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: [patch] Fix gcc.c-torture/execute/20000706-3.c for the v850


law@redhat.com wrote:

> > !         && (i == 2 || i >= 20 && (i < 30)))
>Where you trying to write
>A || (B && C)
>
>or 
>
>(A || B) && C
>
>It seems to me this should be
>
>  && (i == 2 || i >= 20)
>  && i < 30
>  
>
But i == 2 implies i < 30, therefore:

    && (i == 2 || i >= 20)
    && i < 30

is in fact equivalent to:

    && (i == 2 || i >= 20 && i < 30)

which, in turn, is also equivalent to (with redundant parentheses):

    && (i == 2 || i >= 20 && (i < 30))

right?
Paolo.





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