aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPip Cet <pipcet@gmail.com>2016-11-17 16:16:38 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-11-17 16:16:38 +0000
commit86a21121ace5a75de9d57b4b9bd691388e0367bc (patch)
tree8a67841dfc46ed98537f8cc1ed7522c6ee4a7d5d /gcc
parentcc4aa6592b3822043ab5d6b1fad958b9bc21acbd (diff)
downloadgcc-86a21121ace5a75de9d57b4b9bd691388e0367bc.zip
gcc-86a21121ace5a75de9d57b4b9bd691388e0367bc.tar.gz
gcc-86a21121ace5a75de9d57b4b9bd691388e0367bc.tar.bz2
re PR rtl-optimization/78355 (LRA generates unaligned accesses when SLOW_UNALIGNED_ACCESS is 1)
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. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r242554
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/doc/tm.texi3
-rw-r--r--gcc/doc/tm.texi.in3
-rw-r--r--gcc/lra-constraints.c7
4 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1bb29c0..bc2b86c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+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
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 84bba07..7bf09d1 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6368,7 +6368,8 @@ other fields in the same word of the structure, but to different bytes.
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
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 9afd5daa..58d1e63 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -4656,7 +4656,8 @@ other fields in the same word of the structure, but to different bytes.
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
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index b592168..56b65ef 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1486,9 +1486,10 @@ simplify_operand_subreg (int nop, machine_mode reg_mode)
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. */