]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/60603 (.debug_macinfo/.debug_macro has wrong line numbers for built-in...
authorJakub Jelinek <jakub@redhat.com>
Sat, 22 Mar 2014 07:18:38 +0000 (08:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 22 Mar 2014 07:18:38 +0000 (08:18 +0100)
PR debug/60603
c-family/
* c-opts.c (c_finish_options): Restore cb_file_change call to
<built-in>.
fortran/
* cpp.c (gfc_cpp_init): Restore cb_change_file call to
<built-in>.
testsuite/
* gcc.dg/debug/dwarf2/dwarf2-macro2.c: New test.

From-SVN: r208763

gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/fortran/ChangeLog
gcc/fortran/cpp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c [new file with mode: 0644]

index 4e5aea468415321d754548d2b31cca092e856554..536b4fc4ca2566d194282470384639ab8ba37b1c 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/60603
+       * c-opts.c (c_finish_options): Restore cb_file_change call to
+       <built-in>.
+
 2014-03-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/36282
index 92ba481390df90cf133d0659fedc2daf95a48eec..e162e49a18a8bb6275e49caabc268a051f2d106d 100644 (file)
@@ -1274,17 +1274,18 @@ c_finish_options (void)
     {
       size_t i;
 
-      {
-       /* Make sure all of the builtins about to be declared have
-         BUILTINS_LOCATION has their source_location.  */
-       source_location builtins_loc = BUILTINS_LOCATION;
-       cpp_force_token_locations (parse_in, &builtins_loc);
+      cb_file_change (parse_in,
+                     linemap_add (line_table, LC_RENAME, 0,
+                                  _("<built-in>"), 0));
+      /* Make sure all of the builtins about to be declared have
+        BUILTINS_LOCATION has their source_location.  */
+      source_location builtins_loc = BUILTINS_LOCATION;
+      cpp_force_token_locations (parse_in, &builtins_loc);
 
-       cpp_init_builtins (parse_in, flag_hosted);
-       c_cpp_builtins (parse_in);
+      cpp_init_builtins (parse_in, flag_hosted);
+      c_cpp_builtins (parse_in);
 
-       cpp_stop_forcing_token_locations (parse_in);
-      }
+      cpp_stop_forcing_token_locations (parse_in);
 
       /* We're about to send user input to cpplib, so make it warn for
         things that we previously (when we sent it internal definitions)
index ef330df9fda382660e5078947e873222f15419f7..3e4d08d68c08b5096ce74085a7300e0ac47cd9fb 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/60603
+       * cpp.c (gfc_cpp_init): Restore cb_change_file call to
+       <built-in>.
+
 2014-03-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/60148
index 68ce91ffdbf5c7aa66693e695d95ea3bec4dbf7d..169599003db400ff2e36d094db324b4fb0bc5ca5 100644 (file)
@@ -576,6 +576,7 @@ gfc_cpp_init (void)
   if (gfc_option.flag_preprocessed)
     return;
 
+  cpp_change_file (cpp_in, LC_RENAME, _("<built-in>"));
   if (!gfc_cpp_option.no_predefined)
     {
       /* Make sure all of the builtins about to be declared have
index c2e77fbe2dc7fd67acd0853375a0d1b230a454bf..3b22af8d9d977531516a25ee236e4dfcedfbf21f 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/60603
+       * gcc.dg/debug/dwarf2/dwarf2-macro2.c: New test.
+
 2014-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * g++.dg/cpp1y/pr60033.C: Use target c++1y.
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c
new file mode 100644 (file)
index 0000000..3dfa290
--- /dev/null
@@ -0,0 +1,7 @@
+/* Test to make sure the macro info includes the predefined macros with line number 0.  */
+/* { dg-do compile } */
+/* { dg-options "-g3 -gdwarf -dA -fverbose-asm" } */
+/* { dg-final { scan-assembler "At line number 0" } } */
+
+#define FOO 1
+int i;