public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken)
@ 2003-07-25  9:11 aj at gcc dot gnu dot org
  2003-07-25 11:24 ` [Bug other/11669] " pinskia at physics dot uc dot edu
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: aj at gcc dot gnu dot org @ 2003-07-25  9:11 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] Calling of static functions does not
                    work (build of glibc broken)
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: other
        AssignedTo: geoffk at gcc dot gnu dot org
        ReportedBy: aj at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu

This is a testcase reduced from a failure to compile glibc on i686-linux-gnu
with current GCC:

gromit:~/tmp:[0]$ /opt/gcc/3.4-devel/bin/gcc -c test-failure.c -O2     
gromit:~/tmp:[0]$ nm test-failure.o 
00000010 T call_fixup
00000000 t fixup
gromit:~/tmp:[0]$ /opt/gcc/3.4-devel/bin/gcc -c test-failure.c -O2 -DUSE_DECLARATION
gromit:~/tmp:[0]$ nm test-failure.o 
00000010 T call_fixup
         U fixup
00000000 t fixup.0

The fixup.0 declaration is wrong here.  I suspect the IMI patches and assigned
it therefore to Geoff Keating.

To reproduce use the simple follwing simple code snippet:

#if USE_DECLARATION
/* Removing the prototype makes this work.  */
static int fixup (int i) __attribute__ ((used));
#endif

static int __attribute__ ((__used__))
fixup (int i)
{
  return i+1;
}

int
call_fixup (void)
{

  asm ("call fixup\n\t");

  return 0;
}


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
@ 2003-07-25 11:24 ` pinskia at physics dot uc dot edu
  2003-07-25 12:53 ` pinskia at physics dot uc dot edu
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-25 11:24 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-25 11:24 -------
I always thought using control instructions in asm is invalid and wrong to do?


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
  2003-07-25 11:24 ` [Bug other/11669] " pinskia at physics dot uc dot edu
@ 2003-07-25 12:53 ` pinskia at physics dot uc dot edu
  2003-07-25 14:44 ` schwab at suse dot de
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-25 12:53 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-25 12:53 -------
>From bug 11563:
You cannot alter control flow in an inline asm.  This is clearly documented.
So glibc is wrong here.


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
  2003-07-25 11:24 ` [Bug other/11669] " pinskia at physics dot uc dot edu
  2003-07-25 12:53 ` pinskia at physics dot uc dot edu
@ 2003-07-25 14:44 ` schwab at suse dot de
  2003-07-25 14:50 ` pinskia at physics dot uc dot edu
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: schwab at suse dot de @ 2003-07-25 14:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


schwab at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


------- Additional Comments From schwab at suse dot de  2003-07-25 14:44 -------
Please check more carefully.  This has nothing at all to do with control flow.  
GCC is generating the wrong label.  Just replace "call fixup" with "movl 
$fixup,%eax".


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-07-25 14:44 ` schwab at suse dot de
@ 2003-07-25 14:50 ` pinskia at physics dot uc dot edu
  2003-07-26  0:21 ` drow at mvista dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-25 14:50 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-25 14:50 -------
But you should never assume the name of static variable then so the code is still wrong.
The way to fix it is to use asm to make sure the name will be the same as the asm name.
#if USE_DECLARATION
/* Removing the prototype makes this work.  */
static int fixup (int i)__asm__("fixup") __attribute__ ((used)); 
#endif

static int __attribute__ ((__used__))
fixup (int i)
{
  return i+1;
}

int
call_fixup (void)
{

  asm ("call fixup\n\t");

  return 0;
}


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-07-25 14:50 ` pinskia at physics dot uc dot edu
@ 2003-07-26  0:21 ` drow at mvista dot com
  2003-07-26  5:27 ` aj at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: drow at mvista dot com @ 2003-07-26  0:21 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From drow at mvista dot com  2003-07-26 00:21 -------
Subject: Re:  [3.4 regression] Calling of static functions does not work (build of glibc broken)

