diff options
author | no-author <no-author@gcc.gnu.org> | 2002-12-03 22:57:20 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 2002-12-03 22:57:20 +0000 |
commit | 54cae262c9ca867d53a08dfe01def84cdb3590da (patch) | |
tree | 2f853afecc70c62df9042ab024c3f788626b7e19 /gcc | |
parent | 4cdbdeff0cb5f33caa32c24dec17b0e6260f7f37 (diff) |
This commit was manufactured by cvs2svn to create branch
'tree-ssa-20020619-branch'.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@59786 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
23 files changed, 525 insertions, 0 deletions
diff --git a/gcc/config/rs6000/t-netbsd b/gcc/config/rs6000/t-netbsd new file mode 100644 index 00000000000..0cb08e730c0 --- /dev/null +++ b/gcc/config/rs6000/t-netbsd @@ -0,0 +1,42 @@ +# Support for NetBSD PowerPC ELF targets (SVR4 ABI). + +LIB2FUNCS_EXTRA = tramp.S + +tramp.S: $(srcdir)/config/rs6000/tramp.asm + cat $(srcdir)/config/rs6000/tramp.asm > tramp.S + +crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm + cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S + +EXTRA_PARTS += crtsavres$(objext) + +# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata. +CRTSTUFF_T_CFLAGS += -msdata=none +CRTSTUFF_T_CFLAGS_S += -msdata=none + +# Switch synonyms +MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \ + msoft-float=mcpu?403 \ + msoft-float=mcpu?405 \ + msoft-float=mcpu?ec603e \ + msoft-float=mcpu?801 \ + msoft-float=mcpu?821 \ + msoft-float=mcpu?823 \ + msoft-float=mcpu?860 + +MULTILIB_OPTIONS = msoft-float +MULTILIB_DIRNAMES = soft-float +MULTILIB_EXTRA_OPTS = fPIC mstrict-align +MULTILIB_EXCEPTIONS = + +MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib +EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \ + crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \ + crtsavres$(objext) + +$(T)crtsavres$(objext): crtsavres.S + $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ + -c crtsavres.S -o $(T)crtsavres$(objext) diff --git a/gcc/config/s390/t-crtstuff b/gcc/config/s390/t-crtstuff new file mode 100644 index 00000000000..5572e6bf54e --- /dev/null +++ b/gcc/config/s390/t-crtstuff @@ -0,0 +1,4 @@ +# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, +# because then __FRAME_END__ might not be the last thing in .eh_frame +# section. +CRTSTUFF_T_CFLAGS = -fno-asynchronous-unwind-tables diff --git a/gcc/testsuite/g++.dg/abi/empty10.C b/gcc/testsuite/g++.dg/abi/empty10.C new file mode 100644 index 00000000000..970afbaf512 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/empty10.C @@ -0,0 +1,27 @@ +// { dg-do run { target i?86-*-* } } +// { dg-options "-fabi-version=0 -w" } + +struct E {}; +struct E2 : public E {}; + +struct A { + int i; +}; + +struct B { + int j; +}; + +struct C : + public E, + public A, + public E2, + virtual public B { +}; + +C c; + +int main () { + if (((char*)(B*)&c - (char*)&c) != 8) + return 1; +} diff --git a/gcc/testsuite/g++.dg/abi/empty11.C b/gcc/testsuite/g++.dg/abi/empty11.C new file mode 100644 index 00000000000..b35363f5bf6 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/empty11.C @@ -0,0 +1,19 @@ +// { dg-do run } +// { dg-options "-w -fabi-version=0" } + +struct E {}; +struct E2 : public E {}; +struct E3 : public E, public E2 {}; +struct E4 : public E, public E2, public E3 { }; +struct E5 : public E, public E2, public E3, public E4 {}; + +struct S : public virtual E5 { + E e; +}; + +S s; + +int main () { + if ((char*)(E4*)&s - (char*)&s == 0) + return 1; +} diff --git a/gcc/testsuite/g++.dg/inherit/typedef1.C b/gcc/testsuite/g++.dg/inherit/typedef1.C new file mode 100644 index 00000000000..20da08b2c43 --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/typedef1.C @@ -0,0 +1,8 @@ +namespace NS { +class X {}; +typedef X Y; +} + +struct Base : virtual public NS::Y { + Base() : NS::Y() {} +}; diff --git a/gcc/testsuite/g++.dg/inherit/typeinfo1.C b/gcc/testsuite/g++.dg/inherit/typeinfo1.C new file mode 100644 index 00000000000..794776ecbe8 --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/typeinfo1.C @@ -0,0 +1,18 @@ +typedef struct { + virtual const char *blah() { + return "Heya::blah"; + } +} Heya; + +struct Grok : public Heya { + virtual const char *blah() { + return "Grok::blah"; + } +}; + +int main() { + Grok *g = new Grok(); + delete g; + return 0; +} + diff --git a/gcc/testsuite/g++.dg/init/brace2.C b/gcc/testsuite/g++.dg/init/brace2.C new file mode 100644 index 00000000000..488d916aa42 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/brace2.C @@ -0,0 +1,8 @@ +// { dg-do compile } +// [dcl.init] paragraph 13. +int x = { 2 }; +const char * y = { "hello" }; +int a = 2; +int b = { 2,3 }; // { dg-error "requires one element" } +int c = { { 2 } } ; // { dg-error "braces around scalar initializer" } + diff --git a/gcc/testsuite/g++.dg/init/brace3.C b/gcc/testsuite/g++.dg/init/brace3.C new file mode 100644 index 00000000000..0a1ee8f00a9 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/brace3.C @@ -0,0 +1 @@ +int array[2][1] = { {0} {1} }; // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/init/string1.C b/gcc/testsuite/g++.dg/init/string1.C new file mode 100644 index 00000000000..597b8619e72 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/string1.C @@ -0,0 +1,8 @@ +extern void f (char*); + +extern const char * const target = "foo"; + +void g () +{ + f (target); // { dg-error "conversion" } +} diff --git a/gcc/testsuite/g++.dg/lookup/anon2.C b/gcc/testsuite/g++.dg/lookup/anon2.C new file mode 100644 index 00000000000..b0a7c07af96 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/anon2.C @@ -0,0 +1,6 @@ +// { dg-do compile } +// { dg-options "" } + +class { int i; } a; // { dg-error "private" } +void foo() { a.i; } // { dg-error "context" } + diff --git a/gcc/testsuite/g++.dg/overload/ambig1.C b/gcc/testsuite/g++.dg/overload/ambig1.C new file mode 100644 index 00000000000..2adc78c795a --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/ambig1.C @@ -0,0 +1,23 @@ +// [over.best.ics]: For the purpose of ranking implicit conversion +// sequences as described in _over.ics.rank_, the ambiguous conversion +// sequence is treated as a user-defined sequence that is indistinguishable +// from any other user- defined conversion sequence. + +struct A +{ + A(long); + A(char); +}; + +struct B +{ + B(int); +}; + +void f(A); // { dg-error "" "candidate" } +void f(B); // { dg-error "" "candidate" } + +int main() +{ + f (42); // { dg-error "ambiguous" "ambiguous" } +} diff --git a/gcc/testsuite/g++.dg/parse/defarg1.C b/gcc/testsuite/g++.dg/parse/defarg1.C new file mode 100644 index 00000000000..77c50e8c3a9 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/defarg1.C @@ -0,0 +1,5 @@ +class A +{ +public: + A(int nBits = ((int)0x8) | ((int)0x4) | ((int)0x2)); +}; diff --git a/gcc/testsuite/g++.dg/rtti/cv1.C b/gcc/testsuite/g++.dg/rtti/cv1.C new file mode 100644 index 00000000000..59dd6592c9d --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/cv1.C @@ -0,0 +1,17 @@ +// { dg-do run } + +#include <typeinfo> +#include <string.h> + +struct S {}; + +typedef S volatile T[4]; + +T t[3]; + +const std::type_info& ti = typeid (t); + +int main () { + if (strcmp (ti.name (), "A3_A4_1S") != 0) + return 1; +} diff --git a/gcc/testsuite/g++.dg/template/char1.C b/gcc/testsuite/g++.dg/template/char1.C new file mode 100644 index 00000000000..64ffda8fd36 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/char1.C @@ -0,0 +1,4 @@ +template <class CharType, CharType line_terminator = 0> +class String {}; + +String<char, 255> s; diff --git a/gcc/testsuite/g++.dg/template/ctor2.C b/gcc/testsuite/g++.dg/template/ctor2.C new file mode 100644 index 00000000000..1c8d8a65d9b --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ctor2.C @@ -0,0 +1,18 @@ +// { dg-do run } + +int i; + +template <class T> +struct S +{ + S () { i = 1; } +}; + +static S<int> s[1]; + +int main () +{ + if (!i) + return 1; +} + diff --git a/gcc/testsuite/g++.dg/template/friend8.C b/gcc/testsuite/g++.dg/template/friend8.C new file mode 100644 index 00000000000..21fd242f183 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend8.C @@ -0,0 +1,18 @@ +template <int N> struct ivector +{ + template <int r, int c> friend void + mult_mv (); +}; + +template struct ivector<3>; + +template <int r, int c> void +mult_mv () +{ + c; +} + +void get_local_point_pos () +{ + mult_mv<7, 3> (); +} diff --git a/gcc/testsuite/g++.dg/template/strlen1.C b/gcc/testsuite/g++.dg/template/strlen1.C new file mode 100644 index 00000000000..ddec51d7b1e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/strlen1.C @@ -0,0 +1,9 @@ +template <typename A1> +void monk2 (A1) {} + +unsigned int strlen (const char*); + +void monk () +{ + monk2 (strlen ("")); +} diff --git a/gcc/testsuite/g++.dg/template/varmod1.C b/gcc/testsuite/g++.dg/template/varmod1.C new file mode 100644 index 00000000000..0747fe99587 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/varmod1.C @@ -0,0 +1,10 @@ +// { dg-options "-w" } + +template<typename T> void foo(T); + +void bar() +{ + int i; + int A[i][i]; + foo(A); // { dg-error "" } +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20021119-1.c b/gcc/testsuite/gcc.c-torture/execute/20021119-1.c new file mode 100644 index 00000000000..c4ef460d45a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20021119-1.c @@ -0,0 +1,17 @@ +/* PR 8639. */ + +extern void abort(void); + +int foo (int i) +{ + int r; + r = (80 - 4 * i) / 20; + return r; +} + +int main () +{ + if (foo (1) != 3) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20021127-1.c b/gcc/testsuite/gcc.c-torture/execute/20021127-1.c new file mode 100644 index 00000000000..0b3ff9ac850 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20021127-1.c @@ -0,0 +1,14 @@ +long long a = -1; +long long llabs (long long); +void abort (void); +int +main() +{ + if (llabs (a) != 1) + abort (); + return 0; +} +long long llabs (long long b) +{ + abort (); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20021127-1.x b/gcc/testsuite/gcc.c-torture/execute/20021127-1.x new file mode 100644 index 00000000000..efd854a050e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20021127-1.x @@ -0,0 +1,2 @@ +set additional_flags "-std=c99" +return 0 diff --git a/gcc/testsuite/gcc.dg/bitfld-6.c b/gcc/testsuite/gcc.dg/bitfld-6.c new file mode 100644 index 00000000000..a9a7f409992 --- /dev/null +++ b/gcc/testsuite/gcc.dg/bitfld-6.c @@ -0,0 +1,16 @@ +/* { dg-options "" } */ +#include <limits.h> + +struct s +{ + int i1 : sizeof (int) * CHAR_BIT; + int i2 : sizeof (int) * CHAR_BIT; + int i3 : sizeof (int) * CHAR_BIT; + int i4 : sizeof (int) * CHAR_BIT; + int i5 : sizeof (int) * CHAR_BIT; + int i6 : sizeof (int) * CHAR_BIT; + int i7 : sizeof (int) * CHAR_BIT; + int i8 : sizeof (int) * CHAR_BIT; +}; + +int f[sizeof (struct s) != sizeof (int) * 8 ? -1 : 1]; diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c new file mode 100644 index 00000000000..77e44e852ad --- /dev/null +++ b/gcc/unwind-dw2-fde-darwin.c @@ -0,0 +1,231 @@ +/* Copyright (C) 2001, 2002 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. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* Locate the FDE entry for a given address, using Darwin's keymgr support. */ + +#include "tconfig.h" +#include <string.h> +#include <stdlib.h> +#include "dwarf2.h" +#include "unwind.h" +#define NO_BASE_OF_ENCODED_VALUE +#define DWARF2_OBJECT_END_PTR_EXTENSION +#include "unwind-pe.h" +#include "unwind-dw2-fde.h" +/* Carefully don't include gthr.h. */ + +typedef int __gthread_mutex_t; +#define __gthread_mutex_lock(x) (void)(x) +#define __gthread_mutex_unlock(x) (void)(x) + +static fde * _Unwind_Find_registered_FDE (void *pc, + struct dwarf_eh_bases *bases); + +#define _Unwind_Find_FDE _Unwind_Find_registered_FDE +#include "unwind-dw2-fde.c" +#undef _Unwind_Find_FDE + +/* KeyMgr stuff. */ +#define KEYMGR_GCC3_LIVE_IMAGE_LIST 301 /* loaded images */ +#define KEYMGR_GCC3_DW2_OBJ_LIST 302 /* Dwarf2 object list */ + +extern void *_keymgr_get_and_lock_processwide_ptr (int); +extern void _keymgr_set_and_unlock_processwide_ptr (int, void *); +extern void _keymgr_unlock_processwide_ptr (int); + +struct mach_header; +extern char *getsectdatafromheader (struct mach_header*, const char*, + const char *, unsigned long *); + +/* This is referenced from KEYMGR_GCC3_DW2_OBJ_LIST. */ +struct km_object_info { + struct object *seen_objects; + struct object *unseen_objects; + unsigned spare[2]; +}; + +/* Node of KEYMGR_GCC3_LIVE_IMAGE_LIST. Info about each resident image. */ +struct live_images { + unsigned long this_size; /* sizeof (live_images) */ + struct mach_header *mh; /* the image info */ + unsigned long vm_slide; + void (*destructor)(struct live_images *); /* destructor for this */ + struct live_images *next; + unsigned int examined_p; + void *fde; + void *object_info; + unsigned long info[2]; /* Future use. */ +}; + +/* Bits in the examined_p field of struct live_images. */ +enum { + EXAMINED_IMAGE_MASK = 1, /* We've seen this one. */ + ALLOCED_IMAGE_MASK = 2, /* The FDE entries were allocated by + malloc, and must be freed. This isn't + used by newer libgcc versions. */ + IMAGE_IS_TEXT_MASK = 4 /* This image is in the TEXT segment. */ +}; + +/* Delete any data we allocated on a live_images structure. + IMAGE has already been removed from the KEYMGR_GCC3_LIVE_IMAGE_LIST. + Called by KeyMgr (which will delete the struct after we return.) */ + +static void +live_image_destructor (struct live_images *image) +{ + if (image->object_info) + { + /* Free any sorted arrays. */ + __deregister_frame_info_bases (image->fde); + + free (image->object_info); + image->object_info = NULL; + if (image->examined_p & ALLOCED_IMAGE_MASK) + free (image->fde); + } +} + +/* Run through the list of live images. If we can allocate memory, + give each unseen image a new `struct object'. Even if we can't, + check whether the PC is inside the FDE of each unseen image. + */ + +static inline fde * +examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc) +{ + fde *result = NULL; + struct live_images *image; + + image = _keymgr_get_and_lock_processwide_ptr (KEYMGR_GCC3_LIVE_IMAGE_LIST); + + for (; image != NULL; image = image->next) + if ((image->examined_p & EXAMINED_IMAGE_MASK) == 0) + { + char *fde; + unsigned long sz; + + fde = getsectdatafromheader (image->mh, "__DATA", "__eh_frame", &sz); + if (fde == NULL) + { + fde = getsectdatafromheader (image->mh, "__TEXT", + "__eh_frame", &sz); + if (fde != NULL) + image->examined_p |= IMAGE_IS_TEXT_MASK; + } + + /* If .eh_frame is empty, don't register at all. */ + if (fde != NULL && sz > 0) + { + char *real_fde = (fde + image->vm_slide); + struct object *ob = NULL; + struct object panicob; + + if (! dont_alloc) + ob = calloc (1, sizeof (struct object)); + dont_alloc |= ob == NULL; + if (dont_alloc) + ob = &panicob; + + ob->pc_begin = (void *)-1; + ob->tbase = 0; + ob->dbase = 0; + ob->u.single = (struct dwarf_fde *)real_fde; + ob->s.i = 0; + ob->s.b.encoding = DW_EH_PE_omit; + ob->fde_end = real_fde + sz; + + if (! dont_alloc) + { + ob->next = unseen_objects; + unseen_objects = ob; + + image->destructor = live_image_destructor; + image->object_info = ob; + + image->examined_p |= EXAMINED_IMAGE_MASK; + } + image->fde = real_fde; + + result = search_object (ob, pc); + if (result) + { + int encoding; + + bases->tbase = ob->tbase; + bases->dbase = ob->dbase; + + encoding = ob->s.b.encoding; + if (ob->s.b.mixed_encoding) + encoding = get_fde_encoding (result); + read_encoded_value_with_base (encoding, + base_from_object (encoding, ob), + result->pc_begin, + (_Unwind_Ptr *)&bases->func); + break; + } + } + else + image->examined_p |= EXAMINED_IMAGE_MASK; + } + + _keymgr_unlock_processwide_ptr (KEYMGR_GCC3_LIVE_IMAGE_LIST); + + return result; +} + +fde * +_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) +{ + struct km_object_info *the_obj_info; + fde *ret = NULL; + + the_obj_info = + _keymgr_get_and_lock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST); + if (! the_obj_info) + the_obj_info = calloc (1, sizeof (*the_obj_info)); + + if (the_obj_info != NULL) + { + seen_objects = the_obj_info->seen_objects; + unseen_objects = the_obj_info->unseen_objects; + + ret = _Unwind_Find_registered_FDE (pc, bases); + } + + /* OK, didn't find it in the list of FDEs we've seen before, + so go through and look at the new ones. */ + if (ret == NULL) + ret = examine_objects (pc, bases, the_obj_info == NULL); + + if (the_obj_info != NULL) + { + the_obj_info->seen_objects = seen_objects; + the_obj_info->unseen_objects = unseen_objects; + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST, + the_obj_info); + } + return ret; +} |