This is the mail archive of the gcc-bugs@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]

[Bug middle-end/23666] Fold does not reduce C - ~a into a + (C+1)



------- 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


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