Bug 21556 - [4.0/4.1 Regression] TLS failures on 4.0 branch
Summary: [4.0/4.1 Regression] TLS failures on 4.0 branch
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P2 critical
Target Milestone: 4.0.1
Assignee: Richard Henderson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-13 19:37 UTC by Joseph S. Myers
Modified: 2005-06-05 07:52 UTC (History)
2 users (show)

See Also:
Host:
Target: ia64-hpux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-05-16 03:25:01


Attachments
proposed patch (751 bytes, patch)
2005-05-16 03:22 UTC, Richard Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph S. Myers 2005-05-13 19:37:17 UTC
The patch

2005-05-11  Richard Henderson  <rth@redhat.com>

        PR target/21412
        * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New.
        (ia64_cannot_force_const_mem): New.
        [...]

causes mainline bootstrap to fail on ia64-hpux.  The failure is when building
libgcc with the stage2 compiler, i.e. in what follows ./xgcc is the stage2
compiler built with the stage1 compiler so it seems the stage1 compiler is
miscompiling the stage2 compiler.

./xgcc -B./
-B/scratch/gcc/nightly-2005-05-13-mainline/ia64-hp-hpux11.23/build_gcc/install/ia64-hp-hpux11.23/bin/
-isystem
/scratch/gcc/nightly-2005-05-13-mainline/ia64-hp-hpux11.23/build_gcc/install/ia64-hp-hpux11.23/include
-isystem
/scratch/gcc/nightly-2005-05-13-mainline/ia64-hp-hpux11.23/build_gcc/install/ia64-hp-hpux11.23/sys-include
-L/scratch/gcc/nightly-2005-05-13-mainline/ia64-hp-hpux11.23/build_gcc/build/gcc-mainline-2005-05-13-nightly-ia64-hp-hpux11.23-ia64-hp-hpux11.23/gcc/../ld
-O2  -DIN_GCC    -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include   -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I.
-I. -I/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc
-I/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc/.
-I/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc/../include
-I/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc/../libcpp/include
 -DL_ffsdi2 -fvisibility=hidden -DHIDE_EXPORTS -c
/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc/libgcc2.c
-o libgcc/./_ffsdi2.o
/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc/libgcc2.c:
In function '__ffsdi2':
/home/gcc/nightlies/src-mainline-2005-05-13/gcc-mainline-2005-05-13/gcc/libgcc2.c:485:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [libgcc/./_ffssi2.o] Error 1
Comment 1 Richard Henderson 2005-05-13 19:43:45 UTC
Well, since it works on ia64-linux, you'll have to give me more information.
I assume I'm failing to addp4 in the right place, or something...
Comment 2 Joseph S. Myers 2005-05-14 20:53:59 UTC
I'm now running the C testsuite with the before-and-after stage1 compilers to
see if that shows up any problems.

On 4.0 branch the patch doesn't cause bootstrap failure but there are a number
of new testsuite failures, all -milp32 only, which might show up with a
cross-compiler and indicate the source of this or a related problem.  All these
appeared between 20050512 and 20050514, and seem likely to be related to this patch.

FAIL: g++.dg/tls/init-1.C (test for excess errors)
FAIL: gcc.dg/tls/nonpic-1.c (test for excess errors)
FAIL: gcc.dg/tls/opt-3.c (test for excess errors)
FAIL: gcc.dg/tls/opt-6.c (test for excess errors)
FAIL: gcc.dg/tls/opt-8.c (test for excess errors)
FAIL: gcc.dg/tls/pic-1.c (test for excess errors)
FAIL: gcc.dg/tls/struct-1.c (test for excess errors)

(Also note that gcc.dg/tls/opt-9.c still fails for -milp32 although it now
passes for -mlp64.)

4.0 branch failures:

/home/gcc/nightlies/src-4.0-2005-05-14/gcc-4.0-2005-05-14/gcc/testsuite/gcc.dg/tls/nonpic-1.c:
In function 'ae1':
/home/gcc/nightlies/src-4.0-2005-05-14/gcc-4.0-2005-05-14/gcc/testsuite/gcc.dg/tls/nonpic-1.c:12:
error: unrecognizable insn:
(insn 10 9 11 0 (set (reg:DI 341)
        (unspec:DI [
                (symbol_ref:SI ("e1") [flags 0x58] <var_decl 79750690 e1>)
            ] 4)) -1 (nil)
    (nil))
/home/gcc/nightlies/src-4.0-2005-05-14/gcc-4.0-2005-05-14/gcc/testsuite/gcc.dg/tls/nonpic-1.c:12:
internal compiler error: in extract_insn, at recog.c:2020

/home/gcc/nightlies/src-4.0-2005-05-14/gcc-4.0-2005-05-14/gcc/testsuite/gcc.dg/tls/opt-3.c:
In function 'foo':
/home/gcc/nightlies/src-4.0-2005-05-14/gcc-4.0-2005-05-14/gcc/testsuite/gcc.dg/tls/opt-3.c:10:
error: unrecognizable insn:
(insn 11 9 12 0 (set (reg:DI 340)
        (unspec:DI [
                (symbol_ref:SI ("i") [flags 0x48] <var_decl 79750690 i>)
            ] 5)) -1 (nil)
    (nil))
/home/gcc/nightlies/src-4.0-2005-05-14/gcc-4.0-2005-05-14/gcc/testsuite/gcc.dg/tls/opt-3.c:10:
internal compiler error: in extract_insn, at recog.c:2020

and several more following the same pattern.
Comment 3 Joseph S. Myers 2005-05-15 02:02:38 UTC
C testsuite failures with the stage1 compiler introduced by this patch on
mainline are the same as the new failures on 4.0 branch.
Comment 4 H.J. Lu 2005-05-15 18:45:35 UTC

*** This bug has been marked as a duplicate of 21551 ***
Comment 5 Richard Henderson 2005-05-16 03:22:46 UTC
Subject: Re:  [4.0/4.1 Regression] ia64-hpux bootstrap fails on mainline, TLS failures on 4.0 branch

> error: unrecognizable insn:
> (insn 10 9 11 0 (set (reg:DI 341)
>         (unspec:DI [
>                 (symbol_ref:SI ("e1") [flags 0x58] <var_decl 79750690 e1>)
>             ] 4)) -1 (nil)
>     (nil))

In moving functions from ia64.c to predicates.md, they acquired code
that checked the mode argument to the predicate.  We don't actually
care about this mode in this case.

Please try the following.


r~
Comment 6 Richard Henderson 2005-05-16 03:22:47 UTC
Created attachment 8898 [details]
proposed patch
Comment 7 Richard Henderson 2005-05-16 03:23:51 UTC
Not a duplicate entirely.
Comment 8 jsm-csl@polyomino.org.uk 2005-05-16 16:59:17 UTC
Subject: Re:  [4.0/4.1 Regression] ia64-hpux bootstrap
 fails on mainline, TLS failures on 4.0 branch

On Mon, 16 May 2005, rth at gcc dot gnu dot org wrote:

> In moving functions from ia64.c to predicates.md, they acquired code
> that checked the mode argument to the predicate.  We don't actually
> care about this mode in this case.
> 
> Please try the following.
> 
> 
> r~
> 
> ------- Additional Comments From rth at gcc dot gnu dot org  2005-05-16 03:22 -------
> Created an attachment (id=8898)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8898&action=view)

This patch fixes the testsuite regressions on mainline (HJ's patch having 
fixed bootstrap there).  I haven't tested it on 4.0 branch.

Comment 9 GCC Commits 2005-05-16 18:23:02 UTC
Subject: Bug 21556

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-05-16 18:22:50

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.md 

Log message:
	PR target/21556
	* config/ia64/ia64.md (load_dtpmod, load_ltoff_dtpmod, load_dtprel,
	load_dtprel64, load_dtprel22, load_dtprel_gd, load_ltoff_dtprel,
	add_dtprel, add_dtprel14, add_dtprel22, load_tprel, load_tprel64,
	load_tprel22, load_tprel_ie, load_ltoff_tprel, add_tprel, add_tprel14,
	add_tprel22): Remove mode from symbolic operand.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8802&r2=2.8803
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.md.diff?cvsroot=gcc&r1=1.152&r2=1.153

Comment 10 GCC Commits 2005-05-16 18:26:14 UTC
Subject: Bug 21556

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	rth@gcc.gnu.org	2005-05-16 18:25:50

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.md 

Log message:
	PR target/21556
	* config/ia64/ia64.md (load_dtpmod, load_ltoff_dtpmod, load_dtprel,
	load_dtprel64, load_dtprel22, load_dtprel_gd, load_ltoff_dtprel,
	add_dtprel, add_dtprel14, add_dtprel22, load_tprel, load_tprel64,
	load_tprel22, load_tprel_ie, load_ltoff_tprel, add_tprel, add_tprel14,
	add_tprel22): Remove mode from symbolic operand.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.247&r2=2.7592.2.248
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.md.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.146.8.3&r2=1.146.8.4

Comment 11 Richard Henderson 2005-05-16 18:26:58 UTC
Fixed.