From 4cf022385365d3bbf1cfcf265dfd28a21a9be346 Mon Sep 17 00:00:00 2001 From: Ramana Radhakrishnan Date: Thu, 23 Apr 2015 14:49:45 +0000 Subject: [PATCH] re PR target/26702 (.size is not emitted for BSS variables) Fix PR target/26702 For Kwok Cheung Yeung. From-SVN: r222371 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/unknown-elf.h | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/arm/pr26702.c | 4 ++++ 4 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/pr26702.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 223ae3135c0..5c1e4c15eee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-04-23 Kwok Cheung Yeung + + PR target/26702 + * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): + Emit size of local. + 2015-04-23 Nick Clifton * config/rl78/rl78.c (rl78_preferred_reload_class): Add diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h index 17971bbd1f7..df0b9cef39a 100644 --- a/gcc/config/arm/unknown-elf.h +++ b/gcc/config/arm/unknown-elf.h @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f55eb091a8..5126cfe0a08 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-04-23 Kyok Cheung Yeung + + PR target/26702 + * gcc.target/arm/pr26702.c: New test. + 2015-04-23 Marek Polacek 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 index 00000000000..121d42a279d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr26702.c @@ -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; -- 2.30.2