Bug 86887 - [9 Regression] aarch64: adcs accepts only register arguments
Summary: [9 Regression] aarch64: adcs accepts only register arguments
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Richard Earnshaw
URL:
Keywords: assemble-failure
Depends on:
Blocks:
 
Reported: 2018-08-08 11:30 UTC by Zdenek Sojka
Modified: 2018-08-09 13:44 UTC (History)
0 users

See Also:
Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu
Build:
Known to work:
Known to fail: 9.0
Last reconfirmed: 2018-08-08 00:00:00


Attachments
reduced testcase (132 bytes, text/plain)
2018-08-08 11:30 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2018-08-08 11:30:26 UTC
Created attachment 44518 [details]
reduced testcase

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O testcase.c
/tmp/cc93Bw20.s: Assembler messages:
/tmp/cc93Bw20.s:39: Error: operand 1 must be an integer register -- `adcs [sp,104],x3,x0'

$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-263387-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/9.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu --with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld --with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-263387-checking-yes-rtl-df-extra-aarch64
Thread model: posix
gcc version 9.0.0 20180808 (experimental) (GCC) 

The assembler is right, adcs needs all 3 arguments to be regsiters: https://static.docs.arm.com/ddi0487/ca/DDI0487C_a_armv8_arm.pdf
Comment 1 Richard Earnshaw 2018-08-08 12:57:08 UTC
confirmed
Comment 2 Richard Earnshaw 2018-08-09 13:39:49 UTC
Author: rearnsha
Date: Thu Aug  9 13:39:17 2018
New Revision: 263446

URL: https://gcc.gnu.org/viewcvs?rev=263446&root=gcc&view=rev
Log:
aarch64 - PR target/86887 Fix missing register constraints in carryin patterns

Some of the carryin insn patterns are missing a register constraint.
That means that the register allocator can pick practically anything
to hold that value, including memory locations, or registers of the
wrong class.

	PR target/86887
	* config/aarch64/aarch64.md (add<mode>3_carryinC_zero): Add missing
	register constraint to operand 0.
	(add<mode>3_carryinC): Likewise.
	(add<mode>3_carryinV_zero, add<mode>3_carryinV): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.md
Comment 3 Richard Earnshaw 2018-08-09 13:44:44 UTC
Fixed.