summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-28 19:36:44 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-28 19:36:44 +0000
commit722c0f6ebd1f6e138c468af2ba2d9f6250cc734f (patch)
tree738974e0dfcd7dab87ec93691e86e2079883ce31
parent5be9590a469612eedab37680484e772755fe2d8d (diff)
downloadgcc-722c0f6ebd1f6e138c468af2ba2d9f6250cc734f.tar.gz
PR target/42894
* varasm.c (force_const_mem): Store copy of x in desc->constant instead of x itself. * expr.c (emit_move_insn): Add a copy of y_cst instead of y_cst itself into REG_EQUAL note. * gcc.dg/tls/pr42894.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169370 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/expr.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr42894.c12
-rw-r--r--gcc/varasm.c4
5 files changed, 28 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index acfd8a94ee1..714bc44e34a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/42894
+ * varasm.c (force_const_mem): Store copy of x in desc->constant
+ instead of x itself.
+ * expr.c (emit_move_insn): Add a copy of y_cst instead of y_cst
+ itself into REG_EQUAL note.
+
2011-01-28 Joseph Myers <joseph@codesourcery.com>
* config/freebsd.opt (posix, rdynamic): New Driver options.
diff --git a/gcc/expr.c b/gcc/expr.c
index 7441548884e..e6b42795b3a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3398,7 +3398,7 @@ emit_move_insn (rtx x, rtx y)
&& (set = single_set (last_insn)) != NULL_RTX
&& SET_DEST (set) == x
&& ! rtx_equal_p (y_cst, SET_SRC (set)))
- set_unique_reg_note (last_insn, REG_EQUAL, y_cst);
+ set_unique_reg_note (last_insn, REG_EQUAL, copy_rtx (y_cst));
return last_insn;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d2eadb419db..4d6acf0176f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/42894
+ * gcc.dg/tls/pr42894.c: New test.
+
2011-01-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.dg/pr47276.c: Add dg-require-visibility.
diff --git a/gcc/testsuite/gcc.dg/tls/pr42894.c b/gcc/testsuite/gcc.dg/tls/pr42894.c
new file mode 100644
index 00000000000..c3bd76c91c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pr42894.c
@@ -0,0 +1,12 @@
+/* PR target/42894 */
+/* { dg-do compile } */
+/* { dg-options "-march=armv5te -mthumb" { target arm*-*-* } } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int t;
+
+void
+foo (int a)
+{
+ t = a;
+}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index afd9942c295..a1cddac16c1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,7 +1,7 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -3518,7 +3518,7 @@ force_const_mem (enum machine_mode mode, rtx x)
pool->offset &= ~ ((align / BITS_PER_UNIT) - 1);
desc->next = NULL;
- desc->constant = tmp.constant;
+ desc->constant = copy_rtx (tmp.constant);
desc->offset = pool->offset;
desc->hash = hash;
desc->mode = mode;