public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Work around bug in powf function on HP-UX
@ 2013-02-18 16:46 John David Anglin
  2013-03-11  0:52 ` John David Anglin
  0 siblings, 1 reply; 2+ messages in thread
From: John David Anglin @ 2013-02-18 16:46 UTC (permalink / raw)
  To: gcc-patches

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++)

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

end of thread, other threads:[~2013-03-11  0:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-18 16:46 [committed] Work around bug in powf function on HP-UX John David Anglin
2013-03-11  0:52 ` John David Anglin

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).