public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals
@ 2022-04-06  4:21 zsojka at seznam dot cz
  2022-04-06  8:10 ` [Bug tree-optimization/105173] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2022-04-06  4:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

            Bug ID: 105173
           Summary: [10/11/12 Regression] ICE: during GIMPLE pass:
                    reassoc: verify_ssa failed (definition in block 2
                    follows the use) at -Ofast with decimals
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Created attachment 52758
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52758&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Ofast testcase.c 
testcase.c: In function 'foo':
testcase.c:4:1: error: definition in block 2 follows the use
    4 | foo(char c, _Decimal32 d) {
      | ^~~
for SSA_NAME: _12 in statement:
_14 = _12 * -1.0e+0;
during GIMPLE pass: reassoc
testcase.c:4:1: internal compiler error: verify_ssa failed
0x15cee2b verify_ssa(bool, bool)
        /repo/gcc-trunk/gcc/tree-ssa.cc:1211
0x1286b7d execute_function_todo
        /repo/gcc-trunk/gcc/passes.cc:2092
0x1286fae execute_todo
        /repo/gcc-trunk/gcc/passes.cc:2139
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-7994-20220405095446-ge68f5c90bae-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-7994-20220405095446-ge68f5c90bae-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220405 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
@ 2022-04-06  8:10 ` rguenth at gcc dot gnu.org
  2022-04-06  9:20 ` [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-06  8:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|---                         |10.4
   Last reconfirmed|                            |2022-04-06
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
           Priority|P3                          |P2
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, I'll have a look.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
  2022-04-06  8:10 ` [Bug tree-optimization/105173] " rguenth at gcc dot gnu.org
@ 2022-04-06  9:20 ` marxin at gcc dot gnu.org
  2022-04-06  9:40 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-04-06  9:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression] ICE:  |[10/11/12 Regression] ICE:
                   |during GIMPLE pass:         |during GIMPLE pass:
                   |reassoc: verify_ssa failed  |reassoc: verify_ssa failed
                   |(definition in block 2      |(definition in block 2
                   |follows the use) at -Ofast  |follows the use) at -Ofast
                   |with decimals               |with decimals since
                   |                            |r7-950-g8a85cee26eabf5cf
                 CC|                            |kugan at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r7-950-g8a85cee26eabf5cf.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
  2022-04-06  8:10 ` [Bug tree-optimization/105173] " rguenth at gcc dot gnu.org
  2022-04-06  9:20 ` [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf marxin at gcc dot gnu.org
@ 2022-04-06  9:40 ` rguenth at gcc dot gnu.org
  2022-04-06 11:15 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-06  9:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
  <bb 2> [local count: 1073741824]:
  i.0_1 = i;
  _2 = (_Decimal32) i.0_1;
  _12 = (_Decimal64) _2;
  _13 = (_Decimal64) d_8(D);
  _3 = _12 * _13;
  _4 = (_Decimal64) c_9(D);
  _5 = -_4;
  _6 = _3 * _5;
  d_10 = (_Decimal32) _6;
  _11 = (int) d_10;

Transforming _12 = (_Decimal64) _2;
 into _14 = _12 * -1.0e+0;
Transforming _3 = _12 * _13;
 into _15 = _14 * _4;
Transforming _6 = _3 * _5;
 into _6 = _15 * _13;

  <bb 2> [local count: 1073741824]:
  i.0_1 = i;
  _2 = (_Decimal32) i.0_1;
  _14 = _12 * -1.0e+0;
  _12 = (_Decimal64) _2;
  _13 = (_Decimal64) d_8(D);
  _4 = (_Decimal64) c_9(D);
  _15 = _14 * _4;
  _6 = _15 * _13;
  d_10 = (_Decimal32) _6;
  _11 = (int) d_10;
  return _11;

and the logic wrt

              gimple *insert_point
                = find_insert_point (stmt, oe1->op, oe2->op);
...
              if (insert_point == gsi_stmt (gsi))
                gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
              else
                insert_stmt_after (stmt, insert_point);

does not work for

(gdb) p debug_gimple_stmt (stmt)
_12 = (_Decimal64) _2;
$4 = void
(gdb) p oe1->op
$5 = <ssa_name 0x7ffff667e120 12>
(gdb) p oe2->op
$6 = <real_cst 0x7ffff6681540>

