+2016-11-17 Pip Cet <pipcet@gmail.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/78355
+ * doc/tm.texi.in (SLOW_UNALIGNED_ACCESS): Document that the macro only
+ needs to deal with unaligned accesses.
+ * doc/tm.texi: Regenerate.
+ * lra-constraints.c (simplify_operand_subreg): Only invoke
+ SLOW_UNALIGNED_ACCESS on innermode if the MEM is not aligned enough.
+
2016-11-17 David Malcolm <dmalcolm@redhat.com>
* input.c (selftest::test_lexer_string_locations_long_line): New
Define this macro to be the value 1 if memory accesses described by the
@var{mode} and @var{alignment} parameters have a cost many times greater
than aligned accesses, for example if they are emulated in a trap
-handler.
+handler. This macro is invoked only for unaligned accesses, i.e. when
+@code{@var{alignment} < GET_MODE_ALIGNMENT (@var{mode})}.
When this macro is nonzero, the compiler will act as if
@code{STRICT_ALIGNMENT} were nonzero when generating code for block
Define this macro to be the value 1 if memory accesses described by the
@var{mode} and @var{alignment} parameters have a cost many times greater
than aligned accesses, for example if they are emulated in a trap
-handler.
+handler. This macro is invoked only for unaligned accesses, i.e. when
+@code{@var{alignment} < GET_MODE_ALIGNMENT (@var{mode})}.
When this macro is nonzero, the compiler will act as if
@code{STRICT_ALIGNMENT} were nonzero when generating code for block
equivalences in function lra_constraints) and because for spilled
pseudos we allocate stack memory enough for the biggest
corresponding paradoxical subreg. */
- if (!SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (reg))
- || SLOW_UNALIGNED_ACCESS (innermode, MEM_ALIGN (reg))
- || MEM_ALIGN (reg) >= GET_MODE_ALIGNMENT (mode))
+ if (!(MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (mode)
+ && SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (reg)))
+ || (MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (innermode)
+ && SLOW_UNALIGNED_ACCESS (innermode, MEM_ALIGN (reg))))
return true;
/* INNERMODE is fast, MODE slow. Reload the mem in INNERMODE. */