public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types)
@ 2022-06-19  5:22 asolokha at gmx dot com
  2022-06-20  8:15 ` [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2022-06-19  5:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106027
           Summary: ICE: 'verify_gimple' failed (error: mismatching
                    comparison operand types)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc 13.0.0 20220612 snapshot (g:add1adaa17a294ea25918ffb4fdd40f115362632) ICEs
when compiling the following testcase w/ -O1:

int
foo (unsigned int x, int y)
{
  return x <= (((y != y) < 0) ? y < 1 : 0);
}

% gcc-13.0.0 -O1 -c lxx02x06.c
lxx02x06.c: In function 'foo':
lxx02x06.c:2:1: error: mismatching comparison operand types
    2 | foo (unsigned int x, int y)
      | ^~~
unsigned int
int
_1 = x <= 0;
lxx02x06.c:2:1: internal compiler error: 'verify_gimple' failed
0xf2b0cd verify_gimple_in_seq(gimple*)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220612/work/gcc-13-20220612/gcc/tree-cfg.cc:5217
0xc0fb85 gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220612/work/gcc-13-20220612/gcc/gimplify.cc:16543
0xc0fd4c gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220612/work/gcc-13-20220612/gcc/gimplify.cc:16614
0xa26c47 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220612/work/gcc-13-20220612/gcc/cgraphunit.cc:676
0xa297a7 analyze_functions
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220612/work/gcc-13-20220612/gcc/cgraphunit.cc:1241
0xa2a44d symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220612/work/gcc-13-20220612/gcc/cgraphunit.cc:2501

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

* [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
@ 2022-06-20  8:15 ` marxin at gcc dot gnu.org
  2022-06-20 11:27 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-20  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-06-20
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
            Summary|ICE: 'verify_gimple' failed |[11/12/13 Regression] ICE:
                   |(error: mismatching         |'verify_gimple' failed
                   |comparison operand types)   |(error: mismatching
                   |                            |comparison operand types)
                   |                            |since
                   |                            |r11-2450-g10231958fcfb13bc

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-2450-g10231958fcfb13bc.

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

