Bug 45571 - [4.6 Regression] ICE: verify_stmts failed: Invalid address operand in MEM_REF. on invalid C++ code
Summary: [4.6 Regression] ICE: verify_stmts failed: Invalid address operand in MEM_REF...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 minor
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-07 00:12 UTC by Zdenek Sojka
Modified: 2010-09-07 11:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-09-07 08:37:30


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-09-07 00:12:14 UTC
Compiler output:
$ gcc testcase.C        
testcase.C:7:18: error: expected primary-expression before ')' token
testcase.C: In function 'void __static_initialization_and_destruction_0(int, int)':
testcase.C:8:19: error: Invalid first operand of MEM_REF.
<<< error >>>
testcase.C:8:18: note: in statement
s = MEM[(const struct S &)<<< error >>>];

testcase.C:8:19: error: Invalid address operand in MEM_REF.
MEM[(const struct S &)<<< error >>>];

s = MEM[(const struct S &)<<< error >>>];

testcase.C:8:19: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

----- testcase.C -----
struct S
{
  S & m ();
  int *p;
};

S foo (int, int =);
S s = foo (0).m ();
----------------------

Tested revisions:
r163921 - crash
r161659 - crash
r161170 - OK
Comment 1 Richard Biener 2010-09-07 08:37:29 UTC
I'll have a look.
Comment 2 Richard Biener 2010-09-07 11:17:52 UTC
Fixed.