[Bug c/89887] the local array data will be laid in different section by different optimization level

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 30 02:11:00 GMT 2019


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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to vfdff from comment #4)
> I check that base on gcc-431, and find the local array will be placed in
> read only section, i.e. gcc-431 can found the array not be touched with the
> option -fno-toplevel-reorder.  so is it a regression ?
> 
>  ~/GCC/gcc-431/binary/bin/gcc dd.c -O2 -fno-toplevel-reorder -S

This is not a regression either.  It just happens that way.  This not toplevel
reordering either because the static variable is not at the toplevel.

Again you still have not pointed out why you think this is a bug. 
aucSubFrmType is never written to or have its address taken, so there for it is
valid to put it in the read only section.


More information about the Gcc-bugs mailing list