From: Kaveh R. Ghazi Date: Wed, 9 Jan 2008 04:47:27 +0000 (+0000) Subject: chk.h: Don't check !__PIE__. X-Git-Tag: prereleases/gcc-4.2.3-rc1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e68222cc2dc7d5ebed13ec1d15f47465fd5afb5e;p=thirdparty%2Fgcc.git chk.h: Don't check !__PIE__. * gcc.c-torture/execute/builtins/chk.h: Don't check !__PIE__. * gcc.dg/assign-warn-3.c: Use "static inline" instead of "inline". Backport: 2007-04-14 Kazu Hirata * gcc.c-torture/compile/pr27528.c: Require nonpic. 2007-03-21 Richard Sandiford * gcc.c-torture/execute/builtins/chk.h (LOCAL): Define. * gcc.c-torture/execute/builtins/sprintf-chk.c (s1): Make LOCAL. * gcc.c-torture/execute/builtins/stpcpy-chk.c (s1): Likewise. * gcc.c-torture/execute/builtins/strcpy-chk.c (s1): Likewise. 2007-07-26 Nathan Froyd PR/19232 * gcc.dg/assign-warn-3.c (f0): Declare as inline. (f1): Likewise. 2007-01-15 Dale Johannesen * gcc.dg/tree-ssa/loop-3.c: Disable with -fpic or -fPIC. 2007-08-27 Uros Bizjak * gcc.target/i386/stack-prot-kernel.c: Require nonpic effective target. 2007-03-21 Richard Sandiford * lib/target-supports.exp (check_effective_target_nonpic): New procedure. From-SVN: r131412 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bbde3359f14f..c9d5436c173c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,35 @@ +2008-01-08 Kaveh R. Ghazi + + * gcc.c-torture/execute/builtins/chk.h: Don't check !__PIE__. + * gcc.dg/assign-warn-3.c: Use "static inline" instead of "inline". + + Backport: + + 2007-04-14 Kazu Hirata + * gcc.c-torture/compile/pr27528.c: Require nonpic. + + 2007-03-21 Richard Sandiford + * gcc.c-torture/execute/builtins/chk.h (LOCAL): Define. + * gcc.c-torture/execute/builtins/sprintf-chk.c (s1): Make LOCAL. + * gcc.c-torture/execute/builtins/stpcpy-chk.c (s1): Likewise. + * gcc.c-torture/execute/builtins/strcpy-chk.c (s1): Likewise. + + 2007-07-26 Nathan Froyd + PR/19232 + * gcc.dg/assign-warn-3.c (f0): Declare as inline. + (f1): Likewise. + + 2007-01-15 Dale Johannesen + * gcc.dg/tree-ssa/loop-3.c: Disable with -fpic or -fPIC. + + 2007-08-27 Uros Bizjak + * gcc.target/i386/stack-prot-kernel.c: Require nonpic effective + target. + + 2007-03-21 Richard Sandiford + * lib/target-supports.exp (check_effective_target_nonpic): New + procedure. + 2008-01-08 John David Anglin PR testsuite/30459 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr27528.c b/gcc/testsuite/gcc.c-torture/compile/pr27528.c index c5f8b5e1e568..040049127494 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr27528.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr27528.c @@ -1,6 +1,6 @@ /* Check that constant constraints like "i", "n" and "s" can be used in cases where the operand is an initializer constant. */ -/* { dg-options "-fno-pic" } */ +/* { dg-require-effective-target nonpic } */ int x[2] = { 1, 2 }; diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/chk.h b/gcc/testsuite/gcc.c-torture/execute/builtins/chk.h index dfef410c61b8..930d920a56ee 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/chk.h +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/chk.h @@ -79,3 +79,11 @@ extern volatile int memset_disallowed, strcpy_disallowed, stpcpy_disallowed; extern volatile int strncpy_disallowed, strcat_disallowed, strncat_disallowed; extern volatile int sprintf_disallowed, vsprintf_disallowed; extern volatile int snprintf_disallowed, vsnprintf_disallowed; + +/* A storage class that ensures that declarations bind locally. We want + to test non-static declarations where we know it is safe to do so. */ +#if __PIC__ +#define LOCAL static +#else +#define LOCAL +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c b/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c index 95d2a9d2826b..2862ab6dc91f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c @@ -13,7 +13,7 @@ extern int sprintf (char *, const char *, ...); #include "chk.h" -const char s1[] = "123"; +LOCAL const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c b/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c index b292c0aec873..6091f1293592 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c @@ -11,7 +11,7 @@ extern int memcmp (const void *, const void *, size_t); #include "chk.h" -const char s1[] = "123"; +LOCAL const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c index 002dd19500ed..b3c1a3899d96 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c @@ -11,7 +11,7 @@ extern int memcmp (const void *, const void *, size_t); #include "chk.h" -const char s1[] = "123"; +LOCAL const char s1[] = "123"; char p[32] = ""; char *s2 = "defg"; char *s3 = "FGH"; diff --git a/gcc/testsuite/gcc.dg/assign-warn-3.c b/gcc/testsuite/gcc.dg/assign-warn-3.c index 1463fce0f68d..4ff7b88fa5f7 100644 --- a/gcc/testsuite/gcc.dg/assign-warn-3.c +++ b/gcc/testsuite/gcc.dg/assign-warn-3.c @@ -5,9 +5,9 @@ /* { dg-options "-O3 -std=c99 -pedantic-errors" } */ /* This is valid to execute, so maybe shouldn't warn at all. */ -void f0(x) signed char *x; { } +static inline void f0(x) signed char *x; { } void g0(unsigned char *x) { f0(x); } /* { dg-warning "warning: pointer targets in passing argument 1 of 'f0' differ in signedness" } */ /* This is undefined on execution but still must compile. */ -void f1(x) int *x; { } +static inline void f1(x) int *x; { } void g1(unsigned int *x) { f1(x); } /* { dg-warning "warning: pointer targets in passing argument 1 of 'f1' differ in signedness" } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c index 5e374a4b4726..57db5c323991 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c @@ -3,7 +3,8 @@ assume something about memory addressing modes. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O1 -fdump-tree-optimized" } */ +/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-options "-O1 -fno-pic -fno-PIC -fdump-tree-optimized" } */ int arr_base[100]; diff --git a/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c b/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c index af16223a83be..9d177827bd33 100644 --- a/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c +++ b/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c @@ -1,5 +1,5 @@ /* { dg-do compile { target lp64 } } */ -/* { dg-skip-if "darwin x86_64 is pic" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target nonpic } */ /* { dg-options "-O2 -fstack-protector-all -mcmodel=kernel" } */ void test1 (int x) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0672563bb3cf..adafe8d5016f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -509,6 +509,16 @@ proc check_effective_target_mpaired_single { } { } "-mpaired-single"] } +# Return 1 if the current multilib does not generate PIC by default. + +proc check_effective_target_nonpic { } { + return [check_no_compiler_messages nonpic assembly { + #if __PIC__ + #error FOO + #endif + }] +} + # Return true if iconv is supported on the target. In particular IBM1047. proc check_iconv_available { test_what } {