public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
@ 2021-06-21 19:37 cnsun at uwaterloo dot ca
  2021-06-22  6:27 ` [Bug c/101156] " marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-06-21 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101156
           Summary: ICE: ‘verify_gimple’ failed,
                    verify_gimple_in_seq(gimple*)
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210621 (experimental) [master revision
:ac955e7ab:3e42ff715697c75c4fb4aed550a8a15edb3eeea6] (GCC)

$ cat mutant.c
struct S {
  int i;
} baz(struct S *p) {
  setjmp(p--);
}

$ gcc-trunk  mutant.c
mutant.c: In function ‘baz’:
mutant.c:4:3: warning: implicit declaration of function ‘setjmp’
[-Wimplicit-function-declaration]
    4 |   setjmp(p--);
      |   ^~~~~~
mutant.c:3:3: error: type mismatch in ‘pointer_plus_expr’
    3 | } baz(struct S *p) {
      |   ^~~
struct S *

<<< error >>>

sizetype

p = _1 + 18446744073709551612;
mutant.c:3:3: internal compiler error: ‘verify_gimple’ failed
0xf4c4c5 verify_gimple_in_seq(gimple*)
        /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/gcc/tree-cfg.c:5183
0xc3a336 gimplify_body(tree_node*, bool)
        /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/gcc/gimplify.c:15422
0xc3a4d1 gimplify_function_tree(tree_node*)
        /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/gcc/gimplify.c:15493
0xa8be17 cgraph_node::analyze()
        /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/gcc/cgraphunit.c:670
0xa8ed11 analyze_functions
        /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/gcc/cgraphunit.c:1234
0xa8f7e1 symbol_table::finalize_compilation_unit()
        /tmp/tmp.oJWiD4wb77-gcc-builder/gcc/gcc/cgraphunit.c:2508
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.

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

* [Bug c/101156] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
@ 2021-06-22  6:27 ` marxin at gcc dot gnu.org
  2021-06-22  6:54 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-22  6:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-06-22
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r7-536-g381cdae49785fc4b.

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

* [Bug c/101156] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
  2021-06-22  6:27 ` [Bug c/101156] " marxin at gcc dot gnu.org
@ 2021-06-22  6:54 ` rguenth at gcc dot gnu.org
  2021-06-22  8:00 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-22  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

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
             Status|NEW                         |ASSIGNED

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

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

* [Bug c/101156] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
  2021-06-22  6:27 ` [Bug c/101156] " marxin at gcc dot gnu.org
  2021-06-22  6:54 ` rguenth at gcc dot gnu.org
