diff options
Diffstat (limited to 'gcc')
22 files changed, 478 insertions, 112 deletions
diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h deleted file mode 100644 index 7da93053256..00000000000 --- a/gcc/config/i386/scodbx.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Definitions for Intel 386 running SCO Unix System V, - using dbx-in-coff encapsulation. - Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "i386/svr3dbx.h" - -/* Overridden defines for SCO systems from sco.h. */ - -/* By default, target has a 80387, uses IEEE compatible arithmetic, - and returns float values in the 387, ie, - (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387) - - SCO's software emulation of a 387 fails to handle the `fucomp' - opcode. fucomp is only used when generating IEEE compliant code. - So don't make TARGET_IEEE_FP default for SCO. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ - %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" - -/* Library spec, including SCO international language support. */ - -#undef LIB_SPEC -#define LIB_SPEC \ - "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc" - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}" - -/* This spec is used for telling cpp whether char is signed or not. */ - -#undef SIGNED_CHAR_SPEC -#if DEFAULT_SIGNED_CHAR -#define SIGNED_CHAR_SPEC \ - "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#else -#define SIGNED_CHAR_SPEC \ - "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#endif - -/* caller has to pop the extra argument passed to functions that return - structures. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) \ - : 0) -/* On other 386 systems, the last line looks like this: - : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */ - -/* Handle #pragma pack. */ -#define HANDLE_SYSV_PRAGMA diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h deleted file mode 100644 index 881c5c7be9d..00000000000 --- a/gcc/config/i386/xm-dgux.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Configuration for GCC for Intel i386 running DG/ux */ - -/* looks just like sysv4 for now */ -#include "xm-svr4.h" diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h deleted file mode 100644 index 6c0f0a25630..00000000000 --- a/gcc/config/i386/xm-sun.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0. - Copyright (C) 1988, 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#define USG diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h deleted file mode 100644 index 9a655443ff5..00000000000 --- a/gcc/config/i386/xm-sysv3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Configuration for GCC for Intel i386 running System V Release 3. */ - -#include "xm-svr3.h" diff --git a/gcc/testsuite/g++.dg/debug/debug4.C b/gcc/testsuite/g++.dg/debug/debug4.C new file mode 100644 index 00000000000..8dceb0875bf --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/debug4.C @@ -0,0 +1,17 @@ +/* PR debug/5770 + This testcase failed at -O -g because the following constants + were optimized away since they were never referenced, but + since they are variables with initializers, rtl_for_decl_location + run expand_expr on their initializers and returned it. + This lead to references to constants which were deferred and thus + never emitted. */ +/* { dg-do link } */ + +static const char foo[] = "foo string"; +static const char bar[30] = "bar string"; +static const wchar_t baz[] = L"baz string"; + +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/opt/anonunion1.C b/gcc/testsuite/g++.dg/opt/anonunion1.C new file mode 100644 index 00000000000..445ebaa7cb1 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/anonunion1.C @@ -0,0 +1,25 @@ +// PR c++/5748 +// This testcase ICEd because used flag from the anon union variables +// was not propagated back to the anon union itself, causing addressof +// not to be replaced with stack slot. +// { dg-do compile } +// { dg-options "-O2" } + +struct A { + A (); + ~A (); + int foo (); + int bar (void *x, int y); +}; + +int A::foo() +{ + union { + int a; + int b; + }; + + if (bar (&a, sizeof (int)) != 32) + return 16; + return 0; +} diff --git a/gcc/testsuite/g++.dg/opt/mmx1.C b/gcc/testsuite/g++.dg/opt/mmx1.C new file mode 100644 index 00000000000..e433d554aea --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/mmx1.C @@ -0,0 +1,65 @@ +// PR optimization/4994 +// This testcase ICEd because movsi was not supporting direct +// mmx -> mmx register moves. +// { dg-do compile } +// { dg-options "-O2" } +// { dg-options "-fno-exceptions -O2 -mmmx -fPIC" { target i?86-*-* } } + +struct A { + unsigned a0; + bool a1 () { return !--a0; } + void a2 (); +}; + +struct B +{ + B (); + B (const B &); + ~B(); + B &operator= (const B &); + B b0 (unsigned long x, int y = 0, int z = 10) const; + +private: + A *b1; + static A *b2; +}; + +inline B::~B() +{ + if (b1->a1 () && b1 == b2) + b1->a2(); +} + +struct C +{ + C *c0; +}; + +struct D +{ + C *d0; + D (); + D (const D &c0) {} + D &operator++ () { + C *x = d0; C *y = x->c0; + while (x == y->c0) + x = y; + d0 = x; + return *this; + } +}; + +B foo (const char *x, const B &y); + +void bar (void) +{ + B *y = 0; + B z; + for (unsigned long l = 0; l < 2147483647L * 2UL + 1; l++) + { + z = y->b0 (l); + *y = foo ("data", z); + } + D d; + ++d; +} diff --git a/gcc/testsuite/g++.dg/other/classkey1.C b/gcc/testsuite/g++.dg/other/classkey1.C new file mode 100644 index 00000000000..17fb54065d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/classkey1.C @@ -0,0 +1,17 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 28 Feb 2002 <nathan@codesourcery.com> + +// PR 775. Some mismatches which were broken. + +template <class T> struct A {}; +union A<int> a; // { dg-error "`union' tag" "" } + +template <> union A<float> {}; // { dg-error "`union' tag" "" } + +struct B {}; +union B b; // { dg-error "`union' tag" "" } + +union C {}; +class C c; // { dg-error "`class' tag" "" } diff --git a/gcc/testsuite/g++.dg/template/qualttp19.C b/gcc/testsuite/g++.dg/template/qualttp19.C new file mode 100644 index 00000000000..be6676cc592 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/qualttp19.C @@ -0,0 +1,41 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 15 Dec 2001 <nathan@codesourcery.com> + +// PR 2645 + +template <typename T> +struct call_traits +{ + public: + typedef T type_less_spec; +}; + +template <typename T> +struct call_traits<T&> +{ + typedef T type_more_spec; +}; + + +int main() +{ + int num; + + // Two typedefs lead to the instant. of the less spec. ("wrong") template + typedef int& r_type; + typedef const r_type cr_type; + call_traits<cr_type>::type_less_spec var = num; // { dg-error "" "" } + + // The explicit type leads to the instantiation of the "correct" one + call_traits<const int&>::type_more_spec var2 = num; + + // As happen with a single typedef! + typedef const int& std_cr_type; + call_traits<std_cr_type>::type_more_spec var3 = num; + + + // As happen, indeed, without the cv-qualifier + call_traits<r_type>::type_more_spec var4; +} diff --git a/gcc/testsuite/g++.dg/template/qualttp20.C b/gcc/testsuite/g++.dg/template/qualttp20.C new file mode 100644 index 00000000000..2c6c71445c9 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/qualttp20.C @@ -0,0 +1,33 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 15 Dec 2001 <nathan@codesourcery.com> + +// PR 2645 + +struct AS +{ + typedef void (myT) (); + struct L {}; + +}; + + +template <typename T> struct B1 : T +{ + typedef typename T::L __restrict__ r;// { dg-error "`__restrict' qualifiers cannot" "" } + typedef typename T::myT __restrict__ p;// { dg-warning "ignoring `__restrict'" "" } + + typedef typename T::myT volatile *myvolatile; // { dg-warning "ignoring `volatile'" "" } + typename T::myT volatile *a; // { dg-warning "ignoring `volatile'" "" } + myvolatile b; // { dg-bogus "ignoring `volatile'" "" { xfail *-*-* } } +}; +template <typename T> struct B2 : T +{ + typedef typename T::myT const *myconst; + typename T::myT const *a; + myconst b; +}; + +B1<AS> b1; // { dg-error "instantiated" "" } +B2<AS> b2; diff --git a/gcc/testsuite/gcc.c-torture/compile/920625-1.x b/gcc/testsuite/gcc.c-torture/compile/920625-1.x new file mode 100644 index 00000000000..c88a02e9086 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/920625-1.x @@ -0,0 +1,25 @@ +# The problem on IA-64 is that if-conversion creates a sequence +# +# (p17) cmp.geu p6, p7 = r48, r15 +# (p16) cmp.gtu p6, p7 = r48, r15 +# +# where p16 and p17 are complemenary, but the assembler DV validation +# code doesn't recognize that p6 and p7 are complimentary, and so +# we end up warning for a later use +# +# (p6) addl r14 = 1, r0 +# (p7) mov r14 = r0 +# +# that appears to be a WAW violation. + +set torture_eval_before_compile { + + set compiler_conditional_xfail_data { + "missing .pred.rel.mutex directive" \ + "ia64-*-*" \ + { "-O2" "-O3" "-Os" } \ + { "" } + } +} + +return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/981223-1.x b/gcc/testsuite/gcc.c-torture/compile/981223-1.x new file mode 100644 index 00000000000..f8d2aa6f938 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/981223-1.x @@ -0,0 +1,20 @@ +# The problem on IA-64 is that the assembler emits +# +# Warning: Additional NOP may be necessary to workaround Itanium +# processor A/B step errata +# +# This can be fixed by adding "-mb-step" to the command line, which +# does in fact add the extra nop, if someone can tell me how to do +# that for a c-torture compile test. + +set torture_eval_before_compile { + + set compiler_conditional_xfail_data { + "need -mb-step" \ + "ia64-*-*" \ + { "-O2" "-O3" "-Os" } \ + { "" } + } +} + +return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/20020225-1.c b/gcc/testsuite/gcc.c-torture/execute/20020225-1.c new file mode 100644 index 00000000000..61724a1f006 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020225-1.c @@ -0,0 +1,17 @@ +/* This testcase failed at -O2 on powerpc64 due to andsi3 writing + non-zero bits to the high 32 bits of a 64 bit register. */ + +extern void abort (void); +extern void exit (int); + +unsigned long foo (unsigned long base, unsigned int val) +{ + return base + (val & 0x80000001); +} + +int main (void) +{ + if (foo (0L, 0x0ffffff0) != 0L) + abort (); + exit (0); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/960416-1.x b/gcc/testsuite/gcc.c-torture/execute/960416-1.x new file mode 100644 index 00000000000..ca8e06c4077 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/960416-1.x @@ -0,0 +1,5 @@ +if { [istarget "h8300*-*-*"] } { + return 1 +} + +return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/divconst-3.x b/gcc/testsuite/gcc.c-torture/execute/divconst-3.x new file mode 100644 index 00000000000..ca8e06c4077 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/divconst-3.x @@ -0,0 +1,5 @@ +if { [istarget "h8300*-*-*"] } { + return 1 +} + +return 0 diff --git a/gcc/testsuite/gcc.dg/20020220-1.c b/gcc/testsuite/gcc.dg/20020220-1.c new file mode 100644 index 00000000000..aa948aa15e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20020220-1.c @@ -0,0 +1,19 @@ +/* PR c++/4574 + This testcase ICEd because expand_and did not handle VOIDmode + CONST_DOUBLE arguments. */ +/* { dg-do compile } */ +/* { dg-options "-w" } */ + +struct A { + unsigned long long b : 8; + unsigned long long c : 18; +}; + +int main() +{ + struct A a; + long long l; + + l = a.c = 0x123456789aULL; + return 0; +} diff --git a/gcc/testsuite/gcc.dg/20020220-2.c b/gcc/testsuite/gcc.dg/20020220-2.c new file mode 100644 index 00000000000..c6c57a92136 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20020220-2.c @@ -0,0 +1,12 @@ +/* PR c/4697 + Test whether value computed not used warning is given for compound + expression. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wunused" } */ + +int b; +int foo (int a) +{ + a = a + 1, 5 * b; /* { dg-warning "value computed is not used" } */ + return a; +} diff --git a/gcc/testsuite/gcc.dg/20020222-1.c b/gcc/testsuite/gcc.dg/20020222-1.c new file mode 100644 index 00000000000..61f10540f2a --- /dev/null +++ b/gcc/testsuite/gcc.dg/20020222-1.c @@ -0,0 +1,34 @@ +/* PR optimization/5747 + This testcase ICEd on sparc because move_movables created new pseudos, + but did not update reg info which load_mems needed. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fPIC" { target sparc*-*-* } } */ + +extern void foo (void); +static char a[256]; + +void +bar (void) +{ + unsigned int i; + static int b = 0; + int c; + + if (b == 0) + { + b = 1; + foo (); + c = 0; + for (i = 0; i < 10; i++) + a[i + '0'] = c++; + for (i = 'A'; i <= 'Z'; i++) + a[i] = c++; + a['$'] = c++; + a['%'] = c++; + a['.'] = c++; + a['_'] = c++; + for (i = 'a'; i <= 'z'; i++) + a[i] = c++; + } +} diff --git a/gcc/testsuite/gcc.dg/20020224-1.c b/gcc/testsuite/gcc.dg/20020224-1.c new file mode 100644 index 00000000000..a286b6b0599 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20020224-1.c @@ -0,0 +1,41 @@ +/* PR target/5755 + This testcase failed because the caller of a function returning struct + expected the callee to pop up the hidden return structure pointer, + while callee was actually not poping it up (as the hidden argument + was passed in register). */ +/* { dg-do run { target i?86-*-* } } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ + +extern void abort (void); +extern void exit (int); + +typedef struct { + int a1, a2; +} A; + +A a; + +A __attribute__ ((regparm (2))) +foo (int x) +{ + return a; +} + +int __attribute__ ((regparm (2))) +bar (int x) +{ + int r = foo(0).a2; + return r; +} + +int +main () +{ + int f; + a.a1 = 530; + a.a2 = 980; + f = bar (0); + if (f != 980) + abort (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/attr-alwaysinline.c b/gcc/testsuite/gcc.dg/attr-alwaysinline.c new file mode 100644 index 00000000000..8ff92b23a72 --- /dev/null +++ b/gcc/testsuite/gcc.dg/attr-alwaysinline.c @@ -0,0 +1,19 @@ +/* Test always_inline attribute, which forces inlining of functions + even at no optimization. */ +/* Origin: Aldy Hernandez <aldyh@redhat.com>. */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +static inline int sabrina (void) __attribute__((always_inline)); + +static inline int sabrina (void) +{ + return 13; +} + +int bar (void) +{ + return sabrina () + 68; +} + +/* { dg-final { scan-assembler-not "sabrina" } } */ diff --git a/gcc/testsuite/gcc.dg/cpp/wchar-1.c b/gcc/testsuite/gcc.dg/cpp/wchar-1.c new file mode 100644 index 00000000000..f93c1cd4ec0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/wchar-1.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. */ + +/* { dg-do run } */ + +/* Source: Neil Booth, 24 Feb 2002. + + Test if compiler and preprocessor agree on signeness of wide + chars. */ + +int main () +{ + __WCHAR_TYPE__ c = -1; + +#if L'\x0' - 1 < 0 + if (c > 0) + abort (); +#else + if (c < 0) + abort (); +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/debug/20020224-1.c b/gcc/testsuite/gcc.dg/debug/20020224-1.c new file mode 100644 index 00000000000..c61a17aed10 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/20020224-1.c @@ -0,0 +1,60 @@ +/* { dg-do compile } */ + +/* Here's the deal: f3 is not inlined because it's too big, but f2 and + f1 are inlined into it. We used to fail to emit debugging info for + t1, because it was moved inside the (inlined) block of f1, marked + as abstract, then we'd crash. */ + +#define UNUSED __attribute__((unused)) +#define EXT __extension__ + +int undef(void); + +inline static void +f1 (int i UNUSED) +{ +} + +inline static void +f2 (void) +{ + f1 (EXT ({ int t1 UNUSED; undef (); })); +} + +inline static void +f3 (void) +{ + int v1 UNUSED; + int v2 UNUSED; + + EXT ({ int t2 UNUSED; if (0) undef (); 0; }) + && EXT ({ int t3 UNUSED; if (0) undef (); 0; }); + + if (1) + { + undef (); + if (1) + f2 (); + } + + { + undef (); + } +} + +inline static void +f4 (void) +{ + EXT ({ undef (); 1; }) && EXT ({ int t4 UNUSED = ({ 1; }); 1; }); + + { } + + EXT ({ int t5 UNUSED; if (0) undef (); 0; }); + + f4 (); + + undef (); + f3 (); + + return; +} |