https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
Roger Sayle changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
--- Comment #9 from CVS Commits ---
The master branch has been updated by Roger Sayle :
https://gcc.gnu.org/g:2578a3870ef849dc77e98796600181b64ae4fd61
commit r12-3623-g2578a3870ef849dc77e98796600181b64ae4fd61
Author: Roger Sayle
Date: Fri S
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
--- Comment #8 from Roger Sayle ---
Alternate patch proposed:
https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579378.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
Roger Sayle changed:
What|Removed |Added
CC||roger at nextmovesoftware dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
--- Comment #6 from Andrew Pinski ---
Here is a testcase which will hit the warning on all targets and not just ILP32
specific ones:
int
foo (_Bool x)
{
int v = 0;
return (v & ~1u) | (1u & (x << 0));
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
--- Comment #5 from Richard Biener ---
I think the warning should work on unfolded (un-narrowed) trees or
shorten_binary_op should from a INTEGER_TYPEd operation not create a
BOOLEAN_TYPEd one (but maybe simply build a unsigned int:1 for it)?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
--- Comment #4 from Jakub Jelinek ---
So, seems the binary context is result of shorten_binary_op, we see the
1L and (((int)x) << 0) operands of BIT_AND_EXPR, result_type is therefore long
int and shorten_binary_op uses convert to convert that (
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
Jakub Jelinek changed:
What|Removed |Added
Last reconfirmed||2021-09-08
Status|UNCONFIRM
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
Andrew Pinski changed:
What|Removed |Added
Target Milestone|--- |12.0
Summary|false int-in-b