[PATCH][match-and-simplify] Fix lto.exp=20110201-1_0.c ICE

Richard Biener rguenther@suse.de
Fri Sep 12 11:02:00 GMT 2014


Committed.

Richard.

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

	* genmatch.c (expr::gen_transform): Properly autocompute
	type of REALPART_EXPR and IMAGPART_EXPR.

Index: gcc/genmatch.c
===================================================================
--- gcc/genmatch.c	(revision 215210)
+++ gcc/genmatch.c	(working copy)
@@ -898,7 +898,7 @@ expr::gen_transform (FILE *f, const char
 {
   bool conversion_p = is_conversion (operation->op);
   const char *type = expr_type;
-  char optype[20];
+  char optype[64];
   if (type)
     /* If there was a type specification in the pattern use it.  */
     ;
@@ -906,6 +906,15 @@ expr::gen_transform (FILE *f, const char
     /* For conversions we need to build the expression using the
        outer type passed in.  */
     type = in_type;
+  else if (*operation->op == REALPART_EXPR
+	   || *operation->op == IMAGPART_EXPR)
+    {
+      /* __real and __imag use the component type of its operand.  */
+      sprintf (optype, "TREE_TYPE (TREE_TYPE (ops%d[0]))", depth);
+      type = optype;
+      /* Avoid passing in_type / type to operand creation.  */
+      conversion_p = true;
+    }
   else
     {
       /* Other operations are of the same type as their first operand.  */



More information about the Gcc-patches mailing list