aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-02-08 11:26:33 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-02-08 11:26:33 +0100
commit89cfdb7e5ba6f5e00e13473790ef787189c59c01 (patch)
tree2931d159ae46c428e63ba2e351baa7b8eb5db846 /gcc
parent4af50e13a035804b80551e4649cc2b055588ffc8 (diff)
downloadgcc-89cfdb7e5ba6f5e00e13473790ef787189c59c01.zip
gcc-89cfdb7e5ba6f5e00e13473790ef787189c59c01.tar.gz
gcc-89cfdb7e5ba6f5e00e13473790ef787189c59c01.tar.bz2
re PR rtl-optimization/89234 (ICE in get_eh_region_and_lp_from_rtx at gcc/except.c:1824)
PR rtl-optimization/89234 * except.c (copy_reg_eh_region_note_forward): Return if note_or_insn is a NOTE, CODE_LABEL etc. - rtx_insn * other than INSN_P. (copy_reg_eh_region_note_backward): Likewise. * g++.dg/ubsan/pr89234.C: New test. From-SVN: r268669
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/except.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr89234.C11
4 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4e78ab6..14c6183 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/89234
+ * except.c (copy_reg_eh_region_note_forward): Return if note_or_insn
+ is a NOTE, CODE_LABEL etc. - rtx_insn * other than INSN_P.
+ (copy_reg_eh_region_note_backward): Likewise.
+
2019-02-08 Richard Biener <rguenther@suse.de>
PR middle-end/89223
diff --git a/gcc/except.c b/gcc/except.c
index 10fef2f..29437f3 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1756,6 +1756,8 @@ copy_reg_eh_region_note_forward (rtx note_or_insn, rtx_insn *first, rtx last)
if (note == NULL)
return;
}
+ else if (is_a <rtx_insn *> (note_or_insn))
+ return;
note = XEXP (note, 0);
for (insn = first; insn != last ; insn = NEXT_INSN (insn))
@@ -1778,6 +1780,8 @@ copy_reg_eh_region_note_backward (rtx note_or_insn, rtx_insn *last, rtx first)
if (note == NULL)
return;
}
+ else if (is_a <rtx_insn *> (note_or_insn))
+ return;
note = XEXP (note, 0);
for (insn = last; insn != first; insn = PREV_INSN (insn))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9f4296b..fd3fbf1d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/89234
+ * g++.dg/ubsan/pr89234.C: New test.
+
2019-02-08 Richard Biener <rguenther@suse.de>
PR middle-end/89223
diff --git a/gcc/testsuite/g++.dg/ubsan/pr89234.C b/gcc/testsuite/g++.dg/ubsan/pr89234.C
new file mode 100644
index 0000000..af1526c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr89234.C
@@ -0,0 +1,11 @@
+// PR rtl-optimization/89234
+// { dg-do compile { target dfp } }
+// { dg-options "-O2 -fnon-call-exceptions -fsanitize=null" }
+
+typedef float __attribute__((mode (SD))) _Decimal32;
+
+void
+foo (_Decimal32 *b, _Decimal32 c)
+{
+ *b = c + 1.5;
+}