Message ID | DB6PR0801MB2053A9A8671AA794B9FC4E9283B80@DB6PR0801MB2053.eurprd08.prod.outlook.com |
---|---|
State | New |
Headers | show |
On Tue, Jul 25, 2017 at 1:13 PM, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote: > James Greenhalgh wrote: >> >> OK. Either like this, or with the conditions swapped around as Yvan >> suggested to make backporting easier. > > I swapped the conditions around, not sure whether it helps... > Also I needed an additional scan-assembler, this was committed to > trunk and GCC7: BZ suggests that this affects GCC 6 but GCC 7 is fixed ? Should there be a backport to GCC 6 as well ? Can you please keep BZ up to date please ? Ramana > > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > index d7fab3775c06477365217e357b5754026d09752b..7713d543af788d47dcdf8ea89482a2d4f66a1344 100644 > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -10181,7 +10181,7 @@ aarch64_classify_symbol (rtx x, rtx offset) > /* This is alright even in PIC code as the constant > pool reference is always PC relative and within > the same translation unit. */ > - if (CONSTANT_POOL_ADDRESS_P (x)) > + if (!aarch64_pcrelative_literal_loads && CONSTANT_POOL_ADDRESS_P (x)) > return SYMBOL_SMALL_ABSOLUTE; > else > return SYMBOL_FORCE_TO_MEM; > diff --git a/gcc/testsuite/gcc.target/aarch64/pr79041-2.c b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c > new file mode 100644 > index 0000000000000000000000000000000000000000..cd34fbab85a92d00cba7091d4146deaaf3a862a9 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c > @@ -0,0 +1,11 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -mcmodel=large -mpc-relative-literal-loads" } */ > + > +__int128 > +t (void) > +{ > + return (__int128)1 << 80; > +} > + > +/* { dg-final { scan-assembler "adr" } } */ > +/* { dg-final { scan-assembler-not "adrp" } } */
Ramana Radhakrishnan <ramana.gcc@googlemail.com> > > BZ suggests that this affects GCC 6 but GCC 7 is fixed ? Should there > be a backport to GCC 6 as well ? > > Can you please keep BZ up to date please ? GCC7 was affected as well, the example in PR79041 didn't trigger in GCC7, my patch has a better example that does show the issue. GCC6 requires a backport of multiple patches. The patch is https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01708.html which is still waiting for review. Wilco
On Jul 25 2017, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote: > diff --git a/gcc/testsuite/gcc.target/aarch64/pr79041-2.c b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c > new file mode 100644 > index 0000000000000000000000000000000000000000..cd34fbab85a92d00cba7091d4146deaaf3a862a9 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c > @@ -0,0 +1,11 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -mcmodel=large -mpc-relative-literal-loads" } */ > + > +__int128 > +t (void) > +{ > + return (__int128)1 << 80; > +} > + > +/* { dg-final { scan-assembler "adr" } } */ > +/* { dg-final { scan-assembler-not "adrp" } } */ That fails in ILP32 mode. Andreas.
Andreas Schwab wrote:
> That fails in ILP32 mode.
Well -mabi-ilp32 and -mcmodel=large make no sense at all,
that should really give an error... I've committed a patch to
trunk and GCC7 to disable this test with ILP32.
Wilco
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index d7fab3775c06477365217e357b5754026d09752b..7713d543af788d47dcdf8ea89482a2d4f66a1344 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10181,7 +10181,7 @@ aarch64_classify_symbol (rtx x, rtx offset) /* This is alright even in PIC code as the constant pool reference is always PC relative and within the same translation unit. */ - if (CONSTANT_POOL_ADDRESS_P (x)) + if (!aarch64_pcrelative_literal_loads && CONSTANT_POOL_ADDRESS_P (x)) return SYMBOL_SMALL_ABSOLUTE; else return SYMBOL_FORCE_TO_MEM; diff --git a/gcc/testsuite/gcc.target/aarch64/pr79041-2.c b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c new file mode 100644 index 0000000000000000000000000000000000000000..cd34fbab85a92d00cba7091d4146deaaf3a862a9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcmodel=large -mpc-relative-literal-loads" } */ + +__int128 +t (void) +{ + return (__int128)1 << 80; +} + +/* { dg-final { scan-assembler "adr" } } */ +/* { dg-final { scan-assembler-not "adrp" } } */