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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 62873
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62873&action=edit
gcc16-pr122185.patch

You can't provide a valid testcase for this, because it can only ICE on invalid
ones.  In particular the -ffold-simple-inlines code was just assuming standard
conforming std::move, std::forward, std::forward_like, std::addressof,
std::as_const, std::to_underlying and std::__addressof with same behavior as
std::addressof.
The INDIRECT_TYPE_P && INDIRECT_TYPE_P check was actually correct before for
preventing folding (and possibly ICEs or weird stuff) on invalid definitions of
these.  Now, std::to_underlying doesn't satisfy that and guess that is why it
was removed, in that case it wants to convert ENUMERAL_TYPE to INTEGRAL_TYPE_P.
So, this patch checks that too.

Reply via email to