aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-06-27 10:03:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-06-27 10:03:51 +0000
commit3fd269db216915329a3f016e4a7431a82ed564ef (patch)
tree184d0d107cc67e9a8e87328f1ba226432a0ebe3b /gcc
parent807b7d6209c7bd54b4dfc9abdc17f451e71aa648 (diff)
downloadgcc-3fd269db216915329a3f016e4a7431a82ed564ef.zip
gcc-3fd269db216915329a3f016e4a7431a82ed564ef.tar.gz
gcc-3fd269db216915329a3f016e4a7431a82ed564ef.tar.bz2
tree-ssa-math-opts.c (bswap_replace): Fix SLOW_UNALIGNED_ACCESS test to only apply to unaligned object.
2014-06-27 Richard Biener <rguenther@suse.de> * tree-ssa-math-opts.c (bswap_replace): Fix SLOW_UNALIGNED_ACCESS test to only apply to unaligned object. From-SVN: r212068
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-math-opts.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d96c2b..2ea692b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-27 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-math-opts.c (bswap_replace): Fix
+ SLOW_UNALIGNED_ACCESS test to only apply to unaligned object.
+
2014-06-27 Martin Liska <mliska@suse.cz>
* gimple.h (gimple_location_safe): New function introduced.
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index ca2b30d..65dfdec 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2179,7 +2179,9 @@ bswap_replace (gimple cur_stmt, gimple_stmt_iterator gsi, gimple src_stmt,
unsigned align;
align = get_object_alignment (src);
- if (bswap && SLOW_UNALIGNED_ACCESS (TYPE_MODE (load_type), align))
+ if (bswap
+ && align < GET_MODE_ALIGNMENT (TYPE_MODE (load_type))
+ && SLOW_UNALIGNED_ACCESS (TYPE_MODE (load_type), align))
return false;
gsi_move_before (&gsi, &gsi_ins);