re PR target/26702 (.size is not emitted for BSS variables)
authorRamana Radhakrishnan <ramana@gcc.gnu.org>
Thu, 23 Apr 2015 14:49:45 +0000 (14:49 +0000)
committerRamana Radhakrishnan <ramana@gcc.gnu.org>
Thu, 23 Apr 2015 14:49:45 +0000 (14:49 +0000)
Fix PR target/26702

For Kwok Cheung Yeung.

From-SVN: r222371

gcc/ChangeLog
gcc/config/arm/unknown-elf.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr26702.c [new file with mode: 0644]

index 223ae3135c0bb18eda7765646f7ca47bfe090000..5c1e4c15eeee2ef603bc7879e44056206989051f 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-23  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       PR target/26702
+       * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL):
+       Emit size of local.
+
 2015-04-23  Nick Clifton  <nickc@redhat.com>
 
        * config/rl78/rl78.c (rl78_preferred_reload_class): Add
index 17971bbd1f7b5cfd071c2d16553bb1a4dd28231e..df0b9cef39adb88fd252303a317bf565c8931c3c 100644 (file)
@@ -81,6 +81,8 @@
       ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT));     \
       ASM_OUTPUT_LABEL (FILE, NAME);                                   \
       fprintf (FILE, "\t.space\t%d\n", SIZE ? (int)(SIZE) : 1);                \
+      fprintf (FILE, "\t.size\t%s, %d\n",                              \
+              NAME, SIZE ? (int) SIZE, 1);                             \
     }                                                                  \
   while (0)
 
index 5f55eb091a8a4b6cfc28a76eee5aea65258b35b9..5126cfe0a0807f8481ad4d889729751c572d94fa 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-23  Kyok Cheung Yeung  <kck@codesourcery.com>
+
+       PR target/26702
+       * gcc.target/arm/pr26702.c: New test.
+
 2015-04-23  Marek Polacek  <polacek@redhat.com>
 
        PR c/65345
diff --git a/gcc/testsuite/gcc.target/arm/pr26702.c b/gcc/testsuite/gcc.target/arm/pr26702.c
new file mode 100644 (file)
index 0000000..121d42a
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile { target arm_eabi } } */
+/* { dg-final { scan-assembler "\\.size\[\\t \]+static_foo, 4" } } */
+int foo;
+static int static_foo;