typedef struct { int r, i; } F; F foo (float _Complex x) { return *(F *) &x; } F bar (float _Complex x) { F f = foo (x); return f; } ICEs at -O2 -fno-strict-aliasing -m32 on x86_64-linux and i686-linux. On the trunk this doesn't ICE likely due to expand on SSA.
Since PR6177 that part of expand_expr* at least handles whole CONCAT, but as can be seen on this testcase, since VCE can be used, it should be probably handled fully. On this testcase it could be handled just by giving one part of the CONCAT, but e.g. on: typedef struct { char a, b, c, d, e, f, g, h; } F; F foo (float _Complex x) { return *(F *) &x; } int bar (float _Complex x) { F f = foo (x); return f.b; } I'm afraid it just needs to store it into memory.
Subject: Bug 41123 Author: jakub Date: Wed Aug 19 22:51:20 2009 New Revision: 150946 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150946 Log: PR middle-end/41123 * expr.c (expand_expr_real_1) <normal_inner_ref>: Handle all kinds of CONCAT, not just bitpos 0 bitsize size of the whole CONCAT. * gcc.dg/pr41123.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr41123.c Modified: trunk/gcc/ChangeLog trunk/gcc/expr.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 41123 Author: jakub Date: Wed Aug 19 22:52:11 2009 New Revision: 150947 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150947 Log: PR middle-end/41123 * expr.c (expand_expr_real_1) <normal_inner_ref>: Handle all kinds of CONCAT, not just bitpos 0 bitsize size of the whole CONCAT. * gcc.dg/pr41123.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41123.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/expr.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed.