This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR38819, PREing of trapping expressions
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 17 Jan 2009 11:47:31 +0100
- Subject: Re: [PATCH] Fix PR38819, PREing of trapping expressions
- References: <alpine.LNX.2.00.0901170032420.24314@zhemvz.fhfr.qr>
> + if (eprime->kind == NAME
> + || eprime->kind == CONSTANT
> + || eprime->kind == REFERENCE)
> + continue;
> + nary = PRE_EXPR_NARY (eprime);
> + if (TREE_CODE_CLASS (nary->opcode) == tcc_comparison
> + || TREE_CODE_CLASS (nary->opcode) == tcc_unary
> + || TREE_CODE_CLASS (nary->opcode) == tcc_binary)
> + {
> + type = nary->type;
> + fp_operation = FLOAT_TYPE_P (type);
> + if (fp_operation)
> + {
> + honor_nans = flag_trapping_math && !flag_finite_math_only;
> + honor_snans = flag_signaling_nans != 0;
> + }
> + else if (INTEGRAL_TYPE_P (type)
> + && TYPE_OVERFLOW_TRAPS (type))
> + honor_trapv = true;
> + }
> + rhs2 = nary->op[1];
> + ret = operation_could_trap_helper_p (nary->opcode, fp_operation,
> + honor_trapv,
> + honor_nans, honor_snans, rhs2,
> + &handled);
> + if (handled
> + && ret)
> + return false;
> +
> + for (i = 0; i < nary->length; ++i)
> + if (tree_could_trap_p (nary->op[i]))
> + return false;
Extract to vn_could_trap_p?
This would change the patch basically to the much more readable
FOR_EACH_EDGE (pred, ei, block->preds)
if (vn_could_trap_p (avail[pred->src->index]))
return false;
Paolo