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

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Aldy Hernandez from comment #9)
> So...could we keep doing what we're doing for non side-effect code, and only
> do the outline function for side-effect stuff?  Or is that too much to ask?

Yes, that's what Jakub proposed in comment #4.

> But wait a minute, is calling a non-const function from [[assume]] even
> allowed?

Yep, that's the tricky part.  Of course, as functions get more complicated, the
compiler being able to do anything useful with it gets less likely.  It seems
entirely reasonable to start with calls to functions that the compiler knows
are const even if they aren't declared with the attribute.

Reply via email to