public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
@ 2023-06-24 13:35 zhendong.su at inf dot ethz.ch
  2023-06-24 15:16 ` [Bug tree-optimization/110392] ICE at -O3 with "-O3 " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2023-06-24 13:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110392
           Summary: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp
                    -fno-tree-dominator-opts -fno-tree-copy-prop
                    -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in
                    find_var_cmp_const, at
                    gimple-predicate-analysis.cc:257
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a regression from 12.*, and affects 13.* and later.

Compiler Explorer: https://godbolt.org/z/hWsKnGdqz

[528] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230623 (experimental) [master r14-924-gd709841ae0f] (GCC)
[529] %
[529] % gcctk -w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts
-fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop small.c
during GIMPLE pass: uninit
small.c: In function ‘b’:
small.c:2:6: internal compiler error: in find_var_cmp_const, at
gimple-predicate-analysis.cc:257
    2 | void b() {
      |      ^
0x8c4b9b find_var_cmp_const
        ../../gcc-trunk/gcc/gimple-predicate-analysis.cc:257
0x1d636a3 uninit_analysis::overlap(gphi*, unsigned int, hash_set<gphi*, false,
default_hash_traits<gphi*> >*, predicate const&)
        ../../gcc-trunk/gcc/gimple-predicate-analysis.cc:649
0x1d631a8 uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int, hash_set<gphi*, false, default_hash_traits<gphi*> >*)
        ../../gcc-trunk/gcc/gimple-predicate-analysis.cc:2226
0x1d637d9 uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int)
        ../../gcc-trunk/gcc/gimple-predicate-analysis.cc:2264
0x1213ee0 find_uninit_use
        ../../gcc-trunk/gcc/tree-ssa-uninit.cc:1243
0x1214916 warn_uninitialized_phi
        ../../gcc-trunk/gcc/tree-ssa-uninit.cc:1313
0x1214916 execute_late_warn_uninitialized
        ../../gcc-trunk/gcc/tree-ssa-uninit.cc:1434
0x1214916 execute
        ../../gcc-trunk/gcc/tree-ssa-uninit.cc:1451
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.
[530] %
[530] % cat small.c
int a;
void b() {
  int c, d, f, g, i;
  if (a)
    goto L2;
  for (;;) {
    g = 2;
    for (;;) {
      if (f)
      L1:
        if (d)
          break;
      g | f && c;
      if (c)
        goto L1;
      i = ~c;
    L2:
      c = i;
    }
  }
}

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

* [Bug tree-optimization/110392] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
@ 2023-06-24 15:16 ` pinskia at gcc dot gnu.org
  2023-06-24 15:21 ` [Bug tree-optimization/110392] [13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-24 15:16 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE at -O3 with "-w -O3     |ICE at -O3 with "-O3 -Wall
                   |-Wall -fno-tree-vrp         |-fno-tree-vrp
                   |-fno-tree-dominator-opts    |-fno-tree-dominator-opts
                   |-fno-tree-copy-prop         |-fno-tree-copy-prop
                   |-fno-tree-fre -fno-tree-ccp |-fno-tree-fre -fno-tree-ccp
                   |-fno-tree-forwprop": in     |-fno-tree-forwprop": in
                   |find_var_cmp_const, at      |find_var_cmp_const, at
                   |gimple-predicate-analysis.c |gimple-predicate-analysis.c
                   |c:257                       |c:257
            Version|unknown                     |14.0
   Target Milestone|---                         |13.2
           Keywords|                            |ice-on-valid-code

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

* [Bug tree-optimization/110392] [13/14 Regression] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
  2023-06-24 15:16 ` [Bug tree-optimization/110392] ICE at -O3 with "-O3 " pinskia at gcc dot gnu.org
@ 2023-06-24 15:21 ` pinskia at gcc dot gnu.org
  2023-06-26  9:01 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-24 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-06-24

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug tree-optimization/110392] [13/14 Regression] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
  2023-06-24 15:16 ` [Bug tree-optimization/110392] ICE at -O3 with "-O3 " pinskia at gcc dot gnu.org
  2023-06-24 15:21 ` [Bug tree-optimization/110392] [13/14 Regression] " pinskia at gcc dot gnu.org
@ 2023-06-26  9:01 ` rguenth at gcc dot gnu.org
  2023-06-26 11:02 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-26  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.

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

* [Bug tree-optimization/110392] [13/14 Regression] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
                   ` (2 preceding siblings ...)
  2023-06-26  9:01 ` rguenth at gcc dot gnu.org
