This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/48576] New: wrong code when accessing variables in a large stack frame
- From: "akos.pasztory at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Apr 2011 15:01:44 +0000
- Subject: [Bug target/48576] New: wrong code when accessing variables in a large stack frame
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48576
Summary: wrong code when accessing variables in a large stack
frame
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: akos.pasztory@gmail.com
Target: arm-linux-gnueabi
Created attachment 23964
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23964
preprocessed source
Tried with 4.5.2 (and 4.6.0), stage1 compiler:
../gcc-4.5.2/configure \
--target=arm-linux-gnueabi \
--disable-shared \
--disable-bootstrap \
--with-sysroot=/usr/arm-linux-gnueabi \
--disable-threads \
--disable-libmudflap \
--disable-libssp \
--with-arch=armv7-a --with-tune=cortex-a8 --with-float=hard --with-fpu=neon \
--enable-languages=c \
--with-newlib
When compiling the attached source with:
./cc1 -O1 -fgcse -fno-omit-frame-pointer jaj.i
gcc produces this code to do "arr[n] = strdup(str)":
...
bl strdup
sub r3, fp, #4096
ldr r3, [r3, #-132] @ this kills r3
ldr r2, [r3, #-128] @ and this doesn't know about it
str r0, [r2, r3, asl #2]
...
The problem is first visible in jaj.i.192r.ira when using -fdump-rtl-all.
Omitting frame pointer "helps" but I think it's pure coincidence. Apologies
about the messy test code but I was not able to reduce it more without changing
the output.