This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug target/12654] [3.3/3.4 regression] Incorrect comparison code generated for Alpha


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12654



------- Additional Comments From tg at swox dot com  2003-10-27 22:01 -------
Subject: Re:  [3.3/3.4 regression] Incorrect comparison code generated for Alpha

Uhh.

I am very unhappy about my real email address showing up on the
web or in source code that might appear on the web, as part of a
comment in my test case.  This is abolutely unacceptable.  It
must go away immediately, even if it means editing cvs files.

Use tege at swox dot com to refer to me in any place where a spammer
could find the address.  That will put the spammer though a loop.

Now we have nested, redundant tests for the comparison code.
With the installed patch, we have the following:

      /* The following optimizations are only for signed compares.  */
      if (code != LEU && code != LTU && code != GEU && code != GTU)
	{
	  /* Whee.  Compare and branch against 0 directly.  */
	  if (op1 == const0_rtx)
	    cmp_code = NIL, branch_code = code;

	  /* If the constants doesn't fit into an immediate, but can
	     be generated by lda/ldah, we adjust the argument and
	     compare against zero, so we can use beq/bne directly.  */
	  else if (GET_CODE (op1) == CONST_INT && (code == EQ || code == NE))
	    {
	      HOST_WIDE_INT v = INTVAL (op1), n = -v;

	      if (! CONST_OK_FOR_LETTER_P (v, 'I')
		  && (CONST_OK_FOR_LETTER_P (n, 'K')
		      || CONST_OK_FOR_LETTER_P (n, 'L')))
		{
		  cmp_code = PLUS, branch_code = code;
		  op1 = GEN_INT (n);
		}
	    }
	}

This is not good.  The compiler will never do unsigned
comparisons against zero.  Therfore, you've introduced more crud
into the compier with this patch.

Why didn't you just use the simple and correct patch I supplied?

--
Torbjörn


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