]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix bugs relating to flexibly-sized objects in nios2 backend.
authorSandra Loosemore <sandra@codesourcery.com>
Tue, 3 Dec 2019 02:44:41 +0000 (21:44 -0500)
committerSandra Loosemore <sandra@gcc.gnu.org>
Tue, 3 Dec 2019 02:44:41 +0000 (21:44 -0500)
commit0684d6378811b9597c40afada389588813832586
treecc78858e4d9f1c68e83a59889b635e9133ddb035
parent518db23288a17bafa7aa0be70f5bd4273807774e
Fix bugs relating to flexibly-sized objects in nios2 backend.

2019-12-02  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.

From-SVN: r278919
gcc/ChangeLog
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/config/nios2/nios2.c
gcc/config/nios2/nios2.h
gcc/testsuite/ChangeLog
gcc/tree.c
gcc/tree.h