Re: MinGW x86_64 ABI problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 1) Can you tell me where callee saved registers are specified in the gcc source code.

To a first order of approximation, that's the CALL_USED_REGS macro in
tm.h (config/i386/i386.h).
But it can get refined in other places, as in this case in
CONDITIONAL_REGISTER_USAGE.   Some ports also use OVERRIDE_OPTIONS,
for mainly historical reasons.

> 2) I tried adding "-f-call-saved-xmm9" to the g++ command to see if that would fix the problem for one register. That compile aborted with
> internal compiler error: in copyprop_hardreg_forward_1, at regrename.c:1590
> Is that switch so incorrect? I understand it would generate .obj code incompatible with anything generated without that switch. But why should it crash gcc?

Different registers need to be copied in different ways.  If a port does
not anticipate that a certain register class may need saving, the generic
code to implement saving of registers across calls can emit instructions
that can not be recognized, so that code like:

      extract_insn (insn);
      if (! constrain_operands (1))
        fatal_insn_not_found (insn);

will abort.

You'd have to fix the machine description to recognize and implement properly
these register saves and restores.  And then you'll have to recompile
all the libraries with your changed ABI.

If you only have a few entry points in your DLL, it might be simpler
to write some wrapper code in assembler to save and restore the xmm
registers.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux