This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/54384] gfortran memory leaks


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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-27 18:52:29 UTC ---
(In reply to comment #0)
> With Polyhedron 2005's nf.f90:
> With Polyhedron 2005's capacita.f90:

Those are fixed by comment 3


> With Polyhedron 2005's capacita.f90 (and some more):

I think that's aermod.f90 not capacita.f90 - the latter has no leaks any more.


> With Polyhedron 2005's mdbx.f90:
>   by 0x57D7BF: gfc_get_expr() (expr.c:49)
>   by 0x57E123: gfc_copy_expr(gfc_expr*) (expr.c:272)
>   by 0x5C63EA: gfc_match_rvalue(gfc_expr**) (primary.c:2788)
>   by 0x56D3A2: match_data_constant(gfc_expr**) (decl.c:354)

Reduced test case:

      DIMENSION  cmul(3,7)
      PARAMETER (HALF=0.5D0,ONE=1.D0,TWO=2.D0,FOUR=4.D0,TWELVE=12.D0)
      PARAMETER (SQRT2=1.41421356237310D0,SQRT3=1.73205080756888D0,     &
     &           SQRT8=TWO*SQRT2,SQ8BY3=SQRT8/SQRT3,SQ4BY3=TWO/SQRT3,   &
     &           SQ16B3=FOUR/SQRT3)
      DATA cmul/SQRT2 , SQRT2 , SQRT2 , ONE , ONE , SQRT8 , ONE ,       &
     &     SQRT2 , TWO , ONE , SQRT3 , SQ8BY3 , ONE , SQRT3 , SQ8BY3 ,  &
     &     ONE , ONE , SQRT8 , SQ4BY3 , SQ4BY3 , SQ16B3/
      END

Not fixing this issue, but I think still required:

--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -142,2 +142,4 @@ create_character_initializer (gfc_expr *init, gfc_typespec
*ts,
       gfc_extract_int (end_expr, &end);
+      gfc_free_expr (start_expr);
+      gfc_free_expr (end_expr);
     }


> Also leaking, but I lost the overview whether those are already covered:
> doduc.f90.

Others still not tested, but doduc.f90 fails with:

  by 0x63624D: _ZL22gfc_conv_function_exprP6gfc_seP8gfc_expr.part.22
(trans-expr.c:4999)
  by 0x63951B: gfc_conv_expr_op(gfc_se*, gfc_expr*) (trans-expr.c:2158)
  by 0x63951B: gfc_conv_expr_op(gfc_se*, gfc_expr*) (trans-expr.c:2158)
  by 0x638553: gfc_conv_expr_val(gfc_se*, gfc_expr*) (trans-expr.c:5851)
  by 0x638620: gfc_conv_unary_op(tree_code, gfc_se*, gfc_expr*)
(trans-expr.c:1535)
  by 0x639AFF: gfc_conv_expr_op(gfc_se*, gfc_expr*) (trans-expr.c:2031)
  by 0x6394F6: gfc_conv_expr_op(gfc_se*, gfc_expr*) (trans-expr.c:2153)
  by 0x63C163: gfc_trans_assignment_1(gfc_expr*, gfc_expr*, bool, bool)
(trans-expr.c:7278)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]