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

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).