------- Comment #3 from burnus at gcc dot gnu dot org  2007-04-24 19:58 -------
> > This example is not valid. As NAG f95 claims:
> it is not supposed to be a runable example
Well, for hunting miscompilation bugs, a runable example helps.

I think there are at leastfour problems:

a) The program misses something like:
        allocate(ncoset(lb_min_set-1:lb_max_set))
        ncoset = 1
- or as you have suggested - overlap may not be PRIVATE
otherwise the program is it not valid.

b) Since the program is invalid if pad is not present, I added:
        if(.not.present(pab)) return
(similarly for force_a)

c) gfortran should detect that the local variable ncoset is never allocated -
as NAG f95 does:
Error: foo.f90, line 45: ALLOCATABLE array NCOSET used but never ALLOCATEd

d) gfortran give the wrong warning about offset.9 being uninitialized.
It is initialized if pad is present and if it isn't, this variable is not
accessed as I explicitly use: "if(.not.present(pab)) return"

For (d) I filled the middle-end PR 31688.

I still miss the place where gfortran miscompiles (if any).


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org


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

Reply via email to