public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/22069] New: "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs
@ 2005-06-14 22:38 bhavesh at avaya dot com
  2005-06-14 22:44 ` [Bug debug/22069] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bhavesh at avaya dot com @ 2005-06-14 22:38 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following code snippet with "gcc -gstabs+ -O3 -c" will expose the 
bug:
------------------stabs.c-------------------
int func1(int parm1)
{
        static int func2(void);
        int var1=0;

        if (parm1 == 10) {
                var1=func2();
        }

        return var1;
}

static int func2()
{
        return 20;
}
---------------------------end---------------------------
nm -Can stabs.o:
         U func2  <<<<---- Shouldn't be generated since it is inlined
00000000 t
00000000 d
00000000 b
00000000 n
00000000 N
00000000 N
00000000 n
00000000 T func1
00000000 a stabs.c

-------------------------------------
gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-
checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-
exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.1)

-- 
           Summary: "gcc -gstabs+ -O3" generates erroneous stabs for inlined
                    funcs
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bhavesh at avaya dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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


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

* [Bug debug/22069] "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs
  2005-06-14 22:38 [Bug debug/22069] New: "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs bhavesh at avaya dot com
@ 2005-06-14 22:44 ` pinskia at gcc dot gnu dot org
  2005-06-14 22:51 ` bhavesh at avaya dot com
  2005-06-14 22:55 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-14 22:44 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 705 bytes --]


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-14 22:44 -------
The code is invalid and gives errors from 4.0.0 and above:
t.c: In function ‘func1’:
t.c:3: error: invalid storage class for function ‘func2’
t.c: At top level:
t.c:14: error: static declaration of ‘func2’ follows non-static declaration
t.c:7: error: previous implicit declaration of ‘func2’ was here

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


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


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

* [Bug debug/22069] "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs
  2005-06-14 22:38 [Bug debug/22069] New: "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs bhavesh at avaya dot com
  2005-06-14 22:44 ` [Bug debug/22069] " pinskia at gcc dot gnu dot org
@ 2005-06-14 22:51 ` bhavesh at avaya dot com
  2005-06-14 22:55 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: bhavesh at avaya dot com @ 2005-06-14 22:51 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]


------- Additional Comments From bhavesh at avaya dot com  2005-06-14 22:51 -------
(In reply to comment #1)
> The code is invalid and gives errors from 4.0.0 and above:
> t.c: In function ‘func1’:
> t.c:3: error: invalid storage class for function ‘func2’
> t.c: At top level:
> t.c:14: error: static declaration of ‘func2’ follows non-static declaration
> t.c:7: error: previous implicit declaration of ‘func2’ was here

Okay. What about this, then:

int func1(int parm1)
{
        static int func2();
        int var1=0;

        if (parm1 == 10) {
                var1=func2();
        }

        return var1;
}

static int func2()
{
        return 20;
}


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


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


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

* [Bug debug/22069] "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs
  2005-06-14 22:38 [Bug debug/22069] New: "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs bhavesh at avaya dot com
  2005-06-14 22:44 ` [Bug debug/22069] " pinskia at gcc dot gnu dot org
  2005-06-14 22:51 ` bhavesh at avaya dot com
@ 2005-06-14 22:55 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-14 22:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-14 22:55 -------
Still invalid code.   You have a declare a static function inside in a function which is invalid.

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


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


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

end of thread, other threads:[~2005-06-14 22:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-14 22:38 [Bug debug/22069] New: "gcc -gstabs+ -O3" generates erroneous stabs for inlined funcs bhavesh at avaya dot com
2005-06-14 22:44 ` [Bug debug/22069] " pinskia at gcc dot gnu dot org
2005-06-14 22:51 ` bhavesh at avaya dot com
2005-06-14 22:55 ` 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).