This is the mail archive of the gcc-patches@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]

gcc -save-temps emits incorrect debug info in 3.4 (breaks distcc bootstraps)


Per,

Is there any reason why this bit, that made it to mainline, was
missing in the 3.4 branch?  Without it, the initial .file directive
refers to the .i file instead of the original .c file.

I'm bootstrapping and regression-testing this patch in 3.4.  Mark, if
it passes without regressions, is this ok for the branch?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* cppinit.c (cpp_read_main_file): Return file name obtained by
	read_original_filename.  Missed in 2004-02-04's check in to 3.4
	branch by Per Bothner.

Index: gcc/cppinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.297.6.3
diff -u -p -r1.297.6.3 cppinit.c
--- gcc/cppinit.c 7 Feb 2004 14:33:11 -0000 1.297.6.3
+++ gcc/cppinit.c 4 Apr 2004 15:16:36 -0000
@@ -475,8 +475,10 @@ cpp_read_main_file (cpp_reader *pfile, c
   /* For foo.i, read the original filename foo.c now, for the benefit
      of the front ends.  */
   if (CPP_OPTION (pfile, preprocessed))
-    read_original_filename (pfile);
-
+    {
+      read_original_filename (pfile);
+      fname = pfile->map->to_file;
+    }
   return fname;
 }
 
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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