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 tree-optimization/81346] Missed constant propagation into comparison


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346

--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> ---
I think always using an unsigned type for the range check would be simpler. If
we try to check that x>=INT_MIN+2 && x<=INT_MAX-2 with -fwrapv, int is still
not a suitable type in which to do x-(INT_MIN+2)<=INT_MAX-2-(INT_MIN+2), while
the issue doesn't exist with an unsigned type.
I notice you call build_range_check in GENERIC (and new code for GIMPLE). Is
that temporary until match.pd can optimize range checks?
Do we want :s on trunc_div?

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