From: Jakub Jelinek Date: Sat, 22 Mar 2014 07:18:38 +0000 (+0100) Subject: re PR debug/60603 (.debug_macinfo/.debug_macro has wrong line numbers for built-in... X-Git-Tag: releases/gcc-4.9.0~349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b35e0fa0818e426f3de1ec900db2b969e8f212a6;p=thirdparty%2Fgcc.git 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 . fortran/ * cpp.c (gfc_cpp_init): Restore cb_change_file call to . testsuite/ * gcc.dg/debug/dwarf2/dwarf2-macro2.c: New test. From-SVN: r208763 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 4e5aea468415..536b4fc4ca25 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-03-22 Jakub Jelinek + + PR debug/60603 + * c-opts.c (c_finish_options): Restore cb_file_change call to + . + 2014-03-13 Jakub Jelinek PR middle-end/36282 diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 92ba481390df..e162e49a18a8 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, + _(""), 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 ef330df9fda3..3e4d08d68c08 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-03-22 Jakub Jelinek + + PR debug/60603 + * cpp.c (gfc_cpp_init): Restore cb_change_file call to + . + 2014-03-21 Jerry DeLisle PR fortran/60148 diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index 68ce91ffdbf5..169599003db4 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, _("")); 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 c2e77fbe2dc7..3b22af8d9d97 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-22 Jakub Jelinek + + PR debug/60603 + * gcc.dg/debug/dwarf2/dwarf2-macro2.c: New test. + 2014-03-21 Paolo Carlini * 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 000000000000..3dfa2908ef36 --- /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;