public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
@ 2003-05-16  2:16 Tim McGrath
  2003-05-16  5:43 ` Andreas Jaeger
  2003-05-16  7:35 ` Eric Botcazou
  0 siblings, 2 replies; 7+ messages in thread
From: Tim McGrath @ 2003-05-16  2:16 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 3311 bytes --]

I have been boggled by this problem for a long time, ever since the
prerelease of gcc 3.2.x, I was unable to compile quakeforge cvs with
optimization for my processor, a amd K6-III 400. Back then, as now, the
compiler would bomb out on sv_main.c with the following message:

gcc-3.3 -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include
-I../../qw/include    -g -march=k6-3 -O3 -ffast-math -funroll-loops
-fomit-frame-pointer -fexpensive-optimizations -fstrict-aliasing -pipe
-Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -fno-common -c `test -f 'sv_main.c' || echo
'./'`sv_main.c
{standard input}: Assembler messages:
{standard input}:4434: Error: value of ffffffffffffff7a too large for
field of 1 bytes at 0000000000001c89
make[2]: *** [sv_main.o] Error 1
make[2]: Leaving directory
`/usr/local/src/quakeforge/quakeforge/qw/source'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/quakeforge/quakeforge/qw'
make: *** [all-recursive] Error 1

Note that when I compile for a pentium 1, this problem does not happen
and the game works as expected. I have heard problem reports from other
people who also have experienced the same problem, and they have pentium
4's and athlons.

quakeforge's cvs is here:
:pserver:anonymous@taniwha.2y.net:/var/qfcvs

co the quakeforge module and you'll have the latest code.

First, bootstrap (./bootstrap in the quakeforge dir)
then run configure like this:
CC=gcc-3.3 ./configure --with-servers=qw --without-clients\ 
--with-arch=k6-3 --without-tools

and you'll experience the same problem trying to compile it I am. (I'm
only excluding tools and other things to make the compile run faster. If
you want to, compile the whole blasted thing.)

Note you can use --with-arch to manually change the cpu type you're
compiling for - normally configure would detect I have a pentium 1,
which isn't the case as I have a K6-III.

I have tested, and K6, K6-2, and K6-3 all have the same problem at that
point.

I've only held back on reporting this because I figured it had to be a
problem with either myself, (no) my computer, (no) or the code. As this
compiles just fine with gcc 2.95.3 *and* does so normally without cpu
optimization or with anything lower or equal to a pentium 1, I think
it's a compiler problem.

I don't know how much it will be a help to you, so I have not attached
sv_main.c to this message. If it would benefit you to have that file,
just ask and I'll send it right away.

I am using debian sid (unstable) with gcc -v reporting as such:
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared
--with-system-zlib --enable-nls --without-included-gettext
--enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm
--enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3

apt-cache show gcc-3.3 reports the version number of the package to be
1:3.3-0pre9

I'd love to help you stab this bug, if you can tell me whatever you
need, I'll be sure to send it along.

Timothy C. McGrath

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
  2003-05-16  2:16 gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1 Tim McGrath
@ 2003-05-16  5:43 ` Andreas Jaeger
       [not found]   ` <1053074256.5266.13.camel@roll>
  2003-05-16  7:35 ` Eric Botcazou
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Jaeger @ 2003-05-16  5:43 UTC (permalink / raw)
  To: Tim McGrath; +Cc: gcc

Tim McGrath <misty-@charter.net> writes:

> I have been boggled by this problem for a long time, ever since the
> prerelease of gcc 3.2.x, I was unable to compile quakeforge cvs with
> optimization for my processor, a amd K6-III 400. Back then, as now, the
> compiler would bomb out on sv_main.c with the following message:
>
> gcc-3.3 -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include
> -I../../qw/include    -g -march=k6-3 -O3 -ffast-math -funroll-loops
> -fomit-frame-pointer -fexpensive-optimizations -fstrict-aliasing -pipe
> -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -fno-common -c `test -f 'sv_main.c' || echo
> './'`sv_main.c
> {standard input}: Assembler messages:
> {standard input}:4434: Error: value of ffffffffffffff7a too large for
> field of 1 bytes at 0000000000001c89
> make[2]: *** [sv_main.o] Error 1
> make[2]: Leaving directory
> `/usr/local/src/quakeforge/quakeforge/qw/source'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/src/quakeforge/quakeforge/qw'
> make: *** [all-recursive] Error 1

> [...]
> I'd love to help you stab this bug, if you can tell me whatever you
> need, I'll be sure to send it along.


Please follow the instructions on how to report a bug at
http://gcc.gnu.org/bugs.html by sending a small, self-contained
testcase that reproduces this.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
  2003-05-16  2:16 gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1 Tim McGrath
  2003-05-16  5:43 ` Andreas Jaeger
