This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[testcase] GCSE failure on 3.0 branch


On Wed, Sep 12, 2001 at 01:04:53AM +0200, Franz Sirl wrote:
> Try the testcase in PR3387, it got miscompiled on x86 with the branch and is 
> fixed with your patch. Should be easy to turn it into an executable testcase 
> for gcc.dg.

Here it is, ok to commit branch/head?
Also, ok to commit
2001-04-20  Jakub Jelinek  <jakub@redhat.com>
        * gcse.c (gcse_main): Fix comment typo.
        (delete_null_pointer_check): Likewise.
        (hash_scan_set): Don't consider sets with REG_EQUIV MEM notes.
        * cse.c (cse_insn): Likewise.
        * function.c (fixup_var_refs_insns_with_hash): The sequence is
        toplevel.
patch to branch which fixes it?

2001-09-12  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/20010912-1.c: New test.

--- gcc/testsuite/gcc.dg/20010912-1.c.jj	Fri Feb 16 21:16:31 2001
+++ gcc/testsuite/gcc.dg/20010912-1.c	Wed Sep 12 15:40:33 2001
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int bar (int x, char **y)
+{
+  if (x != 56)
+    abort ();
+  if (**y != 'a')
+    abort ();
+  *y = "def";
+  return 1;
+}
+
+int baz (int x, char **y)
+{
+  if (x != 56)
+    abort ();
+  if (**y != 'a')
+    abort ();
+  return 26;
+}
+
+int foo (int x, char *y)
+{
+  int a;
+  char *b = y;
+  a = bar (x, &y);
+  if (a)
+    {
+      y = b;
+      a = baz (x, &y);
+    }
+  if (a)
+    return a;
+
+  baz (x, &y);
+  return 0;
+}
+
+int main ()
+{
+  if (foo (56, "abc") != 26)
+    abort ();
+  exit (0);
+}

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]