public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107305] New: ICE: 'verify_gimple' failed
@ 2022-10-18 17:41 gscfq@t-online.de
  2022-10-18 17:43 ` [Bug c/107305] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2022-10-18 17:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107305
           Summary: ICE: 'verify_gimple' failed
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r7 :


$ cat z1.c
unsigned a;
static double *d;
static _Bool b;
__GIMPLE int
foo (int n)
{
  b = __builtin_add_overflow (n, *d, &a);
}


$ gcc-13-20221016 -c z1.c -fgimple
z1.c: In function 'foo':
z1.c:5:1: error: invalid argument to gimple call
    5 | foo (int n)
      | ^~~
*d
b = __builtin_add_overflow (n, *d, &a);
during GIMPLE pass: *warn_unused_result
z1.c:5:1: internal compiler error: 'verify_gimple' failed
0xf2c76d verify_gimple_in_seq(gimple*)
        ../../gcc/tree-cfg.cc:5301
0xdce2ca execute_function_todo
        ../../gcc/passes.cc:2093
0xdcebf2 execute_todo
        ../../gcc/passes.cc:2145

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
@ 2022-10-18 17:43 ` mpolacek at gcc dot gnu.org
  2022-10-18 17:44 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-10-18 17:43 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2022-10-18

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Without -fgimple:

107305.c:4:1: error: ‘__GIMPLE’ only valid with ‘-fgimple’
    4 | __GIMPLE int
      | ^~~~~~~~
during GIMPLE pass: lower
107305.c: In function ‘foo’:
107305.c:5:1: internal compiler error: in maybe_canonicalize_mem_ref_addr, at
gimple-fold.cc:5976
    5 | foo (int n)
      | ^~~
0xf6da98 maybe_canonicalize_mem_ref_addr
        /home/mpolacek/src/gcc/gcc/gimple-fold.cc:5976
0xf6e630 fold_stmt_1
        /home/mpolacek/src/gcc/gcc/gimple-fold.cc:6134
0xf6f28b fold_stmt(gimple_stmt_iterator*)
        /home/mpolacek/src/gcc/gcc/gimple-fold.cc:6379
0x29c1e62 lower_stmt
        /home/mpolacek/src/gcc/gcc/gimple-low.cc:784
0x29bff00 lower_sequence
        /home/mpolacek/src/gcc/gcc/gimple-low.cc:228
0x29c2300 lower_gimple_bind
        /home/mpolacek/src/gcc/gcc/gimple-low.cc:873
0x29bfb59 lower_function_body
        /home/mpolacek/src/gcc/gcc/gimple-low.cc:118
0x29bfe7c execute
        /home/mpolacek/src/gcc/gcc/gimple-low.cc:205

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
  2022-10-18 17:43 ` [Bug c/107305] " mpolacek at gcc dot gnu.org
@ 2022-10-18 17:44 ` pinskia at gcc dot gnu.org
  2022-10-19  6:47 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-18 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The input is invalid gimple to begin with so ....

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
  2022-10-18 17:43 ` [Bug c/107305] " mpolacek at gcc dot gnu.org
  2022-10-18 17:44 ` pinskia at gcc dot gnu.org
@ 2022-10-19  6:47 ` marxin at gcc dot gnu.org
  2022-10-19  7:16 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-19  6:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r7-6561-g7af4b20d83a8ce30.

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-10-19  6:47 ` marxin at gcc dot gnu.org
@ 2022-10-19  7:16 ` rguenth at gcc dot gnu.org
  2022-10-20  9:29 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-19  7:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
             Blocks|                            |101057

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Yeah, the "design" of the GIMPLE frontend is that most IL validation is done by
the verifiers instead of the parser.

Maybe we can run the verifier on the parsing result and abort compilation
if there was any error.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101057
[Bug 101057] [gimplefe] GIMPLE frontend issues

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-10-19  7:16 ` rguenth at gcc dot gnu.org
@ 2022-10-20  9:29 ` cvs-commit at gcc dot gnu.org
  2022-10-20  9:31 ` rguenth at gcc dot gnu.org
  2022-11-28 22:21 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-20  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:8e2b5cf7cde999582d1b8fff021faa487c8e34b0

commit r13-3397-g8e2b5cf7cde999582d1b8fff021faa487c8e34b0
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Oct 19 14:12:11 2022 +0200

    c/107305 - avoid ICEing with invalid GIMPLE input to the GIMPLE FE

    The GIMPLE FE was designed to defer semantic error checking to the
    GIMPLE IL verifier.  But that can end up causing spurious ICEs
    earlier and in fact it will report an internal error.  The following
    tries to improve the situation by explicitely calling into the
    verifier from the parser and intructing it to not ICE but instead
    zap the parsed body after an error is discovered.

            PR c/107305
            PR c/107306
    gcc/c/
            * gimple-parser.cc (c_parser_parse_gimple_body): Verify
            the parsed IL and zap the body on error.

    gcc/
            * tree-cfg.h (verify_gimple_in_seq): Add parameter to
            indicate whether to emit an ICE.  Add return value.
            (verify_gimple_in_cfg): Likewise.
            * tree-cfg.cc (verify_gimple_in_seq): Likewise.
            (verify_gimple_in_cfg): Likewise.

    gcc/testsuite/
            * gcc.dg/gimplefe-error-15.c: New testcase.

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-10-20  9:29 ` cvs-commit at gcc dot gnu.org
@ 2022-10-20  9:31 ` rguenth at gcc dot gnu.org
  2022-11-28 22:21 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-20  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
So implemented that, fixed.

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

* [Bug c/107305] ICE: 'verify_gimple' failed
  2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-10-20  9:31 ` rguenth at gcc dot gnu.org
@ 2022-11-28 22:21 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

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

end of thread, other threads:[~2022-11-28 22:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 17:41 [Bug c/107305] New: ICE: 'verify_gimple' failed gscfq@t-online.de
2022-10-18 17:43 ` [Bug c/107305] " mpolacek at gcc dot gnu.org
2022-10-18 17:44 ` pinskia at gcc dot gnu.org
2022-10-19  6:47 ` marxin at gcc dot gnu.org
2022-10-19  7:16 ` rguenth at gcc dot gnu.org
2022-10-20  9:29 ` cvs-commit at gcc dot gnu.org
2022-10-20  9:31 ` rguenth at gcc dot gnu.org
2022-11-28 22:21 ` 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).