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

--- Comment #7 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-05-24 
19:35:09 UTC ---
Are we really sure that gen_compile_unit_die() shouldn't being emitting calling
add_comp_dir_attribute  in this case. It seems that the origin of test...

      /* Don't add cwd for <built-in>.  */
      if (!IS_ABSOLUTE_PATH (filename) && filename[0] != '<')
        add_comp_dir_attribute (die);

Dates back to...

Author: amylaar
Date:   Wed Jun 4 17:19:36 2003 UTC (8 years, 11 months ago)
Changed paths:  3
Log Message:
        * c-decl.c (c_init_decl_processing): Clear input_file_name
        while building common nodes.
        * dwarf2out.c (gen_compile_unit_die, dwarf2out_finish):
        Don't add working directory for strings like <built-in> .

The reasoning for that change is described in the patch proposal at
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00149.html
which says...

I have found that pch/system-1.c fails on sh-elf because
the function that is called by BUILD_VA_LIST_TYPE generates
some declarations which end up in the debugging output for
this testcase.  toplev.c has previously set the input filename
to that of the main file - which is different when you compile
a header than when you do an ordinary source compilation.
This causes an anadorned "system-1.h" to be considered among
the source files in the pch case (even though it does nothing
but include other header files).  When dwarf2out sees an input
file without a dir separator, it puts the current working directory
in the list of directories to search.

The patch was revised a number of times...

http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00289.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00151.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00279.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00284.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00289.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00301.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00303.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00308.html
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00337.html

Reading through reviews doesn't give much confidence that this code is test is
bullet-proof.

Reply via email to