On 11/5/23 11:47, Richard Sandiford wrote:
optimize_mode_switching passes an entity's current mode (if known)
to the emit hook.  However, the mode that it passed ignored the
effect of the after hook.  Instead, the mode for the first emit
call in a block was taken from the incoming mode, whereas the
mode for each subsequent emit call was taken from the result
of the previous call.

The previous pass through the insns already calculated the
correct mode, so this patch records it in the seginfo structure.
(There was a 32-bit hole on 64-bit hosts, so this doesn't increase
the size of the structure for them.)

gcc/
        * mode-switching.cc (seginfo): Add a prev_mode field.
        (new_seginfo): Take and initialize the prev_mode.
        (optimize_mode_switching): Update calls accordingly.
        Use the recorded modes during the emit phase, rather than
        computing one on the fly.
OK
jeff

Reply via email to