Bug 396452

Summary: none/test/arm/vfp.c doesn't build with binutils 2.31 gas
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED MOVED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Mark Wielaard 2018-07-12 21:16:33 UTC
This is most likely because of this commit:

https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=58ed5c38f52511e73c9748b86c319320177fb0ca;hp=190852c8ac75cb62a737c58edfadfb0e1fcef78a

   Allow integer immediate for VFP vmov instructions.

   This patch fixes the case where you want to use an integer value the
   floating point immediate to a VFP vmov instruction such as
   vmovmi.f32 s27, #11.

   If the immediate is not a float we convert it and copy it's representation
   into the imm field and then carry on validating as if we originally entered
   a floating point immediate.

   The is considered a QoL improvement for hand assembly writers and allows more
   code portability between assembler.

Introduced after discussion in this thread:
https://sourceware.org/ml/binutils/2018-05/threads.html#00114

gcc -DHAVE_CONFIG_H -I. -I../../..  -I../../.. -I../../../include -I../../../coregrind -I../../../include -I../../../VEX/pub -I../../../VEX/pub -DVGA_arm=1 -DVGO_linux=1 -DVGP_arm_linux=1 -DVGPV_arm_linux_vanilla=1   -Winline -Wall -Wshadow -Wno-long-long -g -fno-stack-protector    -g -O0 -mcpu=cortex-a8 -mfpu=neon -mthumb  -c -o vfp-vfp.o `test -f 'vfp.c' || echo './'`vfp.c
/tmp/ccon3RaI.s: Assembler messages:
/tmp/ccon3RaI.s:42769: Error: immediate out of range -- `vmov s9,#0xbe280000'
/tmp/ccon3RaI.s:42800: Error: immediate out of range -- `vmov s21,#0xbe280000'
/tmp/ccon3RaI.s:42831: Error: immediate out of range -- `vmov s4,#0xbe280000'
/tmp/ccon3RaI.s:42863: Error: immediate out of range -- `vmov s19,#0xbe280000'
/tmp/ccon3RaI.s:42894: Error: immediate out of range -- `vmov s29,#0xbe280000'
/tmp/ccon3RaI.s:42926: Error: immediate out of range -- `vmov s8,#0xbe280000'
/tmp/ccon3RaI.s:42958: Error: immediate out of range -- `vmov s16,#0xbe280000'
/tmp/ccon3RaI.s:42990: Error: immediate out of range -- `vmov s0,#0xbe280000'
/tmp/ccon3RaI.s:43022: Error: immediate out of range -- `vmov s3,#0xbe280000'
/tmp/ccon3RaI.s:43053: Error: immediate out of range -- `vmov s9,#0xbe280000'
/tmp/ccon3RaI.s:43083: Error: immediate out of range -- `vmov s11,#0xbe280000'
/tmp/ccon3RaI.s:43115: Error: immediate out of range -- `vmov s30,#0xbe280000'
/tmp/ccon3RaI.s:44568: Error: immediate out of range -- `vmov s21,#0xbff80000'
/tmp/ccon3RaI.s:44569: Error: immediate out of range -- `vmov s2,#0x3fa80000'
/tmp/ccon3RaI.s:44596: Error: immediate out of range -- `vmov s23,#0xbff80000'
/tmp/ccon3RaI.s:44597: Error: immediate out of range -- `vmov s21,#0x3fa80000'
/tmp/ccon3RaI.s:44623: Error: immediate out of range -- `vmov s3,#0xbff80000'
/tmp/ccon3RaI.s:44624: Error: immediate out of range -- `vmov s3,#0x3fa80000'
/tmp/ccon3RaI.s:44649: Error: immediate out of range -- `vmov s19,#0xbff80000'
/tmp/ccon3RaI.s:44650: Error: immediate out of range -- `vmov s5,#0x3fa80000'
/tmp/ccon3RaI.s:44677: Error: immediate out of range -- `vmov s3,#0xbff80000'
/tmp/ccon3RaI.s:44678: Error: immediate out of range -- `vmov s12,#0x3fa80000'
/tmp/ccon3RaI.s:44705: Error: immediate out of range -- `vmov s7,#0xbff80000'
/tmp/ccon3RaI.s:44706: Error: immediate out of range -- `vmov s10,#0x3fa80000'
/tmp/ccon3RaI.s:44732: Error: immediate out of range -- `vmov s30,#0xbff80000'
/tmp/ccon3RaI.s:44733: Error: immediate out of range -- `vmov s13,#0x3fa80000'
/tmp/ccon3RaI.s:44758: Error: immediate out of range -- `vmov s17,#0xbff80000'
/tmp/ccon3RaI.s:44759: Error: immediate out of range -- `vmov s17,#0x3fa80000'
/tmp/ccon3RaI.s:44786: Error: immediate out of range -- `vmov s11,#0xbff80000'
/tmp/ccon3RaI.s:44787: Error: immediate out of range -- `vmov s21,#0x3fa80000'
/tmp/ccon3RaI.s:44814: Error: immediate out of range -- `vmov s8,#0xbff80000'
/tmp/ccon3RaI.s:44815: Error: immediate out of range -- `vmov s30,#0x3fa80000'
/tmp/ccon3RaI.s:44841: Error: immediate out of range -- `vmov s12,#0xbff80000'
/tmp/ccon3RaI.s:44842: Error: immediate out of range -- `vmov s9,#0x3fa80000'
/tmp/ccon3RaI.s:44867: Error: immediate out of range -- `vmov s6,#0xbff80000'
/tmp/ccon3RaI.s:44868: Error: immediate out of range -- `vmov s11,#0x3fa80000'
/tmp/ccon3RaI.s:44895: Error: immediate out of range -- `vmov s17,#0xbff80000'
/tmp/ccon3RaI.s:44896: Error: immediate out of range -- `vmov s12,#0x3fa80000'
/tmp/ccon3RaI.s:44923: Error: immediate out of range -- `vmov s12,#0xbff80000'
/tmp/ccon3RaI.s:44924: Error: immediate out of range -- `vmov s12,#0x3fa80000'
/tmp/ccon3RaI.s:44950: Error: immediate out of range -- `vmov s11,#0xbff80000'
/tmp/ccon3RaI.s:44951: Error: immediate out of range -- `vmov s11,#0x3fa80000'
/tmp/ccon3RaI.s:45778: Error: immediate out of range -- `vmov s0,#0xbe880000'
/tmp/ccon3RaI.s:45800: Error: immediate out of range -- `vmov s1,#0x3fa80000'
/tmp/ccon3RaI.s:45822: Error: immediate out of range -- `vmov s2,#0xbf080000'
/tmp/ccon3RaI.s:45844: Error: immediate out of range -- `vmov s5,#0x3eb80000'
/tmp/ccon3RaI.s:45866: Error: immediate out of range -- `vmov s7,#0xbff80000'
/tmp/ccon3RaI.s:45888: Error: immediate out of range -- `vmov s10,#0xbe280000'
/tmp/ccon3RaI.s:45910: Error: immediate out of range -- `vmov s12,#0x40000000'
/tmp/ccon3RaI.s:45931: Error: immediate out of range -- `vmov s13,#0x3e880000'
/tmp/ccon3RaI.s:45952: Error: immediate out of range -- `vmov s14,#0xbee80000'
/tmp/ccon3RaI.s:45974: Error: immediate out of range -- `vmov s15,#0xc0b80000'
/tmp/ccon3RaI.s:46383: Error: immediate out of range -- `vmov s2,#0x40000000'
/tmp/ccon3RaI.s:46413: Error: immediate out of range -- `vmov s14,#0x40000000'
/tmp/ccon3RaI.s:46443: Error: immediate out of range -- `vmov s4,#0x40000000'
/tmp/ccon3RaI.s:46474: Error: immediate out of range -- `vmov s7,#0x40000000'
/tmp/ccon3RaI.s:46505: Error: immediate out of range -- `vmov s9,#0x40000000'
/tmp/ccon3RaI.s:46536: Error: immediate out of range -- `vmov s10,#0x40000000'
/tmp/ccon3RaI.s:46567: Error: immediate out of range -- `vmov s13,#0x40000000'
/tmp/ccon3RaI.s:46598: Error: immediate out of range -- `vmov s3,#0x40000000'
/tmp/ccon3RaI.s:46640: Error: immediate out of range -- `vmov s5,#0x40000000'
/tmp/ccon3RaI.s:46673: Error: immediate out of range -- `vmov s8,#0x40000000'
/tmp/ccon3RaI.s:46703: Error: immediate out of range -- `vmov s4,#0x40000000'
/tmp/ccon3RaI.s:46737: Error: immediate out of range -- `vmov s0,#0x40000000'
/tmp/ccon3RaI.s:46777: Error: immediate out of range -- `vmov s0,#0x40000000'
/tmp/ccon3RaI.s:46778: Error: immediate out of range -- `vmov s1,#0x40000000'
/tmp/ccon3RaI.s:46816: Error: immediate out of range -- `vmov s0,#0x40000000'
/tmp/ccon3RaI.s:46817: Error: immediate out of range -- `vmov s1,#0x40000000'
/tmp/ccon3RaI.s:46852: Error: immediate out of range -- `vmov s30,#0x40000000'
/tmp/ccon3RaI.s:46853: Error: immediate out of range -- `vmov s31,#0x40000000'
/tmp/ccon3RaI.s:46895: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:46896: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:46940: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:46941: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:46985: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:46986: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47029: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47030: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47072: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47073: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47117: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47118: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47162: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47163: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47206: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47207: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47249: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47250: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47294: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47295: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47339: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47340: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47394: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47395: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47437: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47438: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47482: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47483: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47527: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47528: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47571: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47572: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47616: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47617: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47663: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47664: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47710: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47711: Error: immediate out of range -- `vmov s21,#0x40000000'
/tmp/ccon3RaI.s:47756: Error: immediate out of range -- `vmov s20,#0x40000000'
/tmp/ccon3RaI.s:47757: Error: immediate out of range -- `vmov s21,#0x40000000'
make[5]: *** [Makefile:1087: vfp-vfp.o] Error 1
Comment 1 Julian Seward 2018-09-03 08:23:50 UTC
Mark, what's the status of this now?  I have a vague memory that
this was resolved somehow, but I can't remember how.
Comment 2 Julian Seward 2018-09-03 08:24:52 UTC
Wasn't there some change subsequently pushed into binutils, that "fixes"
this?
Comment 3 Mark Wielaard 2018-09-03 08:57:55 UTC
Yes, this was resolved in binutils by allowing the existing construct again:

commit 524496887011b46736f4c5865a5faedd46be6f54
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Jul 13 11:44:49 2018 +0100

    Allow bit-patterns in the immediate field of ARM neon mov instructions.
    
        * config/tc-arm.c (do_neon_mov): When converting an integer
        immediate into a floating point value, check that the conversion
        is valid.  Also warn if the immediate is valid as both a floating
        point value and a bit pattern.
        * testsuite/gas/arm/vfp-mov-enc.s: Add instructions that use
        floating point bit patterns.
        * testsuite/gas/arm/vfp-mov-enc.d: Add regexps for the disassembly
        of the new insns.

Which is on both the binutils master and 2.31 branches.
I removed the valgrind workaround in fedora already.