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] quick patch for PR31937


Here is a quick patch related to PR31937. The bug prevents PowerPC
CPUs without FPU (such as PPC405EP) to use libffi, even if no
double/float are used. It crashes with an "illegal instruction"
message.

This bug also means that it crashes when you load & run java bytecode
from a native code binary compiled with gcj. I guess libffi is used in
this case to call java methods of the bytecode.

Notice that this quick patch will only allow you to use libffi (and
hence load & run java bytecode) without float/double numbers. But it
will not prevent a crash if floats or doubles are used. A deeper
modification, with probably calls to the soft float layer, would
probably be needed for this.


--- libffi/src/powerpc/ppc_closure.S.rev112340 2007-05-16 15:49:41.000000000 +0200 +++ libffi/src/powerpc/ppc_closure.S.fix 2007-05-16 15:49:35.000000000 +0200 @@ -29,14 +29,14 @@ stw %r10,44(%r1)

       # next save fpr 1 to fpr 8 (aligned to 8)
-       stfd  %f1, 48(%r1)
-       stfd  %f2, 56(%r1)
-       stfd  %f3, 64(%r1)
-       stfd  %f4, 72(%r1)
-       stfd  %f5, 80(%r1)
-       stfd  %f6, 88(%r1)
-       stfd  %f7, 96(%r1)
-       stfd  %f8, 104(%r1)
+       # stfd  %f1, 48(%r1)
+       # stfd  %f2, 56(%r1)
+       # stfd  %f3, 64(%r1)
+       # stfd  %f4, 72(%r1)
+       # stfd  %f5, 80(%r1)
+       # stfd  %f6, 88(%r1)
+       # stfd  %f7, 96(%r1)
+       # stfd  %f8, 104(%r1)

       # set up registers for the routine that actually does the work
       # get the context pointer from the trampoline


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