* varasm.c (build_constant_desc): Don't share RTL in pool entries.
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jul 2009 18:09:23 +0000 (18:09 +0000)
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jul 2009 18:09:23 +0000 (18:09 +0000)
* gcc.target/m68k/20090709-1.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149426 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20090709-1.c [new file with mode: 0644]
gcc/varasm.c

index 114d4a1..9813255 100644 (file)
@@ -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>
 
index d9f3bfe..674429c 100644 (file)
@@ -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 (file)
index 0000000..fda05b7
--- /dev/null
@@ -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");
+}
index f8744f7..6e81db4 100644 (file)
@@ -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