On Sat, Nov 02, 2019 at 10:14:15AM -0600, Jeff Law wrote:
> On 11/2/19 9:51 AM, Georg-Johann Lay wrote:
> > Segher Boessenkool schrieb:
> >>> Btw, does GCC support clobbering registers in branches (or
> >>> cbranch<mode>4 for that matter)?  This requirement would come up when
> >>> transitioning avr to cc_mode because cbranches would live post reload.
> >>
> >> Of course.  You cannot have *reloads* on branches, that is all.

Sigh.  *Output reloads*, sorry for dropping a crucial word here :-/

> > Does this also apply to input reloads?
>
> This should work in the LRA world just fine.  The problems are with
> output reloads, not input reloads.

In the old reload world as well.  Only output reloads are a problem.

> With an output reload on a branch you have to emit the reload at the
> target(s) of the branch as well as the fallthru path (if one exists).

Or you can do something *before* the branch, but that is different for
every case, and harder to do anyway.

If you insert the reloads at the jump target, you'll need to make a
separate predecessor of the jump target and insert the reload *there*,
if we aren't the only predecessor of that target.

> In theory we could do this for simple branches, but for indirects it'd
> be virtually impossible.

Yup.  Luckily most branches with outputs are not indirect branches.

I would love if this problem was fixed once and for all (I only care
about LRA here of course).


Segher

Reply via email to