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]
Other format: [Raw text]

Re: [PATCH] Fix ACATS failures in GCC 3.4


> But the question is what is the type of the MAX_EXPR?  Did it change
> type?

No, it didn't.  Its type is still 'long int'.

> Is it the same type as both of its operands in both cases?

No, it is not in the second case.  Would this matter since the casts are 
(wrongly) considered NOPs for MAX_EXPR?

>     Maybe the real problem comes from the RTL expander for MAX_EXPR.  I'll
>     investigate this.
>
> I don't think so.

Well, there seems to be a little inconsistency in the expander.  Here is the 
first flavor:

      /* First try to do it with a special MIN or MAX instruction.
	 If that does not win, use a conditional jump to select the proper
	 value.  */
      this_optab = (TREE_UNSIGNED (type)
		    ? (code == MIN_EXPR ? umin_optab : umax_optab)
		    : (code == MIN_EXPR ? smin_optab : smax_optab));

      temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp,
			   OPTAB_WIDEN);

and the second flavor (which is used in our present case):

	  int unsignedp = TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 1)));
	  do_compare_rtx_and_jump (target, op1, code == MAX_EXPR ? GE : LE,
				   unsignedp, mode, NULL_RTX, NULL_RTX,
				   op0);

Note how the signedness is not taken from the same source.

-- 
Eric Botcazou


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