diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-12-15 00:17:03 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-12-15 00:17:03 +0100 |
commit | bbc8d04f0e238cd5e86c240021b2c0aaf1b58d1b (patch) | |
tree | 394f993fcbbae87c63dd6e7b5e257cc45767798a | |
parent | 302db8ba6180906dd9a8c4ce670aff804f921fab (diff) | |
download | gcc-bbc8d04f0e238cd5e86c240021b2c0aaf1b58d1b.zip gcc-bbc8d04f0e238cd5e86c240021b2c0aaf1b58d1b.tar.gz gcc-bbc8d04f0e238cd5e86c240021b2c0aaf1b58d1b.tar.bz2 |
re PR rtl-optimization/88478 (valgrind error in cselib_record_sets)
PR rtl-optimization/88478
* cselib.c (cselib_record_sets): Move sets[i].src_elt tests
after REG_P (dest) test.
* g++.dg/opt/pr88478.C: New test.
From-SVN: r267159
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cselib.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr88478.C | 17 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 492d900..1ae1cc7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-12-15 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/88478 + * cselib.c (cselib_record_sets): Move sets[i].src_elt tests + after REG_P (dest) test. + 2018-12-14 Martin Sebor <msebor@redhat.com> PR tree-optimization/88372 diff --git a/gcc/cselib.c b/gcc/cselib.c index 4a68439..9d68e3c 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -2616,10 +2616,10 @@ cselib_record_sets (rtx_insn *insn) preserves the upper bits that di:SI=zero_extend(flags:CCNO<=0). */ scalar_int_mode mode; if (dest != orig - && sets[i].src_elt && cselib_record_sets_hook && REG_P (dest) && HARD_REGISTER_P (dest) + && sets[i].src_elt && is_a <scalar_int_mode> (GET_MODE (dest), &mode) && n_sets + n_strict_low_parts < MAX_SETS) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24d9ee6..8931a4c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-12-15 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/88478 + * g++.dg/opt/pr88478.C: New test. + 2018-12-14 Martin Sebor <msebor@redhat.com> PR tree-optimization/88372 diff --git a/gcc/testsuite/g++.dg/opt/pr88478.C b/gcc/testsuite/g++.dg/opt/pr88478.C new file mode 100644 index 0000000..2081aad --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr88478.C @@ -0,0 +1,17 @@ +// PR rtl-optimization/88478 +// { dg-do compile } +// { dg-options "-O2" } + +struct A { + bool b; + int s; + template <typename T, typename U> + A (T, U) {} +}; +enum F {} f; + +A +foo () +{ + return A (false, f); +} |