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] Negation related constant folding improvements


On Sun, Aug 10, 2003 at 10:04:31PM -0600, Roger Sayle wrote:
>       case INTEGER_CST:
> -     case REAL_CST:
>         if (! TREE_UNSIGNED (type)
>   	  && 0 != (tem = fold (build1 (NEGATE_EXPR, type, t)))
>   	  && ! TREE_OVERFLOW (tem))
>   	return tem;
>         break;
> 
> +     case REAL_CST:
> +       return fold (build1 (NEGATE_EXPR, type, t));

This is correct only if the fp representation is sign+magnitude.
This is not true of the C4X format.

Rounding problem pointed out upthread.


r~


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