I see the following ICE: $ gcc /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr96370.c -fno-tree-forwprop -funsafe-math-optimizations -fno-tree-vrp -O3 during GIMPLE pass: reassoc /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr96370.c: In function ‘a’: /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr96370.c:5:6: internal compiler error: gimple check: expected gimple_assign(error_mark), have gimple_nop() in gimple_assign_rhs1, at gimple.h:2605 5 | void a(_Decimal128 b) | ^ 0x674ecc gimple_check_failed(gimple const*, char const*, int, char const*, gimple_code, tree_code) /home/marxin/Programming/gcc/gcc/gimple.c:1256 0x714c21 GIMPLE_CHECK2<gassign*> /home/marxin/Programming/gcc/gcc/gimple.h:93 0x714c61 GIMPLE_CHECK2<const gassign*> /home/marxin/Programming/gcc/gcc/gimple.h:2603 0x714c61 gimple_assign_rhs1 /home/marxin/Programming/gcc/gcc/gimple.h:2605 0x71535d gimple_assign_rhs1 /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:5042 0x71535d rewrite_expr_tree /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:4987 0xf35ee5 rewrite_expr_tree /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:5075 0xf442cc reassociate_bb /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:6548 0xf43e28 reassociate_bb /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:6597 0xf4627e do_reassoc /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:6709 0xf4627e execute_reassoc /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:6796 0xf4627e execute /home/marxin/Programming/gcc/gcc/tree-ssa-reassoc.c:6835 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.
I can take a look.
Leaving to Kugan.
Probably similar to the fallout I fixed in 2c558d2655cb22f472c83e8296b5cd2a92365cd3 (PR96370) where I already suspected the real issue is still unfixed. So I'll take a second look.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:ff7463172e564c5dd2432d7af8eaa0124cbd4af7 commit r11-2900-gff7463172e564c5dd2432d7af8eaa0124cbd4af7 Author: Richard Biener <rguenther@suse.de> Date: Thu Aug 27 10:02:22 2020 +0200 tree-optimization/96579 - another special-operands fix in reassoc This makes sure to put special-ops expanded rhs left where expression rewrite expects it. 2020-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/96579 * tree-ssa-reassoc.c (linearize_expr_tree): If we expand rhs via special ops make sure to swap operands. * gcc.dg/pr96579.c: New testcase.
Fixed on trunk sofar. Still not the failure mode I'm eventually expecting as well ;)
https://gcc.gnu.org/g:3ba43155d2b27978589b2c1b0c4fdbaf8d4bba4d commit r11-2918-g3ba43155d2b27978589b2c1b0c4fdbaf8d4bba4d Author: Christophe Lyon <christophe.lyon@linaro.org> Date: Fri Aug 28 07:56:51 2020 +0000 testsuite: Run gcc.dg/pr96579.c only on targets with dfp support. gcc.dg/pr96579.c includes gcc.dg/pr96370.c which needs target dfp. 2020-08-28 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ * gcc.dg/pr96579.c: Compile only with target dfp. Diff: --- gcc/testsuite/gcc.dg/pr96579.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/pr96579.c b/gcc/testsuite/gcc.dg/pr96579.c index 49fdcb40359..982f8ac17a5 100644 --- a/gcc/testsuite/gcc.dg/pr96579.c +++ b/gcc/testsuite/gcc.dg/pr96579.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target dfp } } */ /* { dg-options "-O -fno-tree-forwprop -ffast-math -fno-tree-vrp" } */ #include "pr96370.c"
The releases/gcc-10 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:228c6a864577098f1b3aeeb412c2eb5f05787f02 commit r10-8749-g228c6a864577098f1b3aeeb412c2eb5f05787f02 Author: Richard Biener <rguenther@suse.de> Date: Thu Aug 27 10:02:22 2020 +0200 tree-optimization/96579 - another special-operands fix in reassoc This makes sure to put special-ops expanded rhs left where expression rewrite expects it. 2020-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/96579 * tree-ssa-reassoc.c (linearize_expr_tree): If we expand rhs via special ops make sure to swap operands. * gcc.dg/pr96579.c: New testcase. (cherry picked from commit ff7463172e564c5dd2432d7af8eaa0124cbd4af7)
The releases/gcc-9 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:92b6627874cc924eeed9084a09f09504e20b5387 commit r9-9088-g92b6627874cc924eeed9084a09f09504e20b5387 Author: Richard Biener <rguenther@suse.de> Date: Thu Aug 27 10:02:22 2020 +0200 tree-optimization/96579 - another special-operands fix in reassoc This makes sure to put special-ops expanded rhs left where expression rewrite expects it. 2020-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/96579 * tree-ssa-reassoc.c (linearize_expr_tree): If we expand rhs via special ops make sure to swap operands. * gcc.dg/pr96579.c: New testcase. (cherry picked from commit ff7463172e564c5dd2432d7af8eaa0124cbd4af7)
The releases/gcc-8 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:19b7dd1caf953f8b79b16c6fc0439dba2a598b1f commit r8-10805-g19b7dd1caf953f8b79b16c6fc0439dba2a598b1f Author: Richard Biener <rguenther@suse.de> Date: Thu Aug 27 10:02:22 2020 +0200 tree-optimization/96579 - another special-operands fix in reassoc This makes sure to put special-ops expanded rhs left where expression rewrite expects it. 2020-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/96579 * tree-ssa-reassoc.c (linearize_expr_tree): If we expand rhs via special ops make sure to swap operands. * gcc.dg/pr96579.c: New testcase. (cherry picked from commit 92b6627874cc924eeed9084a09f09504e20b5387)
Fixed.