diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2012-08-04 20:35:05 -0400 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2012-08-04 20:35:05 -0400 |
commit | 5dd4087e9a2bfe31f7f513c2d6ffaa0883632a3b (patch) | |
tree | 96fe41feee13a6afa405ce81841d0956c3dc3875 /gcc | |
parent | 08264e04ba9c439944dbce32d7a0e4d5e944d88d (diff) | |
download | gcc-5dd4087e9a2bfe31f7f513c2d6ffaa0883632a3b.zip gcc-5dd4087e9a2bfe31f7f513c2d6ffaa0883632a3b.tar.gz gcc-5dd4087e9a2bfe31f7f513c2d6ffaa0883632a3b.tar.bz2 |
mips.c (mips_option_override): Check -fpic for compatibility with -mabicalls and ABI.
2012-08-04 Sandra Loosemore <sandra@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
gcc/
* config/mips/mips.c (mips_option_override): Check -fpic
for compatibility with -mabicalls and ABI.
gcc/testsuite/
* g++.dg/opt/enum2.C: Require fpic target.
* g++.dg/lto/20090303_0.C: Likewise.
Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>
From-SVN: r190150
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/20090303_0.C | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/enum2.C | 2 |
5 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8f0a86..9292c7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-08-04 Sandra Loosemore <sandra@codesourcery.com> + Richard Sandiford <rdsandiford@googlemail.com> + + * config/mips/mips.c (mips_option_override): Check -fpic + for compatibility with -mabicalls and ABI. + 2012-08-04 Catherine Moore <clm@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index ef1cccd..f36f65b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -16162,6 +16162,16 @@ mips_option_override (void) target_flags &= ~MASK_ABICALLS; } + /* PIC requires -mabicalls. */ + if (flag_pic) + { + if (mips_abi == ABI_EABI) + error ("cannot generate position-independent code for %qs", + "-mabi=eabi"); + else if (!TARGET_ABICALLS) + error ("position-independent code requires %qs", "-mabicalls"); + } + if (TARGET_ABICALLS_PIC2) /* We need to set flag_pic for executables as well as DSOs because we may reference symbols that are not defined in diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 19a8875..e41b25a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,10 @@ 2012-08-04 Sandra Loosemore <sandra@codesourcery.com> + Richard Sandiford <rdsandiford@googlemail.com> + + * g++.dg/opt/enum2.C: Require fpic target. + * g++.dg/lto/20090303_0.C: Likewise. + +2012-08-04 Sandra Loosemore <sandra@codesourcery.com> Catherine Moore <clm@codesourcery.com> * gcc.target/mips/clear-cache-1.c: Test for alternate cache diff --git a/gcc/testsuite/g++.dg/lto/20090303_0.C b/gcc/testsuite/g++.dg/lto/20090303_0.C index 36c8588..88bd6ad 100644 --- a/gcc/testsuite/g++.dg/lto/20090303_0.C +++ b/gcc/testsuite/g++.dg/lto/20090303_0.C @@ -1,4 +1,5 @@ /* { dg-lto-do run } */ +/* { dg-require-effective-target fpic } */ /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */ /* { dg-lto-options {{-flto -flto-partition=1to1}} { target sparc*-*-* } } */ /* { dg-suppress-ld-options {-fPIC} } */ diff --git a/gcc/testsuite/g++.dg/opt/enum2.C b/gcc/testsuite/g++.dg/opt/enum2.C index 6300896..40a496e 100644 --- a/gcc/testsuite/g++.dg/opt/enum2.C +++ b/gcc/testsuite/g++.dg/opt/enum2.C @@ -1,8 +1,8 @@ // PR c++/43680 // Test that we don't make excessively aggressive assumptions about what // values an enum variable can have. +// { dg-do run { target fpic } } // { dg-options "-O2 -fPIC" } -// { dg-do run } extern "C" void abort (); |