From ef20d2215067b1bfa8b3f9549ca0baed636a94a0 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 18 Sep 2019 09:43:10 +0000 Subject: [PATCH] Two more POLY_INT cases for dwarf2out.c loc_list_for_tree_1 and add_const_value_attribute currently ICE on POLY_INTs. loc_list_for_tree_1 can do something sensible but add_const_value_attribute has to punt, since the constant there needs to be a link-time rather than load-time or run-time constant. This is tested by later SVE patches. 2019-09-18 Richard Sandiford gcc/ * dwarf2out.c (loc_list_from_tree_1): Handle POLY_INT_CST. (add_const_value_attribute): Handle CONST_POLY_INT. From-SVN: r275868 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5407096dff1..7f8425ba0f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-09-18 Richard Sandiford + + * dwarf2out.c (loc_list_from_tree_1): Handle POLY_INT_CST. + (add_const_value_attribute): Handle CONST_POLY_INT. + 2019-09-18 Martin Liska * dbgcnt.def (store_merging): New counter. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5698c82f7df..cec25fa5fa2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18568,6 +18568,24 @@ loc_list_from_tree_1 (tree loc, int want_address, } break; + case POLY_INT_CST: + { + if (want_address) + { + expansion_failed (loc, NULL_RTX, + "constant address with a runtime component"); + return 0; + } + poly_int64 value; + if (!poly_int_tree_p (loc, &value)) + { + expansion_failed (loc, NULL_RTX, "constant too big"); + return 0; + } + ret = int_loc_descriptor (value); + } + break; + case CONSTRUCTOR: case REAL_CST: case STRING_CST: @@ -19684,6 +19702,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) case MINUS: case SIGN_EXTEND: case ZERO_EXTEND: + case CONST_POLY_INT: return false; case MEM: -- 2.30.2