The expression “a.eq.b” is valid. However, the expression returns an array of logicals which can’t be used in an if statement. Adding the ‘all’ intrinsic to perform a reduction should get the desired behavior:
% cat tmp.f90
real :: a(4),b(4)
if (all(a.eq.b)) write (6,*) "a and b are the same"
% pgf90 tmp.f90
a and b are the same