[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-18 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245 Roger Sayle changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
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

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-14 Thread roger at nextmovesoftware dot com via Gcc-bugs
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

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-13 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245 Roger Sayle changed: What|Removed |Added CC||roger at nextmovesoftware dot com

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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)); }

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
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)?

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
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 (

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245 Jakub Jelinek changed: What|Removed |Added Last reconfirmed||2021-09-08 Status|UNCONFIRM

[Bug c/102245] [12 Regression] false int-in-bool-context warning with shift

2021-09-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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