optimization/8300: [3.2/3.3/3.4 regression] [sparc] ICE in gen_reg_rtx, at emit-rtl.c:662
Robert Schiele
rschiele@uni-mannheim.de
Mon Mar 17 16:53:00 GMT 2003
On Mon, Mar 17, 2003 at 04:24:34PM +0100, Falk Hueffner wrote:
> Robert Schiele <rschiele@uni-mannheim.de> writes:
>
> > How about this:
> >
> > void a() {
> > double b;
> > int c[2];
> > *((int*)&b) && (c[1] = 0);
> > }
> >
> > Exactly same problem. And this time there is no pointer outside well
> > defined data area. You agree that this sample is legal code?
>
> No, you're violating the rule in 6.5.7 by accessing an object of type
> double with an lvalue of type int.
6.5.7? This one is about bitwise shift operators in
ISO/IEC 9899:1999. There is no bitwise shift operator in my
expression.
lvalue? b is not used as an lvalue here, is it?
Is it generally illegal to do a cast of this type?
Is it just illegal, because double has 8 bytes, where int has 4 on
this platform? In that case change double to float which has also 4
byte. ==> Same problem.
I can't find such a limitation in 6.5.4 Cast operators. Is there such
a limit somewhere?
Additional note: The code compiles fine when the declaration of b has
a volatile qualifier.
Robert
--
Robert Schiele Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker mailto:rschiele@uni-mannheim.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030317/af881bfb/attachment.sig>
More information about the Gcc-bugs
mailing list