Re: LRA: Fix setup_sp_offset

2024-08-27 Thread Michael Matz
Hello, On Mon, 26 Aug 2024, Paul Koning wrote: > >>> Yeah, I wondered as well. For things to go wrong some instructions that > >>> contain pre/post-inc/dec of the stack pointer need to have reloads in > >>> such > >>> a way that the actual SP-change sideeffect moves to a different > >>> inst

Re: LRA: Fix setup_sp_offset

2024-08-26 Thread Paul Koning
> On Aug 26, 2024, at 10:40 AM, Michael Matz wrote: > > Hello, > > On Mon, 26 Aug 2024, Paul Koning wrote: > > 550: [--sp] = 0 sp_off = 0 {pushexthisi_const} > 551: [--sp] = 37sp_off = -4 {pushexthisi_const} > 552: [--sp] = r37 sp_off = -8 {mo

Re: LRA: Fix setup_sp_offset

2024-08-26 Thread Michael Matz
Hello, On Mon, 26 Aug 2024, Paul Koning wrote: > >>> 550: [--sp] = 0 sp_off = 0 {pushexthisi_const} > >>> 551: [--sp] = 37sp_off = -4 {pushexthisi_const} > >>> 552: [--sp] = r37 sp_off = -8 {movsi_m68k2} > >>> 554: [--sp] = r116 - r37sp_off = -12 {su

Re: LRA: Fix setup_sp_offset

2024-08-26 Thread Paul Koning
> On Aug 26, 2024, at 10:14 AM, Michael Matz wrote: > > Hello, > > On Sun, 25 Aug 2024, Jeff Law wrote: > >>> 550: [--sp] = 0 sp_off = 0 {pushexthisi_const} >>> 551: [--sp] = 37sp_off = -4 {pushexthisi_const} >>> 552: [--sp] = r37 sp_off = -8 {movsi_m

Re: LRA: Fix setup_sp_offset

2024-08-26 Thread Michael Matz
Hello, On Sun, 25 Aug 2024, Jeff Law wrote: > >550: [--sp] = 0 sp_off = 0 {pushexthisi_const} > >551: [--sp] = 37sp_off = -4 {pushexthisi_const} > >552: [--sp] = r37 sp_off = -8 {movsi_m68k2} > >554: [--sp] = r116 - r37sp_off = -12 {subsi3} >

Re: LRA: Fix setup_sp_offset

2024-08-25 Thread Andreas Schwab
On Aug 25 2024, H.J. Lu wrote: > Is it because i386 pushes the return address on stack? Like m68k. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: LRA: Fix setup_sp_offset

2024-08-25 Thread H.J. Lu
On Sun, Aug 25, 2024 at 7:30 AM Jeff Law wrote: > > > > On 8/22/24 9:45 AM, Michael Matz wrote: > > This is part of making m68k work with LRA. See PR116429. > > In short: setup_sp_offset is internally inconsistent. It wants to > > setup the sp_offset for newly generated instructions. sp_offset

Re: LRA: Fix setup_sp_offset

2024-08-25 Thread Jeff Law
On 8/22/24 9:45 AM, Michael Matz wrote: This is part of making m68k work with LRA. See PR116429. In short: setup_sp_offset is internally inconsistent. It wants to setup the sp_offset for newly generated instructions. sp_offset for an instruction is always the state of the sp-offset right be

LRA: Fix setup_sp_offset

2024-08-22 Thread Michael Matz
This is part of making m68k work with LRA. See PR116429. In short: setup_sp_offset is internally inconsistent. It wants to setup the sp_offset for newly generated instructions. sp_offset for an instruction is always the state of the sp-offset right before that instruction. For that it starts at