[Bug c++/106654] [C++23] P1774 - Portable assumptions

aldyh at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Sep 17 18:32:10 GMT 2022


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

--- Comment #11 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #10)

> > 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.

I see.  Ok, so yeah...I'm sure we can work something out.  When y'all have a
prototype representable in the IL, we'd be happy to enhance ranger to handle
it.  Sounds like something very useful, particularly for floats-- without
exposing signaling whathaveyous.

Maybe Andrew has some further thoughts here?


More information about the Gcc-bugs mailing list