https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115273
--- Comment #4 from Andrew Pinski ---
Note ubsan can detect (correctly) a different undefined behavior since GCC 13
(since r13-4988-g8692b15ae7c05e; aka PR108256) but the undefinedness of passing
0 to ctz is still not detected and that is a dup
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115273
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|UNCONFIRME
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115273
--- Comment #2 from Andrew Pinski ---
Reduced testcase:
```
int f(int a)
{
return __builtin_ctz(a) == 0;
}
int main(void)
{
__builtin_printf("%d\n", f(0));
}
```
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115273
Richard Biener changed:
What|Removed |Added
Target Milestone|--- |12.4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115273
--- Comment #1 from Bi6c ---
Created attachment 58306
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58306&action=edit
preprocessed file