http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57354
--- Comment #1 from Vladimir Fuka <vladimir.fuka at gmail dot com> --- valgrind ./a.out ==17600== Memcheck, a memory error detector ==17600== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==17600== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==17600== Command: ./a.out ==17600== ==17600== Invalid read of size 4 ==17600== at 0x4012A0: MAIN__ (realloc.f90:15) ==17600== by 0x40159A: main (realloc.f90:22) ==17600== Address 0x5c4e4a0 is 0 bytes inside a block of size 4 free'd ==17600== at 0x4C2AF6C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==17600== by 0x401181: MAIN__ (realloc.f90:15) ==17600== by 0x40159A: main (realloc.f90:22) ==17600== 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ==17600== ==17600== HEAP SUMMARY: ==17600== in use at exit: 0 bytes in 0 blocks ==17600== total heap usage: 5,372 allocs, 5,372 frees, 116,676 bytes allocated ==17600== ==17600== All heap blocks were freed -- no leaks are possible ==17600== ==17600== For counts of detected and suppressed errors, rerun with: -v ==17600== ERROR SUMMARY: 4950 errors from 1 contexts (suppressed: 2 from 2)