diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-11-23 11:43:39 +0000 |
---|---|---|
committer | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-11-23 11:43:39 +0000 |
commit | b510765dedfec573c756cb1fcfcb5b0c3830c5e9 (patch) | |
tree | fc1c04fa396e7abcbd4fb88b6cf1d8b1fd091794 /gcc/testsuite/lib | |
parent | 4a8c54359a593e4e53192303159144dd70bfced1 (diff) | |
download | gcc-b510765dedfec573c756cb1fcfcb5b0c3830c5e9.zip gcc-b510765dedfec573c756cb1fcfcb5b0c3830c5e9.tar.gz gcc-b510765dedfec573c756cb1fcfcb5b0c3830c5e9.tar.bz2 |
Fix "noinit" attribute being ignored for -O0 and -fdata-sections
Variables with the "noinit" attribute are ignored at -O0 because they
are treated like a regular bss variable and placed in the .bss section.
With -fdata-sections they are ignored because they are not handled in
resolve_unique_section.
gcc/ChangeLog:
* tree.h (DECL_NOINIT_P): Define.
* varasm.c (DECL_NOINIT_P): Check DECL_NOINIT_P before using
unnamed bss/lcomm sections for bss_initializer variables.
(default_elf_select_section): Use DECL_NOINIT_P instead of
looking up attribute for .noinit section selection.
(default_unique_section): Check DECL_NOINIT_P for .noinit
section selection.
gcc/testsuite/ChangeLog:
* gcc.c-torture/execute/noinit-attribute.c: Don't override
optimization options set by torture test harness.
* lib/target-supports.exp (check_effective_target_noinit): Adjust
comment formatting.
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 22acda2..43ac526 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -368,7 +368,7 @@ proc check_weak_override_available { } { return [check_weak_available] } -# The noinit attribute is only supported by some targets. +# The "noinit" attribute is only supported by some targets. # This proc returns 1 if it's supported, 0 if it's not. proc check_effective_target_noinit { } { |