Fix x86/56337 : 1<<28 alignment is broken
authorAndrew Pinski <apinski@marvell.com>
Fri, 23 Jul 2021 17:21:06 +0000 (17:21 +0000)
committerAndrew Pinski <apinski@marvell.com>
Tue, 31 Aug 2021 06:28:26 +0000 (06:28 +0000)
commite4d86078881bb7bb57bc6e68c22211707d2b3dc7
tree5204e75d8da6923db51caf6f9a93376e8460606d
parentd904008df267cbcc01bd6edf98fa0789fb6e94da
Fix x86/56337 : 1<<28 alignment is broken

The problem here is the x86_64 back-end uses a signed integer
for alignment and then divides by BITS_PER_UNIT so if we had
INT_MIN (which is what 1<<28*8 is), we would get the wrong result.

This fixes the problem by using unsigned for the argument to
x86_output_aligned_bss and x86_output_aligned_bss.

OK? Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

PR target/56337
* config/i386/i386-protos.h (x86_output_aligned_bss):
Change align argument to unsigned type.
(x86_elf_aligned_decl_common): Likewise.
* config/i386/i386.c (x86_elf_aligned_decl_common): Likewise.
(x86_output_aligned_bss): Likewise.
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c