This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][match-and-simplify] Fix bootstrap
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Jul 2014 11:47:41 +0200 (CEST)
- Subject: [PATCH][match-and-simplify] Fix bootstrap
- Authentication-results: sourceware.org; auth=none
GENERIC code-path checking TREE_SIDE_EFFECTS ICEs on NULL ops
(obviously). Guard against that.
Bootstrapped on x86_64-unknown-linux-gnu, applied.
Richard.
2014-07-15 Richard Biener <rguenther@suse.de>
* genmatch.c (decision_tree::gen_generic): Guard against
NULL_TREE operands.
Index: genmatch.c
===================================================================
--- genmatch.c (revision 212545)
+++ genmatch.c (working copy)
@@ -1614,9 +1614,9 @@ decision_tree::gen_generic (FILE *f)
principle we can do that automagically for a subset of
transforms (and only reject the remaining cases).
This fixes for example gcc.c-torture/execute/20050131-1.c. */
- fprintf (f, "if (TREE_SIDE_EFFECTS (op0)");
+ fprintf (f, "if ((op0 && TREE_SIDE_EFFECTS (op0))");
for (unsigned i = 1; i < n; ++i)
- fprintf (f, "|| TREE_SIDE_EFFECTS (op%d)", i);
+ fprintf (f, "|| (op%d && TREE_SIDE_EFFECTS (op%d))", i, i);
fprintf (f, ")\n"
" return NULL_TREE;\n");