On Wed, 18 Nov 2026, Uros Bizjak wrote:

> The register stack conversion pass is used only by x86 (STACK_REGS is
> defined only by the i386 port, for the x87 register stack), so make it
> a part of that port.
> 
> The pass is no longer registered in the generic pipeline.  Instead,
> i386-passes.def inserts pass_split_before_regstack and
> pass_stack_regs after pass_sched2, which preserves the pass order
> on x86.  The old pass_stack_regs only served as a STACK_REGS gate and a
> container for these two passes, so remove it and rename
> pass_stack_regs_run to pass_stack_regs.
> 
> No functional change.
> 
> Assisted-by: Claude Sonnet 5.5
> 
> gcc/ChangeLog:
> 
> * reg-stack.cc: Move to config/i386/i386-reg-stack.cc.
> * config/i386/i386-reg-stack.cc: New file, moved from reg-stack.cc.
> Include tm_p.h.  Remove STACK_REGS conditionals.
> (regstack_completed): Make bool.
> (rest_of_handle_stack_regs): Update.
> (pass_data_stack_regs, pass_stack_regs)
> (make_pass_stack_regs): Remove the old gating pass.
> (pass_data_stack_regs_run, pass_stack_regs_run)
> (make_pass_stack_regs_run): Rename to pass_data_stack_regs,
> pass_stack_regs and make_pass_stack_regs.
> * Makefile.in (OBJS): Remove reg-stack.o.
> (GTFILES): Remove reg-stack.cc.
> * config.gcc (extra_objs) <i[34567]86-*-* | x86_64-*-*>:
> Add i386-reg-stack.o.
> * config/i386/t-i386 (i386-reg-stack.o): New rule.
> * config/i386/i386-passes.def (pass_split_before_regstack)
> (pass_stack_regs): Insert after pass_sched2.
> * config/i386/i386-protos.h (make_pass_stack_regs): Declare.
> * passes.def (pass_stack_regs, pass_split_before_regstack)
> (pass_stack_regs_run): Remove.
> * tree-pass.h (make_pass_stack_regs)
> (make_pass_stack_regs_run): Remove.
> * cfgcleanup.cc (old_insns_match_p): Update comment.
> * ira-build.cc (loop_with_complex_edge_p): Update comment.
> * rtl.h (regstack_completed): Make bool.  Update comment.
> * final.cc (rest_of_clean_state): Update.
> * config/i386/i386.h (STACK_REGS): Ditto.
> * doc/passes.texi (RTL passes): Remove
> Register-to-stack conversion item.
> * doc/tm.texi.in (Stack Registers): Remove advice
> on porting the stack register pass to a new architecture.
> (STACK_REG_COVER_CLASS): Remove.
> * doc/tm.texi: Regenerate.
> 
> Bootstrapped and regression tested on x86_64-linux-gnu, and checked
> that cc1 and cc1plus build for alpha-linux-gnu.
> 
> This patch is a pure move of the x87-only reg-stack pass into the i386
> port with no functional change (pass order on x86 is unchanged),
> bootstrapped and regression tested on x86_64-linux-gnu, with cc1 and
> cc1plus also built for alpha-linux-gnu. I know it is not a stage 3
> fix, so may I have an exception from the release managers, or else I
> will hold it for the next stage 1?

I'm OK with it, please give others a day or so to voice different
opinions.

Richard.

-- 
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri; (HRB 36809, AG Nuernberg)

Reply via email to