@ 2021-06-22  8:00 ` rguenth at gcc dot gnu.org
  2021-06-22 13:31 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-22  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so the issue is we're calling gimplify_expr (...., false /*allow_ssa*/)
on 'p--' and the gimplified sequence looks like the following on the pre_p
sequence:

 p.0_1 = p;
 p = p.0_1 + 18446744073709551612;

and the gimplify_expr result is just p.0_1.  Then we do

          /* Avoid the extra copy if possible.  */
          *expr_p = create_tmp_reg (TREE_TYPE (name));
          if (!gimple_nop_p (SSA_NAME_DEF_STMT (name)))
            gimple_set_lhs (SSA_NAME_DEF_STMT (name), *expr_p);
          release_ssa_name (name);

but obviously that disregards that there's other uses of p.0_1 already.
I suppose the above might be premature optimization but I'm going to gather
some statistics on that I guess.

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

* [Bug c/101156] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-06-22  8:00 ` rguenth at gcc dot gnu.org
@ 2021-06-22 13:31 ` cvs-commit at gcc dot gnu.org
  2021-06-22 13:32 ` [Bug middle-end/101156] [9/10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-22 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:b4e21c80462682c4e6e5e487fe87107b27f8b4bd

commit r12-1729-gb4e21c80462682c4e6e5e487fe87107b27f8b4bd
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jun 22 12:13:44 2021 +0200

    middle-end/101156 - remove not working optimization in gimplification

    This removes a premature and not working optimization from the
    gimplifier.  When gimplification is requested not to produce a SSA
    name we try to avoid generating a copy when we did so anyway but
    instead replace the LHS of its definition.  But that only works in
    case there are no uses of the SSA name already which is something
    we cannot easily check, so the following removes said optimization.

    Statistics on the whole bootstrap shows we hit this optimization
    only for libiberty/cp-demangle.c and overall we have 21652112
    gimplifications where just 240 copies are elided.  Preserving
    the optimization would require scanning the original expression
    and the pre and post sequences for SSA names and uses, that seems
    excessive to avoid these 240 copies.

    2021-06-22  Richard Biener  <rguenther@suse.de>

            PR middle-end/101156
            * gimplify.c (gimplify_expr): Remove premature incorrect
            optimization.

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

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

* [Bug middle-end/101156] [9/10/11 Regression] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
                   ` (3 preceding siblings ...)
  2021-06-22 13:31 ` cvs-commit at gcc dot gnu.org
@ 2021-06-22 13:32 ` rguenth at gcc dot gnu.org
  2021-07-07 14:06 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-22 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.5
            Version|tree-ssa                    |12.0
      Known to fail|                            |7.5.0, 8.5.0
            Summary|ICE: ‘verify_gimple’        |[9/10/11 Regression] ICE:
                   |failed,                     |‘verify_gimple’ failed,
                   |verify_gimple_in_seq(gimple |verify_gimple_in_seq(gimple
                   |*)                          |*)
           Keywords|                            |ice-on-valid-code,
                   |                            |wrong-code
      Known to work|                            |12.0
          Component|c                           |middle-end

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar, unsure if worth backporting - we've not hit this in 5
years ;)

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

* [Bug middle-end/101156] [9/10/11 Regression] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
                   ` (4 preceding siblings ...)
  2021-06-22 13:32 ` [Bug middle-end/101156] [9/10/11 Regression] " rguenth at gcc dot gnu.org
@ 2021-07-07 14:06 ` cvs-commit at gcc dot gnu.org
  2022-05-27  9:45 ` [Bug middle-end/101156] [10 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-07 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:9e1173009150086a927a6f0e001fd04c5cac54cb

commit r11-8698-g9e1173009150086a927a6f0e001fd04c5cac54cb
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jun 22 12:13:44 2021 +0200

    middle-end/101156 - remove not working optimization in gimplification

    This removes a premature and not working optimization from the
    gimplifier.  When gimplification is requested not to produce a SSA
    name we try to avoid generating a copy when we did so anyway but
    instead replace the LHS of its definition.  But that only works in
    case there are no uses of the SSA name already which is something
    we cannot easily check, so the following removes said optimization.

    Statistics on the whole bootstrap shows we hit this optimization
    only for libiberty/cp-demangle.c and overall we have 21652112
    gimplifications where just 240 copies are elided.  Preserving
    the optimization would require scanning the original expression
    and the pre and post sequences for SSA names and uses, that seems
    excessive to avoid these 240 copies.

    2021-06-22  Richard Biener  <rguenther@suse.de>

            PR middle-end/101156
            * gimplify.c (gimplify_expr): Remove premature incorrect
            optimization.

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

    (cherry picked from commit b4e21c80462682c4e6e5e487fe87107b27f8b4bd)

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

* [Bug middle-end/101156] [10 Regression] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
                   ` (5 preceding siblings ...)
  2021-07-07 14:06 ` cvs-commit at gcc dot gnu.org
@ 2022-05-27  9:45 ` rguenth at gcc dot gnu.org
  2022-06-28 10:45 ` jakub at gcc dot gnu.org
  2023-07-07  9:42 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug middle-end/101156] [10 Regression] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
                   ` (6 preceding siblings ...)
  2022-05-27  9:45 ` [Bug middle-end/101156] [10 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:45 ` jakub at gcc dot gnu.org
  2023-07-07  9:42 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug middle-end/101156] [10 Regression] ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*)
  2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
                   ` (7 preceding siblings ...)
  2022-06-28 10:45 ` jakub at gcc dot gnu.org
@ 2023-07-07  9:42 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.2
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.2.

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 19:37 [Bug c/101156] New: ICE: ‘verify_gimple’ failed, verify_gimple_in_seq(gimple*) cnsun at uwaterloo dot ca
2021-06-22  6:27 ` [Bug c/101156] " marxin at gcc dot gnu.org
2021-06-22  6:54 ` rguenth at gcc dot gnu.org
2021-06-22  8:00 ` rguenth at gcc dot gnu.org
2021-06-22 13:31 ` cvs-commit at gcc dot gnu.org
2021-06-22 13:32 ` [Bug middle-end/101156] [9/10/11 Regression] " rguenth at gcc dot gnu.org
2021-07-07 14:06 ` cvs-commit at gcc dot gnu.org
2022-05-27  9:45 ` [Bug middle-end/101156] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
2023-07-07  9:42 ` 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).