public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37509]  New: __sync_fetch_and_xxx generates relocatable symbols
@ 2008-09-13 14:48 timothy dot krause at shaw dot ca
  2008-09-13 15:25 ` [Bug c/37509] " timothy dot krause at shaw dot ca
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: timothy dot krause at shaw dot ca @ 2008-09-13 14:48 UTC (permalink / raw)
  To: gcc-bugs

When __sync_fetch_and_xxx builtin functions are required to store the return
value the compiler generates an undefined reference during the link stage.

void main( void )
{
 long a=0;
 #ifndef SHOW_BUG
   __sync_fetch_and_add(&a,1); /* works just fine */
 #else
  a=__sync_fetch_and_add(&a,1); /* creates an undefined symbol */
 #endif
}


-- 
           Summary: __sync_fetch_and_xxx generates relocatable symbols
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: timothy dot krause at shaw dot ca


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


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

* [Bug c/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
@ 2008-09-13 15:25 ` timothy dot krause at shaw dot ca
  2008-09-13 22:09 ` paolo dot carlini at oracle dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: timothy dot krause at shaw dot ca @ 2008-09-13 15:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from timothy dot krause at shaw dot ca  2008-09-13 15:24 -------
Tracing the parser suggests that the problem is in the
expand_sync_fetch_operation of optabs.c in gcc-4.3.2


-- 

timothy dot krause at shaw dot ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timothy dot krause at shaw
                   |                            |dot ca


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


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

* [Bug c/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
  2008-09-13 15:25 ` [Bug c/37509] " timothy dot krause at shaw dot ca
@ 2008-09-13 22:09 ` paolo dot carlini at oracle dot com
  2008-09-13 22:26 ` paolo dot carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-09-13 22:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from paolo dot carlini at oracle dot com  2008-09-13 22:07 -------
Host / Target / Build please...


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug c/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
  2008-09-13 15:25 ` [Bug c/37509] " timothy dot krause at shaw dot ca
  2008-09-13 22:09 ` paolo dot carlini at oracle dot com
@ 2008-09-13 22:26 ` paolo dot carlini at oracle dot com
  2008-09-14  2:04 ` [Bug middle-end/37509] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-09-13 22:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo dot carlini at oracle dot com  2008-09-13 22:25 -------
To be clear, I suspect you are on something like i?86-*, and in that case for
the default arch (-march=i386) this is the expected behavior...


-- 


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


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

* [Bug middle-end/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
                   ` (2 preceding siblings ...)
  2008-09-13 22:26 ` paolo dot carlini at oracle dot com
@ 2008-09-14  2:04 ` pinskia at gcc dot gnu dot org
  2008-09-23 22:54 ` timothy dot krause at shaw dot ca
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-14  2:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-09-14 02:03 -------
This is invalid, it is the issue which Paolo mentioned.  I tried this on
PowerPC Linux and it works correctly.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
          Component|c                           |middle-end
         Resolution|                            |FIXED


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


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

* [Bug middle-end/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
                   ` (3 preceding siblings ...)
  2008-09-14  2:04 ` [Bug middle-end/37509] " pinskia at gcc dot gnu dot org
@ 2008-09-23 22:54 ` timothy dot krause at shaw dot ca
  2008-09-23 22:57 ` timothy dot krause at shaw dot ca
  2008-09-23 23:52 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: timothy dot krause at shaw dot ca @ 2008-09-23 22:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from timothy dot krause at shaw dot ca  2008-09-23 22:53 -------
Setting
CFLAGS="-m32 -march=i686 -O2"
fixed the problem for
host=i686-pc-linux-gnu
target=i686-pc-linux-gnu
I later noticed that configure has a --with-cpu option. This generates a
-mcpu=i?86 option which also works but is depricated.
Thanks to Paolo Carlini for this fix.


-- 

timothy dot krause at shaw dot ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|                            |i686-pc-linux-gnu
 GCC target triplet|                            |i686-pc-linux-gnu


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


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

* [Bug middle-end/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
                   ` (4 preceding siblings ...)
  2008-09-23 22:54 ` timothy dot krause at shaw dot ca
@ 2008-09-23 22:57 ` timothy dot krause at shaw dot ca
  2008-09-23 23:52 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: timothy dot krause at shaw dot ca @ 2008-09-23 22:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from timothy dot krause at shaw dot ca  2008-09-23 22:56 -------
(In reply to comment #5)
> Setting
> CFLAGS="-m32 -march=i686 -O2"
> fixed the problem for
> host=i686-pc-linux-gnu
> target=i686-pc-linux-gnu
> I later noticed that configure has a --with-cpu option. This generates a
> -mcpu=i?86 option which also works but is deprecated.
> Thanks to Paolo Carlini for this fix.
> 


-- 


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


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

* [Bug middle-end/37509] __sync_fetch_and_xxx generates relocatable symbols
  2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
                   ` (5 preceding siblings ...)
  2008-09-23 22:57 ` timothy dot krause at shaw dot ca
@ 2008-09-23 23:52 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-23 23:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2008-09-23 23:51 -------
You want --with-arch or -march=i686.


-- 


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


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

end of thread, other threads:[~2008-09-23 23:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-13 14:48 [Bug c/37509] New: __sync_fetch_and_xxx generates relocatable symbols timothy dot krause at shaw dot ca
2008-09-13 15:25 ` [Bug c/37509] " timothy dot krause at shaw dot ca
2008-09-13 22:09 ` paolo dot carlini at oracle dot com
2008-09-13 22:26 ` paolo dot carlini at oracle dot com
2008-09-14  2:04 ` [Bug middle-end/37509] " pinskia at gcc dot gnu dot org
2008-09-23 22:54 ` timothy dot krause at shaw dot ca
2008-09-23 22:57 ` timothy dot krause at shaw dot ca
2008-09-23 23:52 ` pinskia 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).