public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] make RTL/TREE/IPA dump kind an index
@ 2017-05-09 19:33 Nathan Sidwell
  2017-05-10  9:10 ` Richard Biener
  0 siblings, 1 reply; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-09 19:33 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

Currently, the TDF_foo flags serve 3 purposes:
1) what kind of dump
2) how detailed to print it
3) auxiliary message control

This addresses #1, which currently uses a bit mask of 
TDF_{TREE,RTL,IPA}, of which exactly one must be set.  The patch changes 
things so that these are now an index value (I hesitate to say 
enumeration, because they're still raw ints).  A TDF_KIND(X) accessor 
extracts this value.  (I left the spare bit between the TDF_KIND_MASK 
and TDF_ADDRESS for the moment.)

In addition I added 'TDF_LANG' for language-specific dump control, of 
which -fdump-translation-unit and -fdump-class-hierarchy become.  And 
can also be controlled by -fdump-lang-all. (rather than -fdump-tree-all)

Next move will be to move -fdump-class-hierarchy into a more generic 
structure (and -fdump-translation-unit, if my patch to remove it is not 
accepted).

ok?

nathan
-- 
Nathan Sidwell

[-- Attachment #2: dmp.diff --]
[-- Type: text/x-patch, Size: 6776 bytes --]

2017-05-09  Nathan Sidwell  <nathan@acm.org>

	* dumpfile.h (TDI_lang_all): New.
	(TDF_KIND): New. Renumber others
	(TDF_LANG, TDF_TREE, TDF_RTL, TDF_IPA): Enumerate value, rather
	than bits.
	* dumpfile.c (dump_files): Mark language dumps as TDF_LANG.  add
	lang-all.
	(get_dump_file_name): Adjust suffix generation.
	(dump_enable_all): Use TDF_KIND.
	* doc/invoke.texi (-fdump-lang-all): Document.

Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 247809)
+++ doc/invoke.texi	(working copy)
@@ -543,6 +543,7 @@ Objective-C and Objective-C++ Dialects}.
 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
 -fdump-final-insns@r{[}=@var{file}@r{]}
 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
+-fdump-lang-all @gol
 -fdump-passes @gol
 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
 -fdump-statistics @gol
@@ -12970,6 +12971,10 @@ Dump after function inlining.
 
 @end table
 
+@item -fdump-lang-all
+@opindex fdump-lang-all
+Control the dumping of language-specific information.
+
 @item -fdump-passes
 @opindex fdump-passes
 Print on @file{stderr} the list of optimization passes that are turned
Index: dumpfile.c
===================================================================
--- dumpfile.c	(revision 247809)
+++ dumpfile.c	(working copy)
@@ -57,9 +57,9 @@ static struct dump_file_info dump_files[
    0, 0, 0, 0, 0, false, false},
   {".ipa-clones", "ipa-clones", NULL, NULL, NULL, NULL, NULL, TDF_IPA,
    0, 0, 0, 0, 0, false, false},
-  {".tu", "translation-unit", NULL, NULL, NULL, NULL, NULL, TDF_TREE,
+  {".tu", "translation-unit", NULL, NULL, NULL, NULL, NULL, TDF_LANG,
    0, 0, 0, 0, 1, false, false},
-  {".class", "class-hierarchy", NULL, NULL, NULL, NULL, NULL, TDF_TREE,
+  {".class", "class-hierarchy", NULL, NULL, NULL, NULL, NULL, TDF_LANG,
    0, 0, 0, 0, 2, false, false},
   {".original", "tree-original", NULL, NULL, NULL, NULL, NULL, TDF_TREE,
    0, 0, 0, 0, 3, false, false},
@@ -69,6 +69,8 @@ static struct dump_file_info dump_files[
    0, 0, 0, 0, 5, false, false},
 #define FIRST_AUTO_NUMBERED_DUMP 6
 
+  {NULL, "lang-all", NULL, NULL, NULL, NULL, NULL, TDF_LANG,
+   0, 0, 0, 0, 0, false, false},
   {NULL, "tree-all", NULL, NULL, NULL, NULL, NULL, TDF_TREE,
    0, 0, 0, 0, 0, false, false},
   {NULL, "rtl-all", NULL, NULL, NULL, NULL, NULL, TDF_RTL,
@@ -115,7 +117,7 @@ static const struct dump_option_value_in
   {"missed", MSG_MISSED_OPTIMIZATION},
   {"note", MSG_NOTE},
   {"optall", MSG_ALL},
-  {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
+  {"all", ~(TDF_KIND_MASK | TDF_RAW | TDF_SLIM | TDF_LINENO
 	    | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
 	    | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV
 	    | TDF_GIMPLE)},
@@ -282,15 +284,11 @@ get_dump_file_name (struct dump_file_inf
     dump_id[0] = '\0';
   else
     {
-      char suffix;
-      if (dfi->pflags & TDF_TREE)
-	suffix = 't';
-      else if (dfi->pflags & TDF_IPA)
-	suffix = 'i';
-      else
-	suffix = 'r';
-
-      if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix) < 0)
+      /* LANG, TREE, RTL, IPA.  */
+      char suffix = "ltri"[TDF_KIND (dfi->pflags)];
+      
+      if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix)
+	  < 0)
 	dump_id[0] = '\0';
     }
 
@@ -657,13 +655,13 @@ int
 gcc::dump_manager::
 dump_enable_all (int flags, const char *filename)
 {
-  int ir_dump_type = (flags & (TDF_TREE | TDF_RTL | TDF_IPA));
+  int ir_dump_type = TDF_KIND (flags);
   int n = 0;
   size_t i;
 
   for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
     {
-      if ((dump_files[i].pflags & ir_dump_type))
+      if (TDF_KIND (dump_files[i].pflags) == ir_dump_type)
         {
           const char *old_filename = dump_files[i].pfilename;
           dump_files[i].pstate = -1;
@@ -684,7 +682,7 @@ dump_enable_all (int flags, const char *
 
   for (i = 0; i < m_extra_dump_files_in_use; i++)
     {
-      if ((m_extra_dump_files[i].pflags & ir_dump_type))
+      if (TDF_KIND (m_extra_dump_files[i].pflags) & ir_dump_type)
         {
           const char *old_filename = m_extra_dump_files[i].pfilename;
           m_extra_dump_files[i].pstate = -1;
Index: dumpfile.h
===================================================================
--- dumpfile.h	(revision 247809)
+++ dumpfile.h	(working copy)
@@ -35,6 +35,8 @@ enum tree_dump_index
   TDI_original,			/* dump each function before optimizing it */
   TDI_generic,			/* dump each function after genericizing it */
   TDI_nested,			/* dump each function after unnesting it */
+
+  TDI_lang_all,			/* enable all the language dumps.  */
   TDI_tree_all,                 /* enable all the GENERIC/GIMPLE dumps.  */
   TDI_rtl_all,                  /* enable all the RTL dumps.  */
   TDI_ipa_all,                  /* enable all the IPA dumps.  */
@@ -47,21 +49,25 @@ enum tree_dump_index
    the DUMP_OPTIONS array in dumpfile.c. The TDF_* flags coexist with
    MSG_* flags (for -fopt-info) and the bit values must be chosen to
    allow that.  */
-#define TDF_ADDRESS	(1 << 0)	/* dump node addresses */
-#define TDF_SLIM	(1 << 1)	/* don't go wild following links */
-#define TDF_RAW  	(1 << 2)	/* don't unparse the function */
-#define TDF_DETAILS	(1 << 3)	/* show more detailed info about
+#define TDF_LANG	0	/* is a lang-specific dump.  */
+#define TDF_TREE	1	/* is a tree dump */
+#define TDF_RTL		2	/* is a RTL dump */
+#define TDF_IPA		3	/* is an IPA dump */
+#define TDF_KIND_MASK   3
+#define TDF_KIND(X) ((X) & TDF_KIND_MASK)
+
+#define TDF_ADDRESS	(1 << 3)	/* dump node addresses */
+#define TDF_SLIM	(1 << 4)	/* don't go wild following links */
+#define TDF_RAW  	(1 << 5)	/* don't unparse the function */
+#define TDF_DETAILS	(1 << 6)	/* show more detailed info about
 					   each pass */
-#define TDF_STATS	(1 << 4)	/* dump various statistics about
+#define TDF_STATS	(1 << 7)	/* dump various statistics about
 					   each pass */
-#define TDF_BLOCKS	(1 << 5)	/* display basic block boundaries */
-#define TDF_VOPS	(1 << 6)	/* display virtual operands */
-#define TDF_LINENO	(1 << 7)	/* display statement line numbers */
-#define TDF_UID		(1 << 8)	/* display decl UIDs */
-
-#define TDF_TREE	(1 << 9)	/* is a tree dump */
-#define TDF_RTL		(1 << 10)	/* is a RTL dump */
-#define TDF_IPA		(1 << 11)	/* is an IPA dump */
+#define TDF_BLOCKS	(1 << 8)	/* display basic block boundaries */
+#define TDF_VOPS	(1 << 9)	/* display virtual operands */
+#define TDF_LINENO	(1 << 10)	/* display statement line numbers */
+#define TDF_UID		(1 << 11)	/* display decl UIDs */
+
 #define TDF_STMTADDR	(1 << 12)	/* Address of stmt.  */
 
 #define TDF_GRAPH	(1 << 13)	/* a graph dump is being emitted */

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-09 19:33 [PATCH] make RTL/TREE/IPA dump kind an index Nathan Sidwell
@ 2017-05-10  9:10 ` Richard Biener
  2017-05-10 11:40   ` Nathan Sidwell
  0 siblings, 1 reply; 17+ messages in thread
From: Richard Biener @ 2017-05-10  9:10 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: GCC Patches

On Tue, May 9, 2017 at 9:00 PM, Nathan Sidwell <nathan@acm.org> wrote:
> Currently, the TDF_foo flags serve 3 purposes:
> 1) what kind of dump
> 2) how detailed to print it
> 3) auxiliary message control
>
> This addresses #1, which currently uses a bit mask of TDF_{TREE,RTL,IPA}, of
> which exactly one must be set.  The patch changes things so that these are
> now an index value (I hesitate to say enumeration, because they're still raw
> ints).  A TDF_KIND(X) accessor extracts this value.  (I left the spare bit
> between the TDF_KIND_MASK and TDF_ADDRESS for the moment.)
>
> In addition I added 'TDF_LANG' for language-specific dump control, of which
> -fdump-translation-unit and -fdump-class-hierarchy become.  And can also be
> controlled by -fdump-lang-all. (rather than -fdump-tree-all)
>
> Next move will be to move -fdump-class-hierarchy into a more generic
> structure (and -fdump-translation-unit, if my patch to remove it is not
> accepted).
>
> ok?

   TDI_nested,                  /* dump each function after unnesting it */
+
+  TDI_lang_all,                        /* enable all the language dumps.  */

extra vertical space

+
+#define TDF_ADDRESS    (1 << 3)        /* dump node addresses */

this leaves 1 << 2 unused.

Otherwise looks like a great cleanup.  You might want to coordinate with
Martin a bit here.  It also looks like with this we can start re-using
bits when they are restricted to one TDF_KIND.

Thanks,
Richard.

>
> nathan
> --
> Nathan Sidwell

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-10  9:10 ` Richard Biener
@ 2017-05-10 11:40   ` Nathan Sidwell
  2017-05-11 12:37     ` Rainer Orth
  0 siblings, 1 reply; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-10 11:40 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches

