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

Re: [committed] clarify sleu_operand


Eric Christopher <echristo@redhat.com> writes:
>  (define_predicate "sleu_operand"
> -  (and (match_operand 0 "sle_operand")
> -       (match_test "INTVAL (op) + 1 != 0")))
> +  (and (match_code "const_int")
> +       (match_test "IN_RANGE ((INTVAL (op) + 1), 0, 32767)")))

Um, this doesn't do the same thing at all.  Please revert.

The point of the original is to exclude comparisons against ~0U,
which can't be done, because we implement X <= C as X < (C + 1).
That obviously isn't the same thing when C + 1 carries.  Your patch
now _allows_ comparisons against ~0U, and so from that point of view,
it's a correctness regression.

On the other hand, comparisons against ~2U are fine, and aren't
allowed after your change.  From that point of view it's a
performance regression too.

Richard


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