Bug 44276 - [4.6 Regression]: gcc.dg/tls/alias-1.c
Summary: [4.6 Regression]: gcc.dg/tls/alias-1.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 18:38 UTC by Hans-Peter Nilsson
Modified: 2010-08-11 10:23 UTC (History)
3 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: cris-axis-elf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-05-27 00:12:56


Attachments
fix up alias output (1.05 KB, patch)
2010-05-26 20:26 UTC, Iain Sandoe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2010-05-25 18:38:31 UTC
With revision 159779 this test passed.
From revision 159784 and on, this test has failed as follows:

Running /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/tls/tls.exp ...
FAIL: gcc.dg/tls/alias-1.c (test for excess errors)

With the message in the logfile being (copy-pasted):

Executing on host: /tmp/hpautotest-gcc1/cris-elf/gccobj/gcc/xgcc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/gcc/ /tmp/hpaut\
otest-gcc1/gcc/gcc/testsuite/gcc.dg/tls/alias-1.c    -ansi -pedantic-errors   -isystem /tmp/hpautotest-gcc1/cris-elf/gc\
cobj/cris-elf/./newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-e\
lf/gccobj/cris-elf/./libgloss/cris/ -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./libgloss/cris -L/tmp/hpautotest-g\
cc1/gcc/libgloss/cris  -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./newlib/ -L/tmp/hpautotest-gcc1/cris-elf/gccobj\
/cris-elf/./newlib -sim3  -lm   -o alias-1.exe    (timeout = 300)
/tmp/ccZoLZBR.s: Assembler messages:^M
/tmp/ccZoLZBR.s:43: Error: symbol `___emutls_v.bar' is already defined^M
compiler exited with status 1
output is:
/tmp/ccZoLZBR.s: Assembler messages:^M
/tmp/ccZoLZBR.s:43: Error: symbol `___emutls_v.bar' is already defined^M

