From: Richard Biener Date: Wed, 26 Jun 2019 11:16:56 +0000 (+0000) Subject: re PR middle-end/90982 (ICE in make_decl_rtl, at varasm.c:1344) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=baf8d2ecd702d4b2cd18e9549771db994c22ae15;p=gcc.git re PR middle-end/90982 (ICE in make_decl_rtl, at varasm.c:1344) 2019-06-26 Richard Biener PR ipa/90982 * tree-inline.c (remap_ssa_name): Copy SSA range info. * g++.dg/torture/pr90982.C: New testcase. From-SVN: r272688 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f4576fcefb..432020fb99a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-26 Richard Biener + + PR ipa/90982 + * tree-inline.c (remap_ssa_name): Copy SSA range info. + 2019-06-26 Richard Biener * lto-streamer.h (lto_bitmap_alloc): Remove. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4fbc331d8d9..b16e23a7373 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-26 Richard Biener + + PR ipa/90982 + * g++.dg/torture/pr90982.C: New testcase. + 2019-06-26 Paolo Carlini PR c++/67184 diff --git a/gcc/testsuite/g++.dg/torture/pr90982.C b/gcc/testsuite/g++.dg/torture/pr90982.C new file mode 100644 index 00000000000..8edbb7ca6c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr90982.C @@ -0,0 +1,23 @@ +// { dg-do compile } + +template struct S +{ + long c[n]; + void f (S d) + { + for (int i = 2;; i++) + c[i] &= d.c[i]; + } +}; + +template struct T:S +{ + void operator &= (T d) + { this -> f (d); } +}; + +void g (T<192> &d) +{ + T<192> v; + d &= v; +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 2de5e22f10f..48619fbc821 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -259,6 +259,11 @@ remap_ssa_name (tree name, copy_body_data *id) struct ptr_info_def *new_pi = get_ptr_info (new_tree); new_pi->pt = pi->pt; } + /* So can range-info. */ + if (!POINTER_TYPE_P (TREE_TYPE (name)) + && SSA_NAME_RANGE_INFO (name)) + duplicate_ssa_name_range_info (new_tree, SSA_NAME_RANGE_TYPE (name), + SSA_NAME_RANGE_INFO (name)); return new_tree; } @@ -292,6 +297,11 @@ remap_ssa_name (tree name, copy_body_data *id) struct ptr_info_def *new_pi = get_ptr_info (new_tree); new_pi->pt = pi->pt; } + /* So can range-info. */ + if (!POINTER_TYPE_P (TREE_TYPE (name)) + && SSA_NAME_RANGE_INFO (name)) + duplicate_ssa_name_range_info (new_tree, SSA_NAME_RANGE_TYPE (name), + SSA_NAME_RANGE_INFO (name)); if (SSA_NAME_IS_DEFAULT_DEF (name)) { /* By inlining function having uninitialized variable, we might