summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/20090709-1.c20
-rw-r--r--gcc/varasm.c4
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 114d4a18d4d..9813255fdb8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,6 @@
+2009-07-09 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * varasm.c (build_constant_desc): Don't share RTL in pool entries.
2009-07-09 Basile Starynkevitch <basile@starynkevitch.net>
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d9f3bfe4e40..674429c44f8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-09 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * gcc.target/m68k/20090709-1.c: New.
+
2009-07-09 Dodji Seketeli <dodji@redhat.com>
PR c++/40684
diff --git a/gcc/testsuite/gcc.dg/20090709-1.c b/gcc/testsuite/gcc.dg/20090709-1.c
new file mode 100644
index 00000000000..fda05b7566d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20090709-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* There should be 3 occurrences of .LC0 in the code:
+ one for the definition of "0",
+ one for use in test1() and
+ one for use in test2().
+ FIXME: At the moment m68k GCC does not optimize test1() to nop
+ for some reason. */
+/* { dg-final { scan-assembler-times ".LC0" 3 } } */
+
+void dummy(char *arg);
+
+void test1(void)
+{
+ char tmp[2] = "0";
+}
+
+void test2(void)
+{
+ dummy("0");
+}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f8744f72846..6e81db4ba01 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3208,6 +3208,10 @@ build_constant_desc (tree exp)
set_mem_alias_set (rtl, 0);
set_mem_alias_set (rtl, const_alias_set);
+ /* We cannot share RTX'es in pool entries.
+ Mark this piece of RTL as required for unsharing. */
+ RTX_FLAG (rtl, used) = 1;
+
/* Set flags or add text to the name to record information, such as
that it is a local symbol. If the name is changed, the macro
ASM_OUTPUT_LABELREF will have to know how to strip this