public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary
@ 2023-01-30 11:31 dcb314 at hotmail dot com
  2023-01-30 12:06 ` [Bug rtl-optimization/108596] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-01-30 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108596
           Summary: error: EDGE_CROSSING missing across section boundary
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C code, derived from yesterday's linux-6.2-rc6:

enum { false, true };
__attribute__((__cold__)) _printk();
_static_cpu_has() {
  asm goto("" : : : : t_yes, t_no);
t_yes:
  return true;
t_no:
  return false;
}
acpi_sleep_prepare() {
  _Bool __trans_tmp_1 = _static_cpu_has();
  if (!__trans_tmp_1)
    acpi_set_waking_vector();
  _printk();
}

does this:

$ /home/dcb36/gcc/results/bin/gcc -c -w -std=gnu11   -O2 bug878.c 
bug878.c: In function ‘acpi_sleep_prepare’:
bug878.c:15:1: error: EDGE_CROSSING missing across section boundary
   15 | }
      | ^
during RTL pass: bbpart
bug878.c:15:1: internal compiler error: verify_flow_info failed
0x8818f1 verify_flow_info()
        ../../trunk.d1/gcc/cfghooks.cc:285

$ /home/dcb36/gcc/results/bin/gcc -c -w -std=gnu11   -O1 bug878.c 
$

The bug first seems to occur sometime before g:9b111debbfb79a0a,
dated 20221229.

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

* [Bug rtl-optimization/108596] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
@ 2023-01-30 12:06 ` rguenth at gcc dot gnu.org
  2023-01-30 12:16 ` [Bug rtl-optimization/108596] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-30 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-01-30
          Component|middle-end                  |rtl-optimization
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

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

* [Bug rtl-optimization/108596] [10/11/12/13 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
  2023-01-30 12:06 ` [Bug rtl-optimization/108596] " rguenth at gcc dot gnu.org
@ 2023-01-30 12:16 ` jakub at gcc dot gnu.org
  2023-01-30 12:24 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-30 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.5
            Summary|error: EDGE_CROSSING        |[10/11/12/13 Regression]
                   |missing across section      |error: EDGE_CROSSING
                   |boundary                    |missing across section
                   |                            |boundary
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems to have started with r9-4548-g3b131f6a86798c11093eee79b6069139efb92af9

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

* [Bug rtl-optimization/108596] [10/11/12/13 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
  2023-01-30 12:06 ` [Bug rtl-optimization/108596] " rguenth at gcc dot gnu.org
  2023-01-30 12:16 ` [Bug rtl-optimization/108596] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
@ 2023-01-30 12:24 ` jakub at gcc dot gnu.org
  2023-01-30 17:08 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-30 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Likely latent before that though.
Slightly cleaned up testcase, just -O2 is needed:

__attribute__((__cold__)) void foo (void);
void qux (void);

int
bar (void)
{
  asm goto ("" : : : : l1, l0);
l1:
  return 1;
l0:
  return 0;
}

void
baz ()
{
  _Bool x = bar ();
  if (!x)
    qux ();
  foo ();
}

Or even simpler (again -O2):
__attribute__((__cold__)) void foo (void);
void bar (void);

void
baz ()
{
  asm goto ("" : : : : l1, l0);
  goto l0;
l1:
  bar ();
l0:
  foo ();
}

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

