https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61775

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #7 from kargl at gcc dot gnu.org ---
I think that this is now fixed on trunk.  Don't know which patch.

% gfcx -o z a.f90 && ./z
   10000.0000    
% gfcx -o z a.f90 -O2 -fcheck=all && ./z
   10000.0000    
% valgrind ./z
==85120== Memcheck, a memory error detector
==85120== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==85120== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==85120== Command: ./z
==85120== 
   10000.0000    
==85120== 
==85120== HEAP SUMMARY:
==85120==     in use at exit: 0 bytes in 0 blocks
==85120==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==85120== 
==85120== All heap blocks were freed -- no leaks are possible
==85120== 
==85120== For counts of detected and suppressed errors, rerun with: -v
==85120== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

I've read the tree dump for -fdump-tree-optimized and it appears to
do the right think with expanding the constructor, allocating, and
freeing memory.

Both 6-branch and 7-branch still fail
% gfc6 -o z a.f90 -O2 -fcheck=all && ./z
 Segmentation fault (core dumped)
% gfc7 -o z a.f90 -O2 -fcheck=all && ./z
Segmentation fault (core dumped)

I would like to close this as fixed after committing the following
testcase

        program pi
        real   , allocatable :: x(:)
        integer              :: n
        n  = 10000
        x = [ (i,i=1,n) ]
        if (x(n) /= 10000) stop 1
        end

Reply via email to