On Thu, Dec 08, 2022 at 11:59:44AM +0100, Jose E. Marchesi via Gcc-patches 
wrote:
> gcc/ChangeLog
> 
>       * expr.cc (expand_expr_divmod): Avoid side-effects of trying
>       sequences involving funcalls in optimization.

That looks wrong.
The globals for mentioned calls just shouldn't be emitted during expansion,
especially if it is bigger annoyance than just having some extra symbols
in the symbol table.
expand_expr_divmod is definitely not the only place where something is
expanded and later not used, lots of other places in the expander do that,
and more importantly, there are over 80 optimization passes after expansion,
many of them can remove code determined to be dead, and while lots of dead
code is removed in GIMPLE optimizations already, definitely not all.
So, rather than add hacks for this in a single spot, much better is to emit
the globals only for stuff that is actually needed (so during final or
immediately before it).

        Jakub

Reply via email to