public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99143] New: Bad section alignment on AArch64
@ 2021-02-17 23:14 nyphbl8d at gmail dot com
  2021-02-17 23:43 ` [Bug target/99143] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: nyphbl8d at gmail dot com @ 2021-02-17 23:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99143
           Summary: Bad section alignment on AArch64
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nyphbl8d at gmail dot com
  Target Milestone: ---

aarch64-rtems6-gcc -v output:
Using built-in specs.
COLLECT_GCC=aarch64-rtems6-gcc
COLLECT_LTO_WRAPPER=/home/opticron/rtems-development/tools/libexec/gcc/aarch64-rtems6/10.2.1/lto-wrapper
Target: aarch64-rtems6
Configured with: ../gnu-mirror-gcc-949e0ad/configure
--prefix=/home/opticron/rtems-development/tools
--bindir=/home/opticron/rtems-development/tools/bin
--exec_prefix=/home/opticron/rtems-development/tools
--includedir=/home/opticron/rtems-development/tools/include
--libdir=/home/opticron/rtems-development/tools/lib
--libexecdir=/home/opticron/rtems-development/tools/libexec
--mandir=/home/opticron/rtems-development/tools/share/man
--infodir=/home/opticron/rtems-development/tools/share/info
--datadir=/home/opticron/rtems-development/tools/share --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=aarch64-rtems6 --disable-libstdcxx-pch
--with-gnu-as --with-gnu-ld --verbose --with-newlib --disable-nls
--without-included-gettext --disable-win32-registry
--enable-version-specific-runtime-libs --disable-lto
--enable-newlib-io-c99-formats --enable-newlib-iconv
--enable-newlib-iconv-encodings=big5,cp775,cp850,cp852,cp855,cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,win_1253,win_1254,win_1255,win_1256,win_1257,win_1258
--enable-threads --disable-plugin --enable-libgomp --enable-languages=c,c++
Thread model: rtems
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20200918 (RTEMS 6, RSB
f5fc2bfabbd18f31901ffa6fc0e5b6b47874797c-modified, Newlib 749cbcc) (GCC)

Source file test-align.c:
char i;
char j[1];
char z[0];
unsigned long ai = _Alignof(i);
unsigned long aj = _Alignof(j);
unsigned long az = _Alignof(z);

Command line:
aarch64-rtems6-gcc -O2 -S -o - test-align.c -mabi=ilp32 -fdata-sections

Compiler output:
        .arch armv8-a
        .file   "test-align.c"
        .text
        .global az
        .global aj
        .global ai
        .global z
        .global j
        .global i
        .section        .bss.i,"aw",@nobits
        .type   i, %object
        .size   i, 1
i:
        .zero   1
        .section        .bss.j,"aw",@nobits
        .align  3
        .type   j, %object
        .size   j, 1
j:
        .zero   1
        .section        .bss.z,"aw",@nobits
        .align  3
        .type   z, %object
        .size   z, 0
z:
        .section        .data.ai,"aw"
        .align  2
        .type   ai, %object
        .size   ai, 4
ai:
        .word   1
        .section        .data.aj,"aw"
        .align  2
        .type   aj, %object
        .size   aj, 4
aj:
        .word   1
        .section        .data.az,"aw"
        .align  2
        .type   az, %object
        .size   az, 4
az:
        .word   1
        .ident  "GCC: (GNU) 10.2.1 20200918 (RTEMS 6, RSB
f5fc2bfabbd18f31901ffa6fc0e5b6b47874797c-modified, Newlib 749cbcc)"

test-align.i from --save-temps:
# 1 "test-align.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test-align.c"
char i;
char j[1];
char z[0];
unsigned long ai = _Alignof(i);
unsigned long aj = _Alignof(j);
unsigned long az = _Alignof(z);

Description:
When generating data sections for i, j, z for AArch64/ILP32 (also applies to
LP64), GCC does not align data sections to anything less than 8 bytes, even
when _Alignof() claims that the alignment of all three data elements should be
1 byte.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-01 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 23:14 [Bug c/99143] New: Bad section alignment on AArch64 nyphbl8d at gmail dot com
2021-02-17 23:43 ` [Bug target/99143] " pinskia at gcc dot gnu.org
2021-02-18 14:16 ` nyphbl8d at gmail dot com
2021-02-18 14:46 ` schwab@linux-m68k.org
2021-02-18 15:09 ` nyphbl8d at gmail dot com
2021-02-18 15:24 ` schwab@linux-m68k.org
2021-02-18 15:28 ` jakub at gcc dot gnu.org
2021-02-18 15:31 ` jakub at gcc dot gnu.org
2021-03-01 17:05 ` rearnsha at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).