On 05/10/2017 05:05 AM, Richard Biener wrote:
> On Tue, May 9, 2017 at 9:00 PM, Nathan Sidwell <nathan@acm.org> wrote:

> +
> +#define TDF_ADDRESS    (1 << 3)        /* dump node addresses */
> 
> this leaves 1 << 2 unused.

Yes, that was intentional (though I suspect my note about it was 
hidden).  As you say, I expect further cleanup and didn't want 
gratuitous churn.  I'll add a comment about bit 2 being free.

> Otherwise looks like a great cleanup.  You might want to coordinate with
> Martin a bit here.  It also looks like with this we can start re-using
> bits when they are restricted to one TDF_KIND.

Indeed, we coordinated a bit yesterday.  Thanks for review!

nathan

-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-10 11:40   ` Nathan Sidwell
@ 2017-05-11 12:37     ` Rainer Orth
  2017-05-11 12:44       ` Nathan Sidwell
  2017-05-11 13:14       ` Nathan Sidwell
  0 siblings, 2 replies; 17+ messages in thread
From: Rainer Orth @ 2017-05-11 12:37 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: Richard Biener, GCC Patches

Hi Nathan,

> On 05/10/2017 05:05 AM, Richard Biener wrote:
>> On Tue, May 9, 2017 at 9:00 PM, Nathan Sidwell <nathan@acm.org> wrote:
>
>> +
>> +#define TDF_ADDRESS    (1 << 3)        /* dump node addresses */
>>
>> this leaves 1 << 2 unused.
>
> Yes, that was intentional (though I suspect my note about it was hidden).
> As you say, I expect further cleanup and didn't want gratuitous churn.
> I'll add a comment about bit 2 being free.
>
>> Otherwise looks like a great cleanup.  You might want to coordinate with
>> Martin a bit here.  It also looks like with this we can start re-using
>> bits when they are restricted to one TDF_KIND.
>
> Indeed, we coordinated a bit yesterday.  Thanks for review!

