Bug 14987 - Current gas arm asm syntax checks may be too strict
Summary: Current gas arm asm syntax checks may be too strict
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-30 00:37 UTC by bernhard.rosenkranzer@linaro.org
Modified: 2013-06-24 23:37 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
skip whitespace (616 bytes, patch)
2013-01-02 13:40 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bernhard.rosenkranzer@linaro.org 2012-12-30 00:37:14 UTC
Current (seen with hjl branch binutils 2.23.51.0.6 to 2.23.51.0.8) arm asm syntax checks may be a bit too strict.

This is fine:
vld1.32 {d1[]}, [r2], r3

But this whitespace change errors out:
vld1.32 {d1[]}, [r2 ], r3
test.S:6: Error: ']' expected -- `vld1.32 {d1[]},[r2 ],r3'

This causes problems when building x264 (context:
.macro SAD_FUNC w, h, name, align:vararg
        vld1.32 {d1[]}, [r2 \align], r3
.endm
called without the align parameter)

The fix on the x264 side is easy, but chances are the behavior seen in older binutils versions (accepting both versions equally) is preferable.
Comment 1 Sourceware Commits 2013-01-02 13:39:05 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2013-01-02 13:38:57

Modified files:
	gas            : ChangeLog 
	gas/config     : tc-arm.c 
	gas/testsuite  : ChangeLog 
	gas/testsuite/gas/arm: neon-ldst-es.d neon-ldst-es.s 
Added files:
	gas            : ChangeLog-2012 
	gas/testsuite  : ChangeLog-2012 

Log message:
	PR gas/14987
	* gas/arm/neon-ldst-es.s: Add whitespace test.
	* gas/arm/neon-ldst-es.d: Update expected disassembly.
	
	* config/tc-arm.c (parse_address_main): Skip whitespace before a
	closing bracket.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog-2012.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4893&r2=1.4894
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?cvsroot=src&r1=1.549&r2=1.550
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog-2012.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2161&r2=1.2162
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/arm/neon-ldst-es.d.diff?cvsroot=src&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/arm/neon-ldst-es.s.diff?cvsroot=src&r1=1.3&r2=1.4
Comment 2 Nick Clifton 2013-01-02 13:40:10 UTC
Created attachment 6792 [details]
skip whitespace
Comment 3 Nick Clifton 2013-01-02 13:40:47 UTC
I have committed the uploaded patch in order to fix this problem.

Cheers
  Nick
Comment 4 Mikael Pettersson 2013-01-05 15:52:27 UTC
This bug is also present on current 2.23 branch, but not in the 2.23.1 release, making it a regression.  Backporting the tc-arm.c patch to 2.23 fixes this test case there too.

Please also see PR14887 for the analogous problem of whitespace between the opening bracket and the register operand.
Comment 6 Roland McGrath 2013-06-24 23:37:57 UTC
I've put that fix on the 2.23 branch too now.