aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-01-24 08:24:34 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-01-24 08:24:34 +0100
commit93bcc8c9ff361dbf3f42c9dcced458acfb5e994d (patch)
tree98b79c67cec7eff5791d93ba80cf2ec5abb1fbad /gcc/dwarf2out.c
parent9848887afad7b720d100d536ab35deb7d6c4396c (diff)
downloadgcc-93bcc8c9ff361dbf3f42c9dcced458acfb5e994d.zip
gcc-93bcc8c9ff361dbf3f42c9dcced458acfb5e994d.tar.gz
gcc-93bcc8c9ff361dbf3f42c9dcced458acfb5e994d.tar.bz2
re PR target/51957 (ppc64 .debug_loc toc reference)
PR target/51957 * target.def (const_not_ok_for_debug_p): New hook. * doc/tm.texi.in (TARGET_CONST_NOT_OK_FOR_DEBUG_P): New hook documentation. * doc/tm.texi: Regenerated. * dwarf2out.c (const_ok_for_output_1): If targetm.const_not_ok_for_debug_p returns true, fail. * config/rs6000/rs6000.c (rs6000_const_not_ok_for_debug_p): New function. (TARGET_CONST_NOT_OK_FOR_DEBUG_P): Redefine. * gcc.dg/pr51957-1.c: New test. * gcc.dg/pr51957-1.h: New file. * gcc.dg/pr51957-2.c: New test. From-SVN: r183468
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ed279ba..fee5c60 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10683,6 +10683,13 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
return 1;
}
+ if (targetm.const_not_ok_for_debug_p (rtl))
+ {
+ expansion_failed (NULL_TREE, rtl,
+ "Expression rejected for debug by the backend.\n");
+ return 1;
+ }
+
if (GET_CODE (rtl) != SYMBOL_REF)
return 0;