public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
@ 2022-01-29  8:29 zhendong.su at inf dot ethz.ch
  2022-01-29  8:31 ` [Bug tree-optimization/104279] " zhendong.su at inf dot ethz.ch
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2022-01-29  8:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104279
           Summary: ICE on valid code at -O1 and above on
                    x86_64-linux-gnu: verify_gimple failed
           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 recent regression. 

[551] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220129 (experimental) [master r12-6930-gf6f2d6cfec1] (GCC)
[552] %
[552] % gcctk -O0 small.c; ./a.out
[553] %
[553] % gcctk -O1 small.c
small.c: In function ‘main’:
small.c:6:1: error: bogus comparison result type
    6 | }
      | ^
unsigned int
_5 = a.1_3 == 4294967294;
during GIMPLE pass: fre
small.c:6:1: internal compiler error: verify_gimple failed
0xe52365 verify_gimple_in_cfg(function*, bool)
        ../../gcc-trunk/gcc/tree-cfg.cc:5559
0xce8ece execute_function_todo
        ../../gcc-trunk/gcc/passes.cc:2084
0xce9952 execute_todo
        ../../gcc-trunk/gcc/passes.cc:2138
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.
[554] %
[554] % cat small.c
unsigned a, b;
int main() {
  b = ~(0 || ~0);
  a = ~b / ~a;
  return 0;
}

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

* [Bug tree-optimization/104279] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
  2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
@ 2022-01-29  8:31 ` zhendong.su at inf dot ethz.ch
  2022-01-29  9:34 ` [Bug tree-optimization/104279] [12 Regregression] " pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2022-01-29  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
>From Compiler Explorer: https://godbolt.org/z/465M9Kvx1

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

* [Bug tree-optimization/104279] [12 Regregression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
  2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
  2022-01-29  8:31 ` [Bug tree-optimization/104279] " zhendong.su at inf dot ethz.ch
@ 2022-01-29  9:34 ` pinskia at gcc dot gnu.org
  2022-01-29  9:37 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-29  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
            Version|unknown                     |12.0
            Summary|ICE on valid code at -O1    |[12 Regregression] ICE on
                   |and above on                |valid code at -O1 and above
                   |x86_64-linux-gnu:           |on x86_64-linux-gnu:
                   |verify_gimple failed        |verify_gimple failed

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

* [Bug tree-optimization/104279] [12 Regregression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
  2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
  2022-01-29  8:31 ` [Bug tree-optimization/104279] " zhendong.su at inf dot ethz.ch
  2022-01-29  9:34 ` [Bug tree-optimization/104279] [12 Regregression] " pinskia at gcc dot gnu.org
@ 2022-01-29  9:37 ` pinskia at gcc dot gnu.org
  2022-01-29 16:55 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-29  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this one and the other two are all caused by r12-6924.

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

* [Bug tree-optimization/104279] [12 Regregression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
  2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
                   ` (2 preceding siblings ...)
  2022-01-29  9:37 ` pinskia at gcc dot gnu.org
@ 2022-01-29 16:55 ` cvs-commit at gcc dot gnu.org
  2022-01-29 16:58 ` jakub at gcc dot gnu.org
  2022-01-31 21:27 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-29 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r12-6931-ga1544878966020d1f7a640b35d1f7a5f0e055624
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Jan 29 17:54:43 2022 +0100

    match.pd: Fix up 1 / X for unsigned X optimization [PR104280]

    On Fri, Jan 28, 2022 at 11:38:23AM -0700, Jeff Law wrote:
    > Thanks.  Given the original submission and most of the review work was
done
    > prior to stage3 closing, I went ahead and installed this on the trunk.

    Unfortunately this breaks quite a lot of things.
    The main problem is that GIMPLE allows EQ_EXPR etc. only with BOOLEAN_TYPE
    or with TYPE_PRECISION == 1 integral type (or vector boolean).
    Violating this causes verification failures in tree-cfg.cc in some cases,
    in other cases wrong-code issues because before it is verified we e.g.
    transform
    1U / x
    into
    x == 1U
    and later into
    x (because we assume that == type must be one of the above cases and
    when it is the same type as the type of the first operand, for boolean-ish
    cases it should be equivalent).

    Fixed by changing that
    (eq @1 { build_one_cst (type); })
    into
    (convert (eq:boolean_type_node @1 { build_one_cst (type); }))
    Note, I'm not 100% sure if :boolean_type_node is required in that case,
    I see some spots in match.pd that look exactly like this, while there is
    e.g. (convert (le ...)) that supposedly does the right thing too.
    The signed integer 1/X case doesn't need changes changes, for
    (cond (le ...) ...)
    le gets correctly boolean_type_node and cond should use type.
    I've also reformatted it, some lines were too long, match.pd uses
    indentation by 1 column instead of 2 etc.

    2022-01-29  Jakub Jelinek  <jakub@redhat.com>
                Andrew Pinski  <apinski@marvell.com>

            PR tree-optimization/104279
            PR tree-optimization/104280
            PR tree-optimization/104281
            * match.pd (1 / X -> X == 1 for unsigned X): Build eq with
            boolean_type_node and convert to type.  Formatting fixes.

            * gcc.dg/torture/pr104279.c: New test.
            * gcc.dg/torture/pr104280.c: New test.
            * gcc.dg/torture/pr104281.c: New test.

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

* [Bug tree-optimization/104279] [12 Regregression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
  2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
                   ` (3 preceding siblings ...)
  2022-01-29 16:55 ` cvs-commit at gcc dot gnu.org
@ 2022-01-29 16:58 ` jakub at gcc dot gnu.org
  2022-01-31 21:27 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-29 16:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/104279] [12 Regregression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed
  2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
                   ` (4 preceding siblings ...)
  2022-01-29 16:58 ` jakub at gcc dot gnu.org
@ 2022-01-31 21:27 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-31 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 104310 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2022-01-31 21:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29  8:29 [Bug tree-optimization/104279] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed zhendong.su at inf dot ethz.ch
2022-01-29  8:31 ` [Bug tree-optimization/104279] " zhendong.su at inf dot ethz.ch
2022-01-29  9:34 ` [Bug tree-optimization/104279] [12 Regregression] " pinskia at gcc dot gnu.org
2022-01-29  9:37 ` pinskia at gcc dot gnu.org
2022-01-29 16:55 ` cvs-commit at gcc dot gnu.org
2022-01-29 16:58 ` jakub at gcc dot gnu.org
2022-01-31 21:27 ` pinskia 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).