[patch] target/21927

Eric Christopher echristo@redhat.com
Mon Jun 6 05:12:00 GMT 2005


This was a warning that didn't make a whole lot of sense to me when I
saw it before, but I hadn't been convinced I'd put it in on my target.
Apparently I had when I decided that BRANCH_COST should be unsigned on
my target :)

I don't see the point of a negative branch cost on any target,
especially when the doc says that the default is 1 and everything is
based relative to that. I mean, you may want zero to make it cheaper
than anything else, but negative just seems ridiculous.

Tested by building cc1 for mipsisa64-elf. Bootstrap in process.

OK?

-eric

2005-06-05  Eric Christopher  <echristo@redhat.com>

	target/21927
	* expr.c (do_store_flag): Remove check for non-negative BRANCH_COST.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.792
diff -u -p -w -r1.792 expr.c
--- expr.c	4 Jun 2005 17:22:17 -0000	1.792
+++ expr.c	6 Jun 2005 05:11:53 -0000
@@ -8729,8 +8729,7 @@ do_store_flag (tree exp, rtx target, enu
       if ((code == LT && integer_zerop (arg1))
 	  || (! only_cheap && code == GE && integer_zerop (arg1)))
 	;
-      else if (BRANCH_COST >= 0
-	       && ! only_cheap && (code == NE || code == EQ)
+      else if (! only_cheap && (code == NE || code == EQ)
 	       && TREE_CODE (type) != REAL_TYPE
 	       && ((abs_optab->handlers[(int) operand_mode].insn_code
 		    != CODE_FOR_nothing)




More information about the Gcc-patches mailing list