diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-03-22 08:18:38 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-03-22 08:18:38 +0100 |
commit | b35e0fa0818e426f3de1ec900db2b969e8f212a6 (patch) | |
tree | d27174ed6e79ae0b0010eaf708bb6fbc53a18b8d | |
parent | e10bd1cacc141e20f78ead2a0f07c009d95ba4c3 (diff) | |
download | gcc-b35e0fa0818e426f3de1ec900db2b969e8f212a6.zip gcc-b35e0fa0818e426f3de1ec900db2b969e8f212a6.tar.gz gcc-b35e0fa0818e426f3de1ec900db2b969e8f212a6.tar.bz2 |
re PR debug/60603 (.debug_macinfo/.debug_macro has wrong line numbers for built-in macros)
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
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-opts.c | 19 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/cpp.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c | 7 |
6 files changed, 35 insertions, 9 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 4e5aea4..536b4fc 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -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 diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 92ba481..e162e49 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -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) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ef330df..3e4d08d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index 68ce91f..1695990 100644 --- a/gcc/fortran/cpp.c +++ b/gcc/fortran/cpp.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c2e77fb..3b22af8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..3dfa290 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c @@ -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; |