aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nios2/nios2.h
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2019-12-02 03:52:15 +0000
committerSandra Loosemore <sandra@codesourcery.com>2019-12-02 03:52:15 +0000
commita5fc5d9e9ee48138d09a357cc3b34c144e8616d4 (patch)
treef22f9ae555d8f38b980718893ef0bc8f71976ea5 /gcc/config/nios2/nios2.h
parent26921dc8094c4d4fce83aa4260f30fcb7970bb32 (diff)
2019-12-01 Sandra Loosemore <sandra@codesourcery.com>
Fix bugs relating to flexibly-sized objects in nios2 backend. PR target/92499 gcc/c/ * c-decl.c (flexible_array_type_p): Move to common code. gcc/ * config/nios2/nios2.c (nios2_in_small_data_p): Do not consider objects of flexible types to be small if they have internal linkage or are declared extern. * config/nios2/nios2.h (ASM_OUTPUT_ALIGNED_LOCAL): Replace with... (ASM_OUTPUT_ALIGNED_DECL_LOCAL): ...this. Use targetm.in_small_data_p instead of the size of the object initializer. * tree.c (flexible_array_type_p): Move from C front end, and generalize to handle fields in non-C structures. * tree.h (flexible_array_type_p): Declare. gcc/testsuite/ * gcc.target/nios2/pr92499-1.c: New. * gcc.target/nios2/pr92499-2.c: New. * gcc.target/nios2/pr92499-3.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278891 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nios2/nios2.h')
-rw-r--r--gcc/config/nios2/nios2.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
index 9dec57d67ae..88671652707 100644
--- a/gcc/config/nios2/nios2.h
+++ b/gcc/config/nios2/nios2.h
@@ -467,10 +467,10 @@ while (0)
the linker seems to want the alignment of data objects
to depend on their types. We do exactly that here. */
-#undef ASM_OUTPUT_ALIGNED_LOCAL
-#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
+#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
- if ((SIZE) <= nios2_section_threshold) \
+ if (targetm.in_small_data_p (DECL)) \
switch_to_section (sbss_section); \
else \
switch_to_section (bss_section); \