https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
--- Comment #6 from Andrew Pinski ---
*** Bug 115287 has been marked as a duplicate of this bug. ***
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
--- Comment #5 from XChy ---
(In reply to Jakub Jelinek from comment #4)
> So, e.g. on x86_64,
> unsigned int
> f1 (unsigned val)
> {
> return val / 10 * 16 + val % 10;
> }
>
> unsigned int
> f2 (unsigned val)
> {
> return val / 10 * 6 +
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
--- Comment #4 from Jakub Jelinek ---
So, e.g. on x86_64,
unsigned int
f1 (unsigned val)
{
return val / 10 * 16 + val % 10;
}
unsigned int
f2 (unsigned val)
{
return val / 10 * 6 + val;
}
unsigned int
f3 (unsigned val, unsigned a,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
--- Comment #2 from XChy ---
(In reply to Jakub Jelinek from comment #1)
> When it is signed v / a * b + v % a, I think it can introduce UB which
> wasn't there originally.
> E.g. for v = 0, a = INT_MIN and b = 3. So, if it isn't done just for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
--- Comment #1 from Jakub Jelinek ---
When it is signed v / a * b + v % a, I think it can introduce UB which wasn't
there originally.
E.g. for v = 0, a = INT_MIN and b = 3. So, if it isn't done just for unsigned
types,
parts of it need to be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105
Andrew Pinski changed:
What|Removed |Added
Keywords||missed-optimization