public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called
@ 2003-09-08  0:35 mec at shout dot net
  2003-09-08  0:36 ` [Bug debug/12204] " mec at shout dot net
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mec at shout dot net @ 2003-09-08  0:35 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=12204

           Summary: [regression] gcc emits bogus .file when __inline__
                    called
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mec at shout dot net
                CC: gcc-bugs at gcc dot gnu dot org,jh at suse dot cz
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

gcc emits a bogus ".file" directive when an __inline__ function is called.

I will attach a full test program, before-and-after output, and so on.  Here is
a snippet of the test program:

  # 1 "z2.c"
  # 1 "/usr/include/sys/stat.h" 1 3
  # 337 "/usr/include/sys/stat.h" 3

  extern __inline__ int fstat ()
  {
    return 0;
  }

  #2 "z2.c" 2

  ...

  int
  test_fstat ()
  {
    marker1 ();
    fstat ();
    marker2 ();
    return 0;
  }

Here is the output from "gcc -gdwarf-2 -S":

  .globl main
          .type main, @function
  main:
  .LFB6:
          .file 2 "/usr/include/sys/stat.h"
          .loc 2 23 0
          pushl %ebp
  .LCFI7:
          movl %esp, %ebp

That ".file" directive is bogus!

This happens with gcc HEAD 2003-09-03 15:00:00 UTC.
It does not happen with gcc HEAD 2003-09-03 14:00:00 UTC.
The patch responsible is:

http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00000.html

Wed Sep  3 16:55:25 CEST 2003  Jan Hubicka  <jh@suse.cz>
+                                                                              
+       * Makefile.in (c-objc-common.o): Kill gt-c-objc-common.h dependency.
+       * c-decl.c (finish_function):  Kill arguments, always use cgraph path. 
+       * c-objc-common.c: Kill include of gt-c-objc-common.h
+       (expand_deferred_fns, deffer_fn): Kill function.                       
+       (deferred_fns): Kill variable.
+       (finish_cdtor): Update finish_function call.                           
+       (c_objc_common_finish_file): Always call cgraph code.
+       * c-parse.c: Regenerate.                                               
+       * c-parse.y: Regenerate.
+       * c-tree.h (finish_function): Update prototype.                        
+       * objc-acct.c (build_module_descriptor, finish_method_def):
+       Update call of finish_function.                                        
+       * cgraphunit.c (cgraph_default_inline_p, cgraph_analyze_function): Add
+       forward prototype.                                                     
+       (cgraph_finalize_function): In non-unit-at-a-time mode analyze the
+       function and assemble it if needed.                                    
+       (cgraph_finalize_compilation_unit): Do nothing in non-unit-at-a-time
+       mode.                                                                  
+       (cgraph_optimize): Likewise.
+       (cgraph_expand_function): In non-unit-at-a-time mode keep function body
+       even when it has no inline callees.
+       * c-parse.in: Update calls to finish_function.                          +

This is a regression against gcc 3.3.1, so I am marking it "P1", although it is
just normal severity.


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

* [Bug debug/12204] [regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
@ 2003-09-08  0:36 ` mec at shout dot net
  2003-09-08  0:37 ` mec at shout dot net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mec at shout dot net @ 2003-09-08  0:36 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=12204



------- Additional Comments From mec at shout dot net  2003-09-08 00:36 -------
Created an attachment (id=4713)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4713&action=view)
Input that triggers the bug

This is a .i file.  I started with fileio.c in the gdb test suite (which is
where I encountered the bug) and stripped it down to a minimal case.


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

* [Bug debug/12204] [regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
  2003-09-08  0:36 ` [Bug debug/12204] " mec at shout dot net
@ 2003-09-08  0:37 ` mec at shout dot net
  2003-09-08  0:39 ` mec at shout dot net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mec at shout dot net @ 2003-09-08  0: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=12204



------- Additional Comments From mec at shout dot net  2003-09-08 00:37 -------
Created an attachment (id=4714)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4714&action=view)
Assembly file before the bug

This is assembly output from "gcc -gdwarf-2 -S" with gcc HEAD 2003-09-03
14:00:00 UTC, before the bug started happening.


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

* [Bug debug/12204] [regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
  2003-09-08  0:36 ` [Bug debug/12204] " mec at shout dot net
  2003-09-08  0:37 ` mec at shout dot net
@ 2003-09-08  0:39 ` mec at shout dot net
  2003-09-10 19:07 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mec at shout dot net @ 2003-09-08  0:39 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=12204



------- Additional Comments From mec at shout dot net  2003-09-08 00:39 -------
Created an attachment (id=4715)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4715&action=view)
assembly output after the bug

This is assembly output from "gcc -gdwarf-2 -S" from 2003-09-03 15:00:00 UTC,
after the bug started happening.

The bad assembly line is the ".file ... stat.h" at the beginning of test_fstat.


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

* [Bug debug/12204] [regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
                   ` (2 preceding siblings ...)
  2003-09-08  0:39 ` mec at shout dot net
@ 2003-09-10 19:07 ` pinskia at gcc dot gnu dot org
  2003-09-11 15:58 ` [Bug debug/12204] [3.4 regression] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-10 19: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=12204


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4


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

* [Bug debug/12204] [3.4 regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
                   ` (3 preceding siblings ...)
  2003-09-10 19:07 ` pinskia at gcc dot gnu dot org
@ 2003-09-11 15:58 ` pinskia at gcc dot gnu dot org
  2003-09-11 21:03 ` mec at shout dot net
  2003-09-11 21:06 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-11 15:58 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=12204


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
            Summary|[regression] gcc emits bogus|[3.4 regression] gcc emits
                   |.file when __inline__ called|bogus .file when __inline__
                   |                            |called


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

* [Bug debug/12204] [3.4 regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
                   ` (4 preceding siblings ...)
  2003-09-11 15:58 ` [Bug debug/12204] [3.4 regression] " pinskia at gcc dot gnu dot org
@ 2003-09-11 21:03 ` mec at shout dot net
  2003-09-11 21:06 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mec at shout dot net @ 2003-09-11 21:03 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=12204



------- Additional Comments From mec at shout dot net  2003-09-11 21:03 -------
The bug has been fixed.  The symptoms no longer happens with gcc HEAD 2003-09-10
18:52:57 UTC.  I tested with the z2.i file attached to the bug report as well as
the original test case from the gdb test suite.

The patch which caused the bug was in the call graph code.  I haven't
regression-searched for the patch which fixes the bug, but given the changes in
the call graph code lately, I am comfortable that the bug got fixed "on purpose"
rather than "completely by accident".

gdb has a test case which stumbles on this (gdb.base/fileio.exp), so if the bug
happens again, I will notice it again.

It's okay with me to close this PR.  Happy day!


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

* [Bug debug/12204] [3.4 regression] gcc emits bogus .file when __inline__ called
  2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
                   ` (5 preceding siblings ...)
  2003-09-11 21:03 ` mec at shout dot net
@ 2003-09-11 21:06 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-11 21:06 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=12204


pinskia at gcc dot gnu dot org changed:

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-11 21:06 -------
Fixed according to the submitter.


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

end of thread, other threads:[~2003-09-11 21:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08  0:35 [Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called mec at shout dot net
2003-09-08  0:36 ` [Bug debug/12204] " mec at shout dot net
2003-09-08  0:37 ` mec at shout dot net
2003-09-08  0:39 ` mec at shout dot net
2003-09-10 19:07 ` pinskia at gcc dot gnu dot org
2003-09-11 15:58 ` [Bug debug/12204] [3.4 regression] " pinskia at gcc dot gnu dot org
2003-09-11 21:03 ` mec at shout dot net
2003-09-11 21:06 ` 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).