[Bug tree-optimization/66512] PRE fails to optimize calls to pure functions in C++, ok in C
i at maskray dot me
gcc-bugzilla@gcc.gnu.org
Tue Nov 24 23:44:41 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66512
Fangrui Song <i at maskray dot me> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |i at maskray dot me
--- Comment #4 from Fangrui Song <i at maskray dot me> ---
Should this be reopened?
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html 'const' is
not clarified on its interaction with threads
(https://gcc.gnu.org/legacy-ml/gcc/2015-09/msg00365.html)
and
void f()
{
for (;;)
g(p());
}
is still pessimized for C++ (I tend to agree that 'const' should imply
'nothrow'; even if no, the #c2 case should be resolved properly)
More information about the Gcc-bugs
mailing list