Bug 26415

Summary: [4.3/4.4/4.5 regression] m68k-linux bootstrap error during stage2
Product: gcc Reporter: Debian GCC Maintainers <debian-gcc>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, pinskia, schwab, tbm
Priority: P5 Keywords: assemble-failure, build
Version: 4.2.0   
Target Milestone: 4.3.5   
Host: Target: m68k-linux
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: test case from application torcs
test case from application grace
test case from application synfig

Description Debian GCC Maintainers 2006-02-22 12:25:46 UTC
trunk 20060218, on m68k-linux:

  Matthias

/build/buildd/gcc-snapshot-20060218/build/./prev-gcc/xgcc -B/build/buildd/gcc-snapshot-20060218/build/./prev-gcc/ -B/usr/lib/gcc-snapshot/m68k-linux-gnu/bin/ -c   -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -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../libdecnumber    ../../src/gcc/tree-ssa-reassoc.c -o tree-ssa-reassoc.o
/tmp/ccQSa8G6.s: Assembler messages:
/tmp/ccQSa8G6.s:3389: Error: value out of range
/tmp/ccQSa8G6.s:3389: Error: value of 1488 too large for field of 1 bytes at 10891
make[5]: *** [tree-ssa-reassoc.o] Error 1
make[5]: Leaving directory `/build/buildd/gcc-snapshot-20060218/build/gcc'
make[4]: *** [all-stage2-gcc] Error 2
make[4]: Leaving directory `/build/buildd/gcc-snapshot-20060218/build'
make[3]: *** [stage2-bubble] Error 2
make[3]: Leaving directory `/build/buildd/gcc-snapshot-20060218/build'
make[2]: *** [bootstrap] Error 2
Comment 1 Kazu Hirata 2006-05-10 17:00:40 UTC
Could you submit a preprocessed testcase?
Many of us do not have m68k hardware that can be used for bootstrap.

Thanks,
Comment 2 Mark Mitchell 2006-06-04 17:47:57 UTC
m68k is not a primary or secondary platform.
Comment 3 Martin Michlmayr 2006-06-20 21:54:25 UTC
This is a very common error on m68k.  We got another bug report, see
http://bugs.debian.org/359281, which says:

> torcs, grace, and rscheme all fail with variations on the theme of
> track.s: Assembler messages:
> track.s:10716: Error: value out of range

> This bug appears in at least gcc-4.0 4.0.2-3 - 4.0.2-10.
> Works fine with latest binutils and gcc-3.3.

> torcs (g++) and grace (gcc) can be made to compile with -O1 for
> both 4.1 and 4.0.

> rscheme works with gcc-4.0 -O1 and gcc-4.1 -O2 (in other words,
> it seems to be fixed in 4.1 although the error seems the same).

> None of these look easy to reduce.

> Please let me know what else I can provide.

I have been running some testcases through delta and while they got smaller, they're still fairly large.  However, I'll attach them and hope that someone can make sense of what's going on here.
Comment 4 Martin Michlmayr 2006-06-20 22:03:38 UTC
Created attachment 11713 [details]
test case from application torcs

572:tbm@reyes: ~] /usr/local/bin/m68k-linux-gnu-g++ -c -O2 track.cc
...
/tmp/ccoFyyHa.s: Assembler messages:
/tmp/ccoFyyHa.s:9603: Error: value out of range

The offending line is:

    fbnlt .L297
Comment 5 Martin Michlmayr 2006-06-20 22:06:59 UTC
Created attachment 11714 [details]
test case from application grace

577:tbm@reyes: ~] /usr/local/bin/m68k-linux-gnu-gcc -c -O2 pars.c
...
/tmp/ccaiWxu4.s: Assembler messages:
/tmp/ccaiWxu4.s:11586: Error: value out of range

The offending line is:

    fbngt .L6
Comment 6 Martin Michlmayr 2006-06-20 22:08:30 UTC
I can provide more testcases on request but I think the general pattern is clear from these two:

23:00 < apinski> tbm: what is on the line which the assembler is complaining about
23:01 < tbm> fbnlt .L297
23:03 < apinski> the only thing I can think of is the distance is just too long
23:05 < apinski> tbm: so reducing the testcase is not going to help as you are just going to end up with a big testcase no matter what

BTW, going from -O2 to -O1 makes both of these testcases compile.
Comment 7 Martin Michlmayr 2006-06-20 22:19:46 UTC
Created attachment 11715 [details]
test case from application synfig

This test case is probably also interesting because it shows a slightly different error:

7184:tbm@reyes: ~] /usr/local/bin/m68k-linux-gnu-gcc -c -O2 -S random.ii
7185:tbm@reyes: ~] m68k-linux-as random.s
random.s: Assembler messages:
random.s:581: Error: value out of range
random.s:581: Error: value of 71734 too large for field of 2 bytes at 2144
random.s:590: Error: value out of range
random.s:590: Error: value of 71680 too large for field of 2 bytes at 2188
Comment 8 Andreas Schwab 2006-06-20 22:43:17 UTC
The problem with the attached testcases is that gcc is using fbCC instead of fjCC.  The former set of insns is interpreted by GAS as fixed length branches with 16 bit offset, whereas the latter is handled as variable sized branch with either 16 bit or 32 bit offset.  But the bootstrap error is a different problem, since a floating point branch does not have a 8 bit field.  Please move the test cases to a new bug, and instead attach a testcase for the original problem.
Comment 9 Martin Michlmayr 2006-06-20 22:50:45 UTC
> But the bootstrap error is a different
> problem, since a floating point branch does not have a 8 bit field.  Please
> move the test cases to a new bug, and instead attach a testcase for the
> original problem.

I don't see that bootstrap error anymore so I suggest this PR to be retitled for the other testcases.  Or is the 3rd testcase an example of the original problem?
If so, let's keep that and I'll move the first two testcases to another PR.

How should I proceed?
Comment 10 Mark Mitchell 2007-05-14 22:28:08 UTC
Will not be fixed in 4.2.0; retargeting at 4.2.1.
Comment 11 Mark Mitchell 2007-10-09 19:22:21 UTC
Change target milestone to 4.2.3, as 4.2.2 has been released.
Comment 12 Richard Biener 2008-01-26 12:27:06 UTC
How is the status here?
Comment 13 Debian GCC Maintainers 2008-01-26 20:15:25 UTC
we had successful builds for gcc-4.2 from the branch; no testresults / build logs for gcc-4.3 yet.

  Matthias
Comment 14 Joseph S. Myers 2008-02-01 16:52:52 UTC
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Comment 15 Joseph S. Myers 2008-05-19 20:22:48 UTC
4.2.4 is being released, changing milestones to 4.2.5.
Comment 16 Joseph S. Myers 2009-03-31 19:31:04 UTC
Closing 4.2 branch.  What is the status now on the three testcases?
Comment 17 Richard Biener 2009-08-04 12:27:34 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 18 Jeffrey A. Law 2010-02-24 21:49:41 UTC
Fixed by:
2007-09-18  Roman Zippel <zippel@linux-m68k.org>

        * config/m68k/m68k.md (beq, bne, bgt, blt, bge, ble, bordered,
        bunordered, buneq, bunge, bungt, bunle, bunlt, bltgt, beq_rev,
        bne_rev, bgt_rev, blt_rev, bge_rev, ble_rev, bordered_rev,
        bunordered_rev, buneq_rev, bunge_rev, bungt_rev, bunle_rev,
        bunlt_rev, bltgt_rev): Replace all fbcc with fjcc.