Dear Tobias,

The patch is OK, but you may consider the following remarks:

(1) a comment before

+             c = gfc_simplify_conjg (a);

reminding the definition of the complex dot product.

(2) I don't like the scan-tree-dump: they are fragile and have a limited
coverage. I'ld prefer a test such as the following

! { dg-do run }
!
! PR fortran/57785
!
! Contributed by Kontantinos Anagnostopoulos
!
! The implicit complex conjugate was missing

if (DOT_PRODUCT ((/ (1.0, 2.0), (2.0, 3.0) /), (/ (1.0, 1.0), (1.0, 4.0) /))   &
   /= SUM (CONJG ((/ (1.0, 2.0), (2.0, 3.0) /))*(/ (1.0, 1.0), (1.0, 4.0) /))) &
   call abort ()
if (ANY (MATMUL ((/ (1.0, 2.0), (2.0, 3.0) /),                                 &
                 RESHAPE ((/ (1.0, 1.0), (1.0, 4.0) /),(/2, 1/))) /=           &
         SUM ((/ (1.0, 2.0), (2.0, 3.0) /)*(/ (1.0, 1.0), (1.0, 4.0) /))))     &
    call abort ()      
end

It checks that DOT_PRODUCT matches its definition (it will catch any attempt
to use CONJG on the second vector instead of the first). It also checks
that MATMUL works as expected.

Thanks for the patch,

Dominique

Reply via email to