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



Tobias Burnus <burnus at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

           Keywords|                            |wrong-code

             Status|UNCONFIRMED                 |NEW

   Last reconfirmed|                            |2013-04-28

                 CC|                            |burnus at gcc dot gnu.org

     Ever Confirmed|0                           |1



--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-04-28 
10:05:24 UTC ---

The following patch fixes the issue for the test case in comment 0:



--- a/gcc/fortran/trans-types.c

+++ b/gcc/fortran/trans-types.c

@@ -1182,3 +1165,3 @@ gfc_get_element_type (tree type)

       /* For arrays, which are not scalar coarrays.  */

-      if (TREE_CODE (element) == ARRAY_TYPE)

+      if (TREE_CODE (element) == ARRAY_TYPE && !TYPE_STRING_FLAG (element))

        element = TREE_TYPE (element);



* * *



Also failing is the following test case with "LEN=:" - it fails for arrays and

for (scalar) coarrays. The code looks fine, except that the string length is

never set. In the scalar version, one has:

  .greeting = 2

in the array/coarray version, one properly uses it - but it is never set.





  character(len=:,kind=1), allocatable :: greeting(:)

  allocate (character(len=2) :: greeting(1))

  end



* * *



The following item in trans-decl.c's gfc_get_symbol_decl probably requires an

||attr.codimension:



  if (sym->attr.dimension || sym->attr.allocatable || sym->attr.codimension

      || (sym->ts.type == BT_CLASS &&

          (CLASS_DATA (sym)->attr.dimension

Reply via email to