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] Fix libjava negzero failure (unaligned doubles)


The enclosed patch fixes the failure of the negzero test in the libjava
testsuite on the PA.  This was hidden in the original hppa-unknown-linux-gnu
implementation because the kernel does an unaligned fixup.  However,
the problem became apparent working on the hpux port.

The problem is p_argv is not always correctly aligned for doubles
on the PA-RISC architecture.  The stack slot is always correctly
aligned.  Probably, the misalignment of p_argv needs fixing since
the copy to the stack slot would fail is if the PA backend did
this operation as a load/store double operation.  However, at the
moment, it does the backend does the copy using a pair of word
operations.  The change doesn't adversely affect the generated
code, so I decided that the work around was ok for the moment. 

Tested on hppa2.0w-hp-hpux11 and hppa-unknown-linux-gnu.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2006-05-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from
	stack slot.

Index: src/pa/ffi.c
===================================================================
--- src/pa/ffi.c	(revision 113893)
+++ src/pa/ffi.c	(working copy)
@@ -194,10 +194,10 @@
 	  switch (slot - FIRST_ARG_SLOT)
 	    {
 	    /* First 4 args go in fr4L - fr7L.  */
-	    case 0: fldw(*p_argv, fr4); break;
-	    case 1: fldw(*p_argv, fr5); break;
-	    case 2: fldw(*p_argv, fr6); break;
-	    case 3: fldw(*p_argv, fr7); break;
+	    case 0: fldw(stack - slot, fr4); break;
+	    case 1: fldw(stack - slot, fr5); break;
+	    case 2: fldw(stack - slot, fr6); break;
+	    case 3: fldw(stack - slot, fr7); break;
 	    }
 	  break;
 
@@ -209,8 +209,8 @@
 	  switch (slot - FIRST_ARG_SLOT)
 	    {
 	      /* First 2 args go in fr5, fr7.  */
-	      case 1: fldd(*p_argv, fr5); break;
-	      case 3: fldd(*p_argv, fr7); break;
+	      case 1: fldd(stack - slot, fr5); break;
+	      case 3: fldd(stack - slot, fr7); break;
 	    }
 	  break;
 


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