http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49659

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-07-06 
12:01:59 UTC ---
> Strangely ifort outputs the same result, so it must be correct ...

Indeed! The standard says

7.1.3 Precedence of operators

1 There is a precedence among the intrinsic and extension operations
corresponding to the form of expressions speci ed in 7.1.2, which
determines the order in which the operands are combined unless the order is
changed by the use of parentheses.  This precedence order is summarized in
Table 7.2.  

Table 7.2:

Categories of operations and relative precedence

Category of operation   Operators           Precedence

Extension               defined-unary-op    Highest
Numeric                 **                  .
Numeric                 *, /                .
Numeric                 unary +, -          .
Numeric                 binary +, -         .
Character               //                  .
Relational              .EQ., .NE., .LT., 
                        .LE., .GT., .GE.,
                        ==, /=, <, <=, >, 
                        >=  .
Logical                 .NOT.               .
Logical                 .AND.               .
Logical                 .OR.                .
Logical                 .EQV., .NEQV.       .
Extension               defined-binary-op   Lowest

>From this table 'C.eq.4.and.M.eqv..FALSE.' is computed as
'((C.eq.4).and.M).eqv..FALSE)' which is .TRUE..

> (thus, your program is invalid).

The program is not invalid, but the reporter expectation is.

Reply via email to