[Bug fortran/31608] New: wrong types in array transfer

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Apr 17 16:22:00 GMT 2007


gfortran.dg/achar_4.f90 generates the following snippet of original trees:

    {
      int8 S.5;

      S.5 = 0;
      while (1)
        {
          if (S.5 > (D.1394 + 0) - 1) goto L.1;
          {
            char char.6;

            char.6 = (*(char[0:][1:1] *) atmp.0.data)[S.5][1]{lb: 1 sz: 1} +
224;
            (*(char[0:][1:1] *) atmp.4.data)[S.5] = *(_gfortran_compare_string
(D.1384, &(*(char[0:][1:1] *) atmp.2.data)[S.5], 1, "a") >= 0 &&
_gfortran_compare_string (D.1393, &(*(char[0:][1:1] *) atmp.3.data)[S.5], 1,
"z") <= 0 ? &char.6 : &(*(char[0:][1:1] *) atmp.1.data)[S.5]);
          }
          S.5 = S.5 + 1;
        }
      L.1:;
    }

which clearly has mismatched types in the two arms of the COND_EXPR

  .... = .... ? &char.6 : &(*(char[0:][1:1] *) atmp.1.data)[S.5])

the then arm is of type char* while the else arm has pointer to array type.

This confuses the middle-end.


-- 
           Summary: wrong types in array transfer
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list