This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/23666] Fold does not reduce C - ~a into a + (C+1)
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2006 15:12:41 -0000
- Subject: [Bug middle-end/23666] Fold does not reduce C - ~a into a + (C+1)
- References: <bug-23666-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from rguenth at gcc dot gnu dot org 2006-10-22 15:12 -------
With the patch for 23295 we get the behavior as noted in comment #7. This is
due
to negate_expr_p (correctly) containing
case BIT_NOT_EXPR:
return INTEGRAL_TYPE_P (type)
&& (TYPE_UNSIGNED (type)
|| (flag_wrapv && !flag_trapv));
as negating ~7ffffff will result in signed overflow which is undefined without
flag_wrapv.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23666