public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
@ 2020-08-07  2:39 asolokha at gmx dot com
  2020-08-07  7:40 ` [Bug tree-optimization/96514] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2020-08-07  2:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96514
           Summary: [9/10/11 Regression] ICE: verify_flow_info failed
                    (error: control flow in the middle of basic block 3)
           Product: gcc
           Version: 11.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: ---
            Target: x86_64-pc-linux-gnu

gcc-11.0.0-alpha20200802 snapshot (g:6e46b3f3da5c03bc529b3690dd0995927feb9142)
ICEs when compiling the following testcase w/ -O1:

int __attribute__ ((pure, returns_twice))
r0 (void);

void
vy (int t7)
{
  while (t7 == 0)
    r0 ();
}

void
qw (int t7)
{
  vy (t7);

  if (0)
    r0 ();
}

void __attribute__ ((simd))
un (int t7)
{
  qw (t7);
  qw (t7);
}

% x86_64-pc-linux-gnu-gcc-11.0.0 -O1 -c sylqgldf.c
sylqgldf.c: In function 'un.simdclone.0':
sylqgldf.c:21:1: error: control flow in the middle of basic block 3
   21 | un (int t7)
      | ^~
during GIMPLE pass: ifcvt
sylqgldf.c:21:1: internal compiler error: verify_flow_info failed
0x917096 verify_flow_info()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200802/work/gcc-11-20200802/gcc/cfghooks.c:269
0xe15db4 checking_verify_flow_info
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200802/work/gcc-11-20200802/gcc/cfghooks.h:212
0xe15db4 cleanup_tree_cfg_noloop
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200802/work/gcc-11-20200802/gcc/tree-cfgcleanup.c:1114
0xe163c8 cleanup_tree_cfg(unsigned int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200802/work/gcc-11-20200802/gcc/tree-cfgcleanup.c:1165
0xe3db5c execute
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200802/work/gcc-11-20200802/gcc/tree-if-conv.c:3201
0xe3db5c execute
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200802/work/gcc-11-20200802/gcc/tree-if-conv.c:3170

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

* [Bug tree-optimization/96514] [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
  2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
@ 2020-08-07  7:40 ` rguenth at gcc dot gnu.org
  2020-08-07 10:21 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-07  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

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|---                         |9.4
     Ever confirmed|0                           |1
           Keywords|                            |ice-checking
   Last reconfirmed|                            |2020-08-07
             Status|UNCONFIRMED                 |ASSIGNED
      Known to fail|                            |9.1.0
      Known to work|                            |8.4.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  We "if-convert" to

  <bb 3> [local count: 1073741824]:
  # iter.5_3 = PHI <iter.5_4(7), 0(13)>
  # ivtmp_7 = PHI <ivtmp_8(7), 4(13)>
  t7_1 = t7.3[iter.5_3];
  vy (t7_1);
  vy (t7_1);

thus simply merge blocks.  Because the vy() calls are marked as
gimple_call_ctrl_altering_p () which is because r0 is marked
as returns twice and in qw vy is a possible source of abnormal
return.  Later when the last returns_twice call is eliminated
in the function we'd no longer need those markings but nothing
clears them (CFG cleanup does, but only when the callee itself
says so, not when circumstances no longer require the flag).

The trigger here is the cfun->has_nonlocal_label or cfun->calls_setjmp
check in call_can_make_abnormal_goto.

Now I'm not sure if CFG cleanup could simply clear the flag when
there's just a single outgoing edge but still if-conversion needs
to honor stale flags (or clear them itself?).

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

