This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47370] error: invalid first operand of MEM_REF
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Jan 2011 08:19:11 +0000
- Subject: [Bug c/47370] error: invalid first operand of MEM_REF
- Auto-submitted: auto-generated
- References: <bug-47370-4@http.gcc.gnu.org/bugzilla/>
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.