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

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, the constness can be cast away without changing the effect of the rule.

Similar to the C++ rule we discussed in bug 80794 I feel that constness is an
underappreciated opportunity to generate better code in both languages.  I
agree that constness alone is not sufficient to rely on for optimization
because it can be cast away and the object modified, but in conjunction with
restrict in C and with other rules in C++ (as discussed in bug 80794) I think
it's worth looking into.

Reply via email to