https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109641

            Bug ID: 109641
           Summary: Gfortran fails to overload intrinsic operator (*) if
                    operands are complex. It works with real ones.
           Product: gcc
           Version: og10 (devel/omp/gcc-10)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: adelson.oliveira at gmail dot com
  Target Milestone: ---

Created attachment 54929
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54929&action=edit
A small FORTRAN code to reproduce the bug

I'm uploading a small fortran code to show the problem. The code has a module
that overloads intrinsic operator (*) for a vector matrix multiplication. The
bug is triggered when the matrix (and the result) is complex.
The compilation with

$ gfortran -o teste -O teste.f90

will fail with a error message reporting inconsistent rank declaration.
As indicated in the snippet, simply changing  from COMPLEX to REAL in the
declaration of the matrix (and the result) everything goes fine.

As an additional information, if one changes from the intrinsic (*) to
something like (.MULT.) in the module then there is no error at all.

Please look for the comments in the MODULE TESTEOP and in the PROGRAM TESTE to
better test  the bug.

Thanks for any help

Reply via email to