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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Here's output from the uninitialized pass patched to show in more detail what's
going on.  Cycles can contribute to false positives.  The chain length greater
messages also show possible reasons for false positives in an unpatched GCC
(the patched pass raises the limits to avoid them).  The note after the warning
shows the condition under which GCC determines the uninitialized variable is
used (it needs improvement).

Examining phi: cmd1_68 = PHI <cmd1_44(5), cmd1_12(4)>
cycle detected
cycle detected
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
cycle detected
predicate::predicate (def_bb = 6, use_bb = 3, func_t) initialized from 9
dep_chains:
        24 -> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 32 
24 -> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 18 
24 -> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 19 
24 -> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 32 
24 -> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 18 
24 -> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 19 
24 -> 8, 8 -> 10, 10 -> 13, 13 -> 30, 14 -> 15, 15 -> 32 
24 -> 8, 8 -> 10, 10 -> 13, 13 -> 30, 14 -> 15, 15 -> 18 
24 -> 8, 8 -> 10, 10 -> 13, 13 -> 30, 14 -> 15, 15 -> 19 
init_from_control_deps { { 24 -> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 32 }, { 24
-> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 18 }, { 24 -> 8, 8 -> 9, 9 -> 26, 14 ->
15, 15 -> 19 }, { 24 -> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 32 }, {
24 -> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 18 }, { 24 -> 8, 8 -> 10,
10 -> 11, 11 -> 27, 14 -> 15, 15 -> 19 }, { 24 -> 8, 8 -> 10, 10 -> 13, 13 ->
30, 14 -> 15, 15 -> 32 }, { 24 -> 8, 8 -> 10, 10 -> 13, 13 -> 30, 14 -> 15, 15
-> 18 }, { 24 -> 8, 8 -> 10, 10 -> 13, 13 -> 30, 14 -> 15, 15 -> 19 } }:
        (empty)
Found unguarded use in bb 3: cmd1_12 = PHI <cmd1_68(3), cmd1_19(D)(2)>
cycle detected
cycle detected
cycle detected
cycle detected
cycle detected
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
cycle detected
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
chain length greater than 5: 6
cycle detected
cycle detected
cycle detected
predicate::predicate (def_bb = 6, use_bb = 20, func_t) initialized from 3
dep_chains:
        24 -> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 20 
24 -> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 20 
24 -> 8, 8 -> 10, 10 -> 13, 13 -> 30, 14 -> 15, 15 -> 20 
init_from_control_deps { { 24 -> 8, 8 -> 9, 9 -> 26, 14 -> 15, 15 -> 20 }, { 24
-> 8, 8 -> 10, 10 -> 11, 11 -> 27, 14 -> 15, 15 -> 20 }, { 24 -> 8, 8 -> 10, 10
-> 13, 13 -> 30, 14 -> 15, 15 -> 20 } }:
        ((((MEM[(const char *)input_27 + -1B] != 101 && MEM[(const char
*)input_27 + -1B] <= 101) && MEM[(const char *)input_27 + -1B] == 50) &&
MEM[(const char *)input_74 + 1B] == 10) && _72 == 101 || ((((MEM[(const char
*)input_27 + -1B] != 101 && MEM[(const char *)input_27 + -1B] > 101) &&
MEM[(const char *)input_27 + -1B] <= 115) && MEM[(const char *)input_27 + -1B]
> 112) && MEM[(const char *)input_74 + 1B] == 10) && _72 == 101) ||
((((MEM[(const char *)input_27 + -1B] != 101 && MEM[(const char *)input_27 +
-1B] > 101) && MEM[(const char *)input_27 + -1B] > 115) && MEM[(const char
*)input_27 + -1B] == 118) && MEM[(const char *)input_74 + 1B] == 10) && _72 ==
101 (expanded)
        OR (AND (NOT (_2 == 101), NOT (_2 > 101), _2 == 50, _4 == 10, _72 ==
101), AND (NOT (_2 == 101), _2 > 101, NOT (_2 > 115), _2 > 112, _4 == 10, _72
== 101), AND (NOT (_2 == 101), _2 > 101, _2 > 115, _2 == 118, _4 == 10, _72 ==
101))
collect_phi_def_edges for cd_root 4 and cmd1_68 = PHI <cmd1_44(5), cmd1_12(4)>
        Found def edge 5 -> 6 for cd_root 4 and operand 0 of: cmd1_68 = PHI
<cmd1_44(5), cmd1_12(4)>
        Found def edge 3 -> 4 for cd_root 2 and operand 0 of: cmd1_12 = PHI
<cmd1_68(3), cmd1_19(D)(2)>
Found unguarded use in bb 20: _21 = cmd1_68 == 0;
pr101770.c: In function ‘edit’:
pr101770.c:50:18: warning: ‘cmd1’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   50 |           return !cmd1;
      |                  ^~~~~
pr101770.c:7:11: note: used when ‘*(input+-1) != 'e' && *(input+-1) <= 'e' &&
*(input+-1) == '2' && input[1] == 10 && _72 = PHI <118(30), 50(26), _2(27)> ==
'e' || *(input+-1) != 'e' && *(input+-1) > 'e' && *(input+-1) <= 's' &&
*(input+-1) > 'p' && input[1] == 10 && _72 = PHI <118(30), 50(26), _2(27)> ==
'e' || *(input+-1) != 'e' && *(input+-1) > 'e' && *(input+-1) > 's' &&
*(input+-1) == 'v' && input[1] == 10 && _72 = PHI <118(30), 50(26), _2(27)> ==
'e'’
    7 |       int cmd1;
      |           ^~~~
pr101770.c:7:11: note: ‘cmd1’ was declared here

Reply via email to