Hi,
This adds the reduced test case from the PR to the test suite.
Tested with
make -k check-gcc RUNTESTFLAGS="compile.exp=pr40797*
--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 target/40797
* gcc.c-torture/compile/pr40797.c: New.
Index: gcc/testsuite/gcc.c-torture/compile/pr40797.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr40797.c (revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr40797.c (revision 0)
@@ -0,0 +1,16 @@
+typedef struct str { short x, y;} S;
+
+static short
+bar (short ch, short sl, short sr, short tl, short tr)
+{
+ return 0;
+}
+
+void
+foo (short ch, S *pi, short nc, S *po)
+{
+ short clo, chi, lo, hi;
+
+ po->x = bar (ch, clo, chi, pi[lo].x, pi[hi].x);
+ po->y = bar (ch, clo, chi, pi[lo].y, pi[hi].y);
+}