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]

[testsuite] i386 breakage (was Re: i386 arithmetics+comparison patterns fix)


On Tue, Sep 12, 2000 at 01:03:55AM +0200, Jan Hubicka wrote:
> 
> Hi
> Here is updated patch that attempts to track the problem in way I mentioned
> in previous email.  It does have some problems, but I've decided to stop
> here, since otherwise I will end up with too long patch - I believe that
> now thinkins are not worse than in current code and the bug is fixed.

Unfortunately, it breaks stuff which worked flawlessly before.
Ok to commit the attached testcase?
Jan, will you fix this yourself or should I debug it out?

> 
> The problems are:
>  1)  It don't handle constants in the add patterns.  This is especially tricky,
>      since combine reverses the condition code etc.
>  2)  CCNOmode is never used for adds even when we should use it - the i386.c
>      depends on fact that second operand is zero - we will need probably to
>      split it to CCNOmode and CCNO0mode, where the first will indicate only
>      the presence of good comparison operator.
>  3)  Combine don't canonicalize the negs, so they may appear at both
>      arms of plus - I am sending separate patch for this.
>      Until that these patterns will be rarely generated, since the second
>      ("noncanonical") form is more common.
> 
> Honza
> 
> Tue Sep 12 00:52:16 MET DST 2000  Jan Hubicka  <jh@suse.cz>
> 	* i386.md (add?i_3, add?i_5): New.
> 	(add?i_4): Rename from add?i_3;  Fix compare pattern.
> 	(sub?i_3, xor?i_3, ior?i_3): New.

2000-10-13  Jakub Jelinek  <jakub@redhat.com>

	* gcc.c-torture/execute/20001013-1.c: New test.

--- gcc/testsuite/gcc.c-torture/execute/20001013-1.c.jj	Thu Aug 24 11:00:32 2000
+++ gcc/testsuite/gcc.c-torture/execute/20001013-1.c	Fri Oct 13 11:52:20 2000
@@ -0,0 +1,17 @@
+struct x {
+	int a, b;
+} z = { -4028, 4096 };
+
+int foo(struct x *p, int y)
+{
+  if ((y & 0xff) != y || -p->b >= p->a)
+    return 1;
+  return 0;
+}
+
+main()
+{
+  if (foo (&z, 10))
+    abort ();
+  exit (0);
+}

	Jakub

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