* [Bug rtl-optimization/108596] [10/11/12/13 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2023-01-30 12:24 ` jakub at gcc dot gnu.org
@ 2023-01-30 17:08 ` jakub at gcc dot gnu.org
  2023-01-31  8:47 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-30 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54373
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54373&action=edit
gcc13-pr108596.patch

Untested fix.

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

* [Bug rtl-optimization/108596] [10/11/12/13 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2023-01-30 17:08 ` jakub at gcc dot gnu.org
@ 2023-01-31  8:47 ` cvs-commit at gcc dot gnu.org
  2023-01-31  8:48 ` [Bug rtl-optimization/108596] [10/11/12 " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-31  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:603a6fbcaac1e80aa90d1d26318c881a53473066

commit r13-5527-g603a6fbcaac1e80aa90d1d26318c881a53473066
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 31 09:46:35 2023 +0100

    bbpart: Fix up ICE on asm goto [PR108596]

    On the following testcase we have asm goto in hot block with 2 successors,
    one cold to which it both falls through and has one of the label
    pointing to it and another hot successor with another label.

    Now, during bbpart we want to ensure that no blocks from one partition fall
    through into a block in a different partition.  fix_up_fall_thru_edges
    does that by temporarily clearing the EDGE_CROSSING on the fallthrough
edge,
    calling force_nonfallthru and then depending on whether it created a new
    bb either set EDGE_CROSSING on the single successor edge from the new bb
    (the new bb is kept in the same partition as the predecessor block), or
    if no new bb has been created setting EDGE_CROSSING back on the fallthru
    edge which has been forced non-EDGE_FALLTHRU.
    For asm goto this doesn't always work, force_nonfallthru can create a new
bb
    and change the fallthrough edge to point to that, but if the original
    fallthru destination block has its label referenced among the asm goto
    labels, it will create a new non-fallthru edge for the label(s).
    But because we've temporarily cheated and cleared EDGE_CROSSING on the
edge,
    it is cleared on the new edge as well, then the caller sees we've created
    a new bb and just sets EDGE_CROSSING on the single fallthru edge from the
    new bb.  But the direct edge from cur_bb to fallthru edge's destination
    isn't handled and fails afterwards consistency checks, because it crosses
    partitions.

    The following patch notes the case and sets EDGE_CROSSING on that edge too.

    2023-01-31  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108596
            * bb-reorder.cc (fix_up_fall_thru_edges): Handle the case where
cur_bb
            ends with asm goto and has a crossing fallthrough edge to the same
bb
            that contains at least one of its labels by restoring EDGE_CROSSING
            flag even on possible edge from cur_bb to new_bb successor.

            * gcc.c-torture/compile/pr108596.c: New test.

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

* [Bug rtl-optimization/108596] [10/11/12 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2023-01-31  8:47 ` cvs-commit at gcc dot gnu.org
@ 2023-01-31  8:48 ` jakub at gcc dot gnu.org
  2023-02-02  9:04 ` dcb314 at hotmail dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-31  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Summary|[10/11/12/13 Regression]    |[10/11/12 Regression]
                   |error: EDGE_CROSSING        |error: EDGE_CROSSING
                   |missing across section      |missing across section
                   |boundary                    |boundary

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

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

* [Bug rtl-optimization/108596] [10/11/12 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2023-01-31  8:48 ` [Bug rtl-optimization/108596] [10/11/12 " jakub at gcc dot gnu.org
@ 2023-02-02  9:04 ` dcb314 at hotmail dot com
  2023-02-10 17:46 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2023-02-02  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Jakub Jelinek from comment #6)
> Fixed on the trunk so far.

linux-6.2-rc6 builds fine, when built with -O3.

Thanks for the quick fix.

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

* [Bug rtl-optimization/108596] [10/11/12 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2023-02-02  9:04 ` dcb314 at hotmail dot com
@ 2023-02-10 17:46 ` cvs-commit at gcc dot gnu.org
  2023-02-10 18:01 ` [Bug rtl-optimization/108596] [10/11 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-10 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

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

commit r12-9146-ge365bfacf2617403f6bc6aa79a45a27bdba8da36
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 31 09:46:35 2023 +0100

    bbpart: Fix up ICE on asm goto [PR108596]

    On the following testcase we have asm goto in hot block with 2 successors,
    one cold to which it both falls through and has one of the label
    pointing to it and another hot successor with another label.

    Now, during bbpart we want to ensure that no blocks from one partition fall
    through into a block in a different partition.  fix_up_fall_thru_edges
    does that by temporarily clearing the EDGE_CROSSING on the fallthrough
edge,
    calling force_nonfallthru and then depending on whether it created a new
    bb either set EDGE_CROSSING on the single successor edge from the new bb
    (the new bb is kept in the same partition as the predecessor block), or
    if no new bb has been created setting EDGE_CROSSING back on the fallthru
    edge which has been forced non-EDGE_FALLTHRU.
    For asm goto this doesn't always work, force_nonfallthru can create a new
bb
    and change the fallthrough edge to point to that, but if the original
    fallthru destination block has its label referenced among the asm goto
    labels, it will create a new non-fallthru edge for the label(s).
    But because we've temporarily cheated and cleared EDGE_CROSSING on the
edge,
    it is cleared on the new edge as well, then the caller sees we've created
    a new bb and just sets EDGE_CROSSING on the single fallthru edge from the
    new bb.  But the direct edge from cur_bb to fallthru edge's destination
    isn't handled and fails afterwards consistency checks, because it crosses
    partitions.

    The following patch notes the case and sets EDGE_CROSSING on that edge too.

    2023-01-31  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108596
            * bb-reorder.cc (fix_up_fall_thru_edges): Handle the case where
cur_bb
            ends with asm goto and has a crossing fallthrough edge to the same
bb
            that contains at least one of its labels by restoring EDGE_CROSSING
            flag even on possible edge from cur_bb to new_bb successor.

            * gcc.c-torture/compile/pr108596.c: New test.

    (cherry picked from commit 603a6fbcaac1e80aa90d1d26318c881a53473066)

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

* [Bug rtl-optimization/108596] [10/11 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2023-02-10 17:46 ` cvs-commit at gcc dot gnu.org
@ 2023-02-10 18:01 ` jakub at gcc dot gnu.org
  2023-05-02 20:14 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-02-10 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression]       |[10/11 Regression] error:
                   |error: EDGE_CROSSING        |EDGE_CROSSING missing
                   |missing across section      |across section boundary
                   |boundary                    |

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for gcc 12.3 too.

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

* [Bug rtl-optimization/108596] [10/11 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2023-02-10 18:01 ` [Bug rtl-optimization/108596] [10/11 " jakub at gcc dot gnu.org
@ 2023-05-02 20:14 ` cvs-commit at gcc dot gnu.org
  2023-05-03 10:36 ` [Bug rtl-optimization/108596] [10 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:9a2302a2d268c5cd0b1016d916493d7cf78f495d

commit r11-10704-g9a2302a2d268c5cd0b1016d916493d7cf78f495d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 31 09:46:35 2023 +0100

    bbpart: Fix up ICE on asm goto [PR108596]

    On the following testcase we have asm goto in hot block with 2 successors,
    one cold to which it both falls through and has one of the label
    pointing to it and another hot successor with another label.

    Now, during bbpart we want to ensure that no blocks from one partition fall
    through into a block in a different partition.  fix_up_fall_thru_edges
    does that by temporarily clearing the EDGE_CROSSING on the fallthrough
edge,
    calling force_nonfallthru and then depending on whether it created a new
    bb either set EDGE_CROSSING on the single successor edge from the new bb
    (the new bb is kept in the same partition as the predecessor block), or
    if no new bb has been created setting EDGE_CROSSING back on the fallthru
    edge which has been forced non-EDGE_FALLTHRU.
    For asm goto this doesn't always work, force_nonfallthru can create a new
bb
    and change the fallthrough edge to point to that, but if the original
    fallthru destination block has its label referenced among the asm goto
    labels, it will create a new non-fallthru edge for the label(s).
    But because we've temporarily cheated and cleared EDGE_CROSSING on the
edge,
    it is cleared on the new edge as well, then the caller sees we've created
    a new bb and just sets EDGE_CROSSING on the single fallthru edge from the
    new bb.  But the direct edge from cur_bb to fallthru edge's destination
    isn't handled and fails afterwards consistency checks, because it crosses
    partitions.

    The following patch notes the case and sets EDGE_CROSSING on that edge too.

    2023-01-31  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108596
            * bb-reorder.c (fix_up_fall_thru_edges): Handle the case where
cur_bb
            ends with asm goto and has a crossing fallthrough edge to the same
bb
            that contains at least one of its labels by restoring EDGE_CROSSING
            flag even on possible edge from cur_bb to new_bb successor.

            * gcc.c-torture/compile/pr108596.c: New test.

    (cherry picked from commit 603a6fbcaac1e80aa90d1d26318c881a53473066)

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

* [Bug rtl-optimization/108596] [10 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (9 preceding siblings ...)
  2023-05-02 20:14 ` cvs-commit at gcc dot gnu.org
@ 2023-05-03 10:36 ` jakub at gcc dot gnu.org
  2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
  2023-05-04  7:24 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-03 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression] error:   |[10 Regression] error:
                   |EDGE_CROSSING missing       |EDGE_CROSSING missing
                   |across section boundary     |across section boundary

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.4 as well.

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

* [Bug rtl-optimization/108596] [10 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (10 preceding siblings ...)
  2023-05-03 10:36 ` [Bug rtl-optimization/108596] [10 " jakub at gcc dot gnu.org
@ 2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
  2023-05-04  7:24 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:73abd84646142b2a6177df9366917fea696d4df3

commit r10-11359-g73abd84646142b2a6177df9366917fea696d4df3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 31 09:46:35 2023 +0100

    bbpart: Fix up ICE on asm goto [PR108596]

    On the following testcase we have asm goto in hot block with 2 successors,
    one cold to which it both falls through and has one of the label
    pointing to it and another hot successor with another label.

    Now, during bbpart we want to ensure that no blocks from one partition fall
    through into a block in a different partition.  fix_up_fall_thru_edges
    does that by temporarily clearing the EDGE_CROSSING on the fallthrough
edge,
    calling force_nonfallthru and then depending on whether it created a new
    bb either set EDGE_CROSSING on the single successor edge from the new bb
    (the new bb is kept in the same partition as the predecessor block), or
    if no new bb has been created setting EDGE_CROSSING back on the fallthru
    edge which has been forced non-EDGE_FALLTHRU.
    For asm goto this doesn't always work, force_nonfallthru can create a new
bb
    and change the fallthrough edge to point to that, but if the original
    fallthru destination block has its label referenced among the asm goto
    labels, it will create a new non-fallthru edge for the label(s).
    But because we've temporarily cheated and cleared EDGE_CROSSING on the
edge,
    it is cleared on the new edge as well, then the caller sees we've created
    a new bb and just sets EDGE_CROSSING on the single fallthru edge from the
    new bb.  But the direct edge from cur_bb to fallthru edge's destination
    isn't handled and fails afterwards consistency checks, because it crosses
    partitions.

    The following patch notes the case and sets EDGE_CROSSING on that edge too.

    2023-01-31  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108596
            * bb-reorder.c (fix_up_fall_thru_edges): Handle the case where
cur_bb
            ends with asm goto and has a crossing fallthrough edge to the same
bb
            that contains at least one of its labels by restoring EDGE_CROSSING
            flag even on possible edge from cur_bb to new_bb successor.

            * gcc.c-torture/compile/pr108596.c: New test.

    (cherry picked from commit 603a6fbcaac1e80aa90d1d26318c881a53473066)

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

* [Bug rtl-optimization/108596] [10 Regression] error: EDGE_CROSSING missing across section boundary
  2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
                   ` (11 preceding siblings ...)
  2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
@ 2023-05-04  7:24 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-04  7:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.5 too.

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

end of thread, other threads:[~2023-05-04  7:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 11:31 [Bug c/108596] New: error: EDGE_CROSSING missing across section boundary dcb314 at hotmail dot com
2023-01-30 12:06 ` [Bug rtl-optimization/108596] " rguenth at gcc dot gnu.org
2023-01-30 12:16 ` [Bug rtl-optimization/108596] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
2023-01-30 12:24 ` jakub at gcc dot gnu.org
2023-01-30 17:08 ` jakub at gcc dot gnu.org
2023-01-31  8:47 ` cvs-commit at gcc dot gnu.org
2023-01-31  8:48 ` [Bug rtl-optimization/108596] [10/11/12 " jakub at gcc dot gnu.org
2023-02-02  9:04 ` dcb314 at hotmail dot com
2023-02-10 17:46 ` cvs-commit at gcc dot gnu.org
2023-02-10 18:01 ` [Bug rtl-optimization/108596] [10/11 " jakub at gcc dot gnu.org
2023-05-02 20:14 ` cvs-commit at gcc dot gnu.org
2023-05-03 10:36 ` [Bug rtl-optimization/108596] [10 " jakub at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:24 ` jakub 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).