This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/51835] New: ARM EABI violation when passing arguments to helper floating functions like __aeabi_d2iz
- From: "amker.cheng at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jan 2012 08:00:57 +0000
- Subject: [Bug target/51835] New: ARM EABI violation when passing arguments to helper floating functions like __aeabi_d2iz
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51835
Bug #: 51835
Summary: ARM EABI violation when passing arguments to helper
floating functions like __aeabi_d2iz
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: amker.cheng@gmail.com
For following program
int func(float f)
{
double d = (double)f;
return (int)d;
}
compile it with following command:
$ arm-none-eabi-gcc -O2 -mthumb -mcpu=cortex-m4 -mfloat-abi=hard
-mfpu=fpv4-sp-d16 -S test.c -o test.S
the generated assembly code is:
-----------------------------------------------
fun:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r3, lr}
fmrs r0, s0
bl __aeabi_f2d
fmdrr d0, r0, r1
bl __aeabi_d2iz
pop {r3, pc}
.size fun, .-fun
The argument of __aeabi_d2iz is passed in fp register, While ARM RTABI document
says that such functions should use the soft-float ABI, even when
-mfloat-abi=hard is specified.
The problem at least exists on trunk and 4.6 branch.
I am working a patch and will send it for review later.