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]

[PATCH] Fix clear_hazard() for MIPS64r2 with 64-bit pointers


There is another place where SImode is hard-coded in the trampoline code when
dealing with pointers.  I initially was trying to fix the infinite loop
causing all the libjava timeouts in
http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg02216.html with n64.
However, after testing I found that this fixed the remaining n64 trampoline
failures as well.

(The infinite loop had to do with Java catching sigsegv but than the code
itself segfaulting while dereferencing the truncated PC value in the signal
unwinding code.)

Bootstrapped and tested on mips64octeon-linux-gnu with {,-mabi=64}.

OK to install?

Adam

	* config/mips/mips.md (clear_hazard): Rename to
	clear_hazard_<mode>.  Use mode-specific addition.
	(clear_cache): Rename gen_clear_hazard to gen_clear_hazard_si
	or gen_clear_hazard_di depending on the size of Pmode.

Index: mips.md
===================================================================
--- mips.md	(revision 142136)
+++ mips.md	(working copy)
@@ -4703,7 +4703,9 @@ (define_expand "clear_cache"
     {
       mips_expand_synci_loop (operands[0], operands[1]);
       emit_insn (gen_sync ());
-      emit_insn (gen_clear_hazard ());
+      emit_insn (Pmode == SImode
+		 ? gen_clear_hazard_si ()
+		 : gen_clear_hazard_di ());
     }
   else if (mips_cache_flush_func && mips_cache_flush_func[0])
     {
@@ -4732,14 +4734,14 @@ (define_insn "rdhwr_synci_step_<mode>"
   "ISA_HAS_SYNCI"
   "rdhwr\t%0,$1")
 
-(define_insn "clear_hazard"
+(define_insn "clear_hazard_<mode>"
   [(unspec_volatile [(const_int 0)] UNSPEC_CLEAR_HAZARD)
-   (clobber (reg:SI 31))]
+   (clobber (reg:P 31))]
   "ISA_HAS_SYNCI"
 {
   return "%(%<bal\t1f\n"
          "\tnop\n"
-         "1:\taddiu\t$31,$31,12\n"
+         "1:\t<d>addiu\t$31,$31,12\n"
          "\tjr.hb\t$31\n"
          "\tnop%>%)";
 }


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