it seems your patch caused

UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++11  scan-tree-dump class "24    .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++11  scan-tree-dump class "28    .*c6::f2"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++11  scan-tree-dump class "80    .*0"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++11  scan-tree-dump class "84    .*c6::_ZTv0_n16_NV2c62f2Ev"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++14  scan-tree-dump class "24    .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++14  scan-tree-dump class "28    .*c6::f2"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++14  scan-tree-dump class "80    .*0"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++14  scan-tree-dump class "84    .*c6::_ZTv0_n16_NV2c62f2Ev"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "24    .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "28    .*c6::f2"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "80    .*0"
UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "84    .*c6::_ZTv0_n16_NV2c62f2Ev"

On the gcc-7 branch, the dump file (from -fdump-class-hierarchy) was
called covariant7.C.002t.class, now it's covariant7.C.002l.class.  But
gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the NNNt.<dump>
form.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 12:37     ` Rainer Orth
@ 2017-05-11 12:44       ` Nathan Sidwell
  2017-05-11 13:14       ` Nathan Sidwell
  1 sibling, 0 replies; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-11 12:44 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Richard Biener, GCC Patches

On 05/11/2017 08:28 AM, Rainer Orth wrote:
> Hi Nathan,

> UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "24    .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev"
> UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "28    .*c6::f2"
> UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "80    .*0"
> UNRESOLVED: g++.dg/inherit/covariant7.C  -std=gnu++98  scan-tree-dump class "84    .*c6::_ZTv0_n16_NV2c62f2Ev"
> 
> On the gcc-7 branch, the dump file (from -fdump-class-hierarchy) was
> called covariant7.C.002t.class, now it's covariant7.C.002l.class.  But
> gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the NNNt.<dump>
> form.

oh crap, I checked for new FAILS not UNRESOLVED.  sorry about that.

nathan


-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 12:37     ` Rainer Orth
  2017-05-11 12:44       ` Nathan Sidwell
@ 2017-05-11 13:14       ` Nathan Sidwell
  2017-05-11 22:58         ` Bernhard Reutner-Fischer
  1 sibling, 1 reply; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-11 13:14 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Richard Biener, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

On 05/11/2017 08:28 AM, Rainer Orth wrote:

> On the gcc-7 branch, the dump file (from -fdump-class-hierarchy) was
> called covariant7.C.002t.class, now it's covariant7.C.002l.class.  But
> gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the NNNt.<dump>
> form.

fixed thusly, applied as obvious.

the scan$foo.exp files look like they could benefit from a higher-level 
scandump.exp interface, but that's a cleanup for another day.

nathan

-- 
Nathan Sidwell

[-- Attachment #2: dg.diff --]
[-- Type: text/x-patch, Size: 4207 bytes --]

2017-05-11  Nathan Sidwell  <nathan@acm.org>

	* lib/scanlang.exp: New.
	* lib/gcc-dg.exp: Load scanlang.exp.
	* g++.dg/inherit/covariant7.C: Use scan-lang-dump.

Index: g++.dg/inherit/covariant7.C
===================================================================
--- g++.dg/inherit/covariant7.C	(revision 247902)
+++ g++.dg/inherit/covariant7.C	(working copy)
@@ -36,15 +36,15 @@ struct c6 : c0, c3, c4
 
 // f2 appears four times in the c6 vtables:
 // once in c1-in-c3-in-c6 - covariant, virtual base, uses c1 vcall offset and c0 vbase offset
-// { dg-final { scan-tree-dump "24    .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } }
-// { dg-final { scan-tree-dump "48    .*c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } }
+// { dg-final { scan-lang-dump "24    .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } }
+// { dg-final { scan-lang-dump "48    .*c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } }
 // once in c3-in-c6 - non-covariant, non-virtual base, calls f2 directly
-// { dg-final { scan-tree-dump "28    .*c6::f2" "class" { target ilp32 } } }
-// { dg-final { scan-tree-dump "56    .*c6::f2" "class" { target lp64 } } }
+// { dg-final { scan-lang-dump "28    .*c6::f2" "class" { target ilp32 } } }
+// { dg-final { scan-lang-dump "56    .*c6::f2" "class" { target lp64 } } }
 // once in c1-in-c3-in-c4-in-c6 - lost primary
-// { dg-final { scan-tree-dump "80    .*0" "class" { target ilp32 } } }
-// { dg-final { scan-tree-dump "160   .*0" "class" { target lp64 } } }
+// { dg-final { scan-lang-dump "80    .*0" "class" { target ilp32 } } }
+// { dg-final { scan-lang-dump "160   .*0" "class" { target lp64 } } }
 // once in c3-in-c4-in-c6 - c3 vcall offset
-// { dg-final { scan-tree-dump "84    .*c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } }
-// { dg-final { scan-tree-dump "168   .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } }
+// { dg-final { scan-lang-dump "84    .*c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } }
+// { dg-final { scan-lang-dump "168   .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } }
 
Index: lib/gcc-dg.exp
===================================================================
--- lib/gcc-dg.exp	(revision 247902)
+++ lib/gcc-dg.exp	(working copy)
@@ -22,6 +22,7 @@ load_lib scanasm.exp
 load_lib scanrtl.exp
 load_lib scantree.exp
 load_lib scanipa.exp
+load_lib scanlang.exp
 load_lib timeout.exp
 load_lib timeout-dg.exp
 load_lib prune.exp
Index: lib/scanlang.exp
===================================================================
--- lib/scanlang.exp	(revision 0)
+++ lib/scanlang.exp	(working copy)
@@ -0,0 +1,43 @@
+#   Copyright (C) 2000-2017 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# Various utilities for scanning tree dump output, used by gcc-dg.exp and
+# g++-dg.exp.
+
+load_lib scandump.exp
+
+# Utility for scanning compiler result, invoked via dg-final.
+# Call pass if pattern is present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped lang pass
+# Argument 2 handles expected failures and the like
+proc scan-lang-dump { args } {
+
+    if { [llength $args] < 2 } {
+	error "scan-tree-dump: too few arguments"
+	return
+    }
+    if { [llength $args] > 3 } {
+	error "scan-tree-dump: too many arguments"
+	return
+    }
+    if { [llength $args] >= 3 } {
+	scan-dump "lang" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" [lindex $args 2]
+    } else {
+	scan-dump "lang" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]"
+    }
+}

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 13:14       ` Nathan Sidwell
@ 2017-05-11 22:58         ` Bernhard Reutner-Fischer
  2017-05-11 23:10           ` Rainer Orth
  2017-05-12  0:59           ` Nathan Sidwell
  0 siblings, 2 replies; 17+ messages in thread
From: Bernhard Reutner-Fischer @ 2017-05-11 22:58 UTC (permalink / raw)
  To: gcc-patches, Nathan Sidwell, Rainer Orth; +Cc: Richard Biener, GCC Patches

On 11 May 2017 15:10:36 CEST, Nathan Sidwell <nathan@acm.org> wrote:
>On 05/11/2017 08:28 AM, Rainer Orth wrote:
>
>> On the gcc-7 branch, the dump file (from -fdump-class-hierarchy) was
>> called covariant7.C.002t.class, now it's covariant7.C.002l.class. 
>But
>> gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the
>NNNt.<dump>
>> form.
>
>fixed thusly, applied as obvious.
>
>the scan$foo.exp files look like they could benefit from a higher-level
>
>scandump.exp interface, but that's a cleanup for another day.

Yea and once we can require a recent dejagnu (maybe for gcc-8 finally) we can apply the removal of the load_lib TCL hackery. 

Anyway, please also adjust the dump cleanup to handle class or I can take care of it sometimes later.

Thanks,

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 22:58         ` Bernhard Reutner-Fischer
@ 2017-05-11 23:10           ` Rainer Orth
  2017-05-11 23:18             ` Bernhard Reutner-Fischer
  2017-05-12  0:30             ` Nathan Sidwell
  2017-05-12  0:59           ` Nathan Sidwell
  1 sibling, 2 replies; 17+ messages in thread
