aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-04-06 19:28:54 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-04-06 19:28:54 +0200
commitc617fb562d510101b5445464753858a557020acb (patch)
treeca7aea9f6caf538d42053af6fca7c822bc66bc11 /gcc/dwarf2out.c
parent49574486e65c03100fbf2993804ccc6dbb9051e6 (diff)
downloadgcc-c617fb562d510101b5445464753858a557020acb.zip
gcc-c617fb562d510101b5445464753858a557020acb.tar.gz
gcc-c617fb562d510101b5445464753858a557020acb.tar.bz2
re PR debug/85252 (ICE with -g for static zero-length array initialization)
PR debug/85252 * dwarf2out.c (rtl_for_decl_init): For STRING_CST initializer only build CONST_STRING if TYPE_MAX_VALUE is non-NULL and is INTEGER_CST. * gcc.dg/debug/pr85252.c: New test. From-SVN: r259183
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7933054..50a41c5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19596,6 +19596,8 @@ rtl_for_decl_init (tree init, tree type)
if (is_int_mode (TYPE_MODE (enttype), &mode)
&& GET_MODE_SIZE (mode) == 1
&& domain
+ && TYPE_MAX_VALUE (domain)
+ && TREE_CODE (TYPE_MAX_VALUE (domain)) == INTEGER_CST
&& integer_zerop (TYPE_MIN_VALUE (domain))
&& compare_tree_int (TYPE_MAX_VALUE (domain),
TREE_STRING_LENGTH (init) - 1) == 0