aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2013-02-04 22:41:44 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2013-02-04 22:41:44 +0000
commit951eb5c7e26d4f976cf8bc841aa1268be5f49a06 (patch)
tree3c382925deeb154c254b1608d41713f9ff4077f6 /gcc
parent16e247566db1df18a63965f8b3da7345459c6296 (diff)
downloadgcc-951eb5c7e26d4f976cf8bc841aa1268be5f49a06.zip
gcc-951eb5c7e26d4f976cf8bc841aa1268be5f49a06.tar.gz
gcc-951eb5c7e26d4f976cf8bc841aa1268be5f49a06.tar.bz2
re PR tree-optimization/54386 (Unaligned mem load wrongly generated for inlined inline/static function)
PR tree-optimization/54386 * gcc.target/sh/pr54386.c: New. From-SVN: r195742
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/sh/pr54386.c41
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 548ccc1..29f0281 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-04 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR tree-optimization/54386
+ * gcc.target/sh/pr54386.c: New.
+
2013-02-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/56008
diff --git a/gcc/testsuite/gcc.target/sh/pr54386.c b/gcc/testsuite/gcc.target/sh/pr54386.c
new file mode 100644
index 0000000..4e17f37
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr54386.c
@@ -0,0 +1,41 @@
+/* Check that the inlined mem load is not handled as unaligned load. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-options "-O2" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
+/* { dg-final { scan-assembler-not "shll|extu|or" } } */
+
+static inline int
+readint0 (int* x)
+{
+ return *x;
+}
+
+int
+test0 (int* x)
+{
+ return readint0 (x);
+}
+
+inline int
+readint1 (int* x)
+{
+ return *x;
+}
+
+int
+test1 (int* x)
+{
+ return readint1 (x);
+}
+
+static int
+readint2 (int* x)
+{
+ return *x;
+}
+
+int
+test2 (int* x)
+{
+ return readint2 (x);
+}