This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/60452] [4.8/4.9 Regression] wrong code at -O1 on x86_64-linux-gnu (affecting trunk and 4.8.x)
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 22 Mar 2014 13:53:29 +0000
- Subject: [Bug rtl-optimization/60452] [4.8/4.9 Regression] wrong code at -O1 on x86_64-linux-gnu (affecting trunk and 4.8.x)
- Auto-submitted: auto-generated
- References: <bug-60452-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60452
--- Comment #12 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This also happens for regular objects on stack, i.e. with a MEM_EXPR:
int a;
int
main (void)
{
char e[3] = { 0, 0, 0 }, f = 0;
if (a == 131072)
f = e[a];
return f;
}
But I think that using MEM_OFFSET would be too conservative as well, for
example if the MEM_EXPR is a structure with a flexible array member. So I
think that we should go for something based on the real offset from SFP/HPF/SP
and the value of get_frame_size plus some bias, even if there might be a gap
with the actual end of the frame, that doesn't really matter.