https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83609
Bug ID: 83609 Summary: [8 Regression] ICE in read_complex_part at gcc/expr.c:3202 Product: gcc Version: unknown Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jamborm at gcc dot gnu.org Target Milestone: --- Starting from Martin's r255163 we ICE on: $ cat ice2.ii template <typename> class b; template <> struct b<float> { float c () { return __real__ d; } _Complex float d; }; void e (int, const char *); template <class f> void g () { b<f> h; f *a = (f *) &h; a[0] = a[1] = 6; h.c () ? void() : e (7, __PRETTY_FUNCTION__); } int main () { g<float> (); return 0; } $ g++ -O2 -fno-tree-forwprop -c ice2.ii during RTL pass: expand ice2.ii: In function ‘int main()’: ice2.ii:18:3: internal compiler error: Segmentation fault a[0] = a[1] = 6; ^ 0xdb48af crash_signal ../../gcc/toplev.c:325 0xa6aad0 read_complex_part(rtx_def*, bool) ../../gcc/expr.c:3202 0xa76002 expand_assignment(tree_node*, tree_node*, bool) ../../gcc/expr.c:5155 0x9474c8 expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3681 0x9474c8 expand_gimple_stmt ../../gcc/cfgexpand.c:3779 0x949d17 expand_gimple_basic_block ../../gcc/cfgexpand.c:5796 0x94fa2e execute ../../gcc/cfgexpand.c:6402 Adding -fno-tree-sra also leads to the same revision.