This is the mail archive of the gcc-bugs@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]

[Bug libffi/31937] New: libffi doesn't support ppc without FPU


PowerPC CPU without FPU (such as the PPC405EP) doesn't pass the libffi
testsuite. Most of the tests crash with an "illegal instruction" error message,
even those that don't manipulate double/float. For instance, it crashes with
the "cls_uint" test.

After investigating, I think the problem comes from the ppc assembly code from
the libffi/src/powerpc directory that includes FPU instructions not supported
by those CPU. In particular, the ppc_closure.S file contains "stfd" FPU
instructions that are supposed to save FPU registers and are always executed,
even if no fpu operation is to be performed.

If you don't need fpu support (as I do), a quick and dirty hack is to comment
out those "stfd" instructions from the ppc_closure.S file.

I guess the right way to fix it would be to use the soft-float system when no
FPU is present. But that's something I don't know how to do...

I've tried with gcc 3.4.3 and gcc 4.1.0, but I guess all versions are affected.


-- 
           Summary: libffi doesn't support ppc without FPU
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libffi
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: patrick dot olinet at gmail dot com
 GCC build triplet: i686-linux-gnu
  GCC host triplet: powerpc-405-linux-gnu
GCC target triplet: powerpc-405-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


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