https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91442
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-08-14 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- test () { integer(kind=8) .string; character(kind=1)[1:.string] * string; string = 0B; { integer(kind=8) D.3904; integer(kind=8) D.3905; if (string != 0B) goto L.1; string = (character(kind=1)[1:.string] *) __builtin_malloc (12); goto L.2; L.1:; if (.string == 12) goto L.2; string = (character(kind=1)[1:.string] *) __builtin_realloc ((void *) string, 12); L.2:; .string = 12; see how we run into L.1 testing .string which was not set? At -O0 we didn't figure we never execute this path. I suggest to initialize .string to zero? The early warning pass sees (conditionally executed) <bb 4> : if (.string_11(D) == 12) goto <bb 6>; [INV] else goto <bb 5>; [INV] thus the "may" warning. Alternatively just elide this check.