public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/31537]  New: duplicate weakref emitted with IMA
@ 2007-04-11 14:50 aldot at gcc dot gnu dot org
  2007-04-13 13:32 ` [Bug c/31537] " aldot at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-04-11 14:50 UTC (permalink / raw)
  To: gcc-bugs

$ /scratch/obj.i686/gcc-4.3/./gcc/xgcc -B/scratch/obj.i686/gcc-4.3/./gcc/
-B/opt/i686/gcc-4.3//i686-linux-gnu/bin/
-B/opt/i686/gcc-4.3//i686-linux-gnu/lib/ -c f?.i -combine -o /dev/null 
/tmp/ccqmLD9J.s: Assembler messages:
/tmp/ccqmLD9J.s:3: Error: symbol `__gthrw_pthread_once' is already defined


$ cat f1.i
static __gthrw_pthread_once __attribute__ ((__weakref__ ("pthread_once")));
$ cat f2.i
static __gthrw_pthread_once __attribute__ ((__weakref__ ("pthread_once")));


It fails to drop duplicate weakrefs:
$ /scratch/obj.i686/gcc-4.3/./gcc/xgcc -B/scratch/obj.i686/gcc-4.3/./gcc/
-B/opt/i686/gcc-4.3//i686-linux-gnu/bin/
-B/opt/i686/gcc-4.3//i686-linux-gnu/lib/ -S f?.i -combine -o -
        .file   "f1.i"
        .weakref        __gthrw_pthread_once,pthread_once
        .weakref        __gthrw_pthread_once,pthread_once
        .ident  "GCC: (GNU) 4.3.0 20070410 (experimental)"
        .section        .note.GNU-stack,"",@progbits


-- 
           Summary: duplicate weakref emitted with IMA
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: assemble-failure
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aldot at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
@ 2007-04-13 13:32 ` aldot at gcc dot gnu dot org
  2007-05-02 20:23 ` geoffk at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-04-13 13:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from aldot at gcc dot gnu dot org  2007-04-13 14:32 -------
Created an attachment (id=13363)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13363&action=view)
inaccurate bypass

Not a patch.

By marking ultimate target's asm_written_flag and bailing if it was already
set, one could bypass this, perhaps..


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
  2007-04-13 13:32 ` [Bug c/31537] " aldot at gcc dot gnu dot org
@ 2007-05-02 20:23 ` geoffk at gcc dot gnu dot org
  2007-05-02 20:43 ` aldot at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2007-05-02 20:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from geoffk at gcc dot gnu dot org  2007-05-02 21:23 -------
Since these are both 'static', shouldn't they be named things like
__gthrw_pthread_once.247 in the assembler?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
  2007-04-13 13:32 ` [Bug c/31537] " aldot at gcc dot gnu dot org
  2007-05-02 20:23 ` geoffk at gcc dot gnu dot org
@ 2007-05-02 20:43 ` aldot at gcc dot gnu dot org
  2007-05-03 19:14 ` geoffk at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-05-02 20:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from aldot at gcc dot gnu dot org  2007-05-02 21:43 -------
Richi suggested it was a FE bug.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-05-02 20:43 ` aldot at gcc dot gnu dot org
@ 2007-05-03 19:14 ` geoffk at gcc dot gnu dot org
  2007-06-21 16:44 ` aldot at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2007-05-03 19:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from geoffk at gcc dot gnu dot org  2007-05-03 20:14 -------
The following testcase should be equivalent to the original one but not involve
IMA:

