diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-10-23 22:39:59 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-10-23 22:39:59 +0200 |
commit | 6b10f1741a1d79c9e32e8790fb98ba93c864b219 (patch) | |
tree | 6be0cd9642ffdeb173e3fdad8079590f6f59e342 /gcc/dwarf2out.c | |
parent | b367de5dc31371f88b59e165aa6b8be4ed9ee070 (diff) | |
download | gcc-6b10f1741a1d79c9e32e8790fb98ba93c864b219.zip gcc-6b10f1741a1d79c9e32e8790fb98ba93c864b219.tar.gz gcc-6b10f1741a1d79c9e32e8790fb98ba93c864b219.tar.bz2 |
re PR debug/82630 (Bogus DW_AT_GNU_call_site_value)
PR debug/82630
* target.def (const_not_ok_for_debug_p): Default to
default_const_not_ok_for_debug_p instead of hook_bool_rtx_false.
* targhooks.h (default_const_not_ok_for_debug_p): New declaration.
* targhooks.c (default_const_not_ok_for_debug_p): New function.
* dwarf2out.c (const_ok_for_output_1): Only reject UNSPECs for
which targetm.const_not_ok_for_debug_p returned true.
* config/arm/arm.c (arm_const_not_ok_for_debug_p): Return true
for UNSPECs.
* config/powerpcspe/powerpcspe.c (rs6000_const_not_ok_for_debug_p):
Likewise.
* config/rs6000/rs6000.c (rs6000_const_not_ok_for_debug_p): Likewise.
* config/i386/i386.c (ix86_delegitimize_address_1): Don't delegitimize
UNSPEC_GOTOFF with addend into addend - _GLOBAL_OFFSET_TABLE_ + symbol
if !base_term_p.
(ix86_const_not_ok_for_debug_p): New function.
(i386_asm_output_addr_const_extra): Handle UNSPEC_GOTOFF.
(TARGET_CONST_NOT_OK_FOR_DEBUG_P): Redefine.
* g++.dg/guality/pr82630.C: New test.
From-SVN: r254025
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 81c95ec..dcc624e 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -13740,9 +13740,17 @@ expansion_failed (tree expr, rtx rtl, char const *reason) static bool const_ok_for_output_1 (rtx rtl) { - if (GET_CODE (rtl) == UNSPEC) + if (targetm.const_not_ok_for_debug_p (rtl)) { - /* If delegitimize_address couldn't do anything with the UNSPEC, assume + if (GET_CODE (rtl) != UNSPEC) + { + expansion_failed (NULL_TREE, rtl, + "Expression rejected for debug by the backend.\n"); + return false; + } + + /* If delegitimize_address couldn't do anything with the UNSPEC, and + the target hook doesn't explicitly allow it in debug info, assume we can't express it in the debug info. */ /* Don't complain about TLS UNSPECs, those are just too hard to delegitimize. Note this could be a non-decl SYMBOL_REF such as @@ -13769,13 +13777,6 @@ const_ok_for_output_1 (rtx rtl) return false; } - if (targetm.const_not_ok_for_debug_p (rtl)) - { - expansion_failed (NULL_TREE, rtl, - "Expression rejected for debug by the backend.\n"); - return false; - } - /* FIXME: Refer to PR60655. It is possible for simplification of rtl expressions in var tracking to produce such expressions. We should really identify / validate expressions |