diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2024-11-21 13:41:19 +0100 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2024-11-21 13:41:19 +0100 |
commit | 116b1c5489d12313f015c9ffd46b9394d559709d (patch) | |
tree | a10c79b034cbc2bad45f4d3adf22aef462797de9 /gcc | |
parent | 1c4d39ada33d3655db088a0e5c90a296da794a55 (diff) | |
download | gcc-116b1c5489d12313f015c9ffd46b9394d559709d.zip gcc-116b1c5489d12313f015c9ffd46b9394d559709d.tar.gz gcc-116b1c5489d12313f015c9ffd46b9394d559709d.tar.bz2 |
Use decl size in Solaris ASM_DECLARE_OBJECT_NAME [PR102296]
Solaris has modified versions of ASM_DECLARE_OBJECT_NAME on both i386
and sparc. When
commit ce597aedd79e646c4a5517505088d380239cbfa5
Author: Ilya Enkovich <ilya.enkovich@intel.com>
Date: Thu Aug 7 08:04:55 2014 +0000
elfos.h (ASM_DECLARE_OBJECT_NAME): Use decl size instead of type size.
was applied, those were missed. At the same time, the testcase was
restricted to Linux though there's nothing Linux-specific in there, so
the error remained undetected.
This patch fixes the definitions to match elfos.h and enables the test
on Solaris, too.
Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11.
2024-11-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
PR target/102296
* gcc.target/i386/struct-size.c: Enable on *-*-solaris*.
gcc:
PR target/102296
* config/i386/sol2.h (ASM_DECLARE_OBJECT_NAME): Use decl size
instead of type size.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/sol2.h | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sol2.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/struct-size.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h index f51fb2e..06d7ef0 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -179,7 +179,7 @@ along with GCC; see the file COPYING3. If not see && (DECL) && DECL_SIZE (DECL)) \ { \ size_directive_output = 1; \ - size = int_size_in_bytes (TREE_TYPE (DECL)); \ + size = tree_to_uhwi (DECL_SIZE_UNIT (DECL)); \ ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \ } \ \ diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index f0181d5..f13235e 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -377,7 +377,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); && (DECL) && DECL_SIZE (DECL)) \ { \ size_directive_output = 1; \ - size = int_size_in_bytes (TREE_TYPE (DECL)); \ + size = tree_to_uhwi (DECL_SIZE_UNIT (DECL)); \ ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \ } \ \ diff --git a/gcc/testsuite/gcc.target/i386/struct-size.c b/gcc/testsuite/gcc.target/i386/struct-size.c index d82d730..486aa40 100644 --- a/gcc/testsuite/gcc.target/i386/struct-size.c +++ b/gcc/testsuite/gcc.target/i386/struct-size.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* *-*-solaris* } } */ /* { dg-options "-Wno-pedantic" } */ struct S { |