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]

Re: optimization/8300: [3.2/3.3/3.4 regression] [sparc] ICE in gen_reg_rtx, at emit-rtl.c:662


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?

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:rschiele at uni-mannheim dot de

Attachment: pgp00000.pgp
Description: PGP signature


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