This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Adjust verify stmts printing, add function param type dumping


This prints the bogus statement if verify_stmts fails in addition to
the bogus sub-tree.  It also adjust function body dumping to dump
function parameter types.

Bootstrapped and tested on x86_64-unknown-linux-gnu.  I'll wait for
comments before committing.

Richard.

2008-04-06  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (verify_stmt): Print complete bogus stmt.
	(dump_function_to_file): Dump function arguments with types.

	* gfortran.dg/bind_c_usage_14.f03: Adjust.

Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 133961)
+++ tree-cfg.c	(working copy)
@@ -4181,6 +4181,11 @@ verify_stmt (tree stmt, bool last_in_blo
   if (addr)
     {
       debug_generic_stmt (addr);
+      if (addr != stmt)
+	{
+	  inform ("in statement");
+	  debug_generic_stmt (stmt);
+	}
       return true;
     }
 
@@ -6130,6 +6135,8 @@ dump_function_to_file (tree fn, FILE *fi
   arg = DECL_ARGUMENTS (fn);
   while (arg)
     {
+      print_generic_expr (file, TREE_TYPE (arg), dump_flags);
+      fprintf (file, " ");
       print_generic_expr (file, arg, dump_flags);
       if (TREE_CHAIN (arg))
 	fprintf (file, ", ");
Index: testsuite/gfortran.dg/bind_c_usage_14.f03
===================================================================
--- testsuite/gfortran.dg/bind_c_usage_14.f03	(revision 133961)
+++ testsuite/gfortran.dg/bind_c_usage_14.f03	(working copy)
@@ -81,24 +81,24 @@ end subroutine sub6NoIso
 ! The subroutines (including entry) should have
 ! only a char-length parameter if they are not bind(C).
 !
-! { dg-final { scan-tree-dump "sub1noiso .a, b, _a, _b\\)" "original" } }
-! { dg-final { scan-tree-dump "sub2 .a, b\\)" "original" } }
-! { dg-final { scan-tree-dump "sub3noiso .a, b, _a, _b\\)" "original" } }
-! { dg-final { scan-tree-dump "sub3noisoentry .x, y, z, _x, _z\\)" "original" } }
-! { dg-final { scan-tree-dump "sub4iso .a, b\\)" "original" } }
-! { dg-final { scan-tree-dump "sub4isoentry .x, y, z, _x, _z\\)" "original" } }
-! { dg-final { scan-tree-dump "sub5iso .a, b\\)" "original" } }
-! { dg-final { scan-tree-dump "sub5noisoentry .x, y, z, _x, _z\\)" "original" } }
-! { dg-final { scan-tree-dump "sub6noiso .a, b, _a, _b\\)" "original" } }
-! { dg-final { scan-tree-dump "sub6isoentry .x, y, z, _x, _z\\)" "original" } }
+! { dg-final { scan-tree-dump "sub1noiso \\(\[^.\]*a, \[^.\]*b, \[^.\]*_a, \[^.\]*_b\\)" "original" } }
+! { dg-final { scan-tree-dump "sub2 \\(\[^.\]*a, \[^.\]*b\\)" "original" } }
+! { dg-final { scan-tree-dump "sub3noiso \\(\[^.\]*a, \[^.\]*b, \[^.\]*_a, \[^.\]*_b\\)" "original" } }
+! { dg-final { scan-tree-dump "sub3noisoentry \\(\[^.\]*x, \[^.\]*y, \[^.\]*z, \[^.\]*_x, \[^.\]*_z\\)" "original" } }
+! { dg-final { scan-tree-dump "sub4iso \\(\[^.\]*a, \[^.\]*b\\)" "original" } }
+! { dg-final { scan-tree-dump "sub4isoentry \\(\[^.\]*x, \[^.\]*y, \[^.\]*z, \[^.\]*_x, \[^.\]*_z\\)" "original" } }
+! { dg-final { scan-tree-dump "sub5iso \\(\[^.\]*a, \[^.\]*b\\)" "original" } }
+! { dg-final { scan-tree-dump "sub5noisoentry \\(\[^.\]*x, \[^.\]*y, \[^.\]*z, \[^.\]*_x, \[^.\]*_z\\)" "original" } }
+! { dg-final { scan-tree-dump "sub6noiso \\(\[^.\]*a, \[^.\]*b, \[^.\]*_a, \[^.\]*_b\\)" "original" } }
+! { dg-final { scan-tree-dump "sub6isoentry \\(\[^.\]*x, \[^.\]*y, \[^.\]*z, \[^.\]*_x, \[^.\]*_z\\)" "original" } }
 
 ! The master functions should have always a length parameter
 ! to ensure sharing a parameter between bind(C) and non-bind(C) works
 !
-! { dg-final { scan-tree-dump "master.0.sub3noiso .__entry, z, y, x, b, a, _z, _x, _b, _a\\)" "original" } }
-! { dg-final { scan-tree-dump "master.1.sub4iso .__entry, z, y, x, b, a, _z, _x, _b, _a\\)" "original" } }
-! { dg-final { scan-tree-dump "master.2.sub5iso .__entry, z, y, x, b, a, _z, _x, _b, _a\\)" "original" } }
-! { dg-final { scan-tree-dump "master.3.sub6noiso .__entry, z, y, x, b, a, _z, _x, _b, _a\\)" "original" } }
+! { dg-final { scan-tree-dump "master.0.sub3noiso \\(\[^.\]*__entry, \[^.\]*z, \[^.\]*y, \[^.\]*x, \[^.\]*b, \[^.\]*a, \[^.\]*_z, \[^.\]*_x, \[^.\]*_b, \[^.\]*_a\\)" "original" } }
+! { dg-final { scan-tree-dump "master.1.sub4iso \\(\[^.\]*__entry, \[^.\]*z, \[^.\]*y, \[^.\]*x, \[^.\]*b, \[^.\]*a, \[^.\]*_z, \[^.\]*_x, \[^.\]*_b, \[^.\]*_a\\)" "original" } }
+! { dg-final { scan-tree-dump "master.2.sub5iso \\(\[^.\]*__entry, \[^.\]*z, \[^.\]*y, \[^.\]*x, \[^.\]*b, \[^.\]*a, \[^.\]*_z, \[^.\]*_x, \[^.\]*_b, \[^.\]*_a\\)" "original" } }
+! { dg-final { scan-tree-dump "master.3.sub6noiso \\(\[^.\]*__entry, \[^.\]*z, \[^.\]*y, \[^.\]*x, \[^.\]*b, \[^.\]*a, \[^.\]*_z, \[^.\]*_x, \[^.\]*_b, \[^.\]*_a\\)" "original" } }
 
 ! Thus, the master functions need to be called with length arguments
 ! present


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]