This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -funswitch-loops not effective?
Richard Guenther <richard.guenther@gmail.com> wrote:
> Of course, this doesn't say where there is the well-formed
> leak of a pointer to the const member in the class in the first
> place:
>
> class Foo {
> public:
> Foo(bool b) : flag(b) {}
> bool get() const { return flag; }
> private:
> const bool flag;
> };
>
> Is there a well-formed way to write to Foo::flag? Couldn't we
> detect that there isn't one?
I don't know of any. I do not agree with Andrew's objection to the missing
optimization which prompted your original post either, so I suggest you to
file one (or two?) bugreports about these issues.
--
Giovanni Bajo