[Bug tree-optimization/96370] ICE with -ffast-math since r7-950-g8a85cee26eabf5cf
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96370 --- Comment #6 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:2c558d2655cb22f472c83e8296b5cd2a92365cd3 commit r11-2424-g2c558d2655cb22f472c83e8296b5cd2a92365cd3 Author: Richard Biener Date: Thu Jul 30 10:24:42 2020 +0200 tree-optimization/96370 - make reassoc expr rewrite more robust In the face of the more complex tricks in reassoc with respect to negate processing it can happen that the expression rewrite is fooled to recurse on a leaf and pick up a bogus expression code. The following patch makes the expression rewrite more robust in providing the expression code to it directly since it is the same for all operations in a chain. 2020-07-30 Richard Biener PR tree-optimization/96370 * tree-ssa-reassoc.c (rewrite_expr_tree): Add operation code parameter and use it instead of picking it up from the stmt that is being rewritten. (reassociate_bb): Pass down the operation code. * gcc.dg/pr96370.c: New testcase.
[Bug tree-optimization/96370] ICE with -ffast-math since r7-950-g8a85cee26eabf5cf
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96370 --- Comment #5 from Richard Biener --- OK, so rewrite_expr_tree isn't prepared to see ops with a three component "leaf" as try_special_add_to_ops produces which turns { -b, b } into { b, b, -1 }. Instead it recurses into the apperant non-leaf _1 which is the negate. /* Recurse on the LHS of the binary operator, which is guaranteed to be the non-leaf side. */ tree new_rhs1 = rewrite_expr_tree (SSA_NAME_DEF_STMT (rhs1), opindex + 1, ops, changed || oe->op != rhs2 || next_changed, false); But I have a simple fix.
[Bug tree-optimization/96370] ICE with -ffast-math since r7-950-g8a85cee26eabf5cf
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96370 --- Comment #4 from Richard Biener --- More "complete" testcase: void c(_Decimal128); void a(_Decimal128 b) { c(-b * b); }
[Bug tree-optimization/96370] ICE with -ffast-math since r7-950-g8a85cee26eabf5cf
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96370 Martin Liška changed: What|Removed |Added CC||kugan at gcc dot gnu.org Summary|ice with -ffast-math|ICE with -ffast-math since ||r7-950-g8a85cee26eabf5cf --- Comment #3 from Martin Liška --- Started with r7-950-g8a85cee26eabf5cf.