FAIL: gcc.dg/tls/alias-1.c (test for excess errors)
Excess errors:
/tmp/ccZoLZBR.s:43: Error: symbol `___emutls_v.bar' is already defined


Author of suspect patches in revision range CC:ed.
Comment 1 Hans-Peter Nilsson 2010-05-25 18:41:04 UTC
See also PR44137.
Comment 2 Iain Sandoe 2010-05-25 19:15:12 UTC
Yes, sorry, the list of emutls users grows...

most likely it is my commit from r159781 to address PR44132 that caused this,

1/ Did the same commit improve PR44137 on your target?
 (PR44173 looks pretty much the same bug as 44132)

2/ Are you able to try the proposed "proper" solution to that bug (see comment #24 of PR44132) ?

In the end we will have to address this if lto/whopr are to work with emulated tls.


Comment 3 Iain Sandoe 2010-05-25 20:38:02 UTC
I will need some help in tracking down how to solve this (since I don't have an emutls/visibility/alias target available).

Also I can't find any reference in the gcc manual to alias applied to variables - only to functions.
(although that might just be documentation lag).

I guess we need to check for the alias attribute in emutls_decl and find our way back to the original aliased decl.  Alternatively it might be enough to copy the alias attribute onto the emutls control var.

Comment 4 John David Anglin 2010-05-26 12:56:15 UTC
This also occurs on hppa64-hp-hpux11.11.
Comment 5 Iain Sandoe 2010-05-26 14:12:14 UTC
(In reply to comment #4)
> This also occurs on hppa64-hp-hpux11.11.

OK, I've built gcc & newlib for cris-elf and it's apparent that we need to deal with the fact that that aliased emutls symbols are named differently...

that is the user writes alias(foo) ... but the emulated tls system needs to understand alias(__emutls_v.foo) )

I'll take a look at how to implement this... 
.. sorry for this fallout from the other fix

The patch @ comment#24 of PR44132 also needs to understand this issue, and won't solve this problem yet.
Comment 6 Iain Sandoe 2010-05-26 20:26:15 UTC
Created attachment 20755 [details]
fix up alias output

this fixes it so that we don't try to emit emutls control vars if they are aliases.

The reference will still be emitted when the original var alias is processed.

This gives no fails on  cris-elf (simulator, no pthreads) ..
Comment 7 Hans-Peter Nilsson 2010-05-27 00:12:56 UTC
(In reply to comment #2)

Sorry I wasn't here to answer the basic simulator-target questions, but it seems you found the information needed to get you going.

> 1/ Did the same commit improve PR44137 on your target?

No.

> 2/ Are you able to try the proposed "proper" solution to that bug (see comment
> #24 of PR44132) ?

I'll try when the tree builds again (PR44287) if you need it; from your later questions it seems you've verified this yourself.

Thanks for looking into this!
Comment 8 Iain Sandoe 2010-05-27 00:49:16 UTC
(In reply to comment #7)
> (In reply to comment #2)
> 
> Sorry I wasn't here to answer the basic simulator-target questions, but it
> seems you found the information needed to get you going.

Yes, the wiki page is good and it all went pretty easily.  
One thing you could help with is whether there's a way of enabling threads on the simulator - and what I need to get to do it.. googling cris pthreads wasn't illuminating..

I want to keep this target around to test things that I can't do on darwin.

> > 1/ Did the same commit improve PR44137 on your target?
> 
> No.

I see pretty much clean* output from check-gcc ....  tls.exp=* 

* when clean=only fails I expect for non-tls reasons.

> > 2/ Are you able to try the proposed "proper" solution to that bug (see comment
> > #24 of PR44132) ?
> 
> I'll try when the tree builds again (PR44287) if you need it; from your later
> questions it seems you've verified this yourself.

Hang fire on that - I've just re-made the "proper" solution to deal with the aliasing - but I need to re-reg-test on non-alias targets before posting;

 if you're interested in trying it, watch PR44132 (but I will use cris-elf as a test platform anyway).


Comment 9 Hans-Peter Nilsson 2010-05-27 01:15:12 UTC
(In reply to comment #8)
> One thing you could help with is whether there's a way of enabling threads on
> the simulator

You mean "for cris-axis-elf"; no, there is no support for threads on cris-axis-elf.

(I could reply "yes" to your original question, however, but that's irrelevant; the simulator supports cris-axis-linux-gnu too, but you don't want to build for that target, it's a slightly more complicated. :)

Let's hope your patch gets reviewed post haste.
Comment 10 Iain Sandoe 2010-05-27 10:12:03 UTC
(In reply to comment #4)
> This also occurs on hppa64-hp-hpux11.11.
> 
Does the patch @ comment #6 resolve this for you?
If so, and there are no more targets reporting the issue, I will post to gcc-patches as a proposed fix.
thanks.
Comment 11 Iain Sandoe 2010-07-13 20:30:45 UTC
(In reply to comment #9)


> (I could reply "yes" to your original question, however, but that's irrelevant;
> the simulator supports cris-axis-linux-gnu too, but you don't want to build for
> that target, it's a slightly more complicated. :)

actually, on reflection, I do ... 

... I assume that you're saying that building a sysroot is tricky? 
... or is there one that's "downloadable" ?

(BTW, this bug should be fixed v. soon) 
Comment 12 Hans-Peter Nilsson 2010-07-13 23:07:13 UTC
(In reply to comment #11)
> (In reply to comment #9)
> > the simulator supports cris-axis-linux-gnu too, but you don't want to build for
> > that target, it's a slightly more complicated. :)
> 
> actually, on reflection, I do ... 
> 
> ... I assume that you're saying that building a sysroot is tricky? 

Yes, for different reasons.  Sorry.
Comment 13 Iain Sandoe 2010-08-11 10:23:52 UTC
AFAICT, from testing on cris-elf Xf from i686-darwin9 this is fixed.
Comment 14 dave 2010-08-11 13:15:05 UTC
Subject: Re:  [4.6 Regression]: gcc.dg/tls/alias-1.c

> AFAICT, from testing on cris-elf Xf from i686-darwin9 this is fixed.

It also appears fixed on hppa64-hp-hpux11.11.