Bug 96579 - [8 Regression] ICE in gimple check: expected gimple_assign(error_mark), have gimple_nop() in gimple_assign_rhs1, at gimple.h:2605 since r7-950-g8a85cee26eabf5cf
Summary: [8 Regression] ICE in gimple check: expected gimple_assign(error_mark), have ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: 8.5
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on: 96370
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-12 06:15 UTC by Martin Liška
Modified: 2021-03-17 11:16 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 10.2.1, 11.0, 8.4.1, 9.3.1
Known to fail: 10.2.0, 8.4.0, 9.3.0
Last reconfirmed: 2020-08-12 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2020-08-12 06:15:37 UTC
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.
Comment 1 Martin Liška 2020-08-12 06:15:54 UTC
I can take a look.
Comment 2 Martin Liška 2020-08-12 12:20:36 UTC
Leaving to Kugan.
Comment 3 Richard Biener 2020-08-25 08:47:38 UTC
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.
Comment 4 GCC Commits 2020-08-27 08:05:00 UTC
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.
Comment 5 Richard Biener 2020-08-27 08:05:38 UTC
Fixed on trunk sofar.  Still not the failure mode I'm eventually expecting as well ;)
Comment 6 Christophe Lyon 2020-08-28 08:07:20 UTC
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"
Comment 7 GCC Commits 2020-09-11 12:12:17 UTC
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)
Comment 8 GCC Commits 2020-12-02 12:21:21 UTC
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)
Comment 9 GCC Commits 2021-03-17 11:14:16 UTC
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)
Comment 10 Richard Biener 2021-03-17 11:16:18 UTC
Fixed.