--- gcc/config/m68k.h 2018/04/24 18:00:05 1.1.1.3 +++ gcc/config/m68k.h 2018/04/24 18:06:00 1.1.1.4 @@ -81,14 +81,15 @@ extern int target_flags; /* Compile (actually, link) for Sun SKY board. */ #define TARGET_SKY (target_flags & 0200) -/* Optimize for 68040. +/* Optimize for 68040, but still allow execution on 68020 + (-m68020-40 or -m68040). The 68040 will execute all 68030 and 68881/2 instructions, but some of them must be emulated in software by the OS. When TARGET_68040 is turned on, these instructions won't be used. This code will still run on a 68030 and 68881/2. */ -#define TARGET_68040 (target_flags & 0400) +#define TARGET_68040 (target_flags & 01400) -/* Support 68040 fp instructions. */ +/* Use the 68040-only fp instructions (-m68040). */ #define TARGET_68040_ONLY (target_flags & 01000) /* Macro to define tables used to set the flags. @@ -114,10 +115,10 @@ extern int target_flags; { "nofpa", -0100}, \ { "sky", 0200}, \ { "nosky", -0200}, \ - { "68040", 0407}, \ + { "68020-40", 0407}, \ { "68030", -01400}, \ { "68030", 7}, \ - { "68040-only", 01000}, \ + { "68040", 01007}, \ { "", TARGET_DEFAULT}} /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc. */ @@ -1127,8 +1128,15 @@ __transfer_from_trampoline () \ #define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \ { if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; } -#define GO_IF_INDEXABLE_BASE(X, ADDR) \ -{ if (GET_CODE (X) == LABEL_REF) goto ADDR; \ +/* Only labels on dispatch tables are valid for indexing from. */ +#define GO_IF_INDEXABLE_BASE(X, ADDR) \ +{ rtx temp; \ + if (GET_CODE (X) == LABEL_REF \ + && (temp = next_nonnote_insn (XEXP (X, 0))) != 0 \ + && GET_CODE (temp) == JUMP_INSN \ + && (GET_CODE (PATTERN (temp)) == ADDR_VEC \ + || GET_CODE (PATTERN (temp)) == ADDR_DIFF_VEC)) \ + goto ADDR; \ if (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) goto ADDR; } #define GO_IF_INDEXING(X, ADDR) \