This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][match-and-simplify] Fix lto.exp=20110201-1_0.c ICE
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Sep 2014 12:58:44 +0200 (CEST)
- Subject: [PATCH][match-and-simplify] Fix lto.exp=20110201-1_0.c ICE
- Authentication-results: sourceware.org; auth=none
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. */