diff options
author | Qian Chao <qianchao9@huawei.com> | 2020-06-10 04:46:56 -0400 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-06-10 11:05:06 +0200 |
commit | 6d9ef0621f8e1aaafd458dba1a8b5476e655b479 (patch) | |
tree | d635f64b88d771565d485ed2b07af0d11dc0f929 /gcc | |
parent | dc6d15eaa23cbae1468a6ef92371b1c856c14819 (diff) | |
download | gcc-6d9ef0621f8e1aaafd458dba1a8b5476e655b479.zip gcc-6d9ef0621f8e1aaafd458dba1a8b5476e655b479.tar.gz gcc-6d9ef0621f8e1aaafd458dba1a8b5476e655b479.tar.bz2 |
tmmark: verify_ssa failed [PR95569]
This patch fixes a latent bug exposed by eb72dc663e9070b281be83a80f6f838a3a878822.
See the discussion on the bug for details.
Bootstrapped and regtested on aarch64-linux-gnu. No new fails introduced.
2020-06-10 Qian Chao <qianchao9@huawei.com>
gcc/ChangeLog:
PR tree-optimization/95569
* trans-mem.c (expand_assign_tm): Ensure that rtmp is marked TREE_ADDRESSABLE.
gcc/testsuite/ChangeLog:
PR tree-optimization/95569
* gcc.dg/tm/pr95569.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/tm/pr95569.c | 18 | ||||
-rw-r--r-- | gcc/trans-mem.c | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tm/pr95569.c b/gcc/testsuite/gcc.dg/tm/pr95569.c new file mode 100644 index 0000000..f0b0d6f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/pr95569.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -O0" } */ +/* { dg-do compile { target aarch64*-*-* } } */ + +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; + } +} diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index c23ecd2..b6b9157 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); |