Re: [RFH] negate_expr_p bug?

2006-04-05 Thread Richard Guenther
On Mon, 3 Apr 2006, Roger Sayle wrote: On Mon, 3 Apr 2006, Richard Guenther wrote: || (TREE_CODE (type) == INTEGER_TYPE (TREE_CODE (arg1) == INTEGER_CST || TYPE_UNSIGNED (type) || (flag_wrapv !flag_trapv))) Does this

[RFH] negate_expr_p bug?

2006-04-03 Thread Richard Guenther
negate_expr_p currently contains switch (TREE_CODE (t)) { case INTEGER_CST: if (TYPE_UNSIGNED (type) || ! flag_trapv) return true; /* Check that -CST will not overflow type. */ return may_negate_without_overflow_p (t); where it looks bogus to simply return

Re: [RFH] negate_expr_p bug?

2006-04-03 Thread Roger Sayle
On Mon, 3 Apr 2006, Richard Guenther wrote: negate_expr_p currently contains ... where it looks bogus to simply return true for signed types but unset flag_trapv. ... which is bogus as it should read || (!flag_trapv flag_wrapv) - no? I hit this with a patch to fold A +- CST to A -+ CST

Re: [RFH] negate_expr_p bug?

2006-04-03 Thread Richard Guenther
On Mon, 3 Apr 2006, Roger Sayle wrote: On Mon, 3 Apr 2006, Richard Guenther wrote: negate_expr_p currently contains ... where it looks bogus to simply return true for signed types but unset flag_trapv. ... which is bogus as it should read || (!flag_trapv flag_wrapv) - no? I hit

Re: [RFH] negate_expr_p bug?

2006-04-03 Thread Roger Sayle
On Mon, 3 Apr 2006, Richard Guenther wrote: || (TREE_CODE (type) == INTEGER_TYPE (TREE_CODE (arg1) == INTEGER_CST || TYPE_UNSIGNED (type) || (flag_wrapv !flag_trapv))) Does this sound reasonable? Yes, this sounds