From 2ea5a0786149c6a9faba9fdf3575af66db9902e6 Mon Sep 17 00:00:00 2001 From: sandra Date: Sun, 5 Aug 2012 00:35:05 +0000 Subject: [PATCH] 2012-08-04 Sandra Loosemore Richard Sandiford 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/mips/mips.c | 10 ++++++++++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/lto/20090303_0.C | 1 + gcc/testsuite/g++.dg/opt/enum2.C | 2 +- 5 files changed, 24 insertions(+), 1 deletion(-) 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 + Richard Sandiford + + * config/mips/mips.c (mips_option_override): Check -fpic + for compatibility with -mabicalls and ABI. + 2012-08-04 Catherine Moore Sandra Loosemore 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 + Richard Sandiford + + * g++.dg/opt/enum2.C: Require fpic target. + * g++.dg/lto/20090303_0.C: Likewise. + +2012-08-04 Sandra Loosemore Catherine Moore * 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 (); -- 2.11.4.GIT