https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82630
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Oct 23 20:39:59 2017 New Revision: 254025 URL: https://gcc.gnu.org/viewcvs?rev=254025&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/guality/pr82630.C Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/config/i386/i386.c trunk/gcc/config/powerpcspe/powerpcspe.c trunk/gcc/config/rs6000/rs6000.c trunk/gcc/dwarf2out.c trunk/gcc/target.def trunk/gcc/targhooks.c trunk/gcc/targhooks.h trunk/gcc/testsuite/ChangeLog