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]

Re: [PATCH] Fix PR tree-opt/18067, ICE because no SAVE_EXPR



On Dec 19, 2004, at 2:31 AM, Richard Henderson wrote:


On Sun, Dec 19, 2004 at 12:49:56AM -0500, Andrew Pinski wrote:
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.

Or, rather, that we have a tree sharing problem between types and the gimplifier.


This patch just removes the constraint of adding a SAVE_EXPR
on a read-only object.

For other reasons (mostly to do with looking at the duplicate expressions created by using a variable sized type multiple times, and across nested functions), I suggest instead changing variable_size to forcibly create a SAVE_EXPR. Something like this.


That seems like a better idea and fixes the regression also.

Thanks,
Andrew Pinski


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