This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
New test committed.
- To: gcc-patches at gcc dot gnu dot org
- Subject: New test committed.
- From: Bernd Schmidt <bernds at redhat dot co dot uk>
- Date: Sat, 11 Nov 2000 14:11:51 +0000 (GMT)
This is a reduced version of a file in the Linux kernel that failed to
be compiled correctly with Red Hat's internal version of gcc on an sh-elf
target. This was due to a bug in gcse.c (which isn't present in the net
gcc sources).
Approved by Geoff Keating.
Bernd
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/ChangeLog,v
retrieving revision 1.815
diff -u -p -r1.815 ChangeLog
--- ChangeLog 2000/11/10 19:27:32 1.815
+++ ChangeLog 2000/11/11 14:08:51
@@ -1,3 +1,7 @@
+2000-11-11 Bernd Schmidt <bernds@redhat.co.uk>
+
+ * gcc.c-torture/execute/20001111-1.c: New test.
+
2000-11-10 Nick Clifton <nickc@redhat.com>
* gcc.c-torture/execute/20001108-1.c: Add test of unsigned long
Index: gcc.c-torture/execute/20001111-1.c
===================================================================
RCS file: 20001111-1.c
diff -N 20001111-1.c
--- /dev/null Tue May 5 13:32:27 1998
+++ 20001111-1.c Sat Nov 11 06:08:51 2000
@@ -0,0 +1,41 @@
+
+static int next_buffer = 0;
+void bar (void);
+
+static int t = 1, u = 0;
+
+long
+foo (unsigned int offset)
+{
+ unsigned i, buffer;
+ int x;
+ char *data;
+
+ i = u;
+ if (i)
+ return i * 0xce2f;
+
+ buffer = next_buffer;
+ data = buffer * 0xce2f;
+ for (i = 0; i < 2; i++)
+ bar ();
+ buffer = next_buffer;
+ return buffer * 0xce2f + offset;
+
+}
+
+void
+bar (void)
+{
+}
+
+int
+main ()
+{
+ if (foo (3) != 3)
+ abort ();
+ next_buffer = 1;
+ if (foo (2) != 0xce2f + 2)
+ abort ();
+ exit (0);
+}