This also "breaks" GDB in some cases.  We already decided to use the
old names for static functions in single-file mode.  Being inconsistent
about that is bad.


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2003-07-26  0:21 ` drow at mvista dot com
@ 2003-07-26  5:27 ` aj at gcc dot gnu dot org
  2003-07-26 10:16 ` geoffk at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aj at gcc dot gnu dot org @ 2003-07-26  5:27 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


aj at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


------- Additional Comments From aj at gcc dot gnu dot org  2003-07-26 05:27 -------
GCC changes behaviour and breaks in this way GCC and GDB.
For single-file mode the behaviour should not be changed.

I agree that for multiple-file mode, the usage of asm ("fixup") is the right way
but let's not force this for single-file - and it was already agreed on 
the mailing lists that this should be changed back.

Therefore I'm reopening the bug.


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2003-07-26  5:27 ` aj at gcc dot gnu dot org
@ 2003-07-26 10:16 ` geoffk at gcc dot gnu dot org
  2003-07-26 16:17 ` mec at shout dot net
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2003-07-26 10:16 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From geoffk at gcc dot gnu dot org  2003-07-26 10:16 -------
This should be fixed in current HEAD, with

        * c-decl.c (c_static_assembler_name): Remove TREE_STATIC test.


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2003-07-26 10:16 ` geoffk at gcc dot gnu dot org
@ 2003-07-26 16:17 ` mec at shout dot net
  2003-07-26 17:07 ` mec at shout dot net
  2003-07-26 18:37 ` geoffk at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mec at shout dot net @ 2003-07-26 16:17 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From mec at shout dot net  2003-07-26 16:17 -------
This happens to me on native i686-pc-linux-gnu with -gstabs+ with the following
source file:

  static void f1 ();
  static void f1 () { return; }
  static void f2 () { return; }

f1 is getting qualified as "f1.0".  f2 is not getting qualified, which is right.
 This causes gdb to not find the symbol "f1" with -gstabs+ debugging format.

I started a date search.  The bug did not happen with gcc HEAD from 2003-07-19
15:00:00 UTC, and it did happen with gcc HEAD from 2003-07-22 02:00:00 UTC.

Geoff K says it is fixed now and I am building a current compiler to try it out.


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2003-07-26 16:17 ` mec at shout dot net
@ 2003-07-26 17:07 ` mec at shout dot net
  2003-07-26 18:37 ` geoffk at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mec at shout dot net @ 2003-07-26 17:07 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From mec at shout dot net  2003-07-26 17:07 -------
It works for me.  Tested with gcc HEAD 2003-07-26 16:00:00 UTC, native
i686-pc-linux-gnu, binutils 2.14, -gstabs+.  Thanks!


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

* [Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)
  2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2003-07-26 17:07 ` mec at shout dot net
@ 2003-07-26 18:37 ` geoffk at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2003-07-26 18:37 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED


------- Additional Comments From geoffk at gcc dot gnu dot org  2003-07-26 18:37 -------
Confirmed fixed by mec@shout.net.


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

end of thread, other threads:[~2003-07-26 18:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-25  9:11 [Bug other/11669] New: [3.4 regression] Calling of static functions does not work (build of glibc broken) aj at gcc dot gnu dot org
2003-07-25 11:24 ` [Bug other/11669] " pinskia at physics dot uc dot edu
2003-07-25 12:53 ` pinskia at physics dot uc dot edu
2003-07-25 14:44 ` schwab at suse dot de
2003-07-25 14:50 ` pinskia at physics dot uc dot edu
2003-07-26  0:21 ` drow at mvista dot com
2003-07-26  5:27 ` aj at gcc dot gnu dot org
2003-07-26 10:16 ` geoffk at gcc dot gnu dot org
2003-07-26 16:17 ` mec at shout dot net
2003-07-26 17:07 ` mec at shout dot net
2003-07-26 18:37 ` geoffk 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).