This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Work around bug in powf function on HP-UX


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]