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

            Bug ID: 120351
           Summary: ldrex r1, [s14], invalid use of NEON registers
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jhofstee at victronenergy dot com
  Target Milestone: ---

When compiling gcc for ARM with --with-arch=armv7-a gcc can emit invalid
instructions like ldrex r1, [s14]

godbolt can't reproduce this, since it depends on mentioned configure flag.

Below script builds gcc 15.1.0 with the issue:
https://github.com/jhofstee/qatomic-failure/blob/master/build-gcc-cross/make-gcc-cross.sh

This will then trigger the issue:
/opt/cross/bin/arm-oe-linux-gnueabi-c++ -O2 reduced.cpp -c -ffunction-sections
-O2 -save-temps -fverbose-asm -std=c++17 -O2 -Wall -Wextra  -mfpu=neon
-mfloat-abi=hard -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
reduced.s: Assembler messages:
reduced.s:47: Error: ARM register expected -- `ldrex r1,[s14]'
reduced.s:49: Error: ARM register expected -- `strex r2,r1,[s14]'

Reply via email to