diff options
author | 1999-07-18 18:14:43 +0000 | |
---|---|---|
committer | 1999-07-18 18:14:43 +0000 | |
commit | 17ac181073644eeaa3d39fc29eeb1500cc22bc58 (patch) | |
tree | 606f6103b9f3165f0c33d6d8f64048cc00f87c75 | |
parent | pmap_activate() and pmap_deactivate() are MD (diff) | |
download | wireguard-openbsd-17ac181073644eeaa3d39fc29eeb1500cc22bc58.tar.xz wireguard-openbsd-17ac181073644eeaa3d39fc29eeb1500cc22bc58.zip |
Revert last change of the 990629: this breaks m68k pic code.
More recent snapshots seem to have this fixed properly, wait until u
a complete shake-out has been run
-rw-r--r-- | gnu/egcs/gcc/config/m68k/m68k.c | 18 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/m68k/m68k.h | 16 |
2 files changed, 24 insertions, 10 deletions
diff --git a/gnu/egcs/gcc/config/m68k/m68k.c b/gnu/egcs/gcc/config/m68k/m68k.c index 2eef7123c8f..98f51978ac8 100644 --- a/gnu/egcs/gcc/config/m68k/m68k.c +++ b/gnu/egcs/gcc/config/m68k/m68k.c @@ -126,6 +126,24 @@ override_options () m68k_align_funcs = def_align; } +/* Emit a (use pic_offset_table_rtx) if we used PIC relocation in the + function at any time during the compilation process. In the future + we should try and eliminate the USE if we can easily determine that + all PIC references were deleted from the current function. That would + save an address register */ + +void +finalize_pic () +{ + if (flag_pic && current_function_uses_pic_offset_table) + { + rtx insn = gen_rtx_USE (VOIDmode, pic_offset_table_rtx); + emit_insn_after (insn, get_insns ()); + emit_insn (insn); + } +} + + /* This function generates the assembly code for function entry. STREAM is a stdio stream to output the code to. SIZE is an int: how many units of temporary storage to allocate. diff --git a/gnu/egcs/gcc/config/m68k/m68k.h b/gnu/egcs/gcc/config/m68k/m68k.h index 9a58f1db6be..8152cddb8b5 100644 --- a/gnu/egcs/gcc/config/m68k/m68k.h +++ b/gnu/egcs/gcc/config/m68k/m68k.h @@ -341,6 +341,11 @@ extern int target_flags; /* This defines the register which is used to hold the offset table for PIC. */ #define PIC_OFFSET_TABLE_REGNUM 13 +/* Used to output a (use pic_offset_table_rtx) so that we + always save/restore a5 in functions that use PIC relocation + at *any* time during the compilation process. */ +#define FINALIZE_PIC finalize_pic() + #ifndef SUPPORT_SUN_FPA /* 1 for registers that have pervasive standard uses @@ -441,17 +446,8 @@ extern int target_flags; if (TEST_HARD_REG_BIT (x, i)) \ fixed_regs[i] = call_used_regs[i] = 1; \ } \ - if (flag_pic) \ - fixed_regs[PIC_OFFSET_TABLE_REGNUM] \ - = call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;\ -} -#else -#define CONDITIONAL_REGISTER_USAGE \ -{ \ - if (flag_pic) \ - fixed_regs[PIC_OFFSET_TABLE_REGNUM] \ - = call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;\ } + #endif /* defined SUPPORT_SUN_FPA */ /* Return number of consecutive hard regs needed starting at reg REGNO |