Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-07 Thread Alan Modra
On Mon, Jan 07, 2019 at 12:10:38PM +, Richard Sandiford wrote: > Alan Modra writes: > > +/* Given an attribute value expression, return the maximum value that > > + might be evaluated assuming all conditionals are independent. > > + Return INT_MAX if the value can't be calculated by this f

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-07 Thread Richard Sandiford
Alan Modra writes: > On Fri, Jan 04, 2019 at 12:18:03PM +, Richard Sandiford wrote: >> Alan Modra writes: >> > On Thu, Jan 03, 2019 at 07:03:59PM +, Richard Sandiford wrote: >> >> Richard Sandiford writes: >> >> > This still seems risky and isn't what the name and function comment >> > >

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-06 Thread Alan Modra
On Fri, Jan 04, 2019 at 12:18:03PM +, Richard Sandiford wrote: > Alan Modra writes: > > On Thu, Jan 03, 2019 at 07:03:59PM +, Richard Sandiford wrote: > >> Richard Sandiford writes: > >> > This still seems risky and isn't what the name and function comment > > > > OK, how about this delta

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-04 Thread Richard Sandiford
Alan Modra writes: > On Thu, Jan 03, 2019 at 07:03:59PM +, Richard Sandiford wrote: >> Richard Sandiford writes: >> > This still seems risky and isn't what the name and function comment > > OK, how about this delta from the previous patch to ameliorate the > maintenance risk? attr_value_alig

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-03 Thread Alan Modra
On Thu, Jan 03, 2019 at 07:03:59PM +, Richard Sandiford wrote: > Richard Sandiford writes: > > This still seems risky and isn't what the name and function comment OK, how about this delta from the previous patch to ameliorate the maintenance risk? diff --git a/gcc/genattrtab.c b/gcc/genattrt

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-03 Thread Richard Sandiford
Richard Sandiford writes: > Alan Modra writes: >> If the operands of PLUS are assumed to be insn lengths (reasonable, >> since you're likely to use PLUS to sum the machine insn lengths of a >> pattern that conditionally emits multiple machine insns), then it >> might be better to replace "current

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-03 Thread Richard Sandiford
Alan Modra writes: > On Thu, Jan 03, 2019 at 12:41:52PM +, Richard Sandiford wrote: >> Alan Modra writes: >> > +case PLUS: >> > + current_or = or_attr_value (XEXP (exp, 0)); >> > + if (current_or != -1) >> > + { >> > +int n = current_or; >> > +current_or = or_attr_value

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-03 Thread Alan Modra
On Thu, Jan 03, 2019 at 12:41:52PM +, Richard Sandiford wrote: > Alan Modra writes: > > +case PLUS: > > + current_or = or_attr_value (XEXP (exp, 0)); > > + if (current_or != -1) > > + { > > + int n = current_or; > > + current_or = or_attr_value (XEXP (exp, 1)); > > +

Re: [PATCH] genattrtab bit-rot, and if_then_else in values

2019-01-03 Thread Richard Sandiford
Alan Modra writes: > +case PLUS: > + current_or = or_attr_value (XEXP (exp, 0)); > + if (current_or != -1) > + { > + int n = current_or; > + current_or = or_attr_value (XEXP (exp, 1)); > + if (current_or != -1) > + current_or += n; > + } > + bre