diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index ed263933048e1..c8cbb6f91ef2a 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -2112,7 +2112,7 @@ m68k_illegitimate_symbolic_constant_p (rtx x) && !offset_within_block_p (base, INTVAL (offset))) return true; } - return m68k_tls_reference_p (x, false); + return m68k_tls_reference_p (x, false) || !amigaos_legitimate_src(x); } /* Implement TARGET_CANNOT_FORCE_CONST_MEM. */ diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index 4135248a37541..100ed3a4f97ea 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -302,6 +302,23 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc) goto cleanup; } +#ifdef TARGET_AMIGAOS + if (desc->noloop_assumptions) + { + rtx cmp = XEXP (desc->noloop_assumptions, 0); + if (COMPARISON_P (cmp)) + { + rtx b = XEXP (cmp, 0); + extern bool amigaos_legitimate_src (rtx); + if (!amigaos_legitimate_src (b)) + { + result = false; + goto cleanup; + } + } + } +#endif + for (i = 0; i < loop->num_nodes; i++) { bb = body[i];