[forwarded from http://bugs.debian.org/202859] 3.3 CVS 20030722, when building a mips-linux -> mips64-linux crosscompiler current gcc creates assembler code as can't handle (Branch out of range) The exact error messages is attached. Same happens with HEAD 20030722. Compiler called as: gcc --save-temps -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-cvs/gcc -I../../gcc-cvs/gcc/. -I../../gcc-cvs/gcc/config -I../../gcc-cvs/gcc/../include ../../gcc-cvs/gcc/fold-const.c -o fold-const.o
Created attachment 4510 [details] preprocessed source
Subject: Re: New: [mips] branch out of range when building fold-const.c "debian-gcc at lists dot debian dot org" <gcc-bugzilla@gcc.gnu.org> writes: > when building a mips-linux -> mips64-linux crosscompiler current gcc > creates assembler code as can't handle (Branch out of range) > The exact error messages is attached. Same happens with HEAD 20030722. Which assembler are you using? Richard
Subject: Re: [mips] branch out of range when building fold-const.c rsandifo at redhat dot com writes: > Which assembler are you using? binutils-2.14.90.0.5
Subject: Re: [mips] branch out of range when building fold-const.c "doko at cs dot tu-berlin dot de" <gcc-bugzilla@gcc.gnu.org> writes: > > Which assembler are you using? > > binutils-2.14.90.0.5 OK. As far as the 3.3 goes, it's a known limitation. gcc just doesn't predict the length of macro instructions correctly. Starting with gas 2.14, you can use: -Wa,-relax-branch to get around this. Mainline gcc is supposed to get it right though. Could you attach the preprocessed fold-const.i file? Thanks, Richard
Subject: Re: [mips] branch out of range when building fold-const.c rsandifo at redhat dot com writes: > Mainline gcc is supposed to get it right though. Could you attach > the preprocessed fold-const.i file? hmm, it's already attached. or is this the wrong one? Matthias
Subject: Re: [mips] branch out of range when building fold-const.c "doko at cs dot tu-berlin dot de" <gcc-bugzilla@gcc.gnu.org> writes: > rsandifo at redhat dot com writes: > > Mainline gcc is supposed to get it right though. Could you attach > > the preprocessed fold-const.i file? > > hmm, it's already attached. or is this the wrong one? Ah, sorry about that. For some reason I'd assumed you were using 3.3 to cross-compile 3.3 and trunk to cross-compile trunk. But it now occurs to me that mips64-linux-gnu is new to 3.4, so I guess you were using 3.3 and trunk to compile the same version of gcc. Is that right? When you say you're building a cross compiler, is it a cross-host or a normal cross-target? It looks from bugzilla entry like it's a cross-target, i.e.: build: mips-linux-gnu host: mips-linux-gnu target: mips64-linux-gnu In other words, the compiler itself is to run on mips-linux-gnu rather than mips64-linux-gnu. Is that right? I tried building an i686-pc-linux-gnu cross mips-linux-gnu compiler from HEAD but couldn't reproduce the problem. The checkout I used was updated yesterday. Is it still a problem for you on HEAD? If so, could you tell me what configure line you used? Also, could you try both -mexplicit-relocs and -mno-explicit-relocs? Richard
Subject: Re: [mips] branch out of range when building fold-const.c On Sat, Aug 09, 2003 at 09:23:23AM -0000, rsandifo at redhat dot com wrote: > Ah, sorry about that. For some reason I'd assumed you were using 3.3 to > cross-compile 3.3 and trunk to cross-compile trunk. But it now occurs > to me that mips64-linux-gnu is new to 3.4, so I guess you were using 3.3 > and trunk to compile the same version of gcc. Is that right? Yes, I used 3.3 and a CVS snapshot from 2003-07-22 to build a CVS checkout from the same date. > build: mips-linux-gnu > host: mips-linux-gnu > target: mips64-linux-gnu Yes. > In other words, the compiler itself is to run on mips-linux-gnu > rather than mips64-linux-gnu. Is that right? Yes. > I tried building an i686-pc-linux-gnu cross mips-linux-gnu compiler > from HEAD but couldn't reproduce the problem. The checkout I used > was updated yesterday. I don't have any problem on i386 either. Furthermore compiling without -O2 on mips-linux seems to work around the problem too. > Is it still a problem for you on HEAD? If so, could you tell me what > configure line you used? Also, could you try both -mexplicit-relocs > and -mno-explicit-relocs? Will be some time till I have this all tested. Configure is: ../gcc-cvs/configure --enable-languages=c --disable-shared \ --with-newlib --disable-threads --target=mips64-linux \ --prefix=~/toolchain/cross-mips64-linux Regards, -- Guido
Subject: Re: [mips] branch out of range when building fold-const.c "agx at sigxcpu dot org" <gcc-bugzilla@gcc.gnu.org> writes: > > In other words, the compiler itself is to run on mips-linux-gnu > > rather than mips64-linux-gnu. Is that right? > Yes. > > > I tried building an i686-pc-linux-gnu cross mips-linux-gnu compiler > > from HEAD but couldn't reproduce the problem. The checkout I used > > was updated yesterday. > I don't have any problem on i386 either. Just to confirm: you're saying that you don't see a problem if you create a i386-x-mips-linux-gnu compiler and then use that compiler to compile the fold-const.i file you posted? Richard
Subject: Re: [mips] branch out of range when building fold-const.c On Sat, Aug 09, 2003 at 11:44:13AM -0000, rsandifo at redhat dot com wrote: > Just to confirm: you're saying that you don't see a problem if you > create a i386-x-mips-linux-gnu compiler and then use that compiler > to compile the fold-const.i file you posted? Yes, this works: ~$ /usr/local/stow/cross-mips-linux/bin/mips-linux-gcc -c fold-const.i && echo 'Works!' Works! This is a slightly different gcc though: Reading specs from /usr/local/stow/cross-mips-linux/lib/gcc-lib/mips-linux/3.3/specs Configured with: ../gcc-3.3/configure --prefix=/usr/local/stow/cross-mips-linux --target=mips-linux --disable-shared --enable-languages=c Thread model: posix gcc version 3.3 Regards, -- Guido
The problem doesn't show up anymore with the latest CVS head.
OK, thanks for the info. Since the problem is a known limitation with 3.3.x and earlier, I'll go ahead and close this. Please do open a new bug if you get out-of-range problems on head again. Thanks, Richard
Subject: Bug 11716 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: doko@gcc.gnu.org 2004-03-27 10:35:04 Modified files: gcc : ChangeLog gcc/config/mips: mips.md Log message: 2004-03-27 Matthias Klose <doko@debian.org> PR target/11716 Michael Eager <eager@mvista.com> * config/mips/mips.md: Limit the maximum length of a short branch to 64K instead of 128K. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.955&r2=1.16114.2.956 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mips/mips.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.153.2.4&r2=1.153.2.5
Fixed also in 3.3.4.