[Bug target/92499] nios2 backend needs to consider allocated object size, not C object size for gprel optimization

sandra at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 3 02:45:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92499

--- Comment #10 from sandra at gcc dot gnu.org ---
Author: sandra
Date: Tue Dec  3 02:44:41 2019
New Revision: 278919

URL: https://gcc.gnu.org/viewcvs?rev=278919&root=gcc&view=rev
Log:
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.

Modified:
    branches/gcc-9-branch/gcc/ChangeLog
    branches/gcc-9-branch/gcc/c/ChangeLog
    branches/gcc-9-branch/gcc/c/c-decl.c
    branches/gcc-9-branch/gcc/config/nios2/nios2.c
    branches/gcc-9-branch/gcc/config/nios2/nios2.h
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/gcc/tree.c
    branches/gcc-9-branch/gcc/tree.h


More information about the Gcc-bugs mailing list