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][match-and-simplify] Fix GENERIC outermost expression type


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",


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