On Mon, Mar 31, 2025 at 11:25:27AM +0200, Richard Biener wrote:
> > > PR tree-optimization/119532
> > > * tree-tailcall.cc (process_assignment): FAIL for fixed-point
> > > typed functions.
> > >
> > > * gcc.dg/torture/pr119532.c: New testcase.
> >
> > So shouldn't we punt in that case just for the problematic operations
> > (i.e. NEGATE_EXPR and MINUS_EXPR)?
> > Aren't the others ok as is?
>
> We are associating the expression which at least breaks with
> saturating fixed-point. We are also rejecting FP types
> without -fassociative-math, not trying to special cases some
> maybe working cases.
>
> So, I'm not sure the code behaves correctly even when not
> running into the build_minus_one_cst case for _Fract types.
> We'd at least need to disable TYPE_SATURATING.
>
> I can change to just disable TYPE_SATURATING and
> !ALL_SCALAR_ACCUM_MODE_P (TYPE_MODE (type)) (there's no TYPE-based
> test for _Fract it seems?). Would you prefer that?
> Association could still affect rounding, and I don't think we
> document behavior of -fassociative-math on fixed-point?
I guess I don't know enough about fixed point types, so
let's go with your original patch, if anyone actually interested
in those types comes with something better, they can.
Jakub