https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127974

            Bug ID: 127974
           Summary: Float'Valid causes an unnecessary spill
           Product: gcc
           Version: 16.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liam at liampwll dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 65880
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65880&action=edit
fix

Right now Float'Valid will always cause a spill. This is trivial to fix, as
shown in the attached patch. This does change the behaviour a tiny bit, but it
seems like the old behaviour that could change the sign when calling 'Valid is
incorrect, especially because it will cause a crash if the float is in rodata.

I found this while trying to improve performance of some float-heavy code where
I'd like to leave checks turned on.

As an aside, 'Exponent and 'Fraction are also really slow since they force a
non-inlined call to Decompose, but adding a fast path to them is a bit
involved.

Reply via email to