* -O2 in gcc 2.96 buggy?
@ 2002-01-17 12:25 Torsten Weber
2002-01-17 17:01 ` Justin Carlson
2002-01-17 17:34 ` H . J . Lu
0 siblings, 2 replies; 3+ messages in thread
From: Torsten Weber @ 2002-01-17 12:25 UTC (permalink / raw)
To: Linux MIPS
On a RedHat 7.1 installation I compiled gawk (3.1.0), but gawk crashed
(gawk couldn't run glibc-2.2.4/scripts/firstversions.awk, it resulted
in:
> (FILENAME=- FNR=1) fatal error: internal error
> Aborted (core dumped)
)
The gawk problem disappeares if I compile without optimizing with -O2
(i.e. optimizing with -O works).
gcc version is 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1)
Is this problem already known, or where is my mistake?
Thanks.
---------------------------------------------------------------
Torsten Weber Heinrich-Hertz-Institut fuer
E-Mail: t.weber@hhi.de Nachrichtentechnik Berlin GmbH
---------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: -O2 in gcc 2.96 buggy?
2002-01-17 12:25 -O2 in gcc 2.96 buggy? Torsten Weber
@ 2002-01-17 17:01 ` Justin Carlson
2002-01-17 17:34 ` H . J . Lu
1 sibling, 0 replies; 3+ messages in thread
From: Justin Carlson @ 2002-01-17 17:01 UTC (permalink / raw)
To: Torsten Weber; +Cc: Linux MIPS
[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]
On Thu, 2002-01-17 at 07:25, Torsten Weber wrote:
> On a RedHat 7.1 installation I compiled gawk (3.1.0), but gawk crashed
> (gawk couldn't run glibc-2.2.4/scripts/firstversions.awk, it resulted
> in:
> > (FILENAME=- FNR=1) fatal error: internal error
> > Aborted (core dumped)
> )
> The gawk problem disappeares if I compile without optimizing with -O2
> (i.e. optimizing with -O works).
>
> gcc version is 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1)
>
> Is this problem already known, or where is my mistake?
>
Often compiling with -O2 reveals actual bugs in the code of the program,
not the compiler. For example, uninitialized variables can come out
differently depending on optimization level:
#include <stdlib.h>
#include <stdio.h>
int main()
{
int foo;
printf("Foo is %i\n", foo);
return 0;
}
[justinca@gs256 ~]$ gcc -O0 foo.c -o foo
[justinca@gs256 ~]$ ./foo
Foo is -1073743180
[justinca@gs256 ~]$ gcc -O2 foo.c -o foo
[justinca@gs256 ~]$ ./foo
Foo is 1075157696
-Justin
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: -O2 in gcc 2.96 buggy?
2002-01-17 12:25 -O2 in gcc 2.96 buggy? Torsten Weber
2002-01-17 17:01 ` Justin Carlson
@ 2002-01-17 17:34 ` H . J . Lu
1 sibling, 0 replies; 3+ messages in thread
From: H . J . Lu @ 2002-01-17 17:34 UTC (permalink / raw)
To: Torsten Weber; +Cc: Linux MIPS
On Thu, Jan 17, 2002 at 01:25:57PM +0100, Torsten Weber wrote:
> On a RedHat 7.1 installation I compiled gawk (3.1.0), but gawk crashed
> (gawk couldn't run glibc-2.2.4/scripts/firstversions.awk, it resulted
> in:
> > (FILENAME=- FNR=1) fatal error: internal error
> > Aborted (core dumped)
> )
> The gawk problem disappeares if I compile without optimizing with -O2
> (i.e. optimizing with -O works).
>
> gcc version is 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1)
>
> Is this problem already known, or where is my mistake?
I know a kernel bug caused this problem.
H.J.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-01-17 18:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-17 12:25 -O2 in gcc 2.96 buggy? Torsten Weber
2002-01-17 17:01 ` Justin Carlson
2002-01-17 17:34 ` H . J . Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox