public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95569] New: ICE in tmmark:verify_ssa failed
@ 2020-06-08  3:37 qianchao9 at huawei dot com
  2020-06-08  6:15 ` [Bug tree-optimization/95569] " qianchao9 at huawei dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: qianchao9 at huawei dot com @ 2020-06-08  3:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95569
           Summary: ICE in tmmark:verify_ssa failed
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qianchao9 at huawei dot com
  Target Milestone: ---

Created attachment 48698
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48698&action=edit
mark tree-addressable

Commit eb72dc663e9070b281be83a80f6f838a3a878822 introduces a ICE on AArch64.

Compiling this with -S -fgnu-tm -O0:

typedef int __attribute__ ((vector_size (16))) vectype;
vectype v;

void
foo (int c)
{
  vectype *p = __builtin_malloc (sizeof (vectype));
  __transaction_atomic
  {
    *p = v;
    if (c)
      __transaction_cancel;
  }
}

gives:

testcase.c: In function ‘foo’:
testcase.c:5:1: error: virtual definition of statement not up to date
    5 | foo (int c)
      | ^~~
D.3669 = v.0_11;
during GIMPLE pass: tmmark
testcase.c:5:1: internal compiler error: verify_ssa failed

on the tmmark output is:    

....
<L0>:
  __builtin__ITM_memcpyRtWn (&D.3667, &v, 16);
  v.0_11 = D.3667;
  D.3668 = v.0_11;
  __builtin__ITM_memcpyRnWt (p_4, &D.3668, 16);

...

the following fixes the latent bug - we failed to mark 'D.3668'
TREE_ADDRESSABLE (address-taken)

diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index c23ecd2b31f..b6b9157006b 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -2424,6 +2424,7 @@ expand_assign_tm (struct tm_region *region,
gimple_stmt_iterator *gsi)
       if (is_gimple_reg (rhs))
        {
          tree rtmp = create_tmp_var (TREE_TYPE (rhs));
+         TREE_ADDRESSABLE (rtmp) = 1;
          rhs_addr = build_fold_addr_expr (rtmp);
          gcall = gimple_build_assign (rtmp, rhs);
          gsi_insert_before (gsi, gcall, GSI_SAME_STMT);

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

end of thread, other threads:[~2022-10-18  8:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08  3:37 [Bug tree-optimization/95569] New: ICE in tmmark:verify_ssa failed qianchao9 at huawei dot com
2020-06-08  6:15 ` [Bug tree-optimization/95569] " qianchao9 at huawei dot com
2020-06-08  6:16 ` qianchao9 at huawei dot com
2020-06-09  6:53 ` rguenth at gcc dot gnu.org
2020-06-09 11:26 ` marxin at gcc dot gnu.org
2020-06-10  9:05 ` cvs-commit at gcc dot gnu.org
2022-10-18  3:31 ` asolokha at gmx dot com
2022-10-18  8:02 ` marxin 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).