public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/35597]  New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX
@ 2008-03-15  2:54 dje at gcc dot gnu dot org
  2008-03-15  2:55 ` [Bug libstdc++/35597] " dje at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-03-15  2:54 UTC (permalink / raw)
  To: gcc-bugs

"-g" was added to CXXFLAGS in the GLIBCXX_CHECK_COMPILER_FEATURES configure
test in libstdc++.  This option causes G++ to warn: "-ffunction-sections may
affect debugging on some targets".  CXXFLAGS also includes "-Werror" causing
the warning to become an error.  This results in -ffunction-sections
-fdata-sections being disabled.

"-ffunction-sections -fdata-sections" works fine on AIX and should be used
because it generates functions as intended and improves performance by allowing
the AIX linker to reorder functions.


-- 
           Summary: libstdc++ -ffunction-sections -fdata-sections disabled
                    on AIX
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: major
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dje at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.3.0.0
  GCC host triplet: powerpc-ibm.aix5.3.0.0
GCC target triplet: powerpc-ibm-aix5.3.0.0


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
@ 2008-03-15  2:55 ` dje at gcc dot gnu dot org
  2008-03-15 10:46 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-03-15  2:55 UTC (permalink / raw)
  To: gcc-bugs



-- 

dje at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.3.0
      Known to work|                            |4.2.3
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-15 02:54:39
               date|                            |


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
  2008-03-15  2:55 ` [Bug libstdc++/35597] " dje at gcc dot gnu dot org
@ 2008-03-15 10:46 ` rguenth at gcc dot gnu dot org
  2008-03-15 13:33 ` dje at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-15 10:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-03-15 10:46 -------
So isn't this a target bug then?  That is, the warning should be disabled for
targets that "work"?


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
  2008-03-15  2:55 ` [Bug libstdc++/35597] " dje at gcc dot gnu dot org
  2008-03-15 10:46 ` rguenth at gcc dot gnu dot org
@ 2008-03-15 13:33 ` dje at gcc dot gnu dot org
  2008-03-20 16:17 ` bkoz at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-03-15 13:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dje at gcc dot gnu dot org  2008-03-15 13:32 -------
The change was applied to libstdc++.  The patch affects building libstdc++.

The warning was added in 1996 for all targets and debugging formats:

Mon Apr 15 03:43:11 1996  Jeffrey A. Law  <law@cygnus.com>
        * toplev.c (compile_file): Add warnings when -ffunction-sections is
        used with -g, or profiling.

The warning was disabled for ELF in 1999 and later for MACH-O.  If we disable
the warning for all object file formats, what's the point of the warning?


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-03-15 13:33 ` dje at gcc dot gnu dot org
@ 2008-03-20 16:17 ` bkoz at gcc dot gnu dot org
  2008-03-20 22:20 ` brian at dessent dot net
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-03-20 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bkoz at gcc dot gnu dot org  2008-03-20 16:16 -------
From:
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01135.html

2007-05-17  Benjamin Kosnik  <bkoz@redhat.com>

        * acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Add -g to
        compile flags, move code to test to global scope.
        * configure: Regenerate.


David says that -ffunction-sections -g works on AIX. Presumably this means that
it should also not warn. 

Question to me is, what is the behavior on cygwin? Does -ffunction-sections -g
work? Does it warn?

