Patchwork [SH] PR 54386 - Add testcase

login
register
mail settings
Submitter Oleg Endo
Date Feb. 3, 2013, 9:13 p.m.
Message ID <1359926031.2367.149.camel@yam-132-YW-E178-FTW>
Download mbox | patch
Permalink /patch/217808/
State New
Headers show

Comments

Oleg Endo - Feb. 3, 2013, 9:13 p.m.
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.
Kaz Kojima - Feb. 3, 2013, 11:03 p.m.
Oleg Endo <oleg.endo@t-online.de> wrote:
> 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?

OK.

Regards,
	kaz

Patch

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);
+}