This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[SH] PR 54386 - Add testcase
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 03 Feb 2013 22:13:51 +0100
- Subject: [SH] PR 54386 - Add testcase
Hi,
PR 54386 has been fixed a while ago already and it wasn't really an SH
specific problem. Still, I'd like to add an SH specific test case for
this.
Tested with
make -k check-gcc RUNTESTFLAGS="sh.exp=pr54386.c --target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
OK for trunk?
Cheers,
Oleg
testsuite/ChangeLog:
PR tree-optimization/54386
* gcc.target/sh/pr54386.c: New.
Index: gcc/testsuite/gcc.target/sh/pr54386.c
===================================================================
--- gcc/testsuite/gcc.target/sh/pr54386.c (revision 0)
+++ gcc/testsuite/gcc.target/sh/pr54386.c (revision 0)
@@ -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);
+}