void f1()
{ 
  static __gthrw_pthread_once __attribute__ ((__weakref__ ("pthread_once")));
}
void f2()
{ 
  static __gthrw_pthread_once __attribute__ ((__weakref__ ("pthread_once")));
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-05-03 19:14 ` geoffk at gcc dot gnu dot org
@ 2007-06-21 16:44 ` aldot at gcc dot gnu dot org
  2008-01-02 20:57 ` aldot at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2007-06-21 16:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from aldot at gcc dot gnu dot org  2007-06-21 16:44 -------
Without combine, the attribute is ignored:

$ gcc-4.3.orig-HEAD  -c pr.c  -o /dev/null
pr.c: In function 'f1':
pr.c:3: warning: '__weakref__' attribute ignored
pr.c: In function 'f2':
pr.c:7: warning: '__weakref__' attribute ignored


while with combine and the original testcase, current trunk still gives:
$ gcc-4.3.orig-HEAD  -c f1.i f2.i -combine -o /dev/null
/tmp/ccmg6Twk.s: Assembler messages:
/tmp/ccmg6Twk.s:3: Error: symbol `__gthrw_pthread_once' is already defined


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-06-21 16:44 ` aldot at gcc dot gnu dot org
@ 2008-01-02 20:57 ` aldot at gcc dot gnu dot org
  2008-01-25  9:14 ` aldot at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-01-02 20:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from aldot at gcc dot gnu dot org  2008-01-02 19:06 -------
Any update?
Current trunk still produces wrong code for weakrefs..


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-01-02 20:57 ` aldot at gcc dot gnu dot org
@ 2008-01-25  9:14 ` aldot at gcc dot gnu dot org
  2008-01-25 18:54 ` aldot at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-01-25  9:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from aldot at gcc dot gnu dot org  2008-01-25 08:28 -------
Testing a patch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-01-25  9:14 ` aldot at gcc dot gnu dot org
@ 2008-01-25 18:54 ` aldot at gcc dot gnu dot org
  2008-01-29 23:20 ` aldot at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-01-25 18:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from aldot at gcc dot gnu dot org  2008-01-25 18:02 -------
Mine.

$ cat pr31537.i
static int __gthrw_pthread_once __attribute__ ((__weakref__ ("pthread_once")));
$ gcc-4.3-HEAD -S -o - -Os pr31537.i pr31537.i pr31537.i \
pr31537.i pr31537.i pr31537.i -fno-tree-vnhoist -combine
        .file   "pr31537.i"
        .weakref        __gthrw_pthread_once,pthread_once
        .ident  "GCC: (GNU) 4.3.0 20080125 (experimental)"
        .section        .note.GNU-stack,"",@progbits

Regression-testing still in progress..


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |aldot at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-25 18:02:47
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-01-25 18:54 ` aldot at gcc dot gnu dot org
@ 2008-01-29 23:20 ` aldot at gcc dot gnu dot org
  2008-03-14 16:47 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-01-29 23:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from aldot at gcc dot gnu dot org  2008-01-29 21:07 -------
Created an attachment (id=15053)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15053&action=view)
patch in testing

This is a simple fix to adjust the respective vector (that get's
filled/finalized far too early, AFAICT; furthermore it's never pruned and if a
new target is added  the alias is never rejected).

This patch warns -- conditionally, should most likely be a warning(0.. -- if
the target changes and adjust the vector accordingly.

Should a subsequent weakref to a new target invalidate the weak?


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #13363|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-01-29 23:20 ` aldot at gcc dot gnu dot org
@ 2008-03-14 16:47 ` rguenth at gcc dot gnu dot org
  2008-09-16 19:19 ` aldot at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-14 16:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.0                       |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-03-14 16:47 ` rguenth at gcc dot gnu dot org
@ 2008-09-16 19:19 ` aldot at gcc dot gnu dot org
  2009-06-04 12:55 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-09-16 19:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from aldot at gcc dot gnu dot org  2008-09-16 19:17 -------
unassigning. The BE workaround bypasses it for me, no time to look further.


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|aldot at gcc dot gnu dot org|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-09-16 19:19 ` aldot at gcc dot gnu dot org
@ 2009-06-04 12:55 ` steven at gcc dot gnu dot org
  2009-06-04 13:25 ` aldot at gcc dot gnu dot org
  2009-06-04 13:42 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-06-04 12:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from steven at gcc dot gnu dot org  2009-06-04 12:55 -------
Oh, the temptation to close this as WONTFIX....  Objections?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2009-06-04 12:55 ` steven at gcc dot gnu dot org
@ 2009-06-04 13:25 ` aldot at gcc dot gnu dot org
  2009-06-04 13:42 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: aldot at gcc dot gnu dot org @ 2009-06-04 13:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from aldot at gcc dot gnu dot org  2009-06-04 13:24 -------
Well, without it fixed it's impossible to build libgfortran (and other apps)
with combine, which would be a very nice thing to have.
The sample patch above exposed no regressions fwiw.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/31537] duplicate weakref emitted with IMA
  2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2009-06-04 13:25 ` aldot at gcc dot gnu dot org
@ 2009-06-04 13:42 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-06-04 13:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2009-06-04 13:41 -------
We are getting LTO (and maybe LIPO), no need for -combine being fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31537


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-06-04 13:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-11 14:50 [Bug c/31537] New: duplicate weakref emitted with IMA aldot at gcc dot gnu dot org
2007-04-13 13:32 ` [Bug c/31537] " aldot at gcc dot gnu dot org
2007-05-02 20:23 ` geoffk at gcc dot gnu dot org
2007-05-02 20:43 ` aldot at gcc dot gnu dot org
2007-05-03 19:14 ` geoffk at gcc dot gnu dot org
2007-06-21 16:44 ` aldot at gcc dot gnu dot org
2008-01-02 20:57 ` aldot at gcc dot gnu dot org
2008-01-25  9:14 ` aldot at gcc dot gnu dot org
2008-01-25 18:54 ` aldot at gcc dot gnu dot org
2008-01-29 23:20 ` aldot at gcc dot gnu dot org
2008-03-14 16:47 ` rguenth at gcc dot gnu dot org
2008-09-16 19:19 ` aldot at gcc dot gnu dot org
2009-06-04 12:55 ` steven at gcc dot gnu dot org
2009-06-04 13:25 ` aldot at gcc dot gnu dot org
2009-06-04 13:42 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).