-benjamin


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-03-20 16:17 ` bkoz at gcc dot gnu dot org
@ 2008-03-20 22:20 ` brian at dessent dot net
  2008-04-09 14:42 ` dje at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: brian at dessent dot net @ 2008-03-20 22:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from brian at dessent dot net  2008-03-20 22:19 -------
Subject: Re:  libstdc++ -ffunction-sections -fdata-sections 
 disabled on AIX

bkoz at gcc dot gnu dot org wrote:

> Question to me is, what is the behavior on cygwin? Does -ffunction-sections -g
> work? Does it warn?

Yes it warns, and yes this warning needs to die.  I see no problem
debugging with -ffunction-sections on Cygwin:

$ cat <<EOF >tc.c

int func1 (int a)
{
  return a + 1;
}

int func2 (int a)
{
  return a + 1;
}

int func3 (int a)
{
  return a + 1;
}

int func4 (int a)
{
  return a + 1;
}

int func5 (int a)
{
  return a + 1;
}

int func6 (int a)
{
  return a + 1;
}

int func7 (int a)
{
  return a + 1;
}

int func8 (int a)
{
  return a + 1;
}

int main (int argc, char **argv)
{
  return func5 (func6 (func7 (func8 (argc)))) * 
         func4 (func3 (func2 (func1 (argc))));
}
EOF

$ gcc -ggdb3 -ffunction-sections -fdata-sections -c tc.c -o tc.o
tc.c:1: warning: -ffunction-sections may affect debugging on some
targets

$ objdump -h tc.o | egrep '\.text'
  0 .text         00000000  00000000  00000000  00000000  2**4
  7 .text$func1   0000000c  00000000  00000000  00000e8b  2**2
  8 .text$func2   0000000c  00000000  00000000  00000e97  2**2
  9 .text$func3   0000000c  00000000  00000000  00000ea3  2**2
 10 .text$func4   0000000c  00000000  00000000  00000eaf  2**2
 11 .text$func5   0000000c  00000000  00000000  00000ebb  2**2
 12 .text$func6   0000000c  00000000  00000000  00000ec7  2**2
 13 .text$func7   0000000c  00000000  00000000  00000ed3  2**2
 14 .text$func8   0000000c  00000000  00000000  00000edf  2**2
 15 .text$main    00000080  00000000  00000000  00000eeb  2**2

$ gcc tc.o -o tc

$ gdb --quiet tc
(gdb) start
Breakpoint 1 at 0x4013c6: file tc.c, line 43.
[New thread 3064.0xee4]
[New thread 3064.0x19a4]
main (argc=1, argv=0x6aa1a8) at tc.c:43
43      {
(gdb) rbreak func[1-8]
Breakpoint 2 at 0x401343: file tc.c, line 4.
int func1(int);
Breakpoint 3 at 0x40134f: file tc.c, line 9.
int func2(int);
Breakpoint 4 at 0x40135b: file tc.c, line 14.
int func3(int);
Breakpoint 5 at 0x401367: file tc.c, line 19.
int func4(int);
Breakpoint 6 at 0x401373: file tc.c, line 24.
int func5(int);
Breakpoint 7 at 0x40137f: file tc.c, line 29.
int func6(int);
Breakpoint 8 at 0x40138b: file tc.c, line 34.
int func7(int);
Breakpoint 9 at 0x401397: file tc.c, line 39.
int func8(int);
(gdb) disp/i $pc
(gdb) c

Breakpoint 9, func8 (a=1) at tc.c:39
39        return a + 1;
1: x/i $pc
0x401397 <func8+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 8, func7 (a=2) at tc.c:34
34        return a + 1;
1: x/i $pc
0x40138b <func7+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 7, func6 (a=3) at tc.c:29
29        return a + 1;
1: x/i $pc
0x40137f <func6+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 6, func5 (a=4) at tc.c:24
24        return a + 1;
1: x/i $pc
0x401373 <func5+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 2, func1 (a=1) at tc.c:4
4         return a + 1;
1: x/i $pc
0x401343 <func1+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 3, func2 (a=2) at tc.c:9
9         return a + 1;
1: x/i $pc
0x40134f <func2+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 4, func3 (a=3) at tc.c:14
14        return a + 1;
1: x/i $pc
0x40135b <func3+3>:     mov    0x8(%ebp),%eax
(gdb)

Breakpoint 5, func4 (a=4) at tc.c:19
19        return a + 1;
1: x/i $pc
0x401367 <func4+3>:     mov    0x8(%ebp),%eax
(gdb)

Program exited with code 014400.
(gdb) quit


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-03-20 22:20 ` brian at dessent dot net
@ 2008-04-09 14:42 ` dje at gcc dot gnu dot org
  2008-04-14 20:09 ` bkoz at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-04-09 14:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dje at gcc dot gnu dot org  2008-04-09 14:41 -------
Subject: Bug 35597

Author: dje
Date: Wed Apr  9 14:41:07 2008
New Revision: 134143

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134143
Log:
        PR libstdc++/35597
        * toplev.c (process_options): Remove -ffunction-sections debugging
        warning.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/toplev.c


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-04-09 14:42 ` dje at gcc dot gnu dot org
@ 2008-04-14 20:09 ` bkoz at gcc dot gnu dot org
  2008-04-24 16:59 ` bkoz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-14 20:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from bkoz at gcc dot gnu dot org  2008-04-14 20:08 -------

David, can you put this fix on gcc-4_3-branch and close this PR please?


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-04-14 20:09 ` bkoz at gcc dot gnu dot org
@ 2008-04-24 16:59 ` bkoz at gcc dot gnu dot org
  2008-04-24 18:00 ` dje at gcc dot gnu dot org
  2008-04-24 18:07 ` dje at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-24 16:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from bkoz at gcc dot gnu dot org  2008-04-24 16:58 -------

Second ping. David, I'm setting the target milestone to 4.3.1 for this. Can you
please check in your patch to gcc-4_3-branch?


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.1


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-04-24 16:59 ` bkoz at gcc dot gnu dot org
@ 2008-04-24 18:00 ` dje at gcc dot gnu dot org
  2008-04-24 18:07 ` dje at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-04-24 18:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dje at gcc dot gnu dot org  2008-04-24 17:59 -------
Subject: Bug 35597

Author: dje
Date: Thu Apr 24 17:59:01 2008
New Revision: 134644

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134644
Log:
        PR libstdc++/35597
        * toplev.c (process_options): Remove -ffunction-sections debugging
        warning.

Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/toplev.c


-- 


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


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

* [Bug libstdc++/35597] libstdc++ -ffunction-sections -fdata-sections disabled on AIX
  2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-04-24 18:00 ` dje at gcc dot gnu dot org
@ 2008-04-24 18:07 ` dje at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-04-24 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dje at gcc dot gnu dot org  2008-04-24 18:06 -------
Well, I did not receive your second ping.  But I was traveling and had been
planning to check it in today.


-- 

dje at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-04-24 18:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-15  2:54 [Bug libstdc++/35597] New: libstdc++ -ffunction-sections -fdata-sections disabled on AIX dje at gcc dot gnu dot org
2008-03-15  2:55 ` [Bug libstdc++/35597] " dje at gcc dot gnu dot org
2008-03-15 10:46 ` rguenth at gcc dot gnu dot org
2008-03-15 13:33 ` dje at gcc dot gnu dot org
2008-03-20 16:17 ` bkoz at gcc dot gnu dot org
2008-03-20 22:20 ` brian at dessent dot net
2008-04-09 14:42 ` dje at gcc dot gnu dot org
2008-04-14 20:09 ` bkoz at gcc dot gnu dot org
2008-04-24 16:59 ` bkoz at gcc dot gnu dot org
2008-04-24 18:00 ` dje at gcc dot gnu dot org
2008-04-24 18:07 ` dje 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).