Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-02-06 Thread Segher Boessenkool
Hi again, On Thu, Feb 06, 2020 at 08:51:06PM +0100, Jakub Jelinek wrote: > On Thu, Feb 06, 2020 at 01:15:25PM -0600, Segher Boessenkool wrote: > > On Thu, Jan 30, 2020 at 05:14:08PM +0100, Jakub Jelinek wrote: > > > Here is what I meant as the alternative, i.e. don't check any predicates, > > >

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-02-06 Thread Jakub Jelinek
On Thu, Feb 06, 2020 at 01:15:25PM -0600, Segher Boessenkool wrote: > On Thu, Jan 30, 2020 at 05:14:08PM +0100, Jakub Jelinek wrote: > > Here is what I meant as the alternative, i.e. don't check any predicates, > > just gen_add3_insn, if that fails, force rs into register and retry. > > I don't

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-02-06 Thread Segher Boessenkool
Hi! Sorry for dropping this once again. On Thu, Jan 30, 2020 at 05:14:08PM +0100, Jakub Jelinek wrote: > Here is what I meant as the alternative, i.e. don't check any predicates, > just gen_add3_insn, if that fails, force rs into register and retry. I don't like gen_add3_insn here *at all*, as

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-30 Thread Jakub Jelinek
On Thu, Jan 30, 2020 at 05:14:08PM +0100, Jakub Jelinek wrote: > On Wed, Jan 22, 2020 at 03:24:54PM +0100, Jakub Jelinek wrote: > > > It looks like your patch will pessimise code in some cases as well, btw? > > > > No, it will solely turn previous wrong-codes into something that works > > (==

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-30 Thread Jakub Jelinek
On Wed, Jan 22, 2020 at 03:24:54PM +0100, Jakub Jelinek wrote: > > It looks like your patch will pessimise code in some cases as well, btw? > > No, it will solely turn previous wrong-codes into something that works > (== cases where gen_addr3_insn would previously fail). > The 1)+2) variant could

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-22 Thread Jakub Jelinek
On Wed, Jan 22, 2020 at 08:06:03AM -0600, Segher Boessenkool wrote: > On Mon, Jan 06, 2020 at 09:24:10AM +0100, Jakub Jelinek wrote: > > 1) always use gen_add3_insn, but if it returns NULL use the extra > > emit_move_insn (end_addr, GEN_INT (-rounded_size)); > > and retry with end_addr instead of

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-22 Thread Segher Boessenkool
Hi! On Mon, Jan 06, 2020 at 09:24:10AM +0100, Jakub Jelinek wrote: > 1) always use gen_add3_insn, but if it returns NULL use the extra > emit_move_insn (end_addr, GEN_INT (-rounded_size)); > and retry with end_addr instead of rs > 2) if the first gen_add3_insn returned NULL or if it created more

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-22 Thread Jakub Jelinek
Hi! On Mon, Jan 06, 2020 at 02:46:30PM -0600, Segher Boessenkool wrote: > > > Another option would be to: > > > 1) always use gen_add3_insn, but if it returns NULL use the extra > > > emit_move_insn (end_addr, GEN_INT (-rounded_size)); > > > and retry with end_addr instead of rs > > > 2) if the

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-06 Thread Segher Boessenkool
On Mon, Jan 06, 2020 at 11:03:02AM -0700, Jeff Law wrote: > On Mon, 2020-01-06 at 09:24 +0100, Jakub Jelinek wrote: > > Hi! > > > > As mentioned in the PR, the following testcase ICEs because rs, while valid > > add_operand is not valid add_cint_operand and so gen_add3_insn fails, > > because it

Re: [PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-06 Thread Jeff Law
On Mon, 2020-01-06 at 09:24 +0100, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, the following testcase ICEs because rs, while valid > add_operand is not valid add_cint_operand and so gen_add3_insn fails, > because it doesn't meet the expander predicates. > > Fixed thusly,

[PATCH] Fix PowerPC -fstack-clash-protection -mprefixed-addr ICE (PR target/93122)

2020-01-06 Thread Jakub Jelinek
Hi! As mentioned in the PR, the following testcase ICEs because rs, while valid add_operand is not valid add_cint_operand and so gen_add3_insn fails, because it doesn't meet the expander predicates. Fixed thusly, bootstrapped/regtested on powerpc64{,le}-linux, ok for trunk? Another option would