[Bug libstdc++/78420] [6/7/8 Regression] std::less<T*> is not a total order with -O2 enabled

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 14 09:45:00 GMT 2018


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

--- Comment #30 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess we'd need to add the full set, i.e. bool
__builtin_{less,less_equal,greater,greater_equal}, because e.g. floating point
comparisons are in some compilation modes sensitive to what exact operation it
is.
I think implementing those shouldn't be that hard, just if the arguments aren't
type dependent do a cp_build_binary_op with the arguments and if it returns a
pointer comparison, take it appart and stick the new arguments back into the
builtin.  Then in constexpr handling handle those like pointer comparisons and
in genericization genericize into comparison of the pointers casted to
uintptr_t.

If Jason is ok with that and if you don't see other way to implement this
properly, I can try to implement that.


More information about the Gcc-bugs mailing list