From: Rainer Orth @ 2017-05-11 23:10 UTC (permalink / raw)
  To: Bernhard Reutner-Fischer; +Cc: gcc-patches, Nathan Sidwell, Richard Biener

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:

> On 11 May 2017 15:10:36 CEST, Nathan Sidwell <nathan@acm.org> wrote:
>>On 05/11/2017 08:28 AM, Rainer Orth wrote:
>>
>>> On the gcc-7 branch, the dump file (from -fdump-class-hierarchy) was
>>> called covariant7.C.002t.class, now it's covariant7.C.002l.class. 
>>But
>>> gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the
>>NNNt.<dump>
>>> form.
>>
>>fixed thusly, applied as obvious.
>>
>>the scan$foo.exp files look like they could benefit from a higher-level
>>
>>scandump.exp interface, but that's a cleanup for another day.
>
> Yea and once we can require a recent dejagnu (maybe for gcc-8 finally) we
> can apply the removal of the load_lib TCL hackery.

However, the introduction of scanlang.exp broke libatomic, libgomp, and
libitm testing.  Their logfiles show

trunk/12-gcc/build/sparc-sun-solaris2.12/libatomic/testsuite/libatomic.log:ERROR: Couldn't find library file scanlang.exp.
trunk/12-gcc/build/sparc-sun-solaris2.12/libgomp/testsuite/libgomp.log:ERROR: Couldn't find library file scanlang.exp.
trunk/12-gcc/build/sparc-sun-solaris2.12/libitm/testsuite/libitm.log:ERROR: Couldn't find library file scanlang.exp.

