Bug 34007 - [4.2 Regression] "Error: Branch out of range" compiling fold-const.c in stage 1
Summary: [4.2 Regression] "Error: Branch out of range" compiling fold-const.c in stage 1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: 4.2.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-06 16:59 UTC by Martin Michlmayr
Modified: 2007-11-06 21:31 UTC (History)
3 users (show)

See Also:
Host:
Target: mips-linux-gnu
Build:
Known to work: 4.1.0 4.3.0
Known to fail: 4.2.1
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2007-11-06 16:59:08 UTC
Bootstrap is broken on mips-linux because binutils shows "Error: Branch out
of range" while compiling fold-const.c.  This happens during stage 1.

Revisions 129937 and 129900 fail.  I was able to bootstrap on 20071030
(revision 127646).  My binutils is 2.18.1~cvs20071027-1 (2.18 branch from
October 27).

(sid)tbm@appdev:~/build/gcc-snapshot-20071106/build/gcc$ gcc -c   -g -O -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros                                  -Wno-overlength-strings -fno-common   -DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include  -I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/dpd -I../libdecnumber    ../../src/gcc/fold-const.c -o fold-const.o
/tmp/ccM69d3d.s: Assembler messages:
/tmp/ccM69d3d.s:108768: Error: Branch out of range
Comment 1 David Daney 2007-11-06 17:08:16 UTC
Perhaps your bootstrap compiler is faulty.

It would seem that no code from the compiler-being-built is run at this point.
Comment 2 Martin Michlmayr 2007-11-06 17:11:33 UTC
(In reply to comment #1)
> Perhaps your bootstrap compiler is faulty.
> 
> It would seem that no code from the compiler-being-built is run at this point.

I'm using 4.2.3 20071014 to bootstrap.  So you don't see this problem?
Anyway, I can put the assembler file somewhere if that's helpful.  I need
to go shopping right now, but I'll try to compile with 4.3 in a bit.

(sid)tbm@appdev:~/build/gcc-snapshot-20071106/build/gcc$ as -EB -O2 -g -no-mdebug -mabi=32 -KPIC -o fold-const.o fold-const.s
fold-const.s: Assembler messages:
fold-const.s:108768: Error: Branch out of range
(sid)tbm@appdev:~/build/gcc-snapshot-20071106/build/gcc$ ls -l fold-const.s
-rw-r--r-- 1 tbm 1000 6132019 Nov  6 17:08 fold-const.s
(sid)tbm@appdev:~/build/gcc-snapshot-20071106/build/gcc$
Comment 3 Martin Michlmayr 2007-11-06 17:14:48 UTC
But yeah, I guess you're right that I shouldn't have marked this a "4.3
regression" when 4.2 is producing bad code.
Comment 4 David Daney 2007-11-06 17:17:17 UTC
This is my last known good mips-linux-gnu build:

http://gcc.gnu.org/ml/gcc-testresults/2007-10/msg01186.html

On mipsel-linux-gnu I am bootstrapping almost daily without problems.

Also last night (with an current but unremembered SVN version) I was able to build mips64-linux-gnu with the default debian-etch gcc (4.1) on my O2.

None of these are exactly what you are doing, but somewhat similar.
Comment 5 Martin Michlmayr 2007-11-06 17:18:53 UTC
Compiling the file with 4.3.0 20071030 works.

Comment 6 Martin Michlmayr 2007-11-06 17:23:11 UTC
and 4.1.3 20071019 works too.
Comment 7 Martin Michlmayr 2007-11-06 17:58:32 UTC
4.1 and 4.3 work, 4.2 on mipsel also works.  Only 4.2 on mips fails.  I'll
try the latest 4.2 from SVN now.
Comment 8 Martin Michlmayr 2007-11-06 18:41:57 UTC
4.2.3 20071106 from SVN works, so I guess this bug can be closed.
Comment 9 Martin Michlmayr 2007-11-06 21:24:51 UTC
Just for the record, this bug exists in FSF GCC 4.2.1 (and not just in Debian's
gcc), but is fixed in SVN.