On Thu, Mar 24, 2016 at 7:01 AM, Alan Modra <amo...@gmail.com> wrote: > This fixes the PR70052 ICE by modifying easy_fp_constant to correctly > return false for decimal floating point zero. 0.0D is not an all-zero > bit pattern, at least, not the canonical form. > > I've also taken on Mike's suggestion of using a mode dependent > constraint for insns that currently use "j". Note that > "easy_fp_constant" is already part of "input_operand" so in the usual > case we ought to be prevented from generating 0.0D immediate > constants. However, in the past I've seen reload do some nasty tricks > when pseudos don't get hard regs, and believe that a pseudo that is > known to be equal to 0.0D may have the constant substituted with only > constraints being checked, not the operand predicates. So either the > "j" constraint needs fixing to reject decimal float (as I had in my > original patch) or not used with decimal float (Mike's approach). > I left in a small tidy for "j" from my original patch. > > Bootstrapped and regression tested powerpc64le-linux. OK to apply? > > gcc/ > PR target/70052 > * config/rs6000/constraints.md (j): Simplify. > * config/rs6000/predicates.md (easy_fp_constant): Exclude > decimal float 0.D. > * config/rs6000/rs6000.md (zero_fp): New mode_attr. Use in place > of "j" in all constraints.
The patch did not convert all "j" constraints, so the ChangeLog needs to be a little clearer to explain which alternatives required the change. > (movtd_64bit_nodm): Delete "j" constraint alternative. > gcc/testsuite/ > * gcc.dg/dfp/pr70052.c: New. Okay with that clarification. Thanks, David