and the testsuites aren't run.  The following patch fixes this (manually
tested on libatomic and libitm so far).

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: scanlang-lib.patch --]
[-- Type: text/x-patch, Size: 1227 bytes --]

diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -34,6 +34,7 @@ load_gcc_lib target-utils.exp
 load_gcc_lib target-supports-dg.exp
 load_gcc_lib scanasm.exp
 load_gcc_lib scandump.exp
+load_gcc_lib scanlang.exp
 load_gcc_lib scanrtl.exp
 load_gcc_lib scantree.exp
 load_gcc_lib scanipa.exp
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -26,6 +26,7 @@ load_gcc_lib file-format.exp
 load_gcc_lib target-supports-dg.exp
 load_gcc_lib scanasm.exp
 load_gcc_lib scandump.exp
+load_gcc_lib scanlang.exp
 load_gcc_lib scanrtl.exp
 load_gcc_lib scantree.exp
 load_gcc_lib scanipa.exp
diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
--- a/libitm/testsuite/lib/libitm.exp
+++ b/libitm/testsuite/lib/libitm.exp
@@ -40,6 +40,7 @@ load_gcc_lib file-format.exp
 load_gcc_lib target-supports-dg.exp
 load_gcc_lib scanasm.exp
 load_gcc_lib scandump.exp
