The following reply was made to PR optimization/8300; it has been noted by GNATS. From: Andreas Schwab To: Robert Schiele Cc: Richard Henderson , gcc-bugs@gcc.gnu.org, tneumann@pi3.informatik.uni-mannheim.de, gcc-gnats@gcc.gnu.org Subject: Re: optimization/8300: [3.2/3.3/3.4 regression] [sparc] ICE in gen_reg_rtx, at emit-rtl.c:662 Date: Mon, 17 Mar 2003 16:34:38 +0100 Robert Schiele writes: |> On Mon, Mar 17, 2003 at 09:29:37AM -0500, Daniel Jacobowitz wrote: |> > If you have a copy of the standard, it's 6.5.6#8. Once a pointer is |> > adjusted to point outside of the original object it must not be |> > dereferenced. Accessing memory in this way produces undefined |> > behavior. |> |> Ok thanks, found it there. |> |> 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? Ignoring the missing initialisation of b this is undefined under the aliasing rules. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."