Eric Botcazou <ebotca...@adacore.com> writes:
> This fixes a somewhat obscure interaction between alloca and setjmp/longjmp 
> in 
> PIC mode on the SPARC architecture.  The problem is that the canonical PIC 
> register on SPARC (%l7) is call-saved like on other architectures but, unlike 
> on other architectures, not (always) preserved by setjmp.  There is a note in 
> the SCD about this quirk of setjmp so we must probably live with it.
>
> Tested on SPARC64/Linux and SPARC/Solaris, applied on the mainline.
>
>
> 2018-01-12  Eric Botcazou  <ebotca...@adacore.com>
>
>       PR target/83368
>       * config/sparc/sparc.h (PIC_OFFSET_TABLE_REGNUM): Set to INVALID_REGNUM
>       in PIC mode except for TARGET_VXWORKS_RTP.
>       * config/sparc/sparc.c: Include cfgrtl.h.
>       (TARGET_INIT_PIC_REG): Define.
>       (TARGET_USE_PSEUDO_PIC_REG): Likewise.
>       (sparc_pic_register_p): New predicate.
>       (sparc_legitimate_address_p): Use it.
>       (sparc_legitimize_pic_address): Likewise.
>       (sparc_delegitimize_address): Likewise.
>       (sparc_mode_dependent_address_p): Likewise.
>       (gen_load_pcrel_sym): Remove 4th parameter.
>       (load_got_register): Adjust call to above.  Remove obsolete stuff.
>       (sparc_expand_prologue): Do not call load_got_register here.
>       (sparc_flat_expand_prologue): Likewise.
>       (sparc_output_mi_thunk): Set the pic_offset_table_rtx object.
>       (sparc_use_pseudo_pic_reg): New function.
>       (sparc_init_pic_reg): Likewise.
>       * config/sparc/sparc.md (vxworks_load_got): Set the GOT register.
>       (builtin_setjmp_receiver): Enable only for TARGET_VXWORKS_RTP.
>
>
> 2018-01-12  Eric Botcazou  <ebotca...@adacore.com>
>
>       * gcc.target/sparc/setjmp-1.c: New test.

I think this caused:

.././src/gcc/config/sparc/sparc.md: In function ‘rtx_def* 
gen_vxworks_load_got()’:
.././src/gcc/config/sparc/sparc.md:1811:17: error: ‘global_offset_table_rtx’ 
was not declared in this scope
   operands[0] = global_offset_table_rtx;

on sparc-wrs-vxworks.  (Might already have been reported, sorry.)

Thanks,
Richard

Reply via email to