Bug 20524 - [4.0/4.1 regression] Alias failures on ARM, CRIS, MMIX
Summary: [4.0/4.1 regression] Alias failures on ARM, CRIS, MMIX
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 20553 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-17 20:53 UTC by Hans-Peter Nilsson
Modified: 2005-03-31 23:05 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-03-17 21:02:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2005-03-17 20:53:22 UTC
With LAST_UPDATED "Wed Mar 16 14:54:19 UTC 2005" the tests passed.
With LAST_UPDATED "Wed Mar 16 21:10:54 UTC 2005"
(plus patch at <URL:http://sourceware.org/ml/newlib/2005/msg00179.html>)
the tests fail on trunk.  Similarly for 4.0, LAST_UPDATED
"Wed Mar 16 03:34:07 UTC 2005" (passes) "Thu Mar 17 06:05:21 UTC 2005" (fails)
respectively.

Running
/home/hp/combined/combined/gcc/testsuite/gcc.c-torture/compile/compile.exp ...
FAIL: gcc.c-torture/compile/20011119-1.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O3 -fomit-frame-pointer  (test for
excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -Os  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O3 -fomit-frame-pointer  (test for
excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -Os  (test for excess errors)
Running
/home/hp/combined/combined/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
...

The messages in gcc.log are:
x/gcc/testsuite/gcc.c-torture/compile/20011119-1.c:4: error: 'foo' aliased to
undefined symbol 'xxx'^

(both tests) except:

Executing on host: /home/hp/combined/cris-sim/gcc/xgcc
-B/home/hp/combined/cris-sim/gcc/   -O1  -w -c   -isystem /home/hp/combine\
d/cris-sim/cris-elf/./newlib/targ-include -isystem
/home/hp/combined/combined/newlib/libc/include  -o 20011119-2.o /home/hp/combi\
ned/combined/gcc/testsuite/gcc.c-torture/compile/20011119-2.c    (timeout = 300)
/home/hp/combined/combined/gcc/testsuite/gcc.c-torture/compile/20011119-2.c:4:
internal compiler error: in cgraph_expand_function\
, at cgraphunit.c:837^M
Please submit a full bug report,^M

Looks like only the alias change could be the culprit.  Maybe
related to this target having a leading underscore on symbols.
(BTW, the 4.0 ChangeLog entry has cutnpaste TAB/linebreak typos.)

+ 2005-03-16  Richard Henderson  <rth@redhat.com>
+
+       PR middle-end/15700
+       * varasm.c (struct alias_pair): Rename from struct output_def_pair.
+       (alias_pairs): Rename from output_defs.
+       (find_decl_and_mark_needed): Split out from assemble_alias.
+       (do_assemble_alias): New.
+       (assemble_output_def): Remove.
+       (finish_aliases_1, finish_aliases_2): New.
+       (process_pending_assemble_output_defs): Remove.
+       (assemble_alias): Defer aliases for which we don't yet have a
+       non-external decl for the target symbol.
+       * passes.c (rest_of_decl_compilation): Register variables with cgraph.
+       * cgraphunit.c (cgraph_finalize_compilation_unit): Use finish_aliases_1.
+       * toplev.c (compile_file): Use finish_aliases_2 instead of
+       process_pending_assemble_output_defs.
+       * tree.h (finish_aliases_1, finish_aliases_2): Declare.
+       (process_pending_assemble_output_defs): Remove.
Comment 1 Andrew Pinski 2005-03-17 21:00:22 UTC
At least one of these are the testcase being wrong.
Comment 2 Hans-Peter Nilsson 2005-03-17 21:02:55 UTC
In response to comment #1, the ICE indicates there's at least one bug in GCC...
Comment 3 Hans-Peter Nilsson 2005-03-18 01:46:36 UTC
Also worth noting is that mmix-knuth-mmixware shares the ICE for 20011119-2.c
and has an other alias-related set of failures:

Running
/home/hp/combined/combined/gcc/testsuite/gcc.c-torture/compile/compile.exp ...
FAIL: gcc.c-torture/compile/20011119-2.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/20040323-1.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/20040323-1.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/20040323-1.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/20040323-1.c  -O3 -fomit-frame-pointer  (test for
excess errors)
FAIL: gcc.c-torture/compile/20040323-1.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/20040323-1.c  -Os  (test for excess errors)

The gcc.log messages are:
20040323-1.c: Assembler messages:^M
20040323-1.c:35: Error: symbol `_rtld_local' is already defined

You might think this is a flaw in the MMIX port (not emitting proper pseudos
with .set semantics) but there *is* a problem, apparent in the 20040323-1.s for
cris-axis-elf at -O2:

...
        .size   __dl_start, .-__dl_start
        .comm   __rtld_local,4,2
        .comm   __rtld_global,4,2
        .global __rtld_local
        .set    __rtld_local,__rtld_global
        .global __rtld_local
        .set    __rtld_local,__rtld_global

The ".global" declaration are admittedly a flaw in the CRIS port (an artefact of
the once multi-object-format port) but the ".comm" for rtld_local (at -O2) seems
spurious as does the double .set of __rtld_local.  For MMIX that is at -O2:

...
        .comm   _rtld_local,4,4 ! mmixal-incompatible COMMON
        .comm   _rtld_global,4,4 ! mmixal-incompatible COMMON
        .global _rtld_local
_rtld_local     IS _rtld_global
        .global _rtld_local
_rtld_local     IS _rtld_global
        .data ! mmixal:= 8H LOC 9B
Comment 4 Hans-Peter Nilsson 2005-03-18 03:12:04 UTC
I see the ICE on 4.0 for arm-elf as well, so that makes it a Primary Target
Regression.  Dunno what PR priority and milestone change to adjust as a result.
Comment 5 jsm-csl@polyomino.org.uk 2005-03-18 12:27:30 UTC
Subject: Re:  [4.0/4.1 regression] cris-axis-elf
 testsuite failures: gcc.c-torture/compile/20011119-1.c and -2

20011119-2.c seems to be failing on all HP-UX targets and 
i686-pc-linux-gnu, mainline and 4.0 branch.

hppa2.0w-hpux fails to bootstrap on mainline as noted in 
<http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01673.html>.  On 4.0 branch 
it has new FAILs on 20011119-1.c, 20011119-2.c and 981001-2.c, "error: 
alias definitions not supported in this configuration".  If this is 
correct and the compiler was previously buggy not to reject the code then 
the tests need to be skipped on targets not supporting alias definitions.

Comment 6 Christian Joensson 2005-03-19 15:37:59 UTC
I guess this is related to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20553 
and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20554 
Comment 7 Andrew Pinski 2005-03-19 15:41:34 UTC
*** Bug 20553 has been marked as a duplicate of this bug. ***
Comment 8 John David Anglin 2005-03-19 15:50:27 UTC
On hppa2.0w-hp-hpux* (32-bit SOM targets), there is no assembler support
to create an alias except by emitting a label for the alias at the same
time as the target label.  There is no way to defer emitting aliases.
Comment 9 John David Anglin 2005-03-19 16:15:18 UTC
What I was trying to indicate in the previous comment is that aliases
can be created on targets that don't support ASM_OUTPUT_DEF by emitting
the labels at the same time as the target label.

This happens in the case of thunk functions on hppa2.0w-hp-hpux11.11
where we have a local label for the thunk function as well as the normal
function label.

I believe that we were previously doing this for aliases that didn't
yet have a non-external definition for the target.  It would seem that when
-funit-at-a-time is specified that it might always be possible to emit the
label for the alias together with the label for the target.
Comment 10 John David Anglin 2005-03-19 17:25:33 UTC
The last comment needs qualification.  The technique doesn't work for
common symbols because of the special assembler semantics used for these
symbols on 32-bit hpux.  However, it does work for other code and data
symbols.  For example, the following assembler output would create the
necessary alias in gcc.c-torture/compile/20040323-1.c:

        .EXPORT _rtld_global,DATA
        .SPACE $PRIVATE$
        .SUBSPA $DATA$

        .align 4
_rtld_local
_rtld_global
        .blockz 4
Comment 11 Hans-Peter Nilsson 2005-03-23 02:31:52 UTC
This PR is *not* about targets that supports aliases half-heartedly, so please
don't dup the hppa-*-hpux* alias PRs to this one.
Comment 12 Hans-Peter Nilsson 2005-03-30 00:02:02 UTC
For the non-ICE FAILs, see the USER_LABEL_PREFIX comment
<URL:http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02655.html>.
Also alluded to in the initial description (*cough*).
Comment 13 Richard Henderson 2005-03-31 23:05:40 UTC
The 20011119-1.c failure has been fixed by Joern by taking the USER_LABEL_PREFIX
into account.

I can't replicate the reported mmix double output failure with 20040323-1.c;
I can only presume that it's been fixed by one of the followup patches to the
aliasing code.
Comment 14 dave 2005-04-01 01:06:26 UTC
Subject: Re:  [4.0/4.1 regression] Alias failures on ARM, CRIS, MMIX

> I can't replicate the reported mmix double output failure with 20040323-1.c;
> I can only presume that it's been fixed by one of the followup patches to the
> aliasing code.

The failure noted in PR 20553 is now fixed on hppa64-hp-hpux11.  However,
we are still left with the followin minor regression on hppa2.0w-hp-hpux11:

FAIL: gcc.c-torture/compile/20011119-1.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-1.c  -Os  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/20011119-2.c  -Os  (test for excess errors)
FAIL: gcc.c-torture/compile/981001-2.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/981001-2.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/981001-2.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/981001-2.c  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gcc.c-torture/compile/981001-2.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/981001-2.c  -Os  (test for excess errors)

These now fail because of the warning:

Executing on host: /mnt/gnu/gcc-3.3/objdir/gcc/xgcc -B/mnt/gnu/gcc-3.3/objdir/gc
c/   -O3 -g  -w -c  -o 981001-2.o /mnt/gnu/gcc-3.3/gcc/gcc/testsuite/gcc.c-tortu
re/compile/981001-2.c    (timeout = 300)
/mnt/gnu/gcc-3.3/gcc/gcc/testsuite/gcc.c-torture/compile/981001-2.c:12: error: a
lias definitions not supported in this configuration

These used to pass because the alias was output together with the definition.

Dave
Comment 15 GCC Commits 2005-04-01 07:06:42 UTC
Subject: Bug 20524

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	hp@gcc.gnu.org	2005-04-01 07:06:37

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/gcc.dg: alias-7.c 

Log message:
	PR middle-end/20524
	* gcc.dg/alias-7.c: Prefix asm-declared name with
	__USER_LABEL_PREFIX__.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5256&r2=1.5257
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/alias-7.c.diff?cvsroot=gcc&r1=1.1&r2=1.2