Make MicroBlaze support DWARF EH (old Xilinx patch, needed for glibc build).
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Fri, 6 Jan 2017 20:54:34 +0000 (20:54 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Fri, 6 Jan 2017 20:54:34 +0000 (20:54 +0000)
commitb69195a0f48add25066ee99ef00597715d3c1fe7
treebf1a938e1e5e9e5426bda271978925b3fea8de59
parent75213cc0e4b3afd8e677f25e4fe9201f1b856f33
Make MicroBlaze support DWARF EH (old Xilinx patch, needed for glibc build).

This patch, taken from
<https://git.busybox.net/buildroot/tree/package/gcc/5.4.0/840-microblaze-enable-dwarf-eh-support.patch>
and with a few formatting cleanups and an update for the removal of
gen_rtx_raw_REG, enables DWARF EH support for MicroBlaze.

This is needed for building glibc with a compiler that includes shared
libgcc; right now all glibc builds for MicroBlaze are failing with my
bot for lack of this support.  (It's dubious if we should have glibc
ports at all where required support is missing in FSF GCC.)

Tested building glibc with build-many-glibcs.py.  I have *not* done
any other testing or any execution testing for MicroBlaze.

2017-01-06  Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    David Holsgrove <david.holsgrove@xilinx.com>

* common/config/microblaze/microblaze-common.c
(TARGET_EXCEPT_UNWIND_INFO): Remove.
* config/microblaze/microblaze-protos.h (microblaze_eh_return):
New prototype.
* config/microblaze/microblaze.c (microblaze_must_save_register)
(microblaze_expand_epilogue, microblaze_return_addr): Handle
calls_eh_return.
(microblaze_eh_return): New function.
* config/microblaze/microblaze.h (RETURN_ADDR_OFFSET)
(EH_RETURN_DATA_REGNO, MB_EH_STACKADJ_REGNUM)
(EH_RETURN_STACKADJ_RTX, ASM_PREFERRED_EH_DATA_FORMAT): New macros.
* config/microblaze/microblaze.md (eh_return): New pattern.

Co-Authored-By: David Holsgrove <david.holsgrove@xilinx.com>
From-SVN: r244183
gcc/ChangeLog
gcc/common/config/microblaze/microblaze-common.c
gcc/config/microblaze/microblaze-protos.h
gcc/config/microblaze/microblaze.c
gcc/config/microblaze/microblaze.h
gcc/config/microblaze/microblaze.md