https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89886
Bug ID: 89886 Summary: the local array data will be laid in different section by different optimization level Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zhongyunde at huawei dot com Target Milestone: --- Created attachment 46057 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46057&action=edit simple testcase file the simple testcase dd.c, compiled with the following command: pekpcsi00002:~ # /opt/buildtools/gcc-7.3.0/bin/gcc dd.c -O2 -o O2.s -S pekpcsi00002:~ # /opt/buildtools/gcc-7.3.0/bin/gcc dd.c -O0 -o O0.s -S we'll see that the aucSubFrmType.1820 in assemble O2.s is laid in section rodata, while in assemble O0.s is laid in section data.