2017-02-25 Jakub Jelinek <jakub@redhat.com>
+ 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
--- /dev/null
+// 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;
+}
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,
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)