https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
--- Comment #51 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #48) > This should also work too: > diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c > index ea8594db193..83b1d981439 100644 > --- a/gcc/tree-sra.c > +++ b/gcc/tree-sra.c > @@ -2499,6 +2499,7 @@ analyze_access_subtree (struct access *root, struct > access *parent, > For integral types this means the precision has to match. > Avoid assumptions based on the integral type kind, too. */ > if (INTEGRAL_TYPE_P (root->type) > + && TREE_CODE (root->type) != BOOLEAN_TYPE > && (TREE_CODE (root->type) != INTEGER_TYPE > || TYPE_PRECISION (root->type) != root->size) > /* But leave bitfield accesses alone. */ > > ---- CUT ---- Well, this re-introduces bug PR 52244 and makes the associated testcase fail. PR 52244 fix specifically aimed to disallow boolean replacements. (In reply to Jeffrey A. Law from comment #50) > Reassigning to Martin Jambor since the real fix is to avoid creating the > V_C_E in the first place. I hoped that changing SRA to emit a NOP_EXPR instead of V_C_E would help, but unfortunately it doesn't. I've been looking at this for the whole evening yesterday and ATM I do not see how I could avoid conversion without reintroducing PR 52244 (in the general case - this is another consequence of the fact that SRA is not flow sensitive).