This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/12204] New: [regression] gcc emits bogus .file when __inline__ called


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]