@ 2023-06-26 11:02 ` cvs-commit at gcc dot gnu.org
  2023-06-26 11:04 ` [Bug tree-optimization/110392] [13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-26 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:ab6eac20f00761695c69b555f6b0a026bc25770d

commit r14-2089-gab6eac20f00761695c69b555f6b0a026bc25770d
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jun 26 11:21:43 2023 +0200

    tree-optimization/110392 - ICE with predicate analysis

    Feeding not optimized IL can result in predicate normalization
    to simplify things so a predicate can get true or false.  The
    following re-orders the early exit in that case to come after
    simplification and normalization to take care of that.

            PR tree-optimization/110392
            * gimple-predicate-analysis.cc (uninit_analysis::is_use_guarded):
            Do early exits on true/false predicate only after normalization.

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

* [Bug tree-optimization/110392] [13 Regression] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
                   ` (3 preceding siblings ...)
  2023-06-26 11:02 ` cvs-commit at gcc dot gnu.org
@ 2023-06-26 11:04 ` rguenth at gcc dot gnu.org
  2023-07-07 11:59 ` rguenth at gcc dot gnu.org
  2023-07-07 12:06 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-26 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13/14 Regression] ICE at   |[13 Regression] ICE at -O3
                   |-O3 with "-O3 -Wall         |with "-O3 -Wall
                   |-fno-tree-vrp               |-fno-tree-vrp
                   |-fno-tree-dominator-opts    |-fno-tree-dominator-opts
                   |-fno-tree-copy-prop         |-fno-tree-copy-prop
                   |-fno-tree-fre -fno-tree-ccp |-fno-tree-fre -fno-tree-ccp
                   |-fno-tree-forwprop": in     |-fno-tree-forwprop": in
                   |find_var_cmp_const, at      |find_var_cmp_const, at
                   |gimple-predicate-analysis.c |gimple-predicate-analysis.c
                   |c:257                       |c:257
           Priority|P3                          |P2
      Known to work|                            |14.0

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

* [Bug tree-optimization/110392] [13 Regression] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
                   ` (4 preceding siblings ...)
  2023-06-26 11:04 ` [Bug tree-optimization/110392] [13 " rguenth at gcc dot gnu.org
@ 2023-07-07 11:59 ` rguenth at gcc dot gnu.org
  2023-07-07 12:06 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Known to work|                            |13.1.1
             Status|ASSIGNED                    |RESOLVED

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

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

* [Bug tree-optimization/110392] [13 Regression] ICE at -O3 with "-O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257
  2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
                   ` (5 preceding siblings ...)
  2023-07-07 11:59 ` rguenth at gcc dot gnu.org
@ 2023-07-07 12:06 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-07 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:980666fbaf24f444a4cc7e78eb19aae00f296fdb

commit r13-7544-g980666fbaf24f444a4cc7e78eb19aae00f296fdb
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jun 26 11:21:43 2023 +0200

    tree-optimization/110392 - ICE with predicate analysis

    Feeding not optimized IL can result in predicate normalization
    to simplify things so a predicate can get true or false.  The
    following re-orders the early exit in that case to come after
    simplification and normalization to take care of that.

            PR tree-optimization/110392
            * gimple-predicate-analysis.cc (uninit_analysis::is_use_guarded):
            Do early exits on true/false predicate only after normalization.

    (cherry picked from commit ab6eac20f00761695c69b555f6b0a026bc25770d)

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

end of thread, other threads:[~2023-07-07 12:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-24 13:35 [Bug tree-optimization/110392] New: ICE at -O3 with "-w -O3 -Wall -fno-tree-vrp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop": in find_var_cmp_const, at gimple-predicate-analysis.cc:257 zhendong.su at inf dot ethz.ch
2023-06-24 15:16 ` [Bug tree-optimization/110392] ICE at -O3 with "-O3 " pinskia at gcc dot gnu.org
2023-06-24 15:21 ` [Bug tree-optimization/110392] [13/14 Regression] " pinskia at gcc dot gnu.org
2023-06-26  9:01 ` rguenth at gcc dot gnu.org
2023-06-26 11:02 ` cvs-commit at gcc dot gnu.org
2023-06-26 11:04 ` [Bug tree-optimization/110392] [13 " rguenth at gcc dot gnu.org
2023-07-07 11:59 ` rguenth at gcc dot gnu.org
2023-07-07 12:06 ` cvs-commit 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).