summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-05 00:35:05 +0000
committersandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-05 00:35:05 +0000
commit2ea5a0786149c6a9faba9fdf3575af66db9902e6 (patch)
tree96fe41feee13a6afa405ce81841d0956c3dc3875
parent6b7a0b5b7dfa4071c95418040cc0ee1528ba7915 (diff)
downloadppe42-gcc-2ea5a0786149c6a9faba9fdf3575af66db9902e6.tar.gz
ppe42-gcc-2ea5a0786149c6a9faba9fdf3575af66db9902e6.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190150 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/mips.c10
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/lto/20090303_0.C1
-rw-r--r--gcc/testsuite/g++.dg/opt/enum2.C2
5 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b8f0a86a0f8..9292c7b651a 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 ef1cccdcbe7..f36f65bfac0 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 19a88759e7b..e41b25a717a 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 36c8588bb55..88bd6ad9beb 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 6300896cff9..40a496e535d 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 ();
OpenPOWER on IntegriCloud