Remove single-store shortcut
commit64c9129b5beee61f0a311556259d97d7e56d2879
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Mon, 7 Aug 2017 13:36:22 +0000 (7 15:36 +0200)
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Fri, 11 Aug 2017 14:24:13 +0000 (11 16:24 +0200)
tree24bb3b50e2484150b74caed7f4bed7a23a4c352d
parentd9ff34f2e0d52351ec9e5c5b33002b7be3937123
Remove single-store shortcut

Current sparse code doesn't handle very gracefully
code with undefined pseudos. These can occurs, of
course because the dev has not initialize them,
maybe by error, but they can also occurs when they
are only set (and used) in a single path or even worse,
hen initiializing a bitfield.

The origin of the problem is the single store shortcut
in simplify_one_symbol() which doesn't take in account
the (absence of) dominance when loads exist without
stores.

Fix this by removing this single-store shortcut and leave
all the work for the general case which handle this
situation quite well (and/but set those variables to 0).

Warning: this change impact the performance (but not too much)

Note: This patch will also avoid internal infinite loops
      occuring when processing undefined vars present
      during the SSA construction.
Note: This patch will not avoid all similar problems
      because they can also be created after the SSA
      construction, for example when processing code
      that really is unreachable (then, typically, some
      of the involved pseudos are, in fact, not defined).
      It shouldn't be a problem since the code is
      unreachable. But if we process the code anyway
      (possibly because we simply don't know that the
      code is unreachable) then we create the same situation
      with the same consequences.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
flow.c
validation/infinite-loop0.c