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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to rguent...@suse.de from comment #7)
> > Now, as Richi's warning isn't in GCC 12, quickest/safest temporary fix 
> > would be
> > to revert to previous behavior for IF_STMT_CONSTEXPR_P and 
> > IF_STMT_CONSTEVAL_P,
> >  if (IF_STMT_CONSTEVAL_P (stmt))
> >    stmt = else_;
> >  else if (IF_STMT_CONSTEXPR_P (stmt))
> >    stmt = integer_nonzerop (cond) ? then_ ? else_;
> >  else
> >    stmt = build3 (COND_EXPR, void_type_node, cond, then_, else_);
> 
> I agree that reverting for GCC 12 is the most reasonable thing with adding a
> Testcase

The above isn't a full reversion, it keeps the normal if (which isn't
problematic) as is and just reverts behavior for the special const{expr,eval}
ifs.

Reply via email to