This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Work around bug in powf function on HP-UX
- From: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Feb 2013 11:45:57 -0500
- Subject: [committed] Work around bug in powf function on HP-UX
- Reply-to: John David Anglin <dave dot anglin at nrc-cnrc dot gc dot ca>
The powf function on HP-UX incorrectly clobbers floating point register
%fr12. It is supposed to be saved and restored by callee. The patch
marks the register(s) as call used on HP-UX. We still save and restore
the register is the prologue/epilogue, so the runtime isn't changed.
Tested on hppa2.0w-hp-hpux11 and hppa64-hp-hpux11.11. Committed to
trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2013-02-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/56347
* config/pa/pa.c (pa_conditional_register_usage): On HP-UX, mark
registers %fr12 and %fr12R as call used.
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 196122)
+++ config/pa/pa.c (working copy)
@@ -10313,6 +10313,21 @@
{
int i;
+ if (TARGET_HPUX)
+ {
+ /* Work around powf bug in libm. */
+ if (TARGET_64BIT)
+ {
+ /* Mark %fr12 as call used. */
+ call_used_regs[40] = 1;
+ }
+ else
+ {
+ /* Mark %fr12 and %fr12R as call used. */
+ call_used_regs[48] = 1;
+ call_used_regs[49] = 1;
+ }
+ }
if (!TARGET_64BIT && !TARGET_PA_11)
{
for (i = 56; i <= FP_REG_LAST; i++)