Skip to content

Commit 09a2cda

Browse files
committed
@i added quirky -fbaserel -fbaserel32 - really working? nut sure...
1 parent 6a04e2c commit 09a2cda

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

gcc/config/m68k/amigaos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ extern tree amigaos_handle_type_attribute(tree *, tree, tree, int, bool*);
471471
#define SUBTARGET_OVERRIDE_OPTIONS \
472472
do \
473473
{ \
474-
if (!TARGET_68020 && flag_pic==4) \
474+
if (!TARGET_68020 && flag_pic==2) \
475475
error ("-fbaserel32 is not supported on the 68000 or 68010\n"); \
476476
if (amigaos_regparm > 0 && amigaos_regparm > AMIGAOS_MAX_REGPARM) \
477477
error ("-mregparm=x with 1 <= x <= %d\n", AMIGAOS_MAX_REGPARM); \

gcc/config/m68k/amigaos.opt

100755100644
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ msmall-code
1111
Target RejectNegative
1212
small code model
1313

14+
fbaserel
15+
Target Common Report Var(flag_pic,3) Negative(fpie) Init(-1)
16+
Backward compatibility, use -fpic now
17+
18+
fbaserel32
19+
Target Common Report Var(flag_pic,4) Negative(fPIE) Init(-1)
20+
Backward compatibility, use -fPIC now

gcc/config/m68k/m68k.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ m68k_option_override (void)
557557
: (m68k_cpu_flags & FL_COLDFIRE) != 0 ? FPUTYPE_COLDFIRE
558558
: FPUTYPE_68881);
559559

560-
/* Sanity check to ensure that msep-data and mid-sahred-library are not
560+
/* Sanity check to ensure that msep-data and mid-shared-library are not
561561
* both specified together. Doing so simply doesn't make sense.
562562
*/
563563
if (TARGET_SEP_DATA && TARGET_ID_SHARED_LIBRARY)
@@ -568,7 +568,7 @@ m68k_option_override (void)
568568
* -fpic but it hasn't been tested properly.
569569
*/
570570
if (TARGET_SEP_DATA || TARGET_ID_SHARED_LIBRARY)
571-
flag_pic = 2;
571+
flag_pic = TARGET_68020 ? 2 : 1;
572572

573573
/* -mpcrel -fPIC uses 32-bit pc-relative displacements. Raise an
574574
error if the target does not support them. */
@@ -1139,9 +1139,9 @@ m68k_expand_prologue (void)
11391139
current_frame.reg_mask, true, true));
11401140
}
11411141

1142-
if (!TARGET_SEP_DATA
1143-
&& crtl->uses_pic_offset_table)
1144-
emit_insn (gen_load_got (pic_offset_table_rtx));
1142+
// if (!TARGET_SEP_DATA
1143+
// && crtl->uses_pic_offset_table)
1144+
// emit_insn (gen_load_got (pic_offset_table_rtx));
11451145
}
11461146

11471147
/* Return true if a simple (return) instruction is sufficient for this
@@ -4693,8 +4693,10 @@ print_operand_address (FILE *file, rtx addr)
46934693
{
46944694
struct m68k_address address;
46954695

4696-
if (!m68k_decompose_address (QImode, addr, true, &address))
4696+
if (!m68k_decompose_address (QImode, addr, true, &address)) {
4697+
debug_rtx(addr);
46974698
gcc_unreachable ();
4699+
}
46984700

46994701
if (address.code == PRE_DEC)
47004702
fprintf (file, MOTOROLA ? "-(%s)" : "%s@-",
@@ -4719,7 +4721,7 @@ print_operand_address (FILE *file, rtx addr)
47194721
/* (d16,PC) or (bd,PC,Xn) (with suppressed index register). */
47204722
fputc ('(', file);
47214723
output_addr_const (file, addr);
4722-
asm_fprintf (file, flag_pic == 1 ? ":w,%Rpc)" : ":l,%Rpc)");
4724+
asm_fprintf (file, flag_pic == 1 || flag_pic == 3 ? ":w,%Rpc)" : ":l,%Rpc)");
47234725
}
47244726
else
47254727
{
@@ -5124,8 +5126,8 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
51245126
/* Use the static chain register as a temporary (call-clobbered)
51255127
GOT pointer for this function. We can use the static chain
51265128
register because it isn't live on entry to the thunk. */
5127-
SET_REGNO (pic_offset_table_rtx, STATIC_CHAIN_REGNUM);
5128-
emit_insn (gen_load_got (pic_offset_table_rtx));
5129+
// SET_REGNO (pic_offset_table_rtx, STATIC_CHAIN_REGNUM);
5130+
// emit_insn (gen_load_got (pic_offset_table_rtx));
51295131
}
51305132
legitimize_pic_address (XEXP (mem, 0), Pmode, tmp);
51315133
mem = replace_equiv_address (mem, tmp);

0 commit comments

Comments
 (0)