+load_gcc_lib scanlang.exp
 load_gcc_lib scanrtl.exp
 load_gcc_lib scantree.exp
 load_gcc_lib scanipa.exp

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 23:10           ` Rainer Orth
@ 2017-05-11 23:18             ` Bernhard Reutner-Fischer
  2017-05-13  8:49               ` Bernhard Reutner-Fischer
  2017-05-12  0:30             ` Nathan Sidwell
  1 sibling, 1 reply; 17+ messages in thread
From: Bernhard Reutner-Fischer @ 2017-05-11 23:18 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Nathan Sidwell, Richard Biener

On 12 May 2017 00:57:58 CEST, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>
>> On 11 May 2017 15:10:36 CEST, Nathan Sidwell <nathan@acm.org> wrote:
>>>On 05/11/2017 08:28 AM, Rainer Orth wrote:
>>>
>>>> On the gcc-7 branch, the dump file (from -fdump-class-hierarchy)
>was
>>>> called covariant7.C.002t.class, now it's covariant7.C.002l.class. 
>>>But
>>>> gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the
>>>NNNt.<dump>
>>>> form.
>>>
>>>fixed thusly, applied as obvious.
>>>
>>>the scan$foo.exp files look like they could benefit from a
>higher-level
>>>
>>>scandump.exp interface, but that's a cleanup for another day.
>>
>> Yea and once we can require a recent dejagnu (maybe for gcc-8
>finally) we
>> can apply the removal of the load_lib TCL hackery.

I meant handling the "l" class of dumps along the lines of t, i, r of existing dump files.

>However, the introduction of scanlang.exp broke libatomic, libgomp, and
>libitm testing.  Their logfiles show

Indeed I remember. I don't remember offhand if the search_dirs fix up in dejagnu allowed to reduce this mess but I think it did.
Oh well.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 23:10           ` Rainer Orth
  2017-05-11 23:18             ` Bernhard Reutner-Fischer
@ 2017-05-12  0:30             ` Nathan Sidwell
  2017-05-12  9:24               ` Rainer Orth
  1 sibling, 1 reply; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-12  0:30 UTC (permalink / raw)
  To: Rainer Orth, Bernhard Reutner-Fischer; +Cc: gcc-patches, Richard Biener

On 05/11/2017 06:57 PM, Rainer Orth wrote:
er, the introduction of scanlang.exp broke libatomic, libgomp, and
> libitm testing.  Their logfiles show
>
> trunk/12-gcc/build/sparc-sun-solaris2.12/libatomic/testsuite/libatomic.log:ERROR: Couldn't find library file scanlang.exp.
> trunk/12-gcc/build/sparc-sun-solaris2.12/libgomp/testsuite/libgomp.log:ERROR: Couldn't find library file scanlang.exp.
> trunk/12-gcc/build/sparc-sun-solaris2.12/libitm/testsuite/libitm.log:ERROR: Couldn't find library file scanlang.exp.
>
> and the testsuites aren't run.  The following patch fixes this (manually
> tested on libatomic and libitm so far).

Thanks Rainer!


-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 22:58         ` Bernhard Reutner-Fischer
  2017-05-11 23:10           ` Rainer Orth
@ 2017-05-12  0:59           ` Nathan Sidwell
  2017-05-12  6:11             ` Bernhard Reutner-Fischer
  1 sibling, 1 reply; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-12  0:59 UTC (permalink / raw)
  To: Bernhard Reutner-Fischer, gcc-patches, Rainer Orth; +Cc: Richard Biener

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

On 05/11/2017 06:52 PM, Bernhard Reutner-Fischer wrote:
> On 11 May 2017 15:10:36 CEST, Nathan Sidwell <nathan@acm.org> wrote:

> Anyway, please also adjust the dump cleanup to handle class or I can take care of it sometimes later.

