This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/23155] [4.0/4.1 Regression] Gimplification failed for union cast


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]