@ 2003-05-16  7:35 ` Eric Botcazou
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Botcazou @ 2003-05-16  7:35 UTC (permalink / raw)
  To: Tim McGrath; +Cc: gcc

> I'd love to help you stab this bug, if you can tell me whatever you
> need, I'll be sure to send it along.

Add me to the CC line of your entry in the bug database. I thought I had 
definitely fixed these problems in GCC 3.2.3 but it appears that I was 
wrong.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
       [not found]     ` <u8y917nnfv.fsf@gromit.moeb>
@ 2003-05-31 11:35       ` Tim McGrath
  2003-05-31 15:06         ` Eric Botcazou
  0 siblings, 1 reply; 7+ messages in thread
From: Tim McGrath @ 2003-05-31 11:35 UTC (permalink / raw)
  To: gcc


[-- Attachment #1.1: Type: text/plain, Size: 3810 bytes --]

Alright. I've tried every which way I could to narrow down things, but I
really don't know what I'm doing. I have both the .i and .s output of
the file and have played with a bunch of optimization flags, and noticed
interesting things:

OK, just for reference these are the optimization flags used normally
when compiling quakeforge:

-march=k6-3 -O3 -ffast-math -funroll-loops -fomit-frame-pointer
-fexpensive-optimizations -fstrict-aliasing

What I've found is if you do any of the following:

1. Make -march=586 or less (486/386) OR remove entirely
2. make -O3 -O OR remove entirely
3. remove -ffast-math

the assembler does not complain about being given junk and the file
compiles. Note I have not actually tested if the output is correct by
trying to run the resulting program, which I will do if given enough
time *and* told I should do that (I don't like barking at the wrong
tree)

I'm a novice at these things, and I just plain don't have the *time* to
guess in a 2597 line c file what might possibly cause the problem,
especially as my computer is rather slow. :(

If there is anything else I can do, please let me know. I'm especially
curious if you want to see the output of the other combinations that
cause it to fail.

I have attached the bzip2 -9'd .i file resulting from:

gcc -v -save-temps -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../qw/include    -g -march=k6-3 -O3 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -fstrict-aliasing -pipe -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fno-common -c sv_main.c > temp.txt                   gcc: warning: -pipe ignored because -save-temps specified
Reading specs from /usr/lib/gcc-lib/i386-linux/3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.3 (Debian)
 /usr/lib/gcc-lib/i386-linux/3.3/cc1 -E -quiet -v -I. -I. -I../../include -I../../include -I../../qw/include -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -DHAVE_CONFIG_H sv_main.c -march=k6-3 -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -fstrict-aliasing -fno-common -O3 sv_main.i
ignoring nonexistent directory "/usr/i386-linux/include"
ignoring duplicate directory "."
ignoring duplicate directory "../../include"
#include "..." search starts here:
#include <...> search starts here:
 .
 ../../include
 ../../qw/include
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/3.3/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-linux/3.3/cc1 -fpreprocessed sv_main.i -quiet -dumpbase sv_main.c -march=k6-3 -auxbase sv_main -g -O3 -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -version -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -fstrict-aliasing -fno-common -o sv_main.s
GNU C version 3.3 (Debian) (i386-linux)
        compiled by GNU C version 3.3 (Debian).
GGC heuristics: --param ggc-min-expand=51 --param ggc-min-heapsize=40314
 as -V -Qy -o sv_main.o sv_main.s
GNU assembler version 2.14.90.0.2 (i386-linux) using BFD version 2.14.90.0.2 20030515 Debian GNU/Linux
sv_main.s: Assembler messages:
sv_main.s:4451: Error: value of ffffffffffffff7a too large for field of 1 bytes at 0000000000001ca9


[-- Attachment #1.2: sv_main.i.bz2 --]
[-- Type: application/x-bzip, Size: 53996 bytes --]

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
  2003-05-31 11:35       ` Tim McGrath
@ 2003-05-31 15:06         ` Eric Botcazou
  2003-05-31 18:25           ` Tim McGrath
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Botcazou @ 2003-05-31 15:06 UTC (permalink / raw)
  To: Tim McGrath; +Cc: gcc

> What I've found is if you do any of the following:
>
> 1. Make -march=586 or less (486/386) OR remove entirely
> 2. make -O3 -O OR remove entirely
> 3. remove -ffast-math
>
> the assembler does not complain about being given junk and the file
> compiles. Note I have not actually tested if the output is correct by
> trying to run the resulting program, which I will do if given enough
> time *and* told I should do that (I don't like barking at the wrong
> tree)

The bug is triggered only with the -m(cpu|arch)=k6* options because GCC 
doesn't emit the short range 'loop' instructions for any other models of x86 
processors.

> I'm a novice at these things, and I just plain don't have the *time* to
> guess in a 2597 line c file what might possibly cause the problem,
> especially as my computer is rather slow. :(

GCC wrongly estimates the cumulative length of the instructions between the 
'loop' instruction and its target and thinks it can safely emit a short 
range (-128/+127 bytes) 'loop' instructions while the target is out of 
range.

> I have attached the bzip2 -9'd .i file resulting from:

Thanks. I filed PR target/11044 with the GCC bugzilla on your behalf and 
attached your testcase (you can add your e-mail address to the Cc field if 
you want to be informed of the subsequent events, for some reason I wasn't 
able to do that myself).

Note that the testcase is correctly compiled by GCC 3.2.3 (but not by earlier 
GCC 3.2.x releases) because this version already contains several patches 
aimed at fixing this problem.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
  2003-05-31 15:06         ` Eric Botcazou
@ 2003-05-31 18:25           ` Tim McGrath
  2003-05-31 20:43             ` Eric Botcazou
  0 siblings, 1 reply; 7+ messages in thread
From: Tim McGrath @ 2003-05-31 18:25 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc

On Sat, 2003-05-31 at 03:26, Eric Botcazou wrote:
> Thanks. I filed PR target/11044 with the GCC bugzilla on your behalf and 
> attached your testcase (you can add your e-mail address to the Cc field if 
> you want to be informed of the subsequent events, for some reason I wasn't 
> able to do that myself).
> 
> Note that the testcase is correctly compiled by GCC 3.2.3 (but not by earlier 
> GCC 3.2.x releases) because this version already contains several patches 
> aimed at fixing this problem.

Are you absolutely sure? The gcc I was using is Version: 3:3.3-1
according to apt-cache show gcc, and so this bug might have hopped it's
way into 3.3.x without getting fixed. ... Actually, I have just
confirmed this is the case - gcc 3.2.3 in debian is able to compile this
with no errors. Please make the bug go away :)

Also where is the gcc bugzilla so I might add my email to the CC and
such? *confused*

Timothy C. McGrath

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1
  2003-05-31 18:25           ` Tim McGrath
@ 2003-05-31 20:43             ` Eric Botcazou
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Botcazou @ 2003-05-31 20:43 UTC (permalink / raw)
  To: Tim McGrath; +Cc: gcc

> Are you absolutely sure? The gcc I was using is Version: 3:3.3-1
> according to apt-cache show gcc, and so this bug might have hopped it's
> way into 3.3.x without getting fixed. ...

The patches that have been applied to the 3.2.x branch have also been applied 
to the 3.3.x branch. But the code emitted by the two branches may be 
somewhat different, so it seems that remaining problems were uncovered on 
the 3.3 branch but not on the 3.2 branch.

> Actually, I have just confirmed this is the case - gcc 3.2.3 in debian is
> able to compile this with no errors. Please make the bug go away :)

I'll investigate tomorrow.

> Also where is the gcc bugzilla so I might add my email to the CC and
> such?

On the GCC home page, click on "Bug database".

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-05-31 18:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-16  2:16 gcc 3.3 is not able to compile quakeforge cvs with cpu optimization greater than pentium 1 Tim McGrath
2003-05-16  5:43 ` Andreas Jaeger
     [not found]   ` <1053074256.5266.13.camel@roll>
     [not found]     ` <u8y917nnfv.fsf@gromit.moeb>
2003-05-31 11:35       ` Tim McGrath
2003-05-31 15:06         ` Eric Botcazou
2003-05-31 18:25           ` Tim McGrath
2003-05-31 20:43             ` Eric Botcazou
2003-05-16  7:35 ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).