Applied this, which seems to do the trick.

nathan


-- 
Nathan Sidwell

[-- Attachment #2: cln.diff --]
[-- Type: text/plain, Size: 678 bytes --]

2017-05-11  Nathan Sidwell  <nathan@acm.org>

	* lib/gcc-dg.exp (schedule-cleanups): Add lang dump capability.

Index: lib/gcc-dg.exp
===================================================================
--- lib/gcc-dg.exp	(revision 247936)
+++ lib/gcc-dg.exp	(working copy)
@@ -158,8 +158,8 @@ proc schedule-cleanups { opts } {
     }
     # Finally see if there are any dumps in opts, otherwise we are done
     if [regexp -- {(?=(?:^|[ \t]+)?)-fdump-[^ \t]+(?=(?:$|[ \t]+)?)} $opts] {
-        # Ipa, Rtl, Tree for simplicity
-        set ptn "{i,r,t}"
+        # Lang, Ipa, Rtl, Tree for simplicity
+        set ptn "{l,i,r,t}"
     } else {
         return $finalcode
     }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-12  0:59           ` Nathan Sidwell
@ 2017-05-12  6:11             ` Bernhard Reutner-Fischer
  0 siblings, 0 replies; 17+ messages in thread
From: Bernhard Reutner-Fischer @ 2017-05-12  6:11 UTC (permalink / raw)
  To: Nathan Sidwell, gcc-patches, Rainer Orth; +Cc: Richard Biener

On 12 May 2017 02:29:58 CEST, Nathan Sidwell <nathan@acm.org> wrote:
>On 05/11/2017 06:52 PM, Bernhard Reutner-Fischer wrote:
>> On 11 May 2017 15:10:36 CEST, Nathan Sidwell <nathan@acm.org> wrote:
>
>> Anyway, please also adjust the dump cleanup to handle class or I can
>take care of it sometimes later.
>
>Applied this, which seems to do the trick.

Exactly, thanks!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-12  0:30             ` Nathan Sidwell
@ 2017-05-12  9:24               ` Rainer Orth
  0 siblings, 0 replies; 17+ messages in thread
From: Rainer Orth @ 2017-05-12  9:24 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: Bernhard Reutner-Fischer, gcc-patches, Richard Biener

Hi Nathan,

> On 05/11/2017 06:57 PM, Rainer Orth wrote:
> er, the introduction of scanlang.exp broke libatomic, libgomp, and
>> libitm testing.  Their logfiles show
>>
>> trunk/12-gcc/build/sparc-sun-solaris2.12/libatomic/testsuite/libatomic.log:ERROR:
>> Couldn't find library file scanlang.exp.
>> trunk/12-gcc/build/sparc-sun-solaris2.12/libgomp/testsuite/libgomp.log:ERROR:
>> Couldn't find library file scanlang.exp.
>> trunk/12-gcc/build/sparc-sun-solaris2.12/libitm/testsuite/libitm.log:ERROR:
>> Couldn't find library file scanlang.exp.
>>
>> and the testsuites aren't run.  The following patch fixes this (manually
>> tested on libatomic and libitm so far).
>
> Thanks Rainer!

I've now installed the patch with the following ChangeLog entry after
libgomp testing finished:

2017-05-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libitm:
	* testsuite/lib/libitm.exp: Load scanlang.exp.

	libgomp:
	* testsuite/lib/libgomp.exp: Load scanlang.exp.

	libatomic:
	* testsuite/lib/libatomic.exp: Load scanlang.exp.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-11 23:18             ` Bernhard Reutner-Fischer
@ 2017-05-13  8:49               ` Bernhard Reutner-Fischer
  2017-05-14  7:20                 ` Nathan Sidwell
  0 siblings, 1 reply; 17+ messages in thread
From: Bernhard Reutner-Fischer @ 2017-05-13  8:49 UTC (permalink / raw)
  To: Rainer Orth, mikestump; +Cc: gcc-patches, Nathan Sidwell, Richard Biener

On 12 May 2017 01:10:19 CEST, Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> wrote:
>On 12 May 2017 00:57:58 CEST, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>wrote:
>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>
>>> On 11 May 2017 15:10:36 CEST, Nathan Sidwell <nathan@acm.org> wrote:
>>>>On 05/11/2017 08:28 AM, Rainer Orth wrote:
>>>>
>>>>> On the gcc-7 branch, the dump file (from -fdump-class-hierarchy)
>>was
>>>>> called covariant7.C.002t.class, now it's covariant7.C.002l.class. 
>>>>But
>>>>> gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the
>>>>NNNt.<dump>
>>>>> form.
>>>>
>>>>fixed thusly, applied as obvious.
>>>>
>>>>the scan$foo.exp files look like they could benefit from a
>>higher-level
>>>>
>>>>scandump.exp interface, but that's a cleanup for another day.
>>>
>>> Yea and once we can require a recent dejagnu (maybe for gcc-8
>>finally) we
>>> can apply the removal of the load_lib TCL hackery.


>>However, the introduction of scanlang.exp broke libatomic, libgomp,
>and
>>libitm testing.  Their logfiles show
>
>Indeed I remember. I don't remember offhand if the search_dirs fix up
>in dejagnu allowed to reduce this mess but I think it did.
>Oh well.

Specifically
https://gcc.gnu.org/ml/fortran/2012-03/msg00094.html

dejagnu-1.5.2 contains the libdirs tweak and was released 2015-01-30

Mike,  can we please bump the required dejagnu version for GCC-8?
Thanks 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-13  8:49               ` Bernhard Reutner-Fischer
@ 2017-05-14  7:20                 ` Nathan Sidwell
  2017-05-17 12:25                   ` Richard Biener
  0 siblings, 1 reply; 17+ messages in thread
