https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116409
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I have a quick fix which just limits to const builtins (rather than pure). The expanded change to handle more than const functions will happen later.