Bug ID: 81800
           Summary: [8 regression] on aarch64 ilp32 lrint should not be
                    inlined as two instructions
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot
          Reporter: nsz at gcc dot
  Target Milestone: ---

recently lrint is inlined as frintx/fcvtzs on aarch64, but this
is not valid on ilp32 where a non-integer double may be out-of-bound
for a long and then the first instruction raises the inexact,
the second one raises invalid exception and only the invalid should
be raised in this case.

so the inlining is only valid with -fno-trapping-math i think.

gcc -O3 -mabi=ilp32 -S -fno-math-errno b.c

compiles to

        frintx  d0, d0
        fcvtzs  w0, d0

(the patch for the equivalent bug in glibc is
which saves and restores the fenv around the instructions.)

Reply via email to