extra: preserve hard_max after comparisons to zero
John Levon reported that if you had code like:
int lx_cap_mapping[4];
int i = 63;
if (i)
;
lx_cap_mapping[i] = 0;
The code should trigger a warning but it doesn't.
I initially thought the hard_max was getting lost in
merge_estates(). I changed that to say if we were merging an
impossible state with a possible one then we should keep the
hard max from the possible one. It turns out that wasn't
the issue, but I sort of think it's the correct thing to do
anyway.
The real problem is that we don't preserve the hard_max after
comparisons to zero, whether it's impossible or not. That is
handled in match_condition(). I changed that function to re-use
handle_comparison(). After that because the original "i" had a
hard_max then handle_comparison() sets the hard_max flag for
both the possible and the impossible sides.
Reported-by: John Levon <levon@movementarian.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>