Bug 78733 - [7 Regression] bootstrap broken on aarch64-linux-gnu
Summary: [7 Regression] bootstrap broken on aarch64-linux-gnu
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: assemble-failure, build
Depends on:
Blocks:
 
Reported: 2016-12-08 08:53 UTC by Matthias Klose
Modified: 2016-12-09 14:26 UTC (History)
0 users

See Also:
Host:
Target: aarch64-linux-gnu
Build:
Known to work: 6.2.1
Known to fail: 7.0
Last reconfirmed: 2016-12-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2016-12-08 08:53:02 UTC
trunk 20161207 fails to build on aarch64-linux-gnu in libgfortran (binutils trunk 20161202 is used for the build):

/tmp/ccEfI0qj.s: Assembler messages:
/tmp/ccEfI0qj.s:194: Error: invalid addressing mode at operand 3 -- `ldp x8,x9,.LC0'
/tmp/ccEfI0qj.s:1305: Error: invalid addressing mode at operand 3 -- `ldp x10,x11,.LC9'
Makefile:2982: recipe for target 'maxval_i16.lo' failed
make[5]: *** [maxval_i16.lo] Error 1

configured as -enable-languages=c,ada,c++,go,fortran,objc,obj-c++ --prefix=/usr/lib/gcc-snapshot --program-prefix= --enable-shared --enable-linker-build-id  --disable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=yes --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Comment 2 Andrew Pinski 2016-12-08 09:02:20 UTC
I don't see it in my last build https://gcc.gnu.org/ml/gcc-testresults/2016-12/msg00866.html
Comment 3 James Greenhalgh 2016-12-08 09:24:09 UTC
I see about 250 new failures when testing with -mcmodel=tiny after r243346.

These are of the same form as the failure you report:

FAIL: gfortran.dg/alloc_comp_assign_4.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)

/tmp/ccxfODDL.s: Assembler messages:
/tmp/ccxfODDL.s:30: Error: invalid addressing mode at operand 3 -- `ldp x24,x25,.LC2'

I haven't seen this for other values of mcmodel in my testing. I wonder how -mcmodel=tiny made it in to your bootstrap flags?

This patch probably should be reverted for now given the number of failures.
Comment 4 ktkachov 2016-12-08 09:25:59 UTC
> I haven't seen this for other values of mcmodel in my testing. I wonder how
> -mcmodel=tiny made it in to your bootstrap flags?
> 

Perhaps the --enable-multiarch option gets gcc to build the libraries for all the -mcmodel variations?
Comment 5 Andrew Pinski 2016-12-08 09:32:38 UTC
(In reply to ktkachov from comment #4)
> > I haven't seen this for other values of mcmodel in my testing. I wonder how
> > -mcmodel=tiny made it in to your bootstrap flags?
> > 
> 
> Perhaps the --enable-multiarch option gets gcc to build the libraries for
> all the -mcmodel variations?

My build is auto turning on multi-arch so no.  I am suspecting the workaround a53 errata is the difference that matters.
Comment 6 Matthias Klose 2016-12-08 09:36:11 UTC
yes, I'm configuring with --enable-fix-cortex-a53-843419
Comment 7 James Greenhalgh 2016-12-08 09:39:44 UTC
(In reply to Matthias Klose from comment #6)
> yes, I'm configuring with --enable-fix-cortex-a53-843419

And running the testsuite with -mfix-cortex-a53-843419 shows the failures.

So the problem is visible with either -mcmodel=tiny or -mfix-cortex-a53-843419
Comment 8 Wilco 2016-12-08 11:25:20 UTC
(In reply to James Greenhalgh from comment #7)
> (In reply to Matthias Klose from comment #6)
> > yes, I'm configuring with --enable-fix-cortex-a53-843419
> 
> And running the testsuite with -mfix-cortex-a53-843419 shows the failures.
> 
> So the problem is visible with either -mcmodel=tiny or
> -mfix-cortex-a53-843419

It's -mpc-relative-literal-loads (which is set by both). There is an issue in aarch64_classify_address that doesn't correctly identify TI/TFmode as possible LDP/STP instructions. I'm testing a fix.
Comment 9 Wilco 2016-12-08 15:32:32 UTC
Patch posted: https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00653.html
Comment 10 Wilco 2016-12-08 19:19:05 UTC
Author: wilco
Date: Thu Dec  8 19:18:33 2016
New Revision: 243456

URL: https://gcc.gnu.org/viewcvs?rev=243456&root=gcc&view=rev
Log:
This patch fixes an issue in aarch64_classify_address.  TImode and TFmode
can either use a 64-bit LDP/STP or 128-bit LDR/STR.  The addressing mode
must be carefully modelled as the intersection of both.  This is done for
the immediate offsets, however load_store_pair_p must be set as well to
avoid LDP with a PC-relative address if aarch64_pcrelative_literal_loads
is true.

    gcc/
	PR target/78733
	* config/aarch64/aarch64.c (aarch64_classify_address):
	Set load_store_pair_p for TImode and TFmode.

    testsuite/
	* gcc.target/aarch64/pr78733.c: New test.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.c
    trunk/gcc/testsuite/ChangeLog
Comment 11 Wilco 2016-12-08 19:23:34 UTC
Fixed in r243456.
Comment 12 Wilco 2016-12-09 14:26:39 UTC
Author: wilco
Date: Fri Dec  9 14:26:07 2016
New Revision: 243486

URL: https://gcc.gnu.org/viewcvs?rev=243486&root=gcc&view=rev
Log:
Add the test this time...

        PR target/78733
        * gcc.target/aarch64/pr78733.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/aarch64/pr78733.c
Modified:
    trunk/gcc/testsuite/ChangeLog