------- Comment #1 from burnus at gcc dot gnu dot org  2010-02-16 11:14 -------
Confirm. (Compiles with NAG, ifort, g95; fails with gfortran 4.3/4.4/4.5.)

Though, I think this is a duplicate of PR 42851, based on the location.

Valgrind shows:

 Invalid read of size 8
    at 0x55FAF5: gfc_trans_pointer_assignment (trans-expr.c:4775)
    by 0x540975: trans_code (trans.c:1099)
    by 0x55A16E: gfc_generate_function_code (trans-decl.c:4373)

The issue occurs for:
          if (expr1->symtree->n.sym->attr.subref_array_pointer)
[...]
              gfc_add_modify (&lse.post, GFC_DECL_SPAN(decl), tmp);


Note: The BIND(...) line needs to moved back to the SUBROUTINE line - otherwise
the code is invalid.

Note 2: If one does not move the line back, one gets also an ICE - first there
are a bunch of ERROR messages, followed by
  f951: internal compiler error: Segmentation fault
The output (compiler under valgrind) is:

test.f90:27.66:

    CALL odessa_segment_all(vector%value,od_ig,itype,isize,n,n1,p)
                                                                  1
==18265== Invalid read of size 8
==18265==    at 0x4C8CB6: show_locus (error.c:271)
==18265==    by 0x4C8B8E: error_print (error.c:626)
==18265==    by 0x4C94C6: gfc_error (error.c:881)
==18265==    by 0x511767: resolve_global_procedure (resolve.c:1790)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |42851
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   GCC host triplet|linux i686                  |
           Keywords|                            |error-recovery, ice-on-
                   |                            |invalid-code, ice-on-valid-
                   |                            |code
      Known to fail|                            |4.4.2 4.5.0 4.3.4
   Last reconfirmed|0000-00-00 00:00:00         |2010-02-16 11:14:49
               date|                            |


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

Reply via email to