https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69892
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69892
Manuel López-Ibáñez changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69892
--- Comment #4 from Marc Glisse ---
The example in comment #3 shows a missed optimization:
if (valid_3(D) != 0)
could be optimized to if(true) or if(false), whichever is most convenient
(__builtin_unreachable() might also be a possibility).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69892
--- Comment #3 from Markus Trippelsdorf ---
Well, gcc warns without the assignment in the loop, e.g.:
markus@x4 tmp % cat bool_.ii
int a;
int main() {
bool valid;
while (valid) {
a++;
// valid = false;
}
if (a != 1)
__builtin_
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69892
--- Comment #2 from Marc Glisse ---
(In reply to Marc Glisse from comment #1)
> On the other hand, pass_early_warn_uninitialized is before that, and should
> have warned, not sure why it failed...
Ah, no, it is only the late pass that looks at P
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69892
--- Comment #1 from Marc Glisse ---
:
# valid_1 = PHI
if (valid_1 != 0)
goto ;
else
goto ;
:
valid_3 = 0;
goto ;
CCP notices that valid_1 is either undefined or 0 and simplifies it to 0. There
are several PRs where CCP pr