[Bug fortran/52921] With realloc-lhs: Conditional jump or move depends on uninitialised value

mikael at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 18 09:41:00 GMT 2015


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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #1)
> I already get the valgrind warning
>    Conditional jump or move depends on uninitialised value(s)
> for
>         MY_ARR%ARR(I)%CMP = [1, 2]
> even without any optimization.
> 
> (I replaced the READ by an assignment and marked "i" as VOLATILE.)

No error here using the following program; FIXED?

      PROGRAM QUICK_TEST

      TYPE COMP
        INTEGER, ALLOCATABLE :: CMP(:)
      END TYPE COMP
      TYPE COMP_ARRAY
        TYPE (COMP), ALLOCATABLE :: ARR(:)
      END TYPE COMP_ARRAY

      INTEGER, VOLATILE :: I
      TYPE (COMP_ARRAY), TARGET :: MY_ARR

      I=10
      ALLOCATE (MY_ARR%ARR(I))
      MY_ARR%ARR(I)%CMP = [1, 2]

      END PROGRAM QUICK_TEST



More information about the Gcc-bugs mailing list