This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][match-and-simplify] Fix GENERIC outermost expression type
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Aug 2014 14:14:43 +0200 (CEST)
- Subject: [PATCH][match-and-simplify] Fix GENERIC outermost expression type
- Authentication-results: sourceware.org; auth=none
We shouldn't use the type of the operand but the type requested.
This otherwise triggers asserts for (eq @0 @1) which requires
boolean type, not whatever type @0 has.
Applied.
Richard.
2014-08-19 Richard Biener <rguenther@suse.de>
* genmatch.c (dt_simplify::gen_generic): Properly use the
specified type to generate the outermost expression.
Index: gcc/genmatch.c
===================================================================
--- gcc/genmatch.c (revision 214097)
+++ gcc/genmatch.c (working copy)
@@ -1787,7 +1787,7 @@ dt_simplify::gen_generic (FILE *f)
}
/* Re-fold the toplevel result. */
if (e->operation->op->kind == id_base::CODE)
- fprintf (f, " return fold_build%d (%s, TREE_TYPE (res_op0)",
+ fprintf (f, " return fold_build%d (%s, type",
e->ops.length (), e->operation->op->id);
else
fprintf (f, " return build_call_expr (builtin_decl_implicit (%s), %d",