From: Jakub Jelinek Date: Sat, 25 Feb 2017 10:17:31 +0000 (+0100) Subject: re PR middle-end/79396 (ICE (verify_flow_info failed) with -fnon-call-exceptions... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98561a9b580924293278921f25b5f588e587a4af;p=gcc.git re PR middle-end/79396 (ICE (verify_flow_info failed) with -fnon-call-exceptions -O2 -march=haswell) PR middle-end/79396 * tree-eh.c (operation_could_trap_p, stmt_could_throw_1_p): Handle FMA_EXPR like tcc_binary or tcc_unary. * g++.dg/opt/pr79396.C: New test. From-SVN: r245735 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04d95a35f8b..18410bc65a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2017-02-25 Jakub Jelinek + PR middle-end/79396 + * tree-eh.c (operation_could_trap_p, stmt_could_throw_1_p): Handle + FMA_EXPR like tcc_binary or tcc_unary. + * tree-ssa-loop-niter.c (number_of_iterations_exit): Simplify warning. PR debug/77589 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e37ca9b5fe..e2850e84f88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-02-25 Jakub Jelinek + + PR middle-end/79396 + * g++.dg/opt/pr79396.C: New test. + 2017-02-25 Dominique d'Humieres PR fortran/79597 diff --git a/gcc/testsuite/g++.dg/opt/pr79396.C b/gcc/testsuite/g++.dg/opt/pr79396.C new file mode 100644 index 00000000000..328c271358a --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr79396.C @@ -0,0 +1,13 @@ +// PR middle-end/79396 +// { dg-do compile } +// { dg-options "-fnon-call-exceptions -O2" } +// { dg-additional-options "-mfma" { target i?86-*-* x86_64-*-* } } + +struct A { A (); ~A (); }; + +float +foo (float x) +{ + A a; + return __builtin_pow (x, 2) + 2; +} diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 42fe9dfbbf8..0b785e9b314 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2513,7 +2513,8 @@ operation_could_trap_p (enum tree_code op, bool fp_operation, bool honor_trapv, if (TREE_CODE_CLASS (op) != tcc_comparison && TREE_CODE_CLASS (op) != tcc_unary - && TREE_CODE_CLASS (op) != tcc_binary) + && TREE_CODE_CLASS (op) != tcc_binary + && op != FMA_EXPR) return false; return operation_could_trap_helper_p (op, fp_operation, honor_trapv, @@ -2738,7 +2739,8 @@ stmt_could_throw_1_p (gimple *stmt) if (TREE_CODE_CLASS (code) == tcc_comparison || TREE_CODE_CLASS (code) == tcc_unary - || TREE_CODE_CLASS (code) == tcc_binary) + || TREE_CODE_CLASS (code) == tcc_binary + || code == FMA_EXPR) { if (is_gimple_assign (stmt) && TREE_CODE_CLASS (code) == tcc_comparison)