Skip to content
Snippets Groups Projects
Commit acbfb8b9 authored by Andrew Pinski's avatar Andrew Pinski
Browse files

expr: catch more `a*bool` while expanding [PR 112935]


After r14-1655-g52c92fb3f40050 (and the other commits
which touch zero_one_valued_p), we end up with a with
`bool * a` but where the bool is an SSA name that might not
have non-zero bits set on it (to 0x1) even though it
does the non-zero bits would be 0x1.
The case of coremarks, it is only phiopt4 which adds the new
ssa name and nothing afterwards updates the nonzero bits on it.
This fixes the regression by using gimple_zero_one_valued_p
rather than tree_nonzero_bits to match the cases where the
SSA_NAME didn't have the non-zero bits set.
gimple_zero_one_valued_p handles one level of cast and also
and an `&`.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

	PR middle-end/112935
	* expr.cc (expand_expr_real_2): Use
	gimple_zero_one_valued_p instead of tree_nonzero_bits
	to find boolean defined expressions.

Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
parent eea25179
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment