[PATCH] Fix PR middle-end/14490

Andrew Pinski pinskia@physics.uc.edu
Fri Jul 1 14:40:00 GMT 2005


On Jul 1, 2005, at 6:42 AM, Richard Earnshaw wrote:

> On Thu, 2005-06-30 at 20:10, Andrew Pinski wrote:
> +      /* Transform comparisons of the form X +- C1 CMP C2 to X CMP C2
> +- C1.  */
> +      if ((TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) ==
> MINUS_EXPR)
> +         && ((TREE_CODE (TREE_OPERAND (arg0, 1)) == REAL_CST
> +              && !HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg0))))
> +             || (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
> +                 && !TREE_OVERFLOW (TREE_OPERAND (arg0, 1))
> +                 && !TYPE_UNSIGNED (TREE_TYPE (arg1))
> +                 && !(flag_wrapv || flag_trapv)))
> +         && (TREE_CODE (arg1) == REAL_CST
> +             || (TREE_CODE (arg1) == INTEGER_CST
> +                 && !TREE_OVERFLOW (arg1))))
> +       {
>
> I think you need to be more conservative than this for REAL_CST.
> Consider the case where CST1 and CST2 are the same (so the difference 
> is
> zero) and X is much smaller than CST1.

I attached the wrong patch, I had meant to the following which already
removed the checks for REAL_CST.

Thanks,
Andrew Pinski

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050701/e41afa48/attachment.txt>


More information about the Gcc-patches mailing list