This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23155] [4.0/4.1 Regression] Gimplification failed for union cast
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2005 09:20:52 -0000
- Subject: [Bug c/23155] [4.0/4.1 Regression] Gimplification failed for union cast
- References: <20050731041811.23155.dje@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-04 09:20 -------
It's an lvalue-cast, which we no longer support as an extension. So it's ICE on
invalid and a frontend bug. The C++ frontend spits out the interesting error
pr23155.c: In function ?void foo5(int)?:
pr23155.c:7: error: no matching function for call to ?vx::vx(int&)?
pr23155.c:1: note: candidates are: vx::vx()
pr23155.c:1: note: vx::vx(const vx&)
The following get's rejected with what should be done with the original
testcase, too:
union vx {short f[8]; int v;};
int vec;
void bar(short *);
void
foo5 (int vec)
{
bar(((union vx) vec).f);
}
pr23155.c: In function ?foo5?:
pr23155.c:10: error: invalid use of non-lvalue array
--
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c
Keywords|ice-on-valid-code |accepts-invalid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23155