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] Fix placement of break stmt in genmatch generated files


This fixes an error I introduced by

2014-11-09  Richard Biener  <rguenther@suse.de>

        * match.pd: Add patterns convering two conversions in a row
        from fold-const.c.
        * fold-const.c (fold_unary_loc): Remove them here.
        * tree-ssa-forwprop.c (combine_conversions): Likewise.
        * genmatch.c (dt_node::gen_kids): Check whether we may
        follow SSA use-def chains.

where I avoided an extra {} nesting but failed to move the break
stmt out of the conditional block.  This results in unwanted fallthrus
(non-fatal for the patterns currently in trunk match.pd).

Bootstrapped & tested on x86_64-unknown-linux-gnu, applied.

Richard.

2014-11-13  Richard Biener  <rguenther@suse.de>

	* genmatch.c (dt_node::gen_kids): Fix placement of break statement.

Index: gcc/genmatch.c
===================================================================
--- gcc/genmatch.c	(revision 217465)
+++ gcc/genmatch.c	(working copy)
@@ -2124,8 +2124,8 @@ dt_node::gen_kids (FILE *f, bool gimple)
 		   "}\n");
 	}
 
-      fprintf (f, "break;\n"
-	       "}\n");
+      fprintf (f, "}\n"
+	       "break;\n");
     }
 
   for (unsigned i = 0; i < generic_exprs.length (); ++i)


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