#3943 new defect

i386: unknown register name 'fpcr' in 'asm'

Reported by: Sebastian Huber Owned by:
Priority: normal Milestone: Indefinite
Component: arch/i386 Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

There is a compile error with GCC 10 for the i386/pcp4 and i386/pc586-sse BSPs:

In file included from cpukit/include/config.h:6,
                 from ../../../cpukit/score/src/threadrestart.c:20:
../../../cpukit/score/src/threadrestart.c: In function '_Thread_Life_action_handler':
../../../cpukit/score/cpu/i386/include/rtems/score/cpu.h:615:5: error: unknown register name 'fpcr' in 'asm'
  615 |     __asm__ __volatile__(                      \
      |     ^~~~~~~
../../../cpukit/include/rtems/score/context.h:143:4: note: in expansion of macro '_CPU_Context_restore_fp'
  143 |    _CPU_Context_restore_fp( _fp )
      |    ^~~~~~~~~~~~~~~~~~~~~~~
../../../cpukit/score/src/threadrestart.c:360:5: note: in expansion of macro '_Context_Restore_fp'
  360 |     _Context_Restore_fp( &executing->fp_context );
      |     ^~~~~~~~~~~~~~~~~~~

Change History (4)

comment:1 Changed on Apr 8, 2020 at 12:08:51 PM by Joel Sherrill

This looks like binutils may have renamed a register. :(

comment:2 Changed on Apr 20, 2020 at 5:32:32 PM by Joel Sherrill

I posted to GCC's mailing list but don't have a GCC 10 compiler to test this with.
Uros Bizjak gave this advice (https://gcc.gnu.org/pipermail/gcc/2020-April/232143.html):

Just remove the fpcr clobber. FP control register was never properly handled.

Please also note gcc manual section "6.47.2.1 Volatile", where the
manual discusses similar case of a system register that controls the
rounding mode of floating-point operations. You have to add an
artificial dependency to the asm by referencing a variable in the
subsequent code, otherwise the compiler may move the access to system
register across the arithmetic insn.

Can you try this Sebastian? Thanks.

comment:3 Changed on Apr 20, 2020 at 5:34:30 PM by Sebastian Huber

Great timing. I am about to start a new test run after my build specification changes.

comment:4 Changed on Jul 5, 2020 at 4:00:57 PM by Sebastian Huber <sebastian.huber@…>

In d0c1ce6/rtems:

i386: Replace fpcr clobber with memory clobber

Update #3943.

Note: See TracTickets for help on using tickets.