[Bug rtl-optimization/82677] Many projects (linux, coreutils, GMP, gcrypt, openSSL, etc) are misusing asm(divq/divl) etc, potentially resulting in faulty/unintended optimisations
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 23 11:58:00 GMT 2017
- Previous message (by thread): [Bug inline-asm/82677] Many projects (linux, coreutils, GMP, gcrypt, openSSL, etc) are misusing asm(divq/divl) etc, potentially resulting in faulty/unintended optimisations
- Next message (by thread): [Bug rtl-optimization/82677] Many projects (linux, coreutils, GMP, gcrypt, openSSL, etc) are misusing asm(divq/divl) etc, potentially resulting in faulty/unintended optimisations
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82677
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-10-23
CC| |rguenth at gcc dot gnu.org
Component|inline-asm |rtl-optimization
Ever confirmed|0 |1
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
This is RTL invariant motion hoisting the non-volatile asm out of the loop even
though it is _not_ unconditionally executed.
I think it is against the spirit of asm()s to be treated this way. We're
handling possible NULL pointer dereferences correctly (just not in asm()s)
as well.
So I think LIM needs to be conservative with not always executed asm()s.
It's still safe to move the asm in
int main() {
ulong d = 0;
for (ulong i = 0; i < 3; i++)
for (ulong j = 0; j < 3; j++)
{
ulong r;
__asm__("" : "=r"(d) : "rm"((ulong)0));
udiv_qrnnd(q, r, 0, 0, (i << d));
}
}
thus without the if ().
- Previous message (by thread): [Bug inline-asm/82677] Many projects (linux, coreutils, GMP, gcrypt, openSSL, etc) are misusing asm(divq/divl) etc, potentially resulting in faulty/unintended optimisations
- Next message (by thread): [Bug rtl-optimization/82677] Many projects (linux, coreutils, GMP, gcrypt, openSSL, etc) are misusing asm(divq/divl) etc, potentially resulting in faulty/unintended optimisations
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Gcc-bugs
mailing list