public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/51835] New: ARM EABI violation when passing arguments to helper floating functions like __aeabi_d2iz
@ 2012-01-12  8:01 amker.cheng at gmail dot com
  2012-01-16  9:50 ` [Bug target/51835] " rearnsha at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: amker.cheng at gmail dot com @ 2012-01-12  8:01 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2012-02-23  2:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-12  8:01 [Bug target/51835] New: ARM EABI violation when passing arguments to helper floating functions like __aeabi_d2iz amker.cheng at gmail dot com
2012-01-16  9:50 ` [Bug target/51835] " rearnsha at gcc dot gnu.org
2012-01-19 23:08 ` ramana at gcc dot gnu.org
2012-01-30 18:05 ` jye2 at gcc dot gnu.org
2012-01-30 18:35 ` jye2 at gcc dot gnu.org
2012-02-05 14:08 ` mikpe at it dot uu.se
2012-02-06  5:52 ` amker.cheng at gmail dot com
2012-02-10  3:15 ` amker at gcc dot gnu.org
2012-02-14  7:43 ` amker at gcc dot gnu.org
2012-02-23  2:43 ` ramana 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).