This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/5398: -O2&-O3 results in invalid code
- From: ezharkov at yahoo dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 16 Jan 2002 02:06:33 -0000
- Subject: c/5398: -O2&-O3 results in invalid code
- Reply-to: ezharkov at yahoo dot com
>Number: 5398
>Category: c
>Synopsis: -O2&-O3 results in invalid code
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Tue Jan 15 18:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: ezharkov@yahoo.com
>Release: 3.0.2
>Organization:
>Environment:
System: HP-UX acoma B.11.00 A 9000/782 2008121131 two-user license
>Description:
/usr/local/bin/gcc -O2 hpgccbug.c ; ./a.out
produces invalid result
>How-To-Repeat:
#include <stdio.h>
int main (void) {
int i = 0x12345678;
short*s = (short*) &i;
printf ("%x %x\n", s[0], s[1]);
return 0;
}
>Fix:
Do not use -O2 -O3
>Release-Note:
>Audit-Trail:
>Unformatted: