diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-05-06 11:44:31 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-05-06 11:44:31 +0000 |
commit | 9a429f46712c23fccdcac5ddc674fbf02e2c6d9b (patch) | |
tree | 8ddc551013d8928786763f35e550999f84bd3d94 | |
parent | 80d0dc63dd9c82a61b710f0e2318b9adc00873ff (diff) |
cvs update -Pd -jgcc-3_4-branch:20050{222,506}
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-3_4-rhl-branch@99312 138bc75d-0d04-0410-961f-82ee72b054a4
86 files changed, 2441 insertions, 1642 deletions
diff --git a/ChangeLog b/ChangeLog index f312edbaca6..d36643fa7a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-08 Daniel Jacobowitz <dan@debian.org> + + * configure.in: Use an absolute path to install-sh. + * configure: Regenerated. + 2005-01-12 David Edelsohn <edelsohn@gnu.org> Andreas Schwab <schwab@suse.de> diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 180cf329488..ba917e98ab3 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,21 @@ +2005-04-17 David S. Miller <davem@davemloft.net> + + * include/private/gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM. + * os_dep.c (GC_linux_stack_base): Check for bug present in some + Sparc glibc variants where __libc_stack_end is erroneously set + to "1". Fallback to procfs code in that case. + +2005-04-11 Richard Henderson <rth@redhat.com> + + * include/private/gcconfig.h (alpha-linux): Use LINUX_STACKBOTTOM. + +2005-02-22 Bryce McKinlay <mckinlay@redhat.com> + + PR libgcj/19823 + * configure.host: Set gc_use_mmap on *-linux*. + * configure.in: Define USE_MMAP if gc_use_mmap is set. + * configure: Rebuilt. + 2005-02-08 Jakub Jelinek <jakub@redhat.com> * ia64_save_regs_in_stack.s: Moved to... diff --git a/boehm-gc/configure b/boehm-gc/configure index 20b334af74f..3ff5861be76 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -3076,7 +3076,7 @@ esac # # We don't set NO_EXECUTE_PERMISSION by default because gcj (and # anything else that creates trampolines in gc-allocated memory) -# always needs exec permission. The exception to this is IA-64 and +# always needs exec permission. The exceptions to this are IA-64 and # some variations of Power PC, where trampolines don't contain # executable code. # @@ -3453,6 +3453,13 @@ EOF fi +if test "${gc_use_mmap}" = "yes"; then + cat >> confdefs.h <<\EOF +#define USE_MMAP 1 +EOF + +fi + if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then toolexecdir='$(exec_prefix)/$(target_alias)' diff --git a/boehm-gc/configure.host b/boehm-gc/configure.host index a98a0a7cb30..97f4dacb6de 100644 --- a/boehm-gc/configure.host +++ b/boehm-gc/configure.host @@ -18,8 +18,11 @@ # It sets the following shell variables: # gc_cflags Special CFLAGS to use when building +# gc_use_mmap Set to "yes" on platforms where mmap should be used instead +# of sbrk. This will define USE_MMAP. gc_cflags="" +gc_use_mmap= # We should set -fexceptions if we are using gcc and might be used # inside something like gcj. This is the zeroth approximation: @@ -37,6 +40,12 @@ else esac fi +case "${host}" in + *-linux*) + gc_use_mmap=yes + ;; +esac + case "${target_optspace}:${host}" in yes:*) gc_cflags="${gc_cflags} -Os" diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in index f109c9003ed..69c50ae6a4f 100644 --- a/boehm-gc/configure.in +++ b/boehm-gc/configure.in @@ -419,6 +419,10 @@ AC_ARG_ENABLE(full-debug, esac ] fi) +if test "${gc_use_mmap}" = "yes"; then + AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory]) +fi + if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then toolexecdir='$(exec_prefix)/$(target_alias)' diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index 8dc776286cf..586f31daf41 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -897,12 +897,10 @@ extern ptr_t GC_SysVGetDataStart(); # ifdef __arch64__ # define DATASTART GC_SysVGetDataStart(0x100000, _etext) - /* libc_stack_end is not set reliably for sparc64 */ -# define STACKBOTTOM ((ptr_t) 0x80000000000ULL) # else # define DATASTART GC_SysVGetDataStart(0x10000, _etext) -# define LINUX_STACKBOTTOM # endif +# define LINUX_STACKBOTTOM # endif # ifdef OPENBSD # define OS_TYPE "OPENBSD" @@ -1514,7 +1512,7 @@ # endif # ifdef LINUX # define OS_TYPE "LINUX" -# define STACKBOTTOM ((ptr_t) 0x120000000) +# define LINUX_STACKBOTTOM # ifdef __ELF__ # define SEARCH_FOR_DATA_START # define DYNAMIC_LOADING diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index fd195e1c806..0e51d75db28 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -912,8 +912,17 @@ ptr_t GC_get_stack_base() } /* Otherwise it's not safe to add 16 bytes and we fall */ /* back to using /proc. */ # else +# ifdef SPARC + /* Older versions of glibc for 64-bit Sparc do not set + * this variable correctly, it gets set to either zero + * or one. + */ + if (__libc_stack_end != (ptr_t) (unsigned long)0x1) + return __libc_stack_end; +# else return __libc_stack_end; # endif +# endif } f = open("/proc/self/stat", O_RDONLY); if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) { diff --git a/configure b/configure index efca95bfa3f..c585143167f 100755 --- a/configure +++ b/configure @@ -818,10 +818,17 @@ rm -f conftestsed.out moveifchange=${srcdir}/move-if-change +srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` + +# We pass INSTALL explicitly to sub-makes. Make sure that it is not +# a relative path. +if test "$INSTALL" = "${srcdir}/install-sh -c"; then + INSTALL="${srcpwd}/install-sh -c" +fi + # Set srcdir to "." if that's what it is. # This is important for multilib support. pwd=`${PWDCMD-pwd}` -srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` if test "${pwd}" = "${srcpwd}" ; then srcdir=. fi @@ -2855,7 +2862,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2859: checking for $ac_word" >&5 +echo "configure:2866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2888,7 +2895,7 @@ if test -z "$ac_cv_prog_AR" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2892: checking for $ac_word" >&5 +echo "configure:2899: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2927,7 +2934,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2931: checking for $ac_word" >&5 +echo "configure:2938: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2960,7 +2967,7 @@ if test -z "$ac_cv_prog_AS" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2964: checking for $ac_word" >&5 +echo "configure:2971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2999,7 +3006,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3003: checking for $ac_word" >&5 +echo "configure:3010: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3032,7 +3039,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3036: checking for $ac_word" >&5 +echo "configure:3043: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3071,7 +3078,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3075: checking for $ac_word" >&5 +echo "configure:3082: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3104,7 +3111,7 @@ if test -z "$ac_cv_prog_LD" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3108: checking for $ac_word" >&5 +echo "configure:3115: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3143,7 +3150,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3147: checking for $ac_word" >&5 +echo "configure:3154: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3176,7 +3183,7 @@ if test -z "$ac_cv_prog_NM" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3180: checking for $ac_word" >&5 +echo "configure:3187: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3215,7 +3222,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3219: checking for $ac_word" >&5 +echo "configure:3226: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3248,7 +3255,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3252: checking for $ac_word" >&5 +echo "configure:3259: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3287,7 +3294,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3291: checking for $ac_word" >&5 +echo "configure:3298: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3320,7 +3327,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3324: checking for $ac_word" >&5 +echo "configure:3331: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3359,7 +3366,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3363: checking for $ac_word" >&5 +echo "configure:3370: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3392,7 +3399,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3396: checking for $ac_word" >&5 +echo "configure:3403: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3431,7 +3438,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3435: checking for $ac_word" >&5 +echo "configure:3442: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3464,7 +3471,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3468: checking for $ac_word" >&5 +echo "configure:3475: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3513,7 +3520,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3517: checking for $ac_word" >&5 +echo "configure:3524: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3546,7 +3553,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3550: checking for $ac_word" >&5 +echo "configure:3557: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3585,7 +3592,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3589: checking for $ac_word" >&5 +echo "configure:3596: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3618,7 +3625,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3622: checking for $ac_word" >&5 +echo "configure:3629: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3657,7 +3664,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3661: checking for $ac_word" >&5 +echo "configure:3668: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3690,7 +3697,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3694: checking for $ac_word" >&5 +echo "configure:3701: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3729,7 +3736,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3733: checking for $ac_word" >&5 +echo "configure:3740: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3762,7 +3769,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3766: checking for $ac_word" >&5 +echo "configure:3773: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3801,7 +3808,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3805: checking for $ac_word" >&5 +echo "configure:3812: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3834,7 +3841,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3838: checking for $ac_word" >&5 +echo "configure:3845: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3873,7 +3880,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3877: checking for $ac_word" >&5 +echo "configure:3884: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3906,7 +3913,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3910: checking for $ac_word" >&5 +echo "configure:3917: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3945,7 +3952,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3949: checking for $ac_word" >&5 +echo "configure:3956: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3978,7 +3985,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3982: checking for $ac_word" >&5 +echo "configure:3989: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4045,7 +4052,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4049: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4056: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -4152,34 +4159,15 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. diff --git a/configure.in b/configure.in index 3040762f5f7..ab8f8a5c915 100644 --- a/configure.in +++ b/configure.in @@ -78,10 +78,17 @@ AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) moveifchange=${srcdir}/move-if-change +srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` + +# We pass INSTALL explicitly to sub-makes. Make sure that it is not +# a relative path. +if test "$INSTALL" = "${srcdir}/install-sh -c"; then + INSTALL="${srcpwd}/install-sh -c" +fi + # Set srcdir to "." if that's what it is. # This is important for multilib support. pwd=`${PWDCMD-pwd}` -srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` if test "${pwd}" = "${srcpwd}" ; then srcdir=. fi diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 32406d46135..84faff91d5d 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,19 @@ +2005-03-21 Zack Weinberg <zack@codesourcery.com> + + Merge from mainline: + + 2005-03-18 Alexandre Oliva <aoliva@redhat.com> + + * gcc_update (silent): Unset instead of initializing to null. + + 2005-03-18 Andreas Schwab <schwab@suse.de> + + * gcc_update (apply_patch): Properly quote $1. + + 2005-03-18 Zack Weinberg <zack@codesourcery.com> + + * gcc_update: Add --silent option. + 2005-01-17 David O'Brien <obrien@FreeBSD.org> * contrib/gcc_update: Explicitly update the branch. diff --git a/contrib/gcc_update b/contrib/gcc_update index 658d5876292..29094e86f2d 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -19,6 +19,9 @@ # If the first parameter is --list, a list of the generated files and # their dependencies will be printed; --help prints this message. # +# If the first parameter is --silent, this script prints nothing other +# than error messages; the second parameter is then interpreted as above. +# # Examples: # # contrib/gcc_update -r gcc_latest_snapshot @@ -51,6 +54,15 @@ UPDATE_OPTIONS=-Pd # Arrange for the value of $0 to be available for functions self=$0 +# This function prints its arguments to standard output unless +# "silent" is set. +unset silent +chat () { + if [ -z "$silent" ]; then + echo "$@" + fi +} + # This function prints a list of all generated files, along with their # dependencies. Note that only one target is supported per line: the # colon is stripped from the output. @@ -114,7 +126,7 @@ touch_files () { echo ':' >> Makefile.$$ echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$ echo ' echo Touching $@...; \' >> Makefile.$$ - echo ' echo Touching $@... 1>&2; \' >> Makefile.$$ + chat ' echo Touching $@... 1>&2; \' >> Makefile.$$ echo ' touch $@' >> Makefile.$$ files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$ while ${MAKE-make} -s -f Makefile.$$ all | grep . > /dev/null; do @@ -128,21 +140,21 @@ touch_files () { # this script. By re-execing it, we ensure that the appropriate # dependencies and rules will be used. touch_files_reexec () { - echo "Adjusting file timestamps" - exec ${CONFIG_SHELL-/bin/sh} $self --touch + chat "Adjusting file timestamps" + exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch } # This functions applies a patch to an existing tree. apply_patch () { - if [ -f $1 ]; then + if [ -f "$1" ]; then echo "Applying patch file $1" - case "$1" in + case $1 in *gz) - gzip -d -c $1 | patch -p1 ;; + gzip -d -c "$1" | patch -p1 ;; *bz2) - bzip2 -d -c $1 | patch -p1 ;; + bzip2 -d -c "$1" | patch -p1 ;; *) - cat $1 | patch -p1 ;; + patch -p1 < "$1";; esac fi touch_files_reexec @@ -155,6 +167,13 @@ if [ ! -f gcc/version.c ]; then fi case "$1" in +--silent) + silent=t + shift + ;; +esac + +case "$1" in # First of all, check whether we are going to process a patch. --patch) if test "$#" != 2; then @@ -208,8 +227,8 @@ else set -- $UPDATE_OPTIONS ${1+"$@"} fi -echo "Updating CVS tree" -$GCC_CVS -q update -r gcc-3_4-branch ${1+"$@"} +chat "Updating CVS tree" +$GCC_CVS -q ${silent+-Q} update -r gcc-3_4-branch ${1+"$@"} if [ $? -ne 0 ]; then (touch_files_reexec) echo "CVS update of full tree failed." >&2 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a4557bbfa6..6bb7f400b94 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,10 +1,321 @@ -2005-02-22 Jakub Jelinek <jakub@redhat.com> +2005-05-02 Janis Johnson <janis187@us.ibm.com> + + PR 19985 + * gcov-io.h: Declare gcov external functions hidden. + +2005-05-01 Gerald Pfeifer <gerald@pfeifer.com> + + * config/freebsd-spec.h (FBSD_CPP_SPEC): Revert last change. + +2005-05-01 Gerald Pfeifer <gerald@pfeifer.com> + + Backport from mainline + * doc/install.texi (Specific): Avoid using asterisks in @anchor + names related to target triplets. + Remove i?86-*-esix from platform directory. + Remove powerpc-*-eabiaix from platform directory. + +2005-05-01 Eric Botcazou <ebotcazou@libertysurf.fr> + + PR bootstrap/20633 + * config/freebsd-spec.h (FBSD_CPP_SPEC): Add %(cpp_arch). + +2005-05-01 Gerald Pfeifer <gerald@pfeifer.com> + + * doc/install.texi (Specific): Omit dots in the @anchors names + for i?86-*-sco3.2v5* and sparc-sun-solaris2.7. + Omit underscores for x86_64-*-* and the "all ELF targets" entry. + +2005-05-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/21213 + * c-decl.c (finish_struct): Don't dereference NULL TYPE_FIELDS of + transparent union. + +2005-05-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/20740 + * c-format.c (init_dynamic_asm_fprintf_info): Give errors, not + aborts, if __gcc_host_wide_int__ is not properly defined. + (init_dynamic_diag_info): Give errors, not aborts, if location_t, + tree or __gcc_host_wide_int__ are not properly defined. + +2005-05-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/11459 + PR c/18502 + * gcc.c (cpp_unique_options): Remove %{trigraphs}. + (cpp_options, cc1_options): Change %{std*} %{ansi} to + %{std*&ansi&trigraphs}. + +2005-04-29 Alan Modra <amodra@bigpond.net.au> + + PR target/21098 + * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. + * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. + +2005-04-25 Ralf Corsepius <ralf.corsepius@rtems.org> + + * config.gcc (avr-*-*): Remove redundant "case". + +2005-04-25 Ralf Corsepius <ralf.corsepius@rtems.org> + + PR target/17822 + * config/avr/t-avr (AR_FOR_TARGET,RANLIB_FOR_TARGET): Remove. + +2005-04-25 Ralf Corsepius <ralf.corsepius@rtems.org> + + PR target/17824 + * config/c4x/c4x.h (ASM_PROG, LD_PROG): Remove. + +2005-04-22 David Edelsohn <edelsohn@gnu.org> + + Backport from mainline. + * config/rs6000/rs6000.c (rs6000_init_libfuncs): Set TFmode + optabs to xlq names if TARGET_XL_COMPAT. + +2005-04-22 Eric Botcazou <ebotcazou@libertysurf.fr> + + * doc/invoke.texi (SPARC options): Document that -mapp-regs + is turned off by default on Solaris. + +2005-04-15 Dave Korn <dave.korn@artimi.com> + + * gcc.c (default_compilers): Clarify obscure error message when + reading from standard input. + +2005-04-15 Eric Botcazou <ebotcazou@libertysurf.fr> + + * config/sparc/sparc.c (legitimate_address_p): Use TARGET_ARCH32. + +2005-04-11 David Edelsohn <edelsohn@gnu.org> + + Backport from mainline: + * config/rs6000/aix52.h (atoll): Declare. + +2005-04-08 Ulrich Weigand <uweigand@de.ibm.com> + + Backport from mainline: + * config/s390/tpf.h (ASM_SPEC): Define. + +2005-04-06 Dale Johannesen <dalej@apple.com> + + PR middle-end/19225 + * calls.c (expand_call): Flush pending deferrals before + throwing call. + +2005-04-06 Eric Botcazou <ebotcazou@libertysurf.fr> + + PR target/17245 + * config/sparc/sparc.c (legitimate_address_p): Remove 'imm2'. + Revert 2004-10-08 patch. Reject TFmode LO_SUM in 32-bit mode. + +2005-04-05 James E. Wilson <wilson@specifixinc.com> + + PR target/20670 + * unwind-ia64.c (uw_intall_context): Add missing load of r27. + +2005-04-04 Eric Botcazou <ebotcazou@libertysurf.fr> + + * doc/invoke.texi (SPARC options): Document that + -mlittle-endian is not supported on Linux either. + +2005-03-25 Gabriel Dos Reis <gdr@integrable-solutions.net> + + PR c++/18644 + * doc/invoke.texi (-Wsynth): Don't document, as it now is void of + semantics. + +2005-03-31 Alan Modra <amodra@bigpond.net.au> + + PR target/20611 + * config/rs6000/rs6000.md (load_toc_v4_PIC_1b): Remove inline + label operand. Remove (use (unspec..)). Don't emit a label on + the offset word. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Don't + generate inline label for load_toc_v4_PIC_1b. + (rs6000_emit_load_toc_table): Likewise. + +2005-03-31 Alan Modra <amodra@bigpond.net.au> + + * config.gcc (cpu_is_64bit): Set for 64-bit powerpc cpus. + (powerpc64-*-linux*): Use it. Rearrange tm_file assignment. + (powerpc-*-linux*): Build a biarch compiler when --enable-targets + is given with "powerpc64*" or "all", or when --with-cpu chooses + a 64-bit cpu. + +2005-03-30 Alan Modra <amodra@bigpond.net.au> + + * doc/install.texi: Update binutils requirement for powerpc*-linux. + +2005-03-25 John David Anglin <dave.anglin@nrc-crnc.gc.ca> + + PR target/15491 + * vax.c (vax_rtx_costs_1): Merge with vax_rtx_costs. + (vax_rtx_costs): Return false when passed unsupported rtx's. Handle + FLOAT_EXTEND, FLOAT_TRUNCATE and TRUNCATE. Fix costs for POST_INC, + PRE_DEC, NEG and NOT. + +2005-03-23 Uros Bizjak <uros@kss-loka.si> + + * simplify-rtx.c (simplify_unary_operation) <NOT>: Add missing break + in code that deals with logicals on floats. + +2005-03-22 Uros Bizjak <uros@kss-loka.si> + + PR target/14981 + Backport from mainline + 2004-02-18 Jan Hubicka <jh@suse.cz> + * simplify-rtx.c (simplify_unary_operation): Deal with logicals on + floats. + (simplify_binary_operation): Deal with logicals on floats. + * i386.md (SSE fabs splitters): Emit new patterns. + (SSE cmov splitters): Likewise. + (sse_andv4sf3, sse_nandv4sf3, sse_iorv4sf3, sse_xorv4sf3 + (sse_andv2df3, sse_nandv2df3, sse_iorv2df3, sse_xorv2df3): Do not use + subregs. + (sse_andsf3, sse_nandsf3, sse_xorsf3): Kill. + (sse_anddf3, sse_nanddf3, sse_xordf3): Kill. + +2005-03-20 Marek Michalkiewicz <marekm@amelek.gda.pl> + + PR target/18551 + * config/avr/avr.c (avr_output_function_prologue): Do not use + current_function_name() in a label, use a local label instead. + +2005-03-19 Joseph S. Myers <joseph@codesourcery.com> + + * c.opt (ansi, std=iso9899:1990, std=iso9899:1999, + std=iso9899:199x): Correct descriptions. + +2005-03-19 Andy Hutchinson <HutchinsonAndy@netscape.net> + + PR target/18251 + * config/avr/avr.md (movstrhi): Rewrite as RTL loop. + (*movstrqi_insn): Delete. + (*movstrhi): Delete. + +2005-03-17 Richard Sandiford <rsandifo@redhat.com> + + PR rtl-optimization/19683 + * reload1.c (choose_reload_regs): Pass the number of bits, not the + number of bytes, to smallest_int_for_mode. Fix arguments to + REG_CANNOT_CHANGE_MODE_P. + +2005-03-17 Alan Modra <amodra@bigpond.net.au> + + * config/rs6000/linux-unwind.h: New file backported from gcc-4.0. + * config/rs6000/linux.h: #include linux-unwind.h in place of all + unwind support in this file. + * config/rs6000/linux64.h: Likewise. + +2005-03-16 Roger Sayle <roger@eyesopen.com> + + PR rtl-optimization/17825 + Backport from mainline + 2004-11-27 Jakub Jelinek <jakub@redhat.com> + * combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new) + or not. + +2005-03-16 Roger Sayle <roger@eyesopen.com> PR target/18371 + Backport from mainline 2004-12-19 Steven Bosscher <stevenb@suse.de> * config/i386/i386.c (ix86_split_to_parts): Use an array with four elements for decoding a CONST_DOUBLE on 64 bits targets. +2005-03-14 Alan Modra <amodra@bigpond.net.au> + + * config.gcc: Remove excess indentation. + (powerpc*-*-*, rs6000-*-*): Accept --with-cpu/tune power5. + +2005-03-13 Marek Michalkiewicz <marekm@amelek.gda.pl> + + PR target/20288 + * config/avr/avr.c (print_operand): Add 'p' and 'r'. + (out_movhi_r_mr): Read low byte of volatile MEM first. + (out_movhi_mr_r): Write high byte of volatile MEM first. + +2005-03-10 Aldy Hernandez <aldyh@redhat.com> + + * doc/invoke.texi: Add 8540 to list of cpus in rs6000 cpu section. + +2005-03-08 James E Wilson <wilson@specifixinc.com> + + Backport from mainline + 2004-04-13 James E Wilson <wilson@specifixinc.com> + PR middle-end/20364 + * c-opt.c (c_common_post_options): If this_input_filename is NULL, + increment errorcount and return false instead of true. + + Backport from mainline + 2005-02-21 James E Wilson <wilson@specifixinc.com> + * toplev.c (backend_init): Don't call init_adjust_machine_modes here. + (do_compile): Do call it here. + +2005-03-07 David Billinghurst <David.Billinghurst@riotinto.com> + + * config/i386/cygwin1.c(mingw_scan): Use xstrdup in calls to putenv. + +2005-03-03 Alan Modra <amodra@bigpond.net.au> + + PR target/20277 + * config/rs6000/rs6000.c (rs6000_override_options): Don't allow + -mcpu to override any other explicitly given flags. + +2005-03-02 Mark Mitchell <mark@codesourcery.com> + + PR c++/19916 + * varasm.c (initializer_constant_valid_p): Allow conversions + between OFFSET_TYPEs. Tidy. + +2005-02-28 John David Anglin <dave.anglin#nrc-cnrc.gc.ca> + + PR target/19819 + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Allow allow hard registers during + and after reload in REG+REG indexed addresses without REG_POINTER + set in the base and not set in the index. + +2005-02-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR rtl-optimization/17728 + * pa.md (mulsi3, divsi3, udivsi3, modsi3): Change predicate for + operand 0 from general_operand to move_dest_operand. + +2005-02-26 Paolo Carlini <pcarlini@suse.de> + + * doc/extend.texi (Declaring Attributes of Functions)<noreturn>: + Clarify that the alternative way doesn't work in GNU C++. + +2005-02-25 David Edelsohn <edelsohn@gnu.org> + + Backport from mainline: + 2005-02-24 David Edelsohn <edelsohn@gnu.org> + PR target/19019 + * reload.c (operands_match_p): Only increment register number for + SCALAR_INT_MODE_P modes in multiple hard registers. + * config/rs6000/rs6000.md (trunctfdf2): Remove register constraints. + Fix formatting. + +2005-02-24 Jakub Jelinek <jakub@redhat.com> + + PR target/19019 + * Makefile.in (LIB2FUNCS_SHARED_EXTRA, LIB2ADD_SH): New. + (libgcc.mk): Depend on $(LIB2ADD_SH), pass LIB2ADD_SH to mklibgcc. + (LIBGCC_DEPS): Add $(LIB2ADD_SH). + * mklibgcc.in: Handle LIB2ADD_SH. + * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Remove darwin-ldouble.c. + (LIB2FUNCS_STATIC_EXTRA, LIB2FUNCS_SHARED_EXTRA): Set. + * config/rs6000/darwin-ldouble.c: Protect .symver asm also with + defined IN_LIBGCC2_S. + * config/rs6000/darwin-ldouble-shared.c: New file. + +2005-02-23 Michael Beach <michaelb@ieee.org> + + PR target/20159 + * config/sparc/t-elf (startup files): Assemble with CPP. + 2005-02-22 Jakub Jelinek <jakub@redhat.com> Revert: @@ -23,7 +334,7 @@ * doc/install.texi (Specific): Update link for Darwin-specific tool binary site. - + 2005-02-16 David Edelsohn <edelsohn@gnu.org> PR target/19019 @@ -69,8 +380,8 @@ PR preprocessor/19077 * cppmacro.c (cpp_macro_definition): Move handling of whitespace - to PREV_WHITE conditional. Remove overloading of len - variable. + to PREV_WHITE conditional. Remove overloading of len + variable. 2005-02-16 Eric Botcazou <ebotcazou@libertysurf.fr> @@ -83,10 +394,10 @@ 2005-02-11 John David Anglin <dave.anglin@nrc-crnc.gc.ca> - PR middle-end/19697 + PR middle-end/19697 2005-01-30 Roger Sayle <roger@eyesopen.com> - * config/pa/pa.md (anddi3, iordi3): On HPPA64, disallow an integer - constant as the second operand and a register as the third. + * config/pa/pa.md (anddi3, iordi3): On HPPA64, disallow an integer + constant as the second operand and a register as the third. 2005-02-11 Jakub Jelinek <jakub@redhat.com> @@ -189,9 +500,9 @@ the fact that the PC will be off by 4. 2005-01-24 Richard Henderson <rth@redhat.com> - Aldy Hernandez <aldyh@redhat.com> + Aldy Hernandez <aldyh@redhat.com> - * regrename.c (note_sets): Handle subregs. + * regrename.c (note_sets): Handle subregs. 2005-01-24 Jakub Jelinek <jakub@redhat.com> @@ -235,7 +546,7 @@ PR debug/16261 Backport from mainline: 2004-01-27 Devang Patel <dpatel@apple.com> - + * dwarf2out.c: (remove_child_TAG): New function. (gen_subprogram_die): Do not remove all children dies while reusing declaration die for definition. Instead, selectively remove only @@ -270,7 +581,7 @@ 2005-01-15 Ralf Corsepius <ralf.corsepius@rtems.org> * config/mips/rtems.h (MIPS_DEFAULT_GVALUE): Set to 0. - * config/mips/t-rtems (MULTILIBS_DIRNAMES,MULTILIB_OPTIONS): + * config/mips/t-rtems (MULTILIBS_DIRNAMES,MULTILIB_OPTIONS): Remove little endian multilib variants. Add mips32 multilib variant. @@ -329,16 +640,16 @@ 2005-01-06 Richard Sandiford <rsandifo@redhat.com> - PR rtl-opt/13299 - * loop.c (get_monotonic_increment, biased_biv_fits_mode_p, - biv_fits_mode_p, extension_within_bounds_p): New functions. - (check_ext_dependent_givs): Use them. + PR rtl-opt/13299 + * loop.c (get_monotonic_increment, biased_biv_fits_mode_p, + biv_fits_mode_p, extension_within_bounds_p): New functions. + (check_ext_dependent_givs): Use them. 2005-01-05 Richard Henderson <rth@redhat.com> - PR rtl-opt/10692 - * reload1.c (do_input_reload): Restrict the optimization deleteing - a previous output reload to RELOAD_FOR_INPUT. + PR rtl-opt/10692 + * reload1.c (do_input_reload): Restrict the optimization deleteing + a previous output reload to RELOAD_FOR_INPUT. 2005-01-06 Jakub Jelinek <jakub@redhat.com> @@ -381,12 +692,12 @@ John David Anglin <dave.anglin@nrc-cnrc.gc.ca> rtl-optimization/12863 - * config/vax/vax.h (CASE_DROPS_THROUGH): Don't define. - * config/vax/vax.md (casesi): Emit a test-and-branch to make sure - that the case is in range, to make sure the casesi insn is always - in range and never falls through. - (casesi1): Add comment to explain why casesi never falls through. - Remove the unnamed special case casesi pattern. + * config/vax/vax.h (CASE_DROPS_THROUGH): Don't define. + * config/vax/vax.md (casesi): Emit a test-and-branch to make sure + that the case is in range, to make sure the casesi insn is always + in range and never falls through. + (casesi1): Add comment to explain why casesi never falls through. + Remove the unnamed special case casesi pattern. 2004-12-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> @@ -434,7 +745,7 @@ 2004-12-23 Richard Henderson <rth@redhat.com> - PR c/18282 + PR c/18282 * c-decl.c (finish_enum): Retain precision acquired from an attribute. 2004-12-23 Alexandre Oliva <aoliva@redhat.com> @@ -462,7 +773,7 @@ in MMX registers. * config/i386/i386.h (VALID_SSE2_REG_MODE): Don't include VALID_MMX_REG_MODE. - * config/i386/i386.md (movv4sf_internal, movv4si_internal, + * config/i386/i386.md (movv4sf_internal, movv4si_internal, movv2di_internal, movv2si_internal, movv4hi_internal, movv2sf_internal, movv2df_internal, movv8hi_internal, movv16qi_internal, movti_internal): Add leading '*' to name. @@ -801,7 +1112,7 @@ * c-ppoutput.c (pp_file_change): Remove now-redundant check of flag_no_output. - PR preprocessor/17610 + PR preprocessor/17610 * directives.c (do_include_common): Error out if an empty filename is given for #include (or #include_next or #import). PR preprocessor/17610 @@ -889,7 +1200,7 @@ Backport from mainline: 2004-10-18 Eric Botcazou <ebotcazou@libertysurf.fr> - Roger Sayle <roger@eyesopen.com> + Roger Sayle <roger@eyesopen.com> PR middle-end/17813 * dojump.c (discard_pending_stack_adjust): New function. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index bba82cc1159..d80b0fba368 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -553,6 +553,10 @@ LIB2FUNCS_EXTRA = # Assembler files should have names ending in `.asm'. LIB2FUNCS_STATIC_EXTRA = +# List of extra C and assembler files to add to shared libgcc2. +# Assembler files should have names ending in `.asm'. +LIB2FUNCS_SHARED_EXTRA = + # Program to convert libraries. LIBCONVERT = @@ -1144,14 +1148,17 @@ xlimits.h: glimits.h limitx.h limity.h LIB2ADD = $(LIB2FUNCS_EXTRA) LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA) +LIB2ADD_SH = $(LIB2FUNCS_SHARED_EXTRA) -libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext) specs +libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) $(LIB2ADD_SH) \ + xgcc$(exeext) specs objext='$(objext)' \ LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \ LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \ LIBGCOV='$(LIBGCOV)' \ LIB2ADD='$(LIB2ADD)' \ LIB2ADD_ST='$(LIB2ADD_ST)' \ + LIB2ADD_SH='$(LIB2ADD_SH)' \ LIB2ADDEH='$(LIB2ADDEH)' \ LIB2ADDEHSTATIC='$(LIB2ADDEHSTATIC)' \ LIB2ADDEHSHARED='$(LIB2ADDEHSHARED)' \ @@ -1187,8 +1194,8 @@ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \ libgcc.mk $(srcdir)/libgcc2.c $(srcdir)/libgcov.c $(TCONFIG_H) \ $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs \ tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \ - $(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \ - $(srcdir)/config/$(LIB1ASMSRC) \ + $(LIB2ADD_ST) $(LIB2ADD_SH) $(LIB2ADDEH) $(LIB2ADDEHDEP) \ + $(EXTRA_PARTS) $(srcdir)/config/$(LIB1ASMSRC) \ $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h libgcov.a: libgcc.a; @true diff --git a/gcc/c-decl.c b/gcc/c-decl.c index f4cbd2cc1ac..f04cb32af77 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5134,7 +5134,7 @@ finish_struct (tree t, tree fieldlist, tree attributes) make it one, warn and turn off the flag. */ if (TREE_CODE (t) == UNION_TYPE && TYPE_TRANSPARENT_UNION (t) - && TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t))) + && (!TYPE_FIELDS (t) || TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t)))) { TYPE_TRANSPARENT_UNION (t) = 0; warning ("union cannot be made transparent"); diff --git a/gcc/c-format.c b/gcc/c-format.c index a532259750c..620277ff604 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -2518,9 +2518,27 @@ init_dynamic_asm_fprintf_info (void) length modifier to work, one must have issued: "typedef HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code prior to using that modifier. */ - if (!(hwi = maybe_get_identifier ("__gcc_host_wide_int__")) - || !(hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi)))) + hwi = maybe_get_identifier ("__gcc_host_wide_int__"); + if (!hwi) + { + error ("'__gcc_host_wide_int__' is not defined as a type"); + return; + } + hwi = identifier_global_value (hwi); + if (!hwi || TREE_CODE (hwi) != TYPE_DECL) + { + error ("'__gcc_host_wide_int__' is not defined as a type"); + return; + } + hwi = DECL_ORIGINAL_TYPE (hwi); + if (!hwi) abort (); + if (hwi != long_integer_type_node && hwi != long_long_integer_type_node) + { + error ("'__gcc_host_wide_int__' is not defined as 'long'" + " or 'long long'"); + return; + } /* Create a new (writable) copy of asm_fprintf_length_specs. */ new_asm_fprintf_length_specs = xmemdup (asm_fprintf_length_specs, @@ -2563,19 +2581,71 @@ init_dynamic_diag_info (void) However we don't force a hard ICE because we may see only one or the other type. */ if ((loc = maybe_get_identifier ("location_t"))) - loc = TREE_TYPE (identifier_global_value (loc)); + { + loc = identifier_global_value (loc); + if (loc) + { + if (TREE_CODE (loc) != TYPE_DECL) + { + error ("'location_t' is not defined as a type"); + loc = 0; + } + else + loc = TREE_TYPE (loc); + } + } /* We need to grab the underlying `union tree_node' so peek into an extra type level. */ if ((t = maybe_get_identifier ("tree"))) - t = TREE_TYPE (TREE_TYPE (identifier_global_value (t))); + { + t = identifier_global_value (t); + if (t) + { + if (TREE_CODE (t) != TYPE_DECL) + { + error ("'tree' is not defined as a type"); + t = 0; + } + else if (TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE) + { + error ("'tree' is not defined as a pointer type"); + t = 0; + } + else + t = TREE_TYPE (TREE_TYPE (t)); + } + } /* Find the underlying type for HOST_WIDE_INT. For the %w length modifier to work, one must have issued: "typedef HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code prior to using that modifier. */ if ((hwi = maybe_get_identifier ("__gcc_host_wide_int__"))) - hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi)); + { + hwi = identifier_global_value (hwi); + if (hwi) + { + if (TREE_CODE (hwi) != TYPE_DECL) + { + error ("'__gcc_host_wide_int__' is not defined as a type"); + hwi = 0; + } + else + { + hwi = DECL_ORIGINAL_TYPE (hwi); + if (!hwi) + abort (); + if (hwi != long_integer_type_node + && hwi != long_long_integer_type_node) + { + error ("'__gcc_host_wide_int__' is not defined" + " as 'long' or 'long long'"); + hwi = 0; + } + } + } + } /* Assign the new data for use. */ diff --git a/gcc/c.opt b/gcc/c.opt index 9a0b1f88c40..815cad30434 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -405,7 +405,7 @@ Give strings the type \"array of char\" ansi C ObjC C++ ObjC++ -A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead +A synonym for -std=c89 (for C) or -std=c++98 (for C++). d C ObjC C++ ObjC++ Joined @@ -796,7 +796,7 @@ Deprecated in favor of -std=gnu99 std=iso9899:1990 C ObjC -Deprecated in favor of -std=c89 +Conform to the ISO 1990 C standard std=iso9899:199409 C ObjC @@ -804,11 +804,11 @@ Conform to the ISO 1990 C standard as amended in 1994 std=iso9899:1999 C ObjC -Deprecated in favor of -std=c99 +Conform to the ISO 1999 C standard std=iso9899:199x C ObjC -Deprecated in favor of -std=c99 +Deprecated in favor of -std=iso9899:1999 traditional-cpp C ObjC C++ ObjC++ diff --git a/gcc/calls.c b/gcc/calls.c index c1b900b7d8b..86e51842cf5 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2730,10 +2730,14 @@ expand_call (tree exp, rtx target, int ignore) Also, do all pending adjustments now if there is any chance this might be a call to alloca or if we are expanding a sibling call sequence or if we are calling a function that is to return - with stack pointer depressed. */ + with stack pointer depressed. + Also do the adjustments before a throwing call, otherwise + exception handling can fail; PR 19225. */ if (pending_stack_adjust >= 32 || (pending_stack_adjust > 0 && (flags & (ECF_MAY_BE_ALLOCA | ECF_SP_DEPRESSED))) + || (pending_stack_adjust > 0 + && flag_exceptions && !(flags & ECF_NOTHROW)) || pass == 0) do_pending_stack_adjust (); diff --git a/gcc/config.gcc b/gcc/config.gcc index 2230e0bad0c..9275d6755df 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -244,6 +244,7 @@ esac # machines. tm_p_file= cpu_type=`echo ${target} | sed 's/-.*$//'` +cpu_is_64bit= case ${target} in alpha*-*-*) cpu_type=alpha @@ -300,6 +301,11 @@ powerpc*-*-*) cpu_type=rs6000 extra_headers="ppc-asm.h altivec.h spe.h" need_64bit_hwint=yes + case x$with_cpu in + xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345]|xrs64a) + cpu_is_64bit=yes + ;; + esac ;; rs6000*-*-*) need_64bit_hwint=yes @@ -1689,20 +1695,16 @@ pdp11-*-bsd) pdp11-*-*) use_fixproto=yes ;; -avr-*-*) - use_fixproto=yes - ;; # port not yet contributed #powerpc-*-openbsd*) # tmake_file="${tmake_file} rs6000/t-fprules " # extra_headers= # ;; powerpc64-*-linux*) - tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" - case x$with_cpu in - x|xpowerpc64|xdefault64) tm_file="${tm_file} rs6000/default64.h";; - esac - tm_file="${tm_file} rs6000/linux64.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" + test x$with_cpu != x || cpu_is_64bit=yes + test x$cpu_is_64bit != xyes || tm_file="${tm_file} rs6000/default64.h" + tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h" tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-linux rs6000/t-ppccomm rs6000/t-linux64" ;; powerpc64-*-gnu*) @@ -1776,8 +1778,20 @@ powerpc-*-linux*spe*) tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" ;; powerpc-*-linux*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" + case ${enable_targets}:${cpu_is_64bit} in + *powerpc64* | all:* | *:yes) + if test x$cpu_is_64bit = xyes; then + tm_file="${tm_file} rs6000/default64.h" + fi + tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h" + tmake_file="$tmake_file rs6000/t-linux64" + ;; + *) + tm_file="${tm_file} rs6000/linux.h" + ;; + esac ;; powerpc-*-gnu-gnualtivec*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h" @@ -2409,24 +2423,24 @@ if test x$with_cpu = x ; then esac fi - # Similarly for --with-schedule. - if test x$with_schedule = x; then - case ${target} in - hppa1* | parisc1*) - # Override default PA8000 scheduling model. - with_schedule=7100LC - ;; - esac - fi +# Similarly for --with-schedule. +if test x$with_schedule = x; then + case ${target} in + hppa1* | parisc1*) + # Override default PA8000 scheduling model. + with_schedule=7100LC + ;; + esac +fi - # Validate and mark as valid any --with options supported - # by this target. In order to use a particular --with option - # you must list it in supported_defaults; validating the value - # is optional. This case statement should set nothing besides - # supported_defaults. +# Validate and mark as valid any --with options supported +# by this target. In order to use a particular --with option +# you must list it in supported_defaults; validating the value +# is optional. This case statement should set nothing besides +# supported_defaults. - supported_defaults= - case "${target}" in +supported_defaults= +case "${target}" in alpha*-*-*) supported_defaults="cpu tune" for which in cpu tune; do @@ -2580,8 +2594,7 @@ fi eval $with_which= ;; "" | common \ - | power | power2 | power3 | power4 \ - | powerpc | powerpc64 \ + | power | power[2345] | powerpc | powerpc64 \ | rios | rios1 | rios2 | rsc | rsc1 | rs64a \ | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \ | 601 | 602 | 603 | 603e | ec603e | 604 \ @@ -2666,11 +2679,11 @@ fi ;; esac ;; - esac +esac - # Set some miscellaneous flags for particular targets. - target_cpu_default2= - case ${target} in +# Set some miscellaneous flags for particular targets. +target_cpu_default2= +case ${target} in alpha*-*-*) if test x$gas = xyes then @@ -2782,44 +2795,45 @@ fi ;; esac ;; - esac +esac - t= - all_defaults="abi cpu arch tune schedule float mode" - for option in $all_defaults - do - eval "val=\$with_$option" - if test -n "$val"; then - case " $supported_defaults " in - *" $option "*) - ;; - *) - echo "This target does not support --with-$option." 2>&1 - exit 1 - ;; - esac +t= +all_defaults="abi cpu arch tune schedule float mode" +for option in $all_defaults +do + eval "val=\$with_$option" + if test -n "$val"; then + case " $supported_defaults " in + *" $option "*) + ;; + *) + echo "This target does not support --with-$option." 2>&1 + exit 1 + ;; + esac - if test "x$t" = x - then - t="{ \"$option\", \"$val\" }" - else - t="${t}, { \"$option\", \"$val\" }" - fi + if test "x$t" = x + then + t="{ \"$option\", \"$val\" }" + else + t="${t}, { \"$option\", \"$val\" }" fi - done - if test "x$t" = x - then - configure_default_options="{ { NULL, NULL} }" - else - configure_default_options="{ ${t} }" fi +done + +if test "x$t" = x +then + configure_default_options="{ { NULL, NULL} }" +else + configure_default_options="{ ${t} }" +fi - if test "$target_cpu_default2" != "" +if test "$target_cpu_default2" != "" +then + if test "$target_cpu_default" != "" then - if test "$target_cpu_default" != "" - then - target_cpu_default="(${target_cpu_default}|${target_cpu_default2})" - else - target_cpu_default=$target_cpu_default2 - fi + target_cpu_default="(${target_cpu_default}|${target_cpu_default2})" + else + target_cpu_default=$target_cpu_default2 fi +fi diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index ddd65d9fa5d..e65a98b444c 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -660,14 +660,12 @@ avr_output_function_prologue (FILE *file, HOST_WIDE_INT size) } else if (minimize && (frame_pointer_needed || live_seq > 6)) { - const char *cfun_name = current_function_name (); fprintf (file, ("\t" AS1 (ldi, r26) ",lo8(" HOST_WIDE_INT_PRINT_DEC ")" CR_TAB AS1 (ldi, r27) ",hi8(" HOST_WIDE_INT_PRINT_DEC ")" CR_TAB), size, size); - fprintf (file, (AS2 (ldi, r30, pm_lo8(.L_%s_body)) CR_TAB - AS2 (ldi, r31, pm_hi8(.L_%s_body)) CR_TAB), - cfun_name, cfun_name); + fputs ((AS2 (ldi,r30,pm_lo8(1f)) CR_TAB + AS2 (ldi,r31,pm_hi8(1f)) CR_TAB), file); prologue_size += 4; @@ -683,7 +681,7 @@ avr_output_function_prologue (FILE *file, HOST_WIDE_INT size) (18 - live_seq) * 2); ++prologue_size; } - fprintf (file, ".L_%s_body:\n", cfun_name); + fputs ("1:\n", file); } else { @@ -1099,6 +1097,16 @@ print_operand (FILE *file, rtx x, int code) print_operand (file, XEXP (addr, 1), 0); } + else if (code == 'p' || code == 'r') + { + if (GET_CODE (addr) != POST_INC && GET_CODE (addr) != PRE_DEC) + fatal_insn ("bad address, not post_inc or pre_dec:", addr); + + if (code == 'p') + print_operand_address (file, XEXP (addr, 0)); /* X, Y, Z */ + else + print_operand (file, XEXP (addr, 0), 0); /* r26, r28, r30 */ + } else if (GET_CODE (addr) == PLUS) { print_operand_address (file, XEXP (addr,0)); @@ -1814,6 +1822,9 @@ out_movhi_r_mr (rtx insn, rtx op[], int *l) rtx base = XEXP (src, 0); int reg_dest = true_regnum (dest); int reg_base = true_regnum (base); + /* "volatile" forces reading low byte first, even if less efficient, + for correct operation with 16-bit I/O registers. */ + int mem_volatile_p = MEM_VOLATILE_P (src); int tmp; if (!l) @@ -1907,6 +1918,25 @@ out_movhi_r_mr (rtx insn, rtx op[], int *l) if (reg_overlap_mentioned_p (dest, XEXP (base, 0))) fatal_insn ("incorrect insn:", insn); + if (mem_volatile_p) + { + if (REGNO (XEXP (base, 0)) == REG_X) + { + *l = 4; + return (AS2 (sbiw,r26,2) CR_TAB + AS2 (ld,%A0,X+) CR_TAB + AS2 (ld,%B0,X) CR_TAB + AS2 (sbiw,r26,1)); + } + else + { + *l = 3; + return (AS2 (sbiw,%r1,2) CR_TAB + AS2 (ld,%A0,%p1) CR_TAB + AS2 (ldd,%B0,%p1+1)); + } + } + *l = 2; return (AS2 (ld,%B0,%1) CR_TAB AS2 (ld,%A0,%1)); @@ -2487,7 +2517,11 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l) rtx base = XEXP (dest, 0); int reg_base = true_regnum (base); int reg_src = true_regnum (src); + /* "volatile" forces writing high byte first, even if less efficient, + for correct operation with 16-bit I/O registers. */ + int mem_volatile_p = MEM_VOLATILE_P (dest); int tmp; + if (!l) l = &tmp; if (CONSTANT_ADDRESS_P (base)) @@ -2507,33 +2541,33 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l) { if (reg_src == REG_X) { - /* "st X+,r26" is undefined */ - if (reg_unused_after (insn, src)) + /* "st X+,r26" and "st -X,r26" are undefined. */ + if (!mem_volatile_p && reg_unused_after (insn, src)) return *l=4, (AS2 (mov,__tmp_reg__,r27) CR_TAB AS2 (st,X,r26) CR_TAB AS2 (adiw,r26,1) CR_TAB AS2 (st,X,__tmp_reg__)); else return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB - AS2 (st,X,r26) CR_TAB AS2 (adiw,r26,1) CR_TAB AS2 (st,X,__tmp_reg__) CR_TAB - AS2 (sbiw,r26,1)); + AS2 (sbiw,r26,1) CR_TAB + AS2 (st,X,r26)); } else { - if (reg_unused_after (insn, base)) + if (!mem_volatile_p && reg_unused_after (insn, base)) return *l=2, (AS2 (st,X+,%A1) CR_TAB AS2 (st,X,%B1)); else - return *l=3, (AS2 (st ,X+,%A1) CR_TAB - AS2 (st ,X,%B1) CR_TAB - AS2 (sbiw,r26,1)); + return *l=3, (AS2 (adiw,r26,1) CR_TAB + AS2 (st,X,%B1) CR_TAB + AS2 (st,-X,%A1)); } } else - return *l=2, (AS2 (st ,%0,%A1) CR_TAB - AS2 (std,%0+1,%B1)); + return *l=2, (AS2 (std,%0+1,%B1) CR_TAB + AS2 (st,%0,%A1)); } else if (GET_CODE (base) == PLUS) { @@ -2546,14 +2580,14 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l) if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest))) return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB - AS2 (std,Y+62,%A1) CR_TAB AS2 (std,Y+63,%B1) CR_TAB + AS2 (std,Y+62,%A1) CR_TAB AS2 (sbiw,r28,%o0-62)); return *l = 6, (AS2 (subi,r28,lo8(-%o0)) CR_TAB AS2 (sbci,r29,hi8(-%o0)) CR_TAB - AS2 (st,Y,%A1) CR_TAB AS2 (std,Y+1,%B1) CR_TAB + AS2 (st,Y,%A1) CR_TAB AS2 (subi,r28,lo8(%o0)) CR_TAB AS2 (sbci,r29,hi8(%o0))); } @@ -2561,31 +2595,53 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l) { /* (X + d) = R */ if (reg_src == REG_X) - { + { *l = 7; return (AS2 (mov,__tmp_reg__,r26) CR_TAB AS2 (mov,__zero_reg__,r27) CR_TAB - AS2 (adiw,r26,%o0) CR_TAB - AS2 (st,X+,__tmp_reg__) CR_TAB + AS2 (adiw,r26,%o0+1) CR_TAB AS2 (st,X,__zero_reg__) CR_TAB + AS2 (st,-X,__tmp_reg__) CR_TAB AS1 (clr,__zero_reg__) CR_TAB - AS2 (sbiw,r26,%o0+1)); + AS2 (sbiw,r26,%o0)); } *l = 4; - return (AS2 (adiw,r26,%o0) CR_TAB - AS2 (st,X+,%A1) CR_TAB - AS2 (st,X,%B1) CR_TAB - AS2 (sbiw,r26,%o0+1)); + return (AS2 (adiw,r26,%o0+1) CR_TAB + AS2 (st,X,%B1) CR_TAB + AS2 (st,-X,%A1) CR_TAB + AS2 (sbiw,r26,%o0)); } - return *l=2, (AS2 (std,%A0,%A1) CR_TAB - AS2 (std,%B0,%B1)); + return *l=2, (AS2 (std,%B0,%B1) CR_TAB + AS2 (std,%A0,%A1)); } else if (GET_CODE (base) == PRE_DEC) /* (--R) */ return *l=2, (AS2 (st,%0,%B1) CR_TAB AS2 (st,%0,%A1)); else if (GET_CODE (base) == POST_INC) /* (R++) */ - return *l=2, (AS2 (st,%0,%A1) CR_TAB - AS2 (st,%0,%B1)); + { + if (mem_volatile_p) + { + if (REGNO (XEXP (base, 0)) == REG_X) + { + *l = 4; + return (AS2 (adiw,r26,1) CR_TAB + AS2 (st,X,%B1) CR_TAB + AS2 (st,-X,%A1) CR_TAB + AS2 (adiw,r26,2)); + } + else + { + *l = 3; + return (AS2 (std,%p0+1,%B1) CR_TAB + AS2 (st,%p0,%A1) CR_TAB + AS2 (adiw,%r0,2)); + } + } + + *l = 2; + return (AS2 (st,%0,%A1) CR_TAB + AS2 (st,%0,%B1)); + } fatal_insn ("unknown move insn:",insn); return ""; } diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index 7823545b9da..53c2f7b857d 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -30,6 +30,8 @@ ;; j Branch condition. ;; k Reverse branch condition. ;; o Displacement for (mem (plus (reg) (const_int))) operands. +;; p POST_INC or PRE_DEC address as a pointer (X, Y, Z) +;; r POST_INC or PRE_DEC address as a register (r26, r28, r30) ;; ~ Output 'r' if not AVR_MEGA. ;; UNSPEC usage: @@ -344,75 +346,69 @@ ;;========================================================================= ;; move string (like memcpy) +;; implement as RTL loop (define_expand "movstrhi" [(parallel [(set (match_operand:BLK 0 "memory_operand" "") - (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:HI 2 "const_int_operand" "")) - (use (match_operand:HI 3 "const_int_operand" "")) - (clobber (match_scratch:HI 4 "")) - (clobber (match_scratch:HI 5 "")) - (clobber (match_dup 6))])] + (match_operand:BLK 1 "memory_operand" "")) + (use (match_operand:HI 2 "const_int_operand" "")) + (use (match_operand:HI 3 "const_int_operand" ""))])] "" "{ - rtx addr0, addr1; - int cnt8; + int prob; + HOST_WIDE_INT count; enum machine_mode mode; + rtx label = gen_label_rtx (); + rtx loop_reg; + rtx jump; + + /* Copy pointers into new psuedos - they will be changed. */ + rtx addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); + rtx addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0)); + + /* Create rtx for tmp register - we use this as scratch. */ + rtx tmp_reg_rtx = gen_rtx_REG (QImode, TMP_REGNO); if (GET_CODE (operands[2]) != CONST_INT) FAIL; - cnt8 = byte_immediate_operand (operands[2], GET_MODE (operands[2])); - mode = cnt8 ? QImode : HImode; - operands[2] = copy_to_mode_reg (mode, - gen_int_mode (INTVAL (operands[2]), mode)); - addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); - addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0)); - operands[6] = gen_rtx_SCRATCH (mode); - operands[0] = gen_rtx (MEM, BLKmode, addr0); - operands[1] = gen_rtx (MEM, BLKmode, addr1); -}") - -(define_insn "*movstrqi_insn" - [(set (mem:BLK (match_operand:HI 0 "register_operand" "e")) - (mem:BLK (match_operand:HI 1 "register_operand" "e"))) - (use (match_operand:QI 2 "register_operand" "r")) - (use (match_operand:QI 3 "const_int_operand" "i")) - (clobber (match_scratch:HI 4 "=0")) - (clobber (match_scratch:HI 5 "=1")) - (clobber (match_scratch:QI 6 "=2"))] - "" - "ld __tmp_reg__,%a1+ - st %a0+,__tmp_reg__ - dec %2 - brne .-8" - [(set_attr "length" "4") - (set_attr "cc" "clobber")]) + count = INTVAL (operands[2]); + if (count <= 0) + FAIL; -(define_insn "*movstrhi" - [(set (mem:BLK (match_operand:HI 0 "register_operand" "e,e")) - (mem:BLK (match_operand:HI 1 "register_operand" "e,e"))) - (use (match_operand:HI 2 "register_operand" "!w,d")) - (use (match_operand:HI 3 "const_int_operand" "")) - (clobber (match_scratch:HI 4 "=0,0")) - (clobber (match_scratch:HI 5 "=1,1")) - (clobber (match_scratch:HI 6 "=2,2"))] - "" - "*{ - if (which_alternative==0) - return (AS2 (ld,__tmp_reg__,%a1+) CR_TAB - AS2 (st,%a0+,__tmp_reg__) CR_TAB - AS2 (sbiw,%A2,1) CR_TAB - AS1 (brne,.-8)); - else - return (AS2 (ld,__tmp_reg__,%a1+) CR_TAB - AS2 (st,%a0+,__tmp_reg__) CR_TAB - AS2 (subi,%A2,1) CR_TAB - AS2 (sbci,%B2,0) CR_TAB - AS1 (brne,.-10)); -}" - [(set_attr "length" "4,5") - (set_attr "cc" "clobber,clobber")]) + /* Work out branch probability for latter use. */ + prob = REG_BR_PROB_BASE - REG_BR_PROB_BASE / count; + + /* See if constant fit 8 bits. */ + mode = (count < 0x100) ? QImode : HImode; + /* Create loop counter register. */ + loop_reg = copy_to_mode_reg (mode, gen_int_mode (count, mode)); + + /* Now create RTL code for move loop. */ + /* Label at top of loop. */ + emit_label (label); + + /* Move one byte into scratch and inc pointer. */ + emit_move_insn (tmp_reg_rtx, gen_rtx_MEM (QImode, addr1)); + emit_move_insn (addr1, gen_rtx_PLUS (Pmode, addr1, const1_rtx)); + + /* Move to mem and inc pointer. */ + emit_move_insn (gen_rtx_MEM (QImode, addr0), tmp_reg_rtx); + emit_move_insn (addr0, gen_rtx_PLUS (Pmode, addr0, const1_rtx)); + + /* Decrement count. */ + emit_move_insn (loop_reg, gen_rtx_PLUS (mode, loop_reg, constm1_rtx)); + + /* Compare with zero and jump if not equal. */ + emit_cmp_and_jump_insns (loop_reg, const0_rtx, NE, NULL_RTX, mode, 1, + label); + /* Set jump probability based on loop count. */ + jump = get_last_insn (); + REG_NOTES (jump) = gen_rtx_EXPR_LIST (REG_BR_PROB, + GEN_INT (prob), + REG_NOTES (jump)); + DONE; +}") ;; =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 ;; memset (%0, 0, %1) diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr index 91a089912c9..bb2733ebaa8 100644 --- a/gcc/config/avr/t-avr +++ b/gcc/config/avr/t-avr @@ -1,7 +1,3 @@ -# Specific names for AVR tools -AR_FOR_TARGET = avr-ar -RANLIB_FOR_TARGET = avr-ranlib - LIB1ASMSRC = avr/libgcc.S LIB1ASMFUNCS = \ _mulqi3 \ diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index fd44e215a97..c3b27b60c07 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -81,14 +81,6 @@ } \ while (0) -/* Name of the c4x assembler. */ - -#define ASM_PROG "c4x-as" - -/* Name of the c4x linker. */ - -#define LD_PROG "c4x-ld" - /* Define assembler options. */ #define ASM_SPEC "\ diff --git a/gcc/config/i386/cygwin1.c b/gcc/config/i386/cygwin1.c index 2cab96c195c..88c44fc9fbf 100644 --- a/gcc/config/i386/cygwin1.c +++ b/gcc/config/i386/cygwin1.c @@ -30,13 +30,13 @@ mingw_scan (int argc ATTRIBUTE_UNUSED, const char *const *argv, char **spec_machine) { - putenv ("GCC_CYGWIN_MINGW=0"); + putenv (xstrdup ("GCC_CYGWIN_MINGW=0")); while (*++argv) if (strcmp (*argv, "-mno-win32") == 0) - putenv ("GCC_CYGWIN_WIN32=0"); + putenv (xstrdup ("GCC_CYGWIN_WIN32=0")); else if (strcmp (*argv, "-mwin32") == 0) - putenv ("GCC_CYGWIN_WIN32=1"); + putenv (xstrdup ("GCC_CYGWIN_WIN32=1")); else if (strcmp (*argv, "-mno-cygwin") == 0) { char *p = strstr (*spec_machine, "-cygwin"); @@ -48,7 +48,7 @@ mingw_scan (int argc ATTRIBUTE_UNUSED, strcpy (s + len, "-mingw32"); *spec_machine = s; } - putenv ("GCC_CYGWIN_MINGW=1"); + putenv (xstrdup ("GCC_CYGWIN_MINGW=1")); } return; } diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index fb6b5c746f4..4c7eb5d8f13 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -9700,12 +9700,12 @@ (use (match_operand:V4SF 2 "nonimmediate_operand" "")) (clobber (reg:CC 17))] "reload_completed && SSE_REG_P (operands[0])" - [(set (subreg:TI (match_dup 0) 0) - (xor:TI (match_dup 1) - (match_dup 2)))] + [(set (match_dup 0) + (xor:V4SF (match_dup 1) + (match_dup 2)))] { - operands[1] = simplify_gen_subreg (TImode, operands[1], SFmode, 0); - operands[2] = simplify_gen_subreg (TImode, operands[2], V4SFmode, 0); + operands[0] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); + operands[1] = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); if (operands_match_p (operands[0], operands[2])) { rtx tmp; @@ -9868,13 +9868,12 @@ (use (match_operand:V2DF 2 "nonimmediate_operand" "")) (clobber (reg:CC 17))] "reload_completed && SSE_REG_P (operands[0])" - [(set (subreg:TI (match_dup 0) 0) - (xor:TI (match_dup 1) - (match_dup 2)))] + [(set (match_dup 0) + (xor:V2DF (match_dup 1) + (match_dup 2)))] { operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - operands[1] = simplify_gen_subreg (TImode, operands[1], DFmode, 0); - operands[2] = simplify_gen_subreg (TImode, operands[2], V2DFmode, 0); + operands[1] = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); /* Avoid possible reformatting on the operands. */ if (TARGET_SSE_PARTIAL_REGS && !optimize_size) emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], operands[0])); @@ -10108,12 +10107,12 @@ (use (match_operand:V4SF 2 "nonimmediate_operand" "")) (clobber (reg:CC 17))] "reload_completed && SSE_REG_P (operands[0])" - [(set (subreg:TI (match_dup 0) 0) - (and:TI (match_dup 1) - (match_dup 2)))] + [(set (match_dup 0) + (and:V4SF (match_dup 1) + (match_dup 2)))] { - operands[1] = simplify_gen_subreg (TImode, operands[1], SFmode, 0); - operands[2] = simplify_gen_subreg (TImode, operands[2], V4SFmode, 0); + operands[0] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); + operands[1] = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); if (operands_match_p (operands[0], operands[2])) { rtx tmp; @@ -10262,13 +10261,12 @@ (use (match_operand:V2DF 2 "nonimmediate_operand" "")) (clobber (reg:CC 17))] "reload_completed && SSE_REG_P (operands[0])" - [(set (subreg:TI (match_dup 0) 0) - (and:TI (match_dup 1) - (match_dup 2)))] + [(set (match_dup 0) + (and:V2DF (match_dup 1) + (match_dup 2)))] { operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - operands[1] = simplify_gen_subreg (TImode, operands[1], DFmode, 0); - operands[2] = simplify_gen_subreg (TImode, operands[2], V2DFmode, 0); + operands[1] = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); /* Avoid possible reformatting on the operands. */ if (TARGET_SSE_PARTIAL_REGS && !optimize_size) emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], operands[0])); @@ -17086,22 +17084,60 @@ ;; nand op0, op3 - load op3 to op0 if comparison was false ;; or op2, op0 - get the nonzero one into the result. (define_split - [(set (match_operand 0 "register_operand" "") - (if_then_else (match_operator 1 "sse_comparison_operator" - [(match_operand 4 "register_operand" "") - (match_operand 5 "nonimmediate_operand" "")]) - (match_operand 2 "register_operand" "") - (match_operand 3 "register_operand" ""))) + [(set (match_operand:SF 0 "register_operand" "") + (if_then_else (match_operator:SF 1 "sse_comparison_operator" + [(match_operand:SF 4 "register_operand" "") + (match_operand:SF 5 "nonimmediate_operand" "")]) + (match_operand:SF 2 "register_operand" "") + (match_operand:SF 3 "register_operand" ""))) (clobber (match_operand 6 "" "")) (clobber (reg:CC 17))] "SSE_REG_P (operands[0]) && reload_completed" [(set (match_dup 4) (match_op_dup 1 [(match_dup 4) (match_dup 5)])) - (set (subreg:TI (match_dup 2) 0) (and:TI (subreg:TI (match_dup 2) 0) - (subreg:TI (match_dup 4) 0))) - (set (subreg:TI (match_dup 4) 0) (and:TI (not:TI (subreg:TI (match_dup 4) 0)) - (subreg:TI (match_dup 3) 0))) - (set (subreg:TI (match_dup 0) 0) (ior:TI (subreg:TI (match_dup 6) 0) - (subreg:TI (match_dup 7) 0)))] + (set (match_dup 2) (and:V4SF (match_dup 2) + (match_dup 8))) + (set (match_dup 8) (and:V4SF (not:V4SF (match_dup 8)) + (match_dup 3))) + (set (match_dup 0) (ior:V4SF (match_dup 6) + (match_dup 7)))] +{ + /* If op2 == op3, op3 would be clobbered before it is used. */ + if (operands_match_p (operands[2], operands[3])) + { + emit_move_insn (operands[0], operands[2]); + DONE; + } + + PUT_MODE (operands[1], GET_MODE (operands[0])); + if (operands_match_p (operands[0], operands[4])) + operands[6] = operands[4], operands[7] = operands[2]; + else + operands[6] = operands[2], operands[7] = operands[4]; + operands[0] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); + operands[2] = simplify_gen_subreg (V4SFmode, operands[2], SFmode, 0); + operands[3] = simplify_gen_subreg (V4SFmode, operands[3], SFmode, 0); + operands[8] = simplify_gen_subreg (V4SFmode, operands[4], SFmode, 0); + operands[6] = simplify_gen_subreg (V4SFmode, operands[6], SFmode, 0); + operands[7] = simplify_gen_subreg (V4SFmode, operands[7], SFmode, 0); +}) + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (if_then_else (match_operator:DF 1 "sse_comparison_operator" + [(match_operand:DF 4 "register_operand" "") + (match_operand:DF 5 "nonimmediate_operand" "")]) + (match_operand:DF 2 "register_operand" "") + (match_operand:DF 3 "register_operand" ""))) + (clobber (match_operand 6 "" "")) + (clobber (reg:CC 17))] + "SSE_REG_P (operands[0]) && reload_completed" + [(set (match_dup 4) (match_op_dup 1 [(match_dup 4) (match_dup 5)])) + (set (match_dup 2) (and:V2DF (match_dup 2) + (match_dup 8))) + (set (match_dup 8) (and:V2DF (not:V2DF (match_dup 8)) + (match_dup 3))) + (set (match_dup 0) (ior:V2DF (match_dup 6) + (match_dup 7)))] { if (GET_MODE (operands[2]) == DFmode && TARGET_SSE_PARTIAL_REGS && !optimize_size) @@ -17124,6 +17160,12 @@ operands[6] = operands[4], operands[7] = operands[2]; else operands[6] = operands[2], operands[7] = operands[4]; + operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); + operands[2] = simplify_gen_subreg (V2DFmode, operands[2], DFmode, 0); + operands[3] = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0); + operands[8] = simplify_gen_subreg (V2DFmode, operands[4], DFmode, 0); + operands[6] = simplify_gen_subreg (V2DFmode, operands[6], DFmode, 0); + operands[7] = simplify_gen_subreg (V2DFmode, operands[7], DFmode, 0); }) ;; Special case of conditional move we can handle effectively. @@ -17210,18 +17252,55 @@ "#") (define_split - [(set (match_operand 0 "register_operand" "") - (if_then_else (match_operator 1 "comparison_operator" - [(match_operand 4 "nonimmediate_operand" "") - (match_operand 5 "nonimmediate_operand" "")]) - (match_operand 2 "nonmemory_operand" "") - (match_operand 3 "nonmemory_operand" "")))] + [(set (match_operand:SF 0 "register_operand" "") + (if_then_else (match_operator:SF 1 "comparison_operator" + [(match_operand:SF 4 "nonimmediate_operand" "") + (match_operand:SF 5 "nonimmediate_operand" "")]) + (match_operand:SF 2 "nonmemory_operand" "") + (match_operand:SF 3 "nonmemory_operand" "")))] + "SSE_REG_P (operands[0]) && reload_completed + && (const0_operand (operands[2], GET_MODE (operands[0])) + || const0_operand (operands[3], GET_MODE (operands[0])))" + [(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)])) + (set (match_dup 8) (and:V4SF (match_dup 6) (match_dup 7)))] +{ + PUT_MODE (operands[1], GET_MODE (operands[0])); + if (!sse_comparison_operator (operands[1], VOIDmode) + || !rtx_equal_p (operands[0], operands[4])) + { + rtx tmp = operands[5]; + operands[5] = operands[4]; + operands[4] = tmp; + PUT_CODE (operands[1], swap_condition (GET_CODE (operands[1]))); + } + if (!rtx_equal_p (operands[0], operands[4])) + abort (); + operands[8] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); + if (const0_operand (operands[2], GET_MODE (operands[2]))) + { + operands[7] = operands[3]; + operands[6] = gen_rtx_NOT (V4SFmode, operands[5]); + } + else + { + operands[7] = operands[2]; + operands[6] = operands[0]; + } + operands[7] = simplify_gen_subreg (V4SFmode, operands[7], SFmode, 0); +}) + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (if_then_else (match_operator:DF 1 "comparison_operator" + [(match_operand:DF 4 "nonimmediate_operand" "") + (match_operand:DF 5 "nonimmediate_operand" "")]) + (match_operand:DF 2 "nonmemory_operand" "") + (match_operand:DF 3 "nonmemory_operand" "")))] "SSE_REG_P (operands[0]) && reload_completed && (const0_operand (operands[2], GET_MODE (operands[0])) || const0_operand (operands[3], GET_MODE (operands[0])))" [(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)])) - (set (subreg:TI (match_dup 0) 0) (and:TI (match_dup 6) - (match_dup 7)))] + (set (match_dup 8) (and:V2DF (match_dup 6) (match_dup 7)))] { if (TARGET_SSE_PARTIAL_REGS && !optimize_size && GET_MODE (operands[2]) == DFmode) @@ -17248,19 +17327,18 @@ } if (!rtx_equal_p (operands[0], operands[4])) abort (); - if (const0_operand (operands[2], GET_MODE (operands[0]))) + operands[8] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); + if (const0_operand (operands[2], GET_MODE (operands[2]))) { operands[7] = operands[3]; - operands[6] = gen_rtx_NOT (TImode, gen_rtx_SUBREG (TImode, operands[0], - 0)); + operands[6] = gen_rtx_NOT (V2DFmode, operands[8]); } else { operands[7] = operands[2]; - operands[6] = gen_rtx_SUBREG (TImode, operands[0], 0); + operands[6] = operands[8]; } - operands[7] = simplify_gen_subreg (TImode, operands[7], - GET_MODE (operands[7]), 0); + operands[7] = simplify_gen_subreg (V2DFmode, operands[7], DFmode, 0); }) (define_expand "allocate_stack_worker" @@ -19517,26 +19595,16 @@ ;; of DImode subregs again! ;; SSE1 single precision floating point logical operation (define_expand "sse_andv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "") 0) - (and:TI (subreg:TI (match_operand:V4SF 1 "register_operand" "") 0) - (subreg:TI (match_operand:V4SF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V4SF 0 "register_operand" "") + (and:V4SF (match_operand:V4SF 1 "register_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] "TARGET_SSE" "") (define_insn "*sse_andv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "=x") 0) - (and:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "andps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_insn "*sse_andsf3" - [(set (subreg:TI (match_operand:SF 0 "register_operand" "=x") 0) - (and:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V4SF 0 "register_operand" "=x") + (and:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "andps\t{%2, %0|%0, %2}" @@ -19544,51 +19612,32 @@ (set_attr "mode" "V4SF")]) (define_expand "sse_nandv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "") 0) - (and:TI (not:TI (subreg:TI (match_operand:V4SF 1 "register_operand" "") 0)) - (subreg:TI (match_operand:V4SF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V4SF 0 "register_operand" "") + (and:V4SF (not:V4SF (match_operand:V4SF 1 "register_operand" "")) + (match_operand:V4SF 2 "nonimmediate_operand" "")))] "TARGET_SSE" "") (define_insn "*sse_nandv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "=x") 0) - (and:TI (not:TI (match_operand:TI 1 "register_operand" "0")) - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "andnps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_insn "*sse_nandsf3" - [(set (subreg:TI (match_operand:SF 0 "register_operand" "=x") 0) - (and:TI (not:TI (match_operand:TI 1 "register_operand" "0")) - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V4SF 0 "register_operand" "=x") + (and:V4SF (not:V4SF (match_operand:V4SF 1 "register_operand" "0")) + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE" "andnps\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "mode" "V4SF")]) (define_expand "sse_iorv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "") 0) - (ior:TI (subreg:TI (match_operand:V4SF 1 "register_operand" "") 0) - (subreg:TI (match_operand:V4SF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V4SF 0 "register_operand" "") + (ior:V4SF (match_operand:V4SF 1 "register_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] "TARGET_SSE" "") (define_insn "*sse_iorv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "=x") 0) - (ior:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "orps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_insn "*sse_iorsf3" - [(set (subreg:TI (match_operand:SF 0 "register_operand" "=x") 0) - (ior:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V4SF 0 "register_operand" "=x") + (ior:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "orps\t{%2, %0|%0, %2}" @@ -19596,27 +19645,16 @@ (set_attr "mode" "V4SF")]) (define_expand "sse_xorv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "") 0) - (xor:TI (subreg:TI (match_operand:V4SF 1 "register_operand" "") 0) - (subreg:TI (match_operand:V4SF 2 "nonimmediate_operand" "") 0)))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" + [(set (match_operand:V4SF 0 "register_operand" "") + (xor:V4SF (match_operand:V4SF 1 "register_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" "") (define_insn "*sse_xorv4sf3" - [(set (subreg:TI (match_operand:V4SF 0 "register_operand" "=x") 0) - (xor:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "xorps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_insn "*sse_xorsf3" - [(set (subreg:TI (match_operand:SF 0 "register_operand" "=x") 0) - (xor:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V4SF 0 "register_operand" "=x") + (xor:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "xorps\t{%2, %0|%0, %2}" @@ -19626,26 +19664,16 @@ ;; SSE2 double precision floating point logical operation (define_expand "sse2_andv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "") 0) - (and:TI (subreg:TI (match_operand:V2DF 1 "register_operand" "") 0) - (subreg:TI (match_operand:V2DF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V2DF 0 "register_operand" "") + (and:V2DF (match_operand:V2DF 1 "register_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] "TARGET_SSE2" "") (define_insn "*sse2_andv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "=x") 0) - (and:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "andpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_insn "*sse2_andv2df3" - [(set (subreg:TI (match_operand:DF 0 "register_operand" "=x") 0) - (and:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V2DF 0 "register_operand" "=x") + (and:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "andpd\t{%2, %0|%0, %2}" @@ -19653,51 +19681,32 @@ (set_attr "mode" "V2DF")]) (define_expand "sse2_nandv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "") 0) - (and:TI (not:TI (subreg:TI (match_operand:V2DF 1 "register_operand" "") 0)) - (subreg:TI (match_operand:V2DF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V2DF 0 "register_operand" "") + (and:V2DF (not:V2DF (match_operand:V2DF 1 "register_operand" "")) + (match_operand:V2DF 2 "nonimmediate_operand" "")))] "TARGET_SSE2" "") (define_insn "*sse2_nandv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "=x") 0) - (and:TI (not:TI (match_operand:TI 1 "register_operand" "0")) - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "andnpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_insn "*sse_nandti3_df" - [(set (subreg:TI (match_operand:DF 0 "register_operand" "=Y") 0) - (and:TI (not:TI (match_operand:TI 1 "register_operand" "0")) - (match_operand:TI 2 "nonimmediate_operand" "Ym")))] + [(set (match_operand:V2DF 0 "register_operand" "=x") + (and:V2DF (not:V2DF (match_operand:V2DF 1 "register_operand" "0")) + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2" "andnpd\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "mode" "V2DF")]) (define_expand "sse2_iorv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "") 0) - (ior:TI (subreg:TI (match_operand:V2DF 1 "register_operand" "") 0) - (subreg:TI (match_operand:V2DF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V2DF 0 "register_operand" "") + (ior:V2DF (match_operand:V2DF 1 "register_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] "TARGET_SSE2" "") (define_insn "*sse2_iorv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "=x") 0) - (ior:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "orpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_insn "*sse2_iordf3" - [(set (subreg:TI (match_operand:DF 0 "register_operand" "=x") 0) - (ior:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V2DF 0 "register_operand" "=x") + (ior:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "orpd\t{%2, %0|%0, %2}" @@ -19705,26 +19714,16 @@ (set_attr "mode" "V2DF")]) (define_expand "sse2_xorv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "") 0) - (xor:TI (subreg:TI (match_operand:V2DF 1 "nonimmediate_operand" "") 0) - (subreg:TI (match_operand:V2DF 2 "nonimmediate_operand" "") 0)))] + [(set (match_operand:V2DF 0 "register_operand" "") + (xor:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] "TARGET_SSE2" "") (define_insn "*sse2_xorv2df3" - [(set (subreg:TI (match_operand:V2DF 0 "register_operand" "=x") 0) - (xor:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "xorpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_insn "*sse2_xordf3" - [(set (subreg:TI (match_operand:DF 0 "register_operand" "=x") 0) - (xor:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] + [(set (match_operand:V2DF 0 "register_operand" "=x") + (xor:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] "TARGET_SSE2 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "xorpd\t{%2, %0|%0, %2}" diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c index 9bfc2dbd4ca..dd7bd612637 100644 --- a/gcc/config/ia64/unwind-ia64.c +++ b/gcc/config/ia64/unwind-ia64.c @@ -2320,6 +2320,8 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)), "(p6) ldf.fill f22 = [r28] \n\t" "cmp.ne p7, p0 = r0, r29 \n\t" ";; \n\t" + "ld8 r27 = [r20], 8 \n\t" + ";; \n\t" "ld8 r28 = [r20], 8 \n\t" "(p7) ldf.fill f23 = [r29] \n\t" "cmp.ne p6, p0 = r0, r22 \n\t" diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 1dc2806d2ee..7727cb5f85c 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1530,7 +1530,12 @@ extern int may_call_alloca; && (TARGET_NO_SPACE_REGS \ ? (base && REG_P (index)) \ : (base == XEXP (X, 1) && REG_P (index) \ - && REG_POINTER (base) && !REG_POINTER (index))) \ + && (reload_completed \ + || (reload_in_progress && HARD_REGISTER_P (base)) \ + || REG_POINTER (base)) \ + && (reload_completed \ + || (reload_in_progress && HARD_REGISTER_P (index)) \ + || !REG_POINTER (index)))) \ && MODE_OK_FOR_UNSCALED_INDEXING_P (MODE) \ && REG_OK_FOR_INDEX_P (index) \ && borx_reg_operand (base, Pmode) \ diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 22067388106..5b3a612c72d 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5082,7 +5082,7 @@ (clobber (reg:SI 26)) (clobber (reg:SI 25)) (clobber (match_dup 4))]) - (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))] + (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))] "" " { @@ -5208,7 +5208,7 @@ (clobber (reg:SI 26)) (clobber (reg:SI 25)) (clobber (match_dup 5))]) - (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))] + (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))] "" " { @@ -5264,7 +5264,7 @@ (clobber (reg:SI 26)) (clobber (reg:SI 25)) (clobber (match_dup 5))]) - (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))] + (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))] "" " { @@ -5321,7 +5321,7 @@ (clobber (reg:SI 26)) (clobber (reg:SI 25)) (clobber (match_dup 5))]) - (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))] + (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))] "" " { @@ -5373,7 +5373,7 @@ (clobber (reg:SI 26)) (clobber (reg:SI 25)) (clobber (match_dup 5))]) - (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))] + (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))] "" " { diff --git a/gcc/config/rs6000/aix52.h b/gcc/config/rs6000/aix52.h index c06665066b3..6f12619e2da 100644 --- a/gcc/config/rs6000/aix52.h +++ b/gcc/config/rs6000/aix52.h @@ -193,3 +193,7 @@ do { \ #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS 1 +#ifndef _AIX52 +extern long long int atoll(const char *); +#endif + diff --git a/gcc/config/rs6000/darwin-ldouble-shared.c b/gcc/config/rs6000/darwin-ldouble-shared.c new file mode 100644 index 00000000000..8ceea0ac55b --- /dev/null +++ b/gcc/config/rs6000/darwin-ldouble-shared.c @@ -0,0 +1,2 @@ +#define IN_LIBGCC2_S 1 +#include "darwin-ldouble.c" diff --git a/gcc/config/rs6000/darwin-ldouble.c b/gcc/config/rs6000/darwin-ldouble.c index 60c17681b11..210f2d6a331 100644 --- a/gcc/config/rs6000/darwin-ldouble.c +++ b/gcc/config/rs6000/darwin-ldouble.c @@ -63,7 +63,7 @@ extern long double __gcc_qsub (double, double, double, double); extern long double __gcc_qmul (double, double, double, double); extern long double __gcc_qdiv (double, double, double, double); -#ifdef __ELF__ +#if defined __ELF__ && defined IN_LIBGCC2_S /* Provide definitions of the old symbol names to statisfy apps and shared libs built against an older libgcc. To access the _xlq symbols an explicit version reference is needed, so these won't diff --git a/gcc/config/rs6000/linux-unwind.h b/gcc/config/rs6000/linux-unwind.h index 1acf738123e..842fd1081ec 100644 --- a/gcc/config/rs6000/linux-unwind.h +++ b/gcc/config/rs6000/linux-unwind.h @@ -95,230 +95,228 @@ enum { SIGNAL_FRAMESIZE = 128 }; code that does the save/restore is generated by the linker, so we have no good way to determine at compile time what to do. */ -#define MD_FROB_UPDATE_CONTEXT frob_update_context - -static void -frob_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs) -{ - if (fs->regs.reg[2].how == REG_UNSAVED) - { - unsigned int *insn - = (unsigned int *) _Unwind_GetGR (context, LINK_REGISTER_REGNUM); - if (*insn == 0xE8410028) - _Unwind_SetGRPtr (context, 2, context->cfa + 40); - } -} +#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ + do { \ + if ((FS)->regs.reg[2].how == REG_UNSAVED) \ + { \ + unsigned int *insn \ + = (unsigned int *) \ + _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \ + if (*insn == 0xE8410028) \ + _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ + } \ + } while (0) /* If PC is at a sigreturn trampoline, return a pointer to the regs. Otherwise return NULL. */ -static struct gcc_regs * -get_regs (struct _Unwind_Context *context) -{ - const unsigned char *pc = context->ra; - - /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ - /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ - if (*(unsigned int *) (pc + 0) != 0x38210000 + SIGNAL_FRAMESIZE - || *(unsigned int *) (pc + 8) != 0x44000002) - return NULL; - if (*(unsigned int *) (pc + 4) == 0x38000077) - { - struct sigframe { - char gap[SIGNAL_FRAMESIZE]; - unsigned long pad[7]; - struct gcc_regs *regs; - } *frame = (struct sigframe *) context->cfa; - return frame->regs; - } - else if (*(unsigned int *) (pc + 4) == 0x380000AC) - { - /* This works for 2.4 kernels, but not for 2.6 kernels with vdso - because pc isn't pointing into the stack. Can be removed when - no one is running 2.4.19 or 2.4.20, the first two ppc64 - kernels released. */ - struct rt_sigframe_24 { - int tramp[6]; - void *pinfo; - struct gcc_ucontext *puc; - } *frame24 = (struct rt_sigframe_24 *) pc; - - /* Test for magic value in *puc of vdso. */ - if ((long) frame24->puc != -21 * 8) - return frame24->puc->regs; - else - { - /* This works for 2.4.21 and later kernels. */ - struct rt_sigframe { - char gap[SIGNAL_FRAMESIZE]; - struct gcc_ucontext uc; - unsigned long pad[2]; - int tramp[6]; - void *pinfo; - struct gcc_ucontext *puc; - } *frame = (struct rt_sigframe *) context->cfa; - return frame->uc.regs; - } - } - return NULL; -} +#define PPC_LINUX_GET_REGS(CONTEXT) \ +({ \ + const unsigned char *pc = (CONTEXT)->ra; \ + struct gcc_regs *regs = NULL; \ + \ + /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ \ + /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ \ + if (*(unsigned int *) (pc + 0) != 0x38210000 + SIGNAL_FRAMESIZE \ + || *(unsigned int *) (pc + 8) != 0x44000002) \ + ; \ + else if (*(unsigned int *) (pc + 4) == 0x38000077) \ + { \ + struct sigframe { \ + char gap[SIGNAL_FRAMESIZE]; \ + unsigned long pad[7]; \ + struct gcc_regs *regs; \ + } *frame = (struct sigframe *) (CONTEXT)->cfa; \ + regs = frame->regs; \ + } \ + else if (*(unsigned int *) (pc + 4) == 0x380000AC) \ + { \ + /* This works for 2.4 kernels, but not for 2.6 kernels with vdso \ + because pc isn't pointing into the stack. Can be removed when \ + no one is running 2.4.19 or 2.4.20, the first two ppc64 \ + kernels released. */ \ + struct rt_sigframe_24 { \ + int tramp[6]; \ + void *pinfo; \ + struct gcc_ucontext *puc; \ + } *frame24 = (struct rt_sigframe_24 *) pc; \ + \ + /* Test for magic value in *puc of vdso. */ \ + if ((long) frame24->puc != -21 * 8) \ + regs = frame24->puc->regs; \ + else \ + { \ + /* This works for 2.4.21 and later kernels. */ \ + struct rt_sigframe { \ + char gap[SIGNAL_FRAMESIZE]; \ + struct gcc_ucontext uc; \ + unsigned long pad[2]; \ + int tramp[6]; \ + void *pinfo; \ + struct gcc_ucontext *puc; \ + } *frame = (struct rt_sigframe *) (CONTEXT)->cfa; \ + regs = frame->uc.regs; \ + } \ + } \ + regs; \ +}) + +#define LINUX_HWCAP_DEFAULT 0xc0000000 + +#define PPC_LINUX_VREGS(REGS) (REGS)->vp #else /* !__powerpc64__ */ enum { SIGNAL_FRAMESIZE = 64 }; -static struct gcc_regs * -get_regs (struct _Unwind_Context *context) -{ - const unsigned char *pc = context->ra; +#define PPC_LINUX_GET_REGS(CONTEXT) \ +({ \ + const unsigned char *pc = (CONTEXT)->ra; \ + struct gcc_regs *regs = NULL; \ + \ + /* li r0, 0x7777; sc (sigreturn old) */ \ + /* li r0, 0x0077; sc (sigreturn new) */ \ + /* li r0, 0x6666; sc (rt_sigreturn old) */ \ + /* li r0, 0x00AC; sc (rt_sigreturn new) */ \ + if (*(unsigned int *) (pc + 4) != 0x44000002) \ + ; \ + else if (*(unsigned int *) (pc + 0) == 0x38007777 \ + || *(unsigned int *) (pc + 0) == 0x38000077) \ + { \ + struct sigframe { \ + char gap[SIGNAL_FRAMESIZE]; \ + unsigned long pad[7]; \ + struct gcc_regs *regs; \ + } *frame = (struct sigframe *) (CONTEXT)->cfa; \ + regs = frame->regs; \ + } \ + else if (*(unsigned int *) (pc + 0) == 0x38006666 \ + || *(unsigned int *) (pc + 0) == 0x380000AC) \ + { \ + struct rt_sigframe { \ + char gap[SIGNAL_FRAMESIZE + 16]; \ + char siginfo[128]; \ + struct gcc_ucontext uc; \ + } *frame = (struct rt_sigframe *) (CONTEXT)->cfa; \ + regs = frame->uc.regs; \ + } \ + regs; \ +}) + +#define LINUX_HWCAP_DEFAULT 0x80000000 + +#define PPC_LINUX_VREGS(REGS) &(REGS)->vregs - /* li r0, 0x7777; sc (sigreturn old) */ - /* li r0, 0x0077; sc (sigreturn new) */ - /* li r0, 0x6666; sc (rt_sigreturn old) */ - /* li r0, 0x00AC; sc (rt_sigreturn new) */ - if (*(unsigned int *) (pc + 4) != 0x44000002) - return NULL; - if (*(unsigned int *) (pc + 0) == 0x38007777 - || *(unsigned int *) (pc + 0) == 0x38000077) - { - struct sigframe { - char gap[SIGNAL_FRAMESIZE]; - unsigned long pad[7]; - struct gcc_regs *regs; - } *frame = (struct sigframe *) context->cfa; - return frame->regs; - } - else if (*(unsigned int *) (pc + 0) == 0x38006666 - || *(unsigned int *) (pc + 0) == 0x380000AC) - { - struct rt_sigframe { - char gap[SIGNAL_FRAMESIZE + 16]; - char siginfo[128]; - struct gcc_ucontext uc; - } *frame = (struct rt_sigframe *) context->cfa; - return frame->uc.regs; - } - return NULL; -} #endif -/* Find an entry in the process auxiliary vector. The canonical way to - test for VMX is to look at AT_HWCAP. */ - -static long -ppc_linux_aux_vector (long which) -{ - /* __libc_stack_end holds the original stack passed to a process. */ - extern long *__libc_stack_end; - long argc; - char **argv; - char **envp; - struct auxv - { - long a_type; - long a_val; - } *auxp; - - /* The Linux kernel puts argc first on the stack. */ - argc = __libc_stack_end[0]; - /* Followed by argv, NULL terminated. */ - argv = (char **) __libc_stack_end + 1; - /* Followed by environment string pointers, NULL terminated. */ - envp = argv + argc + 1; - while (*envp++) - continue; - /* Followed by the aux vector, zero terminated. */ - for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp) - if (auxp->a_type == which) - return auxp->a_val; - return 0; -} - /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ -#define MD_FALLBACK_FRAME_STATE_FOR ppc_fallback_frame_state - -static _Unwind_Reason_Code -ppc_fallback_frame_state (struct _Unwind_Context *context, - _Unwind_FrameState *fs) -{ - static long hwcap = 0; - struct gcc_regs *regs = get_regs (context); - long new_cfa; - int i; - - if (regs == NULL) - return _URC_END_OF_STACK; - - new_cfa = regs->gpr[STACK_POINTER_REGNUM]; - fs->cfa_how = CFA_REG_OFFSET; - fs->cfa_reg = STACK_POINTER_REGNUM; - fs->cfa_offset = new_cfa - (long) context->cfa; - - for (i = 0; i < 32; i++) - if (i != STACK_POINTER_REGNUM) - { - fs->regs.reg[i].how = REG_SAVED_OFFSET; - fs->regs.reg[i].loc.offset = (long) ®s->gpr[i] - new_cfa; - } - - fs->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; - fs->regs.reg[CR2_REGNO].loc.offset = (long) ®s->ccr - new_cfa; - - fs->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; - fs->regs.reg[LINK_REGISTER_REGNUM].loc.offset = (long) ®s->link - new_cfa; - - fs->regs.reg[ARG_POINTER_REGNUM].how = REG_SAVED_OFFSET; - fs->regs.reg[ARG_POINTER_REGNUM].loc.offset = (long) ®s->nip - new_cfa; - fs->retaddr_column = ARG_POINTER_REGNUM; - - if (hwcap == 0) - { - hwcap = ppc_linux_aux_vector (16); - /* These will already be set if we found AT_HWCAP. A non-zero - value stops us looking again if for some reason we couldn't - find AT_HWCAP. */ -#ifdef __powerpc64__ - hwcap |= 0xc0000000; -#else - hwcap |= 0x80000000; -#endif - } - - /* If we have a FPU... */ - if (hwcap & 0x08000000) - for (i = 0; i < 32; i++) - { - fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; - fs->regs.reg[i + 32].loc.offset = (long) ®s->fpr[i] - new_cfa; - } - - /* If we have a VMX unit... */ - if (hwcap & 0x10000000) - { - struct gcc_vregs *vregs; -#ifdef __powerpc64__ - vregs = regs->vp; -#else - vregs = ®s->vregs; -#endif - if (regs->msr & (1 << 25)) - { - for (i = 0; i < 32; i++) - { - fs->regs.reg[i + FIRST_ALTIVEC_REGNO].how = REG_SAVED_OFFSET; - fs->regs.reg[i + FIRST_ALTIVEC_REGNO].loc.offset - = (long) &vregs[i] - new_cfa; - } - - fs->regs.reg[VSCR_REGNO].how = REG_SAVED_OFFSET; - fs->regs.reg[VSCR_REGNO].loc.offset = (long) &vregs->vscr - new_cfa; - } - - fs->regs.reg[VRSAVE_REGNO].how = REG_SAVED_OFFSET; - fs->regs.reg[VRSAVE_REGNO].loc.offset = (long) &vregs->vsave - new_cfa; - } - - return _URC_NO_REASON; -} +#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ + do { \ + static long hwcap = 0; \ + struct gcc_regs *regs = PPC_LINUX_GET_REGS (CONTEXT); \ + long new_cfa; \ + int i; \ + \ + if (regs == NULL) \ + break; \ + \ + new_cfa = regs->gpr[STACK_POINTER_REGNUM]; \ + (FS)->cfa_how = CFA_REG_OFFSET; \ + (FS)->cfa_reg = STACK_POINTER_REGNUM; \ + (FS)->cfa_offset = new_cfa - (long) (CONTEXT)->cfa; \ + \ + for (i = 0; i < 32; i++) \ + if (i != STACK_POINTER_REGNUM) \ + { \ + (FS)->regs.reg[i].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[i].loc.offset \ + = (long) ®s->gpr[i] - new_cfa; \ + } \ + \ + (FS)->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[CR2_REGNO].loc.offset \ + = (long) ®s->ccr - new_cfa; \ + \ + (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \ + = (long) ®s->link - new_cfa; \ + \ + (FS)->regs.reg[ARG_POINTER_REGNUM].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[ARG_POINTER_REGNUM].loc.offset \ + = (long) ®s->nip - new_cfa; \ + (FS)->retaddr_column = ARG_POINTER_REGNUM; \ + \ + if (hwcap == 0) \ + { \ + /* __libc_stack_end holds the original stack passed to a \ + process. */ \ + extern long *__libc_stack_end; \ + long argc; \ + char **argv; \ + char **envp; \ + struct auxv \ + { \ + long a_type; \ + long a_val; \ + } *auxp; \ + \ + /* The Linux kernel puts argc first on the stack. */ \ + argc = __libc_stack_end[0]; \ + /* Followed by argv, NULL terminated. */ \ + argv = (char **) __libc_stack_end + 1; \ + /* Followed by environment string pointers, NULL terminated. */ \ + envp = argv + argc + 1; \ + while (*envp++) \ + continue; \ + /* Followed by the aux vector, zero terminated. */ \ + for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp) \ + if (auxp->a_type == 16) \ + { \ + hwcap = auxp->a_val; \ + break; \ + } \ + \ + /* These will already be set if we found AT_HWCAP. A non-zero \ + value stops us looking again if for some reason we couldn't \ + find AT_HWCAP. */ \ + hwcap |= LINUX_HWCAP_DEFAULT; \ + } \ + \ + /* If we have a FPU... */ \ + if (hwcap & 0x08000000) \ + for (i = 0; i < 32; i++) \ + { \ + (FS)->regs.reg[i + 32].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[i + 32].loc.offset \ + = (long) ®s->fpr[i] - new_cfa; \ + } \ + \ + /* If we have a VMX unit... */ \ + if (hwcap & 0x10000000) \ + { \ + struct gcc_vregs *vregs; \ + vregs = PPC_LINUX_VREGS (regs); \ + if (regs->msr & (1 << 25)) \ + { \ + for (i = 0; i < 32; i++) \ + { \ + (FS)->regs.reg[i + FIRST_ALTIVEC_REGNO].how \ + = REG_SAVED_OFFSET; \ + (FS)->regs.reg[i + FIRST_ALTIVEC_REGNO].loc.offset \ + = (long) &vregs[i] - new_cfa; \ + } \ + \ + (FS)->regs.reg[VSCR_REGNO].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[VSCR_REGNO].loc.offset \ + = (long) &vregs->vscr - new_cfa; \ + } \ + \ + (FS)->regs.reg[VRSAVE_REGNO].how = REG_SAVED_OFFSET; \ + (FS)->regs.reg[VRSAVE_REGNO].loc.offset \ + = (long) &vregs->vsave - new_cfa; \ + } \ + \ + goto SUCCESS; \ + } while (0) diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index 8d98c22f1a6..84cdeeddd8a 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for PowerPC machines running Linux. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Meissner (meissner@cygnus.com). @@ -104,89 +104,6 @@ #define TARGET_HAS_F_SETLKW -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - #ifdef IN_LIBGCC2 -#include <signal.h> - -/* During the 2.5 kernel series the kernel ucontext was changed, but - the new layout is compatible with the old one, so we just define - and use the old one here for simplicity and compatibility. */ - -struct kernel_old_ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext_struct uc_mcontext; - sigset_t uc_sigmask; -}; - -enum { SIGNAL_FRAMESIZE = 64 }; +#include "config/rs6000/linux-unwind.h" #endif - -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - int i_; \ - \ - /* li r0, 0x7777; sc (sigreturn old) */ \ - /* li r0, 0x0077; sc (sigreturn new) */ \ - /* li r0, 0x6666; sc (rt_sigreturn old) */ \ - /* li r0, 0x00AC; sc (rt_sigreturn new) */ \ - if (*(unsigned int *) (pc_+4) != 0x44000002) \ - break; \ - if (*(unsigned int *) (pc_+0) == 0x38007777 \ - || *(unsigned int *) (pc_+0) == 0x38000077) \ - { \ - struct sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - struct sigcontext sigctx; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = &rt_->sigctx; \ - } \ - else if (*(unsigned int *) (pc_+0) == 0x38006666 \ - || *(unsigned int *) (pc_+0) == 0x380000AC) \ - { \ - struct rt_sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - unsigned long _unused[2]; \ - struct siginfo *pinfo; \ - void *puc; \ - struct siginfo info; \ - struct kernel_old_ucontext uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = &rt_->uc.uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = STACK_POINTER_REGNUM; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - for (i_ = 0; i_ < 32; i_++) \ - if (i_ != STACK_POINTER_REGNUM) \ - { \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset \ - = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \ - } \ - \ - (FS)->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[CR2_REGNO].loc.offset \ - = (long)&(sc_->regs->ccr) - new_cfa_; \ - \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \ - = (long)&(sc_->regs->link) - new_cfa_; \ - \ - (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[CR0_REGNO].loc.offset \ - = (long)&(sc_->regs->nip) - new_cfa_; \ - (FS)->retaddr_column = CR0_REGNO; \ - goto SUCCESS; \ - } while (0) diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 7058af4c992..60968411960 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for 64 bit PowerPC linux. - Copyright (C) 2000, 2001, 2002, 2003, 2004 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -565,187 +565,13 @@ while (0) #undef DRAFT_V4_STRUCT_RET #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack +#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack #define TARGET_HAS_F_SETLKW #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - #ifdef IN_LIBGCC2 -#include <signal.h> -#ifdef __powerpc64__ -#include <sys/ucontext.h> - -enum { SIGNAL_FRAMESIZE = 128 }; - -#else - -/* During the 2.5 kernel series the kernel ucontext was changed, but - the new layout is compatible with the old one, so we just define - and use the old one here for simplicity and compatibility. */ - -struct kernel_old_ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext_struct uc_mcontext; - sigset_t uc_sigmask; -}; -enum { SIGNAL_FRAMESIZE = 64 }; -#endif - -#endif - -#ifdef __powerpc64__ - -/* If the current unwind info (FS) does not contain explicit info - saving R2, then we have to do a minor amount of code reading to - figure out if it was saved. The big problem here is that the - code that does the save/restore is generated by the linker, so - we have no good way to determine at compile time what to do. */ - -#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ - do { \ - if ((FS)->regs.reg[2].how == REG_UNSAVED) \ - { \ - unsigned int *insn \ - = (unsigned int *) \ - _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \ - if (*insn == 0xE8410028) \ - _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ - } \ - } while (0) - -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - int i_; \ - \ - /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ \ - /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ \ - if (*(unsigned int *) (pc_+0) != 0x38210000 + SIGNAL_FRAMESIZE \ - || *(unsigned int *) (pc_+8) != 0x44000002) \ - break; \ - if (*(unsigned int *) (pc_+4) == 0x38000077) \ - { \ - struct sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - struct sigcontext sigctx; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = &rt_->sigctx; \ - } \ - else if (*(unsigned int *) (pc_+4) == 0x380000AC) \ - { \ - struct rt_sigframe { \ - int tramp[6]; \ - struct siginfo *pinfo; \ - struct ucontext *puc; \ - } *rt_ = (struct rt_sigframe *) pc_; \ - sc_ = &rt_->puc->uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = STACK_POINTER_REGNUM; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - for (i_ = 0; i_ < 32; i_++) \ - if (i_ != STACK_POINTER_REGNUM) \ - { \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset \ - = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \ - } \ - \ - (FS)->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[CR2_REGNO].loc.offset \ - = (long)&(sc_->regs->ccr) - new_cfa_; \ - \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \ - = (long)&(sc_->regs->link) - new_cfa_; \ - \ - (FS)->regs.reg[ARG_POINTER_REGNUM].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[ARG_POINTER_REGNUM].loc.offset \ - = (long)&(sc_->regs->nip) - new_cfa_; \ - (FS)->retaddr_column = ARG_POINTER_REGNUM; \ - goto SUCCESS; \ - } while (0) - -#else - -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - int i_; \ - \ - /* li r0, 0x7777; sc (sigreturn old) */ \ - /* li r0, 0x0077; sc (sigreturn new) */ \ - /* li r0, 0x6666; sc (rt_sigreturn old) */ \ - /* li r0, 0x00AC; sc (rt_sigreturn new) */ \ - if (*(unsigned int *) (pc_+4) != 0x44000002) \ - break; \ - if (*(unsigned int *) (pc_+0) == 0x38007777 \ - || *(unsigned int *) (pc_+0) == 0x38000077) \ - { \ - struct sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - struct sigcontext sigctx; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = &rt_->sigctx; \ - } \ - else if (*(unsigned int *) (pc_+0) == 0x38006666 \ - || *(unsigned int *) (pc_+0) == 0x380000AC) \ - { \ - struct rt_sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - unsigned long _unused[2]; \ - struct siginfo *pinfo; \ - void *puc; \ - struct siginfo info; \ - struct kernel_old_ucontext uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = &rt_->uc.uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = STACK_POINTER_REGNUM; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - for (i_ = 0; i_ < 32; i_++) \ - if (i_ != STACK_POINTER_REGNUM) \ - { \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset \ - = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \ - } \ - \ - (FS)->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[CR2_REGNO].loc.offset \ - = (long)&(sc_->regs->ccr) - new_cfa_; \ - \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \ - = (long)&(sc_->regs->link) - new_cfa_; \ - \ - (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[CR0_REGNO].loc.offset \ - = (long)&(sc_->regs->nip) - new_cfa_; \ - (FS)->retaddr_column = CR0_REGNO; \ - goto SUCCESS; \ - } while (0) - +#include "config/rs6000/linux-unwind.h" #endif diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a6d0ced2529..d0e0608b0df 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -323,6 +323,7 @@ static void rs6000_file_start (void); static unsigned int rs6000_elf_section_type_flags (tree, const char *, int); static void rs6000_elf_asm_out_constructor (rtx, int); static void rs6000_elf_asm_out_destructor (rtx, int); +static void rs6000_elf_end_indicate_exec_stack (void) ATTRIBUTE_UNUSED; static void rs6000_elf_select_section (tree, int, unsigned HOST_WIDE_INT); static void rs6000_elf_unique_section (tree, int); static void rs6000_elf_select_rtx_section (enum machine_mode, rtx, @@ -757,9 +758,8 @@ rs6000_override_options (const char *default_cpu) set_masks &= ~MASK_ALTIVEC; #endif - /* Don't override these by the processor default if given explicitly. */ - set_masks &= ~(target_flags_explicit - & (MASK_MULTIPLE | MASK_STRING | MASK_SOFT_FLOAT)); + /* Don't override by the processor default if given explicitly. */ + set_masks &= ~target_flags_explicit; /* Identify the processor type. */ rs6000_select[0].string = default_cpu; @@ -3011,13 +3011,9 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) rs6000_emit_move (got, gsym, Pmode); else { - char buf[30]; - static int tls_got_labelno = 0; - rtx tempLR, lab, tmp3, mem; + rtx tempLR, tmp3, mem; rtx first, last; - ASM_GENERATE_INTERNAL_LABEL (buf, "LTLS", tls_got_labelno++); - lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); tempLR = gen_reg_rtx (Pmode); tmp1 = gen_reg_rtx (Pmode); tmp2 = gen_reg_rtx (Pmode); @@ -3025,8 +3021,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) mem = gen_rtx_MEM (Pmode, tmp1); RTX_UNCHANGING_P (mem) = 1; - first = emit_insn (gen_load_toc_v4_PIC_1b (tempLR, lab, - gsym)); + first = emit_insn (gen_load_toc_v4_PIC_1b (tempLR, gsym)); emit_move_insn (tmp1, tempLR); emit_move_insn (tmp2, mem); emit_insn (gen_addsi3 (tmp3, tmp1, tmp2)); @@ -7716,11 +7711,21 @@ rs6000_init_libfuncs (void) set_conv_libfunc (ufix_optab, SImode, TFmode, "_quitrunc"); } - /* Standard AIX/Darwin/64-bit SVR4 quad floating point routines. */ - set_optab_libfunc (add_optab, TFmode, "__gcc_qadd"); - set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub"); - set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul"); - set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv"); + /* AIX/Darwin/64-bit Linux quad floating point routines. */ + if (!TARGET_XL_COMPAT) + { + set_optab_libfunc (add_optab, TFmode, "__gcc_qadd"); + set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub"); + set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul"); + set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv"); + } + else + { + set_optab_libfunc (add_optab, TFmode, "_xlqadd"); + set_optab_libfunc (sub_optab, TFmode, "_xlqsub"); + set_optab_libfunc (smul_optab, TFmode, "_xlqmul"); + set_optab_libfunc (sdiv_optab, TFmode, "_xlqdiv"); + } } else { @@ -11493,11 +11498,10 @@ rs6000_emit_load_toc_table (int fromprolog) rtx temp0 = (fromprolog ? gen_rtx_REG (Pmode, 0) : gen_reg_rtx (Pmode)); - rtx symF; if (fromprolog) { - rtx symL; + rtx symF, symL; ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); symF = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); @@ -11515,14 +11519,9 @@ rs6000_emit_load_toc_table (int fromprolog) else { rtx tocsym; - static int reload_toc_labelno = 0; tocsym = gen_rtx_SYMBOL_REF (Pmode, toc_label_name); - - ASM_GENERATE_INTERNAL_LABEL (buf, "LCG", reload_toc_labelno++); - symF = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); - - emit_insn (gen_load_toc_v4_PIC_1b (tempLR, symF, tocsym)); + emit_insn (gen_load_toc_v4_PIC_1b (tempLR, tocsym)); emit_move_insn (dest, tempLR); emit_move_insn (temp0, gen_rtx_MEM (Pmode, dest)); } @@ -15818,6 +15817,13 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) } ASM_OUTPUT_LABEL (file, name); } + +static void +rs6000_elf_end_indicate_exec_stack (void) +{ + if (TARGET_32BIT) + file_end_indicate_exec_stack (); +} #endif #if TARGET_XCOFF diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index b67c210e2a9..3b062ce7cde 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -8260,11 +8260,11 @@ }) (define_expand "trunctfdf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=f") - (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))] + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))] "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" -"") + "") (define_insn_and_split "trunctfdf2_internal1" [(set (match_operand:DF 0 "gpc_reg_operand" "=f,?f") @@ -10051,11 +10051,10 @@ (define_insn "load_toc_v4_PIC_1b" [(set (match_operand:SI 0 "register_operand" "=l") - (match_operand:SI 1 "immediate_operand" "s")) - (use (unspec [(match_dup 1) (match_operand 2 "immediate_operand" "s")] + (unspec:SI [(match_operand:SI 1 "immediate_operand" "s")] UNSPEC_TOCPTR))] "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2" - "bcl 20,31,%1+4\\n%1:\\n\\t.long %2-%1" + "bcl 20,31,$+8\\n\\t.long %1-$" [(set_attr "type" "branch") (set_attr "length" "8")]) diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 index 77ba93e9152..6d1e6f46940 100644 --- a/gcc/config/rs6000/t-linux64 +++ b/gcc/config/rs6000/t-linux64 @@ -1,8 +1,9 @@ #rs6000/t-linux64 -LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c \ - $(srcdir)/config/rs6000/darwin-ldouble.c +LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c +LIB2FUNCS_STATIC_EXTRA = eabi.S $(srcdir)/config/rs6000/darwin-ldouble.c +LIB2FUNCS_SHARED_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble-shared.c TARGET_LIBGCC2_CFLAGS = -mno-minimal-toc -fPIC -specs=bispecs diff --git a/gcc/config/s390/tpf.h b/gcc/config/s390/tpf.h index 4c5af1dee8b..75b141ac952 100644 --- a/gcc/config/s390/tpf.h +++ b/gcc/config/s390/tpf.h @@ -92,6 +92,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" +#undef ASM_SPEC +#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}" + #undef LIB_SPEC #define LIB_SPEC "%{pthread:-lpthread} -lc" diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index e464ffd9e14..0b07e46f6ef 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3320,7 +3320,7 @@ legitimate_pic_operand_p (rtx x) int legitimate_address_p (enum machine_mode mode, rtx addr, int strict) { - rtx rs1 = NULL, rs2 = NULL, imm1 = NULL, imm2; + rtx rs1 = NULL, rs2 = NULL, imm1 = NULL; if (REG_P (addr) || GET_CODE (addr) == SUBREG) rs1 = addr; @@ -3384,7 +3384,6 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) && ! TARGET_CM_MEDMID && RTX_OK_FOR_OLO10_P (rs2)) { - imm2 = rs2; rs2 = NULL; imm1 = XEXP (rs1, 1); rs1 = XEXP (rs1, 0); @@ -3400,25 +3399,10 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) if (! CONSTANT_P (imm1) || tls_symbolic_operand (rs1)) return 0; - if (USE_AS_OFFSETABLE_LO10) - { - /* We can't allow TFmode, because an offset greater than or equal to - the alignment (8) may cause the LO_SUM to overflow if !v9. */ - if (mode == TFmode && ! TARGET_V9) - return 0; - } - else - { - /* We prohibit LO_SUM for TFmode when there are no quad move insns - and we consequently need to split. We do this because LO_SUM - is not an offsettable address. If we get the situation in reload - where source and destination of a movtf pattern are both MEMs with - LO_SUM address, then only one of them gets converted to an - offsettable address. */ - if (mode == TFmode - && ! (TARGET_FPU && TARGET_ARCH64 && TARGET_HARD_QUAD)) - return 0; - } + /* We can't allow TFmode in 32-bit mode, because an offset greater + than the alignment (8) may cause the LO_SUM to overflow. */ + if (mode == TFmode && TARGET_ARCH32) + return 0; } else if (GET_CODE (addr) == CONST_INT && SMALL_INT (addr)) return 1; diff --git a/gcc/config/sparc/t-elf b/gcc/config/sparc/t-elf index 027940b10e4..6868736a178 100644 --- a/gcc/config/sparc/t-elf +++ b/gcc/config/sparc/t-elf @@ -24,6 +24,6 @@ INSTALL_LIBGCC = install-multilib # Assemble startup files. crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES) - $(GCC_FOR_TARGET) -c -o crti.o -x assembler $(srcdir)/config/sparc/sol2-ci.asm + $(GCC_FOR_TARGET) -c -o crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES) - $(GCC_FOR_TARGET) -c -o crtn.o -x assembler $(srcdir)/config/sparc/sol2-cn.asm + $(GCC_FOR_TARGET) -c -o crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 5ff08561169..2c63b0ca0fa 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -50,7 +50,6 @@ static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static int vax_address_cost_1 (rtx); static int vax_address_cost (rtx); -static int vax_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code); static bool vax_rtx_costs (rtx, int, int, int *); /* Initialize the GCC target structure. */ @@ -522,179 +521,228 @@ vax_address_cost (rtx x) /* Cost of an expression on a VAX. This version has costs tuned for the CVAX chip (found in the VAX 3 series) with comments for variations on - other models. */ + other models. -static int -vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code) + FIXME: The costs need review, particularly for TRUNCATE, FLOAT_EXTEND + and FLOAT_TRUNCATE. We need a -mcpu option to allow provision of + costs on a per cpu basis. */ + +static bool +vax_rtx_costs (rtx x, int code, int outer_code, int *total) { enum machine_mode mode = GET_MODE (x); - register int c; - int i = 0; /* may be modified in switch */ + int i = 0; /* may be modified in switch */ const char *fmt = GET_RTX_FORMAT (code); /* may be modified in switch */ switch (code) { /* On a VAX, constants from 0..63 are cheap because they can use the - 1 byte literal constant format. compare to -1 should be made cheap - so that decrement-and-branch insns can be formed more easily (if - the value -1 is copied to a register some decrement-and-branch + 1 byte literal constant format. Compare to -1 should be made cheap + so that decrement-and-branch insns can be formed more easily (if + the value -1 is copied to a register some decrement-and-branch patterns will not match). */ case CONST_INT: if (INTVAL (x) == 0) - return 0; + return true; if (outer_code == AND) - return ((unsigned HOST_WIDE_INT) ~INTVAL (x) <= 077) ? 1 : 2; - if ((unsigned HOST_WIDE_INT) INTVAL (x) <= 077) - return 1; - if (outer_code == COMPARE && INTVAL (x) == -1) - return 1; - if (outer_code == PLUS && (unsigned HOST_WIDE_INT) -INTVAL (x) <= 077) - return 1; + { + *total = ((unsigned HOST_WIDE_INT) ~INTVAL (x) <= 077) ? 1 : 2; + return true; + } + if ((unsigned HOST_WIDE_INT) INTVAL (x) <= 077 + || (outer_code == COMPARE + && INTVAL (x) == -1) + || ((outer_code == PLUS || outer_code == MINUS) + && (unsigned HOST_WIDE_INT) -INTVAL (x) <= 077)) + { + *total = 1; + return true; + } /* FALLTHRU */ case CONST: case LABEL_REF: case SYMBOL_REF: - return 3; + *total = 3; + return true; case CONST_DOUBLE: if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT) - return vax_float_literal (x) ? 5 : 8; + *total = vax_float_literal (x) ? 5 : 8; else - return (((CONST_DOUBLE_HIGH (x) == 0 - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x) < 64) - || (outer_code == PLUS - && CONST_DOUBLE_HIGH (x) == -1 \ - && (unsigned HOST_WIDE_INT)-CONST_DOUBLE_LOW (x) < 64)) - ? 2 : 5); + *total = ((CONST_DOUBLE_HIGH (x) == 0 + && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x) < 64) + || (outer_code == PLUS + && CONST_DOUBLE_HIGH (x) == -1 + && (unsigned HOST_WIDE_INT)-CONST_DOUBLE_LOW (x) < 64)) + ? 2 : 5; + return true; case POST_INC: - return 2; + *total = 2; + return true; /* Implies register operand. */ + case PRE_DEC: - return 3; + *total = 3; + return true; /* Implies register operand. */ + case MULT: switch (mode) { case DFmode: - c = 16; /* 4 on VAX 9000 */ + *total = 16; /* 4 on VAX 9000 */ break; case SFmode: - c = 9; /* 4 on VAX 9000, 12 on VAX 2 */ + *total = 9; /* 4 on VAX 9000, 12 on VAX 2 */ break; case DImode: - c = 16; /* 6 on VAX 9000, 28 on VAX 2 */ + *total = 16; /* 6 on VAX 9000, 28 on VAX 2 */ break; case SImode: case HImode: case QImode: - c = 10; /* 3-4 on VAX 9000, 20-28 on VAX 2 */ + *total = 10; /* 3-4 on VAX 9000, 20-28 on VAX 2 */ break; default: - return MAX_COST; /* Mode is not supported. */ + *total = MAX_COST; /* Mode is not supported. */ + return true; } break; + case UDIV: if (mode != SImode) - return MAX_COST; /* Mode is not supported. */ - c = 17; + { + *total = MAX_COST; /* Mode is not supported. */ + return true; + } + *total = 17; break; + case DIV: if (mode == DImode) - c = 30; /* highly variable */ + *total = 30; /* Highly variable. */ else if (mode == DFmode) /* divide takes 28 cycles if the result is not zero, 13 otherwise */ - c = 24; + *total = 24; else - c = 11; /* 25 on VAX 2 */ + *total = 11; /* 25 on VAX 2 */ break; + case MOD: - c = 23; + *total = 23; break; + case UMOD: if (mode != SImode) - return MAX_COST; /* Mode is not supported. */ - c = 29; + { + *total = MAX_COST; /* Mode is not supported. */ + return true; + } + *total = 29; break; + case FLOAT: - c = 6 + (mode == DFmode) + (GET_MODE (XEXP (x, 0)) != SImode); - /* 4 on VAX 9000 */ + *total = (6 /* 4 on VAX 9000 */ + + (mode == DFmode) + (GET_MODE (XEXP (x, 0)) != SImode)); break; + case FIX: - c = 7; /* 17 on VAX 2 */ + *total = 7; /* 17 on VAX 2 */ break; + case ASHIFT: case LSHIFTRT: case ASHIFTRT: if (mode == DImode) - c = 12; + *total = 12; else - c = 10; /* 6 on VAX 9000 */ + *total = 10; /* 6 on VAX 9000 */ break; + case ROTATE: case ROTATERT: - c = 6; /* 5 on VAX 2, 4 on VAX 9000 */ + *total = 6; /* 5 on VAX 2, 4 on VAX 9000 */ if (GET_CODE (XEXP (x, 1)) == CONST_INT) - fmt = "e"; /* all constant rotate counts are short */ + fmt = "e"; /* all constant rotate counts are short */ break; + case PLUS: case MINUS: - c = (mode == DFmode) ? 13 : 8; /* 6/8 on VAX 9000, 16/15 on VAX 2 */ + *total = (mode == DFmode) ? 13 : 8; /* 6/8 on VAX 9000, 16/15 on VAX 2 */ /* Small integer operands can use subl2 and addl2. */ if ((GET_CODE (XEXP (x, 1)) == CONST_INT) && (unsigned HOST_WIDE_INT)(INTVAL (XEXP (x, 1)) + 63) < 127) fmt = "e"; break; + case IOR: case XOR: - c = 3; + *total = 3; break; + case AND: /* AND is special because the first operand is complemented. */ - c = 3; + *total = 3; if (GET_CODE (XEXP (x, 0)) == CONST_INT) { if ((unsigned HOST_WIDE_INT)~INTVAL (XEXP (x, 0)) > 63) - c = 4; + *total = 4; fmt = "e"; i = 1; } break; + case NEG: if (mode == DFmode) - return 9; + *total = 9; else if (mode == SFmode) - return 6; + *total = 6; else if (mode == DImode) - return 4; + *total = 4; + else + *total = 2; + break; + case NOT: - return 2; + *total = 2; + break; + case ZERO_EXTRACT: case SIGN_EXTRACT: - c = 15; + *total = 15; break; + case MEM: if (mode == DImode || mode == DFmode) - c = 5; /* 7 on VAX 2 */ + *total = 5; /* 7 on VAX 2 */ else - c = 3; /* 4 on VAX 2 */ + *total = 3; /* 4 on VAX 2 */ x = XEXP (x, 0); - if (GET_CODE (x) == REG || GET_CODE (x) == POST_INC) - return c; - return c + vax_address_cost_1 (x); - default: - c = 3; + if (GET_CODE (x) != REG && GET_CODE (x) != POST_INC) + *total += vax_address_cost_1 (x); + return true; + + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: + case TRUNCATE: + *total = 3; /* FIXME: Costs need to be checked */ break; + + default: + return false; } /* Now look inside the expression. Operands which are not registers or short constants add to the cost. FMT and I may have been adjusted in the switch above for instructions - which require special handling */ + which require special handling. */ while (*fmt++ == 'e') { - register rtx op = XEXP (x, i++); + rtx op = XEXP (x, i); + + i += 1; code = GET_CODE (op); /* A NOT is likely to be found as the first operand of an AND @@ -708,12 +756,12 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code) case CONST_INT: if ((unsigned HOST_WIDE_INT)INTVAL (op) > 63 && GET_MODE (x) != QImode) - c += 1; /* 2 on VAX 2 */ + *total += 1; /* 2 on VAX 2 */ break; case CONST: case LABEL_REF: case SYMBOL_REF: - c += 1; /* 2 on VAX 2 */ + *total += 1; /* 2 on VAX 2 */ break; case CONST_DOUBLE: if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT) @@ -721,37 +769,30 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code) /* Registers are faster than floating point constants -- even those constants which can be encoded in a single byte. */ if (vax_float_literal (op)) - c++; + *total += 1; else - c += (GET_MODE (x) == DFmode) ? 3 : 2; + *total += (GET_MODE (x) == DFmode) ? 3 : 2; } else { if (CONST_DOUBLE_HIGH (op) != 0 || (unsigned)CONST_DOUBLE_LOW (op) > 63) - c += 2; + *total += 2; } break; case MEM: - c += 1; /* 2 on VAX 2 */ + *total += 1; /* 2 on VAX 2 */ if (GET_CODE (XEXP (op, 0)) != REG) - c += vax_address_cost_1 (XEXP (op, 0)); + *total += vax_address_cost_1 (XEXP (op, 0)); break; case REG: case SUBREG: break; default: - c += 1; + *total += 1; break; } } - return c; -} - -static bool -vax_rtx_costs (rtx x, int code, int outer_code, int * total) -{ - *total = vax_rtx_costs_1 (x, code, outer_code); return true; } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9411ae3a962..8c0f39cd9f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,116 @@ +2005-05-04 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2004-12-21 Mark Mitchell <mark@codesourcery.com> + PR c++/19034 + * tree.c (cp_tree_equal): Handle OVERLOAD. + +2005-05-02 Mark Mitchell <mark@codesourcery.com> + + Revert: + 2005-05-01 Mark Mitchell <mark@codesourcery.com> + * typeck.c (unary_complex_lvalue): In a template, always refuse + simplifications. + +2005-05-01 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2005-02-22 Mark Mitchell <mark@codesourcery.com> + PR c++/19991 + * init.c (decl_constant_value): Iterate if the value of a decl + is itself a constant. + +2005-05-01 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2004-12-22 Mark Mitchell <mark@codesourcery.com> + PR c++/18464 + * call.c (build_this): In templates, do not bother with + build_unary_op. + * typeck.c (unary_complex_lvalue): In a template, always refuse + simplifications. + +2005-04-25 Roger Sayle <roger@eyesopen.com> + Mark Mitchell <mark@codesourcery.com> + + PR c++/20995 + Partial backport from mainline. + 2004-09-27 Mark Mitchell <mark@codesourcery.com> + * tree.c (fold_if_not_in_template): New function. + * cp-tree.h (fold_if_not_in_template): Prototype here. + * call.c (build_conditional_expr): Use fold_if_not_in_template. + * typeck.c (build_binary_op): Likewise. + +2005-04-16 Mark Mitchell <mark@codesourcery.com> + + PR c++/21025 + * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to + which sizeof/alignof is dependent, rather than just whether we are + processing_template_decl. + +2005-04-06 Jason Merrill <jason@redhat.com> + + PR c++/19312 + * tree.c (stabilize_init): Don't bother trying to stabilize + something with no side-effects. + +2005-04-04 Mark Mitchell <mark@codesourcery.com> + + PR c++/20679 + * parser.c (cp_parser_template_name): Fix thinko. + +2005-04-03 Gabriel Dos Reis <gdr@integrable-solutions.net> + + PR c++/18644 + * call.c (build_new_op): Remove check for -Wsynth. + +2005-03-21 Paolo Carlini <pcarlini@suse.de> + + PR c++/20147 + * semantics.c (finish_stmt_expr_expr): Return immediately + if error_operand_p (expr). + +2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/20240 + * decl.c (decls_match): Compare context of VAR_DECL. + +2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/20333 + * parser.c (cp_parser_postfix_expression) <case RID_TYPENAME>: + Check the return value of cp_parser_nested_name_specifier. + +2005-03-08 Mark Mitchell <mark@codesourcery.com> + + PR c++/20142 + * init.c (build_vec_init): When determining whether or not the + element type has an asignment operator, look through all array + dimensions. + +2005-03-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/19311 + * init.c (build_offset_ref): Don't build non-dependent SCOPE_REF. + * pt.c (build_non_dependent_expr): Don't build NON_DEPENDENT_EXPR + for OFFSET_TYPE. + * typeck.c (build_x_unary_op): Don't build non-dependent SCOPE_REF. + Also set PTRMEM_OK_P for NON_DEPENDENT_EXPR. + (build_unary_op): Handle building ADDR_EXPR of OFFSET_REF inside + template. + +2005-03-02 Alexandre Oliva <aoliva@redhat.com> + + * name-lookup.c (push_overloaded_decl): Don't error if the new + decl matches the old one. + * decl.c (redeclaration_error_message): Likewise. + +2005-02-24 Jakub Jelinek <jakub@redhat.com> + + PR c++/20175 + * decl.c (reshape_init): Don't warn about missing braces if STRING_CST + initializes a char/wchar_t array. + 2005-02-09 Alexandre Oliva <aoliva@redhat.com> PR c++/18838 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index ee464533bc6..aeed3155df4 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1,6 +1,6 @@ /* Functions related to invoking methods and overloaded functions. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). @@ -2203,10 +2203,18 @@ any_strictly_viable (struct z_candidate *cands) return false; } +/* OBJ is being used in an expression like "OBJ.f (...)". In other + words, it is about to become the "this" pointer for a member + function call. Take the address of the object. */ + static tree build_this (tree obj) { - /* Fix this to work on non-lvalues. */ + /* In a template, we are only concerned about the type of the + expression, so we can take a shortcut. */ + if (processing_template_decl) + return build_address (obj); + return build_unary_op (ADDR_EXPR, obj, 0); } @@ -3278,7 +3286,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) } valid_operands: - result = fold (build (COND_EXPR, result_type, arg1, arg2, arg3)); + result = fold_if_not_in_template (build (COND_EXPR, result_type, + arg1, arg2, arg3)); /* We can't use result_type below, as fold might have returned a throw_expr. */ @@ -3562,20 +3571,6 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, if (overloaded_p) *overloaded_p = true; - if (warn_synth - && fnname == ansi_assopname (NOP_EXPR) - && DECL_ARTIFICIAL (cand->fn) - && candidates->next - && ! candidates->next->next) - { - warning ("using synthesized `%#D' for copy assignment", - cand->fn); - cp_warning_at (" where cfront would use `%#D'", - cand == candidates - ? candidates->next->fn - : candidates->fn); - } - return build_over_call (cand, LOOKUP_NORMAL); } diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 0afc144dadb..3c62c19a014 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1,6 +1,6 @@ /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -4206,6 +4206,7 @@ extern int cp_cannot_inline_tree_fn (tree*); extern tree cp_add_pending_fn_decls (void*,tree); extern int cp_is_overload_p (tree); extern int cp_auto_var_in_fn_p (tree,tree); +extern tree fold_if_not_in_template (tree); extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*, int*, tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2963fe3ba0b..e95e71c185c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1,6 +1,6 @@ /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1068,6 +1068,12 @@ decls_match (tree newdecl, tree olddecl) } else { + /* Need to check scope for variable declaration (VAR_DECL). + For typedef (TYPE_DECL), scope is ignored. */ + if (TREE_CODE (newdecl) == VAR_DECL + && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl)) + return 0; + if (TREE_TYPE (newdecl) == error_mark_node) types_match = TREE_TYPE (olddecl) == error_mark_node; else if (TREE_TYPE (olddecl) == NULL_TREE) @@ -2026,7 +2032,8 @@ redeclaration_error_message (tree newdecl, tree olddecl) /* If both functions come from different namespaces, this is not a redeclaration - this is a conflict with a used function. */ if (DECL_NAMESPACE_SCOPE_P (olddecl) - && DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl)) + && DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl) + && ! decls_match (olddecl, newdecl)) return "`%D' conflicts with used function"; /* We'll complain about linkage mismatches in @@ -4279,6 +4286,7 @@ reshape_init (tree type, tree *initp) tree old_init_value; tree new_init; bool brace_enclosed_p; + bool string_init_p; old_init = *initp; old_init_value = (TREE_CODE (*initp) == TREE_LIST @@ -4343,6 +4351,7 @@ reshape_init (tree type, tree *initp) return old_init; } + string_init_p = false; if (TREE_CODE (old_init_value) == STRING_CST && TREE_CODE (type) == ARRAY_TYPE && char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type)))) @@ -4357,6 +4366,7 @@ reshape_init (tree type, tree *initp) /* Move past the initializer. */ *initp = TREE_CHAIN (old_init); TREE_CHAIN (old_init) = NULL_TREE; + string_init_p = true; } else { @@ -4451,7 +4461,7 @@ reshape_init (tree type, tree *initp) { if (brace_enclosed_p) error ("too many initializers for `%T'", type); - else if (warn_missing_braces) + else if (warn_missing_braces && !string_init_p) warning ("missing braces around initializer"); } diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 3adf37fb97b..732d4a0c84d 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1462,14 +1462,6 @@ build_offset_ref (tree type, tree name, bool address_p) return error_mark_node; } - if (processing_template_decl) - { - if (TREE_CODE (orig_name) == TEMPLATE_ID_EXPR) - return build_min (SCOPE_REF, TREE_TYPE (member), type, orig_name); - else - return build_min (SCOPE_REF, TREE_TYPE (member), type, name); - } - if (TREE_CODE (member) == TYPE_DECL) { TREE_USED (member) = 1; @@ -1631,21 +1623,23 @@ decl_constant_value (tree decl) TREE_OPERAND (decl, 0), d1, d2); } - if (DECL_P (decl) - && (/* Enumeration constants are constant. */ - TREE_CODE (decl) == CONST_DECL - /* And so are variables with a 'const' type -- unless they - are also 'volatile'. */ - || CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (decl))) - && DECL_INITIAL (decl) - && DECL_INITIAL (decl) != error_mark_node - /* This is invalid if initial value is not constant. - If it has either a function call, a memory reference, - or a variable, then re-evaluating it could give different results. */ - && TREE_CONSTANT (DECL_INITIAL (decl)) - /* Check for cases where this is sub-optimal, even though valid. */ - && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR) - return DECL_INITIAL (decl); + while (DECL_P (decl) + && (/* Enumeration constants are constant. */ + TREE_CODE (decl) == CONST_DECL + /* And so are variables with a 'const' type -- unless they + are also 'volatile'. */ + || CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (decl))) + && DECL_INITIAL (decl) + && DECL_INITIAL (decl) != error_mark_node + /* This is invalid if initial value is not constant. If it + has either a function call, a memory reference, or a + variable, then re-evaluating it could give different + results. */ + && TREE_CONSTANT (DECL_INITIAL (decl)) + /* Check for cases where this is sub-optimal, even though + valid. */ + && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR) + decl = DECL_INITIAL (decl); return decl; } @@ -2550,6 +2544,9 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array) tree atype = TREE_TYPE (base); /* The type of an element in the array. */ tree type = TREE_TYPE (atype); + /* The element type reached after removing all outer array + types. */ + tree inner_elt_type; /* The type of a pointer to an element in the array. */ tree ptype; tree stmt_expr; @@ -2566,15 +2563,17 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array) if (maxindex == NULL_TREE || maxindex == error_mark_node) return error_mark_node; + inner_elt_type = strip_array_types (atype); if (init && (from_array == 2 - ? (!CLASS_TYPE_P (type) || !TYPE_HAS_COMPLEX_ASSIGN_REF (type)) + ? (!CLASS_TYPE_P (inner_elt_type) + || !TYPE_HAS_COMPLEX_ASSIGN_REF (inner_elt_type)) : !TYPE_NEEDS_CONSTRUCTING (type)) && ((TREE_CODE (init) == CONSTRUCTOR /* Don't do this if the CONSTRUCTOR might contain something that might throw and require us to clean up. */ && (CONSTRUCTOR_ELTS (init) == NULL_TREE - || ! TYPE_HAS_NONTRIVIAL_DESTRUCTOR (target_type (type)))) + || ! TYPE_HAS_NONTRIVIAL_DESTRUCTOR (inner_elt_type))) || from_array)) { /* Do non-default initialization of POD arrays resulting from diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 50313f857ed..06f0cc912d2 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1,5 +1,5 @@ /* Definitions for C++ name lookup routines. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> This file is part of GCC. @@ -2018,7 +2018,8 @@ push_overloaded_decl (tree decl, int flags) if (TREE_CODE (tmp) == OVERLOAD && OVL_USED (tmp) && !(flags & PUSH_USING) && compparms (TYPE_ARG_TYPES (TREE_TYPE (fn)), - TYPE_ARG_TYPES (TREE_TYPE (decl)))) + TYPE_ARG_TYPES (TREE_TYPE (decl))) + && ! decls_match (fn, decl)) error ("`%#D' conflicts with previous using declaration `%#D'", decl, fn); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index bf893756af8..e217b9aaab4 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3551,18 +3551,22 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) bool template_p = false; tree id; tree type; + tree scope; /* Consume the `typename' token. */ cp_lexer_consume_token (parser->lexer); /* Look for the optional `::' operator. */ cp_parser_global_scope_opt (parser, /*current_scope_valid_p=*/false); - /* Look for the nested-name-specifier. */ - cp_parser_nested_name_specifier (parser, - /*typename_keyword_p=*/true, - /*check_dependency_p=*/true, - /*type_p=*/true, - /*is_declaration=*/true); + /* Look for the nested-name-specifier. In case of error here, + consume the trailing id to avoid subsequent error messages + for usual cases. */ + scope = cp_parser_nested_name_specifier (parser, + /*typename_keyword_p=*/true, + /*check_dependency_p=*/true, + /*type_p=*/true, + /*is_declaration=*/true); + /* Look for the optional `template' keyword. */ template_p = cp_parser_optional_template_keyword (parser); /* We don't know whether we're looking at a template-id or an @@ -3575,9 +3579,13 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) /* If that didn't work, try an identifier. */ if (!cp_parser_parse_definitely (parser)) id = cp_parser_identifier (parser); + + /* Don't process id if nested name specifier is invalid. */ + if (scope == error_mark_node) + return error_mark_node; /* If we look up a template-id in a non-dependent qualifying scope, there's no need to create a dependent type. */ - if (TREE_CODE (id) == TYPE_DECL + else if (TREE_CODE (id) == TYPE_DECL && !dependent_type_p (parser->scope)) type = TREE_TYPE (id); /* Create a TYPENAME_TYPE to represent the type to which the @@ -8228,6 +8236,8 @@ cp_parser_template_name (cp_parser* parser, ; else { + tree fn = NULL_TREE; + /* The standard does not explicitly indicate whether a name that names a set of overloaded declarations, some of which are templates, is a template-name. However, such a name should @@ -8235,14 +8245,11 @@ cp_parser_template_name (cp_parser* parser, template-id for the overloaded templates. */ fns = BASELINK_P (decl) ? BASELINK_FUNCTIONS (decl) : decl; if (TREE_CODE (fns) == OVERLOAD) - { - tree fn; - - for (fn = fns; fn; fn = OVL_NEXT (fn)) - if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL) - break; - } - else + for (fn = fns; fn; fn = OVL_NEXT (fn)) + if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL) + break; + + if (!fn) { /* Otherwise, the name does not name a template. */ cp_parser_error (parser, "expected template-name"); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9e53de2d640..a93241f87ad 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12229,7 +12229,8 @@ build_non_dependent_expr (tree expr) if (TREE_CODE (inner_expr) == OVERLOAD || TREE_CODE (inner_expr) == FUNCTION_DECL || TREE_CODE (inner_expr) == TEMPLATE_DECL - || TREE_CODE (inner_expr) == TEMPLATE_ID_EXPR) + || TREE_CODE (inner_expr) == TEMPLATE_ID_EXPR + || TREE_CODE (inner_expr) == OFFSET_REF) return expr; /* Preserve string constants; conversions from string constants to "char *" are allowed, even though normally a "const char *" diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 45fa695f294..bb2f3c925ad 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1443,6 +1443,9 @@ finish_stmt_expr_expr (tree expr) tree result = NULL_TREE; tree type = void_type_node; + if (error_operand_p (expr)) + return error_mark_node; + if (expr) { type = TREE_TYPE (expr); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d3b709fdfa0..cc94bd918c7 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1,6 +1,6 @@ /* Language-dependent node constructors for parse phase of GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1604,6 +1604,11 @@ cp_tree_equal (tree t1, tree t2) return same_type_p (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2)); + case OVERLOAD: + if (OVL_FUNCTION (t1) != OVL_FUNCTION (t2)) + return false; + return cp_tree_equal (OVL_CHAIN (t1), OVL_CHAIN (t2)); + default: break; } @@ -2525,12 +2530,28 @@ stabilize_init (tree init, tree *initp) if (TREE_CODE (t) == COND_EXPR) return false; - stabilize_call (t, initp); + /* The TARGET_EXPR might be initializing via bitwise copy from + another variable; leave that alone. */ + if (TREE_SIDE_EFFECTS (t)) + stabilize_call (t, initp); } return true; } +/* Like "fold", but should be used whenever we might be processing the + body of a template. */ + +tree +fold_if_not_in_template (tree expr) +{ + /* In the body of a template, there is never any need to call + "fold". We will call fold later when actually instantiating the + template. Integral constant expressions in templates will be + evaluated via fold_non_dependent_expr, as necessary. */ + return (processing_template_decl ? expr : fold (expr)); +} + #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) /* Complain that some language-specific thing hanging off a tree diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index d7c1cb36922..0c9c6c4630b 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1,6 +1,6 @@ /* Build expressions with type checking for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1216,7 +1216,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain) if (type == error_mark_node) return error_mark_node; - if (processing_template_decl) + if (dependent_type_p (type)) { value = build_min (op, size_type_node, type); TREE_READONLY (value) = 1; @@ -3458,7 +3458,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree result = build (resultcode, build_type, op0, op1); tree folded; - folded = fold (result); + folded = fold_if_not_in_template (result); if (folded == result) TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1); if (final_type != 0) @@ -3549,23 +3549,6 @@ build_x_unary_op (enum tree_code code, tree xarg) if (type_dependent_expression_p (xarg)) return build_min_nt (code, xarg, NULL_TREE); - /* For non-dependent pointer-to-member, the SCOPE_REF will be - processed during template substitution. Just compute the - right type here and build an ADDR_EXPR around it for - diagnostics. */ - if (code == ADDR_EXPR && TREE_CODE (xarg) == SCOPE_REF) - { - tree type; - if (TREE_TYPE (xarg) == unknown_type_node) - type = unknown_type_node; - else if (TREE_CODE (TREE_TYPE (xarg)) == FUNCTION_TYPE) - type = build_pointer_type (TREE_TYPE (xarg)); - else - type = build_ptrmem_type (TREE_OPERAND (xarg, 0), - TREE_TYPE (xarg)); - return build_min (code, type, xarg, NULL_TREE); - } - xarg = build_non_dependent_expr (xarg); } @@ -3627,13 +3610,13 @@ build_x_unary_op (enum tree_code code, tree xarg) else if (TREE_CODE (xarg) == TARGET_EXPR) warning ("taking address of temporary"); exp = build_unary_op (ADDR_EXPR, xarg, 0); - if (TREE_CODE (exp) == ADDR_EXPR) - PTRMEM_OK_P (exp) = ptrmem; } if (processing_template_decl && exp != error_mark_node) - return build_min_non_dep (code, exp, orig_expr, - /*For {PRE,POST}{INC,DEC}REMENT_EXPR*/NULL_TREE); + exp = build_min_non_dep (code, exp, orig_expr, + /*For {PRE,POST}{INC,DEC}REMENT_EXPR*/NULL_TREE); + if (TREE_CODE (exp) == ADDR_EXPR) + PTRMEM_OK_P (exp) = ptrmem; return exp; } @@ -4095,6 +4078,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) is an error. */ else if (TREE_CODE (argtype) != FUNCTION_TYPE && TREE_CODE (argtype) != METHOD_TYPE + && TREE_CODE (arg) != OFFSET_REF && !lvalue_or_else (arg, "unary `&'")) return error_mark_node; @@ -4109,7 +4093,11 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) expression so we can just form an ADDR_EXPR with the correct type. */ || processing_template_decl) - addr = build_address (arg); + { + addr = build_address (arg); + if (TREE_CODE (arg) == OFFSET_REF) + PTRMEM_OK_P (addr) = PTRMEM_OK_P (arg); + } else if (TREE_CODE (TREE_OPERAND (arg, 1)) == BASELINK) { tree fn = BASELINK_FUNCTIONS (TREE_OPERAND (arg, 1)); @@ -4178,7 +4166,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) for certain kinds of expressions which are not really lvalues but which we can accept as lvalues. - If ARG is not a kind of expression we can handle, return zero. */ + If ARG is not a kind of expression we can handle, return + NULL_TREE. */ tree unary_complex_lvalue (enum tree_code code, tree arg) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index cb3904617e9..2fe3fa32ec5 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2050,6 +2050,8 @@ typedef void voidfn (); volatile voidfn fatal; @end smallexample +This approach does not work in GNU C++. + @cindex @code{noinline} function attribute @item noinline This function attribute prevents a function from being considered for diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index fc05ddb360b..cfa3be5d1a0 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2116,19 +2116,19 @@ GNU Compiler Collection on your machine. @ifhtml @itemize @item -@uref{#alpha*-*-*,,alpha*-*-*} +@uref{#alpha-x-x,,alpha*-*-*} @item -@uref{#alpha*-dec-osf*,,alpha*-dec-osf*} +@uref{#alpha-dec-osf,,alpha*-dec-osf*} @item -@uref{#alphaev5-cray-unicosmk*,,alphaev5-cray-unicosmk*} +@uref{#alphaev5-cray-unicosmk,,alphaev5-cray-unicosmk*} @item -@uref{#arc-*-elf,,arc-*-elf} +@uref{#arc-x-elf,,arc-*-elf} @item -@uref{#arm-*-elf,,arm-*-elf} -@uref{#arm-*-coff,,arm-*-coff} -@uref{#arm-*-aout,,arm-*-aout} +@uref{#arm-x-elf,,arm-*-elf} +@uref{#arm-x-coff,,arm-*-coff} +@uref{#arm-x-aout,,arm-*-aout} @item -@uref{#xscale-*-*,,xscale-*-*} +@uref{#xscale-x-x,,xscale-*-*} @item @uref{#avr,,avr} @item @@ -2138,41 +2138,39 @@ GNU Compiler Collection on your machine. @item @uref{#dsp16xx,,dsp16xx} @item -@uref{#*-*-freebsd*,,*-*-freebsd*} +@uref{#x-x-freebsd,,*-*-freebsd*} @item @uref{#h8300-hms,,h8300-hms} @item -@uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*} +@uref{#hppa-hp-hpux,,hppa*-hp-hpux*} @item -@uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10} +@uref{#hppa-hp-hpux10,,hppa*-hp-hpux10} @item -@uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11} +@uref{#hppa-hp-hpux11,,hppa*-hp-hpux11} @item -@uref{#i370-*-*,,i370-*-*} +@uref{#i370-x-x,,i370-*-*} @item -@uref{#*-*-linux-gnu,,*-*-linux-gnu} +@uref{#x-x-linux-gnu,,*-*-linux-gnu} @item -@uref{#ix86-*-linux*aout,,i?86-*-linux*aout} +@uref{#ix86-x-linuxaout,,i?86-*-linux*aout} @item -@uref{#ix86-*-linux*,,i?86-*-linux*} +@uref{#ix86-x-linux,,i?86-*-linux*} @item -@uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*} +@uref{#ix86-x-sco32v5,,i?86-*-sco3.2v5*} @item -@uref{#ix86-*-udk,,i?86-*-udk} +@uref{#ix86-x-udk,,i?86-*-udk} @item -@uref{#ix86-*-esix,,i?86-*-esix} +@uref{#ia64-x-linux,,ia64-*-linux} @item -@uref{#ia64-*-linux,,ia64-*-linux} +@uref{#ia64-x-hpux,,ia64-*-hpux*} @item -@uref{#ia64-*-hpux*,,ia64-*-hpux*} +@uref{#x-ibm-aix,,*-ibm-aix*} @item -@uref{#*-ibm-aix*,,*-ibm-aix*} +@uref{#ip2k-x-elf,,ip2k-*-elf} @item -@uref{#ip2k-*-elf,,ip2k-*-elf} +@uref{#iq2000-x-elf,,iq2000-*-elf} @item -@uref{#iq2000-*-elf,,iq2000-*-elf} -@item -@uref{#m32r-*-elf,,m32r-*-elf} +@uref{#m32r-x-elf,,m32r-*-elf} @item @uref{#m6811-elf,,m6811-elf} @item @@ -2180,63 +2178,61 @@ GNU Compiler Collection on your machine. @item @uref{#m68k-hp-hpux,,m68k-hp-hpux} @item -@uref{#mips-*-*,,mips-*-*} +@uref{#mips-x-x,,mips-*-*} @item @uref{#mips-sgi-irix5,,mips-sgi-irix5} @item @uref{#mips-sgi-irix6,,mips-sgi-irix6} @item -@uref{#powerpc*-*-*,,powerpc*-*-*, powerpc-*-sysv4} -@item -@uref{#powerpc-*-darwin*,,powerpc-*-darwin*} +@uref{#powerpc-x-x,,powerpc*-*-*, powerpc-*-sysv4} @item -@uref{#powerpc-*-elf,,powerpc-*-elf, powerpc-*-sysv4} +@uref{#powerpc-x-darwin,,powerpc-*-darwin*} @item -@uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*} +@uref{#powerpc-x-elf,,powerpc-*-elf, powerpc-*-sysv4} @item -@uref{#powerpc-*-netbsd*,,powerpc-*-netbsd*} +@uref{#powerpc-x-linux-gnu,,powerpc*-*-linux-gnu*} @item -@uref{#powerpc-*-eabiaix,,powerpc-*-eabiaix} +@uref{#powerpc-x-netbsd,,powerpc-*-netbsd*} @item -@uref{#powerpc-*-eabisim,,powerpc-*-eabisim} +@uref{#powerpc-x-eabisim,,powerpc-*-eabisim} @item -@uref{#powerpc-*-eabi,,powerpc-*-eabi} +@uref{#powerpc-x-eabi,,powerpc-*-eabi} @item -@uref{#powerpcle-*-elf,,powerpcle-*-elf, powerpcle-*-sysv4} +@uref{#powerpcle-x-elf,,powerpcle-*-elf, powerpcle-*-sysv4} @item -@uref{#powerpcle-*-eabisim,,powerpcle-*-eabisim} +@uref{#powerpcle-x-eabisim,,powerpcle-*-eabisim} @item -@uref{#powerpcle-*-eabi,,powerpcle-*-eabi} +@uref{#powerpcle-x-eabi,,powerpcle-*-eabi} @item -@uref{#s390-*-linux*,,s390-*-linux*} +@uref{#s390-x-linux,,s390-*-linux*} @item -@uref{#s390x-*-linux*,,s390x-*-linux*} +@uref{#s390x-x-linux,,s390x-*-linux*} @item -@uref{#s390x-ibm-tpf*,,s390x-ibm-tpf*} +@uref{#s390x-ibm-tpf,,s390x-ibm-tpf*} @item -@uref{#*-*-solaris2*,,*-*-solaris2*} +@uref{#x-x-solaris2,,*-*-solaris2*} @item -@uref{#sparc-sun-solaris2*,,sparc-sun-solaris2*} +@uref{#sparc-sun-solaris2,,sparc-sun-solaris2*} @item -@uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7} +@uref{#sparc-sun-solaris27,,sparc-sun-solaris2.7} @item -@uref{#sparc-*-linux*,,sparc-*-linux*} +@uref{#sparc-x-linux,,sparc-*-linux*} @item -@uref{#sparc64-*-solaris2*,,sparc64-*-solaris2*} +@uref{#sparc64-x-solaris2,,sparc64-*-solaris2*} @item -@uref{#sparcv9-*-solaris2*,,sparcv9-*-solaris2*} +@uref{#sparcv9-x-solaris2,,sparcv9-*-solaris2*} @item -@uref{#*-*-sysv*,,*-*-sysv*} +@uref{#x-x-sysv,,*-*-sysv*} @item @uref{#vax-dec-ultrix,,vax-dec-ultrix} @item -@uref{#*-*-vxworks*,,*-*-vxworks*} +@uref{#x-x-vxworks,,*-*-vxworks*} @item -@uref{#x86_64-*-*,,x86_64-*-*, amd64-*-*} +@uref{#x86-64-x-x,,x86_64-*-*, amd64-*-*} @item -@uref{#xtensa-*-elf,,xtensa-*-elf} +@uref{#xtensa-x-elf,,xtensa-*-elf} @item -@uref{#xtensa-*-linux*,,xtensa-*-linux*} +@uref{#xtensa-x-linux,,xtensa-*-linux*} @item @uref{#windows,,Microsoft Windows} @item @@ -2247,7 +2243,7 @@ GNU Compiler Collection on your machine. @itemize @item -@uref{#elf_targets,,all ELF targets} (SVR4, Solaris 2, etc.) +@uref{#elf,,all ELF targets} (SVR4, Solaris 2, etc.) @end itemize @end ifhtml @@ -2256,7 +2252,7 @@ GNU Compiler Collection on your machine. <!-- -------- host/target specific issues start here ---------------- --> <hr /> @end html -@heading @anchor{alpha*-*-*}alpha*-*-* +@heading @anchor{alpha-x-x}alpha*-*-* This section contains general configuration information for all alpha-based platforms using ELF (in particular, ignore this section for @@ -2271,7 +2267,7 @@ shared libraries. @html <hr /> @end html -@heading @anchor{alpha*-dec-osf*}alpha*-dec-osf* +@heading @anchor{alpha-dec-osf}alpha*-dec-osf* Systems using processors that implement the DEC Alpha architecture and are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq Tru64 UNIX) operating system, for example the DEC Alpha AXP systems. @@ -2352,7 +2348,7 @@ provide a fix shortly. @html <hr /> @end html -@heading @anchor{alphaev5-cray-unicosmk*}alphaev5-cray-unicosmk* +@heading @anchor{alphaev5-cray-unicosmk}alphaev5-cray-unicosmk* Cray T3E systems running Unicos/Mk. This port is incomplete and has many known bugs. We hope to improve the @@ -2379,15 +2375,15 @@ failure. @html <hr /> @end html -@heading @anchor{arc-*-elf}arc-*-elf +@heading @anchor{arc-x-elf}arc-*-elf Argonaut ARC processor. This configuration is intended for embedded systems. @html <hr /> @end html -@heading @anchor{arm-*-elf}arm-*-elf -@heading @anchor{xscale-*-*}xscale-*-* +@heading @anchor{arm-x-elf}arm-*-elf +@heading @anchor{xscale-x-x}xscale-*-* ARM-family processors. Subtargets that use the ELF object format require GNU binutils 2.13 or newer. Such subtargets include: @code{arm-*-freebsd}, @code{arm-*-netbsdelf}, @code{arm-*-*linux}, @@ -2396,7 +2392,7 @@ require GNU binutils 2.13 or newer. Such subtargets include: @html <hr /> @end html -@heading @anchor{arm-*-coff}arm-*-coff +@heading @anchor{arm-x-coff}arm-*-coff ARM-family processors. Note that there are two different varieties of PE format subtarget supported: @code{arm-wince-pe} and @code{arm-pe} as well as a standard COFF target @code{arm-*-coff}. @@ -2404,7 +2400,7 @@ of PE format subtarget supported: @code{arm-wince-pe} and @html <hr /> @end html -@heading @anchor{arm-*-aout}arm-*-aout +@heading @anchor{arm-x-aout}arm-*-aout ARM-family processors. These targets support the AOUT file format: @code{arm-*-aout}, @code{arm-*-netbsd}. @@ -2536,7 +2532,7 @@ A port to the AT&T DSP1610 family of processors. @html <hr /> @end html -@heading @anchor{*-*-freebsd*}*-*-freebsd* +@heading @anchor{x-x-freebsd}*-*-freebsd* The version of binutils installed in @file{/usr/bin} probably works with this release of GCC. However, on FreeBSD 4, bootstrapping against the @@ -2597,7 +2593,7 @@ longer a multiple of 2 bytes. @html <hr /> @end html -@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux* +@heading @anchor{hppa-hp-hpux}hppa*-hp-hpux* Support for HP-UX version 9 and older was discontinued in GCC 3.4. We @emph{highly} recommend using gas/binutils 2.8 or newer on all hppa @@ -2631,7 +2627,7 @@ More specific information to @samp{hppa*-hp-hpux*} targets follows. @html <hr /> @end html -@heading @anchor{hppa*-hp-hpux10}hppa*-hp-hpux10 +@heading @anchor{hppa-hp-hpux10}hppa*-hp-hpux10 For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch @code{PHCO_19798} from HP@. HP has two sites which provide patches free of @@ -2661,7 +2657,7 @@ the failure from @samp{make bootstrap}. @html <hr /> @end html -@heading @anchor{hppa*-hp-hpux11}hppa*-hp-hpux11 +@heading @anchor{hppa-hp-hpux11}hppa*-hp-hpux11 GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot be used to compile GCC 3.0 and up. @@ -2793,14 +2789,14 @@ This port still is undergoing significant development. @html <hr /> @end html -@heading @anchor{i370-*-*}i370-*-* +@heading @anchor{i370-x-x}i370-*-* This port is very preliminary and has many known bugs. We hope to have a higher-quality port for this machine soon. @html <hr /> @end html -@heading @anchor{*-*-linux-gnu}*-*-linux-gnu +@heading @anchor{x-x-linux-gnu}*-*-linux-gnu Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present in glibc 2.2.5 and later. More information is available in the @@ -2809,14 +2805,14 @@ libstdc++-v3 documentation. @html <hr /> @end html -@heading @anchor{ix86-*-linux*aout}i?86-*-linux*aout +@heading @anchor{ix86-x-linuxaout}i?86-*-linux*aout Use this configuration to generate @file{a.out} binaries on Linux-based GNU systems. This configuration is being superseded. @html <hr /> @end html -@heading @anchor{ix86-*-linux*}i?86-*-linux* +@heading @anchor{ix86-x-linux}i?86-*-linux* As of GCC 3.3, binutils 2.13.1 or later is required for this platform. See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information. @@ -2840,7 +2836,7 @@ This will be fixed in future releases of GCC. @html <hr /> @end html -@heading @anchor{ix86-*-sco3.2v5*}i?86-*-sco3.2v5* +@heading @anchor{ix86-x-sco32v5}i?86-*-sco3.2v5* Use this for the SCO OpenServer Release 5 family of operating systems. Unlike earlier versions of GCC, the ability to generate COFF with this @@ -2884,7 +2880,7 @@ GCC, version 2.95.3. It is useful for bootstrapping this version. @html <hr /> @end html -@heading @anchor{ix86-*-udk}i?86-*-udk +@heading @anchor{ix86-x-udk}i?86-*-udk This target emulates the SCO Universal Development Kit and requires that package be installed. (If it is installed, you will have a @@ -2920,7 +2916,7 @@ have installed. @html <hr /> @end html -@heading @anchor{ia64-*-linux}ia64-*-linux +@heading @anchor{ia64-x-linux}ia64-*-linux IA-64 processor (also known as IPF, or Itanium Processor Family) running GNU/Linux. @@ -2940,7 +2936,7 @@ more major ABI changes are expected. @html <hr /> @end html -@heading @anchor{ia64-*-hpux*}ia64-*-hpux* +@heading @anchor{ia64-x-hpux}ia64-*-hpux* Building GCC on this target requires the GNU Assembler. The bundled HP assembler will not work. To prevent GCC from using the wrong assembler, the option @option{--with-gnu-as} may be necessary. @@ -2955,7 +2951,7 @@ removed and the system libunwind library will always be used. <hr /> <!-- rs6000-ibm-aix*, powerpc-ibm-aix* --> @end html -@heading @anchor{*-ibm-aix*}*-ibm-aix* +@heading @anchor{x-ibm-aix}*-ibm-aix* Support for AIX version 3 and older was discontinued in GCC 3.4. AIX Make frequently has problems with GCC makefiles. GNU Make 3.79.1 or @@ -3080,7 +3076,7 @@ switch and using the configure option @option{--with-cpu-@var{cpu_type}}. @html <hr /> @end html -@heading @anchor{ip2k-*-elf}ip2k-*-elf +@heading @anchor{ip2k-x-elf}ip2k-*-elf Ubicom IP2022 micro controller. This configuration is intended for embedded systems. There are no standard Unix configurations. @@ -3090,14 +3086,14 @@ Use @samp{configure --target=ip2k-elf --enable-languages=c} to configure GCC@. @html <hr /> @end html -@heading @anchor{iq2000-*-elf}iq2000-*-elf +@heading @anchor{iq2000-x-elf}iq2000-*-elf Vitesse IQ2000 processors. These are used in embedded applications. There are no standard Unix configurations. @html <hr /> @end html -@heading @anchor{m32r-*-elf}m32r-*-elf +@heading @anchor{m32r-x-elf}m32r-*-elf Renesas M32R processor. This configuration is intended for embedded systems. @@ -3171,7 +3167,7 @@ to look like: @html <hr /> @end html -@heading @anchor{mips-*-*}mips-*-* +@heading @anchor{mips-x-x}mips-*-* If on a MIPS system you get an error message saying ``does not have gp sections for all it's [sic] sectons [sic]'', don't worry about it. This happens whenever you use GAS with the MIPS linker, but there is not @@ -3308,7 +3304,7 @@ information about using GCC on IRIX platforms. @html <hr /> @end html -@heading @anchor{powerpc*-*-*}powerpc-*-* +@heading @anchor{powerpc-x-x}powerpc-*-* You can specify a default version for the @option{-mcpu=@var{cpu_type}} switch by using the configure option @option{--with-cpu-@var{cpu_type}}. @@ -3316,7 +3312,7 @@ switch by using the configure option @option{--with-cpu-@var{cpu_type}}. @html <hr /> @end html -@heading @anchor{powerpc-*-darwin*}powerpc-*-darwin* +@heading @anchor{powerpc-x-darwin}powerpc-*-darwin* PowerPC running Darwin (Mac OS X kernel). Pre-installed versions of Mac OS X may not include any developer tools, @@ -3340,22 +3336,22 @@ are generally specific to Mac programming. @html <hr /> @end html -@heading @anchor{powerpc-*-elf}powerpc-*-elf, powerpc-*-sysv4 +@heading @anchor{powerpc-x-elf}powerpc-*-elf, powerpc-*-sysv4 PowerPC system in big endian mode, running System V.4. @html <hr /> @end html -@heading @anchor{powerpc-*-linux-gnu*}powerpc-*-linux-gnu* +@heading @anchor{powerpc-x-linux-gnu}powerpc*-*-linux-gnu* You will need -@uref{ftp://ftp.kernel.org/pub/linux/devel/binutils,,binutils 2.13.90.0.10} +@uref{ftp://ftp.kernel.org/pub/linux/devel/binutils,,binutils 2.15} or newer for a working GCC@. @html <hr /> @end html -@heading @anchor{powerpc-*-netbsd*}powerpc-*-netbsd* +@heading @anchor{powerpc-x-netbsd}powerpc-*-netbsd* PowerPC system in big endian mode running NetBSD@. To build the documentation you will need Texinfo version 4.2 (NetBSD 1.5.1 included Texinfo version 3.12). @@ -3363,51 +3359,51 @@ Texinfo version 3.12). @html <hr /> @end html -@heading @anchor{powerpc-*-eabisim}powerpc-*-eabisim +@heading @anchor{powerpc-x-eabisim}powerpc-*-eabisim Embedded PowerPC system in big endian mode for use in running under the PSIM simulator. @html <hr /> @end html -@heading @anchor{powerpc-*-eabi}powerpc-*-eabi +@heading @anchor{powerpc-x-eabi}powerpc-*-eabi Embedded PowerPC system in big endian mode. @html <hr /> @end html -@heading @anchor{powerpcle-*-elf}powerpcle-*-elf, powerpcle-*-sysv4 +@heading @anchor{powerpcle-x-elf}powerpcle-*-elf, powerpcle-*-sysv4 PowerPC system in little endian mode, running System V.4. @html <hr /> @end html -@heading @anchor{powerpcle-*-eabisim}powerpcle-*-eabisim +@heading @anchor{powerpcle-x-eabisim}powerpcle-*-eabisim Embedded PowerPC system in little endian mode for use in running under the PSIM simulator. @html <hr /> @end html -@heading @anchor{powerpcle-*-eabi}powerpcle-*-eabi +@heading @anchor{powerpcle-x-eabi}powerpcle-*-eabi Embedded PowerPC system in little endian mode. @html <hr /> @end html -@heading @anchor{s390-*-linux*}s390-*-linux* +@heading @anchor{s390-x-linux}s390-*-linux* S/390 system running GNU/Linux for S/390@. @html <hr /> @end html -@heading @anchor{s390x-*-linux*}s390x-*-linux* +@heading @anchor{s390x-x-linux}s390x-*-linux* zSeries system (64-bit) running GNU/Linux for zSeries@. @html <hr /> @end html -@heading @anchor{s390x-ibm-tpf*}s390x-ibm-tpf* +@heading @anchor{s390x-ibm-tpf}s390x-ibm-tpf* zSeries system (64-bit) running TPF. This platform is supported as cross-compilation target only. @@ -3418,7 +3414,7 @@ supported as cross-compilation target only. @c with 2.0 until 2.6, 7, 8, etc. Solaris 1 was a marketing name for @c SunOS 4 releases which we don't use to avoid confusion. Solaris @c alone is too unspecific and must be avoided. -@heading @anchor{*-*-solaris2*}*-*-solaris2* +@heading @anchor{x-x-solaris2}*-*-solaris2* Sun does not ship a C compiler with Solaris 2. To bootstrap and install GCC you first have to install a pre-built compiler, see the @@ -3502,7 +3498,7 @@ SPARC, 117172-11 or newer for Intel) that address this problem. @html <hr /> @end html -@heading @anchor{sparc-sun-solaris2*}sparc-sun-solaris2* +@heading @anchor{sparc-sun-solaris2}sparc-sun-solaris2* When GCC is configured to use binutils 2.11.2 or later the binaries produced are smaller than the ones produced using Sun's native tools; @@ -3565,7 +3561,7 @@ plain @option{-g}. @html <hr /> @end html -@heading @anchor{sparc-sun-solaris2.7}sparc-sun-solaris2.7 +@heading @anchor{sparc-sun-solaris27}sparc-sun-solaris2.7 Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8 @@ -3616,7 +3612,7 @@ This bug has been fixed in the final 5.0 version of the assembler. @html <hr /> @end html -@heading @anchor{sparc-*-linux*}sparc-*-linux* +@heading @anchor{sparc-x-linux}sparc-*-linux* GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4 or newer on this platform. All earlier binutils and glibc @@ -3626,7 +3622,7 @@ releases mishandled unaligned relocations on @code{sparc-*-*} targets. @html <hr /> @end html -@heading @anchor{sparc64-*-solaris2*}sparc64-*-solaris2* +@heading @anchor{sparc64-x-solaris2}sparc64-*-solaris2* The following compiler flags must be specified in the configure step in order to bootstrap this target with the Sun compiler: @@ -3641,14 +3637,14 @@ specifies the SPARC-V9 architecture to the Sun linker and assembler. @html <hr /> @end html -@heading @anchor{sparcv9-*-solaris2*}sparcv9-*-solaris2* +@heading @anchor{sparcv9-x-solaris2}sparcv9-*-solaris2* This is a synonym for sparc64-*-solaris2*. @html <hr /> @end html -@heading @anchor{#*-*-sysv*}*-*-sysv* +@heading @anchor{x-x-sysv}*-*-sysv* On System V release 3, you may get this error message while linking: @@ -3689,7 +3685,7 @@ in some cases (for example, when @code{alloca} is used). @html <hr /> @end html -@heading @anchor{*-*-vxworks*}*-*-vxworks* +@heading @anchor{x-x-vxworks}*-*-vxworks* Support for VxWorks is in flux. At present GCC supports @emph{only} the very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC. We welcome patches for other architectures supported by VxWorks 5.5. @@ -3724,7 +3720,7 @@ VxWorks will incorporate this module.) @html <hr /> @end html -@heading @anchor{x86_64-*-*}x86_64-*-*, amd64-*-* +@heading @anchor{x86-64-x-x}x86_64-*-*, amd64-*-* GCC supports the x86-64 architecture implemented by the AMD64 processor (amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD. @@ -3734,7 +3730,7 @@ both 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch). @html <hr /> @end html -@heading @anchor{xtensa-*-elf}xtensa-*-elf +@heading @anchor{xtensa-x-elf}xtensa-*-elf This target is intended for embedded Xtensa systems using the @samp{newlib} C library. It uses ELF but does not support shared @@ -3752,7 +3748,7 @@ which you can use to replace the default header file. @html <hr /> @end html -@heading @anchor{xtensa-*-linux*}xtensa-*-linux* +@heading @anchor{xtensa-x-linux}xtensa-*-linux* This target is for Xtensa systems running GNU/Linux. It supports ELF shared objects and the GNU C library (glibc). It also generates @@ -3837,7 +3833,7 @@ current GCC) is to be found in the GCC texinfo manual. @html <hr /> @end html -@heading @anchor{elf_targets}all ELF targets (SVR4, Solaris 2, etc.) +@heading @anchor{elf}all ELF targets (SVR4, Solaris 2, etc.) C++ support is significantly better on ELF targets if you use the @uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f220a073840..776e76a4618 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -189,7 +189,7 @@ in the following sections. -Weffc++ -Wno-deprecated @gol -Wno-non-template-friend -Wold-style-cast @gol -Woverloaded-virtual -Wno-pmf-conversions @gol --Wsign-promo -Wsynth} +-Wsign-promo} @item Objective-C Language Options @xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}. @@ -1730,13 +1730,6 @@ enumerated type to a signed type, over a conversion to an unsigned type of the same size. Previous versions of G++ would try to preserve unsignedness, but the standard mandates the current behavior. -@item -Wsynth @r{(C++ only)} -@opindex Wsynth -@cindex warning for synthesized methods -@cindex synthesized methods, warning -Warn when G++'s synthesis behavior does not match that of cfront. For -instance: - @smallexample struct A @{ operator int (); @@ -6209,7 +6202,7 @@ These @samp{-m} options are supported on the SPARC: @opindex mapp-regs Specify @option{-mapp-regs} to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications. This -is the default. +is the default, except on Solaris. To be fully SVR4 ABI compliant at the cost of some performance loss, specify @option{-mno-app-regs}. You should compile libraries and system @@ -6432,7 +6425,7 @@ on SPARC-V9 processors in 64-bit environments: @item -mlittle-endian @opindex mlittle-endian Generate code for a processor running in little-endian mode. It is only -available for a few configurations and most notably not on Solaris. +available for a few configurations and most notably not on Solaris and Linux. @item -m32 @itemx -m64 @@ -7098,7 +7091,7 @@ Supported values for @var{cpu_type} are @samp{401}, @samp{403}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823}, -@samp{860}, @samp{970}, @samp{common}, @samp{ec603e}, @samp{G3}, +@samp{860}, @samp{970}, @samp{8540}, @samp{common}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{powerpc}, @samp{powerpc64}, @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64a}. diff --git a/gcc/gcc.c b/gcc/gcc.c index 4e053b81f52..5d77e23e334 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -746,7 +746,7 @@ static const char *cpp_unique_options = %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\ %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\ %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}\ - %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\ + %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\ %{E|M|MM:%W{o*}}"; /* This contains cpp options which are common with cc1_options and are passed @@ -755,8 +755,9 @@ static const char *cpp_unique_options = options used to set target flags. Those special target flags settings may in turn cause preprocessor symbols to be defined specially. */ static const char *cpp_options = -"%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*}\ - %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}"; +"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*}\ + %{undef}"; /* This contains cpp options which are not passed when the preprocessor output will be used by another program. */ @@ -767,7 +768,7 @@ static const char *cc1_options = "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\ %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\ - %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi}\ + %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\ %{v:-version} %{pg:-p} %{p} %{f*} %{undef}\ %{Qn:-fno-ident} %{--help:--help}\ %{--target-help:--target-help}\ @@ -912,7 +913,7 @@ static const struct compiler default_compilers[] = cc1 %(cpp_unique_options) %(cc1_options)}}}\ %{!fsyntax-only:%(invoke_as)}}}}", 0}, {"-", - "%{!E:%e-E required when input is from standard input}\ + "%{!E:%e-E or -x required when input is from standard input}\ %(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)", 0}, {".h", "@c-header", 0}, {"@c-header", diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index e83c5163c90..68798293f11 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -230,11 +230,15 @@ typedef HOST_WIDEST_INT gcov_type; #endif /* !IN_LIBGCOV */ -/* In gcov we want function linkage to be static. In libgcov we need - these functions to be extern, so prefix them with __gcov. In the - compiler we want it extern, so that they can be accessed from - elsewhere. */ +/* In gcov we want function linkage to be static. In the compiler we want + it extern, so that they can be accessed from elsewhere. In libgcov we + need these functions to be extern, so prefix them with __gcov. In + libgcov they must also be hidden so that the instance in the executable + is not also used in a DSO. */ #if IN_LIBGCOV + +#include "auto-host.h" /* for HAVE_GAS_HIDDEN */ + #define gcov_var __gcov_var #define gcov_open __gcov_open #define gcov_close __gcov_close @@ -255,6 +259,16 @@ typedef HOST_WIDEST_INT gcov_type; #pragma GCC poison gcov_write_string gcov_write_tag gcov_write_length #pragma GCC poison gcov_read_string gcov_sync gcov_time gcov_magic +#ifdef HAVE_GAS_HIDDEN +#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden"))) +#else +#define ATTRIBUTE_HIDDEN +#endif + +#else + +#define ATTRIBUTE_HIDDEN + #endif #ifndef GCOV_LINKAGE @@ -433,20 +447,20 @@ struct gcov_info }; /* Register a new object file module. */ -extern void __gcov_init (struct gcov_info *); +extern void __gcov_init (struct gcov_info *) ATTRIBUTE_HIDDEN; /* Called before fork, to avoid double counting. */ -extern void __gcov_flush (void); +extern void __gcov_flush (void) ATTRIBUTE_HIDDEN; /* The merge function that just sums the counters. */ -extern void __gcov_merge_add (gcov_type *, unsigned); +extern void __gcov_merge_add (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function to choose the most common value. */ -extern void __gcov_merge_single (gcov_type *, unsigned); +extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function to choose the most common difference between consecutive values. */ -extern void __gcov_merge_delta (gcov_type *, unsigned); +extern void __gcov_merge_delta (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; #endif /* IN_LIBGCOV */ #if IN_LIBGCOV >= 0 @@ -476,7 +490,7 @@ GCOV_LINKAGE struct gcov_var size_t alloc; gcov_unsigned_t *buffer; #endif -} gcov_var; +} gcov_var ATTRIBUTE_HIDDEN; /* Functions for reading and writing gcov files. In libgcov you can open the file for reading then writing. Elsewhere you can open the @@ -488,31 +502,33 @@ GCOV_LINKAGE struct gcov_var functions for writing. Your file may become corrupted if you break these invariants. */ #if IN_LIBGCOV -GCOV_LINKAGE int gcov_open (const char */*name*/); +GCOV_LINKAGE int gcov_open (const char */*name*/) ATTRIBUTE_HIDDEN; #else GCOV_LINKAGE int gcov_open (const char */*name*/, int /*direction*/); GCOV_LINKAGE int gcov_magic (gcov_unsigned_t, gcov_unsigned_t); #endif -GCOV_LINKAGE int gcov_close (void); +GCOV_LINKAGE int gcov_close (void) ATTRIBUTE_HIDDEN; /* Available everywhere. */ static gcov_position_t gcov_position (void); static int gcov_is_error (void); static int gcov_is_eof (void); -GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned (void); -GCOV_LINKAGE gcov_type gcov_read_counter (void); -GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *); +GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned (void) ATTRIBUTE_HIDDEN; +GCOV_LINKAGE gcov_type gcov_read_counter (void) ATTRIBUTE_HIDDEN; +GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN; #if IN_LIBGCOV /* Available only in libgcov */ -GCOV_LINKAGE void gcov_write_counter (gcov_type); -GCOV_LINKAGE void gcov_write_tag_length (gcov_unsigned_t, gcov_unsigned_t); +GCOV_LINKAGE void gcov_write_counter (gcov_type) ATTRIBUTE_HIDDEN; +GCOV_LINKAGE void gcov_write_tag_length (gcov_unsigned_t, gcov_unsigned_t) + ATTRIBUTE_HIDDEN; GCOV_LINKAGE void gcov_write_summary (gcov_unsigned_t /*tag*/, - const struct gcov_summary *); + const struct gcov_summary *) + ATTRIBUTE_HIDDEN; static void gcov_truncate (void); static void gcov_rewrite (void); -GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/); +GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/) ATTRIBUTE_HIDDEN; #else /* Available outside libgcov */ GCOV_LINKAGE const char *gcov_read_string (void); @@ -522,7 +538,7 @@ GCOV_LINKAGE void gcov_sync (gcov_position_t /*base*/, #if !IN_GCOV /* Available outside gcov */ -GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t); +GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t) ATTRIBUTE_HIDDEN; #endif #if !IN_GCOV && !IN_LIBGCOV diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in index da480ab241b..143b4e83ba1 100644 --- a/gcc/mklibgcc.in +++ b/gcc/mklibgcc.in @@ -13,6 +13,7 @@ # LIBGCOV # LIB2ADD # LIB2ADD_ST +# LIB2ADD_SH # LIB2ADDEH # LIB2ADDEHSTATIC # LIB2ADDEHSHARED @@ -279,6 +280,26 @@ for file in $LIB2ADD_ST; do libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}" done +if [ "$SHLIB_LINK" ]; then + for file in $LIB2ADD_SH; do + name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` + oname=`echo $name | sed -e 's,.*/,,'` + + for ml in $MULTILIBS; do + dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` + flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; + out="libgcc/${dir}/${oname}${objext}" + if [ ${name}.asm = ${file} ]; then + flags="$flags -xassembler-with-cpp" + fi + + echo $out: stmp-dirs $file + echo " $gcc_compile" $flags -c $file -o $out + done + libgcc2_sh_objs="$libgcc2_sh_objs ${oname}${objext}" + done +fi + if [ "$LIBUNWIND" ]; then libunwind_static_objs="" libunwind_shared_objs="" @@ -346,6 +367,9 @@ for ml in $MULTILIBS; do libgcc_eh_shared_objs="$libgcc_eh_shared_objs libgcc/${dir}/$o" done libgcc_sh_objs="$libgcc_objs $libgcc_eh_shared_objs" + for o in $libgcc2_sh_objs; do + libgcc_sh_objs="$libgcc_sh_objs libgcc/${dir}/$o" + done shlib_deps="$libgcc_sh_objs" libgcc_st_objs="" diff --git a/gcc/reload.c b/gcc/reload.c index ed70d00492e..9eae9ff7bfc 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2144,12 +2144,15 @@ operands_match_p (rtx x, rtx y) j = REGNO (y); /* On a WORDS_BIG_ENDIAN machine, point to the last register of a - multiple hard register group, so that for example (reg:DI 0) and - (reg:SI 1) will be considered the same register. */ + multiple hard register group of scalar integer registers, so that + for example (reg:DI 0) and (reg:SI 1) will be considered the same + register. */ if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD + && SCALAR_INT_MODE_P (GET_MODE (x)) && i < FIRST_PSEUDO_REGISTER) i += HARD_REGNO_NREGS (i, GET_MODE (x)) - 1; if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (y)) > UNITS_PER_WORD + && SCALAR_INT_MODE_P (GET_MODE (y)) && j < FIRST_PSEUDO_REGISTER) j += HARD_REGNO_NREGS (j, GET_MODE (y)) - 1; diff --git a/gcc/reload1.c b/gcc/reload1.c index bd2bb706a1f..26f62aa2ee5 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5412,19 +5412,18 @@ choose_reload_regs (struct insn_chain *chain) need_mode = mode; else need_mode - = smallest_mode_for_size (GET_MODE_SIZE (mode) + byte, + = smallest_mode_for_size (GET_MODE_BITSIZE (mode) + + byte * BITS_PER_UNIT, GET_MODE_CLASS (mode)); - if ( -#ifdef CANNOT_CHANGE_MODE_CLASS - (!REG_CANNOT_CHANGE_MODE_P (i, GET_MODE (last_reg), - need_mode) - && -#endif - (GET_MODE_SIZE (GET_MODE (last_reg)) + if ((GET_MODE_SIZE (GET_MODE (last_reg)) >= GET_MODE_SIZE (need_mode)) #ifdef CANNOT_CHANGE_MODE_CLASS - ) + /* Verify that the register in "i" can be obtained + from LAST_REG. */ + && !REG_CANNOT_CHANGE_MODE_P (REGNO (last_reg), + GET_MODE (last_reg), + mode) #endif && reg_reloaded_contents[i] == regno && TEST_HARD_REG_BIT (reg_reloaded_valid, i) diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index dd44544f738..71ffceb7a5d 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -773,7 +773,17 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode, case FIX: real_arithmetic (&d, FIX_TRUNC_EXPR, &d, NULL); break; - + case NOT: + { + long tmp[4]; + int i; + + real_to_target (tmp, &d, GET_MODE (trueop)); + for (i = 0; i < 4; i++) + tmp[i] = ~tmp[i]; + real_from_target (&d, tmp, mode); + break; + } default: abort (); } @@ -1220,60 +1230,91 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode, && GET_CODE (trueop1) == CONST_DOUBLE && mode == GET_MODE (op0) && mode == GET_MODE (op1)) { - REAL_VALUE_TYPE f0, f1, value; - - REAL_VALUE_FROM_CONST_DOUBLE (f0, trueop0); - REAL_VALUE_FROM_CONST_DOUBLE (f1, trueop1); - f0 = real_value_truncate (mode, f0); - f1 = real_value_truncate (mode, f1); + if (code == AND + || code == IOR + || code == XOR) + { + long tmp0[4]; + long tmp1[4]; + REAL_VALUE_TYPE r; + int i; + + real_to_target (tmp0, CONST_DOUBLE_REAL_VALUE (op0), + GET_MODE (op0)); + real_to_target (tmp1, CONST_DOUBLE_REAL_VALUE (op1), + GET_MODE (op1)); + for (i = 0; i < 4; i++) + { + if (code == AND) + tmp0[i] &= tmp1[i]; + else if (code == IOR) + tmp0[i] |= tmp1[i]; + else if (code == XOR) + tmp0[i] ^= tmp1[i]; + else + abort (); + } + real_from_target (&r, tmp0, mode); + return CONST_DOUBLE_FROM_REAL_VALUE (r, mode); + } + else + { + REAL_VALUE_TYPE f0, f1, value; - if (HONOR_SNANS (mode) - && (REAL_VALUE_ISNAN (f0) || REAL_VALUE_ISNAN (f1))) - return 0; + REAL_VALUE_FROM_CONST_DOUBLE (f0, trueop0); + REAL_VALUE_FROM_CONST_DOUBLE (f1, trueop1); + f0 = real_value_truncate (mode, f0); + f1 = real_value_truncate (mode, f1); - if (code == DIV - && REAL_VALUES_EQUAL (f1, dconst0) - && (flag_trapping_math || ! MODE_HAS_INFINITIES (mode))) - return 0; + if (HONOR_SNANS (mode) + && (REAL_VALUE_ISNAN (f0) || REAL_VALUE_ISNAN (f1))) + return 0; - if (MODE_HAS_INFINITIES (mode) && HONOR_NANS (mode) - && flag_trapping_math - && REAL_VALUE_ISINF (f0) && REAL_VALUE_ISINF (f1)) - { - int s0 = REAL_VALUE_NEGATIVE (f0); - int s1 = REAL_VALUE_NEGATIVE (f1); + if (code == DIV + && REAL_VALUES_EQUAL (f1, dconst0) + && (flag_trapping_math || ! MODE_HAS_INFINITIES (mode))) + return 0; - switch (code) + if (MODE_HAS_INFINITIES (mode) && HONOR_NANS (mode) + && flag_trapping_math + && REAL_VALUE_ISINF (f0) && REAL_VALUE_ISINF (f1)) { - case PLUS: - /* Inf + -Inf = NaN plus exception. */ - if (s0 != s1) - return 0; - break; - case MINUS: - /* Inf - Inf = NaN plus exception. */ - if (s0 == s1) - return 0; - break; - case DIV: - /* Inf / Inf = NaN plus exception. */ - return 0; - default: - break; + int s0 = REAL_VALUE_NEGATIVE (f0); + int s1 = REAL_VALUE_NEGATIVE (f1); + + switch (code) + { + case PLUS: + /* Inf + -Inf = NaN plus exception. */ + if (s0 != s1) + return 0; + break; + case MINUS: + /* Inf - Inf = NaN plus exception. */ + if (s0 == s1) + return 0; + break; + case DIV: + /* Inf / Inf = NaN plus exception. */ + return 0; + default: + break; + } } - } - if (code == MULT && MODE_HAS_INFINITIES (mode) && HONOR_NANS (mode) - && flag_trapping_math - && ((REAL_VALUE_ISINF (f0) && REAL_VALUES_EQUAL (f1, dconst0)) - || (REAL_VALUE_ISINF (f1) && REAL_VALUES_EQUAL (f0, dconst0)))) - /* Inf * 0 = NaN plus exception. */ - return 0; + if (code == MULT && MODE_HAS_INFINITIES (mode) && HONOR_NANS (mode) + && flag_trapping_math + && ((REAL_VALUE_ISINF (f0) && REAL_VALUES_EQUAL (f1, dconst0)) + || (REAL_VALUE_ISINF (f1) + && REAL_VALUES_EQUAL (f0, dconst0)))) + /* Inf * 0 = NaN plus exception. */ + return 0; - REAL_ARITHMETIC (value, rtx_to_tree_code (code), f0, f1); + REAL_ARITHMETIC (value, rtx_to_tree_code (code), f0, f1); - value = real_value_truncate (mode, value); - return CONST_DOUBLE_FROM_REAL_VALUE (value, mode); + value = real_value_truncate (mode, value); + return CONST_DOUBLE_FROM_REAL_VALUE (value, mode); + } } /* We can fold some multi-word operations. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 353c94f2835..8008c383552 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,152 @@ +2005-05-04 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2004-12-21 Mark Mitchell <mark@codesourcery.com> + PR c++/19034 + * g++.dg/template/crash30.C: New test. + +2005-05-02 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2005-03-25 Mark Mitchell <mark@codesourcery.com> + * lib/g++.exp (g++_link_flags): Use gcc-set-multilib-library-path. + (g++_init): Make sure that CXXFLAGS is set. + * lib/gcc-defs.exp (gcc-set-multilib-library-path): New function. + * lib/objc.exp (objc_init): Likewise. + 2004-11-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + * lib/target-libpath.exp (restore_ld_library_path_env_vars): + Check existence of ld library path variables before unsetting. + 2004-11-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + * lib/target-libpath.exp (orig_ld_library_path_saved): Add missing set. + 2004-11-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + * lib/target-libpath.exp: New file defining + set_ld_library_path_env_vars and restore_ld_library_path_env_vars. + * g++.dg/compat/compat.exp, lib/g++.exp, lib/objc.exp: Use new procs. + +2005-05-02 Mark Mitchell <mark@codesourcery.com> + + PR c++/15875 + * g++.dg/template/ptrmem14.C: New test. + +2005-05-01 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2005-02-22 Mark Mitchell <mark@codesourcery.com> + PR c++/19991 + * g++.dg/parse/constant7.C: New test. + +2005-05-02 Eric Botcazou <ebotcazou@libertysurf.fr> + + * gcc.dg/titype-1.c: Fix dg-error target regexp. + * gcc.dg/uninit-C.c: Likewise. + +2005-05-01 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2004-12-22 Mark Mitchell <mark@codesourcery.com> + PR c++/18464 + * g++.dg/template/cond5.C: New test. + +2005-05-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/21213 + * gcc.dg/transparent-union-3.c: New test. + +2005-05-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/20740 + * gcc.dg/format/asm_fprintf-2.c, gcc.dg/format/asm_fprintf-3.c, + gcc.dg/format/asm_fprintf-4.c, gcc.dg/format/asm_fprintf-5.c, + gcc.dg/format/gcc_diag-2.c, gcc.dg/format/gcc_diag-3.c, + gcc.dg/format/gcc_diag-4.c, gcc.dg/format/gcc_diag-5.c, + gcc.dg/format/gcc_diag-6.c, gcc.dg/format/gcc_diag-7.c , + gcc.dg/format/gcc_diag-8.c, gcc.dg/format/gcc_diag-9.c: New tests. + +2005-05-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/11459 + PR c/18502 + * gcc.dg/pr11459-1.c, gcc.dg/pr18502-1.c: New tests. + +2005-04-25 Roger Sayle <roger@eyesopen.com> + + PR c++/20995 + * g++.dg/opt/pr20995-1.C: New test case. + +2005-04-16 Mark Mitchell <mark@codesourcery.com> + + PR c++/21025 + * g++.dg/template/sizeof9.C: New test. + +2005-04-04 Mark Mitchell <mark@codesourcery.com> + + PR c++/20679 + * g++.dg/template/overload4.C: New test. + +2005-04-03 Gabriel Dos Reis <gdr@integrable-solutions.net> + + PR c++/18644 + * g++.old-deja/g++.jason/warning9.C (struct A, main): Adjust. + +2005-03-22 Uros Bizjak <uros@kss-loka.si> + + PR target/14981 + * gcc.dg/pr14981-1.c: New test. + +2005-03-21 Paolo Carlini <pcarlini@suse.de> + + PR c++/20147 + * g++.dg/ext/stmtexpr4.C: New test. + +2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/20240 + * g++.dg/lookup/using13.C: New test. + +2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/20333 + * g++.dg/template/crash36.C: New test. + +2005-03-17 Richard Sandiford <rsandifo@redhat.com> + + * gcc.dg/torture/pr19683-1.c: New test. + +2005-03-16 Roger Sayle <roger@eyesopen.com> + + PR rtl-optimization/17825 + Backport from mainline + 2004-11-27 Jakub Jelinek <jakub@redhat.com> + * gcc.c-torture/compile/20041119-1.c: New test. + +2005-03-08 Mark Mitchell <mark@codesourcery.com> + + PR c++/20142 + * g++.dg/init/array18.C: New test. + +2005-03-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/19311 + * g++.dg/template/non-dependent11.C: New test. + +2005-03-04 David Billinghurst <David.Billinghurst@riotinto.com> + + * gcc.dg/cpp/assert4.c: Fix for cygwin + +2005-03-02 Mark Mitchell <mark@codesourcery.com> + + PR c++/19916 + * g++.dg/init/ptrmem2.C: New test. + +2005-03-02 Alexandre Oliva <aoliva@redhat.com> + + * g++.dg/overload/using2.C: New. + +2005-02-24 Jakub Jelinek <jakub@redhat.com> + + PR c++/20175 + * g++.dg/warn/Wbraces2.C: New test. + 2005-02-09 Alexandre Oliva <aoliva@redhat.com> PR c++/18838 diff --git a/gcc/testsuite/g++.dg/compat/compat.exp b/gcc/testsuite/g++.dg/compat/compat.exp index 94da38c77de..accd1452d7d 100644 --- a/gcc/testsuite/g++.dg/compat/compat.exp +++ b/gcc/testsuite/g++.dg/compat/compat.exp @@ -35,22 +35,7 @@ global ld_library_path # Load procedures from common libraries. load_lib standard.exp load_lib g++.exp - -# -# compat-fix-library-path -- switch LD_LIBRARY_PATH -# -proc compat-fix-library-path { } { - global ld_library_path - - # See comments in lib/g++.exp for why this is needed. - if {![is_remote target]} { - # See comments in lib/g++.exp for why this is needed. - setenv LD_LIBRARY_PATH $ld_library_path - setenv SHLIB_PATH $ld_library_path - setenv LD_LIBRARYN32_PATH $ld_library_path - setenv LD_LIBRARY64_PATH $ld_library_path - } -} +load_lib target-libpath.exp # # compat-use-alt-compiler -- make the alternate compiler the default @@ -69,7 +54,7 @@ proc compat-use-alt-compiler { } { set CXXFLAGS "" set ALWAYS_CXXFLAGS "" set ld_library_path $alt_ld_library_path - compat-fix-library-path + set_ld_library_path_env_vars } } @@ -91,7 +76,7 @@ proc compat-use-tst-compiler { } { set CXXFLAGS $save_cxxflags set ALWAYS_CXXFLAGS $save_always_cxxflags set ld_library_path $save_ld_library_path - compat-fix-library-path + set_ld_library_path_env_vars } } diff --git a/gcc/testsuite/g++.dg/ext/altivec-10.C b/gcc/testsuite/g++.dg/ext/altivec-10.C index 0be609431ce..3b790f5ebfe 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-10.C +++ b/gcc/testsuite/g++.dg/ext/altivec-10.C @@ -18,5 +18,3 @@ a1 = { 100, 200, 300, 400 }; vector_float f1 = { 1.0, 2.0, 3.0, 4.0 }; vector_float_foo = { 3.0, 4.0, 5.0, 6.0 }; vector_float_bar_eq { 8.0, 7.0, 6.0, 5.0 }; - -/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/g++.dg/ext/altivec-3.C b/gcc/testsuite/g++.dg/ext/altivec-3.C index f2812fc91a1..a5e7308bb05 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-3.C +++ b/gcc/testsuite/g++.dg/ext/altivec-3.C @@ -75,15 +75,11 @@ void baz (int i, ... ) CHECK_INVARIANT (vec_all_eq (v_i, v_g)); CHECK_INVARIANT (j == i_1); - CHECK_INVARIANT (vx.x == vx_g.x); - CHECK_INVARIANT (vec_all_eq (vx.v, vx_g.v)); - CHECK_INVARIANT (vx.y == vx_g.y); + CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y); CHECK_INVARIANT (k == i_1); CHECK_INVARIANT (vec_all_eq (v2_i, v2_g)); CHECK_INVARIANT (l == i_1); - CHECK_INVARIANT (vx2.x == vx2_g.x); - CHECK_INVARIANT (vec_all_eq (vx2.v, vx2_g.v)); - CHECK_INVARIANT (vx2.y == vx2_g.y); + CHECK_INVARIANT (vx2.x == vx2_g.x && vec_all_eq(vx2.v, vx2_g.v) && vx2.y == vx2_g.y); } void quux (int i, ... ) @@ -114,9 +110,7 @@ void baz2 (int i, ... ) va_end(ap); vxi.v = vx.v; - CHECK_INVARIANT (vx.x == vx_g.x); - CHECK_INVARIANT (vec_all_eq (vx.v, vx_g.v)); - CHECK_INVARIANT (vx.y == vx_g.y); + CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y); CHECK_INVARIANT (vec_all_eq (vxi.v, vx_g.v)); } diff --git a/gcc/testsuite/g++.dg/ext/stmtexpr4.C b/gcc/testsuite/g++.dg/ext/stmtexpr4.C index a37c33ae086..0257939aa37 100644 --- a/gcc/testsuite/g++.dg/ext/stmtexpr4.C +++ b/gcc/testsuite/g++.dg/ext/stmtexpr4.C @@ -4,5 +4,5 @@ void foo() { - ({x;}); // { dg-error "was not declared" } + ({x;}); // { dg-error "undeclared" } } diff --git a/gcc/testsuite/g++.dg/init/array18a.C b/gcc/testsuite/g++.dg/init/array18a.C new file mode 100644 index 00000000000..154d03fcff8 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/array18a.C @@ -0,0 +1,22 @@ +// PR c++/20142 +// { dg-do run } + +int n=4; + +struct A +{ + A() {} + A& operator= (const A&) { --n; return *this; } +}; + +struct B +{ + A x[2][2]; +}; + +int main() +{ + B b; + b = b; + return n; +} diff --git a/gcc/testsuite/g++.old-deja/g++.jason/warning9.C b/gcc/testsuite/g++.old-deja/g++.jason/warning9.C index 9423ac1269b..775a37ca33d 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/warning9.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/warning9.C @@ -3,12 +3,13 @@ struct A { operator int (); - A& operator= (int); // { dg-warning "" } not used below + A& operator= (int); }; +int main() { A a, b; - a = b; // { dg-warning "" } uses synthesized op= + a = b; } diff --git a/gcc/testsuite/gcc.dg/altivec-16.c b/gcc/testsuite/gcc.dg/altivec-16.c index 0be609431ce..3b790f5ebfe 100644 --- a/gcc/testsuite/gcc.dg/altivec-16.c +++ b/gcc/testsuite/gcc.dg/altivec-16.c @@ -18,5 +18,3 @@ a1 = { 100, 200, 300, 400 }; vector_float f1 = { 1.0, 2.0, 3.0, 4.0 }; vector_float_foo = { 3.0, 4.0, 5.0, 6.0 }; vector_float_bar_eq { 8.0, 7.0, 6.0, 5.0 }; - -/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc/testsuite/gcc.dg/cpp/assert4.c index 20063b96e2e..cbe381f3f03 100644 --- a/gcc/testsuite/gcc.dg/cpp/assert4.c +++ b/gcc/testsuite/gcc.dg/cpp/assert4.c @@ -78,7 +78,7 @@ # error #endif -#if defined __unix__ +#if defined __unix__ && !defined __CYGWIN__ # if !#system(unix) # error # endif @@ -118,7 +118,7 @@ # error #endif -#if defined __WINNT__ +#if defined __WINNT__ || defined __CYGWIN__ # if !#system(winnt) # error # endif diff --git a/gcc/testsuite/gcc.dg/pr14981-1.c b/gcc/testsuite/gcc.dg/pr14981-1.c new file mode 100644 index 00000000000..7d5bde9e566 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr14981-1.c @@ -0,0 +1,12 @@ +/* PR target/14981 */ +/* PR target/20051 */ +/* Test case reduced by Ferdinand <commie1@gmx.net> */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -msse" } */ +typedef float v4sf __attribute__ ((vector_size (16))); + +void foo(float* y) +{ + v4sf x = __builtin_ia32_xorps (x,x); + __builtin_ia32_storeaps (y, x); +} diff --git a/gcc/testsuite/gcc.dg/titype-1.c b/gcc/testsuite/gcc.dg/titype-1.c index ee41db9778a..12175f5bbf3 100644 --- a/gcc/testsuite/gcc.dg/titype-1.c +++ b/gcc/testsuite/gcc.dg/titype-1.c @@ -2,7 +2,7 @@ /* Not all platforms support TImode integers. */ #if defined(__LP64__) || defined(__sparc__) -typedef int TItype __attribute__ ((mode (TI))); /* { dg-error "no data type for mode" "TI" { target sparc-sun-solaris2.[0-6]* } } */ +typedef int TItype __attribute__ ((mode (TI))); /* { dg-error "no data type for mode" "TI" { target sparc-sun-solaris2.[0-6] sparc-sun-solaris2.[0-6].* } } */ #else typedef long TItype; #endif diff --git a/gcc/testsuite/gcc.dg/torture/pr19683-1.c b/gcc/testsuite/gcc.dg/torture/pr19683-1.c index 96674811f1e..4015fb981e9 100644 --- a/gcc/testsuite/gcc.dg/torture/pr19683-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr19683-1.c @@ -6,7 +6,6 @@ extern void abort (void); extern void exit (int); -#ifndef __mips16 #define REPEAT10(X, Y) \ X(Y##0); X(Y##1); X(Y##2); X(Y##3); X(Y##4); \ X(Y##5); X(Y##6); X(Y##7); X(Y##8); X(Y##9) @@ -41,10 +40,3 @@ main (void) abort (); exit (0); } -#else -int -main (void) -{ - exit (0); -} -#endif diff --git a/gcc/testsuite/gcc.dg/uninit-C.c b/gcc/testsuite/gcc.dg/uninit-C.c index 3ecbf8ae43a..44c75c1624b 100644 --- a/gcc/testsuite/gcc.dg/uninit-C.c +++ b/gcc/testsuite/gcc.dg/uninit-C.c @@ -4,7 +4,7 @@ /* Not all platforms support TImode integers. */ #if defined(__LP64__) || defined(__sparc__) -typedef int TItype __attribute__ ((mode (TI))); /* { dg-error "no data type for mode" "TI" { target sparc-sun-solaris2.[0-6]* } } */ +typedef int TItype __attribute__ ((mode (TI))); /* { dg-error "no data type for mode" "TI" { target sparc-sun-solaris2.[0-6] sparc-sun-solaris2.[0-6].* } } */ #else typedef long TItype; #endif diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 0b5681b134b..8a6e3a0b55b 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -24,6 +24,7 @@ # load_lib prune.exp load_lib gcc-defs.exp +load_lib target-libpath.exp # # GXX_UNDER_TEST is the compiler under test. @@ -96,7 +97,6 @@ proc g++_include_flags { paths } { # proc g++_link_flags { paths } { - global rootme global srcdir global ld_library_path global GXX_UNDER_TEST @@ -128,21 +128,7 @@ proc g++_link_flags { paths } { if [file exists "${gccpath}/librx/librx.a"] { append flags "-L${gccpath}/librx " } - append ld_library_path ":${rootme}" - set compiler [lindex $GXX_UNDER_TEST 0] - if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { - set mldir "" - regexp -- "\[a-z0-9=/\.-\]*;" $i mldir - set mldir [string trimright $mldir "\;@"] - if { "$mldir" == "." } { - continue - } - if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } { - append ld_library_path ":${rootme}/${mldir}" - } - } - } + append ld_library_path [gcc-set-multilib-library-path $GXX_UNDER_TEST] } else { global tool_root_dir; @@ -166,20 +152,7 @@ proc g++_link_flags { paths } { } } - # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but - # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH - # (for the 64-bit ABI). The right way to do this would be to modify - # unix.exp -- but that's not an option since it's part of DejaGNU - # proper, so we do it here. We really only need to do - # this on IRIX, but it shouldn't hurt to do it anywhere else. - # Doing this does cause trouble when testing cross-compilers. - if {![is_remote target]} { - setenv LD_LIBRARY_PATH $ld_library_path - setenv SHLIB_PATH $ld_library_path - setenv LD_LIBRARYN32_PATH $ld_library_path - setenv LD_LIBRARY64_PATH $ld_library_path - setenv DYLD_LIBRARY_PATH $ld_library_path - } + set_ld_library_path_env_vars return "$flags" } @@ -197,6 +170,7 @@ proc g++_init { args } { global gluefile wrap_flags; global objdir srcdir global ALWAYS_CXXFLAGS + global CXXFLAGS global TOOL_EXECUTABLE TOOL_OPTIONS global GXX_UNDER_TEST global TESTING_IN_BUILD_TREE @@ -244,6 +218,10 @@ proc g++_init { args } { } } + if {![info exists CXXFLAGS]} { + set CXXFLAGS "" + } + set ALWAYS_CXXFLAGS "" if ![is_remote host] { diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index bb2369c2110..b19e2788fd3 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -217,3 +217,35 @@ proc dg-additional-files-options { options source } { return $options } + +# Return a colon-separate list of directories to search for libraries +# for COMPILER, including multilib directories. + +proc gcc-set-multilib-library-path { compiler } { + global rootme + + # ??? rootme will not be set when testing an installed compiler. + # In that case, we should perhaps use some other method to find + # libraries. + if {![info exists rootme]} { + return "" + } + + set libpath ":${rootme}" + set compiler [lindex $compiler 0] + if { [is_remote host] == 0 && [which $compiler] != 0 } { + foreach i "[exec $compiler --print-multi-lib]" { + set mldir "" + regexp -- "\[a-z0-9=/\.-\]*;" $i mldir + set mldir [string trimright $mldir "\;@"] + if { "$mldir" == "." } { + continue + } + if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } { + append libpath ":${rootme}/${mldir}" + } + } + } + + return $libpath +} diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp index 2819660df38..b0f910430dd 100644 --- a/gcc/testsuite/lib/objc.exp +++ b/gcc/testsuite/lib/objc.exp @@ -28,6 +28,7 @@ load_lib libgloss.exp load_lib prune.exp load_lib gcc-defs.exp +load_lib target-libpath.exp # # OBJC_UNDER_TEST is the compiler under test. @@ -85,7 +86,6 @@ proc objc_version { } { set objc_initialized 0 proc objc_init { args } { - global rootme global tmpdir global libdir global gluefile wrap_flags @@ -118,25 +118,10 @@ proc objc_init { args } { } } - set objc_libgcc_s_path "${rootme}" - set compiler [lindex $OBJC_UNDER_TEST 0] - if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { - set mldir "" - regexp -- "\[a-z0-9=/\.-\]*;" $i mldir - set mldir [string trimright $mldir "\;@"] - if { "$mldir" == "." } { - continue - } - if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } { - append objc_libgcc_s_path ":${rootme}/${mldir}" - } - } - } + append objc_libgcc_s_path [gcc-set-multilib-library-path $OBJC_UNDER_TEST] } proc objc_target_compile { source dest type options } { - global rootme; global tmpdir; global gluefile wrap_flags; global srcdir @@ -184,17 +169,7 @@ proc objc_target_compile { source dest type options } { } lappend options "compiler=$OBJC_UNDER_TEST" - # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but - # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH - # (for the 64-bit ABI). The right way to do this would be to modify - # unix.exp -- but that's not an option since it's part of DejaGNU - # proper, so we do it here. We really only need to do - # this on IRIX, but it shouldn't hurt to do it anywhere else. - setenv LD_LIBRARY_PATH $ld_library_path - setenv SHLIB_PATH $ld_library_path - setenv LD_LIBRARYN32_PATH $ld_library_path - setenv LD_LIBRARY64_PATH $ld_library_path - setenv DYLD_LIBRARY_PATH $ld_library_path + set_ld_library_path_env_vars return [target_compile $source $dest $type $options] } diff --git a/gcc/testsuite/lib/target-libpath.exp b/gcc/testsuite/lib/target-libpath.exp index e8cf4630e16..8635e7e3453 100644 --- a/gcc/testsuite/lib/target-libpath.exp +++ b/gcc/testsuite/lib/target-libpath.exp @@ -57,7 +57,7 @@ proc set_ld_library_path_env_vars { } { } if { $orig_environment_saved == 0 } { - global env + global env; set orig_environment_saved 1 diff --git a/gcc/toplev.c b/gcc/toplev.c index 04f43c4f8eb..3c9dbcb0660 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4491,8 +4491,6 @@ process_options (void) static void backend_init (void) { - init_adjust_machine_modes (); - init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL || debug_info_level == DINFO_LEVEL_VERBOSE #ifdef VMS_DEBUGGING_INFO @@ -4636,6 +4634,11 @@ do_compile (void) /* Don't do any more if an error has already occurred. */ if (!errorcount) { + /* This must be run always, because it is needed to compute the FP + predefined macros, such as __LDBL_MAX__, for targets using non + default FP formats. */ + init_adjust_machine_modes (); + /* Set up the back-end if requested. */ if (!no_backend) backend_init (); diff --git a/gcc/varasm.c b/gcc/varasm.c index bc6996b63e0..8e83d543191 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -3603,63 +3603,61 @@ initializer_constant_valid_p (tree value, tree endtype) case CONVERT_EXPR: case NOP_EXPR: - /* Allow conversions between pointer types. */ - if (POINTER_TYPE_P (TREE_TYPE (value)) - && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) - return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); - - /* Allow conversions between real types. */ - if (FLOAT_TYPE_P (TREE_TYPE (value)) - && FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) - return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); - - /* Allow length-preserving conversions between integer types. */ - if (INTEGRAL_TYPE_P (TREE_TYPE (value)) - && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0))) - && (TYPE_PRECISION (TREE_TYPE (value)) - == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))) - return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); - - /* Allow conversions between other integer types only if - explicit value. */ - if (INTEGRAL_TYPE_P (TREE_TYPE (value)) - && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) - { - tree inner = initializer_constant_valid_p (TREE_OPERAND (value, 0), - endtype); - if (inner == null_pointer_node) - return null_pointer_node; - break; - } + { + tree src; + tree src_type; + tree dest_type; + + src = TREE_OPERAND (value, 0); + src_type = TREE_TYPE (src); + dest_type = TREE_TYPE (value); + + /* Allow conversions between pointer types, floating-point + types, and offset types. */ + if ((POINTER_TYPE_P (dest_type) && POINTER_TYPE_P (src_type)) + || (FLOAT_TYPE_P (dest_type) && FLOAT_TYPE_P (src_type)) + || (TREE_CODE (dest_type) == OFFSET_TYPE + && TREE_CODE (src_type) == OFFSET_TYPE)) + return initializer_constant_valid_p (src, endtype); + + /* Allow length-preserving conversions between integer types. */ + if (INTEGRAL_TYPE_P (dest_type) && INTEGRAL_TYPE_P (src_type) + && (TYPE_PRECISION (dest_type) == TYPE_PRECISION (src_type))) + return initializer_constant_valid_p (src, endtype); + + /* Allow conversions between other integer types only if + explicit value. */ + if (INTEGRAL_TYPE_P (dest_type) && INTEGRAL_TYPE_P (src_type)) + { + tree inner = initializer_constant_valid_p (src, endtype); + if (inner == null_pointer_node) + return null_pointer_node; + break; + } - /* Allow (int) &foo provided int is as wide as a pointer. */ - if (INTEGRAL_TYPE_P (TREE_TYPE (value)) - && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0))) - && (TYPE_PRECISION (TREE_TYPE (value)) - >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))) - return initializer_constant_valid_p (TREE_OPERAND (value, 0), - endtype); - - /* Likewise conversions from int to pointers, but also allow - conversions from 0. */ - if ((POINTER_TYPE_P (TREE_TYPE (value)) - || TREE_CODE (TREE_TYPE (value)) == OFFSET_TYPE) - && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) - { - if (integer_zerop (TREE_OPERAND (value, 0))) - return null_pointer_node; - else if (TYPE_PRECISION (TREE_TYPE (value)) - <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))) - return initializer_constant_valid_p (TREE_OPERAND (value, 0), - endtype); - } + /* Allow (int) &foo provided int is as wide as a pointer. */ + if (INTEGRAL_TYPE_P (dest_type) && POINTER_TYPE_P (src_type) + && (TYPE_PRECISION (dest_type) >= TYPE_PRECISION (src_type))) + return initializer_constant_valid_p (src, endtype); - /* Allow conversions to struct or union types if the value - inside is okay. */ - if (TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE - || TREE_CODE (TREE_TYPE (value)) == UNION_TYPE) - return initializer_constant_valid_p (TREE_OPERAND (value, 0), - endtype); + /* Likewise conversions from int to pointers, but also allow + conversions from 0. */ + if ((POINTER_TYPE_P (dest_type) + || TREE_CODE (dest_type) == OFFSET_TYPE) + && INTEGRAL_TYPE_P (src_type)) + { + if (integer_zerop (src)) + return null_pointer_node; + else if (TYPE_PRECISION (dest_type) <= TYPE_PRECISION (src_type)) + return initializer_constant_valid_p (src, endtype); + } + + /* Allow conversions to struct or union types if the value + inside is okay. */ + if (TREE_CODE (dest_type) == RECORD_TYPE + || TREE_CODE (dest_type) == UNION_TYPE) + return initializer_constant_valid_p (src, endtype); + } break; case PLUS_EXPR: diff --git a/gcc/version.c b/gcc/version.c index 9d64d6cb616..0cb010eae9d 100644 --- a/gcc/version.c +++ b/gcc/version.c @@ -5,7 +5,7 @@ please modify this string to indicate that, e.g. by putting your organization's name in parentheses at the end of the string. */ -const char version_string[] = "3.4.3 20050221 (Red Hat 3.4.3-20)"; +const char version_string[] = "3.4.3 20050505 (Red Hat 3.4.3-23)"; /* This is the location of the online document giving instructions for reporting bugs. If you distribute a modified version of GCC, diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fe0d1767da5..8c70ca74501 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,53 @@ +2005-05-04 Mark Mitchell <mark@codesourcery.com> + + * testsuite/lib/libstdc++.exp (v3-build_support): Look for + __GTHREADS, rather than _GLIBCXX_HAVE_GTHR_DEFAULT, to determine + whether or not thread support is available. + +2005-05-04 Mark Mitchell <mark@codesourcery.com> + + Backport: + 2005-03-25 Mark Mitchell <mark@codesourcery.com> + * testsuite/lib/libstdc++.exp (libstdc++_init): Define LOCALEDIR + when testing an installed compiler. + * testsuite/lib/libstdc++.exp (v3-build_support): Pass -w when + compiling support objects. + 2005-03-23 Mark Mitchell <mark@codesourcery.com> + * testsuite/libstdc++-dg/normal.exp: Read testsuite_files, if it + exists. + * testsuite/lib/libstdc++.exp (libstdc++_wchar_t): Rename to ... + (v3-wchar_t): ... this. + (libstdc++_threads): Rename to ... + (v3-threads): ... this. + (libstdc++_test_objs): Rename to ... + (v3-test_objs): ... this. + (libstdc++_build_support): Rename to ... + (v3-build_support): ... this. + * testsuite/libstdc++-dg/normal.exp: Adjust to use new names. + * testsuite/lib/libstdc++.exp (libstdc++_init): Improve handling + of compilers not in the build directory. + (libstdc++_wchar_t): New variable. + (libstdc++_threads): Likewise. + (libstdc++_test_objs): Likewise. + (v3_target_compile): Use libstdc++_test_objs. + (v3-list-tests): Remove. + (listdc++_build_support): New function. + * testsuite/libstdc++-dg/normal.exp: Rework to dynamically + generate list of tests. + 2004-11-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + * testsuite/lib/libstdc++.exp: Use new procs in target-libpath.exp. + +2005-04-26 Jones Desougi <jones@ingate.com> + + PR libstdc++/21131 + * linkage.m4: Fix comments. + +2005-04-25 Paolo Carlini <pcarlini@suse.de> + + PR libstdc++/21035 + * include/bits/basic_string.h (compare): Adjust the documentation + to match the implementation and the standard. + 2005-02-20 Paolo Carlini <pcarlini@suse.de> Jon Grimm <jgrimm2@us.ibm.com> diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index b6149e7ffb2..04e1500a87d 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -1850,9 +1850,11 @@ namespace std * * Returns an integer < 0 if this string is ordered before @a str, 0 if * their values are equivalent, or > 0 if this string is ordered after - * @a str. If the lengths of @a str and this string are different, the - * shorter one is ordered first. If they are the same, returns the - * result of traits::compare(data(),str.data(),size()); + * @a str. Determines the effective length rlen of the strings to + * compare as the smallest of size() and str.size(). The function + * then compares the two strings by calling traits::compare(data(), + * str.data(),rlen). If the result of the comparison is nonzero returns + * it, otherwise the shorter one is ordered first. */ int compare(const basic_string& __str) const @@ -1877,10 +1879,12 @@ namespace std * Form the substring of this string from the @a n characters starting * at @a pos. Returns an integer < 0 if the substring is ordered * before @a str, 0 if their values are equivalent, or > 0 if the - * substring is ordered after @a str. If the lengths @a of str and the - * substring are different, the shorter one is ordered first. If they - * are the same, returns the result of - * traits::compare(substring.data(),str.data(),size()); + * substring is ordered after @a str. Determines the effective length + * rlen of the strings to compare as the smallest of the length of the + * substring and @a str.size(). The function then compares the two + * strings by calling traits::compare(substring.data(),str.data(),rlen). + * If the result of the comparison is nonzero returns it, otherwise the + * shorter one is ordered first. */ int compare(size_type __pos, size_type __n, const basic_string& __str) const; @@ -1899,10 +1903,12 @@ namespace std * starting at @a pos2. Returns an integer < 0 if this substring is * ordered before the substring of @a str, 0 if their values are * equivalent, or > 0 if this substring is ordered after the substring - * of @a str. If the lengths of the substring of @a str and this - * substring are different, the shorter one is ordered first. If they - * are the same, returns the result of - * traits::compare(substring.data(),str.substr(pos2,n2).data(),size()); + * of @a str. Determines the effective length rlen of the strings + * to compare as the smallest of the lengths of the substrings. The + * function then compares the two strings by calling + * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). + * If the result of the comparison is nonzero returns it, otherwise the + * shorter one is ordered first. */ int compare(size_type __pos1, size_type __n1, const basic_string& __str, @@ -1915,9 +1921,12 @@ namespace std * * Returns an integer < 0 if this string is ordered before @a s, 0 if * their values are equivalent, or > 0 if this string is ordered after - * @a s. If the lengths of @a s and this string are different, the - * shorter one is ordered first. If they are the same, returns the - * result of traits::compare(data(),s,size()); + * @a s. Determines the effective length rlen of the strings to + * compare as the smallest of size() and the length of a string + * constructed from @a s. The function then compares the two strings + * by calling traits::compare(data(),s,rlen). If the result of the + * comparison is nonzero returns it, otherwise the shorter one is + * ordered first. */ int compare(const _CharT* __s) const; @@ -1934,10 +1943,13 @@ namespace std * Form the substring of this string from the @a n1 characters starting * at @a pos. Returns an integer < 0 if the substring is ordered * before @a s, 0 if their values are equivalent, or > 0 if the - * substring is ordered after @a s. If the lengths of @a s and the - * substring are different, the shorter one is ordered first. If they - * are the same, returns the result of - * traits::compare(substring.data(),s,size()); + * substring is ordered after @a s. Determines the effective length + * rlen of the strings to compare as the smallest of the length of the + * substring and the length of a string constructed from @a s. The + * function then compares the two string by calling + * traits::compare(substring.data(),s,rlen). If the result of the + * comparison is nonzero returns it, otherwise the shorter one is + * ordered first. */ int compare(size_type __pos, size_type __n1, const _CharT* __s) const; @@ -1954,10 +1966,12 @@ namespace std * at @a pos1. Form a string from the first @a n2 characters of @a s. * Returns an integer < 0 if this substring is ordered before the string * from @a s, 0 if their values are equivalent, or > 0 if this substring - * is ordered after the string from @a s. If the lengths of this - * substring and @a n2 are different, the shorter one is ordered first. - * If they are the same, returns the result of - * traits::compare(substring.data(),s,size()); + * is ordered after the string from @a s. Determines the effective + * length rlen of the strings to compare as the smallest of the length + * of the substring and @a n2. The function then compares the two + * strings by calling traits::compare(substring.data(),s,rlen). If the + * result of the comparison is nonzero returns it, otherwise the shorter + * one is ordered first. * * NB: s must have at least n2 characters, '\0' has no special * meaning. diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index aeb063eb0da..4606ae0759e 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -35,7 +35,7 @@ #include <bits/os_defines.h> // The current version of the C++ library in compressed ISO date format. -#define __GLIBCXX__ 20050221 +#define __GLIBCXX__ 20050505 // Allow use of "export template." This is currently not a feature // that g++ supports. diff --git a/libstdc++-v3/linkage.m4 b/libstdc++-v3/linkage.m4 index 6c8a6a766c0..c6c14785741 100644 --- a/libstdc++-v3/linkage.m4 +++ b/libstdc++-v3/linkage.m4 @@ -202,7 +202,7 @@ dnl 2) has "C" linkage dnl dnl argument 1 is name of function to check dnl -dnl ASSUMES argument is a math function with TWO parameters +dnl ASSUMES argument is a stdlib function with TWO parameters dnl dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2 AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2], [ @@ -231,7 +231,7 @@ dnl 2) has "C" linkage dnl dnl argument 1 is name of function to check dnl -dnl ASSUMES argument is a function with THREE parameters +dnl ASSUMES argument is a stdlib function with THREE parameters dnl dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3 AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3], [ diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index f16f20f5e1c..c5ea2cd2ca3 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -50,6 +50,7 @@ load_lib libgloss.exp load_gcc_lib target-supports.exp load_lib prune.exp load_lib dg-options.exp +load_gcc_lib target-libpath.exp # Useful for debugging. Pass the name of a variable and the verbosity # threshold (number of -v's on the command line). @@ -81,7 +82,7 @@ proc libstdc++_init { testfile } { global cxx cxxflags global includes global gluefile wrap_flags - global original_ld_library_path + global ld_library_path global target_triplet set blddir [lookfor_file [get_multilibs] libstdc++-v3] @@ -119,26 +120,6 @@ proc libstdc++_init { testfile } { v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"] v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"] - # Setup LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found. - # Find the existing LD_LIBRARY_PATH. - if [info exists env(LD_LIBRARY_PATH)] { - set original_ld_library_path $env(LD_LIBRARY_PATH) - # For HP-UX - } elseif [info exists env(SHLIB_PATH)] { - set original_ld_library_path $env(SHLIB_PATH) - # For Darwin: - } elseif [info exists env(DYLD_LIBRARY_PATH)] { - set original_ld_library_path $env(DYLD_LIBRARY_PATH) - # For Solaris 32 bit: - } elseif [info exists env(LD_LIBRARY_PATH_32)] { - set original_ld_library_path $env(LD_LIBRARY_PATH_32) - # For Solaris 64 bit: - } elseif [info exists env(LD_LIBRARY_PATH_64)] { - set original_ld_library_path $env(LD_LIBRARY_PATH_64) - } else { - set original_ld_library_path "" - } - # Locate libgcc.a so we don't need to account for different values of # SHLIB_EXT on different platforms set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] @@ -148,41 +129,33 @@ proc libstdc++_init { testfile } { v3track gccdir 3 # Compute what needs to be added to the existing LD_LIBRARY_PATH. - set ld_library_path "" - append ld_library_path ":${gccdir}" - set compiler ${gccdir}/g++ - if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { - set mldir "" - regexp -- "\[a-z0-9=/\.-\]*;" $i mldir - set mldir [string trimright $mldir "\;@"] - if { "$mldir" == "." } { - continue - } - if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { - append ld_library_path ":${gccdir}/${mldir}" - } - } + if {$gccdir != ""} { + set ld_library_path "" + append ld_library_path ":${gccdir}" + set compiler ${gccdir}/g++ + append ld_library_path ":${blddir}/src/.libs" + + if { [is_remote host] == 0 && [which $compiler] != 0 } { + foreach i "[exec $compiler --print-multi-lib]" { + set mldir "" + regexp -- "\[a-z0-9=/\.-\]*;" $i mldir + set mldir [string trimright $mldir "\;@"] + if { "$mldir" == "." } { + continue + } + if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { + append ld_library_path ":${gccdir}/${mldir}" + } + } + } + + set_ld_library_path_env_vars + if [info exists env(LD_LIBRARY_PATH)] { + verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" + } + } else { + set compiler [transform "g++"] } - append ld_library_path ":${blddir}/src/.libs" - - # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but - # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH - # (for the 64-bit ABI). The right way to do this would be to modify - # unix.exp -- but that's not an option since it's part of DejaGNU - # proper, so we do it here. - # The same applies to darwin (DYLD_LIBRARY_PATH), solaris 32 bit - # (LD_LIBRARY_PATH_32), solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX - # (SHLIB_PATH). - setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path" - setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path" - setenv LD_LIBRARYN32_PATH "$ld_library_path:$original_ld_library_path" - setenv LD_LIBRARY64_PATH "$ld_library_path:$original_ld_library_path" - setenv LD_RUN_PATH "$ld_library_path:$original_ld_library_path" - setenv LD_LIBRARY_PATH_32 "$ld_library_path:$original_ld_library_path" - setenv LD_LIBRARY_PATH_64 "$ld_library_path:$original_ld_library_path" - setenv DYLD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path" - verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" # Do a bunch of handstands and backflips for cross compiling and # finding simulators... @@ -203,8 +176,16 @@ proc libstdc++_init { testfile } { set includes [exec sh $flags_file --build-includes] } else { set cxx [transform "g++"] - set cxxflags "-ggdb3" + set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" set includes "-I${srcdir}" + # Guess at the location of the installed locale files. + # (It would be nice if "gcc --print-file-name" could find + # message files, but it cannot.) + set absolute_cxx [which $cxx] + if { $absolute_cxx != "" } { + set localedir "[file dirname $absolute_cxx]/../share/locale" + } + set cxxflags "$cxxflags -DLOCALEDIR=\"$localedir\"" } } @@ -269,6 +250,15 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } { return [list $comp_output $output_file] } +# True if the library supports wchar_t. +set v3-wchar_t 0 + +# True if the library supports threads. +set v3-threads 0 + +# A string naming object files to be linked into all tests. +set v3-test_objs "" + # Called from libstdc++-dg-test above. Calls back into system's # target_compile to actually do the work. proc v3_target_compile { source dest type options } { @@ -278,6 +268,7 @@ proc v3_target_compile { source dest type options } { global cxxflags global includes global blddir + global v3-test_objs if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { lappend options "libs=${gluefile}" @@ -289,42 +280,58 @@ proc v3_target_compile { source dest type options } { set cxx_final [concat $cxx_final $cxxlibglossflags] set cxx_final [concat $cxx_final $cxxflags] set cxx_final [concat $cxx_final $includes] + # Link the support objects into executables. + if { $type == "executable" } { + set cxx_final [concat $cxx_final ${v3-test_objs}] + } lappend options "compiler=$cxx_final" - # Picks up the freshly-built testsuite library corresponding to the - # multilib under test. - lappend options "ldflags=-L${blddir}/testsuite" - lappend options "libs=-lv3test" - return [target_compile $source $dest $type $options] } - -# Called once, from libstdc++/normal.exp. -proc v3-list-tests { filename } { +# Build the support objects linked in with the libstdc++ tests. In +# addition, set v3-wchar_t, v3-threads, and v3-test_objs +# appropriately. +proc v3-build_support {} { global srcdir - global blddir - - set tests_file "${blddir}/testsuite/${filename}" - set sfiles "" - - verbose -log "In v3-list-tests" - verbose -log "blddir = ${blddir}" - verbose -log "tests_file = $tests_file" + global v3-wchar_t + global v3-threads + global v3-test_objs + + # Figure out whether or not the library supports certain features. + set v3-wchar_t 0 + set v3-threads 0 + set v3-test_objs "" + + set config_src "config.cc" + set f [open $config_src "w"] + puts $f "#include <bits/c++config.h>" + puts $f "#include <bits/gthr.h>" + close $f + set preprocessed [v3_target_compile $config_src "" \ + preprocess "additional_flags=-dN"] + if { [string first "_GLIBCXX_USE_WCHAR_T" $preprocessed] != -1 } { + verbose -log "wchar_t support detected" + set v3-wchar_t 1 + } + if { [string first "__GTHREADS" $preprocessed] != -1 } { + verbose -log "thread support detected" + set v3-threads 1 + } - # If there is a testsuite_file, use it. - if { [file exists $tests_file] } { - set f [open $tests_file] - while { ! [eof $f] } { - set t [gets $f] - if { [string length "$t"] != 0 } { - lappend sfiles ${srcdir}/${t} - } - } - close $f - } else { - verbose "cannot open $tests_file" + # Build the support objects. + set source_files \ + [list testsuite_abi.cc testsuite_allocator.cc testsuite_hooks.cc] + foreach f $source_files { + set object_file [file rootname $f].o + # Compile with "-w" so that warnings issued by the compiler + # do not prevent compilation. + if { [v3_target_compile $srcdir/$f $object_file "object" \ + [list "incdir=$srcdir" "additional_flags=-w"]] + != "" } { + error "could not compile $f" + } + append v3-test_objs "$object_file " } - return $sfiles } diff --git a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp index b613c66da1c..746c7a8ec3f 100644 --- a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp +++ b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp @@ -21,10 +21,73 @@ # Initialization. dg-init +# Build the support objects. +v3-build_support + +set tests [list] + +# If there is a "testsuite_files" file, use it. +# +# This is a workaround for problems reported with using: +# +# runtest normal.exp="`cat testsuite_files`" +# +# See: +# http://gcc.gnu.org/ml/libstdc++/2005-03/msg00278.html +# for discussion of the problem. +# +# If that worked consistently, we could modify "make check" to +# pass that option, and then remove this code. +if {[info exists blddir]} { + set tests_file "${blddir}/testsuite/testsuite_files" +} +if {[info exists tests_file] && [file exists $tests_file]} { + set f [open $tests_file] + while { ! [eof $f] } { + set t [gets $f] + if { [string length "$t"] != 0 } { + lappend tests ${srcdir}/${t} + } + } + close $f +} else { + # Find directories that might have tests. + set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"] + foreach d [glob "$srcdir/\[a-z\]*"] { + if {[file isdirectory $d]} { + lappend subdirs $d + } + } + # Find all the tests. + foreach s $subdirs { + set subdir_tests [find $s *.cc] + # Filter out tests that should not be run. + foreach t $subdir_tests { + # The DejaGNU "find" procedure sometimes returns a list + # containing an empty string, when it should really return + # an empty list. + if { $t == "" } { + continue + } + # Filter out: + # 1. interactive tests. + # 2. performance tests. + # 3. wchar_t tests, if not supported. + # 4. thread tests, if not supported. + if { [string first _xin $t] == -1 + && [string first performance $t] == -1 + && (${v3-wchar_t} || [string first wchar_t $t] == -1) + && (${v3-threads} || [string first thread $t] == -1) } { + lappend tests $t + } + } + } +} +set tests [lsort $tests] + # Main loop. global DEFAULT_CXXFLAGS -dg-runtest [v3-list-tests testsuite_files] "" $DEFAULT_CXXFLAGS -#dg-runtest [v3-list-tests testsuite_files_interactive] "" $DEFAULT_CXXFLAGS +dg-runtest $tests "" $DEFAULT_CXXFLAGS # All done. dg-finish |