Reintroduce -mflat option on SPARC

Laurent Rougé laurent.rouge@menta.fr
Wed Feb 23 13:51:00 GMT 2011


Hello,

This patch reintroduce the -mflat option on SPARC. The -mfalt option was 
deprecated in february 2004 with GCC 3.4.6. Now, with the support of 
LEON processor on GCC, this option has found a new interest.

The patch has been tested, validated and made with Eric collaboration.

Please apply this patch on mainline and backport it to 4.6 branch.

The patch change :
* doc/invoke.texi (SPARC options): Add -mflat option.
* config/sparc/sparc.c: Likewise.
(load_pic_register): Remove static and prototype.
(sparc_expand_prologue): Rename into sparc_nonflat_expland_prologue.
(sparc_expand_epilogue): Rename into sparc_nonflat_expand_epilogue.
(sparc_can_use_return_insn_p): Add TARGET_FLAT handling.
(sparc_function_ok_for_sibcall): Likewise.
(sparc_frame_pointer_required): Likewise.
(struct sparc_frame_info, current_frame_info, zero_frame_info): Add.
(RETURN_ADDR_REGNUM, HARD_FRAME_POINTER_MASK,
RETURN_ADDR_MASK): Define.
(sparc_expand_prologue): New.
(sparc_expland_epilogue): Likewise.
(sparc_flat_must_save_register_p): Likewise.
(sparc_flat_compute_frame_size): Likewise.
(sparc_flat_save_or_restore): Likewise.
(sparc_flat_expand_prologue): Likewise.
(sparc_flat_expand_epilogue): Likewise.
(flat_output_return): Likewise.
(sparc_flat_eligible_for_return_delay): Likewise.
* config/sparc/sparc.h:
(CPP_CPU_SPEC): Add mflat option.
(SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling.
(CONDITIONAL_REGISTER_USAGE): Likewise.
(INITIAL_ELIMINATION_OFFSET): Likewise.
(INCOMING_REGNO): Likewise.
(OUTGOING_REGNO): Likewise.
(LOCAL_REGNO): Likewise.
(EPILOGUE_USES): Likewise.
(ELIGIBLE_FOR_EPILOGUE_DELAY): Define.
* config/sparc/sparc.md:
("flat" attribute): Add.
(return_internal): Add TARGET_FLAT and "flat" attribute handling.
(do_builtin_setjmp_setup): Likewise.
(exception_receiver): Add.
(builtin_setjmp_receiver): Likewise.
* config/sparc/sparc.opt: Define mflat option.
* config/sparc/sparc-protos.h: Add sparc_flat_* prototypes.
(load_pic_register prototype): Add.
* config/sparc/t-elf:
(MULTILIB_OPTIONS): Add mflat option.
(MULTILIB_DIRNAMES): Add flat folder.
* gcc.dg/20020503-1.c: Add -mflat dg-options.

Regards,
Laurent Rougé.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-4.5.1-flat.diff.gz
Type: application/gzip
Size: 10365 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110223/5338f23c/attachment.gz>


More information about the Gcc-patches mailing list