From: Nathan Sidwell @ 2017-05-14  7:20 UTC (permalink / raw)
  To: Bernhard Reutner-Fischer, Rainer Orth, mikestump
  Cc: gcc-patches, Richard Biener

On 05/13/2017 03:58 AM, Bernhard Reutner-Fischer wrote:

> Specifically
> https://gcc.gnu.org/ml/fortran/2012-03/msg00094.html
>
> dejagnu-1.5.2 contains the libdirs tweak and was released 2015-01-30
>
> Mike,  can we please bump the required dejagnu version for GCC-8?
> Thanks

There's also the version of TCL. My recent attempt to use an 8.5 feature killed 
some build systems.  install.texi doesn't seem to specify a minimum version, 
just '8.6 is bad, don't use it'

nathan


-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
  2017-05-14  7:20                 ` Nathan Sidwell
@ 2017-05-17 12:25                   ` Richard Biener
  0 siblings, 0 replies; 17+ messages in thread
From: Richard Biener @ 2017-05-17 12:25 UTC (permalink / raw)
  To: Nathan Sidwell
  Cc: Bernhard Reutner-Fischer, Rainer Orth, Mike Stump, GCC Patches

On Sun, May 14, 2017 at 3:57 AM, Nathan Sidwell <nathan@acm.org> wrote:
> On 05/13/2017 03:58 AM, Bernhard Reutner-Fischer wrote:
>
>> Specifically
>> https://gcc.gnu.org/ml/fortran/2012-03/msg00094.html
>>
>> dejagnu-1.5.2 contains the libdirs tweak and was released 2015-01-30
>>
>> Mike,  can we please bump the required dejagnu version for GCC-8?
>> Thanks
>
>
> There's also the version of TCL. My recent attempt to use an 8.5 feature
> killed some build systems.  install.texi doesn't seem to specify a minimum
> version, just '8.6 is bad, don't use it'

SLES11 already has 8.5.5, so I'm fine specifying a minimal version of 8.5.x

Richard.

> nathan
>
>
> --
> Nathan Sidwell

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] make RTL/TREE/IPA dump kind an index
@ 2017-05-11 13:49 Uros Bizjak
  0 siblings, 0 replies; 17+ messages in thread
From: Uros Bizjak @ 2017-05-11 13:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nathan Sidwell

Hello!

> Currently, the TDF_foo flags serve 3 purposes:
> 1) what kind of dump
> 2) how detailed to print it
> 3) auxiliary message control

"-da" option now dumps all IPA dumps in addition to RTL dumps. Can
this behavior be reverted, so "-da" will dump only RTL dumps, as it
was before your patch?

Uros.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-05-17 12:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 19:33 [PATCH] make RTL/TREE/IPA dump kind an index Nathan Sidwell
2017-05-10  9:10 ` Richard Biener
2017-05-10 11:40   ` Nathan Sidwell
2017-05-11 12:37     ` Rainer Orth
2017-05-11 12:44       ` Nathan Sidwell
2017-05-11 13:14       ` Nathan Sidwell
2017-05-11 22:58         ` Bernhard Reutner-Fischer
2017-05-11 23:10           ` Rainer Orth
2017-05-11 23:18             ` Bernhard Reutner-Fischer
2017-05-13  8:49               ` Bernhard Reutner-Fischer
2017-05-14  7:20                 ` Nathan Sidwell
2017-05-17 12:25                   ` Richard Biener
2017-05-12  0:30             ` Nathan Sidwell
2017-05-12  9:24               ` Rainer Orth
2017-05-12  0:59           ` Nathan Sidwell
2017-05-12  6:11             ` Bernhard Reutner-Fischer
2017-05-11 13:49 Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).