https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487

--- Comment #38 from Leo Yuriev <leo at yuriev dot ru> ---
(In reply to Richard Biener from comment #37)
> Just pasting here what I said in the review:
>
> ...
> 
> So indeed WONTFIX (IMO) as very initially suggested.

I agree that in many cases it’s indeed better not to use these attributes,
except in two situations:
 - in an API at the DSO boundary — there’s simply no other way to convey
information about pure/const to the calling code;
 - in similar cases at the module boundary, when LTO is too
expensive/unjustified.

And while your logic is not devoid of sound rationality and pragmatism, it
seems to me that you haven’t taken into account the specific cases of using
const/pure attributes that I mentioned.

--

The first time I came across this issue >20 years ago, when the attributes
first appeared, I decided to use them, mechanically made a mistake in one place
out of ~30, spent the whole weekend debugging and went to bugzilla to add a bug
to the optimizer...

The other day, I mixed up pure/const again (mostly due to my deteriorating
eyesight), and I even got as far as adding a bug, but in response, someone
pointed out my mistake and then mentioned that there was such an PR.

Surprised that this trivial issue hadn’t been fixed in 20+ years and that
several people had stumbled over it, I simply decided to close the gestalt ;)

Reply via email to