public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
@ 2022-03-20  4:29 asolokha at gmx dot com
  2022-03-21  8:55 ` [Bug rtl-optimization/104989] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: asolokha at gmx dot com @ 2022-03-20  4:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104989
           Summary: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error:
                    flow control insn inside a basic block)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++ 12.0.1 20220313 snapshot (g:7e28750395889d16a9cba49cd5935ced7dc00ce8) ICEs
when compiling gcc/testsuite/g++.dg/other/pr84964.C w/ -fnon-call-exceptions:

% g++-12.0.1 -fchecking -fnon-call-exceptions -w
gcc/testsuite/g++.dg/other/pr84964.C
gcc/testsuite/g++.dg/other/pr84964.C: In function 'void c(...)':
gcc/testsuite/g++.dg/other/pr84964.C:6:16: sorry, unimplemented: passing too
large argument on stack
    6 | void c(...) { c(a()); }
      |               ~^~~~~
gcc/testsuite/g++.dg/other/pr84964.C:6:23: error: in basic block 2:
    6 | void c(...) { c(a()); }
      |                       ^
gcc/testsuite/g++.dg/other/pr84964.C:6:23: error: flow control insn inside a
basic block
(call_insn 9 8 14 2 (call (mem:QI (symbol_ref:DI ("_Z1cz") [flags 0x3]
<function_decl 0x7f451f1a4400 c>) [0 c S1 A8])
        (const_int 2305843009213693952 [0x2000000000000000]))
"gcc/testsuite/g++.dg/other/pr84964.C":6:16 -1
     (expr_list:REG_ARGS_SIZE (const_int 0 [0])
        (expr_list:REG_NORETURN (const_int 0 [0])
            (nil)))
    (expr_list (use (reg:QI 0 ax))
        (nil)))
during RTL pass: expand
gcc/testsuite/g++.dg/other/pr84964.C:6:23: internal compiler error: in
rtl_verify_bb_insns, at cfgrtl.cc:2797
0x800d85 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/rtl-error.cc:108
0xcd5ff3 rtl_verify_bb_insns
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfgrtl.cc:2797
0xcde38a rtl_verify_flow_info_1
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfgrtl.cc:2883
0xcde38a rtl_verify_flow_info
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfgrtl.cc:3126
0xcc456a verify_flow_info()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfghooks.cc:282
0x1ee7578 checking_verify_flow_info
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfghooks.h:214
0x1ee7578 try_optimize_cfg
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfgcleanup.cc:2980
0x1ee7578 cleanup_cfg(int)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfgcleanup.cc:3143
0xcc1f1f execute
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/cfgexpand.cc:6971

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

* [Bug rtl-optimization/104989] [9/10/11/12 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
@ 2022-03-21  8:55 ` rguenth at gcc dot gnu.org
  2022-03-21  9:33 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-21  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug rtl-optimization/104989] [9/10/11/12 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
  2022-03-21  8:55 ` [Bug rtl-optimization/104989] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
@ 2022-03-21  9:33 ` marxin at gcc dot gnu.org
  2022-03-21 10:34 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-03-21  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-03-21
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rsandifo at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r8-5501-ga20c5714c689bf1c.

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

* [Bug rtl-optimization/104989] [9/10/11/12 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
  2022-03-21  8:55 ` [Bug rtl-optimization/104989] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
  2022-03-21  9:33 ` marxin at gcc dot gnu.org
@ 2022-03-21 10:34 ` jakub at gcc dot gnu.org
  2022-03-22  7:40 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-21 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52653
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52653&action=edit
gcc12-pr104989.patch

IMHO the flags |= ECF_NORETURN; change is too problematic, because for
noreturn calls we rely on the containing bb to not have fallthru edges and the
call being at the end of the bb.  This patch arranges that assertion not to
trigger either, but throws away the whole call insn sequence.

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

* [Bug rtl-optimization/104989] [9/10/11/12 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-03-21 10:34 ` jakub at gcc dot gnu.org
@ 2022-03-22  7:40 ` cvs-commit at gcc dot gnu.org
  2022-03-22  7:43 ` [Bug rtl-optimization/104989] [9/10/11 " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-22  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:6adbb51eaa85f5bfed1ee06327daca306d48986d

commit r12-7749-g6adbb51eaa85f5bfed1ee06327daca306d48986d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 22 08:39:40 2022 +0100

    calls: Fix error recovery after sorry differently [PR104989]

    On Mon, Feb 28, 2022 at 07:52:56AM -0000, Roger Sayle wrote:
    > This patch resolves PR c++/84964 which is an ICE in the middle-end after
    > emitting a "sorry, unimplemented" message, and is a regression from
    > earlier releases of GCC.  This issue is that after encountering a
    > function call requiring an unreasonable amount of stack space, the
    > code continues and falls foul of an assert checking that stack pointer
    > has been correctly updated.  The fix is to (locally) consider aborted
    > function calls as "no return", which skips this downstream sanity check.

    As can be seen on PR104989, just setting ECF_NORETURN after sorry is quite
    risky and leads to other ICEs.  The problem is that ECF_NORETURN calls
    better should be at the end of basic blocks that don't have any fallthru
    successor edges, otherwise we can ICE later.

    This patch instead sets sibcall_failure if in pass == 0 (sibcall_failure
    means that the tail call sequence is not useful/not desirable and throws
    it away) and otherwise sets a new bool variable that will let us pass
    the assertion and also throws away the whole call sequence, I think that is
    best for error recovery.

    2022-03-22  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/104989
            * calls.cc (expand_call): Don't set ECF_NORETURN in flags after
            sorry for passing too large argument, instead set sibcall_failure
            for pass == 0, or a new normal_failure flag otherwise.  If
            normal_failure is set, don't assert all stack has been deallocated
            at the end and throw away the whole insn sequence.

            * g++.dg/other/pr104989.C: New test.

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

* [Bug rtl-optimization/104989] [9/10/11 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-03-22  7:40 ` cvs-commit at gcc dot gnu.org
@ 2022-03-22  7:43 ` jakub at gcc dot gnu.org
  2022-05-27  9:47 ` [Bug rtl-optimization/104989] [10/11 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-22  7:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11/12 Regression] ICE |[9/10/11 Regression] ICE in
                   |in rtl_verify_bb_insns, at  |rtl_verify_bb_insns, at
                   |cfgrtl.cc:2797 (error: flow |cfgrtl.cc:2797 (error: flow
                   |control insn inside a basic |control insn inside a basic
                   |block)                      |block)

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

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

* [Bug rtl-optimization/104989] [10/11 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-03-22  7:43 ` [Bug rtl-optimization/104989] [9/10/11 " jakub at gcc dot gnu.org
@ 2022-05-27  9:47 ` rguenth at gcc dot gnu.org
  2022-06-28 10:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug rtl-optimization/104989] [10/11 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-05-27  9:47 ` [Bug rtl-optimization/104989] [10/11 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:48 ` jakub at gcc dot gnu.org
  2023-04-15 17:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 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] 11+ messages in thread

* [Bug rtl-optimization/104989] [10/11 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-06-28 10:48 ` jakub at gcc dot gnu.org
@ 2023-04-15 17:03 ` cvs-commit at gcc dot gnu.org
  2023-04-16  3:18 ` sjames at gcc dot gnu.org
  2023-07-07 10:42 ` [Bug rtl-optimization/104989] [11 " rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-15 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by John David Anglin <danglin@gcc.gnu.org>:

https://gcc.gnu.org/g:4f1c5e54d782b26304b0095ffb3ceb4c92c3c78d

commit r13-7194-g4f1c5e54d782b26304b0095ffb3ceb4c92c3c78d
Author: John David Anglin <danglin@gcc.gnu.org>
Date:   Sat Apr 15 17:02:44 2023 +0000

    Fix handling of large arguments passed by value.

    2023-04-15  John David Anglin  <danglin@gcc.gnu.org>

    gcc/ChangeLog:

            PR target/104989
            * config/pa/pa-protos.h (pa_function_arg_size): Update prototype.
            * config/pa/pa.cc (pa_function_arg): Return NULL_RTX if argument
            size is zero.
            (pa_arg_partial_bytes): Don't call pa_function_arg_size twice.
            (pa_function_arg_size): Change return type to int.  Return zero
            for arguments larger than 1 GB.  Update comments.

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

* [Bug rtl-optimization/104989] [10/11 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (7 preceding siblings ...)
  2023-04-15 17:03 ` cvs-commit at gcc dot gnu.org
@ 2023-04-16  3:18 ` sjames at gcc dot gnu.org
  2023-07-07 10:42 ` [Bug rtl-optimization/104989] [11 " rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-16  3:18 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #8 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to CVS Commits from comment #7)
> The master branch has been updated by John David Anglin
> <danglin@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:4f1c5e54d782b26304b0095ffb3ceb4c92c3c78d
> 
> commit r13-7194-g4f1c5e54d782b26304b0095ffb3ceb4c92c3c78d
> Author: John David Anglin <danglin@gcc.gnu.org>
> Date:   Sat Apr 15 17:02:44 2023 +0000
> 
>     Fix handling of large arguments passed by value.
>     
>     2023-04-15  John David Anglin  <danglin@gcc.gnu.org>
>     
>     gcc/ChangeLog:
>     
>             PR target/104989
> [...]

This was for PR109478 instead.

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

* [Bug rtl-optimization/104989] [11 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block)
  2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
                   ` (8 preceding siblings ...)
  2023-04-16  3:18 ` sjames at gcc dot gnu.org
@ 2023-07-07 10:42 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-20  4:29 [Bug rtl-optimization/104989] New: ICE in rtl_verify_bb_insns, at cfgrtl.cc:2797 (error: flow control insn inside a basic block) asolokha at gmx dot com
2022-03-21  8:55 ` [Bug rtl-optimization/104989] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2022-03-21  9:33 ` marxin at gcc dot gnu.org
2022-03-21 10:34 ` jakub at gcc dot gnu.org
2022-03-22  7:40 ` cvs-commit at gcc dot gnu.org
2022-03-22  7:43 ` [Bug rtl-optimization/104989] [9/10/11 " jakub at gcc dot gnu.org
2022-05-27  9:47 ` [Bug rtl-optimization/104989] [10/11 " rguenth at gcc dot gnu.org
2022-06-28 10:48 ` jakub at gcc dot gnu.org
2023-04-15 17:03 ` cvs-commit at gcc dot gnu.org
2023-04-16  3:18 ` sjames at gcc dot gnu.org
2023-07-07 10:42 ` [Bug rtl-optimization/104989] [11 " 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).