On 02/06/2018 10:52 AM, Jakub Jelinek wrote:
On Tue, Feb 06, 2018 at 10:43:21AM -0500, Aldy Hernandez wrote:
In this PR we are ICEing here:
bool
operation_no_trapping_overflow (tree type, enum tree_code code)
{
gcc_checking_assert (ANY_INTEGRAL_TYPE_P (type));
...because we are being passed a pointer type from find_trapping_overflow.
Fixed by avoiding passing non-integrals from find_trapping_overflow.
Pre-approved by Jakub. Committed.
Tested on x86-64 Linux.
gcc/
PR tree-optimization/84225
* tree-eh.c (find_trapping_overflow): Only call
operation_no_trapping_overflow when ANY_INTEGRAL_TYPE_P.
Can you please add a testcase too?
While the reported ICE was on an existing testcase, it was with
non-standard options on it.
So e.g.
gcc.dg/pr84225.c
that would contain:
/* PR tree-optimization/84225 */
/* { dg-do compile { target int32plus } } */
/* { dg-options "-Ofast -ftrapv" } */
#include "torture/pr69714.c"
Sorry for being sloppy on this. I didn't even know we could #include
other tests without the dg-do stuff being included and messing things up.
I have committed the code below, and have verified that it passes with
the previous patch, and ICEs without the patch.
Thanks.
commit e783f8fb7d9a7b0972b4ebe4b86aa541904de692 (HEAD ->
pr84225-jakub-trapv)
Author: Aldy Hernandez <al...@redhat.com>
Date: Tue Feb 6 12:06:40 2018 -0500
PR tree-optimization/84225
Add test for previous commit for PR84225.
diff --git a/gcc/testsuite/gcc.dg/pr84225.c b/gcc/testsuite/gcc.dg/pr84225.c
new file mode 100644
index 00000000000..f57266c9a26
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84225.c
@@ -0,0 +1,5 @@
+/* PR tree-optimization/84225 */
+/* { dg-do compile { target int32plus } } */
+/* { dg-options "-Ofast -ftrapv" } */
+
+#include "torture/pr69714.c"