* [Bug tree-optimization/96514] [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
  2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
  2020-08-07  7:40 ` [Bug tree-optimization/96514] " rguenth at gcc dot gnu.org
@ 2020-08-07 10:21 ` cvs-commit at gcc dot gnu.org
  2020-08-07 10:22 ` [Bug tree-optimization/96514] [9/10 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-07 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:c3f94f5786a014515c09c7852db228c74adf51e5

commit r11-2607-gc3f94f5786a014515c09c7852db228c74adf51e5
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Aug 7 10:16:05 2020 +0200

    tree-optimization/96514 - avoid if-converting control-altering calls

    This avoids if-converting when encountering control-altering calls.

    2020-08-07  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/96514
            * tree-if-conv.c (if_convertible_bb_p): If the last stmt
            is a call that is control-altering, fail.

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

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

* [Bug tree-optimization/96514] [9/10 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
  2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
  2020-08-07  7:40 ` [Bug tree-optimization/96514] " rguenth at gcc dot gnu.org
  2020-08-07 10:21 ` cvs-commit at gcc dot gnu.org
@ 2020-08-07 10:22 ` rguenth at gcc dot gnu.org
  2020-09-11 12:12 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-07 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.0
            Summary|[9/10/11 Regression] ICE:   |[9/10 Regression] ICE:
                   |verify_flow_info failed     |verify_flow_info failed
                   |(error: control flow in the |(error: control flow in the
                   |middle of basic block 3)    |middle of basic block 3)

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.  The possible missed-optimization prevails.

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

* [Bug tree-optimization/96514] [9/10 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
  2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-08-07 10:22 ` [Bug tree-optimization/96514] [9/10 " rguenth at gcc dot gnu.org
@ 2020-09-11 12:12 ` cvs-commit at gcc dot gnu.org
  2020-12-02 12:21 ` [Bug tree-optimization/96514] [9 " cvs-commit at gcc dot gnu.org
  2020-12-02 12:28 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-11 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r10-8747-ga568a893f38a9cd32ddffd32bb9b6636deeeb5f1
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Aug 7 10:16:05 2020 +0200

    tree-optimization/96514 - avoid if-converting control-altering calls

    This avoids if-converting when encountering control-altering calls.

    2020-08-07  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/96514
            * tree-if-conv.c (if_convertible_bb_p): If the last stmt
            is a call that is control-altering, fail.

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

    (cherry picked from commit c3f94f5786a014515c09c7852db228c74adf51e5)

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

* [Bug tree-optimization/96514] [9 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
  2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-09-11 12:12 ` cvs-commit at gcc dot gnu.org
@ 2020-12-02 12:21 ` cvs-commit at gcc dot gnu.org
  2020-12-02 12:28 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-02 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:6178c27b4bbea186305ecbfeb4b9939dece75a9d

commit r9-9086-g6178c27b4bbea186305ecbfeb4b9939dece75a9d
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Aug 7 10:16:05 2020 +0200

    tree-optimization/96514 - avoid if-converting control-altering calls

    This avoids if-converting when encountering control-altering calls.

    2020-08-07  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/96514
            * tree-if-conv.c (if_convertible_bb_p): If the last stmt
            is a call that is control-altering, fail.

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

    (cherry picked from commit c3f94f5786a014515c09c7852db228c74adf51e5)

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

* [Bug tree-optimization/96514] [9 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3)
  2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-12-02 12:21 ` [Bug tree-optimization/96514] [9 " cvs-commit at gcc dot gnu.org
@ 2020-12-02 12:28 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-02 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Known to fail|                            |9.3.0
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |9.3.1

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-12-02 12:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07  2:39 [Bug tree-optimization/96514] New: [9/10/11 Regression] ICE: verify_flow_info failed (error: control flow in the middle of basic block 3) asolokha at gmx dot com
2020-08-07  7:40 ` [Bug tree-optimization/96514] " rguenth at gcc dot gnu.org
2020-08-07 10:21 ` cvs-commit at gcc dot gnu.org
2020-08-07 10:22 ` [Bug tree-optimization/96514] [9/10 " rguenth at gcc dot gnu.org
2020-09-11 12:12 ` cvs-commit at gcc dot gnu.org
2020-12-02 12:21 ` [Bug tree-optimization/96514] [9 " cvs-commit at gcc dot gnu.org
2020-12-02 12:28 ` 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).