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] Fix PR tree-opt/18067, ICE because no SAVE_EXPR


Take the following testcase:
void foo(int i)
{
    const int j=i+1;
    int a[1][j*j];
}

When we compile this we don't add a SAVE_EXPR around the multiply as
the expression is considered read only, this causes us to keep the
SSA_NAME inside the type expression around even after out of SSA because
out of SSA does not look inside type expressions. This patch just removes
the constraint of adding a SAVE_EXPR on a read-only object.


OK? Bootstrapped and tested on powerpc-darwin with no regression.

Thanks,
Andrew Pinski

Testcase:

/* { dg-do compile } */
/* { dg-options "-O2 -gdwarf-2" } */

void foo(int i)
{
    const int j=i+1;
    int a[1][j*j];
}

ChangeLog:
	* tree.c (save_expr): Do create a save expression for a read-only
	node also.


Patch:

Attachment: fixPR18067.diff.txt
Description: Text document


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