public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/97357] New: Unable to coalesce ssa_names  which are marked as MUST COALESCE.
@ 2020-10-09 16:33 qinzhao at gcc dot gnu.org
  2020-10-09 16:35 ` [Bug middle-end/97357] " qinzhao at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-10-09 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97357
           Summary: Unable to coalesce ssa_names  which are marked as MUST
                    COALESCE.
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qinzhao at gcc dot gnu.org
  Target Milestone: ---

the latest gcc10.2.1 failed with SSA corruption on multiple c modules of our
important application on O3. disabling -fsplit-loops cures the failure.

I was able to reduce the huge routine to the following simple one to reproduce
the failure:

#include <setjmp.h>
#include <stdlib.h>

static void * my_malloc (size_t size);

typedef struct glk {
  struct glk *nxt;
} glk;

typedef struct Lock
{
 glk ByteLock;
} Lock;

static Lock *l, *lk;

void bytelocks(glk *rethead, jmp_buf jb)
{
  glk *cur, *cur_lk;

  if (( _setjmp (jb)) == 0) 
    for (cur = &l->ByteLock; cur != ((glk *)0) ; cur = (cur)->nxt)
        for (cur_lk = &lk->ByteLock; cur_lk != ((glk *)0); cur_lk =
cur_lk->nxt)
          {
            glk *retrng;

            if(!rethead)
              rethead = (glk *) my_malloc (sizeof(glk));
            retrng = (glk *) my_malloc (sizeof(glk));

            retrng->nxt = rethead;
          }

 return;
}
/home/qinzhao/Install/latest/bin/gcc -O3 t.c
t.c:4:15: warning: ‘my_malloc’ used but never defined
    4 | static void * my_malloc (size_t size);
      |               ^~~~~~~~~

Unable to coalesce ssa_names 5 and 6 which are marked as MUST COALESCE.
rethead_5(ab) and  rethead_6(ab)
during RTL pass: expand
t.c: In function ‘bytelocks’:
t.c:17:6: internal compiler error: SSA corruption
   17 | void bytelocks(glk *rethead, jmp_buf jb)
      |      ^~~~~~~~~
0xbcca65 fail_abnormal_edge_coalesce
        ../../latest_gcc/gcc/tree-ssa-coalesce.c:1003
0xbcca65 coalesce_partitions
        ../../latest_gcc/gcc/tree-ssa-coalesce.c:1425
0xbcca65 coalesce_ssa_name(_var_map*)
        ../../latest_gcc/gcc/tree-ssa-coalesce.c:1755
0xb7d597 remove_ssa_form
        ../../latest_gcc/gcc/tree-outof-ssa.c:1065
0xb7d597 rewrite_out_of_ssa(ssaexpand*)
        ../../latest_gcc/gcc/tree-outof-ssa.c:1323
0x6fb5d5 execute
        ../../latest_gcc/gcc/cfgexpand.c:6352
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 middle-end/97357] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
@ 2020-10-09 16:35 ` qinzhao at gcc dot gnu.org
  2020-10-12  6:23 ` [Bug middle-end/97357] [10 Regression] " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-10-09 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from qinzhao at gcc dot gnu.org ---
/home/qinzhao/Install/latest/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/qinzhao/Install/latest/bin/gcc
COLLECT_LTO_WRAPPER=/home/qinzhao/Install/latest/libexec/gcc/x86_64-pc-linux-gnu/10.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../latest_gcc/configure --prefix=/home/qinzhao/Install/latest
-enable-languages=c,c++,fortran,lto
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20201009 (GCC)

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
  2020-10-09 16:35 ` [Bug middle-end/97357] " qinzhao at gcc dot gnu.org
@ 2020-10-12  6:23 ` rguenth at gcc dot gnu.org
  2020-10-12  7:11 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-12  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
      Known to fail|                            |10.2.1
            Summary|Unable to coalesce          |[10 Regression] Unable to
                   |ssa_names  which are marked |coalesce ssa_names  which
                   |as MUST COALESCE.           |are marked as MUST
                   |                            |COALESCE.
   Last reconfirmed|                            |2020-10-12
      Known to work|                            |11.0
     Ever confirmed|0                           |1
   Target Milestone|---                         |10.3
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  I will have a look.  Seems to work on trunk, probably by accident.

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
  2020-10-09 16:35 ` [Bug middle-end/97357] " qinzhao at gcc dot gnu.org
  2020-10-12  6:23 ` [Bug middle-end/97357] [10 Regression] " rguenth at gcc dot gnu.org
@ 2020-10-12  7:11 ` marxin at gcc dot gnu.org
  2020-10-12  8:27 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-12  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started one master with r10-4447-g095f78c62157124a and disappeared with
r11-309-gfe8c8f1e5ed61f00.

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-10-12  7:11 ` marxin at gcc dot gnu.org
@ 2020-10-12  8:27 ` cvs-commit at gcc dot gnu.org
  2020-10-12  8:28 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-12  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:5b2cc633794f6e1f882d46bdefe267401d33285e

commit r11-3808-g5b2cc633794f6e1f882d46bdefe267401d33285e
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 12 08:51:05 2020 +0200

    tree-optimization/97357 - avoid abnormals in loop splitting conditions

    This avoids abnormals in another place.

    2020-10-12  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/97357
            * tree-ssa-loop-split.c (ssa_semi_invariant_p): Abnormal
            SSA names are not semi invariant.

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

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-10-12  8:27 ` cvs-commit at gcc dot gnu.org
@ 2020-10-12  8:28 ` cvs-commit at gcc dot gnu.org
  2020-10-12  8:28 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-12  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r10-8879-ge293967739f8ac5341ad4e2121f9d87b67499008
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 12 08:51:05 2020 +0200

    tree-optimization/97357 - avoid abnormals in loop splitting conditions

    This avoids abnormals in another place.

    2020-10-12  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/97357
            * tree-ssa-loop-split.c (ssa_semi_invariant_p): Abnormal
            SSA names are not semi invariant.

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

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-10-12  8:28 ` cvs-commit at gcc dot gnu.org
@ 2020-10-12  8:28 ` rguenth at gcc dot gnu.org
  2020-10-12 14:09 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-12  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-10-12  8:28 ` rguenth at gcc dot gnu.org
@ 2020-10-12 14:09 ` cvs-commit at gcc dot gnu.org
  2020-10-12 14:12 ` cvs-commit at gcc dot gnu.org
  2020-10-12 16:56 ` qinzhao at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-12 14:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>:

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

commit r11-3824-gf10f11eb63b0ed082674d9a589e67230aa49efb5
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Mon Oct 12 14:04:06 2020 +0000

    tree-optimization/97357: Fix testcase

    Calling _setjmp causing a warning when targeting newlib.

    2020-10-12  Christophe Lyon  <christophe.lyon@linaro.org>

            gcc/testsuite/
            PR tree-optimization/97357
            * gcc.dg/pr97357.c: Call setjmp instead of _setjmp.

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-10-12 14:09 ` cvs-commit at gcc dot gnu.org
@ 2020-10-12 14:12 ` cvs-commit at gcc dot gnu.org
  2020-10-12 16:56 ` qinzhao at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-12 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Christophe Lyon
<clyon@gcc.gnu.org>:

https://gcc.gnu.org/g:124b4630636974638dfab057bb96f91bb7ee40eb

commit r10-8881-g124b4630636974638dfab057bb96f91bb7ee40eb
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Mon Oct 12 14:04:06 2020 +0000

    tree-optimization/97357: Fix testcase

    Calling _setjmp causing a warning when targeting newlib.

    2020-10-12  Christophe Lyon  <christophe.lyon@linaro.org>

            gcc/testsuite/
            PR tree-optimization/97357
            * gcc.dg/pr97357.c: Call setjmp instead of _setjmp.

    (cherry picked from commit f10f11eb63b0ed082674d9a589e67230aa49efb5)

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

* [Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names  which are marked as MUST COALESCE.
  2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2020-10-12 14:12 ` cvs-commit at gcc dot gnu.org
@ 2020-10-12 16:56 ` qinzhao at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-10-12 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from qinzhao at gcc dot gnu.org ---
with the patch, all the C modules in our application that failed with this bug
passed without any issue.

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

end of thread, other threads:[~2020-10-12 16:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 16:33 [Bug middle-end/97357] New: Unable to coalesce ssa_names which are marked as MUST COALESCE qinzhao at gcc dot gnu.org
2020-10-09 16:35 ` [Bug middle-end/97357] " qinzhao at gcc dot gnu.org
2020-10-12  6:23 ` [Bug middle-end/97357] [10 Regression] " rguenth at gcc dot gnu.org
2020-10-12  7:11 ` marxin at gcc dot gnu.org
2020-10-12  8:27 ` cvs-commit at gcc dot gnu.org
2020-10-12  8:28 ` cvs-commit at gcc dot gnu.org
2020-10-12  8:28 ` rguenth at gcc dot gnu.org
2020-10-12 14:09 ` cvs-commit at gcc dot gnu.org
2020-10-12 14:12 ` cvs-commit at gcc dot gnu.org
2020-10-12 16:56 ` qinzhao 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).