The following removes the location from CSWTCH variables which are
DECL_IGNORED_P and have no DECL_CONTEXT. The location is currently
taken from the gswitch statement and thus includes a BLOCK reference
which can eventually be elided and GCd, causing later ICEs when
ICF decides to merge the variable with some other.
PR tree-optimization/114274
* tree-switch-conversion.cc (switch_conversion::build_one_array):
Use UNKNOWN_LOCATION for the CSWTCH decl.
tree name;
gimple *load;
gimple_stmt_iterator gsi = gsi_for_stmt (m_switch);
- location_t loc = gimple_location (m_switch);
gcc_assert (m_default_values[num]);
TREE_CONSTANT (ctor) = true;
TREE_STATIC (ctor) = true;
- decl = build_decl (loc, VAR_DECL, NULL_TREE, array_type);
+ decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, NULL_TREE, array_type);
TREE_STATIC (decl) = 1;
DECL_INITIAL (decl) = ctor;