# aarch64-linux-gnu-gcc -std=gnu99 -fgnu89-inline -O -Wall -Winline -Wwrite-strings -fmerge-all-constants -frounding-math -g -Wstrict-prototypes malloc.i
malloc.c: In function ‘__libc_mallopt’:
malloc.c:4761:16: error: invalid 'asm': invalid expression as operand
Splitting this inline asm out into a smaller testcase does not seem to reproduce the issue. It's possible this is a bug in the source file, but it's not clear from gcc's output what the problem is.
Seems to be an issue with alignment calculation in
aarch64_classify_address.
for rtl of the form (lo_sum:DI (reg/f:DI 132)
(symbol_ref:DI ("*.LANCHOR4") [flags 0x182])) we are currently
calculating align of 8bits and due to this the following statement
returns false. This causes output_addr_const (in gcc/final.c) to fail.
Created attachment 32017
pre processed source
This issue is originally reported in https:/ /bugs.launchpad .net/gcc- linaro/ +bug/1270789
The attached pre-processed source fails with:
# aarch64- linux-gnu- gcc -std=gnu99 -fgnu89-inline -O -Wall -Winline -Wwrite-strings -fmerge- all-constants -frounding-math -g -Wstrict-prototypes malloc.i
malloc.c: In function ‘__libc_mallopt’:
malloc.c:4761:16: error: invalid 'asm': invalid expression as operand
Splitting this inline asm out into a smaller testcase does not seem to reproduce the issue. It's possible this is a bug in the source file, but it's not clear from gcc's output what the problem is.
Seems to be an issue with alignment calculation in classify_ address.
aarch64_
for rtl of the form (lo_sum:DI (reg/f:DI 132)
(symbol_ref:DI ("*.LANCHOR4") [flags 0x182])) we are currently
calculating align of 8bits and due to this the following statement
returns false. This causes output_addr_const (in gcc/final.c) to fail.
return ((INTVAL (offs) & (ref_size - 1)) == 0
&& ((align / BITS_PER_UNIT) & (ref_size - 1)) == 0);
AFIK, align of 8bits is not correct here.
GCC version and config: linux-gnueabi- gcc -v GCC=/home/ kugan/work/ builds/ gcc-fsf- trunk/tools/ bin/arm- none-linux- gnueabi- gcc LTO_WRAPPER= /home/kugan/ work/builds/ gcc-fsf- trunk/tools/ libexec/ gcc/arm- none-linux- gnueabi/ 4.9.0/lto- wrapper linux-gnueabi work/sources/ gcc-fsf/ trunk/configure --target= arm-none- linux-gnueabi --prefix= /home/kugan/ work/builds/ gcc-fsf- trunk/tools --with- sysroot= /home/kugan/ work/builds/ gcc-fsf- trunk/sysroot- arm-none- linux-gnueabi --disable-libssp --disable-libgomp --disable- libmudflap --enable- languages= c,c++ --with-arch=armv7-a --with- fpu=vfpv3- d16 --with-float=softfp --with-thumb
arm-none-
Using built-in specs.
COLLECT_
COLLECT_
Target: arm-none-
Configured with: /home/kugan/
Thread model: posix
gcc version 4.9.0 20130922 (experimental) (GCC)