* [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
  2022-06-20  8:15 ` [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc marxin at gcc dot gnu.org
@ 2022-06-20 11:27 ` rguenth at gcc dot gnu.org
  2022-06-20 11:40 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-06-20 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
  2022-06-20  8:15 ` [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc marxin at gcc dot gnu.org
  2022-06-20 11:27 ` rguenth at gcc dot gnu.org
@ 2022-06-20 11:40 ` rguenth at gcc dot gnu.org
  2022-06-20 13:02 ` 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-06-20 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue seems to be that

#4  0x0000000000f82be3 in fold_binary_loc (loc=2147483656, 
    code=TRUTH_ANDIF_EXPR, type=<integer_type 0x7ffff68dd690 unsigned int>, 
    op0=<nop_expr 0x7ffff6a0f240>, op1=<nop_expr 0x7ffff6a0f220>)
    at /space/rguenther/src/gcc/gcc/fold-const.cc:12044
      /* A < X && A + 1 > Y ==> A < X && A >= Y.  Normally A + 1 > Y
         means A >= Y && A != MAX, but in this case we know that
         A < X <= MAX.  */

      if (!TREE_SIDE_EFFECTS (arg0)
          && !TREE_SIDE_EFFECTS (arg1))
        {
          tem = fold_to_nonsharp_ineq_using_bound (loc, arg0, arg1);
          if (tem && !operand_equal_p (tem, arg0, 0))
            return fold_build2_loc (loc, code, type, tem, arg1);

          tem = fold_to_nonsharp_ineq_using_bound (loc, arg1, arg0);
          if (tem && !operand_equal_p (tem, arg1, 0))
            return fold_build2_loc (loc, code, type, arg0, tem);

builds unsigned type TRUTH_ANDIF_EXPR with signed type arg0/tem (op0/op1
are conversions to unsigned type).  The offending revision just chokes
on the invalid input.

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

* [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-06-20 11:40 ` rguenth at gcc dot gnu.org
@ 2022-06-20 13:02 ` cvs-commit at gcc dot gnu.org
  2022-06-20 13:02 ` [Bug middle-end/106027] [11/12 " 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-06-20 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:713f2fd923442b1be620a44240ddf786ae0ab476

commit r13-1174-g713f2fd923442b1be620a44240ddf786ae0ab476
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jun 20 13:40:50 2022 +0200

    middle-end/106027 - fix types in needle folding

    The fold_to_nonsharp_ineq_using_bound folding ends up creating invalid
    typed IL which confuses later foldings.  The following fixes that.

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

            PR middle-end/106027
            * fold-const.cc (fold_to_nonsharp_ineq_using_bound): Use the
            type of the prevailing comparison for the new comparison type.
            (fold_binary_loc): Use proper types for the A < X && A + 1 > Y
            to A < X && A >= Y folding.

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

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

* [Bug middle-end/106027] [11/12 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-06-20 13:02 ` cvs-commit at gcc dot gnu.org
@ 2022-06-20 13:02 ` rguenth at gcc dot gnu.org
  2022-07-19 11:38 ` 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-06-20 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |middle-end
      Known to fail|13.0                        |
      Known to work|                            |13.0
           Priority|P3                          |P2
            Summary|[11/12/13 Regression] ICE:  |[11/12 Regression] ICE:
                   |'verify_gimple' failed      |'verify_gimple' failed
                   |(error: mismatching         |(error: mismatching
                   |comparison operand types)   |comparison operand types)
                   |since                       |since
                   |r11-2450-g10231958fcfb13bc  |r11-2450-g10231958fcfb13bc

--- 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 middle-end/106027] [11/12 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-06-20 13:02 ` [Bug middle-end/106027] [11/12 " rguenth at gcc dot gnu.org
@ 2022-07-19 11:38 ` cvs-commit at gcc dot gnu.org
  2022-10-11 13:04 ` [Bug middle-end/106027] [11 " cvs-commit at gcc dot gnu.org
  2022-10-11 13:05 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-19 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:71c6baa9abc8c378a1aa913398a8f1a2277946e0

commit r12-8581-g71c6baa9abc8c378a1aa913398a8f1a2277946e0
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jun 20 13:40:50 2022 +0200

    middle-end/106027 - fix types in needle folding

    The fold_to_nonsharp_ineq_using_bound folding ends up creating invalid
    typed IL which confuses later foldings.  The following fixes that.

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

            PR middle-end/106027
            * fold-const.cc (fold_to_nonsharp_ineq_using_bound): Use the
            type of the prevailing comparison for the new comparison type.
            (fold_binary_loc): Use proper types for the A < X && A + 1 > Y
            to A < X && A >= Y folding.

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

    (cherry picked from commit 713f2fd923442b1be620a44240ddf786ae0ab476)

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

* [Bug middle-end/106027] [11 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-07-19 11:38 ` cvs-commit at gcc dot gnu.org
@ 2022-10-11 13:04 ` cvs-commit at gcc dot gnu.org
  2022-10-11 13:05 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-11 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 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:a27e5fc76a49b759d271a828f225899434b537e9

commit r11-10302-ga27e5fc76a49b759d271a828f225899434b537e9
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jun 20 13:40:50 2022 +0200

    middle-end/106027 - fix types in needle folding

    The fold_to_nonsharp_ineq_using_bound folding ends up creating invalid
    typed IL which confuses later foldings.  The following fixes that.

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

            PR middle-end/106027
            * fold-const.c (fold_to_nonsharp_ineq_using_bound): Use the
            type of the prevailing comparison for the new comparison type.
            (fold_binary_loc): Use proper types for the A < X && A + 1 > Y
            to A < X && A >= Y folding.

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

    (cherry picked from commit 713f2fd923442b1be620a44240ddf786ae0ab476)

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

* [Bug middle-end/106027] [11 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc
  2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-10-11 13:04 ` [Bug middle-end/106027] [11 " cvs-commit at gcc dot gnu.org
@ 2022-10-11 13:05 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-11 13:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.3.1
         Resolution|---                         |FIXED
             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-10-11 13:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19  5:22 [Bug tree-optimization/106027] New: ICE: 'verify_gimple' failed (error: mismatching comparison operand types) asolokha at gmx dot com
2022-06-20  8:15 ` [Bug tree-optimization/106027] [11/12/13 Regression] ICE: 'verify_gimple' failed (error: mismatching comparison operand types) since r11-2450-g10231958fcfb13bc marxin at gcc dot gnu.org
2022-06-20 11:27 ` rguenth at gcc dot gnu.org
2022-06-20 11:40 ` rguenth at gcc dot gnu.org
2022-06-20 13:02 ` cvs-commit at gcc dot gnu.org
2022-06-20 13:02 ` [Bug middle-end/106027] [11/12 " rguenth at gcc dot gnu.org
2022-07-19 11:38 ` cvs-commit at gcc dot gnu.org
2022-10-11 13:04 ` [Bug middle-end/106027] [11 " cvs-commit at gcc dot gnu.org
2022-10-11 13:05 ` 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).