testing a fix.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-04-06  9:40 ` rguenth at gcc dot gnu.org
@ 2022-04-06 11:15 ` cvs-commit at gcc dot gnu.org
  2022-04-06 11:16 ` [Bug tree-optimization/105173] [10/11 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-06 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:e1a5e7562d53a8d2256f754714b06595bea72196

commit r12-8020-ge1a5e7562d53a8d2256f754714b06595bea72196
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 6 11:43:01 2022 +0200

    tree-optimization/105173 - fix insertion logic in reassoc

    The find_insert_point logic around deciding whether to insert
    before or after the found insertion point does not handle
    the case of _12 = ..;, _12, 1.0 well.  The following puts the
    logic into find_insert_point itself instead.

    2022-04-06  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/105173
            * tree-ssa-reassoc.cc (find_insert_point): Get extra
            insert_before output argument and compute it.
            (insert_stmt_before_use): Adjust.
            (rewrite_expr_tree): Likewise.

            * gcc.dg/pr105173.c: New testcase.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10/11 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-04-06 11:15 ` cvs-commit at gcc dot gnu.org
@ 2022-04-06 11:16 ` rguenth at gcc dot gnu.org
  2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-06 11:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|12.0                        |
            Summary|[10/11/12 Regression] ICE:  |[10/11 Regression] ICE:
                   |during GIMPLE pass:         |during GIMPLE pass:
                   |reassoc: verify_ssa failed  |reassoc: verify_ssa failed
                   |(definition in block 2      |(definition in block 2
                   |follows the use) at -Ofast  |follows the use) at -Ofast
                   |with decimals since         |with decimals since
                   |r7-950-g8a85cee26eabf5cf    |r7-950-g8a85cee26eabf5cf
      Known to work|                            |12.0

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10/11 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-04-06 11:16 ` [Bug tree-optimization/105173] [10/11 " rguenth at gcc dot gnu.org
@ 2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
  2022-05-27 13:15 ` [Bug tree-optimization/105173] [10 " cvs-commit at gcc dot gnu.org
  2022-05-27 13:17 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-19 14:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:f4f2bd4edea8beabcf9caea98f951dcac612b126

commit r11-10016-gf4f2bd4edea8beabcf9caea98f951dcac612b126
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 6 11:43:01 2022 +0200

    tree-optimization/105173 - fix insertion logic in reassoc

    The find_insert_point logic around deciding whether to insert
    before or after the found insertion point does not handle
    the case of _12 = ..;, _12, 1.0 well.  The following puts the
    logic into find_insert_point itself instead.

    2022-04-06  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/105173
            * tree-ssa-reassoc.c (find_insert_point): Get extra
            insert_before output argument and compute it.
            (insert_stmt_before_use): Adjust.
            (rewrite_expr_tree): Likewise.

            * gcc.dg/pr105173.c: New testcase.

    (cherry picked from commit e1a5e7562d53a8d2256f754714b06595bea72196)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
@ 2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
  2022-05-27 13:17 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-27 13:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:84ebfc7558d23c5262d35740d1d495bd0884a58c

commit r10-10766-g84ebfc7558d23c5262d35740d1d495bd0884a58c
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 6 11:43:01 2022 +0200

    tree-optimization/105173 - fix insertion logic in reassoc

    The find_insert_point logic around deciding whether to insert
    before or after the found insertion point does not handle
    the case of _12 = ..;, _12, 1.0 well.  The following puts the
    logic into find_insert_point itself instead.

    2022-04-06  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/105173
            * tree-ssa-reassoc.c (find_insert_point): Get extra
            insert_before output argument and compute it.
            (insert_stmt_before_use): Adjust.
            (rewrite_expr_tree): Likewise.

            * gcc.dg/pr105173.c: New testcase.

    (cherry picked from commit e1a5e7562d53a8d2256f754714b06595bea72196)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/105173] [10 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf
  2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2022-05-27 13:15 ` [Bug tree-optimization/105173] [10 " cvs-commit at gcc dot gnu.org
@ 2022-05-27 13:17 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 13:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Known to fail|10.3.1                      |10.3.0
      Known to work|                            |10.3.1
             Status|ASSIGNED                    |RESOLVED

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-27 13:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06  4:21 [Bug tree-optimization/105173] New: [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals zsojka at seznam dot cz
2022-04-06  8:10 ` [Bug tree-optimization/105173] " rguenth at gcc dot gnu.org
2022-04-06  9:20 ` [Bug tree-optimization/105173] [10/11/12 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf marxin at gcc dot gnu.org
2022-04-06  9:40 ` rguenth at gcc dot gnu.org
2022-04-06 11:15 ` cvs-commit at gcc dot gnu.org
2022-04-06 11:16 ` [Bug tree-optimization/105173] [10/11 " rguenth at gcc dot gnu.org
2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
2022-05-27 13:15 ` [Bug tree-optimization/105173] [10 " cvs-commit at gcc dot gnu.org
2022-05-27 13:17 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).