[Bug c/47370] error: invalid first operand of MEM_REF
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 20 09:20:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47370
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.01.20 08:19:09
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |4.6.0
Ever Confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-20 08:19:09 UTC ---
Tiny bit reduced:
struct S { int s; };
void
foo (void)
{
for (;;)
;
}
struct S
bar (void)
{
struct S s = { 99 };
return s;
}
void
baz (void)
{
struct S s[1];
s[0] = bar ();
bar ();
foo ();
}
Only happens with -m32. My bet is this goes wrong during inlining.
We have
MEM[(struct S *)&<retval>] = s$s_5;
stmt where &RESULT_DECL satisfies is_gimple_mem_ref_addr.
But after inlining this becomes
MEM[(struct S *)&s[0]] = s$s_5;
and ADDR_EXPR of ARRAY_REF is not is_gimple_mem_ref_addr, so I suppose the
inliner needs to fix this up somewhere.
More information about the Gcc-bugs
mailing list