From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31778 invoked by alias); 6 Feb 2012 05:52:26 -0000 Received: (qmail 31768 invoked by uid 22791); 6 Feb 2012 05:52:24 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Feb 2012 05:52:11 +0000 From: "amker.cheng at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/51835] ARM EABI violation when passing arguments to helper floating functions like __aeabi_d2iz Date: Mon, 06 Feb 2012 05:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amker.cheng at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.3 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg00562.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51835 --- Comment #6 from amker.cheng 2012-02-06 05:51:25 UTC --- (In reply to comment #5) > (In reply to comment #2) > > This is only applicable to the 4.6 branch and trunk since support for the > > Cortex M4 wasn't added till 4.6. > > > > cheers > > Ramana > > Maybe the Cortex M4 wasn't added until 4.6, but the other options are permitted > by 4.5 and I can easily get 4.5 to produce wrong-looking code. With -O2 > -mfloat-abi=hard -mfpu=fpv4-sp-d16 -march=armv7-a -marm I see the following > code generation difference between 4.5 and 4.6: > > @@ -22,8 +22,9 @@ > @ frame_needed = 0, uses_anonymous_args = 0 > stmfd sp!, {r3, lr} > bl __aeabi_f2d > + fmrrd r0, r1, d0 > bl __aeabi_d2iz > ldmfd sp!, {r3, pc} > .size func, .-func > - .ident "GCC: (GNU) 4.5.4 20120126 (prerelease)" > + .ident "GCC: (GNU) 4.6.3 20120203 (prerelease)" > .section .note.GNU-stack,"",%progbits > > Backporting r183734 from 4.6 to 4.5 makes 4.5 generate the same code as 4.6, > i.e., with the fmrrd between the two calls. beside this patch, Julian Brown's patch r174803 is necessary too. For now, 1, arguments for both __aeabi_f2d and __aeabi_d2iz are wrong in 4.5; 2, arguments for __aeabi_f2d is wrong in 4.6 To solve this, have to: 1, backport r183734 and r174803 to 4.5; 2, backport r174803 to 4.6;