summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-09 19:21:18 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-09 19:21:18 +0000
commit45cb67c919f95074341164e3a2e350732e78d373 (patch)
tree7ce00b243f903b7dbfb65abea5f7d07041368f2a
parent534783cff20b859b0a7edcab38eca01f0d0e1993 (diff)
downloadgcc-45cb67c919f95074341164e3a2e350732e78d373.tar.gz
2008-09-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140164 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@140169 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.melt3
-rw-r--r--fixincludes/ChangeLog17
-rw-r--r--fixincludes/aclocal.m44
-rw-r--r--fixincludes/config.h.in2
-rwxr-xr-xfixincludes/configure694
-rw-r--r--fixincludes/configure.ac4
-rw-r--r--fixincludes/fixincl.tpl6
-rw-r--r--fixincludes/fixincl.x246
-rw-r--r--fixincludes/inclhack.def167
-rw-r--r--fixincludes/tests/base/internal/wchar_core.h2
-rw-r--r--fixincludes/tests/base/math.h13
-rw-r--r--fixincludes/tests/base/pthread.h1
-rw-r--r--gcc/ChangeLog243
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in4
-rw-r--r--gcc/ada/ChangeLog18
-rw-r--r--gcc/ada/gcc-interface/Makefile.in24
-rw-r--r--gcc/ada/s-interr-hwint.adb (renamed from gcc/ada/s-interr-vxworks.adb)69
-rw-r--r--gcc/ada/s-osinte-vxworks-kernel.adb251
-rw-r--r--gcc/ada/s-osinte-vxworks.adb71
-rw-r--r--gcc/ada/s-osinte-vxworks.ads44
-rw-r--r--gcc/c-common.c22
-rw-r--r--gcc/c-common.h6
-rw-r--r--gcc/c-decl.c9
-rw-r--r--gcc/c-objc-common.h2
-rw-r--r--gcc/c-parser.c4
-rw-r--r--gcc/cfgexpand.c9
-rw-r--r--gcc/config/avr/avr.c2
-rw-r--r--gcc/config/avr/avr.md31
-rw-r--r--gcc/config/bfin/bfin.c187
-rw-r--r--gcc/config/crx/crx.h13
-rw-r--r--gcc/config/h8300/h8300.h13
-rw-r--r--gcc/config/i386/sol2.h5
-rw-r--r--gcc/config/pa/linux-atomic.c300
-rw-r--r--gcc/config/pa/pa-hpux.h6
-rw-r--r--gcc/config/pa/pa-hpux10.h6
-rw-r--r--gcc/config/pa/pa-hpux11.h3
-rw-r--r--gcc/config/pa/pa32-regs.h13
-rw-r--r--gcc/config/pa/pa64-regs.h15
-rw-r--r--gcc/config/pa/t-linux1
-rw-r--r--gcc/config/pa/t-linux642
-rw-r--r--gcc/config/rs6000/altivec.md22
-rw-r--r--gcc/config/sol2.h5
-rw-r--r--gcc/config/sparc/sol2.h5
-rw-r--r--gcc/config/v850/v850.md2
-rw-r--r--gcc/cp/ChangeLog30
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h7
-rw-r--r--gcc/cp/decl.c81
-rw-r--r--gcc/cp/decl.h13
-rw-r--r--gcc/cp/mangle.c28
-rw-r--r--gcc/cp/name-lookup.c11
-rw-r--r--gcc/cp/parser.c80
-rw-r--r--gcc/cp/pt.c32
-rw-r--r--gcc/cp/semantics.c10
-rw-r--r--gcc/fold-const.c6
-rw-r--r--gcc/fortran/ChangeLog25
-rw-r--r--gcc/fortran/resolve.c9
-rw-r--r--gcc/fortran/symbol.c6
-rw-r--r--gcc/fortran/trans-array.c3
-rw-r--r--gcc/fortran/trans-expr.c23
-rw-r--r--gcc/function.h3
-rw-r--r--gcc/gimplify.c39
-rw-r--r--gcc/graphite.c114
-rw-r--r--gcc/haifa-sched.c16
-rw-r--r--gcc/ira-build.c2
-rw-r--r--gcc/ira-color.c13
-rw-r--r--gcc/ira-conflicts.c16
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/decl.c4
-rw-r--r--gcc/langhooks-def.h3
-rw-r--r--gcc/langhooks.c12
-rw-r--r--gcc/langhooks.h4
-rw-r--r--gcc/mips-tdump.c67
-rw-r--r--gcc/mips-tfile.c2
-rw-r--r--gcc/opts.c1
-rw-r--r--gcc/passes.c1
-rw-r--r--gcc/predict.c3
-rw-r--r--gcc/profile.c75
-rw-r--r--gcc/stmt.c60
-rw-r--r--gcc/testsuite/ChangeLog214
-rw-r--r--gcc/testsuite/g++.dg/cdce3.C5
-rw-r--r--gcc/testsuite/g++.dg/compat/eh/filter2_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/eh/new1_x.C3
-rw-r--r--gcc/testsuite/g++.dg/compat/eh/new1_y.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto3.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto6.C18
-rw-r--r--gcc/testsuite/g++.dg/opt/init2.C6
-rw-r--r--gcc/testsuite/g++.dg/other/error15.C74
-rw-r--r--gcc/testsuite/g++.dg/other/error6.C3
-rw-r--r--gcc/testsuite/g++.dg/other/pr28114.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error3.C12
-rw-r--r--gcc/testsuite/g++.dg/torture/pr37354.C14
-rw-r--r--gcc/testsuite/g++.dg/torture/pr37421.C39
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr14703.C49
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr37337.C37
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr37393.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/rfg16.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/template1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37387.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37433.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/memcpy-bi.c1
-rw-r--r--gcc/testsuite/gcc.dg/20041213-1.c38
-rw-r--r--gcc/testsuite/gcc.dg/always_inline.c4
-rw-r--r--gcc/testsuite/gcc.dg/always_inline3.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/compat-common.h8
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h33
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c6
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1.h24
-rw-r--r--gcc/testsuite/gcc.dg/div-double-1.c (renamed from gcc/testsuite/gcc.dg/fastmath-2.c)5
-rw-r--r--gcc/testsuite/gcc.dg/inline-14.c8
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-7.c12
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_global_var.c13
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_local_array.c10
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_local_var.c11
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c10
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c8
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c11
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c8
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c9
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c13
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c10
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c13
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c19
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c11
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c12
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr36630.c16
-rw-r--r--gcc/testsuite/gcc.dg/winline-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-7.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-9.c4
-rw-r--r--gcc/testsuite/gcc.dg/wtr-func-def-1.c60
-rw-r--r--gcc/testsuite/gcc.target/i386/pr12329.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-5.c4
-rw-r--r--gcc/testsuite/gfortran.dg/array_function_2.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/array_function_3.f9048
-rw-r--r--gcc/testsuite/gfortran.dg/array_function_4.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/implicit_12.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_order_1.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_order_2.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_order_3.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_order_4.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/save_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/size_kind.f904
-rw-r--r--gcc/testsuite/gfortran.dg/stfunc_6.f903
-rw-r--r--gcc/testsuite/gfortran.dg/string_compare_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_7.f0350
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_8.f0332
-rw-r--r--gcc/testsuite/lib/c-compat.exp14
-rw-r--r--gcc/testsuite/lib/compat.exp3
-rw-r--r--gcc/testsuite/lib/target-supports.exp3
-rw-r--r--gcc/tree-cfg.c311
-rw-r--r--gcc/tree-data-ref.c5
-rw-r--r--gcc/tree-inline.c1
-rw-r--r--gcc/tree-scalar-evolution.c145
-rw-r--r--gcc/tree-scalar-evolution.h14
-rw-r--r--gcc/tree-ssa-ccp.c1
-rw-r--r--gcc/tree-ssa-dom.c10
-rw-r--r--gcc/tree-ssa-ifcombine.c19
-rw-r--r--gcc/tree-ssa-live.c7
-rw-r--r--gcc/tree-ssa-sccvn.c10
-rw-r--r--gcc/tree-vect-transform.c1
-rw-r--r--gcc/tree.h1
-rw-r--r--include/ChangeLog5
-rw-r--r--include/demangle.h4
-rw-r--r--libgfortran/ChangeLog18
-rw-r--r--libgfortran/generated/reshape_c10.c27
-rw-r--r--libgfortran/generated/reshape_c16.c27
-rw-r--r--libgfortran/generated/reshape_c4.c27
-rw-r--r--libgfortran/generated/reshape_c8.c27
-rw-r--r--libgfortran/generated/reshape_i16.c27
-rw-r--r--libgfortran/generated/reshape_i4.c27
-rw-r--r--libgfortran/generated/reshape_i8.c27
-rw-r--r--libgfortran/generated/reshape_r10.c27
-rw-r--r--libgfortran/generated/reshape_r16.c27
-rw-r--r--libgfortran/generated/reshape_r4.c27
-rw-r--r--libgfortran/generated/reshape_r8.c27
-rw-r--r--libgfortran/intrinsics/reshape_generic.c27
-rw-r--r--libgfortran/m4/reshape.m427
-rw-r--r--libiberty/ChangeLog12
-rw-r--r--libiberty/cp-demangle.c134
-rw-r--r--libiberty/testsuite/demangle-expected16
-rw-r--r--libstdc++-v3/ChangeLog14
-rw-r--r--libstdc++-v3/acinclude.m434
-rw-r--r--libstdc++-v3/config.h.in4
-rwxr-xr-xlibstdc++-v3/configure77
-rw-r--r--libstdc++-v3/include/tr1_impl/cinttypes4
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc6
227 files changed, 4823 insertions, 1133 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt
index d0157c1f539..77a4df29c38 100644
--- a/ChangeLog.melt
+++ b/ChangeLog.melt
@@ -1,3 +1,6 @@
+2008-09-08 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk r140164
+
2008-09-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140063
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 1a3aea42026..94b49ebe18a 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,20 @@
+2008-09-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure.ac: Fix a typo.
+ * configured: Regenerate.
+
+2008-09-06 Bruce Korb <bkorb@gnu.org>
+
+ * fixincl.tpl (sed): make the program executable configurable.
+ Some platforms have some rather oddball defaults.
+ * config.h.in (SED_PROGRAM): define the default sed.
+ * fixincl.x: regenerated
+ * tests/base/internal/wchar_core.h: fix bad sample text
+ * tests/base/math.h: fix bad sample text
+ * configure.ac: search for working sed
+ * inclhack.def (glibc_mutex_init): fix non-portable construct
+ and re-order a few misordered entries.
+
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
diff --git a/fixincludes/aclocal.m4 b/fixincludes/aclocal.m4
index 60193f24ae2..6549cc2502f 100644
--- a/fixincludes/aclocal.m4
+++ b/fixincludes/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/fixincludes/config.h.in b/fixincludes/config.h.in
index fac869f1450..3693285482b 100644
--- a/fixincludes/config.h.in
+++ b/fixincludes/config.h.in
@@ -38,6 +38,8 @@
you don't. */
#undef HAVE_DECL_FFLUSH_UNLOCKED
+#define SED_PROGRAM "/usr/bin/sed"
+
/* Define to 1 if you have the declaration of `fgetc_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETC_UNLOCKED
diff --git a/fixincludes/configure b/fixincludes/configure
index 234619a9c56..872e8e0c82c 100755
--- a/fixincludes/configure
+++ b/fixincludes/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT WARN_CFLAGS WARN_PEDANTIC WERROR target_noncanonical TARGET CPP EGREP MAINT LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SED WARN_CFLAGS WARN_PEDANTIC WERROR target_noncanonical TARGET CPP EGREP MAINT LIBOBJS LTLIBOBJS'
ac_subst_files=''
ac_pwd=`pwd`
@@ -1355,6 +1355,633 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+
+
+# serial 53 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+# _LT_INIT
+
+# Old names:
+
+
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+
+
+# Initialize.
+
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+
+
+# Initialize.
+
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+
+
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+
+
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+
+
+
+# C support is built-in for now
+
+
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+
+
+
+
+
+
+# _LT_TAG_COMPILER
+# ----------------
+# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+# _LT_LINKER_BOILERPLATE
+
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+# _LT_COMPILER_OPTION
+
+# Old name:
+
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+# _LT_LINKER_OPTION
+
+# Old name:
+
+
+
+# LT_CMD_MAX_LEN
+#---------------
+# LT_CMD_MAX_LEN
+
+# Old name:
+
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+# LT_SYS_DLOPEN_SELF
+
+# Old name:
+
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+# LT_PATH_LD
+
+# Old names:
+
+
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+# LT_PATH_NM
+
+# Old names:
+
+
+
+
+# LT_LIB_M
+# --------
+# check for math library
+# LT_LIB_M
+
+# Old name:
+
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+ # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+# _LT_PROG_CXX
+
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+# _LT_PROG_F77
+
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+# _LT_PROG_FC
+
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+
+
+# Old name:
+
+
+
+# LT_PROG_RC
+# ----------
+
+
+# Old name:
+
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+# _LT_DECL_SED
+
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+#AC_PROG_SED
+#m4_ifndef
+
+# Old name:
+
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+
+
# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
{ { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
@@ -2377,6 +3004,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
@@ -5398,6 +6084,11 @@ else
fi
+cat >>confdefs.h <<_ACEOF
+#define SED_PROGRAM "${SED}"
+_ACEOF
+
+
ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile mkheaders.almost:mkheaders.in"
@@ -6032,6 +6723,7 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
+s,@SED@,$SED,;t t
s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
s,@WARN_PEDANTIC@,$WARN_PEDANTIC,;t t
s,@WERROR@,$WERROR,;t t
diff --git a/fixincludes/configure.ac b/fixincludes/configure.ac
index 6b03130b2d0..d885e3c9a1f 100644
--- a/fixincludes/configure.ac
+++ b/fixincludes/configure.ac
@@ -3,8 +3,10 @@ AC_PREREQ(2.59)
AC_INIT(fixincludes, [ ])
AC_CONFIG_SRCDIR(inclhack.def)
AC_CONFIG_AUX_DIR(..)
+m4_sinclude(../libtool.m4)
AC_CANONICAL_SYSTEM
AC_PROG_CC
+AC_PROG_SED
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
@@ -106,6 +108,8 @@ else
MAINT='#'
fi
AC_SUBST(MAINT)
+AC_DEFINE_UNQUOTED([SED_PROGRAM], "${SED}",
+ [Defined to the best working sed program on the host system])
AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in)
diff --git a/fixincludes/fixincl.tpl b/fixincludes/fixincl.tpl
index af92d15c8d9..c8d4b2ce145 100644
--- a/fixincludes/fixincl.tpl
+++ b/fixincludes/fixincl.tpl
@@ -35,6 +35,10 @@ x=fixincl.x =]
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef SED_PROGRAM
+#define SED_PROGRAM "/usr/bin/sed"
+#endif
+static char const sed_cmd_z[] = SED_PROGRAM;
[=
FOR fix =]
@@ -165,7 +169,7 @@ static tTestDesc a[=(. Hack)=]Tests[] = {[=
* Fix Command Arguments for [=(. Hack)=]
*/
static const char* apz[=(. Hack)=]Patch[] = {[=
- IF (exist? "sed")=] "sed"[=
+ IF (exist? "sed")=] sed_cmd_z[=
FOR sed=],
"-e", [=(kr-string (get "sed"))=][=
ENDFOR sed=],[=
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index c42991631f6..aa256892178 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Saturday June 14, 2008 at 12:41:10 PM CEST
+ * It has been AutoGen-ed Saturday September 6, 2008 at 11:42:15 AM PDT
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jun 14 12:41:10 CEST 2008
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Sep 6 11:42:15 PDT 2008
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -36,6 +36,10 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef SED_PROGRAM
+#define SED_PROGRAM "/usr/bin/sed"
+#endif
+static char const sed_cmd_z[] = SED_PROGRAM;
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
@@ -873,7 +877,7 @@ static tTestDesc aAlpha_Bad_LvalTests[] = {
/*
* Fix Command Arguments for Alpha_Bad_Lval
*/
-static const char* apzAlpha_Bad_LvalPatch[] = { "sed",
+static const char* apzAlpha_Bad_LvalPatch[] = { sed_cmd_z,
"-e", "s/^[ \t]*#[ \t]*define[ \t][ \t]*\\([^(]*\\)\\(([^)]*)\\)[ \t]*\\(_.*\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/",
(char*)NULL };
@@ -1058,7 +1062,7 @@ static tTestDesc aAlpha_Pthread_InitTests[] = {
/*
* Fix Command Arguments for Alpha_Pthread_Init
*/
-static const char* apzAlpha_Pthread_InitPatch[] = { "sed",
+static const char* apzAlpha_Pthread_InitPatch[] = { sed_cmd_z,
"-e", "s@MVALID\\(.*\\)A}@MVALID\\1A, 0, 0, 0, 0, 0, 0 }@\n\
s@MVALID\\(.*\\)_}@MVALID\\1_, 0, 0, 0, 0 }@\n\
s@CVALID\\(.*\\)A}@CVALID\\1A, 0, 0, 0, 0 }@\n\
@@ -1134,7 +1138,7 @@ static tTestDesc aAlpha_WcharTests[] = {
/*
* Fix Command Arguments for Alpha_Wchar
*/
-static const char* apzAlpha_WcharPatch[] = { "sed",
+static const char* apzAlpha_WcharPatch[] = { sed_cmd_z,
"-e", "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@",
"-e", "s@#define wcsftime __wcsftime_isoc@extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@",
(char*)NULL };
@@ -1463,7 +1467,7 @@ static tTestDesc aBroken_CabsTests[] = {
/*
* Fix Command Arguments for Broken_Cabs
*/
-static const char* apzBroken_CabsPatch[] = { "sed",
+static const char* apzBroken_CabsPatch[] = { sed_cmd_z,
"-e", "s/^extern[ \t]*double[ \t]*cabs[ \t]*([^\\)]*);//",
"-e", "s/^extern[ \t]*long[ \t]*double[ \t]*cabsl[ \t]*([^\\)]*);//",
(char*)NULL };
@@ -1807,7 +1811,7 @@ tSCC zDec_Intern_AsmList[] =
/*
* Fix Command Arguments for Dec_Intern_Asm
*/
-static const char* apzDec_Intern_AsmPatch[] = { "sed",
+static const char* apzDec_Intern_AsmPatch[] = { sed_cmd_z,
"-e", "/^[ \t]*float[ \t]*fasm/i\\\n\
#ifdef __DECC\n",
"-e", "/^[ \t]*#[ \t]*pragma[ \t]*intrinsic([ \t]*dasm/a\\\n\
@@ -2117,7 +2121,7 @@ static tTestDesc aGlibc_C99_Inline_2Tests[] = {
/*
* Fix Command Arguments for Glibc_C99_Inline_2
*/
-static const char* apzGlibc_C99_Inline_2Patch[] = { "sed",
+static const char* apzGlibc_C99_Inline_2Patch[] = { sed_cmd_z,
"-e", "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/#ifdef __GNUC_GNU_INLINE__\\\n\
extern\\\n\
#endif\\\n\
@@ -2247,8 +2251,11 @@ static tTestDesc aGlibc_Mutex_InitTests[] = {
/*
* Fix Command Arguments for Glibc_Mutex_Init
*/
-static const char* apzGlibc_Mutex_InitPatch[] = { "sed",
- "-e", "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/,+1s/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/",
+static const char* apzGlibc_Mutex_InitPatch[] = { sed_cmd_z,
+ "-e", "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/{\n\
+N\n\
+s/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/\n\
+}",
"-e", "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0 }/",
"-e", "s/{ \\(0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0, 0 }/",
"-e", "/define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\/N;s/^[ \t]*#[ \t]*\\(define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\\\)\\n[ \t]*{ { 0, } }/# if __WORDSIZE == 64\\n# \\1\\n { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }\\n# else\\n# \\1\\n { { 0, 0, 0, 0, 0, 0, 0, 0 } }\\n# endif/",
@@ -2373,6 +2380,51 @@ static const char* apzHp_SysfilePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Hppa_Hpux_Fp_Macros fix
+ */
+tSCC zHppa_Hpux_Fp_MacrosName[] =
+ "hppa_hpux_fp_macros";
+
+/*
+ * File name selection pattern
+ */
+tSCC zHppa_Hpux_Fp_MacrosList[] =
+ "math.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzHppa_Hpux_Fp_MacrosMachs[] = {
+ "hppa*-hp-hpux11*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zHppa_Hpux_Fp_MacrosSelect0[] =
+ "#[ \t]*define[ \t]*FP_NORMAL.*\n\
+#[ \t]*define[ \t]*FP_ZERO.*\n\
+#[ \t]*define[ \t]*FP_INFINITE.*\n\
+#[ \t]*define[ \t]*FP_SUBNORMAL.*\n\
+#[ \t]*define[ \t]*FP_NAN.*\n";
+
+#define HPPA_HPUX_FP_MACROS_TEST_CT 1
+static tTestDesc aHppa_Hpux_Fp_MacrosTests[] = {
+ { TT_EGREP, zHppa_Hpux_Fp_MacrosSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Hppa_Hpux_Fp_Macros
+ */
+static const char* apzHppa_Hpux_Fp_MacrosPatch[] = {
+ "format",
+ "#endif /* _INCLUDE_HPUX_SOURCE */\n\n\
+#if defined(_INCLUDE_HPUX_SOURCE) || \\\n\
+ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))\n\
+%0#endif\n\n\
+#ifdef _INCLUDE_HPUX_SOURCE\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Hpux10_Cpp_Pow_Inline fix
*/
tSCC zHpux10_Cpp_Pow_InlineName[] =
@@ -2452,50 +2504,6 @@ static const char* apzHpux11_Cpp_Pow_InlinePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Hppa_Hpux_Fp_Macros fix
- */
-tSCC zHppa_Hpux_Fp_MacrosName[] =
- "hppa_hpux_fp_macros";
-
-/*
- * File name selection pattern
- */
-tSCC zHppa_Hpux_Fp_MacrosList[] =
- "math.h\0";
-/*
- * Machine/OS name selection pattern
- */
-tSCC* apzHppa_Hpux_Fp_MacrosMachs[] = {
- "hppa*-hp-hpux11*",
- (const char*)NULL };
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zHppa_Hpux_Fp_MacrosSelect0[] =
- "#[ \t]*define[ \t]*FP_NORMAL.*\n\
-#[ \t]*define[ \t]*FP_ZERO.*\n\
-#[ \t]*define[ \t]*FP_INFINITE.*\n\
-#[ \t]*define[ \t]*FP_SUBNORMAL.*\n\
-#[ \t]*define[ \t]*FP_NAN.*\n";
-
-#define HPPA_HPUX_FP_MACROS_TEST_CT 1
-static tTestDesc aHppa_Hpux_Fp_MacrosTests[] = {
- { TT_EGREP, zHppa_Hpux_Fp_MacrosSelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Hppa_Hpux_Fp_Macros
- */
-static const char* apzHppa_Hpux_Fp_MacrosPatch[] = {
- "format",
- "#endif /* _INCLUDE_HPUX_SOURCE */\n\n\
-#if defined(_INCLUDE_HPUX_SOURCE) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))\n\
-%0#endif\n\n\
-#ifdef _INCLUDE_HPUX_SOURCE\n",
- (char*)NULL };
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
* Description of Hpux10_Ctype_Declarations1 fix
*/
tSCC zHpux10_Ctype_Declarations1Name[] =
@@ -2742,6 +2750,43 @@ static const char* apzHpux11_FabsfPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Hpux11_Pthread_Const fix
+ */
+tSCC zHpux11_Pthread_ConstName[] =
+ "hpux11_pthread_const";
+
+/*
+ * File name selection pattern
+ */
+tSCC zHpux11_Pthread_ConstList[] =
+ "sys/pthread.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzHpux11_Pthread_ConstMachs[] = {
+ "*-hp-hpux11.[0-3]*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zHpux11_Pthread_ConstSelect0[] =
+ "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
+
+#define HPUX11_PTHREAD_CONST_TEST_CT 1
+static tTestDesc aHpux11_Pthread_ConstTests[] = {
+ { TT_EGREP, zHpux11_Pthread_ConstSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Hpux11_Pthread_Const
+ */
+static const char* apzHpux11_Pthread_ConstPatch[] = {
+ "format",
+ "#define __POINTER_SET\t\t((void *) 1L)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Hpux11_Size_T fix
*/
tSCC zHpux11_Size_TName[] =
@@ -2918,7 +2963,7 @@ static tTestDesc aHpux8_Bogus_InlinesTests[] = {
/*
* Fix Command Arguments for Hpux8_Bogus_Inlines
*/
-static const char* apzHpux8_Bogus_InlinesPatch[] = { "sed",
+static const char* apzHpux8_Bogus_InlinesPatch[] = { sed_cmd_z,
"-e", "s@inline int abs(int [a-z][a-z]*) {.*}@extern \"C\" int abs(int);@",
"-e", "s@inline double abs(double [a-z][a-z]*) {.*}@@",
"-e", "s@inline int sqr(int [a-z][a-z]*) {.*}@@",
@@ -3037,7 +3082,7 @@ static tTestDesc aHpux_Long_DoubleTests[] = {
/*
* Fix Command Arguments for Hpux_Long_Double
*/
-static const char* apzHpux_Long_DoublePatch[] = { "sed",
+static const char* apzHpux_Long_DoublePatch[] = { sed_cmd_z,
"-e", "/^#[ \t]*ifndef _LONG_DOUBLE/,/\\/\\* _LONG_DOUBLE \\*\\//D",
"-e", "s/long_double/long double/g",
(char*)NULL };
@@ -3240,43 +3285,6 @@ extern \"C\" {\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Hpux11_Pthread_Const fix
- */
-tSCC zHpux11_Pthread_ConstName[] =
- "hpux11_pthread_const";
-
-/*
- * File name selection pattern
- */
-tSCC zHpux11_Pthread_ConstList[] =
- "sys/pthread.h\0";
-/*
- * Machine/OS name selection pattern
- */
-tSCC* apzHpux11_Pthread_ConstMachs[] = {
- "*-hp-hpux11.[0-3]*",
- (const char*)NULL };
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zHpux11_Pthread_ConstSelect0[] =
- "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
-
-#define HPUX11_PTHREAD_CONST_TEST_CT 1
-static tTestDesc aHpux11_Pthread_ConstTests[] = {
- { TT_EGREP, zHpux11_Pthread_ConstSelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Hpux11_Pthread_Const
- */
-static const char* apzHpux11_Pthread_ConstPatch[] = {
- "format",
- "#define __POINTER_SET\t\t((void *) 1L)",
- (char*)NULL };
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
* Description of Hpux_Pthread_Initializers fix
*/
tSCC zHpux_Pthread_InitializersName[] =
@@ -3299,7 +3307,7 @@ tSCC* apzHpux_Pthread_InitializersMachs[] = {
/*
* Fix Command Arguments for Hpux_Pthread_Initializers
*/
-static const char* apzHpux_Pthread_InitializersPatch[] = { "sed",
+static const char* apzHpux_Pthread_InitializersPatch[] = { sed_cmd_z,
"-e", "s@^[ \t]*1, 1, 1, 1,[ \t]*\\\\@\t{ 1, 1, 1, 1 },\t\t\t\t\t\t\t\\\\@",
"-e", "s@^[ \t]*1,[ \t]*\\\\@\t{ 1, 0 }@",
"-e", "/^[ \t]*0$/d",
@@ -3581,7 +3589,7 @@ static tTestDesc aIp_Missing_SemiTests[] = {
/*
* Fix Command Arguments for Ip_Missing_Semi
*/
-static const char* apzIp_Missing_SemiPatch[] = { "sed",
+static const char* apzIp_Missing_SemiPatch[] = { sed_cmd_z,
"-e", "/^struct/,/^};/s/}$/};/",
(char*)NULL };
@@ -4387,7 +4395,7 @@ static tTestDesc aNested_Sys_LimitsTests[] = {
/*
* Fix Command Arguments for Nested_Sys_Limits
*/
-static const char* apzNested_Sys_LimitsPatch[] = { "sed",
+static const char* apzNested_Sys_LimitsPatch[] = { sed_cmd_z,
"-e", "/CHILD_MAX/s,/\\* Max, Max,",
"-e", "/OPEN_MAX/s,/\\* Max, Max,",
(char*)NULL };
@@ -5148,7 +5156,7 @@ static tTestDesc aSco_MathTests[] = {
/*
* Fix Command Arguments for Sco_Math
*/
-static const char* apzSco_MathPatch[] = { "sed",
+static const char* apzSco_MathPatch[] = { sed_cmd_z,
"-e", "/#define.*__fp_class(a) \\\\/i\\\n\
#ifndef __GNUC__\n",
"-e", "/.*__builtin_generic/a\\\n\
@@ -5671,7 +5679,7 @@ static tTestDesc aSolaris_Stdio_TagTests[] = {
/*
* Fix Command Arguments for Solaris_Stdio_Tag
*/
-static const char* apzSolaris_Stdio_TagPatch[] = { "sed",
+static const char* apzSolaris_Stdio_TagPatch[] = { sed_cmd_z,
"-e", "s/defined(__cplusplus) && (__cplusplus < 54321L)/0/",
(char*)NULL };
@@ -5780,7 +5788,7 @@ static tTestDesc aStdio_Va_ListTests[] = {
/*
* Fix Command Arguments for Stdio_Va_List
*/
-static const char* apzStdio_Va_ListPatch[] = { "sed",
+static const char* apzStdio_Va_ListPatch[] = { sed_cmd_z,
"-e", "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n\
s@(va_list)&@(__gnuc_va_list)\\&@\n\
s@ _VA_LIST_));@ __gnuc_va_list));@\n\
@@ -5830,7 +5838,7 @@ static tTestDesc aStdio_Va_List_ClientsTests[] = {
/*
* Fix Command Arguments for Stdio_Va_List_Clients
*/
-static const char* apzStdio_Va_List_ClientsPatch[] = { "sed",
+static const char* apzStdio_Va_List_ClientsPatch[] = { sed_cmd_z,
"-e", "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n\
s@(va_list)&@(__gnuc_va_list)\\&@\n\
s@ _VA_LIST_));@ __gnuc_va_list));@\n\
@@ -6211,7 +6219,7 @@ static tTestDesc aSun_MallocTests[] = {
/*
* Fix Command Arguments for Sun_Malloc
*/
-static const char* apzSun_MallocPatch[] = { "sed",
+static const char* apzSun_MallocPatch[] = { sed_cmd_z,
"-e", "s/typedef[ \t]char \\*\tmalloc_t/typedef void \\*\tmalloc_t/g",
"-e", "s/int[ \t][ \t]*free/void\tfree/g",
"-e", "s/char\\([ \t]*\\*[ \t]*malloc\\)/void\\1/g",
@@ -6249,7 +6257,7 @@ static tTestDesc aSun_Rusers_SemiTests[] = {
/*
* Fix Command Arguments for Sun_Rusers_Semi
*/
-static const char* apzSun_Rusers_SemiPatch[] = { "sed",
+static const char* apzSun_Rusers_SemiPatch[] = { sed_cmd_z,
"-e", "/^struct/,/^};/s/_cnt$/_cnt;/",
(char*)NULL };
@@ -6357,7 +6365,7 @@ static tTestDesc aSvr4_Disable_OptTests[] = {
/*
* Fix Command Arguments for Svr4_Disable_Opt
*/
-static const char* apzSvr4_Disable_OptPatch[] = { "sed",
+static const char* apzSvr4_Disable_OptPatch[] = { sed_cmd_z,
"-e", "/#define.*__std_hdr_/d",
(char*)NULL };
@@ -6547,7 +6555,7 @@ static tTestDesc aSysv68_StringTests[] = {
/*
* Fix Command Arguments for Sysv68_String
*/
-static const char* apzSysv68_StringPatch[] = { "sed",
+static const char* apzSysv68_StringPatch[] = { sed_cmd_z,
"-e", "s/extern[ \t]*int[ \t]*strlen();/extern unsigned int strlen();/",
"-e", "s/extern[ \t]*int[ \t]*ffs[ \t]*(long);/extern int ffs(int);/",
"-e", "s/strdup(char \\*s1);/strdup(const char *s1);/",
@@ -6852,7 +6860,7 @@ static tTestDesc aVxworks_Gcc_ProblemTests[] = {
/*
* Fix Command Arguments for Vxworks_Gcc_Problem
*/
-static const char* apzVxworks_Gcc_ProblemPatch[] = { "sed",
+static const char* apzVxworks_Gcc_ProblemPatch[] = { sed_cmd_z,
"-e", "s/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/#if 1/",
"-e", "/[ \t]size_t/i\\\n\
#ifndef _GCC_SIZE_T\\\n\
@@ -6949,7 +6957,7 @@ static tTestDesc aVxworks_Needs_VxworksTests[] = {
/*
* Fix Command Arguments for Vxworks_Needs_Vxworks
*/
-static const char* apzVxworks_Needs_VxworksPatch[] = { "sed",
+static const char* apzVxworks_Needs_VxworksPatch[] = { sed_cmd_z,
"-e", "/#[ \t]define[ \t][ \t]*__INCstath/a\\\n\
#include <types/vxTypesOld.h>\n",
(char*)NULL };
@@ -7122,7 +7130,7 @@ static tTestDesc aX11_NewTests[] = {
/*
* Fix Command Arguments for X11_New
*/
-static const char* apzX11_NewPatch[] = { "sed",
+static const char* apzX11_NewPatch[] = { sed_cmd_z,
"-e", "/Widget\told, new;/i\\\n\
#ifdef __cplusplus\\\n\
\tWidget\told, c_new;\\\n\
@@ -7239,14 +7247,15 @@ typedef enum {
GNU_TYPES_FIXIDX,
HP_INLINE_FIXIDX,
HP_SYSFILE_FIXIDX,
+ HPPA_HPUX_FP_MACROS_FIXIDX,
HPUX10_CPP_POW_INLINE_FIXIDX,
HPUX11_CPP_POW_INLINE_FIXIDX,
- HPPA_HPUX_FP_MACROS_FIXIDX,
HPUX10_CTYPE_DECLARATIONS1_FIXIDX,
HPUX10_CTYPE_DECLARATIONS2_FIXIDX,
HPUX10_STDIO_DECLARATIONS_FIXIDX,
HPUX11_ABS_FIXIDX,
HPUX11_FABSF_FIXIDX,
+ HPUX11_PTHREAD_CONST_FIXIDX,
HPUX11_SIZE_T_FIXIDX,
HPUX11_SNPRINTF_FIXIDX,
HPUX11_UINT32_C_FIXIDX,
@@ -7260,7 +7269,6 @@ typedef enum {
HPUX11_EXTERN_SENDFILE_FIXIDX,
HPUX11_EXTERN_SENDPATH_FIXIDX,
HPUX_EXTERN_ERRNO_FIXIDX,
- HPUX11_PTHREAD_CONST_FIXIDX,
HPUX_PTHREAD_INITIALIZERS_FIXIDX,
HUGE_VAL_HEX_FIXIDX,
HUGE_VALF_HEX_FIXIDX,
@@ -7647,6 +7655,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HP_SYSFILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHp_SysfileTests, apzHp_SysfilePatch, 0 },
+ { zHppa_Hpux_Fp_MacrosName, zHppa_Hpux_Fp_MacrosList,
+ apzHppa_Hpux_Fp_MacrosMachs,
+ HPPA_HPUX_FP_MACROS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHppa_Hpux_Fp_MacrosTests, apzHppa_Hpux_Fp_MacrosPatch, 0 },
+
{ zHpux10_Cpp_Pow_InlineName, zHpux10_Cpp_Pow_InlineList,
apzHpux10_Cpp_Pow_InlineMachs,
HPUX10_CPP_POW_INLINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -7657,11 +7670,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HPUX11_CPP_POW_INLINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux11_Cpp_Pow_InlineTests, apzHpux11_Cpp_Pow_InlinePatch, 0 },
- { zHppa_Hpux_Fp_MacrosName, zHppa_Hpux_Fp_MacrosList,
- apzHppa_Hpux_Fp_MacrosMachs,
- HPPA_HPUX_FP_MACROS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aHppa_Hpux_Fp_MacrosTests, apzHppa_Hpux_Fp_MacrosPatch, 0 },
-
{ zHpux10_Ctype_Declarations1Name, zHpux10_Ctype_Declarations1List,
apzHpux10_Ctype_Declarations1Machs,
HPUX10_CTYPE_DECLARATIONS1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -7687,6 +7695,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HPUX11_FABSF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux11_FabsfTests, apzHpux11_FabsfPatch, 0 },
+ { zHpux11_Pthread_ConstName, zHpux11_Pthread_ConstList,
+ apzHpux11_Pthread_ConstMachs,
+ HPUX11_PTHREAD_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux11_Pthread_ConstTests, apzHpux11_Pthread_ConstPatch, 0 },
+
{ zHpux11_Size_TName, zHpux11_Size_TList,
apzHpux11_Size_TMachs,
HPUX11_SIZE_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -7752,11 +7765,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HPUX_EXTERN_ERRNO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux_Extern_ErrnoTests, apzHpux_Extern_ErrnoPatch, 0 },
- { zHpux11_Pthread_ConstName, zHpux11_Pthread_ConstList,
- apzHpux11_Pthread_ConstMachs,
- HPUX11_PTHREAD_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aHpux11_Pthread_ConstTests, apzHpux11_Pthread_ConstPatch, 0 },
-
{ zHpux_Pthread_InitializersName, zHpux_Pthread_InitializersList,
apzHpux_Pthread_InitializersMachs,
HPUX_PTHREAD_INITIALIZERS_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 3143dea9c12..69ea0cf59a8 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -620,6 +620,7 @@ fix = {
"#endif";
};
+
/*
* Compaq Tru64 v5.1 defines all of its PTHREAD_*_INITIALIZER macros
* incorrectly, specifying less fields in the initializers than are
@@ -639,32 +640,34 @@ fix = {
"s@CVALID\\(.*\\)_}@CVALID\\1_, 0, 0 }@\n"
"s@WVALID\\(.*\\)A}@WVALID\\1A, 0, 0, 0, 0, 0, 0, 0, 0, 0 }@\n"
"s@WVALID\\(.*\\)_}@WVALID\\1_, 0, 0, 0, 0, 0, 0, 0 }@\n";
- test_text = "/*\n"
- " * @(#)_RCSfile: pthread.h,v \\$ "
- "_Revision: 1.1.33.21 \\$ (DEC) "
- "_Date: 2000/08/15 15:30:13 \\$\n"
- " */\n"
-"#ifndef _PTHREAD_NOMETER_STATIC\n"
-"# define PTHREAD_MUTEX_INITIALIZER \\\n"
-" {_PTHREAD_MSTATE_CONFIG, _PTHREAD_MVALID | _PTHREAD_MVF_STA}\n"
-"# define PTHREAD_COND_INITIALIZER \\\n"
-" {_PTHREAD_CSTATE_SLOW, _PTHREAD_CVALID | _PTHREAD_CVF_STA}\n"
-"# define PTHREAD_MUTEX_INITWITHNAME_NP(_n_,_a_) \\\n"
-" {_PTHREAD_MSTATE_CONFIG, _PTHREAD_MVALID | _PTHREAD_MVF_STA, _n_, _a_}\n"
-"# define PTHREAD_COND_INITWITHNAME_NP(_n_,_a_) \\\n"
-" {_PTHREAD_CSTATE_SLOW, _PTHREAD_CVALID | _PTHREAD_CVF_STA, _n_, _a_}\n"
-"#else\n"
-"# define PTHREAD_MUTEX_INITIALIZER {0, _PTHREAD_MVALID | _PTHREAD_MVF_STA}\n"
-"# define PTHREAD_MUTEX_INITWITHNAME_NP(_n_,_a_) \\\n"
-" {0, _PTHREAD_MVALID | _PTHREAD_MVF_STA, _n_, _a_}\n"
-"# define PTHREAD_COND_INITWITHNAME_NP(_n_,_a_) \\\n"
-" {0, _PTHREAD_CVALID | _PTHREAD_CVF_STA, _n_, _a_}\n"
-"#endif\n\n"
-"#define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWVALID | _PTHREAD_RWVF_STA}\n"
-"#define PTHREAD_RWLOCK_INITWITHNAME_NP(_n_,_a_) \\\n"
-" {_PTHREAD_RWVALID | _PTHREAD_RWVF_STA, _n_, _a_}\n";
+ test_text = <<- _EOText_
+ /*
+ * @(#)_RCSfile: pthread.h,v $ _Revision: 1.1.33.21 $ (DEC) _Date: 2000/08/15 15:30:13 $
+ */
+ #ifndef _PTHREAD_NOMETER_STATIC
+ # define PTHREAD_MUTEX_INITIALIZER \
+ {_PTHREAD_MSTATE_CONFIG, _PTHREAD_MVALID | _PTHREAD_MVF_STA}
+ # define PTHREAD_COND_INITIALIZER \
+ {_PTHREAD_CSTATE_SLOW, _PTHREAD_CVALID | _PTHREAD_CVF_STA}
+ # define PTHREAD_MUTEX_INITWITHNAME_NP(_n_,_a_) \
+ {_PTHREAD_MSTATE_CONFIG, _PTHREAD_MVALID | _PTHREAD_MVF_STA, _n_, _a_}
+ # define PTHREAD_COND_INITWITHNAME_NP(_n_,_a_) \
+ {_PTHREAD_CSTATE_SLOW, _PTHREAD_CVALID | _PTHREAD_CVF_STA, _n_, _a_}
+ #else
+ # define PTHREAD_MUTEX_INITIALIZER {0, _PTHREAD_MVALID | _PTHREAD_MVF_STA}
+ # define PTHREAD_MUTEX_INITWITHNAME_NP(_n_,_a_) \
+ {0, _PTHREAD_MVALID | _PTHREAD_MVF_STA, _n_, _a_}
+ # define PTHREAD_COND_INITWITHNAME_NP(_n_,_a_) \
+ {0, _PTHREAD_CVALID | _PTHREAD_CVF_STA, _n_, _a_}
+ #endif
+
+ #define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWVALID | _PTHREAD_RWVF_STA}
+ #define PTHREAD_RWLOCK_INITWITHNAME_NP(_n_,_a_) \
+ {_PTHREAD_RWVALID | _PTHREAD_RWVF_STA, _n_, _a_}
+ _EOText_;
};
+
/*
* Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
* And OpenBSD.
@@ -852,10 +855,10 @@ fix = {
"extern long double cabsl( struct __cabsl_s );";
};
+
/*
* Fixup Darwin's broken check for __builtin_nanf.
- */
-
+ */
fix = {
hackname = broken_nan;
/*
@@ -871,7 +874,7 @@ fix = {
c_fix = format;
c_fix_arg = "#if 1";
test_text = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
-};
+};
/*
@@ -1228,10 +1231,12 @@ fix = {
hackname = glibc_mutex_init;
files = pthread.h;
select = '\{ *\{ *0, *\} *\}';
- sed = "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/,+1"
- "s/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/";
- sed = "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0 }/";
- sed = "s/{ \\(0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0, 0 }/";
+ sed = "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/{\n"
+ "N\ns/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/\n}";
+ sed = "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_"
+ "\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0 }/";
+ sed = "s/{ \\(0, 0, 0, PTHREAD_MUTEX_"
+ "\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0, 0 }/";
sed = "/define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\/"
"N;s/^[ \t]*#[ \t]*"
"\\(define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\\\)\\n"
@@ -1242,7 +1247,8 @@ fix = {
"# \\1\\n"
" { { 0, 0, 0, 0, 0, 0, 0, 0 } }\\n"
"# endif/";
- sed = "s/{ \\(0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\\) }/{ \\1, 0 }/";
+ sed = "s/{ \\(0, 0, 0, 0, 0, 0, "
+ "PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\\) }/{ \\1, 0 }/";
sed = "/define[ \t]\\+PTHREAD_COND_INITIALIZER/"
"s/{ { 0, } }/{ { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }/";
@@ -1349,6 +1355,40 @@ fix = {
/*
+ * Un-Hide a series of five FP defines from post-1999 compliance GCC:
+ * FP_NORMAL, FP_ZERO, FP_INFINITE, FP_SUBNORMAL and FP_NAN
+ */
+fix = {
+ hackname = hppa_hpux_fp_macros;
+ mach = "hppa*-hp-hpux11*";
+ files = math.h;
+ select = "#[ \t]*define[ \t]*FP_NORMAL.*\n"
+ "#[ \t]*define[ \t]*FP_ZERO.*\n"
+ "#[ \t]*define[ \t]*FP_INFINITE.*\n"
+ "#[ \t]*define[ \t]*FP_SUBNORMAL.*\n"
+ "#[ \t]*define[ \t]*FP_NAN.*\n";
+ c_fix = format;
+ c_fix_arg = <<- _EOFix_
+ #endif /* _INCLUDE_HPUX_SOURCE */
+
+ #if defined(_INCLUDE_HPUX_SOURCE) || \
+ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
+ %0#endif
+
+ #ifdef _INCLUDE_HPUX_SOURCE
+
+ _EOFix_;
+
+ test_text =
+ "# define FP_NORMAL 0\n"
+ "# define FP_ZERO 1\n"
+ "# define FP_INFINITE 2\n"
+ "# define FP_SUBNORMAL 3\n"
+ "# define FP_NAN 4\n";
+};
+
+
+/*
* Delete C++ double pow (double, int) inline function from HP-UX 10 & 11
* math.h to prevent clash with define in c_std/bits/std_cmath.h.
*/
@@ -1396,27 +1436,6 @@ fix = {
};
-fix = {
- hackname = hppa_hpux_fp_macros;
- mach = "hppa*-hp-hpux11*";
- files = math.h;
- select = "#[ \t]*define[ \t]*FP_NORMAL.*\n"
- "#[ \t]*define[ \t]*FP_ZERO.*\n"
- "#[ \t]*define[ \t]*FP_INFINITE.*\n"
- "#[ \t]*define[ \t]*FP_SUBNORMAL.*\n"
- "#[ \t]*define[ \t]*FP_NAN.*\n";
- c_fix = format;
- c_fix_arg = "#endif /* _INCLUDE_HPUX_SOURCE */\n\n#if defined(_INCLUDE_HPUX_SOURCE) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))\n%0#endif\n\n#ifdef _INCLUDE_HPUX_SOURCE\n";
-
- test_text =
- "# define FP_NORMAL 0\n"
- "# define FP_ZERO 1\n"
- "# define FP_INFINITE 2\n"
- "# define FP_SUBNORMAL 3\n"
- "# define FP_NAN 4\n";
-};
-
-
/*
* Fix hpux 10.X missing ctype declarations 1
*/
@@ -1512,7 +1531,6 @@ fix = {
select = "ifndef _MATH_INCLUDED";
c_fix = format;
c_fix_arg = "if !defined(_MATH_INCLUDED) || defined(__GNUG__)";
-// sed = "s/ifndef _MATH_INCLUDED/if !defined(_MATH_INCLUDED) || defined(__GNUG__)/";
test_text = "#ifndef _MATH_INCLUDED";
};
@@ -1538,6 +1556,21 @@ fix = {
/*
+ * Fix C99 constant in __POINTER_SET define.
+ */
+fix = {
+ hackname = hpux11_pthread_const;
+ mach = "*-hp-hpux11.[0-3]*";
+ files = sys/pthread.h;
+ select = "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
+
+ c_fix = format;
+ c_fix_arg = "#define __POINTER_SET\t\t((void *) 1L)";
+ test_text = "#define __POINTER_SET\t\t((void *) 1LL)";
+};
+
+
+/*
* Prevent HP-UX 11 from defining __size_t and preventing size_t from
* being defined by having it define _hpux_size_t instead.
*/
@@ -1763,19 +1796,6 @@ fix = {
test_text = " extern int errno;\n";
};
-/*
- * Fix C99 constant in __POINTER_SET define.
- */
-fix = {
- hackname = hpux11_pthread_const;
- mach = "*-hp-hpux11.[0-3]*";
- files = sys/pthread.h;
- select = "^#define[ \t]*__POINTER_SET[ \t]*\\(\\(void \\*\\) 1LL\\)";
-
- c_fix = format;
- c_fix_arg = "#define __POINTER_SET\t\t((void *) 1L)";
- test_text = "#define __POINTER_SET\t\t((void *) 1LL)";
-};
/*
* Add missing braces to pthread initializer defines.
@@ -2112,7 +2132,9 @@ fix = {
c_fix_arg = "#if _NO_XOPEN5 && !defined(__c99)\n%1";
test_text = "#if _NO_XOPEN5\n"
- "extern size_t wcsftime(wchar_t *, __SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, const struct tm *);";
+ "extern size_t wcsftime(wchar_t *, "
+ "__SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, "
+ "const struct tm *);";
};
/*
@@ -2278,7 +2300,8 @@ fix = {
* exception either. So currently we bypass only for glibc, based on a
* comment in the fixed glibc header. Ick.
*/
- bypass = 'We have a problem when using C\+\+|for C\+\+, _[a-z0-9A-Z_]+_exception; for C, exception';
+ bypass = 'We have a problem when using C\+\+|for C\+\+, '
+ '_[a-z0-9A-Z_]+_exception; for C, exception';
c_fix = wrap;
c_fix_arg = "#ifdef __cplusplus\n"
@@ -2368,7 +2391,11 @@ fix = {
select = "extern __inline int";
c_fix = format;
- c_fix_arg = "extern\n#ifdef __GNUC_STDC_INLINE__\n__attribute__((__gnu_inline__))\n#endif\n__inline int";
+ c_fix_arg = "extern\n"
+ "#ifdef __GNUC_STDC_INLINE__\n"
+ "__attribute__((__gnu_inline__))\n"
+ "#endif\n"
+ "__inline int";
test_text = "extern __inline int\nsigaddset(sigset_t *set, int signo)\n{}";
};
diff --git a/fixincludes/tests/base/internal/wchar_core.h b/fixincludes/tests/base/internal/wchar_core.h
index 5b358a32213..9c9fc4e97b2 100644
--- a/fixincludes/tests/base/internal/wchar_core.h
+++ b/fixincludes/tests/base/internal/wchar_core.h
@@ -11,5 +11,5 @@
#if defined( IRIX_WCSFTIME_CHECK )
#if _NO_XOPEN5 && !defined(__c99)
-extern size_t wcsftime(wchar_t *, __SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, const struct tm *);
+extern size_t wcsftime(wchar_t *, __SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, const struct tm *);
#endif /* IRIX_WCSFTIME_CHECK */
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 5b5b1d1ede0..389dacf25c7 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -43,15 +43,11 @@ extern int matherr();
#endif /* EXCEPTION_STRUCTURE_CHECK */
-#if defined( HPUX11_CPP_POW_INLINE_CHECK )
-
-#endif /* HPUX11_CPP_POW_INLINE_CHECK */
-
-
#if defined( HPPA_HPUX_FP_MACROS_CHECK )
#endif /* _INCLUDE_HPUX_SOURCE */
-#if defined(_INCLUDE_HPUX_SOURCE) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
+#if defined(_INCLUDE_HPUX_SOURCE) || \
+ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
# define FP_NORMAL 0
# define FP_ZERO 1
# define FP_INFINITE 2
@@ -64,6 +60,11 @@ extern int matherr();
#endif /* HPPA_HPUX_FP_MACROS_CHECK */
+#if defined( HPUX11_CPP_POW_INLINE_CHECK )
+
+#endif /* HPUX11_CPP_POW_INLINE_CHECK */
+
+
#if defined( HPUX11_FABSF_CHECK )
#ifdef _PA_RISC
#ifndef __cplusplus
diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h
index 68ed2c8ab1a..4f18e718057 100644
--- a/fixincludes/tests/base/pthread.h
+++ b/fixincludes/tests/base/pthread.h
@@ -52,7 +52,6 @@
#define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWVALID | _PTHREAD_RWVF_STA, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
#define PTHREAD_RWLOCK_INITWITHNAME_NP(_n_,_a_) {_PTHREAD_RWVALID | _PTHREAD_RWVF_STA, _n_, _a_, 0, 0, 0, 0, 0, 0, 0 }
-
#endif /* ALPHA_PTHREAD_INIT_CHECK */
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f3a30d97222..ef34d8d541d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,246 @@
+2008-09-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/37375
+ * tree-scalar-evolution.c (scev_info_str): Add field instantiated_below.
+ (new_scev_info_str, eq_scev_info, find_var_scev_info,
+ set_scalar_evolution, get_scalar_evolution, get_instantiated_value,
+ set_instantiated_value): Pass instantiated_below.
+ (analyze_scalar_evolution_1, analyze_scalar_evolution): Update calls to
+ above functions.
+ (instantiate_scev_1, instantiate_scev): Pass a basic block above which the
+ definitions are not instantiated.
+
+ * tree-scalar-evolution.h (instantiate_scev): Update declaration.
+ (block_before_loop): New.
+ * tree-data-ref.c (dr_analyze_indices): Update uses of instantiate_scev.
+ * graphite.c (block_before_scop): New.
+ (loop_affine_expr, stmt_simple_for_scop_p, harmful_stmt_in_bb): Pass a
+ basic block, not a loop for determining the parameters.
+ (scopdet_edge_info, build_scops_1): Do not pass outermost loop in the
+ scop.
+ (idx_record_params, find_params_in_bb, find_scop_parameters,
+ build_loop_iteration_domains, add_conditions_to_domain): Update calls
+ to instantiate_scev.
+
+ * Makefile.in (cfgloopmanip.o): Add missing dependency on TREE_FLOW_H.
+
+2008-09-09 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-opt/37333
+
+ * ira-build.c (ira_create_allocno): Setup frequency to 0.
+
+ * ira-color.c (update_conflict_hard_regno_costs): Remove assert.
+ Check zero freq and increase if necessary.
+
+2008-09-09 Vladimir Makarov <vmakarov@redhat.com>
+
+ * ira-conflicts.c (process_regs_for_copy): Check that the hard
+ regno is in the right range. Add comments.
+
+2008-09-09 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * Makefile.in (mips-tfile.o-warn): Don't error out on mips-tfile.c
+ warnings.
+ * mips-tfile.c (copy_object): Cast alloca result to int *.
+ * mips-tdump.c (print_symbol): Cast xmalloc return values to
+ proper types.
+ Rename class to sclass.
+ (read_tfile): Cast read_seek return values to proper types.
+ Cast xcalloc return value to proper type.
+
+2008-09-09 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/sol2.h (REGISTER_TARGET_PRAGMAS): Move ...
+ * config/i386/sol2.h (REGISTER_SUBTARGET_PRAGMAS): ... here.
+ * config/sparc/sol2.h (REGISTER_TARGET_PRAGMAS): ... and here.
+
+2008-09-09 Jan Hubicka <jh@suse.cz>
+
+ * profile.c (is_edge_inconsistent): Add debug output; ignore negative count
+ on fake edges.
+ (is_inconsistent): Add debug output.
+
+2008-09-09 Andrey Belevantsev <abel@ispras.ru>
+
+ * haifa-sched.c (advance_one_cycle): Do not print '\n' before printing
+ dump message.
+ (choose_ready): When first insn is chosen from the ready list, also
+ dump it.
+
+2008-09-09 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/37360
+ * haifa-sched.c (max_issue): Do not assert that we never issue more
+ insns than issue_rate. Add comment.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ * tree-cfg.c (verify_types_in_gimple_op): Remove.
+ (verify_types_in_gimple_call): Rename to ...
+ (verify_gimple_call): ... this. Enhance.
+ (verify_types_in_gimple_cond): Remove.
+ (verify_gimple_comparison): New function ...
+ (verify_types_in_gimple_assign): ... split out from here.
+ (verify_types_in_gimple_return): Rename to ...
+ (verify_gimple_return): ... this. Enhance.
+ (verify_types_in_gimple_switch): Rename to ...
+ (verify_gimple_switch): ... this. Enhance.
+ (verify_gimple_goto): New function.
+ (verify_types_in_gimple_phi): Rename to ...
+ (verify_gimple_phi): ... this. Enhance.
+ (verify_types_in_gimple_stmt): Adjust calls to helper functions.
+ Fold in single-statement cases from verify_types_in_gimple_seq_2.
+ (verify_types_in_gimple_seq_2): Remove cases handled in
+ verify_types_in_gimple_stmt.
+
+2008-09-09 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.c (n_regs_to_save): New static variable.
+ (push_multiple_operation, pop_multiple_operation): Set it.
+ (workaround_rts_anomaly): New function.
+ (workaround_speculation): New function, broken out of bfin_reorg.
+ (bfin_reorg): Call the new functions.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37354
+ PR middle-end/30165
+ * gimplify.c (gimplify_conversion): Change conversions of
+ non-register type to VIEW_CONVERT_EXPRs.
+ (gimplify_addr_expr): If we need to make the operand
+ addressable make sure to use a properly initialized
+ temporary for that so it gets a valid gimple store.
+
+2008-09-09 Aldy Hernandez <aldyh@redhat.com>
+
+ * function.h (struct function): Add function_start_locus.
+ * cfgexpand.c (gimple_expand_cfg): Use it.
+ * c-parser.c (c_parser_declaration_or_fndef): Set it.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37433
+ * tree-ssa-ccp.c (ccp_fold): Properly guard folding of
+ function calls.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37387
+ * tree-ssa-ifcombine.c (ifcombine_iforif): Convert the name
+ and bits to a common type.
+
+2008-09-09 Nick Clifton <nickc@redhat.com>
+
+ * config/v850/v850.md (return): Restore frame size restriction.
+
+2008-09-09 Paolo Bonzini <bonzini@gnu.org>
+
+ * c-common.c (c_expand_decl): Remove.
+ * c-common.h (anon_aggr_type_p): Remove prototype.
+ (DECL_ANON_UNION_ELEMS): Remove.
+ * c-objc-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
+ * c-decl.c (anon_aggr_type_p): Remove.
+ * langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Remove.
+ (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_EXPAND_DECL.
+ * langhooks.h (struct lang_hooks): Remove expand_decl.
+ * langhooks.c (lhd_expand_decl): Remove.
+ * stmt.c (expand_anon_union_decl): Remove.
+ * tree.h (expand_anon_union_decl): Remove prototype.
+
+2008-08-09 Andy Hutchinson <hutchinsonandy@aim.com>
+
+ PR target/36609
+ * config/avr/avr.c (avr_reorg): Create RTL for reversed compare with
+ zero.
+ * config/avr/avr.md (QISI) : Define mode iterator.
+ (negated_tst<mode>) : Redefine as split using mode macro.
+ (reversed_tstqi): Define insn as reversed compare with zero.
+ (reversed_tsthi): Ditto.
+ (reversed_tstsi): Ditto.
+
+2008-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37393
+ * tree-inline.c (copy_bb): When replacing a gimple_call_va_arg_pack_p
+ call stmt by new_call, clear gimple_bb on stmt after gsi_replace.
+
+ PR middle-end/37414
+ * predict.c (optimize_function_for_size_p): Don't segfault if
+ FUN is NULL.
+ * fold-const.c (LOGICAL_OP_NON_SHORT_CIRCUIT, fold_truthop,
+ tree_swap_operands_p): Don't test cfun != NULL before calling
+ optimize_function_for_s*_p.
+
+2008-09-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ira-color.c (ira_reuse_stack_slot): Set slot_num on success at the
+ end of the search.
+
+2008-09-08 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
+
+ * crx/crx.h (IRA_COVER_CLASSES): Define.
+
+2008-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37337
+ * tree-ssa-dom.c (optimize_stmt): Call maybe_clean_or_replace_eh_stmt
+ even when a stmt has been gimple_modified_p, but after fold_stmt is
+ not any longer. Remove unneeded may_have_exposed_new_symbols
+ initializations.
+
+2008-09-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37421
+ * tree-ssa-sccvn.c (visit_copy): Make sure to fully
+ valueize the RHS.
+
+2008-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37415
+ * opts.c (common_handle_option): Handle OPT_ftree_store_ccp.
+
+2008-09-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR driver/37409
+ * pa-hpux.h (LINK_SPEC): Strip -fwhole-program.
+ * pa-hpux10.h (LINK_SPEC): Likewise.
+ * pa-hpux11.h (LINK_SPEC): Likewise.
+
+2008-09-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa32-regs.h (IRA_COVER_CLASSES): Define.
+ * pa64-regs.h (IRA_COVER_CLASSES): Define.
+
+2008-09-07 Helge Deller <deller@gmx.de>
+
+ * pa/linux-atomic.c: New file.
+ * pa/t-linux (LIB2FUNCS_STATIC_EXTRA): Define.
+ * pa/t-linux64 (LIB2FUNCS_STATIC_EXTRA): Define.
+
+2008-09-07 Richard Guenther <rguenther@suse.de>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/36630
+ * tree-vect-transform.c (vect_update_ivs_after_vectorizer):
+ Call STRIP_NOPS before calling evolution_part_in_loop_num.
+
+2008-09-07 Dorit Nuzman <dorit@il.ibm.com>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/35642
+ * config/rs6000/altivec.md (mulv8hi3): Implement.
+
+2008-09-06 Jeff Law <law@redhat.com>
+
+ * h8300/h8300.h (IRA_COVER_CLASSES): Define.
+
+2008-09-06 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/14703
+ * tree-ssa-live.c (remove_unused_scope_block_p): Remove ignored declarations.
+ * passes.c (init_optimization_passes): Recompute inline parameters.
+
2008-09-06 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.c (mips_function_ok_for_sibcall): Check for
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 92b72ce4934..40b90e8e2b4 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080906
+20080909
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index b05bccb9004..f1c5e485199 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -185,6 +185,8 @@ bitmap.o-warn = -Wno-error
dominance.o-warn = -Wno-error
# graphite.c contains code calling cloog that has problems.
graphite.o-warn = -Wno-error
+# mips-tfile.c contains -Wcast-qual warnings.
+mips-tfile.o-warn = -Wno-error
## basilys.c contain tricky stuff
basilys.o-warn = -Wno-error
@@ -2880,7 +2882,7 @@ loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(HASHTAB_H) except.h
cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \
- coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H)
+ coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) $(TREE_FLOW_H)
loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \
coretypes.h $(TM_H) $(OBSTACK_H) tree-pass.h $(TIMEVAR_H) $(FLAGS_H) $(DF_H)
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0ce56a66a97..8453c2eb964 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,17 @@
+2008-09-09 Arnaud Charlet <charlet@adacore.com>
+ Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * gcc-interface/Makefile.in: Switch VxWorks to s-interr-hwint.adb.
+
+ * s-interr-vxworks.adb: Renamed to s-interr-hwint.adb
+
+ * s-interr-hwint.adb: New file.
+
+ * s-osinte-vxworks.ads, s-osinte-vxworks.adb: Add new functions
+ needed by s-interr-hwint.adb.
+
+ * s-osinte-vxworks-kernel.adb: New file.
+
2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* s-stchop-rtems.adb: Add file missed in early commit. Already
@@ -28,8 +42,8 @@
* checks.adb (Determine_Range): Deal with values that might be invalid
- * opt.adb, opt.ads (Assume_No_Invalid_Values[_Config]): New configuration
- switches.
+ * opt.adb, opt.ads (Assume_No_Invalid_Values[_Config]): New
+ configuration switches.
* par-prag.adb: Dummy entry for pragma Assume_No_Invalid_Values
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 28763d7872f..5a35c07c4d8 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -391,10 +391,10 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb \
s-osinte.ads<s-osinte-vxworks.ads \
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
@@ -472,7 +472,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
else
LIBGNAT_TARGET_PAIRS += \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
system.ads<system-vxworks-ppc.ads
@@ -505,10 +505,10 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
g-io.adb<g-io-vxworks-ppc-cert.adb \
g-io.ads<g-io-vxworks-ppc-cert.ads \
s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb \
s-osinte.ads<s-osinte-vxworks.ads \
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-ae653.ads \
@@ -551,10 +551,10 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb \
s-osinte.ads<s-osinte-vxworks.ads \
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
@@ -626,7 +626,7 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
else
LIBGNAT_TARGET_PAIRS += \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
system.ads<system-vxworks-x86.ads
@@ -654,10 +654,10 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb \
s-osinte.ads<s-osinte-vxworks.ads \
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
@@ -689,10 +689,10 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
+ s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb \
s-osinte.ads<s-osinte-vxworks.ads \
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
diff --git a/gcc/ada/s-interr-vxworks.adb b/gcc/ada/s-interr-hwint.adb
index a752b2dbd4c..729c62cb8fc 100644
--- a/gcc/ada/s-interr-vxworks.adb
+++ b/gcc/ada/s-interr-hwint.adb
@@ -40,7 +40,7 @@
-- it must call Block_Interrupt/Unblock_Interrupt, which will have the effect
-- of unmasking/masking the signal in the Interrupt_Manager task. These
-- comments do not apply to vectored hardware interrupts, which may be masked
--- or unmasked using routined interfaced to the relevant VxWorks system
+-- or unmasked using routined interfaced to the relevant embedded RTOS system
-- calls.
-- Once we associate a Signal_Server_Task with an signal, the task never goes
@@ -61,14 +61,14 @@
-- status between Interrupt_Manager and Server_Task. Protection among service
-- requests are ensured via user calls to the Interrupt_Manager entries.
--- This is the VxWorks version of this package, supporting vectored hardware
--- interrupts.
+-- This is reasonably generic version of this package, supporting vectored
+-- hardware interrupts using non-RTOS specific adapter routines which
+-- should easily implemented on any RTOS capable of supporting GNAT.
with Ada.Unchecked_Conversion;
with Ada.Task_Identification;
-with Interfaces.VxWorks;
-
+with Interfaces.C; use Interfaces.C;
with System.OS_Interface; use System.OS_Interface;
with System.Interrupt_Management;
with System.Task_Primitives.Operations;
@@ -125,7 +125,7 @@ package body System.Interrupts is
end Interrupt_Manager;
task type Interrupt_Server_Task
- (Interrupt : Interrupt_ID; Int_Sema : SEM_ID) is
+ (Interrupt : Interrupt_ID; Int_Sema : Binary_Semaphore_Id) is
-- Server task for vectored hardware interrupt handling
pragma Interrupt_Priority (System.Interrupt_Priority'First + 2);
end Interrupt_Server_Task;
@@ -182,7 +182,7 @@ package body System.Interrupts is
Semaphore_ID_Map : array
(Interrupt_ID range 0 .. System.OS_Interface.Max_HW_Interrupt)
- of SEM_ID := (others => 0);
+ of Binary_Semaphore_Id := (others => 0);
-- Array of binary semaphores associated with vectored interrupts
-- Note that the last bound should be Max_HW_Interrupt, but this will raise
-- Storage_Error if Num_HW_Interrupts is null, so use an extra 4 bytes
@@ -213,11 +213,12 @@ package body System.Interrupts is
-- Always consider a null handler as registered.
procedure Notify_Interrupt (Param : System.Address);
+ pragma Convention (C, Notify_Interrupt);
-- Umbrella handler for vectored interrupts (not signals)
procedure Install_Umbrella_Handler
(Interrupt : HW_Interrupt;
- Handler : Interfaces.VxWorks.VOIDFUNCPTR);
+ Handler : System.OS_Interface.Interrupt_Handler);
-- Install the runtime umbrella handler for a vectored hardware
-- interrupt
@@ -490,16 +491,12 @@ package body System.Interrupts is
procedure Install_Umbrella_Handler
(Interrupt : HW_Interrupt;
- Handler : Interfaces.VxWorks.VOIDFUNCPTR)
+ Handler : System.OS_Interface.Interrupt_Handler)
is
- use Interfaces.VxWorks;
-
Vec : constant Interrupt_Vector :=
- INUM_TO_IVEC (Interfaces.VxWorks.int (Interrupt));
+ Interrupt_Number_To_Vector (int (Interrupt));
- Stat : Interfaces.VxWorks.STATUS;
- pragma Unreferenced (Stat);
- -- ??? shouldn't we test Stat at least in a pragma Assert?
+ Status : int;
begin
-- Only install umbrella handler when no Ada handler has already been
@@ -508,7 +505,10 @@ package body System.Interrupts is
-- wrapper generated by intConnect for each interrupt number.
if not Handler_Installed (Interrupt) then
- Stat := intConnect (Vec, Handler, System.Address (Interrupt));
+ Status :=
+ Interrupt_Connect (Vec, Handler, System.Address (Interrupt));
+ pragma Assert (Status = 0);
+
Handler_Installed (Interrupt) := True;
end if;
end Install_Umbrella_Handler;
@@ -618,20 +618,20 @@ package body System.Interrupts is
-- on which it pends once it's been started. This routine determines
-- The appropriate semaphore and issues a semGive call, waking
-- the server task. When a handler is unbound,
- -- System.Interrupts.Unbind_Handler issues a semFlush, and the
- -- server task deletes its semaphore and terminates.
+ -- System.Interrupts.Unbind_Handler issues a Binary_Semaphore_Flush,
+ -- and the server task deletes its semaphore and terminates.
procedure Notify_Interrupt (Param : System.Address) is
Interrupt : constant Interrupt_ID := Interrupt_ID (Param);
- Id : constant SEM_ID := Semaphore_ID_Map (Interrupt);
+ Id : constant Binary_Semaphore_Id := Semaphore_ID_Map (Interrupt);
- Discard_Result : STATUS;
- pragma Unreferenced (Discard_Result);
+ Status : int;
begin
if Id /= 0 then
- Discard_Result := semGive (Id);
+ Status := Binary_Semaphore_Release (Id);
+ pragma Assert (Status = 0);
end if;
end Notify_Interrupt;
@@ -764,15 +764,13 @@ package body System.Interrupts is
--------------------
procedure Unbind_Handler (Interrupt : Interrupt_ID) is
- S : STATUS;
- use type STATUS;
-
+ Status : int;
begin
-- Flush server task off semaphore, allowing it to terminate
- S := semFlush (Semaphore_ID_Map (Interrupt));
- pragma Assert (S = 0);
+ Status := Binary_Semaphore_Flush (Semaphore_ID_Map (Interrupt));
+ pragma Assert (Status = 0);
end Unbind_Handler;
--------------------------------
@@ -890,8 +888,7 @@ package body System.Interrupts is
(To_Ada (Server_ID (Interrupt))))
then
Interrupt_Access_Hold :=
- new Interrupt_Server_Task
- (Interrupt, semBCreate (SEM_Q_FIFO, SEM_EMPTY));
+ new Interrupt_Server_Task (Interrupt, Binary_Semaphore_Create);
Server_ID (Interrupt) :=
To_System (Interrupt_Access_Hold.all'Identity);
end if;
@@ -988,7 +985,7 @@ package body System.Interrupts is
(To_Ada (Server_ID (Interrupt)))
then
Interrupt_Access_Hold := new Interrupt_Server_Task
- (Interrupt, semBCreate (SEM_Q_FIFO, SEM_EMPTY));
+ (Interrupt, Binary_Semaphore_Create);
Server_ID (Interrupt) :=
To_System (Interrupt_Access_Hold.all'Identity);
end if;
@@ -1046,9 +1043,7 @@ package body System.Interrupts is
Tmp_Handler : Parameterless_Handler;
Tmp_ID : Task_Id;
Tmp_Entry_Index : Task_Entry_Index;
- S : STATUS;
-
- use type STATUS;
+ Status : int;
begin
System.Tasking.Utilities.Make_Independent;
@@ -1058,8 +1053,8 @@ package body System.Interrupts is
-- Pend on semaphore that will be triggered by the
-- umbrella handler when the associated interrupt comes in
- S := semTake (Int_Sema, WAIT_FOREVER);
- pragma Assert (S = 0);
+ Status := Binary_Semaphore_Obtain (Int_Sema);
+ pragma Assert (Status = 0);
if User_Handler (Interrupt).H /= null then
@@ -1091,9 +1086,9 @@ package body System.Interrupts is
-- Delete the associated semaphore
- S := semDelete (Int_Sema);
+ Status := Binary_Semaphore_Delete (Int_Sema);
- pragma Assert (S = 0);
+ pragma Assert (Status = 0);
-- Set status for the Interrupt_Manager
diff --git a/gcc/ada/s-osinte-vxworks-kernel.adb b/gcc/ada/s-osinte-vxworks-kernel.adb
new file mode 100644
index 00000000000..ed62f802953
--- /dev/null
+++ b/gcc/ada/s-osinte-vxworks-kernel.adb
@@ -0,0 +1,251 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- --
+-- S Y S T E M . O S _ I N T E R F A C E --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 1997-2008, Free Software Foundation, Inc. --
+-- --
+-- GNARL is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNARL; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNARL was developed by the GNARL team at Florida State University. --
+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the VxWorks version
+
+-- This package encapsulates all direct interfaces to OS services that are
+-- needed by children of System.
+
+pragma Polling (Off);
+-- Turn off polling, we do not want ATC polling to take place during tasking
+-- operations. It causes infinite loops and other problems.
+
+package body System.OS_Interface is
+
+ use type Interfaces.C.int;
+
+ Low_Priority : constant := 255;
+ -- VxWorks native (default) lowest scheduling priority
+
+ ----------
+ -- kill --
+ ----------
+
+ function kill (pid : t_id; sig : Signal) return int is
+ begin
+ return System.VxWorks.Ext.kill (pid, int (sig));
+ end kill;
+
+ -------------
+ -- sigwait --
+ -------------
+
+ function sigwait
+ (set : access sigset_t;
+ sig : access Signal) return int
+ is
+ Result : int;
+
+ function sigwaitinfo
+ (set : access sigset_t; sigvalue : System.Address) return int;
+ pragma Import (C, sigwaitinfo, "sigwaitinfo");
+
+ begin
+ Result := sigwaitinfo (set, System.Null_Address);
+
+ if Result /= -1 then
+ sig.all := Signal (Result);
+ return 0;
+ else
+ sig.all := 0;
+ return errno;
+ end if;
+ end sigwait;
+
+ -----------------
+ -- To_Duration --
+ -----------------
+
+ function To_Duration (TS : timespec) return Duration is
+ begin
+ return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9;
+ end To_Duration;
+
+ -----------------
+ -- To_Timespec --
+ -----------------
+
+ function To_Timespec (D : Duration) return timespec is
+ S : time_t;
+ F : Duration;
+
+ begin
+ S := time_t (Long_Long_Integer (D));
+ F := D - Duration (S);
+
+ -- If F is negative due to a round-up, adjust for positive F value
+
+ if F < 0.0 then
+ S := S - 1;
+ F := F + 1.0;
+ end if;
+
+ return timespec'(ts_sec => S,
+ ts_nsec => long (Long_Long_Integer (F * 10#1#E9)));
+ end To_Timespec;
+
+ -------------------------
+ -- To_VxWorks_Priority --
+ -------------------------
+
+ function To_VxWorks_Priority (Priority : int) return int is
+ begin
+ return Low_Priority - Priority;
+ end To_VxWorks_Priority;
+
+ --------------------
+ -- To_Clock_Ticks --
+ --------------------
+
+ -- ??? - For now, we'll always get the system clock rate since it is
+ -- allowed to be changed during run-time in VxWorks. A better method would
+ -- be to provide an operation to set it that so we can always know its
+ -- value.
+
+ -- Another thing we should probably allow for is a resultant tick count
+ -- greater than int'Last. This should probably be a procedure with two
+ -- output parameters, one in the range 0 .. int'Last, and another
+ -- representing the overflow count.
+
+ function To_Clock_Ticks (D : Duration) return int is
+ Ticks : Long_Long_Integer;
+ Rate_Duration : Duration;
+ Ticks_Duration : Duration;
+
+ begin
+ if D < 0.0 then
+ return -1;
+ end if;
+
+ -- Ensure that the duration can be converted to ticks
+ -- at the current clock tick rate without overflowing.
+
+ Rate_Duration := Duration (sysClkRateGet);
+
+ if D > (Duration'Last / Rate_Duration) then
+ Ticks := Long_Long_Integer (int'Last);
+ else
+ Ticks_Duration := D * Rate_Duration;
+ Ticks := Long_Long_Integer (Ticks_Duration);
+
+ if Ticks_Duration > Duration (Ticks) then
+ Ticks := Ticks + 1;
+ end if;
+
+ if Ticks > Long_Long_Integer (int'Last) then
+ Ticks := Long_Long_Integer (int'Last);
+ end if;
+ end if;
+
+ return int (Ticks);
+ end To_Clock_Ticks;
+
+ -----------------------------
+ -- Binary_Semaphore_Create --
+ -----------------------------
+
+ function Binary_Semaphore_Create return Binary_Semaphore_Id is
+ begin
+ return Binary_Semaphore_Id (semBCreate (SEM_Q_FIFO, SEM_EMPTY));
+ end Binary_Semaphore_Create;
+
+ -----------------------------
+ -- Binary_Semaphore_Delete --
+ -----------------------------
+
+ function Binary_Semaphore_Delete (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semDelete (SEM_ID (ID));
+ end Binary_Semaphore_Delete;
+
+ -----------------------------
+ -- Binary_Semaphore_Obtain --
+ -----------------------------
+
+ function Binary_Semaphore_Obtain (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semTake (SEM_ID (ID), WAIT_FOREVER);
+ end Binary_Semaphore_Obtain;
+
+ ------------------------------
+ -- Binary_Semaphore_Release --
+ ------------------------------
+
+ function Binary_Semaphore_Release (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semGive (SEM_ID (ID));
+ end Binary_Semaphore_Release;
+
+ ----------------------------
+ -- Binary_Semaphore_Flush --
+ ----------------------------
+
+ function Binary_Semaphore_Flush (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semFlush (SEM_ID (ID));
+ end Binary_Semaphore_Flush;
+
+ -----------------------
+ -- Interrupt_Connect --
+ -----------------------
+
+ function Interrupt_Connect
+ (Vector : Interrupt_Vector;
+ Handler : Interrupt_Handler;
+ Parameter : System.Address := System.Null_Address) return int
+ is
+ function intConnect
+ (vector : Interrupt_Vector;
+ handler : Interrupt_Handler;
+ parameter : System.Address) return int;
+ pragma Import (C, intConnect, "intConnect");
+
+ begin
+ return intConnect (Vector, Handler, Parameter);
+ end Interrupt_Connect;
+
+ --------------------------------
+ -- Interrupt_Number_To_Vector --
+ --------------------------------
+
+ function Interrupt_Number_To_Vector
+ (intNum : int) return Interrupt_Vector
+ is
+ function INUM_TO_IVEC (intNum : int) return Interrupt_Vector;
+ pragma Import (C, INUM_TO_IVEC, "__gnat_inum_to_ivec");
+
+ begin
+ return INUM_TO_IVEC (intNum);
+ end Interrupt_Number_To_Vector;
+
+end System.OS_Interface;
diff --git a/gcc/ada/s-osinte-vxworks.adb b/gcc/ada/s-osinte-vxworks.adb
index 312fabaaeb6..b0fd06b10ef 100644
--- a/gcc/ada/s-osinte-vxworks.adb
+++ b/gcc/ada/s-osinte-vxworks.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -170,4 +170,73 @@ package body System.OS_Interface is
return int (Ticks);
end To_Clock_Ticks;
+ -----------------------------
+ -- Binary_Semaphore_Create --
+ -----------------------------
+
+ function Binary_Semaphore_Create return Binary_Semaphore_Id is
+ begin
+ return Binary_Semaphore_Id (semBCreate (SEM_Q_FIFO, SEM_EMPTY));
+ end Binary_Semaphore_Create;
+
+ -----------------------------
+ -- Binary_Semaphore_Delete --
+ -----------------------------
+
+ function Binary_Semaphore_Delete (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semDelete (SEM_ID (ID));
+ end Binary_Semaphore_Delete;
+
+ -----------------------------
+ -- Binary_Semaphore_Obtain --
+ -----------------------------
+
+ function Binary_Semaphore_Obtain (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semTake (SEM_ID (ID), WAIT_FOREVER);
+ end Binary_Semaphore_Obtain;
+
+ ------------------------------
+ -- Binary_Semaphore_Release --
+ ------------------------------
+
+ function Binary_Semaphore_Release (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semGive (SEM_ID (ID));
+ end Binary_Semaphore_Release;
+
+ ----------------------------
+ -- Binary_Semaphore_Flush --
+ ----------------------------
+
+ function Binary_Semaphore_Flush (ID : Binary_Semaphore_Id) return int is
+ begin
+ return semFlush (SEM_ID (ID));
+ end Binary_Semaphore_Flush;
+
+ -----------------------
+ -- Interrupt_Connect --
+ -----------------------
+
+ function Interrupt_Connect
+ (Vector : Interrupt_Vector;
+ Handler : Interrupt_Handler;
+ Parameter : System.Address := System.Null_Address) return int
+ is
+ pragma Unreferenced (Vector, Handler, Parameter);
+ begin
+ return 0;
+ end Interrupt_Connect;
+
+ --------------------------------
+ -- Interrupt_Number_To_Vector --
+ --------------------------------
+
+ function Interrupt_Number_To_Vector
+ (intNum : int) return Interrupt_Vector is
+ begin
+ return Interrupt_Vector (intNum);
+ end Interrupt_Number_To_Vector;
+
end System.OS_Interface;
diff --git a/gcc/ada/s-osinte-vxworks.ads b/gcc/ada/s-osinte-vxworks.ads
index 35baabb6924..532bded849d 100644
--- a/gcc/ada/s-osinte-vxworks.ads
+++ b/gcc/ada/s-osinte-vxworks.ads
@@ -432,6 +432,50 @@ package System.OS_Interface is
pragma Import (C, semFlush, "semFlush");
-- Release all threads blocked on the semaphore
+ ------------------------------------------------------------
+ -- Binary Semaphore Wrapper to Support Interrupt Tasks --
+ ------------------------------------------------------------
+
+ type Binary_Semaphore_Id is new Long_Integer;
+
+ function Binary_Semaphore_Create return Binary_Semaphore_Id;
+ pragma Inline (Binary_Semaphore_Create);
+
+ function Binary_Semaphore_Delete (ID : Binary_Semaphore_Id) return int;
+ pragma Inline (Binary_Semaphore_Delete);
+
+ function Binary_Semaphore_Obtain (ID : Binary_Semaphore_Id) return int;
+ pragma Inline (Binary_Semaphore_Obtain);
+
+ function Binary_Semaphore_Release (ID : Binary_Semaphore_Id) return int;
+ pragma Inline (Binary_Semaphore_Release);
+
+ function Binary_Semaphore_Flush (ID : Binary_Semaphore_Id) return int;
+ pragma Inline (Binary_Semaphore_Flush);
+
+ ------------------------------------------------------------
+ -- Hardware Interrupt Wrappers to Support Interrupt Tasks --
+ ------------------------------------------------------------
+
+ type Interrupt_Handler is access procedure (parameter : System.Address);
+ pragma Convention (C, Interrupt_Handler);
+
+ type Interrupt_Vector is new System.Address;
+
+ function Interrupt_Connect
+ (Vector : Interrupt_Vector;
+ Handler : Interrupt_Handler;
+ Parameter : System.Address := System.Null_Address) return int;
+ pragma Inline (Interrupt_Connect);
+ -- Use this to set up an user handler. The routine installs a
+ -- a user handler which is invoked after RTEMS has saved enough
+ -- context for a high-level language routine to be safely invoked.
+
+ function Interrupt_Number_To_Vector (intNum : int) return Interrupt_Vector;
+ pragma Inline (Interrupt_Number_To_Vector);
+ -- Convert a logical interrupt number to the hardware interrupt vector
+ -- number used to connect the interrupt.
+
private
type sigset_t is new unsigned_long_long;
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 1934a13f437..68837a02063 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -995,28 +995,6 @@ fname_as_string (int pretty_p)
return namep;
}
-/* Expand DECL if it declares an entity not handled by the
- common code. */
-
-int
-c_expand_decl (tree decl)
-{
- if (TREE_CODE (decl) == VAR_DECL && !TREE_STATIC (decl))
- {
- /* Let the back-end know about this variable. */
- if (!anon_aggr_type_p (TREE_TYPE (decl)))
- emit_local_var (decl);
- else
- expand_anon_union_decl (decl, NULL_TREE,
- DECL_ANON_UNION_ELEMS (decl));
- }
- else
- return 0;
-
- return 1;
-}
-
-
/* Return the VAR_DECL for a const char array naming the current
function. If the VAR_DECL has not yet been created, create it
now. RID indicates how it should be formatted and IDENTIFIER_NODE
diff --git a/gcc/c-common.h b/gcc/c-common.h
index d6f8d05f6de..96c5fa071cb 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -800,12 +800,6 @@ extern void finish_file (void);
#define COMPOUND_LITERAL_EXPR_DECL(NODE) \
DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE))
-extern int anon_aggr_type_p (const_tree);
-
-/* For a VAR_DECL that is an anonymous union, these are the various
- sub-variables that make up the anonymous union. */
-#define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE))
-
/* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */
#define DECL_C_BIT_FIELD(NODE) \
(DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) == 1)
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5a60063c2bd..ae8861e2b85 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6978,15 +6978,6 @@ current_stmt_tree (void)
return &c_stmt_tree;
}
-/* Nonzero if TYPE is an anonymous union or struct type. Always 0 in
- C. */
-
-int
-anon_aggr_type_p (const_tree ARG_UNUSED (node))
-{
- return 0;
-}
-
/* Return the global value of T as a symbol. */
tree
diff --git a/gcc/c-objc-common.h b/gcc/c-objc-common.h
index 9c73fdd3c15..65445aef667 100644
--- a/gcc/c-objc-common.h
+++ b/gcc/c-objc-common.h
@@ -45,8 +45,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
-#undef LANG_HOOKS_EXPAND_DECL
-#define LANG_HOOKS_EXPAND_DECL c_expand_decl
#undef LANG_HOOKS_MARK_ADDRESSABLE
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
#undef LANG_HOOKS_PARSE_FILE
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index b7f3a17f1b6..43ef655495e 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1301,9 +1301,9 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
while (c_parser_next_token_is_not (parser, CPP_EOF)
&& c_parser_next_token_is_not (parser, CPP_OPEN_BRACE))
c_parser_declaration_or_fndef (parser, false, false, true, false);
- DECL_SOURCE_LOCATION (current_function_decl)
- = c_parser_peek_token (parser)->location;
store_parm_decls ();
+ DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus
+ = c_parser_peek_token (parser)->location;
fnbody = c_parser_compound_statement (parser);
if (nested)
{
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index ac228f9b79f..d9e9835643b 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2261,7 +2261,14 @@ gimple_expand_cfg (void)
insn_locators_alloc ();
if (!DECL_BUILT_IN (current_function_decl))
- set_curr_insn_source_location (DECL_SOURCE_LOCATION (current_function_decl));
+ {
+ /* Eventually, all FEs should explicitly set function_start_locus. */
+ if (cfun->function_start_locus == UNKNOWN_LOCATION)
+ set_curr_insn_source_location
+ (DECL_SOURCE_LOCATION (current_function_decl));
+ else
+ set_curr_insn_source_location (cfun->function_start_locus);
+ }
set_curr_insn_block (DECL_INITIAL (current_function_decl));
prologue_locator = curr_insn_locator ();
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index cc8b65cae7d..fb217bb167a 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -5683,7 +5683,7 @@ avr_reorg (void)
rtx t = XEXP (src,0);
PUT_CODE (t, swap_condition (GET_CODE (t)));
- SET_SRC (pattern) = gen_rtx_NEG (GET_MODE (SET_SRC (pattern)),
+ SET_SRC (pattern) = gen_rtx_COMPARE (GET_MODE (SET_SRC (pattern)), const0_rtx,
SET_SRC (pattern));
INSN_CODE (next) = -1;
INSN_CODE (insn) = -1;
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 371ca76c7dd..8dad9d8fe80 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -117,6 +117,9 @@
(const_int 2))]
(const_int 2)))
+;; Define mode iterator
+(define_mode_iterator QISI [(QI "") (HI "") (SI "")])
+
;;========================================================================
;; The following is used by nonlocal_goto and setjmp.
;; The receiver pattern will create no instructions since internally
@@ -2015,9 +2018,10 @@
[(set_attr "cc" "compare")
(set_attr "length" "1")])
-(define_insn "*negated_tstqi"
+(define_insn "*reversed_tstqi"
[(set (cc0)
- (neg:QI (match_operand:QI 0 "register_operand" "r")))]
+ (compare (const_int 0)
+ (match_operand:QI 0 "register_operand" "r")))]
""
"cp __zero_reg__,%0"
[(set_attr "cc" "compare")
@@ -2031,9 +2035,10 @@
[(set_attr "cc" "compare,compare")
(set_attr "length" "1,2")])
-(define_insn "*negated_tsthi"
+(define_insn "*reversed_tsthi"
[(set (cc0)
- (neg:HI (match_operand:HI 0 "register_operand" "r")))]
+ (compare (const_int 0)
+ (match_operand:HI 0 "register_operand" "r")))]
""
"cp __zero_reg__,%A0
cpc __zero_reg__,%B0"
@@ -2048,9 +2053,10 @@
[(set_attr "cc" "compare")
(set_attr "length" "4")])
-(define_insn "*negated_tstsi"
+(define_insn "*reversed_tstsi"
[(set (cc0)
- (neg:SI (match_operand:SI 0 "register_operand" "r")))]
+ (compare (const_int 0)
+ (match_operand:SI 0 "register_operand" "r")))]
""
"cp __zero_reg__,%A0
cpc __zero_reg__,%B0
@@ -2187,6 +2193,19 @@
[(set_attr "cc" "compare,compare,compare,compare,compare")
(set_attr "length" "4,4,7,5,8")])
+; Optimize negated tests into reverse compare if overflow is undefined.
+(define_insn_and_split "negated_tst<mode>"
+ [(set (cc0)
+ (neg:QISI (match_operand:QISI 0 "register_operand")))]
+
+ "(!flag_wrapv && !flag_trapv && flag_strict_overflow)"
+ "#"
+ ""
+ [(set (cc0)
+ (compare (const_int 0)
+ (match_dup 0)))]
+ "")
+
;; ----------------------------------------------------------------------
;; JUMP INSTRUCTIONS
;; ----------------------------------------------------------------------
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 8e0f355d176..7ff1379f2c9 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -3100,6 +3100,7 @@ bfin_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed)
/* Used for communication between {push,pop}_multiple_operation (which
we use not only as a predicate) and the corresponding output functions. */
static int first_preg_to_save, first_dreg_to_save;
+static int n_regs_to_save;
int
push_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
@@ -3168,6 +3169,7 @@ push_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
lastpreg++;
}
}
+ n_regs_to_save = 8 - first_dreg_to_save + 6 - first_preg_to_save;
return 1;
}
@@ -3227,6 +3229,7 @@ pop_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
}
first_dreg_to_save = lastdreg;
first_preg_to_save = lastpreg;
+ n_regs_to_save = 8 - first_dreg_to_save + 6 - first_preg_to_save;
return 1;
}
@@ -4631,6 +4634,85 @@ reorder_var_tracking_notes (void)
}
}
+/* On some silicon revisions, functions shorter than a certain number of cycles
+ can cause unpredictable behaviour. Work around this by adding NOPs as
+ needed. */
+static void
+workaround_rts_anomaly (void)
+{
+ rtx insn, first_insn = NULL_RTX;
+ int cycles = 4;
+
+ if (! ENABLE_WA_RETS)
+ return;
+
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ rtx pat;
+
+ if (BARRIER_P (insn))
+ return;
+
+ if (NOTE_P (insn) || LABEL_P (insn))
+ continue;
+
+ if (first_insn == NULL_RTX)
+ first_insn = insn;
+ pat = PATTERN (insn);
+ if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER
+ || GET_CODE (pat) == ASM_INPUT || GET_CODE (pat) == ADDR_VEC
+ || GET_CODE (pat) == ADDR_DIFF_VEC || asm_noperands (pat) >= 0)
+ continue;
+
+ if (CALL_P (insn))
+ return;
+
+ if (JUMP_P (insn))
+ {
+ if (recog_memoized (insn) == CODE_FOR_return_internal)
+ break;
+
+ /* Nothing to worry about for direct jumps. */
+ if (!any_condjump_p (insn))
+ return;
+ if (cycles <= 1)
+ return;
+ cycles--;
+ }
+ else if (INSN_P (insn))
+ {
+ rtx pat = PATTERN (insn);
+ int this_cycles = 1;
+
+ if (GET_CODE (pat) == PARALLEL)
+ {
+ if (push_multiple_operation (pat, VOIDmode)
+ || pop_multiple_operation (pat, VOIDmode))
+ this_cycles = n_regs_to_save;
+ }
+ else
+ {
+ enum insn_code icode = recog_memoized (insn);
+ if (icode == CODE_FOR_link)
+ this_cycles = 4;
+ else if (icode == CODE_FOR_unlink)
+ this_cycles = 3;
+ else if (icode == CODE_FOR_mulsi3)
+ this_cycles = 5;
+ }
+ if (this_cycles >= cycles)
+ return;
+
+ cycles -= this_cycles;
+ }
+ }
+ while (cycles > 0)
+ {
+ emit_insn_before (gen_nop (), first_insn);
+ cycles--;
+ }
+}
+
/* Return an insn type for INSN that can be used by the caller for anomaly
workarounds. This differs from plain get_attr_type in that it handles
SEQUENCEs. */
@@ -4711,58 +4793,13 @@ find_load (rtx insn)
return NULL_RTX;
}
-/* We use the machine specific reorg pass for emitting CSYNC instructions
- after conditional branches as needed.
-
- The Blackfin is unusual in that a code sequence like
- if cc jump label
- r0 = (p0)
- may speculatively perform the load even if the condition isn't true. This
- happens for a branch that is predicted not taken, because the pipeline
- isn't flushed or stalled, so the early stages of the following instructions,
- which perform the memory reference, are allowed to execute before the
- jump condition is evaluated.
- Therefore, we must insert additional instructions in all places where this
- could lead to incorrect behavior. The manual recommends CSYNC, while
- VDSP seems to use NOPs (even though its corresponding compiler option is
- named CSYNC).
-
- When optimizing for speed, we emit NOPs, which seems faster than a CSYNC.
- When optimizing for size, we turn the branch into a predicted taken one.
- This may be slower due to mispredicts, but saves code size. */
-
static void
-bfin_reorg (void)
+workaround_speculation (void)
{
rtx insn, next;
rtx last_condjump = NULL_RTX;
int cycles_since_jump = INT_MAX;
- /* We are freeing block_for_insn in the toplev to keep compatibility
- with old MDEP_REORGS that are not CFG based. Recompute it now. */
- compute_bb_for_insn ();
-
- if (bfin_flag_schedule_insns2)
- {
- splitting_for_sched = 1;
- split_all_insns ();
- splitting_for_sched = 0;
-
- timevar_push (TV_SCHED2);
- schedule_insns ();
- timevar_pop (TV_SCHED2);
-
- /* Examine the schedule and insert nops as necessary for 64-bit parallel
- instructions. */
- bfin_gen_bundles ();
- }
-
- df_analyze ();
-
- /* Doloop optimization */
- if (cfun->machine->has_hardware_loops)
- bfin_reorg_loops (dump_file);
-
if (! ENABLE_WA_SPECULATIVE_LOADS && ! ENABLE_WA_SPECULATIVE_SYNCS)
return;
@@ -4841,11 +4878,9 @@ bfin_reorg (void)
if (! ENABLE_WA_SPECULATIVE_SYNCS)
return;
- if (! ENABLE_WA_RETS)
- return;
-
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
+ int cycles_since_jump;
if (JUMP_P (insn)
&& any_condjump_p (insn)
&& (INSN_CODE (insn) == CODE_FOR_cbranch_predicted_taken
@@ -4907,6 +4942,57 @@ bfin_reorg (void)
}
}
}
+}
+
+/* We use the machine specific reorg pass for emitting CSYNC instructions
+ after conditional branches as needed.
+
+ The Blackfin is unusual in that a code sequence like
+ if cc jump label
+ r0 = (p0)
+ may speculatively perform the load even if the condition isn't true. This
+ happens for a branch that is predicted not taken, because the pipeline
+ isn't flushed or stalled, so the early stages of the following instructions,
+ which perform the memory reference, are allowed to execute before the
+ jump condition is evaluated.
+ Therefore, we must insert additional instructions in all places where this
+ could lead to incorrect behavior. The manual recommends CSYNC, while
+ VDSP seems to use NOPs (even though its corresponding compiler option is
+ named CSYNC).
+
+ When optimizing for speed, we emit NOPs, which seems faster than a CSYNC.
+ When optimizing for size, we turn the branch into a predicted taken one.
+ This may be slower due to mispredicts, but saves code size. */
+
+static void
+bfin_reorg (void)
+{
+ /* We are freeing block_for_insn in the toplev to keep compatibility
+ with old MDEP_REORGS that are not CFG based. Recompute it now. */
+ compute_bb_for_insn ();
+
+ if (bfin_flag_schedule_insns2)
+ {
+ splitting_for_sched = 1;
+ split_all_insns ();
+ splitting_for_sched = 0;
+
+ timevar_push (TV_SCHED2);
+ schedule_insns ();
+ timevar_pop (TV_SCHED2);
+
+ /* Examine the schedule and insert nops as necessary for 64-bit parallel
+ instructions. */
+ bfin_gen_bundles ();
+ }
+
+ df_analyze ();
+
+ /* Doloop optimization */
+ if (cfun->machine->has_hardware_loops)
+ bfin_reorg_loops (dump_file);
+
+ workaround_speculation ();
if (bfin_flag_var_tracking)
{
@@ -4915,7 +5001,10 @@ bfin_reorg (void)
reorder_var_tracking_notes ();
timevar_pop (TV_VAR_TRACKING);
}
+
df_finish_pass (false);
+
+ workaround_rts_anomaly ();
}
/* Handle interrupt_handler, exception_handler and nmi_handler function
diff --git a/gcc/config/crx/crx.h b/gcc/config/crx/crx.h
index 91c5f31d1e1..505c96fd71d 100644
--- a/gcc/config/crx/crx.h
+++ b/gcc/config/crx/crx.h
@@ -182,6 +182,19 @@ enum reg_class
#define N_REG_CLASSES (int) LIM_REG_CLASSES
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, LIM_REG_CLASSES \
+}
+
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 4edbb2f6ba2..bc451694cf3 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -354,6 +354,19 @@ enum reg_class {
{ "NO_REGS", "COUNTER_REGS", "SOURCE_REGS", "DESTINATION_REGS", \
"GENERAL_REGS", "MAC_REGS", "ALL_REGS", "LIM_REGS" }
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, MAC_REGS, LIM_REG_CLASSES \
+}
+
/* Define which registers fit in which classes.
This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index b08d56c944d..1d21cd9c043 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -1,6 +1,6 @@
/* Target definitions for GCC for Intel 80386 running Solaris 2
Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2007 Free Software Foundation, Inc.
+ 2004, 2007, 2008 Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com).
This file is part of GCC.
@@ -96,6 +96,9 @@ along with GCC; see the file COPYING3. If not see
#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
+/* Register the Solaris-specific #pragma directives. */
+#define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
+
/* Output a simple call for .init/.fini. */
#define ASM_OUTPUT_CALL(FILE, FN) \
do \
diff --git a/gcc/config/pa/linux-atomic.c b/gcc/config/pa/linux-atomic.c
new file mode 100644
index 00000000000..23f5f736c65
--- /dev/null
+++ b/gcc/config/pa/linux-atomic.c
@@ -0,0 +1,300 @@
+/* Linux-specific atomic operations for PA Linux.
+ Copyright (C) 2008 Free Software Foundation, Inc.
+ Based on code contributed by CodeSourcery for ARM EABI Linux.
+ Modifications for PA Linux by Helge Deller <deller@gmx.de>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+#include <errno.h>
+
+/* All PA-RISC implementations supported by linux have strongly
+ ordered loads and stores. Only cache flushes and purges can be
+ delayed. The data cache implementations are all globally
+ coherent. Thus, there is no need to synchonize memory accesses.
+
+ GCC automatically issues a asm memory barrier when it encounters
+ a __sync_synchronize builtin. Thus, we do not need to define this
+ builtin.
+
+ We implement byte, short and int versions of each atomic operation
+ using the kernel helper defined below. There is no support for
+ 64-bit operations yet. */
+
+/* A privileged instruction to crash a userspace program with SIGILL. */
+#define ABORT_INSTRUCTION asm ("iitlbp %r0,(%sr0, %r0)")
+
+/* Determine kernel LWS function call (0=32-bit, 1=64-bit userspace). */
+#define LWS_CAS (sizeof(unsigned long) == 4 ? 0 : 1)
+
+/* Kernel helper for compare-and-exchange a 32-bit value. */
+static inline long
+__kernel_cmpxchg (int oldval, int newval, int *mem)
+{
+ register unsigned long lws_mem asm("r26") = (unsigned long) (mem);
+ register long lws_ret asm("r28");
+ register long lws_errno asm("r21");
+ register int lws_old asm("r25") = oldval;
+ register int lws_new asm("r24") = newval;
+ asm volatile ( "ble 0xb0(%%sr2, %%r0) \n\t"
+ "ldi %5, %%r20 \n\t"
+ : "=r" (lws_ret), "=r" (lws_errno), "=r" (lws_mem),
+ "=r" (lws_old), "=r" (lws_new)
+ : "i" (LWS_CAS), "2" (lws_mem), "3" (lws_old), "4" (lws_new)
+ : "r1", "r20", "r22", "r23", "r29", "r31", "memory"
+ );
+ if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0))
+ ABORT_INSTRUCTION;
+ return lws_errno;
+}
+
+#define HIDDEN __attribute__ ((visibility ("hidden")))
+
+/* Big endian masks */
+#define INVERT_MASK_1 24
+#define INVERT_MASK_2 16
+
+#define MASK_1 0xffu
+#define MASK_2 0xffffu
+
+#define FETCH_AND_OP_WORD(OP, PFX_OP, INF_OP) \
+ int HIDDEN \
+ __sync_fetch_and_##OP##_4 (int *ptr, int val) \
+ { \
+ int failure, tmp; \
+ \
+ do { \
+ tmp = *ptr; \
+ failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \
+ } while (failure != 0); \
+ \
+ return tmp; \
+ }
+
+FETCH_AND_OP_WORD (add, , +)
+FETCH_AND_OP_WORD (sub, , -)
+FETCH_AND_OP_WORD (or, , |)
+FETCH_AND_OP_WORD (and, , &)
+FETCH_AND_OP_WORD (xor, , ^)
+FETCH_AND_OP_WORD (nand, ~, &)
+
+#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH
+#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH
+
+/* Implement both __sync_<op>_and_fetch and __sync_fetch_and_<op> for
+ subword-sized quantities. */
+
+#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \
+ TYPE HIDDEN \
+ NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE val) \
+ { \
+ int *wordptr = (int *) ((unsigned long) ptr & ~3); \
+ unsigned int mask, shift, oldval, newval; \
+ int failure; \
+ \
+ shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
+ mask = MASK_##WIDTH << shift; \
+ \
+ do { \
+ oldval = *wordptr; \
+ newval = ((PFX_OP ((oldval & mask) >> shift) \
+ INF_OP (unsigned int) val) << shift) & mask; \
+ newval |= oldval & ~mask; \
+ failure = __kernel_cmpxchg (oldval, newval, wordptr); \
+ } while (failure != 0); \
+ \
+ return (RETURN & mask) >> shift; \
+ }
+
+SUBWORD_SYNC_OP (add, , +, short, 2, oldval)
+SUBWORD_SYNC_OP (sub, , -, short, 2, oldval)
+SUBWORD_SYNC_OP (or, , |, short, 2, oldval)
+SUBWORD_SYNC_OP (and, , &, short, 2, oldval)
+SUBWORD_SYNC_OP (xor, , ^, short, 2, oldval)
+SUBWORD_SYNC_OP (nand, ~, &, short, 2, oldval)
+
+SUBWORD_SYNC_OP (add, , +, char, 1, oldval)
+SUBWORD_SYNC_OP (sub, , -, char, 1, oldval)
+SUBWORD_SYNC_OP (or, , |, char, 1, oldval)
+SUBWORD_SYNC_OP (and, , &, char, 1, oldval)
+SUBWORD_SYNC_OP (xor, , ^, char, 1, oldval)
+SUBWORD_SYNC_OP (nand, ~, &, char, 1, oldval)
+
+#define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \
+ int HIDDEN \
+ __sync_##OP##_and_fetch_4 (int *ptr, int val) \
+ { \
+ int tmp, failure; \
+ \
+ do { \
+ tmp = *ptr; \
+ failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \
+ } while (failure != 0); \
+ \
+ return PFX_OP tmp INF_OP val; \
+ }
+
+OP_AND_FETCH_WORD (add, , +)
+OP_AND_FETCH_WORD (sub, , -)
+OP_AND_FETCH_WORD (or, , |)
+OP_AND_FETCH_WORD (and, , &)
+OP_AND_FETCH_WORD (xor, , ^)
+OP_AND_FETCH_WORD (nand, ~, &)
+
+SUBWORD_SYNC_OP (add, , +, short, 2, newval)
+SUBWORD_SYNC_OP (sub, , -, short, 2, newval)
+SUBWORD_SYNC_OP (or, , |, short, 2, newval)
+SUBWORD_SYNC_OP (and, , &, short, 2, newval)
+SUBWORD_SYNC_OP (xor, , ^, short, 2, newval)
+SUBWORD_SYNC_OP (nand, ~, &, short, 2, newval)
+
+SUBWORD_SYNC_OP (add, , +, char, 1, newval)
+SUBWORD_SYNC_OP (sub, , -, char, 1, newval)
+SUBWORD_SYNC_OP (or, , |, char, 1, newval)
+SUBWORD_SYNC_OP (and, , &, char, 1, newval)
+SUBWORD_SYNC_OP (xor, , ^, char, 1, newval)
+SUBWORD_SYNC_OP (nand, ~, &, char, 1, newval)
+
+int HIDDEN
+__sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
+{
+ int actual_oldval, fail;
+
+ while (1)
+ {
+ actual_oldval = *ptr;
+
+ if (oldval != actual_oldval)
+ return actual_oldval;
+
+ fail = __kernel_cmpxchg (actual_oldval, newval, ptr);
+
+ if (!fail)
+ return oldval;
+ }
+}
+
+#define SUBWORD_VAL_CAS(TYPE, WIDTH) \
+ TYPE HIDDEN \
+ __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
+ TYPE newval) \
+ { \
+ int *wordptr = (int *)((unsigned long) ptr & ~3), fail; \
+ unsigned int mask, shift, actual_oldval, actual_newval; \
+ \
+ shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
+ mask = MASK_##WIDTH << shift; \
+ \
+ while (1) \
+ { \
+ actual_oldval = *wordptr; \
+ \
+ if (((actual_oldval & mask) >> shift) != (unsigned int) oldval) \
+ return (actual_oldval & mask) >> shift; \
+ \
+ actual_newval = (actual_oldval & ~mask) \
+ | (((unsigned int) newval << shift) & mask); \
+ \
+ fail = __kernel_cmpxchg (actual_oldval, actual_newval, \
+ wordptr); \
+ \
+ if (!fail) \
+ return oldval; \
+ } \
+ }
+
+SUBWORD_VAL_CAS (short, 2)
+SUBWORD_VAL_CAS (char, 1)
+
+typedef unsigned char bool;
+
+bool HIDDEN
+__sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
+{
+ int failure = __kernel_cmpxchg (oldval, newval, ptr);
+ return (failure == 0);
+}
+
+#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \
+ bool HIDDEN \
+ __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
+ TYPE newval) \
+ { \
+ TYPE actual_oldval \
+ = __sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval); \
+ return (oldval == actual_oldval); \
+ }
+
+SUBWORD_BOOL_CAS (short, 2)
+SUBWORD_BOOL_CAS (char, 1)
+
+int HIDDEN
+__sync_lock_test_and_set_4 (int *ptr, int val)
+{
+ int failure, oldval;
+
+ do {
+ oldval = *ptr;
+ failure = __kernel_cmpxchg (oldval, val, ptr);
+ } while (failure != 0);
+
+ return oldval;
+}
+
+#define SUBWORD_TEST_AND_SET(TYPE, WIDTH) \
+ TYPE HIDDEN \
+ __sync_lock_test_and_set_##WIDTH (TYPE *ptr, TYPE val) \
+ { \
+ int failure; \
+ unsigned int oldval, newval, shift, mask; \
+ int *wordptr = (int *) ((unsigned long) ptr & ~3); \
+ \
+ shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
+ mask = MASK_##WIDTH << shift; \
+ \
+ do { \
+ oldval = *wordptr; \
+ newval = (oldval & ~mask) \
+ | (((unsigned int) val << shift) & mask); \
+ failure = __kernel_cmpxchg (oldval, newval, wordptr); \
+ } while (failure != 0); \
+ \
+ return (oldval & mask) >> shift; \
+ }
+
+SUBWORD_TEST_AND_SET (short, 2)
+SUBWORD_TEST_AND_SET (char, 1)
+
+#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \
+ void HIDDEN \
+ __sync_lock_release_##WIDTH (TYPE *ptr) \
+ { \
+ *ptr = 0; \
+ }
+
+SYNC_LOCK_RELEASE (int, 4)
+SYNC_LOCK_RELEASE (short, 2)
+SYNC_LOCK_RELEASE (char, 1)
diff --git a/gcc/config/pa/pa-hpux.h b/gcc/config/pa/pa-hpux.h
index cd85cdc2d27..7dc7f4034f3 100644
--- a/gcc/config/pa/pa-hpux.h
+++ b/gcc/config/pa/pa-hpux.h
@@ -97,10 +97,12 @@ along with GCC; see the file COPYING3. If not see
#undef LINK_SPEC
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
#define LINK_SPEC \
- "%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
+ "%<fwhole-program\
+ %{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
#else
#define LINK_SPEC \
- "%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
+ "%<fwhole-program\
+ %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
#endif
/* hpux8 and later have C++ compatible include files, so do not
diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h
index a05a5f12b13..13143aa2c14 100644
--- a/gcc/config/pa/pa-hpux10.h
+++ b/gcc/config/pa/pa-hpux10.h
@@ -84,7 +84,8 @@ along with GCC; see the file COPYING3. If not see
#undef LINK_SPEC
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
#define LINK_SPEC \
- "%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
+ "%<fwhole-program\
+ %{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
%{!shared:%{p:-L/lib/libp %{!static:\
%nWarning: consider linking with `-static' as system libraries with\n\
%n profiling support are only provided in archive format}}}\
@@ -95,7 +96,8 @@ along with GCC; see the file COPYING3. If not see
%{static:-a archive} %{shared:-b}"
#else
#define LINK_SPEC \
- "%{!shared:%{p:-L/lib/libp %{!static:\
+ "%<fwhole-program\
+ %{!shared:%{p:-L/lib/libp %{!static:\
%nWarning: consider linking with `-static' as system libraries with\n\
%n profiling support are only provided in archive format}}}\
%{!shared:%{pg:-L/lib/libp %{!static:\
diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h
index 8d4a807cbe3..b45109df6fc 100644
--- a/gcc/config/pa/pa-hpux11.h
+++ b/gcc/config/pa/pa-hpux11.h
@@ -106,7 +106,8 @@ along with GCC; see the file COPYING3. If not see
want dereferencing of a NULL pointer to cause a SEGV. */
#undef LINK_SPEC
#define LINK_SPEC \
- "%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
+ "%<fwhole-program\
+ %{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
%nWarning: consider linking with `-static' as system libraries with\n\
%n profiling support are only provided in archive format}}}\
%{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
diff --git a/gcc/config/pa/pa32-regs.h b/gcc/config/pa/pa32-regs.h
index 89cbb9b7552..4463c631d38 100644
--- a/gcc/config/pa/pa32-regs.h
+++ b/gcc/config/pa/pa32-regs.h
@@ -287,6 +287,19 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS,
{0x00000000, 0x00000000, 0x01000000}, /* SHIFT_REGS */ \
{0xfffffffe, 0xffffffff, 0x01ffffff}} /* ALL_REGS */
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FP_REGS, SHIFT_REGS, LIM_REG_CLASSES \
+}
+
/* Defines invalid mode changes. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
diff --git a/gcc/config/pa/pa64-regs.h b/gcc/config/pa/pa64-regs.h
index 828265f23b8..ec865606d5f 100644
--- a/gcc/config/pa/pa64-regs.h
+++ b/gcc/config/pa/pa64-regs.h
@@ -235,12 +235,25 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS,
{{0x00000000, 0x00000000}, /* NO_REGS */ \
{0x00000002, 0x00000000}, /* R1_REGS */ \
{0xfffffffe, 0x00000000}, /* GENERAL_REGS */ \
- {0x00000000, 0x00000000}, /* FPUPPER_REGS */ \
+ {0x00000000, 0x00000000}, /* FPUPPER_REGS */ \
{0x00000000, 0x0fffffff}, /* FP_REGS */ \
{0xfffffffe, 0x0fffffff}, /* GENERAL_OR_FP_REGS */ \
{0x00000000, 0x10000000}, /* SHIFT_REGS */ \
{0xfffffffe, 0x1fffffff}} /* ALL_REGS */
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FP_REGS, SHIFT_REGS, LIM_REG_CLASSES \
+}
+
/* Defines invalid mode changes. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
diff --git a/gcc/config/pa/t-linux b/gcc/config/pa/t-linux
index 561bc009dfe..4b56debac55 100644
--- a/gcc/config/pa/t-linux
+++ b/gcc/config/pa/t-linux
@@ -9,6 +9,7 @@ LIB1ASMSRC = pa/milli64.S
TARGET_LIBGCC2_CFLAGS = -fPIC -DELF=1 -DLINUX=1
LIB2FUNCS_EXTRA=fptr.c
+LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/pa/linux-atomic.c
fptr.c: $(srcdir)/config/pa/fptr.c
rm -f fptr.c
diff --git a/gcc/config/pa/t-linux64 b/gcc/config/pa/t-linux64
index e376d22538e..48d45168cbd 100644
--- a/gcc/config/pa/t-linux64
+++ b/gcc/config/pa/t-linux64
@@ -8,5 +8,7 @@ LIB1ASMSRC = pa/milli64.S
# Actually, hppa64 is always PIC but adding -fPIC does no harm.
CRTSTUFF_T_CFLAGS_S = -fPIC
+LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/pa/linux-atomic.c
+
# Compile libgcc2.a as PIC.
TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index e8028edf067..5edd248b722 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -647,6 +647,28 @@
DONE;
}")
+(define_expand "mulv8hi3"
+ [(use (match_operand:V8HI 0 "register_operand" ""))
+ (use (match_operand:V8HI 1 "register_operand" ""))
+ (use (match_operand:V8HI 2 "register_operand" ""))]
+ "TARGET_ALTIVEC"
+ "
+{
+ rtx odd = gen_reg_rtx (V4SImode);
+ rtx even = gen_reg_rtx (V4SImode);
+ rtx high = gen_reg_rtx (V4SImode);
+ rtx low = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_altivec_vmulesh (even, operands[1], operands[2]));
+ emit_insn (gen_altivec_vmulosh (odd, operands[1], operands[2]));
+
+ emit_insn (gen_altivec_vmrghw (high, even, odd));
+ emit_insn (gen_altivec_vmrglw (low, even, odd));
+
+ emit_insn (gen_altivec_vpkuwum (operands[0], high, low));
+
+ DONE;
+}")
;; Fused multiply subtract
(define_insn "altivec_vnmsubfp"
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 512d0ff17f5..a8f5514f68c 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -1,6 +1,6 @@
/* Operating system specific defines to be used when targeting GCC for any
Solaris 2 system.
- Copyright 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -233,9 +233,6 @@ __enable_execute_stack (void *addr) \
} \
while (0)
-/* Register the Solaris-specific #pragma directives. */
-#define REGISTER_TARGET_PRAGMAS() solaris_register_pragmas ()
-
extern GTY(()) tree solaris_pending_aligns;
extern GTY(()) tree solaris_pending_inits;
extern GTY(()) tree solaris_pending_finis;
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 1890ce9b1d6..8e760b8e928 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GCC, for SPARC running Solaris 2
Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@netcom.com).
Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
@@ -167,6 +167,9 @@ along with GCC; see the file COPYING3. If not see
#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
+/* Register the Solaris-specific #pragma directives. */
+#define REGISTER_TARGET_PRAGMAS() solaris_register_pragmas ()
+
/* Output a simple call for .init/.fini. */
#define ASM_OUTPUT_CALL(FILE, FN) \
do \
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index 79b47e64990..504a748f496 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -1563,7 +1563,7 @@
(define_insn "return"
[(return)]
- "reload_completed"
+ "reload_completed && compute_frame_size (get_frame_size (), (long *)0) == 0"
"jmp [r31]"
[(set_attr "length" "2")
(set_attr "cc" "none")])
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cb5c31402e8..633161543f9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,33 @@
+2008-09-09 Paolo Bonzini <bonzini@gnu.org>
+
+ * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
+ * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
+ * semantics.c (anon_aggr_type_p): Remove.
+
+2008-09-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/37302
+ * parser.c (cp_parser_parameter_declaration_list): Process the
+ PARM_DECLs as we go and push them. Return a TREE_LIST.
+ (cp_parser_parameter_declaration_clause): Return a TREE_LIST.
+ (cp_parser_direct_declarator): Create a binding level and
+ suppress deprecated warnings in the parameter list.
+ (make_call_declarator): PARMS is now a tree.
+ * cp-tree.h (struct cp_declarator): Function parms are now a tree.
+ * decl.h (enum deprecated_states, deprecated_state): Move here.
+ * decl.c: From here.
+ (type_is_deprecated): New fn.
+ (grokparms): PARMLIST is a tree now. Warn about parms that
+ use deprecated types.
+ * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and
+ 0-operand cast.
+ * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation.
+ (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a
+ function.
+ * name-lookup.c (pushtag): Look through function parameter scopes.
+ (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL
+ when we're parsing a function declarator.
+
2008-09-05 Douglas Gregor <doug.gregor@gmail.com>
PR c++/37342
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index a7d4f89e8c9..db78f948b2d 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -52,8 +52,6 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
-#undef LANG_HOOKS_EXPAND_DECL
-#define LANG_HOOKS_EXPAND_DECL c_expand_decl
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_STATICP
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index ca069b765cf..a39e9da6975 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -175,9 +175,6 @@ framework extensions, you must include this file before toplev.h, not after.
to which the vptr should be initialized. Use get_vtbl_decl_for_binfo
to extract the VAR_DECL for the complete vtable.
- DECL_ARGUMENTS
- For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
-
DECL_VINDEX
This field is NULL for a non-virtual function. For a virtual
function, it is eventually set to an INTEGER_CST indicating the
@@ -4108,8 +4105,8 @@ struct cp_declarator {
} id;
/* For functions. */
struct {
- /* The parameters to the function. */
- cp_parameter_declarator *parameters;
+ /* The parameters to the function as a TREE_LIST of decl/default. */
+ tree parameters;
/* The cv-qualifiers for the function. */
cp_cv_quals qualifiers;
/* The exception-specification for the function. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c045353fe7f..3348d28425c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -54,7 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "pointer-set.h"
-static tree grokparms (cp_parameter_declarator *, tree *);
+static tree grokparms (tree parmlist, tree *);
static const char *redeclaration_error_message (tree, tree);
static int decl_jump_unsafe (tree);
@@ -236,13 +236,7 @@ VEC(tree, gc) *deferred_mark_used_calls;
with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other
deprecated items. */
-
-enum deprecated_states {
- DEPRECATED_NORMAL,
- DEPRECATED_SUPPRESS
-};
-
-static enum deprecated_states deprecated_state = DEPRECATED_NORMAL;
+enum deprecated_states deprecated_state = DEPRECATED_NORMAL;
/* A TREE_LIST of VAR_DECLs. The TREE_PURPOSE is a RECORD_TYPE or
@@ -9494,6 +9488,32 @@ check_default_argument (tree decl, tree arg)
return arg;
}
+/* Returns a deprecated type used within TYPE, or NULL_TREE if none. */
+
+static tree
+type_is_deprecated (tree type)
+{
+ enum tree_code code;
+ if (TREE_DEPRECATED (type))
+ return type;
+ if (TYPE_NAME (type)
+ && TREE_DEPRECATED (TYPE_NAME (type)))
+ return type;
+
+ code = TREE_CODE (type);
+
+ if (code == POINTER_TYPE || code == REFERENCE_TYPE
+ || code == OFFSET_TYPE || code == FUNCTION_TYPE
+ || code == METHOD_TYPE || code == ARRAY_TYPE)
+ return type_is_deprecated (TREE_TYPE (type));
+
+ if (TYPE_PTRMEMFUNC_P (type))
+ return type_is_deprecated
+ (TREE_TYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type))));
+
+ return NULL_TREE;
+}
+
/* Decode the list of parameter types for a function type.
Given the list of things declared inside the parens,
return a list of types.
@@ -9504,41 +9524,31 @@ check_default_argument (tree decl, tree arg)
*PARMS is set to the chain of PARM_DECLs created. */
static tree
-grokparms (cp_parameter_declarator *first_parm, tree *parms)
+grokparms (tree parmlist, tree *parms)
{
tree result = NULL_TREE;
tree decls = NULL_TREE;
- int ellipsis = !first_parm || first_parm->ellipsis_p;
- cp_parameter_declarator *parm;
+ tree parm;
int any_error = 0;
- struct pointer_set_t *unique_decls = pointer_set_create ();
- for (parm = first_parm; parm != NULL; parm = parm->next)
+ for (parm = parmlist; parm != NULL_TREE; parm = TREE_CHAIN (parm))
{
tree type = NULL_TREE;
- tree init = parm->default_argument;
- tree attrs;
- tree decl;
+ tree init = TREE_PURPOSE (parm);
+ tree decl = TREE_VALUE (parm);
- if (parm == no_parameters)
+ if (parm == void_list_node)
break;
- attrs = parm->decl_specifiers.attributes;
- parm->decl_specifiers.attributes = NULL_TREE;
- decl = grokdeclarator (parm->declarator, &parm->decl_specifiers,
- PARM, init != NULL_TREE, &attrs);
if (! decl || TREE_TYPE (decl) == error_mark_node)
continue;
- if (attrs)
- cplus_decl_attributes (&decl, attrs, 0);
-
type = TREE_TYPE (decl);
if (VOID_TYPE_P (type))
{
if (same_type_p (type, void_type_node)
&& DECL_SELF_REFERENCE_P (type)
- && !DECL_NAME (decl) && !result && !parm->next && !ellipsis)
+ && !DECL_NAME (decl) && !result && TREE_CHAIN (parm) == void_list_node)
/* this is a parmlist of `(void)', which is ok. */
break;
cxx_incomplete_type_error (decl, type);
@@ -9561,6 +9571,13 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms)
if (type != error_mark_node)
{
+ if (deprecated_state != DEPRECATED_SUPPRESS)
+ {
+ tree deptype = type_is_deprecated (type);
+ if (deptype)
+ warn_deprecated_use (deptype);
+ }
+
/* Top-level qualifiers on the parameters are
ignored for function types. */
type = cp_build_qualified_type (type, 0);
@@ -9603,28 +9620,20 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms)
if (TREE_CODE (decl) == PARM_DECL
&& FUNCTION_PARAMETER_PACK_P (decl)
- && parm->next)
+ && TREE_CHAIN (parm)
+ && TREE_CHAIN (parm) != void_list_node)
error ("parameter packs must be at the end of the parameter list");
- if (DECL_NAME (decl))
- {
- if (pointer_set_contains (unique_decls, DECL_NAME (decl)))
- error ("multiple parameters named %qE", DECL_NAME (decl));
- else
- pointer_set_insert (unique_decls, DECL_NAME (decl));
- }
-
TREE_CHAIN (decl) = decls;
decls = decl;
result = tree_cons (init, type, result);
}
decls = nreverse (decls);
result = nreverse (result);
- if (!ellipsis)
+ if (parm)
result = chainon (result, void_list_node);
*parms = decls;
- pointer_set_destroy (unique_decls);
return result;
}
diff --git a/gcc/cp/decl.h b/gcc/cp/decl.h
index 52ab0fbaef5..ed287149d87 100644
--- a/gcc/cp/decl.h
+++ b/gcc/cp/decl.h
@@ -34,3 +34,16 @@ enum decl_context
extern tree grokdeclarator (const cp_declarator *,
const cp_decl_specifier_seq *,
enum decl_context, int, tree*);
+
+/* States indicating how grokdeclarator() should handle declspecs marked
+ with __attribute__((deprecated)). An object declared as
+ __attribute__((deprecated)) suppresses warnings of uses of other
+ deprecated items. */
+
+enum deprecated_states {
+ DEPRECATED_NORMAL,
+ DEPRECATED_SUPPRESS
+};
+
+extern enum deprecated_states deprecated_state;
+
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index dea92b9c9ea..7b4c30344cc 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2016,7 +2016,8 @@ write_template_args (tree args)
<expr-primary> ::= <template-param>
::= L <type> <value number> E # literal
::= L <mangled-name> E # external name
- ::= sr <type> <unqualified-name>
+ ::= st <type> # sizeof
+ ::= sr <type> <unqualified-name> # dependent name
::= sr <type> <unqualified-name> <template-args> */
static void
@@ -2042,6 +2043,12 @@ write_expression (tree expr)
code = TREE_CODE (expr);
}
+ if (code == OVERLOAD)
+ {
+ expr = OVL_FUNCTION (expr);
+ code = TREE_CODE (expr);
+ }
+
/* Handle pointers-to-members by making them look like expression
nodes. */
if (code == PTRMEM_CST)
@@ -2064,6 +2071,13 @@ write_expression (tree expr)
else if (TREE_CODE_CLASS (code) == tcc_constant
|| (abi_version_at_least (2) && code == CONST_DECL))
write_template_arg_literal (expr);
+ else if (code == PARM_DECL)
+ {
+ /* A function parameter used under decltype in a late-specified
+ return type. Represented with a type placeholder. */
+ write_string ("sT");
+ write_type (non_reference (TREE_TYPE (expr)));
+ }
else if (DECL_P (expr))
{
/* G++ 3.2 incorrectly mangled non-type template arguments of
@@ -2175,16 +2189,17 @@ write_expression (tree expr)
switch (code)
{
case CALL_EXPR:
- sorry ("call_expr cannot be mangled due to a defect in the C++ ABI");
+ write_expression (CALL_EXPR_FN (expr));
+ for (i = 0; i < call_expr_nargs (expr); ++i)
+ write_expression (CALL_EXPR_ARG (expr, i));
+ write_char ('E');
break;
case CAST_EXPR:
write_type (TREE_TYPE (expr));
- /* There is no way to mangle a zero-operand cast like
- "T()". */
if (!TREE_OPERAND (expr, 0))
- sorry ("zero-operand casts cannot be mangled due to a defect "
- "in the C++ ABI");
+ /* "T()" is mangled as "T(void)". */
+ write_char ('v');
else
write_expression (TREE_VALUE (TREE_OPERAND (expr, 0)));
break;
@@ -2195,7 +2210,6 @@ write_expression (tree expr)
write_expression (TREE_OPERAND (expr, 0));
break;
-
/* Handle pointers-to-members specially. */
case SCOPE_REF:
write_type (TREE_OPERAND (expr, 0));
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 7fc6a9341ae..743f02365ee 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -604,6 +604,13 @@ pushdecl_maybe_friend (tree x, bool is_friend)
scope of the current namespace, not the current
function. */
&& !(TREE_CODE (x) == VAR_DECL && DECL_EXTERNAL (x))
+ /* When parsing the parameter list of a function declarator,
+ don't set DECL_CONTEXT to an enclosing function. When we
+ push the PARM_DECLs in order to process the function body,
+ current_binding_level->this_entity will be set. */
+ && !(TREE_CODE (x) == PARM_DECL
+ && current_binding_level->kind == sk_function_parms
+ && current_binding_level->this_entity == NULL)
&& !DECL_CONTEXT (x))
DECL_CONTEXT (x) = current_function_decl;
@@ -712,8 +719,6 @@ pushdecl_maybe_friend (tree x, bool is_friend)
}
else if (TREE_CODE (t) == PARM_DECL)
{
- gcc_assert (DECL_CONTEXT (t));
-
/* Check for duplicate params. */
if (duplicate_decls (x, t, is_friend))
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
@@ -4987,6 +4992,8 @@ pushtag (tree name, tree type, tag_scope scope)
while (/* Cleanup scopes are not scopes from the point of view of
the language. */
b->kind == sk_cleanup
+ /* Neither are function parameter scopes. */
+ || b->kind == sk_function_parms
/* Neither are the scopes used to hold template parameters
for an explicit specialization. For an ordinary template
declaration, these scopes are not scopes from the point of
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 3f6e3701127..88f92e7ccc4 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -853,7 +853,7 @@ clear_decl_specs (cp_decl_specifier_seq *decl_specs)
VAR_DECLs or FUNCTION_DECLs) should do that directly. */
static cp_declarator *make_call_declarator
- (cp_declarator *, cp_parameter_declarator *, cp_cv_quals, tree, tree);
+ (cp_declarator *, tree, cp_cv_quals, tree, tree);
static cp_declarator *make_array_declarator
(cp_declarator *, tree);
static cp_declarator *make_pointer_declarator
@@ -1013,7 +1013,7 @@ make_ptrmem_declarator (cp_cv_quals cv_qualifiers, tree class_type,
cp_declarator *
make_call_declarator (cp_declarator *target,
- cp_parameter_declarator *parms,
+ tree parms,
cp_cv_quals cv_qualifiers,
tree exception_specification,
tree late_return_type)
@@ -1736,9 +1736,9 @@ static tree cp_parser_type_id
(cp_parser *);
static void cp_parser_type_specifier_seq
(cp_parser *, bool, cp_decl_specifier_seq *);
-static cp_parameter_declarator *cp_parser_parameter_declaration_clause
+static tree cp_parser_parameter_declaration_clause
(cp_parser *);
-static cp_parameter_declarator *cp_parser_parameter_declaration_list
+static tree cp_parser_parameter_declaration_list
(cp_parser *, bool *);
static cp_parameter_declarator *cp_parser_parameter_declaration
(cp_parser *, bool, bool *);
@@ -12986,8 +12986,10 @@ cp_parser_direct_declarator (cp_parser* parser,
if (!first || dcl_kind != CP_PARSER_DECLARATOR_NAMED)
{
- cp_parameter_declarator *params;
+ tree params;
unsigned saved_num_template_parameter_lists;
+ bool is_declarator = false;
+ tree t;
/* In a member-declarator, the only valid interpretation
of a parenthesis is the start of a
@@ -13014,6 +13016,8 @@ cp_parser_direct_declarator (cp_parser* parser,
= parser->num_template_parameter_lists;
parser->num_template_parameter_lists = 0;
+ begin_scope (sk_function_parms, NULL_TREE);
+
/* Parse the parameter-declaration-clause. */
params = cp_parser_parameter_declaration_clause (parser);
@@ -13028,6 +13032,8 @@ cp_parser_direct_declarator (cp_parser* parser,
tree exception_specification;
tree late_return;
+ is_declarator = true;
+
if (ctor_dtor_or_conv_p)
*ctor_dtor_or_conv_p = *ctor_dtor_or_conv_p < 0;
first = false;
@@ -13053,10 +13059,16 @@ cp_parser_direct_declarator (cp_parser* parser,
return type, so are not those of the declared
function. */
parser->default_arg_ok_p = false;
-
- /* Repeat the main loop. */
- continue;
}
+
+ /* Remove the function parms from scope. */
+ for (t = current_binding_level->names; t; t = TREE_CHAIN (t))
+ pop_binding (DECL_NAME (t), t);
+ leave_scope();
+
+ if (is_declarator)
+ /* Repeat the main loop. */
+ continue;
}
/* If this is the first, we can try a parenthesized
@@ -13728,10 +13740,10 @@ cp_parser_type_specifier_seq (cp_parser* parser,
value of NULL indicates a parameter-declaration-clause consisting
only of an ellipsis. */
-static cp_parameter_declarator *
+static tree
cp_parser_parameter_declaration_clause (cp_parser* parser)
{
- cp_parameter_declarator *parameters;
+ tree parameters;
cp_token *token;
bool ellipsis_p;
bool is_error;
@@ -13743,7 +13755,7 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
{
/* Consume the `...' token. */
cp_lexer_consume_token (parser->lexer);
- return NULL;
+ return NULL_TREE;
}
else if (token->type == CPP_CLOSE_PAREN)
/* There are no parameters. */
@@ -13751,10 +13763,10 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
#ifndef NO_IMPLICIT_EXTERN_C
if (in_system_header && current_class_type == NULL
&& current_lang_name == lang_name_c)
- return NULL;
+ return NULL_TREE;
else
#endif
- return no_parameters;
+ return void_list_node;
}
/* Check for `(void)', too, which is a special case. */
else if (token->keyword == RID_VOID
@@ -13764,7 +13776,7 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
/* Consume the `void' token. */
cp_lexer_consume_token (parser->lexer);
/* There are no parameters. */
- return no_parameters;
+ return void_list_node;
}
/* Parse the parameter-declaration-list. */
@@ -13799,8 +13811,8 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
ellipsis_p = false;
/* Finish the parameter list. */
- if (parameters && ellipsis_p)
- parameters->ellipsis_p = true;
+ if (!ellipsis_p)
+ parameters = chainon (parameters, void_list_node);
return parameters;
}
@@ -13816,11 +13828,11 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
`void_list_node' is never appended to the list. Upon return,
*IS_ERROR will be true iff an error occurred. */
-static cp_parameter_declarator *
+static tree
cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
{
- cp_parameter_declarator *parameters = NULL;
- cp_parameter_declarator **tail = &parameters;
+ tree parameters = NULL_TREE;
+ tree *tail = &parameters;
bool saved_in_unbraced_linkage_specification_p;
/* Assume all will go well. */
@@ -13836,6 +13848,7 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
while (true)
{
cp_parameter_declarator *parameter;
+ tree decl = error_mark_node;
bool parenthesized_p;
/* Parse the parameter. */
parameter
@@ -13843,17 +13856,38 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
/*template_parm_p=*/false,
&parenthesized_p);
+ /* We don't know yet if the enclosing context is deprecated, so wait
+ and warn in grokparms if appropriate. */
+ deprecated_state = DEPRECATED_SUPPRESS;
+
+ if (parameter)
+ decl = grokdeclarator (parameter->declarator,
+ &parameter->decl_specifiers,
+ PARM,
+ parameter->default_argument != NULL_TREE,
+ &parameter->decl_specifiers.attributes);
+
+ deprecated_state = DEPRECATED_NORMAL;
+
/* If a parse error occurred parsing the parameter declaration,
then the entire parameter-declaration-list is erroneous. */
- if (!parameter)
+ if (decl == error_mark_node)
{
*is_error = true;
- parameters = NULL;
+ parameters = error_mark_node;
break;
}
+
+ if (parameter->decl_specifiers.attributes)
+ cplus_decl_attributes (&decl,
+ parameter->decl_specifiers.attributes,
+ 0);
+ if (DECL_NAME (decl))
+ decl = pushdecl (decl);
+
/* Add the new parameter to the list. */
- *tail = parameter;
- tail = &parameter->next;
+ *tail = build_tree_list (parameter->default_argument, decl);
+ tail = &TREE_CHAIN (*tail);
/* Peek at the next token. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7c9165c20ea..4aa7b1ad146 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9556,11 +9556,16 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
tree type;
- type =
- finish_decltype_type (tsubst_expr
- (DECLTYPE_TYPE_EXPR (t), args,
- complain, in_decl,
- /*integral_constant_expression_p=*/false),
+ ++skip_evaluation;
+
+ type = tsubst_expr (DECLTYPE_TYPE_EXPR (t), args,
+ complain, in_decl,
+ /*integral_constant_expression_p=*/false);
+
+ --skip_evaluation;
+
+ type =
+ finish_decltype_type (type,
DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t));
return cp_build_qualified_type_real (type,
cp_type_quals (t)
@@ -9796,7 +9801,22 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
case PARM_DECL:
r = retrieve_local_specialization (t);
- gcc_assert (r != NULL);
+
+ if (r == NULL)
+ {
+ /* This can happen for a parameter name used later in a function
+ declaration (such as in a late-specified return type).
+ Replace it with an arbitrary expression with the same type
+ (*(T*)0). This should only occur in an unevaluated context
+ (i.e. decltype). */
+ gcc_assert (skip_evaluation && DECL_CONTEXT (t) == NULL_TREE);
+ r = non_reference (TREE_TYPE (t));
+ r = tsubst (r, args, complain, in_decl);
+ r = build_pointer_type (r);
+ r = build_c_cast (r, null_node);
+ return cp_build_indirect_ref (r, NULL, tf_warning_or_error);
+ }
+
if (TREE_CODE (r) == ARGUMENT_PACK_SELECT)
r = ARGUMENT_PACK_SELECT_ARG (r);
mark_used (r);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index e044a4392c3..cfd06bb08cb 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -429,16 +429,6 @@ add_decl_expr (tree decl)
add_stmt (r);
}
-/* Nonzero if TYPE is an anonymous union or struct type. We have to use a
- flag for this because "A union for which objects or pointers are
- declared is not an anonymous union" [class.union]. */
-
-int
-anon_aggr_type_p (const_tree node)
-{
- return ANON_AGGR_TYPE_P (node);
-}
-
/* Finish a scope. */
tree
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 7c4c522b2c4..aea7a653b18 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5110,7 +5110,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2)
#ifndef LOGICAL_OP_NON_SHORT_CIRCUIT
#define LOGICAL_OP_NON_SHORT_CIRCUIT \
- (BRANCH_COST (!cfun || optimize_function_for_speed_p (cfun), \
+ (BRANCH_COST (optimize_function_for_speed_p (cfun), \
false) >= 2)
#endif
@@ -5359,7 +5359,7 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
that can be merged. Avoid doing this if the RHS is a floating-point
comparison since those can trap. */
- if (BRANCH_COST (!cfun || optimize_function_for_speed_p (cfun),
+ if (BRANCH_COST (optimize_function_for_speed_p (cfun),
false) >= 2
&& ! FLOAT_TYPE_P (TREE_TYPE (rl_arg))
&& simple_operand_p (rl_arg)
@@ -6682,7 +6682,7 @@ tree_swap_operands_p (const_tree arg0, const_tree arg1, bool reorder)
if (TREE_CONSTANT (arg0))
return 1;
- if (cfun && optimize_function_for_size_p (cfun))
+ if (optimize_function_for_size_p (cfun))
return 0;
if (reorder && flag_evaluation_order
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0e64d91652b..c8f1aaf5d92 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,28 @@
+2008-09-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37429
+ * resolve.c (expression_rank): Added assertion to guard against
+ EXPR_COMPCALL expressions.
+ (resolve_compcall): Set expression's rank from the target procedure's.
+
+2008-09-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37411
+ * trans-array.c (gfc_conv_array_parameter): Added assertion that the
+ symbol has an array spec.
+
+2008-09-08 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37199
+ * trans-expr.c (gfc_add_interface_mapping): Set new_sym->as.
+ (gfc_map_intrinsic_function): Added checks against NULL bounds in
+ array specs.
+
+2008-09-08 Tobias Burnus <burnus@net.b.de>
+
+ PR fortran/37400
+ * symbol.c (gfc_set_default_type): Copy char len.
+
2008-09-06 Steven G. Kargl <kargls@comcast.net>
PR fortran/36153
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 05f2c14f4b3..69245f2ce35 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -4021,6 +4021,10 @@ expression_rank (gfc_expr *e)
gfc_ref *ref;
int i, rank;
+ /* Just to make sure, because EXPR_COMPCALL's also have an e->ref and that
+ could lead to serious confusion... */
+ gcc_assert (e->expr_type != EXPR_COMPCALL);
+
if (e->ref == NULL)
{
if (e->expr_type == EXPR_ARRAY)
@@ -4550,6 +4554,11 @@ resolve_compcall (gfc_expr* e)
if (resolve_typebound_generic_call (e) == FAILURE)
return FAILURE;
+ gcc_assert (!e->value.compcall.tbp->is_generic);
+
+ /* Take the rank from the function's symbol. */
+ if (e->value.compcall.tbp->u.specific->n.sym->as)
+ e->rank = e->value.compcall.tbp->u.specific->n.sym->as->rank;
/* For now, we simply transform it into an EXPR_FUNCTION call with the same
arglist to the TBP's binding target. */
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 0b580794ea2..905b243a225 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -257,6 +257,12 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
sym->ts = *ts;
sym->attr.implicit_type = 1;
+ if (ts->cl)
+ {
+ sym->ts.cl = gfc_get_charlen ();
+ *sym->ts.cl = *ts->cl;
+ }
+
if (sym->attr.is_bind_c == 1)
{
/* BIND(C) variables should not be implicitly declared. */
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index e0ebbf0e9b0..1ab58e1d7eb 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -5155,6 +5155,9 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77,
&& expr->ref->u.ar.type == AR_FULL);
sym = full_array_var ? expr->symtree->n.sym : NULL;
+ /* The symbol should have an array specification. */
+ gcc_assert (!sym || sym->as);
+
if (expr->expr_type == EXPR_ARRAY && expr->ts.type == BT_CHARACTER)
{
get_array_ctor_strlen (&se->pre, expr->value.constructor, &tmp);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index d253976af1b..216b3df1c96 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1618,6 +1618,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
/* Create a new symbol to represent the actual argument. */
new_sym = gfc_new_symbol (sym->name, NULL);
new_sym->ts = sym->ts;
+ new_sym->as = gfc_copy_array_spec (sym->as);
new_sym->attr.referenced = 1;
new_sym->attr.dimension = sym->attr.dimension;
new_sym->attr.pointer = sym->attr.pointer;
@@ -1798,8 +1799,9 @@ gfc_apply_interface_mapping_to_ref (gfc_interface_mapping * mapping,
/* Convert intrinsic function calls into result expressions. */
+
static bool
-gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping * mapping)
+gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping *mapping)
{
gfc_symbol *sym;
gfc_expr *new_expr;
@@ -1813,7 +1815,7 @@ gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping * mapping)
else
arg2 = NULL;
- sym = arg1->symtree->n.sym;
+ sym = arg1->symtree->n.sym;
if (sym->attr.dummy)
return false;
@@ -1850,6 +1852,13 @@ gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping * mapping)
for (; d < dup; d++)
{
gfc_expr *tmp;
+
+ if (!sym->as->upper[d] || !sym->as->lower[d])
+ {
+ gfc_free_expr (new_expr);
+ return false;
+ }
+
tmp = gfc_add (gfc_copy_expr (sym->as->upper[d]), gfc_int_expr (1));
tmp = gfc_subtract (tmp, gfc_copy_expr (sym->as->lower[d]));
if (new_expr)
@@ -1875,9 +1884,15 @@ gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping * mapping)
gcc_unreachable ();
if (expr->value.function.isym->id == GFC_ISYM_LBOUND)
- new_expr = gfc_copy_expr (sym->as->lower[d]);
+ {
+ if (sym->as->lower[d])
+ new_expr = gfc_copy_expr (sym->as->lower[d]);
+ }
else
- new_expr = gfc_copy_expr (sym->as->upper[d]);
+ {
+ if (sym->as->upper[d])
+ new_expr = gfc_copy_expr (sym->as->upper[d]);
+ }
break;
default:
diff --git a/gcc/function.h b/gcc/function.h
index eb85e3c37af..e6214b3ae6f 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -527,6 +527,9 @@ struct function GTY(())
/* Last statement uid. */
int last_stmt_uid;
+ /* Line number of the start of the function for debugging purposes. */
+ location_t function_start_locus;
+
/* Line number of the end of the function. */
location_t function_end_locus;
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index c1f5744d7a8..55c5fb25889 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1872,6 +1872,12 @@ gimplify_conversion (tree *expr_p)
canonicalize_addr_expr (expr_p);
}
+ /* If we have a conversion to a non-register type force the
+ use of a VIEW_CONVERT_EXPR instead. */
+ if (!is_gimple_reg_type (TREE_TYPE (*expr_p)))
+ *expr_p = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (*expr_p),
+ TREE_OPERAND (*expr_p, 0));
+
return GS_OK;
}
@@ -4555,20 +4561,31 @@ gimplify_addr_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
/* Mark the RHS addressable. */
ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, post_p,
is_gimple_addressable, fb_either);
- if (ret != GS_ERROR)
- {
- op0 = TREE_OPERAND (expr, 0);
+ if (ret == GS_ERROR)
+ break;
- /* For various reasons, the gimplification of the expression
- may have made a new INDIRECT_REF. */
- if (TREE_CODE (op0) == INDIRECT_REF)
- goto do_indirect_ref;
+ /* We cannot rely on making the RHS addressable if it is
+ a temporary created by gimplification. In this case create a
+ new temporary that is initialized by a copy (which will
+ become a store after we mark it addressable).
+ This mostly happens if the frontend passed us something that
+ it could not mark addressable yet, like a fortran
+ pass-by-reference parameter (int) floatvar. */
+ if (is_gimple_formal_tmp_var (TREE_OPERAND (expr, 0)))
+ TREE_OPERAND (expr, 0)
+ = get_initialized_tmp_var (TREE_OPERAND (expr, 0), pre_p, post_p);
- /* Make sure TREE_CONSTANT and TREE_SIDE_EFFECTS are set properly. */
- recompute_tree_invariant_for_addr_expr (expr);
+ op0 = TREE_OPERAND (expr, 0);
- mark_addressable (TREE_OPERAND (expr, 0));
- }
+ /* For various reasons, the gimplification of the expression
+ may have made a new INDIRECT_REF. */
+ if (TREE_CODE (op0) == INDIRECT_REF)
+ goto do_indirect_ref;
+
+ /* Make sure TREE_CONSTANT and TREE_SIDE_EFFECTS are set properly. */
+ recompute_tree_invariant_for_addr_expr (expr);
+
+ mark_addressable (TREE_OPERAND (expr, 0));
break;
}
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 86b0eae6f97..40a317eb5f5 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -717,16 +717,24 @@ outermost_loop_in_scop (scop_p scop, basic_block bb)
return nest;
}
+/* Returns the block preceding the entry of SCOP. */
+
+static basic_block
+block_before_scop (scop_p scop)
+{
+ return SESE_ENTRY (SCOP_REGION (scop))->src;
+}
+
/* Return true when EXPR is an affine function in LOOP with parameters
- instantiated relative to outermost_loop. */
+ instantiated relative to SCOP_ENTRY. */
static bool
-loop_affine_expr (struct loop *outermost_loop, struct loop *loop, tree expr)
+loop_affine_expr (basic_block scop_entry, struct loop *loop, tree expr)
{
- int n = outermost_loop->num;
+ int n = scop_entry->loop_father->num;
tree scev = analyze_scalar_evolution (loop, expr);
- scev = instantiate_scev (outermost_loop, loop, scev);
+ scev = instantiate_scev (scop_entry, loop, scev);
return (evolution_function_is_invariant_p (scev, n)
|| evolution_function_is_affine_multivariate_p (scev, n));
@@ -751,11 +759,11 @@ is_simple_operand (loop_p loop, gimple stmt, tree op)
}
/* Return true only when STMT is simple enough for being handled by
- Graphite. This depends on OUTERMOST_LOOP, as the parametetrs are
- initialized relative to this loop. */
+ Graphite. This depends on SCOP_ENTRY, as the parametetrs are
+ initialized relatively to this basic block. */
static bool
-stmt_simple_for_scop_p (struct loop *outermost_loop, gimple stmt)
+stmt_simple_for_scop_p (basic_block scop_entry, gimple stmt)
{
basic_block bb = gimple_bb (stmt);
struct loop *loop = bb->loop_father;
@@ -791,11 +799,11 @@ stmt_simple_for_scop_p (struct loop *outermost_loop, gimple stmt)
|| code == GE_EXPR))
return false;
- if (!outermost_loop)
+ if (!scop_entry)
return false;
FOR_EACH_SSA_TREE_OPERAND (op, stmt, op_iter, SSA_OP_ALL_USES)
- if (!loop_affine_expr (outermost_loop, loop, op))
+ if (!loop_affine_expr (scop_entry, loop, op))
return false;
return true;
@@ -850,18 +858,17 @@ stmt_simple_for_scop_p (struct loop *outermost_loop, gimple stmt)
}
/* Returns the statement of BB that contains a harmful operation: that
- can be a function call with side effects, data dependences that
- cannot be computed in OUTERMOST_LOOP, the induction variables are
- not linear with respect to OUTERMOST_LOOP, etc. The current open
+ can be a function call with side effects, the induction variables
+ are not linear with respect to SCOP_ENTRY, etc. The current open
scop should end before this statement. */
static gimple
-harmful_stmt_in_bb (struct loop *outermost_loop, basic_block bb)
+harmful_stmt_in_bb (basic_block scop_entry, basic_block bb)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- if (!stmt_simple_for_scop_p (outermost_loop, gsi_stmt (gsi)))
+ if (!stmt_simple_for_scop_p (scop_entry, gsi_stmt (gsi)))
return gsi_stmt (gsi);
return NULL;
@@ -1048,20 +1055,28 @@ struct scopdet_info
};
static struct scopdet_info build_scops_1 (edge, VEC (scop_p, heap) **,
- loop_p, loop_p);
+ loop_p);
/* Checks, if a bb can be added to a SCoP. */
static struct scopdet_info
-scopdet_edge_info (edge ee, loop_p outermost_loop,
+scopdet_edge_info (edge ee,
VEC (scop_p, heap) **scops, gbb_type type, gimple *stmt)
{
basic_block bb = ee->dest;
struct loop *loop = bb->loop_father;
struct scopdet_info result;
+ basic_block scop_entry;
- *stmt = harmful_stmt_in_bb (outermost_loop, bb);
+ if (VEC_length (scop_p, *scops) != 0)
+ scop_entry = block_before_scop (VEC_last (scop_p, *scops));
+ else if (loop->header)
+ scop_entry = loop->header;
+ else
+ scop_entry = ENTRY_BLOCK_PTR;
+
+ *stmt = harmful_stmt_in_bb (scop_entry, bb);
result.difficult = (*stmt != NULL);
result.last = NULL;
@@ -1084,7 +1099,7 @@ scopdet_edge_info (edge ee, loop_p outermost_loop,
VEC (scop_p, heap) *tmp_scops = VEC_alloc (scop_p, heap, 3);
struct scopdet_info sinfo;
- sinfo = build_scops_1 (ee, &tmp_scops, loop, outermost_loop);
+ sinfo = build_scops_1 (ee, &tmp_scops, loop);
result.last = single_exit (bb->loop_father);
@@ -1117,20 +1132,18 @@ scopdet_edge_info (edge ee, loop_p outermost_loop,
case GBB_LOOP_MULT_EXIT_HEADER:
{
/* XXX: Handle loop nests with the same header. */
- /* XXX: Handle iterative optimization of outermost_loop. */
/* XXX: For now we just do not join loops with multiple exits. If the
exits lead to the same bb it may be possible to join the loop. */
VEC (scop_p, heap) *tmp_scops = VEC_alloc (scop_p, heap, 3);
VEC (edge, heap) *exits = get_loop_exit_edges (loop);
edge e;
int i;
- build_scops_1 (ee, &tmp_scops, loop, outermost_loop);
+ build_scops_1 (ee, &tmp_scops, loop);
for (i = 0; VEC_iterate (edge, exits, i, e); i++)
if (dominated_by_p (CDI_DOMINATORS, e->dest, e->src)
&& e->dest->loop_father == loop_outer (loop))
- build_scops_1 (e, &tmp_scops, e->dest->loop_father,
- outermost_loop);
+ build_scops_1 (e, &tmp_scops, e->dest->loop_father);
result.next = NULL;
result.last = NULL;
@@ -1199,7 +1212,7 @@ scopdet_edge_info (edge ee, loop_p outermost_loop,
continue;
}
- sinfo = build_scops_1 (e, &tmp_scops, loop, outermost_loop);
+ sinfo = build_scops_1 (e, &tmp_scops, loop);
result.exits |= sinfo.exits;
result.last = sinfo.last;
@@ -1261,10 +1274,9 @@ scopdet_edge_info (edge ee, loop_p outermost_loop,
e = split_block (dom_bb, NULL);
if (loop_depth (loop) > loop_depth (dom_bb->loop_father))
- sinfo = build_scops_1 (e, &tmp_scops, loop_outer (loop),
- outermost_loop);
+ sinfo = build_scops_1 (e, &tmp_scops, loop_outer (loop));
else
- sinfo = build_scops_1 (e, &tmp_scops, loop, outermost_loop);
+ sinfo = build_scops_1 (e, &tmp_scops, loop);
result.exits |= sinfo.exits;
@@ -1335,8 +1347,7 @@ end_scop (scop_p scop, edge exit, bool split_entry)
/* Creates the SCoPs and writes entry and exit points for every SCoP. */
static struct scopdet_info
-build_scops_1 (edge start, VEC (scop_p, heap) **scops, loop_p loop,
- loop_p outermost_loop)
+build_scops_1 (edge start, VEC (scop_p, heap) **scops, loop_p loop)
{
edge current = start;
@@ -1357,7 +1368,7 @@ build_scops_1 (edge start, VEC (scop_p, heap) **scops, loop_p loop,
and can only be added if all bbs in deeper layers are simple. */
while (current != NULL)
{
- sinfo = scopdet_edge_info (current, outermost_loop, scops,
+ sinfo = scopdet_edge_info (current, scops,
get_bb_type (current->dest, loop), &stmt);
if (!in_scop && !(sinfo.exits || sinfo.difficult))
@@ -1433,7 +1444,7 @@ static void
build_scops (void)
{
struct loop *loop = current_loops->tree_root;
- build_scops_1 (single_succ_edge (ENTRY_BLOCK_PTR), &current_scops, loop, loop);
+ build_scops_1 (single_succ_edge (ENTRY_BLOCK_PTR), &current_scops, loop);
}
/* Gather the basic blocks belonging to the SCOP. */
@@ -1895,19 +1906,15 @@ idx_record_params (tree base, tree *idx, void *dta)
tree scev;
scop_p scop = data->scop;
struct loop *loop = data->loop;
+ Value one;
scev = analyze_scalar_evolution (loop, *idx);
- scev = instantiate_scev (outermost_loop_in_scop (scop, loop->header),
- loop, scev);
-
- {
- Value one;
+ scev = instantiate_scev (block_before_scop (scop), loop, scev);
- value_init (one);
- value_set_si (one, 1);
- scan_tree_for_params (scop, scev, NULL, 0, one, false);
- value_clear (one);
- }
+ value_init (one);
+ value_set_si (one, 1);
+ scan_tree_for_params (scop, scev, NULL, 0, one, false);
+ value_clear (one);
}
return true;
@@ -1957,11 +1964,11 @@ find_params_in_bb (scop_p scop, basic_block bb)
lhs = gimple_cond_lhs (stmt);
lhs = analyze_scalar_evolution (loop, lhs);
- lhs = instantiate_scev (nest, loop, lhs);
+ lhs = instantiate_scev (block_before_scop (scop), loop, lhs);
rhs = gimple_cond_rhs (stmt);
rhs = analyze_scalar_evolution (loop, rhs);
- rhs = instantiate_scev (nest, loop, rhs);
+ rhs = instantiate_scev (block_before_scop (scop), loop, rhs);
value_init (one);
scan_tree_for_params (scop, lhs, NULL, 0, one, false);
@@ -2081,8 +2088,7 @@ find_scop_parameters (scop_p scop)
continue;
nb_iters = analyze_scalar_evolution (loop, nb_iters);
- nb_iters = instantiate_scev (outermost_loop_in_scop (scop, loop->header),
- loop, nb_iters);
+ nb_iters = instantiate_scev (block_before_scop (scop), loop, nb_iters);
scan_tree_for_params (scop, nb_iters, NULL, 0, one, false);
}
@@ -2209,10 +2215,10 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
row++;
value_set_si (cstr->p[row][0], 1);
value_set_si (cstr->p[row][loop_col], -1);
+
nb_iters = analyze_scalar_evolution (loop, nb_iters);
- nb_iters =
- instantiate_scev (outermost_loop_in_scop (scop, loop->header),
- loop, nb_iters);
+ nb_iters = instantiate_scev (block_before_scop (scop), loop, nb_iters);
+
value_init (one);
value_set_si (one, 1);
scan_tree_for_params (scop, nb_iters, cstr, row, one, false);
@@ -2333,15 +2339,15 @@ add_conditions_to_domain (graphite_bb_p gb)
tree left;
tree right;
loop_p loop = GBB_BB (gb)->loop_father;
- loop_p outermost = outermost_loop_in_scop (scop, GBB_BB (gb));
left = gimple_cond_lhs (stmt);
right = gimple_cond_rhs (stmt);
left = analyze_scalar_evolution (loop, left);
right = analyze_scalar_evolution (loop, right);
- left = instantiate_scev (outermost, loop, left);
- right = instantiate_scev (outermost, loop, right);
+
+ left = instantiate_scev (block_before_scop (scop), loop, left);
+ right = instantiate_scev (block_before_scop (scop), loop, right);
code = gimple_cond_code (stmt);
@@ -3974,13 +3980,13 @@ gbb_can_be_ignored (graphite_bb_p gb)
XXX: Just a heuristic, that needs further investigation. */
case GIMPLE_ASSIGN:
{
- tree var = gimple_assign_lhs (stmt);
+ tree var = gimple_assign_lhs (stmt);
var = analyze_scalar_evolution (loop, var);
- var = instantiate_scev (outermost_loop_in_scop (scop,
- GBB_BB (gb)),
- loop, var);
+ var = instantiate_scev (block_before_scop (scop), loop, var);
+
if (TREE_CODE (var) == SCEV_NOT_KNOWN)
return false;
+
break;
}
/* Otherwise not ignoreable. */
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 833e1552b31..ba604371745 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1210,7 +1210,7 @@ advance_one_cycle (void)
{
advance_state (curr_state);
if (sched_verbose >= 6)
- fprintf (sched_dump, "\n;;\tAdvanced a state.\n");
+ fprintf (sched_dump, ";;\tAdvanced a state.\n");
}
/* Clock at which the previous instruction was issued. */
@@ -2071,7 +2071,14 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state,
/* Init max_points. */
max_points = 0;
more_issue = issue_rate - cycle_issued_insns;
- gcc_assert (more_issue >= 0);
+
+ /* ??? We used to assert here that we never issue more insns than issue_rate.
+ However, some targets (e.g. MIPS/SB1) claim lower issue rate than can be
+ achieved to get better performance. Until these targets are fixed to use
+ scheduler hooks to manipulate insns priority instead, the assert should
+ be disabled.
+
+ gcc_assert (more_issue >= 0); */
for (i = 0; i < n_ready; i++)
if (!ready_try [i])
@@ -2319,9 +2326,10 @@ choose_ready (struct ready_list *ready, rtx *insn_ptr)
if (max_issue (ready, 1, curr_state, &index) == 0)
{
- if (sched_verbose >= 4)
- fprintf (sched_dump, ";;\t\tChosen none\n");
*insn_ptr = ready_remove_first (ready);
+ if (sched_verbose >= 4)
+ fprintf (sched_dump, ";;\t\tChosen insn (but can't issue) : %s \n",
+ (*current_sched_info->print_insn) (*insn_ptr, 0));
return 0;
}
else
diff --git a/gcc/ira-build.c b/gcc/ira-build.c
index b1f496c41df..3535214cac6 100644
--- a/gcc/ira-build.c
+++ b/gcc/ira-build.c
@@ -443,7 +443,7 @@ ira_create_allocno (int regno, bool cap_p, ira_loop_tree_node_t loop_tree_node)
COPY_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
ALLOCNO_NREFS (a) = 0;
- ALLOCNO_FREQ (a) = 1;
+ ALLOCNO_FREQ (a) = 0;
ALLOCNO_HARD_REGNO (a) = -1;
ALLOCNO_CALL_FREQ (a) = 0;
ALLOCNO_CALLS_CROSSED_NUM (a) = 0;
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 833048e2541..6342e90a923 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -210,7 +210,7 @@ static void
update_conflict_hard_regno_costs (int *costs, ira_allocno_t allocno,
int divisor, bool decr_p)
{
- int i, cost, class_size, mult, div;
+ int i, cost, class_size, freq, mult, div;
int *conflict_costs;
bool cont_p;
enum machine_mode mode;
@@ -258,9 +258,11 @@ update_conflict_hard_regno_costs (int *costs, ira_allocno_t allocno,
cont_p = true;
else
{
- ira_assert (ALLOCNO_FREQ (another_allocno) != 0);
mult = cp->freq;
- div = ALLOCNO_FREQ (another_allocno) * divisor;
+ freq = ALLOCNO_FREQ (another_allocno);
+ if (freq == 0)
+ freq = 1;
+ div = freq * divisor;
cont_p = false;
for (i = class_size - 1; i >= 0; i--)
{
@@ -2728,10 +2730,11 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
}
if (best_cost >= 0)
{
- slot = &ira_spilled_reg_stack_slots[best_slot_num];
+ slot_num = best_slot_num;
+ slot = &ira_spilled_reg_stack_slots[slot_num];
SET_REGNO_REG_SET (&slot->spilled_regs, regno);
x = slot->mem;
- ALLOCNO_HARD_REGNO (allocno) = -best_slot_num - 2;
+ ALLOCNO_HARD_REGNO (allocno) = -slot_num - 2;
}
}
if (x != NULL_RTX)
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index 8b8c48582ea..e467a7c60ee 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -331,7 +331,7 @@ go_through_subreg (rtx x, int *offset)
static bool
process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq)
{
- int hard_regno, cost, index, offset1, offset2;
+ int allocno_preferenced_hard_regno, cost, index, offset1, offset2;
bool only_regs_p;
ira_allocno_t a;
enum reg_class rclass, cover_class;
@@ -342,16 +342,18 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq)
only_regs_p = REG_P (reg1) && REG_P (reg2);
reg1 = go_through_subreg (reg1, &offset1);
reg2 = go_through_subreg (reg2, &offset2);
+ /* Set up hard regno preferenced by allocno. If allocno gets the
+ hard regno the copy (or potential move) insn will be removed. */
if (HARD_REGISTER_P (reg1))
{
if (HARD_REGISTER_P (reg2))
return false;
- hard_regno = REGNO (reg1) + offset1 - offset2;
+ allocno_preferenced_hard_regno = REGNO (reg1) + offset1 - offset2;
a = ira_curr_regno_allocno_map[REGNO (reg2)];
}
else if (HARD_REGISTER_P (reg2))
{
- hard_regno = REGNO (reg2) + offset2 - offset1;
+ allocno_preferenced_hard_regno = REGNO (reg2) + offset2 - offset1;
a = ira_curr_regno_allocno_map[REGNO (reg1)];
}
else if (!CONFLICT_ALLOCNO_P (ira_curr_regno_allocno_map[REGNO (reg1)],
@@ -366,7 +368,10 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq)
}
else
return false;
- rclass = REGNO_REG_CLASS (hard_regno);
+ if (! IN_RANGE (allocno_preferenced_hard_regno, 0, FIRST_PSEUDO_REGISTER - 1))
+ /* Can not be tied. */
+ return false;
+ rclass = REGNO_REG_CLASS (allocno_preferenced_hard_regno);
mode = ALLOCNO_MODE (a);
cover_class = ALLOCNO_COVER_CLASS (a);
if (! ira_class_subset_p[rclass][cover_class])
@@ -375,8 +380,9 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq)
&& reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode))
/* It is already taken into account in ira-costs.c. */
return false;
- index = ira_class_hard_reg_index[cover_class][hard_regno];
+ index = ira_class_hard_reg_index[cover_class][allocno_preferenced_hard_regno];
if (index < 0)
+ /* Can not be tied. It is not in the cover class. */
return false;
if (HARD_REGISTER_P (reg1))
cost = ira_register_move_cost[mode][cover_class][rclass] * freq;
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f80688f0d21..c88eca60d74 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ * decl.c (build_result_decl): Remove no longer applicable
+ promotion.
+
2008-09-05 David Daney <ddaney@avtrex.com>
* gcj.texi (-freduced-reflection): Clarify option's restrictions.
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 1768109414d..bae077887bf 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1694,10 +1694,6 @@ build_result_decl (tree fndecl)
tree result = DECL_RESULT (fndecl);
if (! result)
{
- /* To be compatible with C_PROMOTING_INTEGER_TYPE_P in cc1/cc1plus. */
- if (INTEGRAL_TYPE_P (restype)
- && TYPE_PRECISION (restype) < TYPE_PRECISION (integer_type_node))
- restype = integer_type_node;
result = build_decl (RESULT_DECL, NULL_TREE, restype);
DECL_ARTIFICIAL (result) = 1;
DECL_IGNORED_P (result) = 1;
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 7f8de5b9772..37b5905ed98 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -51,7 +51,6 @@ extern const char *lhd_decl_printable_name (tree, int);
extern const char *lhd_dwarf_name (tree, int);
extern int lhd_types_compatible_p (tree, tree);
extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
-extern int lhd_expand_decl (tree);
extern void lhd_print_error_function (struct diagnostic_context *,
const char *, struct diagnostic_info *);
extern void lhd_set_decl_assembler_name (tree);
@@ -93,7 +92,6 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#define LANG_HOOKS_MISSING_NORETURN_OK_P hook_bool_tree_true
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
-#define LANG_HOOKS_EXPAND_DECL lhd_expand_decl
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
#define LANG_HOOKS_STATICP lhd_staticp
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
@@ -243,7 +241,6 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_MISSING_NORETURN_OK_P, \
LANG_HOOKS_GET_ALIAS_SET, \
LANG_HOOKS_EXPAND_EXPR, \
- LANG_HOOKS_EXPAND_DECL, \
LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
LANG_HOOKS_MARK_ADDRESSABLE, \
LANG_HOOKS_STATICP, \
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 4d441029802..ebbec951aef 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -227,18 +227,6 @@ lhd_expand_expr (tree ARG_UNUSED (t), rtx ARG_UNUSED (r),
gcc_unreachable ();
}
-/* The default language-specific function for expanding a decl. After
- the language-independent cases are handled, this function will be
- called. If this function is not defined, it is assumed that
- declarations other than those for variables and labels do not require
- any RTL generation. */
-
-int
-lhd_expand_decl (tree ARG_UNUSED (t))
-{
- return 0;
-}
-
/* This is the default decl_printable_name function. */
const char *
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index a10ce482f5c..2d62f99f28d 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -294,10 +294,6 @@ struct lang_hooks
Fourth argument is actually an enum expand_modifier. */
rtx (*expand_expr) (tree, rtx, enum machine_mode, int, rtx *);
- /* Called by expand_expr to generate the definition of a decl. Returns
- 1 if handled, 0 otherwise. */
- int (*expand_decl) (tree);
-
/* Function to finish handling an incomplete decl at the end of
compilation. Default hook is does nothing. */
void (*finish_incomplete_decl) (tree);
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index cc43e85bdbe..2164a6e4b48 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -883,7 +883,7 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = xmalloc (sizeof (scope_t));
+ scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
@@ -937,7 +937,7 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = xmalloc (sizeof (scope_t));
+ scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
@@ -980,19 +980,19 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
scope_ptr != (scope_t *) 0;
scope_ptr = scope_ptr->prev)
{
- const char *class;
+ const char *sclass;
if (scope_ptr->st == st_Proc || scope_ptr->st == st_StaticProc)
- class = "func.";
+ sclass = "func.";
else if (scope_ptr->st == st_File)
- class = "file";
+ sclass = "file";
else if (scope_ptr->st == st_Block && scope_ptr->sc == sc_Text)
- class = "block";
+ sclass = "block";
else if (scope_ptr->st == st_Block && scope_ptr->sc == sc_Info)
- class = "type";
+ sclass = "type";
else
- class = "???";
+ sclass = "???";
- printf (" %ld [%s]", scope_ptr->open_sym, class);
+ printf (" %ld [%s]", scope_ptr->open_sym, sclass);
}
printf ("\n");
}
@@ -1345,41 +1345,44 @@ read_tfile (void)
print_sym_hdr (&sym_hdr);
- lines = read_seek (NULL, sym_hdr.cbLine, sym_hdr.cbLineOffset,
- "Line numbers");
+ lines = (LINER *) read_seek (NULL, sym_hdr.cbLine, sym_hdr.cbLineOffset,
+ "Line numbers");
- dense_nums = read_seek (NULL, sym_hdr.idnMax * sizeof (DNR),
- sym_hdr.cbDnOffset, "Dense numbers");
+ dense_nums = (DNR *) read_seek (NULL, sym_hdr.idnMax * sizeof (DNR),
+ sym_hdr.cbDnOffset, "Dense numbers");
- proc_desc = read_seek (NULL, sym_hdr.ipdMax * sizeof (PDR),
- sym_hdr.cbPdOffset, "Procedure tables");
+ proc_desc = (PDR *) read_seek (NULL, sym_hdr.ipdMax * sizeof (PDR),
+ sym_hdr.cbPdOffset, "Procedure tables");
- l_symbols = read_seek (NULL, sym_hdr.isymMax * sizeof (SYMR),
- sym_hdr.cbSymOffset, "Local symbols");
+ l_symbols = (SYMR *) read_seek (NULL, sym_hdr.isymMax * sizeof (SYMR),
+ sym_hdr.cbSymOffset, "Local symbols");
- opt_symbols = read_seek (NULL, sym_hdr.ioptMax * sizeof (OPTR),
- sym_hdr.cbOptOffset, "Optimization symbols");
+ opt_symbols = (OPTR *) read_seek (NULL, sym_hdr.ioptMax * sizeof (OPTR),
+ sym_hdr.cbOptOffset,
+ "Optimization symbols");
- aux_symbols = read_seek (NULL, sym_hdr.iauxMax * sizeof (AUXU),
- sym_hdr.cbAuxOffset, "Auxiliary symbols");
+ aux_symbols = (AUXU *) read_seek (NULL, sym_hdr.iauxMax * sizeof (AUXU),
+ sym_hdr.cbAuxOffset, "Auxiliary symbols");
if (sym_hdr.iauxMax > 0)
- aux_used = xcalloc (sym_hdr.iauxMax, 1);
+ aux_used = (char *) xcalloc (sym_hdr.iauxMax, 1);
- l_strings = read_seek (NULL, sym_hdr.issMax,
- sym_hdr.cbSsOffset, "Local string table");
+ l_strings = (char *) read_seek (NULL, sym_hdr.issMax,
+ sym_hdr.cbSsOffset, "Local string table");
- e_strings = read_seek (NULL, sym_hdr.issExtMax,
- sym_hdr.cbSsExtOffset, "External string table");
+ e_strings = (char *) read_seek (NULL, sym_hdr.issExtMax,
+ sym_hdr.cbSsExtOffset,
+ "External string table");
- file_desc = read_seek (NULL, sym_hdr.ifdMax * sizeof (FDR),
- sym_hdr.cbFdOffset, "File tables");
+ file_desc = (FDR *) read_seek (NULL, sym_hdr.ifdMax * sizeof (FDR),
+ sym_hdr.cbFdOffset, "File tables");
- rfile_desc = read_seek (NULL, sym_hdr.crfd * sizeof (ulong),
- sym_hdr.cbRfdOffset, "Relative file tables");
+ rfile_desc = (ulong *) read_seek (NULL, sym_hdr.crfd * sizeof (ulong),
+ sym_hdr.cbRfdOffset,
+ "Relative file tables");
- e_symbols = read_seek (NULL, sym_hdr.iextMax * sizeof (EXTR),
- sym_hdr.cbExtOffset, "External symbols");
+ e_symbols = (EXTR *) read_seek (NULL, sym_hdr.iextMax * sizeof (EXTR),
+ sym_hdr.cbExtOffset, "External symbols");
}
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 56a953747e4..87b278ab4d6 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -4469,7 +4469,7 @@ copy_object (void)
(in case there are duplicate filenames, we collapse them into one
file section, the MIPS assembler may or may not collapse them). */
- remap_file_number = alloca (sizeof (int) * orig_sym_hdr.ifdMax);
+ remap_file_number = (int *) alloca (sizeof (int) * orig_sym_hdr.ifdMax);
for (fd = delete_ifd; fd < orig_sym_hdr.ifdMax; fd++)
{
diff --git a/gcc/opts.c b/gcc/opts.c
index 591094d6182..5e97bdd4ec6 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2059,6 +2059,7 @@ common_handle_option (size_t scode, const char *arg, int value,
case OPT_ftree_store_copy_prop:
case OPT_fforce_addr:
case OPT_ftree_salias:
+ case OPT_ftree_store_ccp:
/* These are no-ops, preserved for backward compatibility. */
break;
diff --git a/gcc/passes.c b/gcc/passes.c
index b7020ca0acd..860a082a1f1 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -574,6 +574,7 @@ init_optimization_passes (void)
}
NEXT_PASS (pass_release_ssa_names);
NEXT_PASS (pass_rebuild_cgraph_edges);
+ NEXT_PASS (pass_inline_parameters);
}
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_matrix_reorg);
diff --git a/gcc/predict.c b/gcc/predict.c
index b69934f4778..5ed6c431355 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -203,7 +203,8 @@ bool
optimize_function_for_size_p (struct function *fun)
{
return (optimize_size
- || fun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED);
+ || (fun && (fun->function_frequency
+ == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)));
}
/* Return true when current function should always be optimized for speed. */
diff --git a/gcc/profile.c b/gcc/profile.c
index 883515d9a17..0ece72519d9 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -277,8 +277,20 @@ is_edge_inconsistent (VEC(edge,gc) *edges)
{
if (!EDGE_INFO (e)->ignore)
{
- if (e->count < 0)
- return true;
+ if (e->count < 0
+ && ((!e->flags & EDGE_FAKE)
+ || !block_ends_with_call_p (e->src)))
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file,
+ "Edge %i->%i is inconsistent, count"HOST_WIDEST_INT_PRINT_DEC,
+ e->src->index, e->dest->index, e->count);
+ dump_bb (e->src, dump_file, 0);
+ dump_bb (e->dest, dump_file, 0);
+ }
+ return true;
+ }
}
}
return false;
@@ -307,20 +319,59 @@ static bool
is_inconsistent (void)
{
basic_block bb;
+ bool inconsistent = false;
FOR_EACH_BB (bb)
{
- if (is_edge_inconsistent (bb->preds))
- return true;
- if (is_edge_inconsistent (bb->succs))
- return true;
- if ( bb->count != sum_edge_counts (bb->preds)
- || (bb->count != sum_edge_counts (bb->succs) &&
- !(find_edge (bb, EXIT_BLOCK_PTR) != NULL &&
- block_ends_with_call_p (bb))))
- return true;
+ inconsistent |= is_edge_inconsistent (bb->preds);
+ if (!dump_file && inconsistent)
+ return true;
+ inconsistent |= is_edge_inconsistent (bb->succs);
+ if (!dump_file && inconsistent)
+ return true;
+ if (bb->count < 0)
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "BB %i count is negative "
+ HOST_WIDEST_INT_PRINT_DEC,
+ bb->index,
+ bb->count);
+ dump_bb (bb, dump_file, 0);
+ }
+ inconsistent = true;
+ }
+ if (bb->count != sum_edge_counts (bb->preds))
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "BB %i count does not match sum of incomming edges "
+ HOST_WIDEST_INT_PRINT_DEC" should be " HOST_WIDEST_INT_PRINT_DEC,
+ bb->index,
+ bb->count,
+ sum_edge_counts (bb->preds));
+ dump_bb (bb, dump_file, 0);
+ }
+ inconsistent = true;
+ }
+ if (bb->count != sum_edge_counts (bb->succs) &&
+ ! (find_edge (bb, EXIT_BLOCK_PTR) != NULL && block_ends_with_call_p (bb)))
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "BB %i count does not match sum of outgoing edges "
+ HOST_WIDEST_INT_PRINT_DEC" should be " HOST_WIDEST_INT_PRINT_DEC,
+ bb->index,
+ bb->count,
+ sum_edge_counts (bb->succs));
+ dump_bb (bb, dump_file, 0);
+ }
+ inconsistent = true;
+ }
+ if (!dump_file && inconsistent)
+ return true;
}
- return false;
+ return inconsistent;
}
/* Set each basic block count to the sum of its outgoing edge counts */
diff --git a/gcc/stmt.c b/gcc/stmt.c
index ee880964fe1..199967e1062 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1958,66 +1958,6 @@ expand_stack_restore (tree var)
emit_stack_restore (SAVE_BLOCK, sa, NULL_RTX);
}
-/* DECL is an anonymous union. CLEANUP is a cleanup for DECL.
- DECL_ELTS is the list of elements that belong to DECL's type.
- In each, the TREE_VALUE is a VAR_DECL, and the TREE_PURPOSE a cleanup. */
-
-void
-expand_anon_union_decl (tree decl, tree cleanup ATTRIBUTE_UNUSED,
- tree decl_elts)
-{
- rtx x;
- tree t;
-
- /* If any of the elements are addressable, so is the entire union. */
- for (t = decl_elts; t; t = TREE_CHAIN (t))
- if (TREE_ADDRESSABLE (TREE_VALUE (t)))
- {
- TREE_ADDRESSABLE (decl) = 1;
- break;
- }
-
- expand_decl (decl);
- x = DECL_RTL (decl);
-
- /* Go through the elements, assigning RTL to each. */
- for (t = decl_elts; t; t = TREE_CHAIN (t))
- {
- tree decl_elt = TREE_VALUE (t);
- enum machine_mode mode = TYPE_MODE (TREE_TYPE (decl_elt));
- rtx decl_rtl;
-
- /* If any of the elements are addressable, so is the entire
- union. */
- if (TREE_USED (decl_elt))
- TREE_USED (decl) = 1;
-
- /* Propagate the union's alignment to the elements. */
- DECL_ALIGN (decl_elt) = DECL_ALIGN (decl);
- DECL_USER_ALIGN (decl_elt) = DECL_USER_ALIGN (decl);
-
- /* If the element has BLKmode and the union doesn't, the union is
- aligned such that the element doesn't need to have BLKmode, so
- change the element's mode to the appropriate one for its size. */
- if (mode == BLKmode && DECL_MODE (decl) != BLKmode)
- DECL_MODE (decl_elt) = mode
- = mode_for_size_tree (DECL_SIZE (decl_elt), MODE_INT, 1);
-
- if (mode == GET_MODE (x))
- decl_rtl = x;
- else if (MEM_P (x))
- /* (SUBREG (MEM ...)) at RTL generation time is invalid, so we
- instead create a new MEM rtx with the proper mode. */
- decl_rtl = adjust_address_nv (x, mode, 0);
- else
- {
- gcc_assert (REG_P (x));
- decl_rtl = gen_lowpart_SUBREG (mode, x);
- }
- SET_DECL_RTL (decl_elt, decl_rtl);
- }
-}
-
/* Do the insertion of a case label into case_list. The labels are
fed to us in descending order from the sorted vector of case labels used
in the tree part of the middle end. So the list we construct is
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index aaeb46c1464..185c066b9ba 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,217 @@
+2008-09-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37429
+ * gfortran.dg/typebound_call_7.f03: New test.
+ * gfortran.dg/typebound_call_8.f03: New test.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37354
+ PR middle-end/30165
+ * g++.dg/torture/pr37354.C: New testcase.
+
+2008-09-09 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/37442
+ * gcc.target/i386/pr12329.c: Place error message on function name
+ line.
+ * gcc.target/i386/sse-5.c: Same.
+
+2008-09-09 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/always_inline.c: Place error message on function
+ name line.
+ * gcc.dg/winline-6.c: Same.
+ * gcc.dg/noreturn-1.c: Same.
+ * gcc.dg/noreturn-7.c: Same.
+ * gcc.dg/inline-14.c: Same.
+ * gcc.dg/always_inline3.c: Same.
+ * gcc.dg/winline-3.c: Same.
+ * gcc.dg/wtr-func-def-1.c: Same.
+ * gcc.dg/winline-5.c: Same.
+ * gcc.dg/winline-7.c: Same.
+ * gcc.dg/winline-9.c: Same.
+ * gcc.dg/noreturn-4.c: Same.
+ * gcc.dg/20041213-1.c: Use column numbers.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37433
+ * gcc.c-torture/compile/pr37433.c: New testcase.
+
+2008-09-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37387
+ * gcc.c-torture/compile/pr37387.c: New testcase.
+
+2008-09-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37411
+ * gfortran.dg/array_function_4.f90: New test.
+
+2008-09-08 Daniel Jacobowitz <dan@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/compat/eh/filter2_x.C: Declare abort.
+ * g++.dg/compat/eh/new1_x.C, g++.dg/compat/eh/new1_y.C: Include
+ cstddef and use std::size_t.
+
+ * gcc.dg/compat/compat-common.h: Define SKIP_COMPLEX_INT if
+ SKIP_COMPLEX. Honor SKIP_COMPLEX.
+ * gcc.dg/compat/scalar-by-value-3_x.c,
+ gcc.dg/compat/scalar-by-value-3_y.c,
+ gcc.dg/compat/scalar-by-value-4_x.c,
+ gcc.dg/compat/scalar-by-value-4_y.c,
+ gcc.dg/compat/scalar-by-value-5.c,
+ gcc.dg/compat/scalar-by-value-5_main.c,
+ gcc.dg/compat/scalar-by-value-6.c,
+ gcc.dg/compat/scalar-by-value-6_main.c,
+ gcc.dg/compat/scalar-by-value-6_x.c,
+ gcc.dg/compat/scalar-by-value-6_y.c,
+ gcc.dg/compat/struct-by-value-16_x.c,
+ gcc.dg/compat/struct-by-value-16_y.c,
+ gcc.dg/compat/struct-by-value-16a_x.c,
+ gcc.dg/compat/struct-by-value-16a_y.c,
+ gcc.dg/compat/struct-by-value-17_x.c,
+ gcc.dg/compat/struct-by-value-17_y.c,
+ gcc.dg/compat/struct-by-value-17a_x.c,
+ gcc.dg/compat/struct-by-value-17a_y.c,
+ gcc.dg/compat/struct-by-value-18_x.c,
+ gcc.dg/compat/struct-by-value-18_y.c,
+ gcc.dg/compat/struct-by-value-18a_x.c,
+ gcc.dg/compat/struct-by-value-18a_y.c,
+ gcc.dg/compat/struct-layout-1.h,
+ gcc.dg/compat/scalar-return-3_x.c,
+ gcc.dg/compat/scalar-return-3_y.c,
+ gcc.dg/compat/scalar-return-4_x.c,
+ gcc.dg/compat/scalar-return-4_y.c: Honor SKIP_COMPLEX.
+
+ * gcc.dg/compat/scalar-by-value-y.h: Use stdarg.h for non-GCC
+ compilers.
+
+ * gcc.dg/compat/struct-by-value-22_y.c,
+ gcc.dg/compat/struct-by-value-22_main.c,
+ gcc.dg/compat/struct-by-value-22_x.c: Honor SKIP_VLA_IN_STRUCT.
+
+ * lib/c-compat.exp (compat_setup_dfp): Check the compiler under test
+ first.
+ * lib/compat.exp: Document COMPLEX and VLA_IN_STRUCT skips.
+
+2008-09-08 Andy Hutchinson <hutchinsonandy@aim.com>
+
+ * gcc.dg/struct/wo_prof_escape_substr_value.c: Limit allocation
+ based on STACK_SIZE.
+ * gcc.dg/struct/wo_prof_array_through_pointer.c: Ditto.
+ * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Ditto.
+ * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Limit allocation
+ based on STACK_SIZE. Check malloc return for NULL.
+ * gcc.dg/struct/w_prof_local_var.c: Ditto.
+ * gcc.dg/struct/wo_prof_mult_field_peeling.c: Ditto.
+ * gcc.dg/struct/w_prof_local_array.c: Limit allocation based on
+ STACK_SIZE. XFAIL AVR target.
+ * gcc.dg/struct/wo_prof_local_array.c: Ditto.
+ * gcc.dg/struct/w_prof_two_strs.c: Limit allocation based on
+ STACK_SIZE. Limit random size to N.
+ * gcc.dg/struct/wo_prof_two_strs.c: Limit allocation based on
+ STACK_SIZE. XFAIL AVR target. Limit random size to N.
+ * gcc.dg/struct/w_prof_single_str_global.c: XFAIL AVR target.
+ * gcc.dg/struct/wo_prof_array_field.c: Ditto.
+ * gcc.dg/struct/wo_prof_double_malloc.c: Ditto.
+ * gcc.dg/struct/wo_prof_global_array.c: Ditto.
+ * gcc.dg/struct/wo_prof_single_str_global.c: Ditto.
+ * gcc.dg/struct/wo_prof_single_str_local.c: Ditto.
+ * gcc.dg/struct/w_prof_global_var.c: Limit allocation based on
+ STACK_SIZE. Check malloc return for NULL. XFAIL AVR target.
+ * gcc.dg/struct/wo_prof_global_var.c: Ditto.
+ * gcc.dg/struct/wo_prof_local_var.c: Ditto.
+ * gcc.dg/struct/wo_prof_malloc_size_var.c: Access only allocated
+ space. Limit allocation based on STACK_SIZE. XFAIL AVR target.
+
+2008-09-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * g++.dg/cdce3.C: Require c99 runtime.
+
+2008-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37393
+ * g++.dg/tree-ssa/pr37393.C: New test.
+
+ PR middle-end/37414
+ * g++.dg/opt/init2.C: New test.
+
+ PR middle-end/37337
+ * g++.dg/tree-ssa/pr37337.C: New test.
+
+2008-09-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37421
+ * g++.dg/torture/pr37421.C: New testcase.
+
+2008-09-08 Daniel Kraft <d@domob.eu>
+
+ PR fortran/36167
+ * gfortran.dg/array_function_3.f90: New test.
+ * gfortran.dg/save_3.f90: Added cleanup-modules directive.
+ * gfortran.dg/string_compare_1.f90: Ditto.
+
+2008-09-08 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37199
+ * gfortran.dg/array_function_2.f90: New test.
+
+2008-09-08 Tobias Burnus <burnus@net.b.de>
+
+ PR fortran/37400
+ * gfortran.dg/implicit_12.f90: New test.
+
+2008-09-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/37203
+ * gfortran.d/reshape_order_1.f90: New test case.
+ * gfortran.d/reshape_order_2.f90: New test case.
+ * gfortran.d/reshape_order_3.f90: New test case.
+ * gfortran.d/reshape_order_4.f90: New test case.
+
+2008-09-07 Richard Guenther <rguenther@suse.de>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/36630
+ * gcc.dg/vect/pr36630.c: New test.
+
+2008-09-07 Daniel Kraft <d@domob.eu>
+
+ * gfortran.dg/stfunc_6.f90: Extended testcase to include more tests
+ related to PURE and statement functions.
+
+2008-09-07 Dorit Nuzman <dorit@il.ibm.com>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/35642
+ * lib/target-supports.exp (check_effective_target_vect_short_mult):
+ Add powerpc.
+
+2008-09-07 Victor Kaplansky <victork@il.ibm.com>
+
+ PR testsuite/37334
+ * gcc/testsuite/gcc.dg/fastmath-2.c: Add volatile to
+ definition of b, change -ffast-math to -ffinite-math-only
+ and rename test to ...
+ * gcc/testsuite/gcc.dg/div-double-1.c: ... this.
+
+2008-09-06 Jeff Law <law@redhat.com>
+
+ * gcc.c-torture/execute/memcpy-bi.c: Include <string.h>
+
+2008-09-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37399
+ * gfortran.dg/size_kind.f90: Remove allocate statement
+ as it overflows at compile time on 32bit systems.
+
+2008-09-06 Jan Hubicka <jh@suse.cz>
+
+ * g++.dg/tree-ssa-pr14703.C: New testcase.
+
2008-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/36153
diff --git a/gcc/testsuite/g++.dg/cdce3.C b/gcc/testsuite/g++.dg/cdce3.C
index 19f7f0b295a..d70fa6de979 100644
--- a/gcc/testsuite/g++.dg/cdce3.C
+++ b/gcc/testsuite/g++.dg/cdce3.C
@@ -1,10 +1,10 @@
/* { dg-do run } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -DNO_GNU_EXTENSION -lm" { target "*-*-darwin*" } } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" { target { {! "*-*-darwin*" } && large_long_double } } }*/
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -DNO_LONG_DOUBLE -lm" { target {! large_long_double } } } */
-/* { dg-final { scan-tree-dump "cdce3.C:89: note: function call is shrink-wrapped into error conditions\." "cdce" { target {! "*-*-darwin*" } } } }*/
/* { dg-final { scan-tree-dump "cdce3.C:90: note: function call is shrink-wrapped into error conditions\." "cdce" { target {! "*-*-darwin*" } } } }*/
-/* { dg-final { scan-tree-dump "cdce3.C:92: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
+/* { dg-final { scan-tree-dump "cdce3.C:91: note: function call is shrink-wrapped into error conditions\." "cdce" { target {! "*-*-darwin*" } } } }*/
/* { dg-final { scan-tree-dump "cdce3.C:93: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { scan-tree-dump "cdce3.C:94: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { scan-tree-dump "cdce3.C:95: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
@@ -18,6 +18,7 @@
/* { dg-final { scan-tree-dump "cdce3.C:103: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { scan-tree-dump "cdce3.C:104: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { scan-tree-dump "cdce3.C:105: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
+/* { dg-final { scan-tree-dump "cdce3.C:106: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { cleanup-tree-dump "cdce" } } */
#include <stdlib.h>
#include <math.h>
diff --git a/gcc/testsuite/g++.dg/compat/eh/filter2_x.C b/gcc/testsuite/g++.dg/compat/eh/filter2_x.C
index cdbfffffdd1..287ffc7bd89 100644
--- a/gcc/testsuite/g++.dg/compat/eh/filter2_x.C
+++ b/gcc/testsuite/g++.dg/compat/eh/filter2_x.C
@@ -1,6 +1,8 @@
#include <exception>
#include <cstdlib>
+extern "C" void abort (void);
+
extern void my_terminate (void);
extern void ex_test (void);
diff --git a/gcc/testsuite/g++.dg/compat/eh/new1_x.C b/gcc/testsuite/g++.dg/compat/eh/new1_x.C
index 4ca3be0af90..12128717089 100644
--- a/gcc/testsuite/g++.dg/compat/eh/new1_x.C
+++ b/gcc/testsuite/g++.dg/compat/eh/new1_x.C
@@ -1,9 +1,10 @@
#include <new>
+#include <cstddef>
extern "C" void exit (int);
extern "C" void abort (void);
-extern void * operator new[] (size_t s) throw (std::bad_alloc);
+extern void * operator new[] (std::size_t s) throw (std::bad_alloc);
extern void operator delete[] (void *p) throw ();
struct A
diff --git a/gcc/testsuite/g++.dg/compat/eh/new1_y.C b/gcc/testsuite/g++.dg/compat/eh/new1_y.C
index c448cbed8d2..fbe0e214591 100644
--- a/gcc/testsuite/g++.dg/compat/eh/new1_y.C
+++ b/gcc/testsuite/g++.dg/compat/eh/new1_y.C
@@ -1,9 +1,10 @@
#include <new>
+#include <cstddef>
extern int ret;
void *ptr;
-void * operator new[] (size_t s) throw (std::bad_alloc)
+void * operator new[] (std::size_t s) throw (std::bad_alloc)
{
ptr = operator new (s);
return ptr;
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto2.C b/gcc/testsuite/g++.dg/cpp0x/auto2.C
index a3df9d1927e..626e9e245d4 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto2.C
@@ -69,4 +69,6 @@ int main()
case 42:
break;
}
+
+ auto j = 42, k = 24;
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto3.C b/gcc/testsuite/g++.dg/cpp0x/auto3.C
index dc4218bf023..769d987c961 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto3.C
@@ -5,6 +5,10 @@
auto x; // { dg-error "auto" }
+// If the type deduced for the template parameter U is not the same in each
+// deduction, the program is ill-formed.
+auto i = 42, j = 42.0; // { dg-error "" "" { xfail *-*-* } }
+
// New CWG issue
auto a[2] = { 1, 2 }; // { dg-error "auto" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto6.C b/gcc/testsuite/g++.dg/cpp0x/auto6.C
index ac209934869..a574f54758f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto6.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto6.C
@@ -6,4 +6,20 @@ auto f() -> int
}
template<class T, class U>
-auto add(T t, U u) -> decltype (t+u); // { dg-bogus "not declared" "" { xfail *-*-* } }
+auto add(T t, U u) -> decltype (t+u);
+
+template<class T, class U>
+decltype(T()+U()) add2(T t, U u);
+
+template <class T, class U>
+U g (T, U);
+
+template<class T, class U>
+auto add3(T t, U u) -> decltype (g(t,u));
+
+int main()
+{
+ auto i = add(1, 2.0);
+ auto i2 = add2(1, 2.0);
+ auto i3 = add3(1, 2.0);
+}
diff --git a/gcc/testsuite/g++.dg/opt/init2.C b/gcc/testsuite/g++.dg/opt/init2.C
new file mode 100644
index 00000000000..3c3bc939d76
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/init2.C
@@ -0,0 +1,6 @@
+// PR middle-end/37414
+// { dg-do compile }
+// { dg-options "-O2 -ffast-math" }
+
+double x = 6.0;
+double y = x * x;
diff --git a/gcc/testsuite/g++.dg/other/error15.C b/gcc/testsuite/g++.dg/other/error15.C
index 0a5bae1b3c0..3601852322a 100644
--- a/gcc/testsuite/g++.dg/other/error15.C
+++ b/gcc/testsuite/g++.dg/other/error15.C
@@ -3,58 +3,54 @@
extern void g0 (int a, int b);
extern void g1 (int a, float b);
-extern void f0 (int a,
- int a); // { dg-error "multiple parameters named 'a'" }
-extern void f1 (int a,
- float a); // { dg-error "multiple parameters named 'a'" }
-extern void f3 (int a, int b, int c,
- int a); // { dg-error "multiple parameters named 'a'" }
-extern void f4 (int a, int b, int c,
- int a,
- int a); // { dg-error "multiple parameters named 'a'" }
-extern void f5 (int a, int b, int c, int d, int e, int f, int g, int h,
- int a,
+extern void f0 (int a, // { dg-error "previous" }
+ int a); // { dg-error "redefinition" }
+extern void f1 (int a, // { dg-error "previous" }
+ float a); // { dg-error "conflicting" }
+extern void f3 (int a, int b, int c, // { dg-error "previous" }
+ int a); // { dg-error "redefinition" }
+extern void f4 (int a, int b, int c, // { dg-error "previous" }
+ int a, // { dg-error "redefinition" }
+ int a); // { dg-error "redefinition" }
+extern void f5 (int a, int b, int c, int d, int e, int f, int g, int h, // { dg-error "previous" }
+ int a, // { dg-error "redefinition" }
int i, int j, int k, int l, int m, int n, int o, int p,
int q, int r, int s, int t, int u, int v, int w, int x, int y,
- int z); // { dg-error "multiple parameters named 'a'" }
+ int z);
-extern void f6 (int a, int, int, int, int, int, int, int, int, int, int,
- int a,
+extern void f6 (int a, int, int, int, int, int, int, int, int, int, int, // { dg-error "previous" }
+ int a, // { dg-error "redefinition" }
int, int, int, int, int, int, int, int, int, int, int,
float, float, float, float, float, float, float, float,
- int); // { dg-error "multiple parameters named 'a'" }
-
-extern void f7 (void (*a)(int),
- void (*a)(int)); // { dg-error "multiple parameters named 'a'" }
-extern void f8 (float (*a)(int),
- int (*a)(float)); // { dg-error "multiple parameters named 'a'" }
-
-extern void f9 (int a,
- int a,
- int a);
-// { dg-error "multiple parameters named 'a'" "" { target *-*-* } 34 }
-
-extern void f10 (int a,
- int b,
- int c,
- int c,
- int b,
- int a);
-// { dg-error "multiple parameters named 'a'" "" { target *-*-* } 42 }
-// { dg-error "multiple parameters named 'b'" "" { target *-*-* } 42 }
-// { dg-error "multiple parameters named 'c'" "" { target *-*-* } 42 }
+ int);
+
+extern void f7 (void (*a)(int), // { dg-error "previous" }
+ void (*a)(int)); // { dg-error "redefinition" }
+extern void f8 (float (*a)(int), // { dg-error "previous" }
+ int (*a)(float)); // { dg-error "conflicting" }
+
+extern void f9 (int a, // { dg-error "previous" }
+ int a, // { dg-error "redefinition" }
+ int a); // { dg-error "redefinition" }
+
+extern void f10 (int a, // { dg-error "previous" }
+ int b, // { dg-error "previous" }
+ int c, // { dg-error "previous" }
+ int c, // { dg-error "redefinition" }
+ int b, // { dg-error "redefinition" }
+ int a); // { dg-error "redefinition" }
class C1 {
public:
void C1_g0 (int a, int b);
- void C1_f0 (int a,
- int a); // { dg-error "multiple parameters named 'a'" }
+ void C1_f0 (int a, // { dg-error "previous" }
+ int a); // { dg-error "redefinition" }
};
template <class T>
class C2 {
public:
void C2_g0 (T a, T b);
- void C2_f0 (T a,
- T a); // { dg-error "multiple parameters named 'a'" }
+ void C2_f0 (T a, // { dg-error "previous" }
+ T a); // { dg-error "redefinition" }
};
diff --git a/gcc/testsuite/g++.dg/other/error6.C b/gcc/testsuite/g++.dg/other/error6.C
index 9b403c7207b..21180d765ab 100644
--- a/gcc/testsuite/g++.dg/other/error6.C
+++ b/gcc/testsuite/g++.dg/other/error6.C
@@ -1,6 +1,7 @@
// { dg-do compile }
// Make sure we emit a decent error message when trying to mangle an
// expression not supported by the C++ ABI due to a defect.
+// Update: Better to make it supported, I think...
template <int N>
struct A {};
@@ -15,5 +16,5 @@ A<sizeof(T::foo())> func(void);
int main()
{
- func<B>(); // { dg-error "sorry, unimplemented" }
+ func<B>();
}
diff --git a/gcc/testsuite/g++.dg/other/pr28114.C b/gcc/testsuite/g++.dg/other/pr28114.C
index e16f6b589e5..e370f717c3a 100644
--- a/gcc/testsuite/g++.dg/other/pr28114.C
+++ b/gcc/testsuite/g++.dg/other/pr28114.C
@@ -5,5 +5,5 @@ template<int> void foo(struct {}*); // { dg-error "" }
void bar()
{
- foo<0>(0);
+ foo<0>(0); // { dg-error "" }
}
diff --git a/gcc/testsuite/g++.dg/parse/error3.C b/gcc/testsuite/g++.dg/parse/error3.C
index 1f337e91cde..2856850fb76 100644
--- a/gcc/testsuite/g++.dg/parse/error3.C
+++ b/gcc/testsuite/g++.dg/parse/error3.C
@@ -6,14 +6,4 @@ static void InstantiateConstraint(const float&, unsigned,
char*, char*,
unsigned*));
// { dg-error "64: error: expected ',' or '...' before '&' token" "" { target *-*-* } { 5 } }
-
-/// in the coming test, the column information is broken as it points to
-// the end of the declaration instead of pointing to the begining of the
-// 'TYPE' identifier. This is due to the warning being generated by the
-// declaration groking code (gcc/cp/decl.c) and not the parser. So in that
-// code, the exact token location information is lost as the declaration
-// groking code manipulates TREEs only. The token location used is then
-// the global one that is not accurate enough. Anyway, let's say it is
-// good enough for now, until we find a way to propagate token location to
-// code paths that manipulate TREEs only.
-// { dg-error "64: error: ISO C\\+\\+ forbids declaration of 'TYPE' with no type" "" { target *-*-* } { 7 } }
+// { dg-error "60: error: ISO C\\+\\+ forbids declaration of 'TYPE' with no type" "" { target *-*-* } { 5 } }
diff --git a/gcc/testsuite/g++.dg/torture/pr37354.C b/gcc/testsuite/g++.dg/torture/pr37354.C
new file mode 100644
index 00000000000..acdf2911063
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr37354.C
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+class GenericClass;
+struct AlsaDriver
+{
+ virtual int _read (unsigned nframes);
+};
+typedef void (GenericClass::*GenericMemFuncType) ();
+GenericMemFuncType m_pFunction;
+void AlsaDriver1 ()
+{
+ m_pFunction = reinterpret_cast < GenericMemFuncType > (&AlsaDriver::_read);
+}
+
diff --git a/gcc/testsuite/g++.dg/torture/pr37421.C b/gcc/testsuite/g++.dg/torture/pr37421.C
new file mode 100644
index 00000000000..4b8447eac49
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr37421.C
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+
+#include <stdio.h>
+#include <string.h>
+
+inline int
+bci (const float &source)
+{
+ int dest;
+ memcpy (&dest, &source, sizeof (dest));
+ return dest;
+}
+
+inline float
+bcf (const int &source)
+{
+ float dest;
+ memcpy (&dest, &source, sizeof (dest));
+ return dest;
+}
+
+float
+Foo ()
+{
+ const int foo = bci (0.0f);
+ int bar = foo;
+ const int baz = foo & 1;
+ if (!baz && (foo & 2))
+ bar = 0;
+ return bcf (bar);
+}
+
+int
+main ()
+{
+ printf ("Foo() = %f\n", Foo());
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr14703.C b/gcc/testsuite/g++.dg/tree-ssa/pr14703.C
new file mode 100644
index 00000000000..58705277ec5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr14703.C
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-ipa-reference" } */
+#include <iostream>
+
+namespace {
+template <unsigned long long L> class fib {
+ public:
+ static const unsigned long long value = fib<L - 1>::value + fib<L - 2>::value;
+};
+
+template <> class fib<0> {
+ public:
+ static const unsigned long long value = 1;
+};
+
+template <> class fib<1> {
+ public:
+ static const unsigned long long value = 1;
+};
+
+template<unsigned long long L> inline unsigned long long fibconst()
+{
+ return fibconst<L - 1>() + fibconst<L - 2>();
+}
+
+template <> inline unsigned long long fibconst<0>()
+{
+ return 1ull;
+}
+
+template <> inline unsigned long long fibconst<1>()
+{
+ return 1ull;
+}
+
+template <> inline unsigned long long fibconst<2>()
+{
+ return 2ull;
+}
+
+}
+
+int main()
+{
+ ::std::cerr << "fib<90>::value == " << fib<90>::value << "\n";
+ ::std::cerr << "fibcst<90>() == " << fibconst<90>() << "\n";
+}
+// { dg-final { scan-tree-dump-not "fibconst" "optimized" } }
+// { dg-final { cleanup-tree-dump "optimized" } }
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr37337.C b/gcc/testsuite/g++.dg/tree-ssa/pr37337.C
new file mode 100644
index 00000000000..5b8521df8db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr37337.C
@@ -0,0 +1,37 @@
+// PR middle-end/37337
+// { dg-do compile }
+// { dg-options "-O2" }
+
+extern "C"
+{
+ typedef struct _IO_FILE FILE;
+ extern int __fprintf_chk (FILE *, int, const char *, ...);
+ extern inline __attribute__ ((always_inline, gnu_inline, artificial))
+ int fprintf (FILE *s, const char *f, ...)
+ {
+ return __fprintf_chk (s, 1, f, __builtin_va_arg_pack ());
+ }
+}
+
+extern int a;
+struct A
+{
+ virtual ~A (void)
+ {
+ }
+};
+
+struct B : public A
+{
+ B ();
+ FILE *b;
+};
+
+void f (int *);
+B::B ()
+{
+ f (&a);
+ for (int i = 0; i < 6; i++)
+ fprintf (b, "%02x", 0xff);
+ fprintf (b, "\n--\n");
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr37393.C b/gcc/testsuite/g++.dg/tree-ssa/pr37393.C
new file mode 100644
index 00000000000..2f9281c9657
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr37393.C
@@ -0,0 +1,27 @@
+// PR middle-end/37393
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct A
+{
+ ~A ();
+ bool foo () const;
+};
+
+extern "C"
+{
+ extern void bar (const char *, ...) __attribute__ ((noreturn));
+ extern inline __attribute__ ((always_inline, gnu_inline, artificial)) void
+ baz (const char *fmt, ...)
+ {
+ bar (fmt, __builtin_va_arg_pack ());
+ }
+};
+
+void
+test ()
+{
+ A a;
+ if (a.foo ())
+ baz ("foo");
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rfg16.C b/gcc/testsuite/g++.old-deja/g++.jason/rfg16.C
index 6a39ff42e3d..d42516d4fcf 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/rfg16.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/rfg16.C
@@ -1,5 +1,5 @@
// { dg-do assemble }
// Bug: g++ doesn't push parameter decls as they are parsed.
-void (*ptr) (int foo, int array[sizeof(foo)]); // { dg-bogus "" "" { xfail *-*-* } }
-void test2 (int bar, int array[sizeof(bar)]) { } // { dg-bogus "" "" { xfail *-*-* } }
+void (*ptr) (int foo, int array[sizeof(foo)]);
+void test2 (int bar, int array[sizeof(bar)]) { }
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template1.C b/gcc/testsuite/g++.old-deja/g++.oliva/template1.C
index 133899e55e8..8ac05146866 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/template1.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/template1.C
@@ -11,5 +11,5 @@ template<int P = 0> struct foo {
};
void bar() {
- foo<>::bar(0); // { dg-error "" "" } instantiated from here
+ foo<>::bar(0);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C
index c14ca235772..808f233c648 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C
@@ -9,7 +9,7 @@ struct S
void f(U u);
template <class U>
- void g(U U);
+ void g(U u);
int c[16];
};
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37387.c b/gcc/testsuite/gcc.c-torture/compile/pr37387.c
new file mode 100644
index 00000000000..d338933e6ec
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37387.c
@@ -0,0 +1,11 @@
+typedef long int Int;
+void FuncMakeConsequencesPres (long *objDefs1)
+{
+ long a = (long)objDefs1;
+ int c = a & 0x01;
+ int b = 0;
+ if (! ( 13 <= ( c ? 0 : (((int) objDefs1 & 0x02) ? 0 : *objDefs1 ))
+ && b <= 0))
+ ErrorQuit ();
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37433.c b/gcc/testsuite/gcc.c-torture/compile/pr37433.c
new file mode 100644
index 00000000000..0ba1179886c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37433.c
@@ -0,0 +1,11 @@
+int regex_subst(void)
+{
+ const void *subst = "";
+ return (*(int (*)(int))subst) (0);
+}
+
+int foobar (void)
+{
+ int x;
+ return (*(int (*)(void))&x) ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/memcpy-bi.c b/gcc/testsuite/gcc.c-torture/execute/memcpy-bi.c
index c6d6e035346..40b1030802e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/memcpy-bi.c
+++ b/gcc/testsuite/gcc.c-torture/execute/memcpy-bi.c
@@ -1,4 +1,5 @@
/* Test builtin-memcpy (which may emit different code for different N). */
+#include <string.h>
#define TESTSIZE 80
diff --git a/gcc/testsuite/gcc.dg/20041213-1.c b/gcc/testsuite/gcc.dg/20041213-1.c
index be1ab00241c..aeff7443ce2 100644
--- a/gcc/testsuite/gcc.dg/20041213-1.c
+++ b/gcc/testsuite/gcc.dg/20041213-1.c
@@ -1,33 +1,33 @@
/* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-fshow-column" } */
/* test redeclarations with void and implicit int */
-extern foo1(); /* { dg-message "note: previous declaration" } */
-extern void foo1(); /* { dg-error "conflicting types" } */
+extern foo1(); /* { dg-message "8:note: previous declaration" } */
+extern void foo1(); /* { dg-error "13:conflicting types" } */
-extern void foo2(); /* { dg-message "note: previous declaration" } */
-extern foo2(); /* { dg-error "conflicting types" } */
+extern void foo2(); /* { dg-message "13:note: previous declaration" } */
+extern foo2(); /* { dg-error "8:conflicting types" } */
-void foo3() {} /* { dg-message "note: previous definition" } */
-extern foo3(); /* { dg-error "conflicting types" } */
+void foo3() {} /* { dg-message "6:note: previous definition" } */
+extern foo3(); /* { dg-error "8:conflicting types" } */
-extern foo4(); /* { dg-message "note: previous declaration" } */
-void foo4() {} /* { dg-error "conflicting types" } */
+extern foo4(); /* { dg-message "8:note: previous declaration" } */
+void foo4() {} /* { dg-error "6:conflicting types" } */
-extern void foo5(); /* { dg-message "note: previous declaration" } */
-foo5() {} /* { dg-warning "conflicting types" } */
+extern void foo5(); /* { dg-message "13:note: previous declaration" } */
+foo5() {} /* { dg-warning "1:conflicting types" } */
-foo6() {} /* { dg-message "note: previous definition" } */
-extern void foo6(); /* { dg-error "conflicting types" } */
+foo6() {} /* { dg-message "1:note: previous definition" } */
+extern void foo6(); /* { dg-error "13:conflicting types" } */
-foo7() {} /* { dg-message "note: previous definition" } */
-void foo7() {} /* { dg-error "conflicting types" } */
+foo7() {} /* { dg-message "1:note: previous definition" } */
+void foo7() {} /* { dg-error "6:conflicting types" } */
-void foo8() {} /* { dg-message "note: previous definition" } */
-foo8() {} /* { dg-error "conflicting types" } */
+void foo8() {} /* { dg-message "6:note: previous definition" } */
+foo8() {} /* { dg-error "1:conflicting types" } */
int use9() { foo9(); } /* { dg-message "note: previous implicit declaration" } */
-extern void foo9(); /* { dg-warning "conflicting types" } */
+extern void foo9(); /* { dg-warning "13:conflicting types" } */
int use10() { foo10(); } /* { dg-message "note: previous implicit declaration" } */
-void foo10() {} /* { dg-warning "conflicting types" } */
+void foo10() {} /* { dg-warning "6:conflicting types" } */
diff --git a/gcc/testsuite/gcc.dg/always_inline.c b/gcc/testsuite/gcc.dg/always_inline.c
index 3233741896a..08119f1a254 100644
--- a/gcc/testsuite/gcc.dg/always_inline.c
+++ b/gcc/testsuite/gcc.dg/always_inline.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2" } */
#include <stdarg.h>
inline __attribute__ ((always_inline)) void
-e(int t, ...)
-{ /* { dg-message "sorry\[^\n\]*variable argument" "" } */
+e(int t, ...) /* { dg-message "sorry\[^\n\]*variable argument" "" } */
+{
va_list q;
va_start (q, t);
}
diff --git a/gcc/testsuite/gcc.dg/always_inline3.c b/gcc/testsuite/gcc.dg/always_inline3.c
index db06843c7d0..97c80aa5217 100644
--- a/gcc/testsuite/gcc.dg/always_inline3.c
+++ b/gcc/testsuite/gcc.dg/always_inline3.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2" } */
int do_something_evil (void);
inline __attribute__ ((always_inline)) void
-q2(void)
-{ /* { dg-message "sorry\[^\n\]*recursive" "" } */
+q2(void) /* { dg-message "sorry\[^\n\]*recursive" "" } */
+{
if (do_something_evil ())
return;
q2(); /* { dg-message "sorry\[^\n\]*called from here" "" } */
diff --git a/gcc/testsuite/gcc.dg/compat/compat-common.h b/gcc/testsuite/gcc.dg/compat/compat-common.h
index 635e7446d76..40d4e08f9f1 100644
--- a/gcc/testsuite/gcc.dg/compat/compat-common.h
+++ b/gcc/testsuite/gcc.dg/compat/compat-common.h
@@ -24,6 +24,13 @@
#define DEBUG_FINI
#endif
+#ifdef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+#define SKIP_COMPLEX_INT
+#endif
+#endif
+
+#ifndef SKIP_COMPLEX
#ifdef __GNUC__
#define CINT(x, y) (x + y * __extension__ 1i)
#define CDBL(x, y) (x + y * __extension__ 1i)
@@ -38,6 +45,7 @@
#endif
#define CDBL(x, y) (x + y * _Complex_I)
#endif
+#endif
extern void abort (void);
extern int fails;
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
index 6f550b4baec..e63f5fd389f 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
@@ -144,6 +144,7 @@ testit##NAME (void) \
DEBUG_NL; \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(ci, _Complex int, CINT (2, 3))
T(cl, _Complex long, CINT (3, 4))
@@ -151,6 +152,7 @@ T(cll, _Complex long long, CINT (5, 6))
#endif
T(cd, _Complex double, CDBL (7.0, 8.0))
T(cld, _Complex long double, CDBL (8.0, 9.0))
+#endif
#undef T
@@ -161,6 +163,7 @@ DEBUG_INIT
#define T(NAME) testit##NAME ();
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(ci)
T(cl)
@@ -168,6 +171,7 @@ T(cll)
#endif
T(cd)
T(cld)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c
index 1e12cc92c62..d470ef605da 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c
@@ -84,6 +84,7 @@ testva##NAME (int n, ...) \
} \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(ci, _Complex int, CINT (2, 3))
T(cl, _Complex long, CINT (3, 4))
@@ -91,3 +92,4 @@ T(cll, _Complex long long, CINT (5, 6))
#endif
T(cd, _Complex double, CDBL (7.0, 8.0))
T(cld, _Complex long double, CDBL (8.0, 9.0))
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
index adc8ece5690..a4e73c9fdb6 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
@@ -68,11 +68,13 @@ testit##NAME (void) \
DEBUG_NL; \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(cc, _Complex char, CINT (0, 1))
T(cs, _Complex short, CINT (1, 2))
#endif
T(cf, _Complex float, CDBL (6.0, 7.0))
+#endif
#undef T
@@ -83,11 +85,13 @@ DEBUG_INIT
#define T(NAME) testit##NAME ();
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(cc)
T(cs)
#endif
T(cf)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c
index 0db32ab53c9..e0fa7053996 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c
@@ -67,8 +67,10 @@ test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
check##NAME (x16, 16); \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(cc, _Complex char, CINT (0, 1))
T(cs, _Complex short, CINT (1, 2))
#endif
T(cf, _Complex float, CDBL (6.0, 7.0))
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c
index 1fa713d2b64..1c336d81ab5 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c
@@ -2,15 +2,21 @@ TEST_FUNCS (longlong_i, long long, int,
1234LL, -987)
TEST_FUNCS (longlong_d, long long, double,
1234LL, -987.0)
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
TEST_FUNCS (complexint_i, _Complex int, int,
1234 + 567i, -987)
TEST_FUNCS (complexint_d, _Complex int, double,
1234 + 567i, -987.0)
+#endif
TEST_FUNCS (complexdouble_i, _Complex double, int,
1234.0 + 567.0i, -987)
TEST_FUNCS (complexdouble_d, _Complex double, double,
1234.0 + 567.0i, -987.0)
+#ifndef SKIP_COMPLEX_INT
TEST_FUNCS (complexlonglong_i, _Complex long long, int,
1234LL + 567LLi, -987)
TEST_FUNCS (complexlonglong_d, _Complex long long, double,
1234LL + 567LLi, -987.0)
+#endif
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c
index c57c6fee42d..d29597e3d04 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c
@@ -16,6 +16,7 @@ int main (void)
{
longlong_i_doit ();
longlong_d_doit ();
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
complexint_i_doit ();
complexint_d_doit ();
@@ -26,5 +27,6 @@ int main (void)
complexlonglong_i_doit ();
complexlonglong_d_doit ();
#endif
+#endif
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c
index 54c5d9b7002..af65398f71e 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c
@@ -1,4 +1,6 @@
TEST_FUNCS (longdouble_i, long double, int, d, -987)
TEST_FUNCS (longdouble_d, long double, double, d, -987.0)
+#ifndef SKIP_COMPLEX
TEST_FUNCS (complexlongdouble_i, _Complex long double, int, cd, -987)
TEST_FUNCS (complexlongdouble_d, _Complex long double, double, cd, -987.0)
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c
index 9c73a1caca1..f6b3c1d8a8e 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c
@@ -6,14 +6,18 @@
extern void exit (int);
extern void longdouble_i_doit (void);
extern void longdouble_d_doit (void);
+#ifndef SKIP_COMPLEX
extern void complexlongdouble_i_doit (void);
extern void complexlongdouble_d_doit (void);
+#endif
int main (void)
{
longdouble_i_doit ();
longdouble_d_doit ();
+#ifndef SKIP_COMPLEX
complexlongdouble_i_doit ();
complexlongdouble_d_doit ();
+#endif
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c
index a395cb207fa..27aa48fbe83 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c
@@ -1,6 +1,8 @@
#include "scalar-by-value-x.h"
extern long double d;
+#ifndef SKIP_COMPLEX
extern _Complex long double cd;
+#endif
#include "scalar-by-value-6.c"
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c
index 87c7b234a82..2e9aed2821f 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c
@@ -1,6 +1,8 @@
#include "scalar-by-value-y.h"
long double d = 1234.0L + 0x0.abcdp-70L;
+#ifndef SKIP_COMPLEX
_Complex long double cd = 234.0L + 0x0.abcp-70L + 567.0Li +0x0defp-70Li;
+#endif
#include "scalar-by-value-6.c"
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h b/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h
index 47a36133507..e181a7e34e5 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h
@@ -1,5 +1,14 @@
extern void abort (void);
+#ifdef __GNUC__
+#define va_list __builtin_va_list
+#define va_start __builtin_va_start
+#define va_arg __builtin_va_arg
+#define va_end __builtin_va_end
+#else
+#include <stdarg.h>
+#endif
+
#if USE_MEMCMP
/* For comparing vectors. */
#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
@@ -115,22 +124,22 @@ void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
\
void NAME##_fv (int n, ...) \
{ \
- __builtin_va_list ap; \
+ va_list ap; \
TYPE x; \
- __builtin_va_start (ap, n); \
+ va_start (ap, n); \
\
while (n-- != 0) \
- if (__builtin_va_arg (ap, PADT) != (PADT) 0) \
+ if (va_arg (ap, PADT) != (PADT) 0) \
abort (); \
\
- x = __builtin_va_arg (ap, TYPE); \
+ x = va_arg (ap, TYPE); \
if (memcmp (&x, &VAL, sizeof (x)) != 0 ) \
abort (); \
\
- if (__builtin_va_arg (ap, PADT) != VAL2) \
+ if (va_arg (ap, PADT) != VAL2) \
abort (); \
\
- __builtin_va_end (ap); \
+ va_end (ap); \
}
#else
@@ -248,21 +257,21 @@ void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
\
void NAME##_fv (int n, ...) \
{ \
- __builtin_va_list ap; \
+ va_list ap; \
\
- __builtin_va_start (ap, n); \
+ va_start (ap, n); \
\
while (n-- != 0) \
- if (__builtin_va_arg (ap, PADT) != (PADT) 0) \
+ if (va_arg (ap, PADT) != (PADT) 0) \
abort (); \
\
- if (__builtin_va_arg (ap, TYPE) != VAL) \
+ if (va_arg (ap, TYPE) != VAL) \
abort (); \
\
- if (__builtin_va_arg (ap, PADT) != VAL2) \
+ if (va_arg (ap, PADT) != VAL2) \
abort (); \
\
- __builtin_va_end (ap); \
+ va_end (ap); \
}
#endif
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c b/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
index c153f6f19df..5b33ce88033 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
@@ -83,6 +83,7 @@ testit##NAME (void) \
DEBUG_NL; \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(ci, _Complex int, CINT (2, 3))
T(cl, _Complex long, CINT (3, 4))
@@ -90,6 +91,7 @@ T(cll, _Complex long long, CINT (4, 5))
#endif
T(cd, _Complex double, CDBL (2.0, 3.0))
T(cld, _Complex long double, CDBL (3.0, 4.0))
+#endif
#undef T
@@ -100,6 +102,7 @@ DEBUG_INIT
#define T(NAME) testit##NAME ();
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(ci)
T(cl)
@@ -107,6 +110,7 @@ T(cll)
#endif
T(cd)
T(cld)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c b/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
index 31dddd0a033..245c4c571bc 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
@@ -62,6 +62,7 @@ testva##NAME (int n, ...) \
return rslt; \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(ci, _Complex int, CINT (2, 3))
T(cl, _Complex long, CINT (3, 4))
@@ -69,3 +70,4 @@ T(cll, _Complex long long, CINT (4, 5))
#endif
T(cd, _Complex double, CDBL (2.0, 3.0))
T(cld, _Complex long double, CDBL (3.0, 4.0))
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c b/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
index 0ea764958d0..50305be4d35 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
@@ -36,11 +36,13 @@ testit##NAME (void) \
DEBUG_NL; \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(cc, _Complex char, CINT (0, 1))
T(cs, _Complex short, CINT (1 + 2))
#endif
T(cf, _Complex float, CDBL (1.0, 2.0))
+#endif
#undef T
@@ -51,11 +53,13 @@ DEBUG_INIT
#define T(NAME) testit##NAME ();
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(cc)
T(cs)
#endif
T(cf)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c b/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c
index 175fb6ccb50..3c96856975f 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c
@@ -37,8 +37,10 @@ test1##NAME (TYPE x01) \
return x01; \
}
+#ifndef SKIP_COMPLEX
#ifndef SKIP_COMPLEX_INT
T(cc, _Complex char, CINT (0, 1))
T(cs, _Complex short, CINT (1, 2))
#endif
T(cf, _Complex float, CDBL (1.0, 2.0))
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
index eb995921467..05e36fe26c0 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
@@ -4,6 +4,7 @@
#include "fp-struct-check.h"
#include "fp-struct-test-by-value-x.h"
+#ifndef SKIP_COMPLEX
DEFS(cf, _Complex float)
CHECKS(cf, _Complex float)
@@ -19,7 +20,7 @@ TEST(Scf9, _Complex float)
TEST(Scf10, _Complex float)
TEST(Scf11, _Complex float)
TEST(Scf12, _Complex float)
-
+#endif
#undef T
@@ -30,6 +31,7 @@ DEBUG_INIT
#define T(TYPE, MTYPE) testit##TYPE ();
+#ifndef SKIP_COMPLEX
T(Scf1, _Complex float)
T(Scf2, _Complex float)
T(Scf3, _Complex float)
@@ -42,7 +44,7 @@ T(Scf9, _Complex float)
T(Scf10, _Complex float)
T(Scf11, _Complex float)
T(Scf12, _Complex float)
-
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c
index 9450815e74c..ce99a68a0c8 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c
@@ -12,6 +12,7 @@ const int test_va = 1;
#include "fp-struct-init.h"
#include "fp-struct-test-by-value-y.h"
+#ifndef SKIP_COMPLEX
DEFS(cf,_Complex float)
INITS(cf, _Complex float)
@@ -27,4 +28,4 @@ TEST(Scf9, _Complex float)
TEST(Scf10, _Complex float)
TEST(Scf11, _Complex float)
TEST(Scf12, _Complex float)
-
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
index 0aa45249590..f563f6ea91b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
@@ -4,14 +4,15 @@
#include "fp-struct-check.h"
#include "fp-struct-test-by-value-x.h"
+#ifndef SKIP_COMPLEX
DEFS(cf, _Complex float)
CHECKS(cf, _Complex float)
-
TEST(Scf13, _Complex float)
TEST(Scf14, _Complex float)
TEST(Scf15, _Complex float)
TEST(Scf16, _Complex float)
+#endif
#undef T
@@ -22,11 +23,12 @@ DEBUG_INIT
#define T(TYPE, MTYPE) testit##TYPE ();
-
+#ifndef SKIP_COMPLEX
T(Scf13, _Complex float)
T(Scf14, _Complex float)
T(Scf15, _Complex float)
T(Scf16, _Complex float)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c
index 2fd561ef044..0575b3c1d81 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c
@@ -12,11 +12,12 @@ const int test_va = 1;
#include "fp-struct-init.h"
#include "fp-struct-test-by-value-y.h"
+#ifndef SKIP_COMPLEX
DEFS(cf,_Complex float)
INITS(cf, _Complex float)
-
TEST(Scf13, _Complex float)
TEST(Scf14, _Complex float)
TEST(Scf15, _Complex float)
TEST(Scf16, _Complex float)
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
index 93fd788ea45..8c270452243 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
@@ -4,6 +4,7 @@
#include "fp-struct-check.h"
#include "fp-struct-test-by-value-x.h"
+#ifndef SKIP_COMPLEX
DEFS(cd, _Complex double)
CHECKS(cd, _Complex double)
@@ -19,7 +20,7 @@ TEST(Scd9, _Complex double)
TEST(Scd10, _Complex double)
TEST(Scd11, _Complex double)
TEST(Scd12, _Complex double)
-
+#endif
#undef T
@@ -30,6 +31,7 @@ DEBUG_INIT
#define T(TYPE, MTYPE) testit##TYPE ();
+#ifndef SKIP_COMPLEX
T(Scd1, _Complex double)
T(Scd2, _Complex double)
T(Scd3, _Complex double)
@@ -42,7 +44,7 @@ T(Scd9, _Complex double)
T(Scd10, _Complex double)
T(Scd11, _Complex double)
T(Scd12, _Complex double)
-
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c
index f8ac0a7c15e..d05ff84075a 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c
@@ -12,6 +12,7 @@ const int test_va = 1;
#include "fp-struct-init.h"
#include "fp-struct-test-by-value-y.h"
+#ifndef SKIP_COMPLEX
DEFS(cd,_Complex double)
INITS(cd, _Complex double)
@@ -27,4 +28,4 @@ TEST(Scd9, _Complex double)
TEST(Scd10, _Complex double)
TEST(Scd11, _Complex double)
TEST(Scd12, _Complex double)
-
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c
index 5b2f1d1d920..804b5c25565 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c
@@ -4,14 +4,15 @@
#include "fp-struct-check.h"
#include "fp-struct-test-by-value-x.h"
+#ifndef SKIP_COMPLEX
DEFS(cd, _Complex double)
CHECKS(cd, _Complex double)
-
TEST(Scd13, _Complex double)
TEST(Scd14, _Complex double)
TEST(Scd15, _Complex double)
TEST(Scd16, _Complex double)
+#endif
#undef T
@@ -22,11 +23,12 @@ DEBUG_INIT
#define T(TYPE, MTYPE) testit##TYPE ();
-
+#ifndef SKIP_COMPLEX
T(Scd13, _Complex double)
T(Scd14, _Complex double)
T(Scd15, _Complex double)
T(Scd16, _Complex double)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c
index d785a999d58..3119e54480d 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c
@@ -12,11 +12,12 @@ const int test_va = 1;
#include "fp-struct-init.h"
#include "fp-struct-test-by-value-y.h"
+#ifndef SKIP_COMPLEX
DEFS(cd,_Complex double)
INITS(cd, _Complex double)
-
TEST(Scd13, _Complex double)
TEST(Scd14, _Complex double)
TEST(Scd15, _Complex double)
TEST(Scd16, _Complex double)
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
index f9dd6aa0b72..aa10a6e1a1a 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
@@ -4,6 +4,7 @@
#include "fp-struct-check.h"
#include "fp-struct-test-by-value-x.h"
+#ifndef SKIP_COMPLEX
DEFS(cld, _Complex long double)
CHECKS(cld, _Complex long double)
@@ -19,7 +20,7 @@ TEST(Scld9, _Complex long double)
TEST(Scld10, _Complex long double)
TEST(Scld11, _Complex long double)
TEST(Scld12, _Complex long double)
-
+#endif
#undef T
@@ -30,6 +31,7 @@ DEBUG_INIT
#define T(TYPE, MTYPE) testit##TYPE ();
+#ifndef SKIP_COMPLEX
T(Scld1, _Complex long double)
T(Scld2, _Complex long double)
T(Scld3, _Complex long double)
@@ -42,7 +44,7 @@ T(Scld9, _Complex long double)
T(Scld10, _Complex long double)
T(Scld11, _Complex long double)
T(Scld12, _Complex long double)
-
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c
index 8c732d58273..d98debb6df7 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c
@@ -12,6 +12,7 @@ const int test_va = 1;
#include "fp-struct-init.h"
#include "fp-struct-test-by-value-y.h"
+#ifndef SKIP_COMPLEX
DEFS(cld,_Complex long double)
INITS(cld, _Complex long double)
@@ -27,4 +28,4 @@ TEST(Scld9, _Complex long double)
TEST(Scld10, _Complex long double)
TEST(Scld11, _Complex long double)
TEST(Scld12, _Complex long double)
-
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c
index 72f5bbf5d44..986c4dded09 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c
@@ -4,14 +4,15 @@
#include "fp-struct-check.h"
#include "fp-struct-test-by-value-x.h"
+#ifndef SKIP_COMPLEX
DEFS(cld, _Complex long double)
CHECKS(cld, _Complex long double)
-
TEST(Scld13, _Complex long double)
TEST(Scld14, _Complex long double)
TEST(Scld15, _Complex long double)
TEST(Scld16, _Complex long double)
+#endif
#undef T
@@ -22,11 +23,12 @@ DEBUG_INIT
#define T(TYPE, MTYPE) testit##TYPE ();
-
+#ifndef SKIP_COMPLEX
T(Scld13, _Complex long double)
T(Scld14, _Complex long double)
T(Scld15, _Complex long double)
T(Scld16, _Complex long double)
+#endif
DEBUG_FINI
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c
index 545dcf8970f..12ac5341826 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c
@@ -12,11 +12,12 @@ const int test_va = 1;
#include "fp-struct-init.h"
#include "fp-struct-test-by-value-y.h"
+#ifndef SKIP_COMPLEX
DEFS(cld,_Complex long double)
INITS(cld, _Complex long double)
-
TEST(Scld13, _Complex long double)
TEST(Scld14, _Complex long double)
TEST(Scld15, _Complex long double)
TEST(Scld16, _Complex long double)
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c
index 7f005ef0d88..1fd2eba1c7f 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c
@@ -4,13 +4,17 @@
the former doesn't.
See http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01830.html */
+#ifndef SKIP_VLA_IN_STRUCT
extern void struct_by_value_22_x (void);
+#endif
extern void exit (int);
int fails;
int
main ()
{
+#ifndef SKIP_VLA_IN_STRUCT
struct_by_value_22_x ();
+#endif
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c
index fa71a9edd3c..6f1cdc86014 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c
@@ -1,3 +1,5 @@
+#ifndef SKIP_VLA_IN_STRUCT
+
#ifndef T
#include "compat-common.h"
#include "mixed-struct-defs.h"
@@ -77,3 +79,5 @@ U(Sfiifii)
#undef U
#endif
+
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c
index 079e40e5f89..ea5dec2268e 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c
@@ -9,6 +9,7 @@ const int test_va = 0;
const int test_va = 1;
#endif
+#ifndef SKIP_VLA_IN_STRUCT
#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST) \
void \
testva##NAME (int n, ...) \
@@ -37,3 +38,4 @@ testva##NAME (int n, ...) \
}
#include "struct-by-value-22_x.c"
+#endif
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1.h b/gcc/testsuite/gcc.dg/compat/struct-layout-1.h
index decc6769421..8426787b68f 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1.h
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1.h
@@ -214,9 +214,11 @@ typedef _Decimal32 TDecimal32;
typedef _Decimal64 TDecimal64;
typedef _Decimal128 TDecimal128;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Tcfloat;
typedef _Complex double Tcdouble;
typedef _Complex long double Tcldouble;
+#endif
typedef bool Tbool;
typedef enum E0 TE0;
typedef enum E1 TE1;
@@ -263,9 +265,11 @@ typedef _Decimal32 TalDecimal32 atal;
typedef _Decimal64 TalDecimal64 atal;
typedef _Decimal128 TalDecimal128 atal;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Talcfloat atal;
typedef _Complex double Talcdouble atal;
typedef _Complex long double Talcldouble atal;
+#endif
typedef bool Talbool atal;
typedef enum E0 TalE0 atal;
typedef enum E1 TalE1 atal;
@@ -312,9 +316,11 @@ typedef _Decimal32 Tal1Decimal32 atal1;
typedef _Decimal64 Tal1Decimal64 atal1;
typedef _Decimal128 Tal1Decimal128 atal1;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Tal1cfloat atal1;
typedef _Complex double Tal1cdouble atal1;
typedef _Complex long double Tal1cldouble atal1;
+#endif
typedef bool Tal1bool atal1;
typedef enum E0 Tal1E0 atal1;
typedef enum E1 Tal1E1 atal1;
@@ -361,9 +367,11 @@ typedef _Decimal32 Tal2Decimal32 atal2;
typedef _Decimal64 Tal2Decimal64 atal2;
typedef _Decimal128 Tal2Decimal128 atal2;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Tal2cfloat atal2;
typedef _Complex double Tal2cdouble atal2;
typedef _Complex long double Tal2cldouble atal2;
+#endif
typedef bool Tal2bool atal2;
typedef enum E0 Tal2E0 atal2;
typedef enum E1 Tal2E1 atal2;
@@ -410,9 +418,11 @@ typedef _Decimal32 Tal4Decimal32 atal4;
typedef _Decimal64 Tal4Decimal64 atal4;
typedef _Decimal128 Tal4Decimal128 atal4;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Tal4cfloat atal4;
typedef _Complex double Tal4cdouble atal4;
typedef _Complex long double Tal4cldouble atal4;
+#endif
typedef bool Tal4bool atal4;
typedef enum E0 Tal4E0 atal4;
typedef enum E1 Tal4E1 atal4;
@@ -459,9 +469,11 @@ typedef _Decimal32 Tal8Decimal32 atal8;
typedef _Decimal64 Tal8Decimal64 atal8;
typedef _Decimal128 Tal8Decimal128 atal8;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Tal8cfloat atal8;
typedef _Complex double Tal8cdouble atal8;
typedef _Complex long double Tal8cldouble atal8;
+#endif
typedef bool Tal8bool atal8;
typedef enum E0 Tal8E0 atal8;
typedef enum E1 Tal8E1 atal8;
@@ -508,9 +520,11 @@ typedef _Decimal32 Tal16Decimal32 atal16;
typedef _Decimal64 Tal16Decimal64 atal16;
typedef _Decimal128 Tal16Decimal128 atal16;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Tal16cfloat atal16;
typedef _Complex double Tal16cdouble atal16;
typedef _Complex long double Tal16cldouble atal16;
+#endif
typedef bool Tal16bool atal16;
typedef enum E0 Tal16E0 atal16;
typedef enum E1 Tal16E1 atal16;
@@ -557,9 +571,11 @@ typedef _Decimal32 Talx1Decimal32 atalx1;
typedef _Decimal64 Talx1Decimal64 atalx1;
typedef _Decimal128 Talx1Decimal128 atalx1;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Talx1cfloat atalx1;
typedef _Complex double Talx1cdouble atalx1;
typedef _Complex long double Talx1cldouble atalx1;
+#endif
typedef bool Talx1bool atalx1;
typedef enum E0 Talx1E0 atalx1;
typedef enum E1 Talx1E1 atalx1;
@@ -603,9 +619,11 @@ typedef _Decimal32 Talx2Decimal32 atalx2;
typedef _Decimal64 Talx2Decimal64 atalx2;
typedef _Decimal128 Talx2Decimal128 atalx2;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Talx2cfloat atalx2;
typedef _Complex double Talx2cdouble atalx2;
typedef _Complex long double Talx2cldouble atalx2;
+#endif
typedef enum E0 Talx2E0 atalx2;
typedef enum E1 Talx2E1 atalx2;
typedef enum E2 Talx2E2 atalx2;
@@ -643,9 +661,11 @@ typedef _Decimal32 Talx4Decimal32 atalx4;
typedef _Decimal64 Talx4Decimal64 atalx4;
typedef _Decimal128 Talx4Decimal128 atalx4;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Talx4cfloat atalx4;
typedef _Complex double Talx4cdouble atalx4;
typedef _Complex long double Talx4cldouble atalx4;
+#endif
typedef enum E0 Talx4E0 atalx4;
typedef enum E1 Talx4E1 atalx4;
typedef enum E2 Talx4E2 atalx4;
@@ -677,9 +697,11 @@ typedef long double Talx8ldouble atalx8;
typedef _Decimal64 Talx8Decimal64 atalx8;
typedef _Decimal128 Talx8Decimal128 atalx8;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex float Talx8cfloat atalx8;
typedef _Complex double Talx8cdouble atalx8;
typedef _Complex long double Talx8cldouble atalx8;
+#endif
typedef void *Taly8ptr ataly8;
typedef char *Taly8cptr ataly8;
typedef int *Taly8iptr ataly8;
@@ -689,8 +711,10 @@ typedef _Complex unsigned long int Taly16culong ataly16;
typedef _Complex long long int Talx16cllong atalx16;
typedef _Complex unsigned long long int Talx16cullong atalx16;
#endif
+#ifndef SKIP_COMPLEX
typedef _Complex double Talx16cdouble atalx16;
typedef _Complex long double Talx16cldouble atalx16;
+#endif
typedef int (*Tfnptr) (void);
/* Bitfield macros. In C, it is invalid to use numbers larger
diff --git a/gcc/testsuite/gcc.dg/fastmath-2.c b/gcc/testsuite/gcc.dg/div-double-1.c
index 2003cf952bb..0cb8268e868 100644
--- a/gcc/testsuite/gcc.dg/fastmath-2.c
+++ b/gcc/testsuite/gcc.dg/div-double-1.c
@@ -1,10 +1,10 @@
/* { dg-do run } */
-/* { dg-options "-O2 -ffast-math" } */
+/* { dg-options "-O2 -ffinite-math-only" } */
extern void abort (void);
volatile double a = 2.002083e-146;
-double b;
+volatile double b;
int
main()
@@ -15,4 +15,3 @@ main()
abort ();
return 0;
}
-
diff --git a/gcc/testsuite/gcc.dg/inline-14.c b/gcc/testsuite/gcc.dg/inline-14.c
index 15b2d404c11..b2bfb67c5bc 100644
--- a/gcc/testsuite/gcc.dg/inline-14.c
+++ b/gcc/testsuite/gcc.dg/inline-14.c
@@ -2,8 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-std=c99" } */
-extern inline int func1 (void)
-{ /* { dg-message "note: previous definition" } */
+extern inline int func1 (void) /* { dg-message "note: previous definition" } */
+{
return 1;
}
@@ -12,8 +12,8 @@ inline int func1 (void) /* { dg-error "redefinition" } */
return 1;
}
-inline int func2 (void)
-{ /* { dg-message "note: previous definition" } */
+inline int func2 (void) /* { dg-message "note: previous definition" } */
+{
return 2;
}
diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c
index 3bd6a26c582..1e7a778103e 100644
--- a/gcc/testsuite/gcc.dg/noreturn-1.c
+++ b/gcc/testsuite/gcc.dg/noreturn-1.c
@@ -25,8 +25,8 @@ foo3(void)
extern void foo4(void);
void
-foo4(void)
-{ /* { dg-warning "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
+foo4(void) /* { dg-warning "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
+{
exit(0);
}
diff --git a/gcc/testsuite/gcc.dg/noreturn-4.c b/gcc/testsuite/gcc.dg/noreturn-4.c
index 5bc78abd4fb..bcc29dac69a 100644
--- a/gcc/testsuite/gcc.dg/noreturn-4.c
+++ b/gcc/testsuite/gcc.dg/noreturn-4.c
@@ -4,7 +4,7 @@
extern void exit (int) __attribute__ ((__noreturn__));
int
-main (void)
-{ /* { dg-warning "function might be possible candidate for attribute 'noreturn'" "warn for main" } */
+main (void) /* { dg-warning "function might be possible candidate for attribute 'noreturn'" "warn for main" } */
+{
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc/testsuite/gcc.dg/noreturn-7.c
index 8ae5e238224..1913be1fe1d 100644
--- a/gcc/testsuite/gcc.dg/noreturn-7.c
+++ b/gcc/testsuite/gcc.dg/noreturn-7.c
@@ -13,8 +13,8 @@ void _exit(int status) __attribute__ ((__noreturn__));
int z = 0;
-void g()
-{ /* { dg-warning "possible candidate" } */
+void g() /* { dg-warning "possible candidate" } */
+{
if (++z > 10)
_exit(0);
g();
@@ -27,15 +27,15 @@ void f()
f();
} /* { dg-bogus "does return" } */
-int h()
-{ /* { dg-warning "possible candidate" } */
+int h() /* { dg-warning "possible candidate" } */
+{
if (++z > 10)
_exit(0);
return h();
} /* { dg-bogus "end of non-void function" } */
-int k()
-{ /* { dg-warning "possible candidate" } */
+int k() /* { dg-warning "possible candidate" } */
+{
if (++z > 10)
_exit(0);
k();
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
index 8f1ae752fd3..c51648c4ef0 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
@@ -5,7 +5,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
str_t *p;
@@ -15,7 +23,8 @@ main ()
int i, sum;
p = malloc (N * sizeof (str_t));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
p[i].b = i;
@@ -30,5 +39,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
index 6394d07bf76..1a798e399d3 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
@@ -5,7 +5,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
@@ -26,5 +34,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
index c84863c3790..82f24a1a4b1 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
@@ -5,7 +5,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
@@ -13,7 +21,8 @@ main ()
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
p[i].b = i;
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
index db9372e4c0e..6a717ddb23f 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
@@ -26,6 +26,6 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
index aca646a1d34..308c30e4fd7 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
@@ -12,7 +12,15 @@ typedef struct
float d;
}str_t2;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 16000
#define N 1000
+#else
+#define N (STACK_SIZE/16)
+#endif
+#else
+#define N 1000
+#endif
str_t1 *p1;
str_t2 *p2;
@@ -33,7 +41,7 @@ main ()
int i, r;
r = rand ();
- num = r > N ? N : num;
+ num = r > N ? N : r;
p1 = malloc (num * sizeof (str_t1));
p2 = malloc (num * sizeof (str_t2));
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c
index 1c41de5bc3c..12c217aad97 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c
@@ -23,5 +23,5 @@ int main()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c
index 07460191ba0..303afb72b36 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c
@@ -8,7 +8,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c
index 27503f82464..b1508eec5c7 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c
@@ -26,5 +26,5 @@ int main()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
index b120a799cd6..43ca58b9ef2 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
@@ -9,7 +9,15 @@ struct str
float b;
};
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
foo (struct str * p_str)
@@ -25,7 +33,8 @@ main ()
{
int i, sum;
struct str * p = malloc (N * sizeof (struct str));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
sum = foo (p+i);
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c
index fcb10e37b52..8e54632454e 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c
@@ -8,7 +8,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 16000
#define N 1000
+#else
+#define N (STACK_SIZE/16)
+#endif
+#else
+#define N 1000
+#endif
typedef struct
{
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c
index 49283a586f2..bade3153909 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c
@@ -8,7 +8,16 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
+
typedef struct
{
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c
index 1254281f565..4ffd4b5a265 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c
@@ -29,5 +29,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
index a38dd58b021..58790bfd527 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
@@ -8,7 +8,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
str_t *p;
@@ -18,7 +26,8 @@ main ()
int i, sum;
p = malloc (N * sizeof (str_t));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
p[i].b = i;
@@ -33,5 +42,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c
index 28d66e4cccf..3d92da40517 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c
@@ -8,7 +8,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
@@ -29,5 +37,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
index 65b31978312..5a778a7d439 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
@@ -8,7 +8,15 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
@@ -16,7 +24,8 @@ main ()
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
p[i].b = i;
@@ -31,5 +40,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
index 7e80baba7d8..04b8b6621fb 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
@@ -8,26 +8,35 @@ typedef struct
float b;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 8000
#define N 1000
+#else
+#define N (STACK_SIZE/8)
+#endif
+#else
+#define N 1000
+#endif
int
main ()
{
int i, num;
- num = rand();
+ num = rand();
+ num = num > N ? N : num;
str_t * p = malloc (num * sizeof (str_t));
if (p == 0)
return 0;
- for (i = 0; i < N; i++)
+ for (i = 0; i < num; i++)
p[i].b = i;
- for (i = 0; i < N; i++)
+ for (i = 0; i < num; i++)
p[i].a = p[i].b + 1;
- for (i = 0; i < N; i++)
+ for (i = 0; i < num; i++)
if (p[i].a != p[i].b + 1)
abort ();
@@ -35,5 +44,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c
index df2b4ee08bd..8f116df4d01 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c
@@ -10,14 +10,23 @@ typedef struct
float d;
}str_t;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 1600
#define N 100
+#else
+#define N (STACK_SIZE/16)
+#endif
+#else
+#define N 100
+#endif
int
main ()
{
int i;
str_t *p = malloc (N * sizeof (str_t));
-
+ if (p == NULL)
+ return 0;
for (i = 0; i < N; i++)
p[i].a = 5;
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c
index 5569debfc0d..81c3edfa413 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c
@@ -29,5 +29,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
index 65a9602963a..f9cb7d58a5d 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
@@ -29,5 +29,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c
index 5fb152a1420..24dae559829 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c
@@ -15,7 +15,15 @@ typedef struct
float d;
}str_t2;
+#ifdef STACK_SIZE
+#if STACK_SIZE > 16000
#define N 1000
+#else
+#define N (STACK_SIZE/16)
+#endif
+#else
+#define N 1000
+#endif
str_t1 *p1;
str_t2 *p2;
@@ -36,7 +44,7 @@ main ()
int i, r;
r = rand ();
- num = r > N ? N : num;
+ num = r > N ? N : r;
p1 = malloc (num * sizeof (str_t1));
p2 = malloc (num * sizeof (str_t2));
@@ -56,5 +64,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr36630.c b/gcc/testsuite/gcc.dg/vect/pr36630.c
new file mode 100644
index 00000000000..9d85afffb20
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr36630.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void
+foo (unsigned char *x, short y)
+{
+ short i;
+
+ i = 2;
+ while (i < y)
+ {
+ x[i - 1] = x[i];
+ i = i + 1;
+ }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/winline-3.c b/gcc/testsuite/gcc.dg/winline-3.c
index ce9e08012ca..d586cba644a 100644
--- a/gcc/testsuite/gcc.dg/winline-3.c
+++ b/gcc/testsuite/gcc.dg/winline-3.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2 --param max-inline-insns-single=1" } */
void big (void);
-inline int q(void)
-{ /* { dg-warning "max-inline-insns-single" "" } */
+inline int q(void) /* { dg-warning "max-inline-insns-single" "" } */
+{
big();
big();
big();
diff --git a/gcc/testsuite/gcc.dg/winline-5.c b/gcc/testsuite/gcc.dg/winline-5.c
index 57fa3937e0a..ad1fc4100bb 100644
--- a/gcc/testsuite/gcc.dg/winline-5.c
+++ b/gcc/testsuite/gcc.dg/winline-5.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2 --param inline-unit-growth=0 --param large-unit-insns=0" } */
void big (void);
-inline int q(void)
-{ /* { dg-warning "inline-unit-growth" } */
+inline int q(void) /* { dg-warning "inline-unit-growth" } */
+{
big();
big();
big();
diff --git a/gcc/testsuite/gcc.dg/winline-6.c b/gcc/testsuite/gcc.dg/winline-6.c
index dd8d3a81b08..4e22ce14455 100644
--- a/gcc/testsuite/gcc.dg/winline-6.c
+++ b/gcc/testsuite/gcc.dg/winline-6.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2 --param large-function-growth=0 --param large-function-insns=1" } */
void big (void);
-inline int q(void)
-{ /* { dg-warning "large-function-growth" } */
+inline int q(void) /* { dg-warning "large-function-growth" } */
+{
big();
big();
big();
diff --git a/gcc/testsuite/gcc.dg/winline-7.c b/gcc/testsuite/gcc.dg/winline-7.c
index bab82a2d682..19262da7c55 100644
--- a/gcc/testsuite/gcc.dg/winline-7.c
+++ b/gcc/testsuite/gcc.dg/winline-7.c
@@ -4,8 +4,8 @@
extern void *alloca (__SIZE_TYPE__);
void big (void);
-inline void *q (void)
-{ /* { dg-warning "(function not inlinable|alloca)" } */
+inline void *q (void) /* { dg-warning "(function not inlinable|alloca)" } */
+{
return alloca (10);
}
inline void *t (void)
diff --git a/gcc/testsuite/gcc.dg/winline-9.c b/gcc/testsuite/gcc.dg/winline-9.c
index f6cd2374983..fddf5c68f0c 100644
--- a/gcc/testsuite/gcc.dg/winline-9.c
+++ b/gcc/testsuite/gcc.dg/winline-9.c
@@ -10,8 +10,8 @@ int aa (void)
test(t);
}
static inline
-int bb (void)
-{ /* { dg-warning "large-stack-frame" "" } */
+int bb (void) /* { dg-warning "large-stack-frame" "" } */
+{
char t[100];
test(t);
}
diff --git a/gcc/testsuite/gcc.dg/wtr-func-def-1.c b/gcc/testsuite/gcc.dg/wtr-func-def-1.c
index 32d613ea748..049e05b8551 100644
--- a/gcc/testsuite/gcc.dg/wtr-func-def-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-func-def-1.c
@@ -6,8 +6,8 @@
/* Test some simple cases. */
-void f_void1 (void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_void1 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -16,8 +16,8 @@ void f_void2 ()
return;
}
-void f_int1 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int1 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -29,8 +29,8 @@ void f_int2 (f)
/* Test that we don't ever warn about nested functions. */
-void f_int3 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int3 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
void f3a (void) { return; }
void f3b () { return; }
void f3c (int f) { return; }
@@ -39,8 +39,8 @@ void f_int3 (int f)
return;
}
-void f_int4 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int4 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
void f4a (void) { return; }
void f4b () { return; }
void f4c (int f) { return; }
@@ -77,14 +77,14 @@ void f_int6 (f)
are still warned about. */
extern void f_int_p1 (int);
-void f_int_p1 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int_p1 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
extern void f_int_p2 (int f);
-void f_int_p2 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int_p2 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -103,14 +103,14 @@ void f_int_p4 (f)
}
extern void f_void_p1 ();
-void f_void_p1 (void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_void_p1 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
extern void f_void_p2 (void);
-void f_void_p2 (void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_void_p2 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -133,39 +133,39 @@ f_impl1()
return 0;
}
-f_impl2(void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+f_impl2(void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
-f_impl3(int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+f_impl3(int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
/* Test stdarg functions. */
-f_stdarg1(const char *s, ...)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+f_stdarg1(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
-void f_stdarg2(const char *s, ...)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_stdarg2(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
extern void f_stdarg3(const char *, ...);
-void f_stdarg3(const char *s, ...)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_stdarg3(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
/* Test handling function pointer parameters. */
void f_fnptr1 (int f, int (*fp)(int));
-void f_fnptr1 (int f, int (*fp)(int))
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_fnptr1 (int f, int (*fp)(int)) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -180,8 +180,8 @@ void f_fnptr2 (f, fp)
/* Test for main. */
int
-main (int argc, char **argv)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+main (int argc, char **argv) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
diff --git a/gcc/testsuite/gcc.target/i386/pr12329.c b/gcc/testsuite/gcc.target/i386/pr12329.c
index aeefeb0ce80..21d2c6580e2 100644
--- a/gcc/testsuite/gcc.target/i386/pr12329.c
+++ b/gcc/testsuite/gcc.target/i386/pr12329.c
@@ -6,8 +6,8 @@ extern void abort (void);
int test_nested (int i)
{
- int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l)
- { /* { dg-error "nested functions are limited to 2 register parameters" } */
+ int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l) /* { dg-error "nested functions are limited to 2 register parameters" } */
+ {
return i + j + k + l;
}
diff --git a/gcc/testsuite/gcc.target/i386/sse-5.c b/gcc/testsuite/gcc.target/i386/sse-5.c
index fa40366c38a..c3ed8f2672b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-5.c
+++ b/gcc/testsuite/gcc.target/i386/sse-5.c
@@ -4,7 +4,7 @@
typedef double v2df __attribute__ ((vector_size (16)));
v2df p;
-q(v2df t)
-{ /* { dg-warning "SSE" "" } */
+q(v2df t) /* { dg-warning "SSE" "" } */
+{
p=t;
}
diff --git a/gcc/testsuite/gfortran.dg/array_function_2.f90 b/gcc/testsuite/gfortran.dg/array_function_2.f90
new file mode 100644
index 00000000000..a9374116a41
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_function_2.f90
@@ -0,0 +1,30 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+
+! PR fortran/37199
+! We used to produce wrong (segfaulting) code for this one because the
+! temporary array for the function result had wrong bounds.
+
+! Contributed by Gavin Salam <salam@lpthe.jussieu.fr>
+
+program bounds_issue
+ implicit none
+ integer, parameter :: dp = kind(1.0d0)
+ real(dp), pointer :: pdf0(:,:), dpdf(:,:)
+
+ allocate(pdf0(0:282,-6:7))
+ allocate(dpdf(0:282,-6:7)) ! with dpdf(0:283,-6:7) [illegal] error disappears
+ !write(0,*) lbound(dpdf), ubound(dpdf)
+ dpdf = tmp_PConv(pdf0)
+
+contains
+ function tmp_PConv(q_in) result(Pxq)
+ real(dp), intent(in) :: q_in(0:,-6:)
+ real(dp) :: Pxq(0:ubound(q_in,dim=1),-6:7)
+ Pxq = 0d0
+ !write(0,*) lbound(q_in), ubound(q_in)
+ !write(0,*) lbound(Pxq), ubound(Pxq)
+ return
+ end function tmp_PConv
+
+end program bounds_issue
diff --git a/gcc/testsuite/gfortran.dg/array_function_3.f90 b/gcc/testsuite/gfortran.dg/array_function_3.f90
new file mode 100644
index 00000000000..b1a9cac4400
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_function_3.f90
@@ -0,0 +1,48 @@
+! { dg-do compile }
+
+! PR fortran/36167
+! This used to cause an ICE because of a missing array spec after interface
+! mapping.
+
+! Contributed by Frank Muldoon <fmuldoo@me.lsu.edu>
+
+module communication_tools
+
+contains
+!*******************************************************************************
+function overlap_1(u,lbound_u,ubound_u)
+!*******************************************************************************
+integer, intent(in), dimension(:) :: lbound_u,ubound_u
+real, intent(in), dimension(lbound_u(1):ubound_u(1),lbound_u(2):ubound_u(2),&
+ lbound_u(3):ubound_u(3)) :: u
+
+real, dimension(&
+lbound(u,1):ubound(u,1),&
+lbound(u,2):ubound(u,2),&
+lbound(u,3):ubound(u,3)) :: overlap_1
+
+return
+end function overlap_1
+
+end module communication_tools
+
+!*******************************************************************************
+subroutine write_out_particles
+!*******************************************************************************
+
+use communication_tools
+real, dimension(1:5, 2:4, 3:10) :: vorticityMag
+real, allocatable, dimension(:,:,:) :: temp3d
+
+allocate(temp3d( &
+lbound(overlap_1(vorticityMag,lbound(vorticityMag),ubound(vorticityMag)),1):&
+ubound(overlap_1(vorticityMag,lbound(vorticityMag),ubound(vorticityMag)),1),&
+lbound(overlap_1(vorticityMag,lbound(vorticityMag),ubound(vorticityMag)),2):&
+ubound(overlap_1(vorticityMag,lbound(vorticityMag),ubound(vorticityMag)),2),&
+lbound(overlap_1(vorticityMag,lbound(vorticityMag),ubound(vorticityMag)),3):&
+ubound(overlap_1(vorticityMag,lbound(vorticityMag),ubound(vorticityMag)),3)))
+
+return
+end subroutine write_out_particles
+
+! { dg-final { cleanup-modules "communication_tools" } }
diff --git a/gcc/testsuite/gfortran.dg/array_function_4.f90 b/gcc/testsuite/gfortran.dg/array_function_4.f90
new file mode 100644
index 00000000000..c7e7d6e57c4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_function_4.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+
+! PR fortran/37411
+! This used to cause an ICE because of a missing array spec after interface
+! mapping.
+
+! Contributed by Kristjan Jonasson <jonasson@hi.is>
+
+MODULE B1
+CONTAINS
+ subroutine sub()
+ integer :: x(1)
+ character(3) :: st
+ st = fun(x)
+ end subroutine sub
+
+ function fun(x) result(st)
+ integer, intent(in) :: x(1)
+ character(lenf(x)) :: st
+ st = 'abc'
+ end function fun
+
+ pure integer function lenf(x)
+ integer, intent(in) :: x(1)
+ lenf = x(1)
+ end function lenf
+END MODULE B1
+
+! { dg-final { cleanup-modules "B1" } }
diff --git a/gcc/testsuite/gfortran.dg/implicit_12.f90 b/gcc/testsuite/gfortran.dg/implicit_12.f90
new file mode 100644
index 00000000000..8136a183971
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/implicit_12.f90
@@ -0,0 +1,23 @@
+! { dg-do run}
+!
+! PR fortran/37400
+!
+module mod
+ implicit character(len=*,kind=kind('A')) (Q)
+ parameter(Q1 = '12345678') ! len=8
+ parameter(Q2 = 'abcdefghijkl') ! len=12
+ contains
+ subroutine sub(Q3)
+ if(len('#'//Q3//'#') /= 15) call abort()
+ if('#'//Q3//'#' /= '#ABCDEFGHIJKLM#') call abort()
+ end subroutine sub
+end module mod
+program startest
+ use mod
+ implicit none
+ if(len('#'//Q1//'#') /= 10) call abort()
+ if(len('#'//Q2//'#') /= 14) call abort()
+ if('#'//Q1//'#' /='#12345678#') call abort()
+ if('#'//Q2//'#' /='#abcdefghijkl#') call abort()
+ call sub('ABCDEFGHIJKLM') ! len=13
+end program startest
diff --git a/gcc/testsuite/gfortran.dg/reshape_order_1.f90 b/gcc/testsuite/gfortran.dg/reshape_order_1.f90
new file mode 100644
index 00000000000..3909bfde22b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reshape_order_1.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+! { dg-shouldfail "Duplicate value 2 in ORDER argument to RESHAPE intrinsic" }
+program main
+ implicit none
+ integer(kind=1), dimension(6) :: source1 = (/ 1, 2, 3, 4, 5, 6 /)
+ integer, dimension(2) :: shape1 = (/ 2, 5/)
+ integer(kind=1), dimension(2) :: pad1 = (/ 0, 0/)
+ character(len=200) :: l1, l2
+ integer :: i1, i2
+
+ l1 = "2 2"
+ read(unit=l1,fmt=*) i1, i2
+ write (unit=l2,fmt=*) reshape(source1, shape1, pad1, (/i1, i2/)) ! Invalid
+end program main
+! { dg-output "Fortran runtime error: Duplicate value 2 in ORDER argument to RESHAPE intrinsic" }
+
+
diff --git a/gcc/testsuite/gfortran.dg/reshape_order_2.f90 b/gcc/testsuite/gfortran.dg/reshape_order_2.f90
new file mode 100644
index 00000000000..3c8ef411370
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reshape_order_2.f90
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+! { dg-shouldfail "Value 3 out of range in ORDER argument to RESHAPE intrinsic" }
+program main
+ implicit none
+ integer(kind=1), dimension(6) :: source1 = (/ 1, 2, 3, 4, 5, 6 /)
+ integer, dimension(2) :: shape1 = (/ 2, 5/)
+ integer(kind=1), dimension(2) :: pad1 = (/ 0, 0/)
+ character(len=200) :: l1, l2
+ integer :: i1, i2
+
+ l1 = "3 2"
+ read(unit=l1,fmt=*) i1, i2
+ write (unit=l2,fmt=*) reshape(source1, shape1, pad1, (/i1, i2/)) ! Invalid
+end program main
+! { dg-output "Fortran runtime error: Value 3 out of range in ORDER argument to RESHAPE intrinsic" }
diff --git a/gcc/testsuite/gfortran.dg/reshape_order_3.f90 b/gcc/testsuite/gfortran.dg/reshape_order_3.f90
new file mode 100644
index 00000000000..263488025d8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reshape_order_3.f90
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+! { dg-shouldfail "Duplicate value 2 in ORDER argument to RESHAPE intrinsic" }
+program main
+ implicit none
+ integer(kind=4), dimension(6) :: source1 = (/ 1, 2, 3, 4, 5, 6 /)
+ integer, dimension(2) :: shape1 = (/ 2, 5/)
+ integer(kind=4), dimension(2) :: pad1 = (/ 0, 0/)
+ character(len=200) :: l1, l2
+ integer :: i1, i2
+
+ l1 = "2 2"
+ read(unit=l1,fmt=*) i1, i2
+ write (unit=l2,fmt=*) reshape(source1, shape1, pad1, (/i1, i2/)) ! Invalid
+end program main
+! { dg-output "Fortran runtime error: Duplicate value 2 in ORDER argument to RESHAPE intrinsic" }
diff --git a/gcc/testsuite/gfortran.dg/reshape_order_4.f90 b/gcc/testsuite/gfortran.dg/reshape_order_4.f90
new file mode 100644
index 00000000000..bd0536d844a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reshape_order_4.f90
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+! { dg-shouldfail "Value 0 out of range in ORDER argument to RESHAPE intrinsic" }
+program main
+ implicit none
+ integer(kind=4), dimension(6) :: source1 = (/ 1, 2, 3, 4, 5, 6 /)
+ integer, dimension(2) :: shape1 = (/ 2, 5/)
+ integer(kind=4), dimension(2) :: pad1 = (/ 0, 0/)
+ character(len=200) :: l1, l2
+ integer :: i1, i2
+
+ l1 = "0 2"
+ read(unit=l1,fmt=*) i1, i2
+ write (unit=l2,fmt=*) reshape(source1, shape1, pad1, (/i1, i2/)) ! Invalid
+end program main
+! { dg-output "Fortran runtime error: Value 0 out of range in ORDER argument to RESHAPE intrinsic" }
diff --git a/gcc/testsuite/gfortran.dg/save_3.f90 b/gcc/testsuite/gfortran.dg/save_3.f90
index d2deed17e04..ab2ee52685a 100644
--- a/gcc/testsuite/gfortran.dg/save_3.f90
+++ b/gcc/testsuite/gfortran.dg/save_3.f90
@@ -14,3 +14,5 @@ pure function tell_i() result (answer)
answer=i
end function tell_i
end module g95bug
+
+! { dg-final { cleanup-modules "g95bug" } }
diff --git a/gcc/testsuite/gfortran.dg/size_kind.f90 b/gcc/testsuite/gfortran.dg/size_kind.f90
index 5ec6f7efe14..ee9cb8f246f 100644
--- a/gcc/testsuite/gfortran.dg/size_kind.f90
+++ b/gcc/testsuite/gfortran.dg/size_kind.f90
@@ -19,7 +19,9 @@ program test_64
print *, "max_32 = ", max_32
print *, "big_sz = ", big_sz
- allocate(array(big_sz))
+! Disabled as it overflows on 32bit systems (at compile time)
+! (conversion of integer(8) to integer(4))
+! allocate(array(big_sz))
print *, "sz = ", size(array)
print *, "sz = ", size(array, kind=long)
end program
diff --git a/gcc/testsuite/gfortran.dg/stfunc_6.f90 b/gcc/testsuite/gfortran.dg/stfunc_6.f90
index 2ad791d3bbf..c5657833c0f 100644
--- a/gcc/testsuite/gfortran.dg/stfunc_6.f90
+++ b/gcc/testsuite/gfortran.dg/stfunc_6.f90
@@ -10,10 +10,13 @@
INTEGER :: st1, i = 99, a(4), q = 6
st1 (i) = i * i * i
+ st3 (i) = i * v(i)
FORALL(i=1:4) a(i) = st1 (i)
FORALL(i=1:4) a(i) = u (a(i)) - a(i)** 2
if (any (a .ne. 0)) call abort ()
if (i .ne. 99) call abort ()
+ FORALL (i=1:4) a(i) = st3 (i) ! { dg-error "non-PURE function" "non-PURE reference in FORALL" { xfail *-*-*} }
+ FORALL (i=1:4) a(i) = v(i) ! { dg-error "non-PURE function" }
contains
pure integer function u (x)
integer,intent(in) :: x
diff --git a/gcc/testsuite/gfortran.dg/string_compare_2.f90 b/gcc/testsuite/gfortran.dg/string_compare_2.f90
index dc68bef2ada..966ed554ab5 100644
--- a/gcc/testsuite/gfortran.dg/string_compare_2.f90
+++ b/gcc/testsuite/gfortran.dg/string_compare_2.f90
@@ -35,3 +35,5 @@ program pack_bug
end if
end do
end
+
+! { dg-final { cleanup-modules "xparams" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_7.f03 b/gcc/testsuite/gfortran.dg/typebound_call_7.f03
new file mode 100644
index 00000000000..c429dc71257
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_7.f03
@@ -0,0 +1,50 @@
+! { dg-do compile}
+
+! PR fortran/37429
+! Checks for assignments from type-bound functions.
+
+MODULE touching
+ IMPLICIT NONE
+
+ TYPE :: EqnSys33
+ CONTAINS
+ PROCEDURE, NOPASS :: solve1
+ PROCEDURE, NOPASS :: solve2
+ PROCEDURE, NOPASS :: solve3
+ END TYPE EqnSys33
+
+CONTAINS
+
+ FUNCTION solve1 ()
+ IMPLICIT NONE
+ REAL :: solve1(3)
+ solve1 = 0.0
+ END FUNCTION solve1
+
+ CHARACTER(len=5) FUNCTION solve2 ()
+ IMPLICIT NONE
+ solve2 = "hello"
+ END FUNCTION solve2
+
+ REAL FUNCTION solve3 ()
+ IMPLICIT NONE
+ solve3 = 4.2
+ END FUNCTION solve3
+
+ SUBROUTINE fill_gap ()
+ IMPLICIT NONE
+ TYPE(EqnSys33) :: sys
+ REAL :: res
+ REAL :: resArr(3), resSmall(2)
+
+ res = sys%solve1 () ! { dg-error "Incompatible rank" }
+ res = sys%solve2 () ! { dg-error "Can't convert" }
+ resSmall = sys%solve1 () ! { dg-error "Different shape" }
+
+ res = sys%solve3 ()
+ resArr = sys%solve1 ()
+ END SUBROUTINE fill_gap
+
+END MODULE touching
+
+! { dg-final { cleanup-modules "touching" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_8.f03 b/gcc/testsuite/gfortran.dg/typebound_call_8.f03
new file mode 100644
index 00000000000..c8bf8d83c01
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_8.f03
@@ -0,0 +1,32 @@
+! { dg-do compile}
+
+! PR fortran/37429
+! This used to ICE, check that is fixed.
+
+MODULE touching
+ IMPLICIT NONE
+
+ TYPE :: EqnSys33
+ CONTAINS
+ PROCEDURE, NOPASS :: solve1
+ END TYPE EqnSys33
+
+CONTAINS
+
+ FUNCTION solve1 ()
+ IMPLICIT NONE
+ REAL :: solve1(3)
+ solve1 = 0.0
+ END FUNCTION solve1
+
+ SUBROUTINE fill_gap ()
+ IMPLICIT NONE
+ TYPE(EqnSys33) :: sys
+ REAL :: res
+
+ res = sys%solve1 () ! { dg-error "Incompatible rank" }
+ END SUBROUTINE fill_gap
+
+END MODULE touching
+
+! { dg-final { cleanup-modules "touching" } }
diff --git a/gcc/testsuite/lib/c-compat.exp b/gcc/testsuite/lib/c-compat.exp
index ce923b754ba..53562731b54 100644
--- a/gcc/testsuite/lib/c-compat.exp
+++ b/gcc/testsuite/lib/c-compat.exp
@@ -65,19 +65,19 @@ proc compat_setup_dfp { } {
global compat_have_dfp
verbose "compat_setup_dfp: $compat_use_alt $compat_same_alt" 2
- set compat_have_dfp 1
+
+ # Does the compiler under test support decimal float types?
+ compat-use-tst-compiler
+ set compat_have_dfp [check_effective_target_dfprt_nocache]
+ verbose "compat_have_dfp for tst compiler: $compat_have_dfp" 2
+
# If there is an alternate compiler, does it support decimal float types?
- if { $compat_use_alt == 1 && $compat_same_alt == 0 } {
+ if { $compat_have_dfp == 1 && $compat_use_alt == 1 && $compat_same_alt == 0 } {
compat-use-alt-compiler
set compat_have_dfp [check_effective_target_dfprt_nocache]
compat-use-tst-compiler
verbose "compat_have_dfp for alt compiler: $compat_have_dfp" 2
}
- # Does the compiler under test support it?
- if { $compat_have_dfp == 1 } {
- set compat_have_dfp [check_effective_target_dfprt_nocache]
- verbose "compat_have_dfp for tst compiler: $compat_have_dfp" 2
- }
# If decimal float is not supported, add it to the skip list, which
# affects code in the header files.
diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index e8ca8fc7987..e1af1b039e6 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -51,8 +51,11 @@ set option_list $COMPAT_OPTIONS
# Subsets of tests can be selectively disabled by members of this list:
# - ATTRIBUTE: disable all tests using the __attribute__ extension,
+# - COMPLEX: disable all tests using the complex types feature,
# - COMPLEX_INT: disable all tests using the complex integral types extension,
# - VA: disable all tests using the variable number of arguments feature,
+# - VLA_IN_STRUCT: disable all tests using the variable-length arrays as
+# structure members extension,
# - ZERO_ARRAY: disable all tests using the zero-sized arrays extension.
# The default skip lists can be overriden by
# COMPAT_SKIPS="[list {skip_1}...{skip_n}]"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 925c892ee70..296506484ad 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2093,7 +2093,8 @@ proc check_effective_target_vect_short_mult { } {
if { [istarget ia64-*-*]
|| [istarget spu-*-*]
|| [istarget i?86-*-*]
- || [istarget x86_64-*-*] } {
+ || [istarget x86_64-*-*]
+ || [istarget powerpc*-*-*] } {
set et_vect_short_mult_saved 1
}
}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index ce06d0e583d..4b253bf7899 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3168,67 +3168,94 @@ valid_fixed_convert_types_p (tree type1, tree type2)
|| FIXED_POINT_TYPE_P (type2)));
}
-/* Verify that OP is a valid GIMPLE operand. Return true if there is
- an error, false otherwise. */
-
-static bool
-verify_types_in_gimple_op (tree op)
-{
- if (!is_gimple_val (op) && !is_gimple_lvalue (op))
- {
- error ("Invalid GIMPLE operand");
- debug_generic_expr (op);
- return true;
- }
-
- return false;
-}
-
-
/* Verify the contents of a GIMPLE_CALL STMT. Returns true when there
is a problem, otherwise false. */
static bool
-verify_types_in_gimple_call (gimple stmt)
+verify_gimple_call (gimple stmt)
{
- bool failed = false;
- unsigned int i;
- tree fn;
+ tree fn = gimple_call_fn (stmt);
+ tree fntype;
- if (gimple_call_lhs (stmt))
- failed |= verify_types_in_gimple_op (gimple_call_lhs (stmt));
+ if (!POINTER_TYPE_P (TREE_TYPE (fn))
+ || (TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != FUNCTION_TYPE
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != METHOD_TYPE))
+ {
+ error ("non-function in gimple call");
+ return true;
+ }
- fn = gimple_call_fn (stmt);
- if (TREE_CODE (fn) != OBJ_TYPE_REF
- && verify_types_in_gimple_op (fn))
- failed = true;
+ if (gimple_call_lhs (stmt)
+ && !is_gimple_lvalue (gimple_call_lhs (stmt)))
+ {
+ error ("invalid LHS in gimple call");
+ return true;
+ }
- if (gimple_call_chain (stmt))
- failed |= verify_types_in_gimple_op (gimple_call_chain (stmt));
+ fntype = TREE_TYPE (TREE_TYPE (fn));
+ if (gimple_call_lhs (stmt)
+ && !useless_type_conversion_p (TREE_TYPE (gimple_call_lhs (stmt)),
+ TREE_TYPE (fntype))
+ /* ??? At least C++ misses conversions at assignments from
+ void * call results.
+ ??? Java is completely off. Especially with functions
+ returning java.lang.Object.
+ For now simply allow arbitrary pointer type conversions. */
+ && !(POINTER_TYPE_P (TREE_TYPE (gimple_call_lhs (stmt)))
+ && POINTER_TYPE_P (TREE_TYPE (fntype))))
+ {
+ error ("invalid conversion in gimple call");
+ debug_generic_stmt (TREE_TYPE (gimple_call_lhs (stmt)));
+ debug_generic_stmt (TREE_TYPE (fntype));
+ return true;
+ }
- for (i = 0; i < gimple_call_num_args (stmt); i++)
- failed |= verify_types_in_gimple_op (gimple_call_arg (stmt,i));
+ /* ??? The C frontend passes unpromoted arguments in case it
+ didn't see a function declaration before the call. So for now
+ leave the call arguments unverified. Once we gimplify
+ unit-at-a-time we have a chance to fix this. */
- return failed;
+ return false;
}
-
-/* Verify the contents of a GIMPLE_COND STMT. Returns true when there
- is a problem, otherwise false. */
+/* Verifies the gimple comparison with the result type TYPE and
+ the operands OP0 and OP1. */
static bool
-verify_types_in_gimple_cond (gimple stmt)
+verify_gimple_comparison (tree type, tree op0, tree op1)
{
- bool failed = false;
-
- failed |= verify_types_in_gimple_op (gimple_cond_lhs (stmt));
- failed |= verify_types_in_gimple_op (gimple_cond_rhs (stmt));
- failed |= verify_types_in_gimple_op (gimple_cond_true_label (stmt));
- failed |= verify_types_in_gimple_op (gimple_cond_false_label (stmt));
+ tree op0_type = TREE_TYPE (op0);
+ tree op1_type = TREE_TYPE (op1);
- return failed;
-}
+ if (!is_gimple_val (op0) || !is_gimple_val (op1))
+ {
+ error ("invalid operands in gimple comparison");
+ return true;
+ }
+ /* For comparisons we do not have the operations type as the
+ effective type the comparison is carried out in. Instead
+ we require that either the first operand is trivially
+ convertible into the second, or the other way around.
+ The resulting type of a comparison may be any integral type.
+ Because we special-case pointers to void we allow
+ comparisons of pointers with the same mode as well. */
+ if ((!useless_type_conversion_p (op0_type, op1_type)
+ && !useless_type_conversion_p (op1_type, op0_type)
+ && (!POINTER_TYPE_P (op0_type)
+ || !POINTER_TYPE_P (op1_type)
+ || TYPE_MODE (op0_type) != TYPE_MODE (op1_type)))
+ || !INTEGRAL_TYPE_P (type))
+ {
+ error ("type mismatch in comparison expression");
+ debug_generic_expr (type);
+ debug_generic_expr (op0_type);
+ debug_generic_expr (op1_type);
+ return true;
+ }
+
+ return false;
+}
/* Verify the contents of a GIMPLE_ASSIGN STMT. Returns true when there
is a problem, otherwise false.
@@ -3588,35 +3615,7 @@ verify_types_in_gimple_assign (gimple stmt)
return verify_types_in_gimple_reference (rhs1);
case tcc_comparison:
- {
- if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
- {
- error ("invalid operands in comparison expression");
- return true;
- }
-
- /* For comparisons we do not have the operations type as the
- effective type the comparison is carried out in. Instead
- we require that either the first operand is trivially
- convertible into the second, or the other way around.
- The resulting type of a comparison may be any integral type.
- Because we special-case pointers to void we allow
- comparisons of pointers with the same mode as well. */
- if ((!useless_type_conversion_p (rhs1_type, rhs2_type)
- && !useless_type_conversion_p (rhs2_type, rhs1_type)
- && (!POINTER_TYPE_P (rhs1_type)
- || !POINTER_TYPE_P (rhs2_type)
- || TYPE_MODE (rhs1_type) != TYPE_MODE (rhs2_type)))
- || !INTEGRAL_TYPE_P (lhs_type))
- {
- error ("type mismatch in comparison expression");
- debug_generic_expr (lhs_type);
- debug_generic_expr (rhs1_type);
- debug_generic_expr (rhs2_type);
- return true;
- }
- break;
- }
+ return verify_gimple_comparison (lhs_type, rhs1, rhs2);
default:;
}
@@ -3629,27 +3628,72 @@ verify_types_in_gimple_assign (gimple stmt)
is a problem, otherwise false. */
static bool
-verify_types_in_gimple_return (gimple stmt)
+verify_gimple_return (gimple stmt)
{
tree op = gimple_return_retval (stmt);
+ tree restype = TREE_TYPE (TREE_TYPE (cfun->decl));
+ /* We cannot test for present return values as we do not fix up missing
+ return values from the original source. */
if (op == NULL)
return false;
-
- return verify_types_in_gimple_op (op);
+
+ if (!is_gimple_val (op)
+ && TREE_CODE (op) != RESULT_DECL)
+ {
+ error ("invalid operand in return statement");
+ debug_generic_stmt (op);
+ return true;
+ }
+
+ if (!useless_type_conversion_p (restype, TREE_TYPE (op))
+ /* ??? With C++ we can have the situation that the result
+ decl is a reference type while the return type is an aggregate. */
+ && !(TREE_CODE (op) == RESULT_DECL
+ && TREE_CODE (TREE_TYPE (op)) == REFERENCE_TYPE
+ && useless_type_conversion_p (restype, TREE_TYPE (TREE_TYPE (op)))))
+ {
+ error ("invalid conversion in return statement");
+ debug_generic_stmt (restype);
+ debug_generic_stmt (TREE_TYPE (op));
+ return true;
+ }
+
+ return false;
}
+/* Verify the contents of a GIMPLE_GOTO STMT. Returns true when there
+ is a problem, otherwise false. */
+
+static bool
+verify_gimple_goto (gimple stmt)
+{
+ tree dest = gimple_goto_dest (stmt);
+
+ /* ??? We have two canonical forms of direct goto destinations, a
+ bare LABEL_DECL and an ADDR_EXPR of a LABEL_DECL. */
+ if (TREE_CODE (dest) != LABEL_DECL
+ && (!is_gimple_val (dest)
+ || !POINTER_TYPE_P (TREE_TYPE (dest))))
+ {
+ error ("goto destination is neither a label nor a pointer");
+ return true;
+ }
+
+ return false;
+}
+
/* Verify the contents of a GIMPLE_SWITCH STMT. Returns true when there
is a problem, otherwise false. */
static bool
-verify_types_in_gimple_switch (gimple stmt)
+verify_gimple_switch (gimple stmt)
{
if (!is_gimple_val (gimple_switch_index (stmt)))
{
error ("invalid operand to switch statement");
- debug_generic_expr (gimple_switch_index (stmt));
+ debug_generic_stmt (gimple_switch_index (stmt));
return true;
}
@@ -3661,16 +3705,34 @@ verify_types_in_gimple_switch (gimple stmt)
and false otherwise. */
static bool
-verify_types_in_gimple_phi (gimple stmt)
+verify_gimple_phi (gimple stmt)
{
- size_t i;
+ tree type = TREE_TYPE (gimple_phi_result (stmt));
+ unsigned i;
- if (verify_types_in_gimple_op (gimple_phi_result (stmt)))
- return true;
+ if (!is_gimple_variable (gimple_phi_result (stmt)))
+ {
+ error ("Invalid PHI result");
+ return true;
+ }
for (i = 0; i < gimple_phi_num_args (stmt); i++)
- if (verify_types_in_gimple_op (gimple_phi_arg_def (stmt, i)))
- return true;
+ {
+ tree arg = gimple_phi_arg_def (stmt, i);
+ if (!is_gimple_val (arg))
+ {
+ error ("Invalid PHI argument");
+ debug_generic_stmt (arg);
+ return true;
+ }
+ if (!useless_type_conversion_p (type, TREE_TYPE (arg)))
+ {
+ error ("Incompatible types in PHI argument");
+ debug_generic_stmt (type);
+ debug_generic_stmt (TREE_TYPE (arg));
+ return true;
+ }
+ }
return false;
}
@@ -3702,32 +3764,37 @@ verify_types_in_gimple_stmt (gimple stmt)
return TREE_CODE (gimple_label_label (stmt)) != LABEL_DECL;
case GIMPLE_CALL:
- return verify_types_in_gimple_call (stmt);
+ return verify_gimple_call (stmt);
case GIMPLE_COND:
- return verify_types_in_gimple_cond (stmt);
+ return verify_gimple_comparison (boolean_type_node,
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt));
case GIMPLE_GOTO:
- return verify_types_in_gimple_op (gimple_goto_dest (stmt));
-
- case GIMPLE_NOP:
- case GIMPLE_PREDICT:
- return false;
+ return verify_gimple_goto (stmt);
case GIMPLE_SWITCH:
- return verify_types_in_gimple_switch (stmt);
+ return verify_gimple_switch (stmt);
case GIMPLE_RETURN:
- return verify_types_in_gimple_return (stmt);
+ return verify_gimple_return (stmt);
case GIMPLE_ASM:
return false;
case GIMPLE_CHANGE_DYNAMIC_TYPE:
- return verify_types_in_gimple_op (gimple_cdt_location (stmt));
+ return (!is_gimple_reg (gimple_cdt_location (stmt))
+ || !POINTER_TYPE_P (TREE_TYPE (gimple_cdt_location (stmt))));
case GIMPLE_PHI:
- return verify_types_in_gimple_phi (stmt);
+ return verify_gimple_phi (stmt);
+
+ /* Tuples that do not have tree operands. */
+ case GIMPLE_NOP:
+ case GIMPLE_RESX:
+ case GIMPLE_PREDICT:
+ return false;
default:
gcc_unreachable ();
@@ -3748,44 +3815,22 @@ verify_types_in_gimple_seq_2 (gimple_seq stmts)
switch (gimple_code (stmt))
{
- case GIMPLE_BIND:
- err |= verify_types_in_gimple_seq_2 (gimple_bind_body (stmt));
- break;
-
- case GIMPLE_TRY:
- err |= verify_types_in_gimple_seq_2 (gimple_try_eval (stmt));
- err |= verify_types_in_gimple_seq_2 (gimple_try_cleanup (stmt));
- break;
-
- case GIMPLE_EH_FILTER:
- err |= verify_types_in_gimple_seq_2
- (gimple_eh_filter_failure (stmt));
- break;
-
- case GIMPLE_CATCH:
- err |= verify_types_in_gimple_seq_2 (gimple_catch_handler (stmt));
- break;
-
- case GIMPLE_OMP_CRITICAL:
- case GIMPLE_OMP_CONTINUE:
- case GIMPLE_OMP_MASTER:
- case GIMPLE_OMP_ORDERED:
- case GIMPLE_OMP_SECTION:
- case GIMPLE_OMP_FOR:
- case GIMPLE_OMP_PARALLEL:
- case GIMPLE_OMP_TASK:
- case GIMPLE_OMP_SECTIONS:
- case GIMPLE_OMP_SINGLE:
- case GIMPLE_OMP_ATOMIC_STORE:
- case GIMPLE_OMP_ATOMIC_LOAD:
- break;
-
- /* Tuples that do not have trees. */
- case GIMPLE_NOP:
- case GIMPLE_RESX:
- case GIMPLE_OMP_RETURN:
- case GIMPLE_PREDICT:
- break;
+ case GIMPLE_BIND:
+ err |= verify_types_in_gimple_seq_2 (gimple_bind_body (stmt));
+ break;
+
+ case GIMPLE_TRY:
+ err |= verify_types_in_gimple_seq_2 (gimple_try_eval (stmt));
+ err |= verify_types_in_gimple_seq_2 (gimple_try_cleanup (stmt));
+ break;
+
+ case GIMPLE_EH_FILTER:
+ err |= verify_types_in_gimple_seq_2 (gimple_eh_filter_failure (stmt));
+ break;
+
+ case GIMPLE_CATCH:
+ err |= verify_types_in_gimple_seq_2 (gimple_catch_handler (stmt));
+ break;
default:
{
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index af1146c7fef..2be0ad1b401 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -747,6 +747,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
VEC (tree, heap) *access_fns = NULL;
tree ref = unshare_expr (DR_REF (dr)), aref = ref, op;
tree base, off, access_fn;
+ basic_block before_loop = block_before_loop (nest);
while (handled_component_p (aref))
{
@@ -754,7 +755,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
op = TREE_OPERAND (aref, 1);
access_fn = analyze_scalar_evolution (loop, op);
- access_fn = instantiate_scev (nest, loop, access_fn);
+ access_fn = instantiate_scev (before_loop, loop, access_fn);
VEC_safe_push (tree, heap, access_fns, access_fn);
TREE_OPERAND (aref, 1) = build_int_cst (TREE_TYPE (op), 0);
@@ -767,7 +768,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
op = TREE_OPERAND (aref, 0);
access_fn = analyze_scalar_evolution (loop, op);
- access_fn = instantiate_scev (nest, loop, access_fn);
+ access_fn = instantiate_scev (before_loop, loop, access_fn);
base = initial_condition (access_fn);
split_constant_offset (base, &base, &off);
access_fn = chrec_replace_initial_condition (access_fn,
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 8b603f0a37c..d083a5467b8 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1331,6 +1331,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
gimple_call_set_lhs (new_call, gimple_call_lhs (stmt));
gsi_replace (&copy_gsi, new_call, false);
+ gimple_set_bb (stmt, NULL);
stmt = new_call;
}
else if (is_gimple_call (stmt)
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 67fcd08dda0..64d628a1adf 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -175,8 +175,8 @@ along with GCC; see the file COPYING3. If not see
value of loop_2 for "j" is 4, and the evolution of "k" in loop_1 is
{0, +, 1}_1. To obtain the evolution function in loop_3 and
instantiate the scalar variables up to loop_1, one has to use:
- instantiate_scev (loop_1, loop_3, "j + k"). The result of this
- call is {{0, +, 1}_1, +, 1}_2.
+ instantiate_scev (block_before_loop (loop_1), loop_3, "j + k").
+ The result of this call is {{0, +, 1}_1, +, 1}_2.
Example 3: Higher degree polynomials.
@@ -278,11 +278,13 @@ along with GCC; see the file COPYING3. If not see
static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
-/* The cached information about a ssa name VAR, claiming that inside LOOP,
- the value of VAR can be expressed as CHREC. */
+/* The cached information about an SSA name VAR, claiming that below
+ basic block INSTANTIATED_BELOW, the value of VAR can be expressed
+ as CHREC. */
struct scev_info_str GTY(())
{
+ basic_block instantiated_below;
tree var;
tree chrec;
};
@@ -306,22 +308,21 @@ tree chrec_dont_know;
happen, then it qualifies it with chrec_known. */
tree chrec_known;
-static bitmap already_instantiated;
-
static GTY ((param_is (struct scev_info_str))) htab_t scalar_evolution_info;
-/* Constructs a new SCEV_INFO_STR structure. */
+/* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */
static inline struct scev_info_str *
-new_scev_info_str (tree var)
+new_scev_info_str (basic_block instantiated_below, tree var)
{
struct scev_info_str *res;
res = GGC_NEW (struct scev_info_str);
res->var = var;
res->chrec = chrec_not_analyzed_yet;
-
+ res->instantiated_below = instantiated_below;
+
return res;
}
@@ -341,7 +342,8 @@ eq_scev_info (const void *e1, const void *e2)
const struct scev_info_str *elt1 = (const struct scev_info_str *) e1;
const struct scev_info_str *elt2 = (const struct scev_info_str *) e2;
- return elt1->var == elt2->var;
+ return (elt1->var == elt2->var
+ && elt1->instantiated_below == elt2->instantiated_below);
}
/* Deletes database element E. */
@@ -352,22 +354,22 @@ del_scev_info (void *e)
ggc_free (e);
}
-/* Get the index corresponding to VAR in the current LOOP. If
- it's the first time we ask for this VAR, then we return
- chrec_not_analyzed_yet for this VAR and return its index. */
+/* Get the scalar evolution of VAR for INSTANTIATED_BELOW basic block.
+ A first query on VAR returns chrec_not_analyzed_yet. */
static tree *
-find_var_scev_info (tree var)
+find_var_scev_info (basic_block instantiated_below, tree var)
{
struct scev_info_str *res;
struct scev_info_str tmp;
PTR *slot;
tmp.var = var;
+ tmp.instantiated_below = instantiated_below;
slot = htab_find_slot (scalar_evolution_info, &tmp, INSERT);
if (!*slot)
- *slot = new_scev_info_str (var);
+ *slot = new_scev_info_str (instantiated_below, var);
res = (struct scev_info_str *) *slot;
return &res->chrec;
@@ -570,20 +572,22 @@ chrec_is_positive (tree chrec, bool *value)
/* Associate CHREC to SCALAR. */
static void
-set_scalar_evolution (tree scalar, tree chrec)
+set_scalar_evolution (basic_block instantiated_below, tree scalar, tree chrec)
{
tree *scalar_info;
if (TREE_CODE (scalar) != SSA_NAME)
return;
- scalar_info = find_var_scev_info (scalar);
+ scalar_info = find_var_scev_info (instantiated_below, scalar);
if (dump_file)
{
if (dump_flags & TDF_DETAILS)
{
fprintf (dump_file, "(set_scalar_evolution \n");
+ fprintf (dump_file, " instantiated_below = %d \n",
+ instantiated_below->index);
fprintf (dump_file, " (scalar = ");
print_generic_expr (dump_file, scalar, 0);
fprintf (dump_file, ")\n (scalar_evolution = ");
@@ -597,10 +601,11 @@ set_scalar_evolution (tree scalar, tree chrec)
*scalar_info = chrec;
}
-/* Retrieve the chrec associated to SCALAR in the LOOP. */
+/* Retrieve the chrec associated to SCALAR instantiated below
+ INSTANTIATED_BELOW block. */
static tree
-get_scalar_evolution (tree scalar)
+get_scalar_evolution (basic_block instantiated_below, tree scalar)
{
tree res;
@@ -620,7 +625,7 @@ get_scalar_evolution (tree scalar)
switch (TREE_CODE (scalar))
{
case SSA_NAME:
- res = *find_var_scev_info (scalar);
+ res = *find_var_scev_info (instantiated_below, scalar);
break;
case REAL_CST:
@@ -1845,7 +1850,7 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
res = var;
if (loop == def_loop)
- set_scalar_evolution (var, res);
+ set_scalar_evolution (block_before_loop (loop), var, res);
return res;
}
@@ -1879,7 +1884,8 @@ analyze_scalar_evolution (struct loop *loop, tree var)
fprintf (dump_file, ")\n");
}
- res = analyze_scalar_evolution_1 (loop, var, get_scalar_evolution (var));
+ res = get_scalar_evolution (block_before_loop (loop), var);
+ res = analyze_scalar_evolution_1 (loop, var, res);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, ")\n");
@@ -1926,14 +1932,17 @@ analyze_scalar_evolution_in_loop (struct loop *wrto_loop, struct loop *use_loop,
}
}
-/* Returns instantiated value for VERSION in CACHE. */
+/* Returns from CACHE the value for VERSION instantiated below
+ INSTANTIATED_BELOW block. */
static tree
-get_instantiated_value (htab_t cache, tree version)
+get_instantiated_value (htab_t cache, basic_block instantiated_below,
+ tree version)
{
struct scev_info_str *info, pattern;
pattern.var = version;
+ pattern.instantiated_below = instantiated_below;
info = (struct scev_info_str *) htab_find (cache, &pattern);
if (info)
@@ -1942,10 +1951,12 @@ get_instantiated_value (htab_t cache, tree version)
return NULL_TREE;
}
-/* Sets instantiated value for VERSION to VAL in CACHE. */
+/* Sets in CACHE the value of VERSION instantiated below basic block
+ INSTANTIATED_BELOW to VAL. */
static void
-set_instantiated_value (htab_t cache, tree version, tree val)
+set_instantiated_value (htab_t cache, basic_block instantiated_below,
+ tree version, tree val)
{
struct scev_info_str *info, pattern;
PTR *slot;
@@ -1954,7 +1965,7 @@ set_instantiated_value (htab_t cache, tree version, tree val)
slot = htab_find_slot (cache, &pattern, INSERT);
if (!*slot)
- *slot = new_scev_info_str (version);
+ *slot = new_scev_info_str (instantiated_below, version);
info = (struct scev_info_str *) *slot;
info->chrec = val;
}
@@ -1989,7 +2000,7 @@ loop_closed_phi_def (tree var)
return NULL_TREE;
}
-/* Analyze all the parameters of the chrec, between INSTANTIATION_LOOP
+/* Analyze all the parameters of the chrec, between INSTANTIATE_BELOW
and EVOLUTION_LOOP, that were left under a symbolic form.
CHREC is the scalar evolution to instantiate.
@@ -2004,7 +2015,7 @@ loop_closed_phi_def (tree var)
instantiated, and to stop if it exceeds some limit. */
static tree
-instantiate_scev_1 (struct loop *instantiation_loop,
+instantiate_scev_1 (basic_block instantiate_below,
struct loop *evolution_loop, tree chrec,
bool fold_conversions, htab_t cache, int size_expr)
{
@@ -2030,7 +2041,7 @@ instantiate_scev_1 (struct loop *instantiation_loop,
evolutions in outer loops), nothing to do. */
if (!def_bb
|| loop_depth (def_bb->loop_father) == 0
- || !flow_bb_inside_loop_p (instantiation_loop, def_bb))
+ || dominated_by_p (CDI_DOMINATORS, instantiate_below, def_bb))
return chrec;
/* We cache the value of instantiated variable to avoid exponential
@@ -2042,31 +2053,17 @@ instantiate_scev_1 (struct loop *instantiation_loop,
| a_2 -> {0, +, 1, +, a_2}_1 */
- res = get_instantiated_value (cache, chrec);
+ res = get_instantiated_value (cache, instantiate_below, chrec);
if (res)
return res;
- /* Store the convenient value for chrec in the structure. If it
- is defined outside of the loop, we may just leave it in symbolic
- form, otherwise we need to admit that we do not know its behavior
- inside the loop. */
- res = !flow_bb_inside_loop_p (instantiation_loop, def_bb)
- ? chrec : chrec_dont_know;
- set_instantiated_value (cache, chrec, res);
-
- /* To make things even more complicated, instantiate_scev_1
- calls analyze_scalar_evolution that may call # of iterations
- analysis that may in turn call instantiate_scev_1 again.
- To prevent the infinite recursion, keep also the bitmap of
- ssa names that are being instantiated globally. */
- if (bitmap_bit_p (already_instantiated, SSA_NAME_VERSION (chrec)))
- return res;
+ res = chrec_dont_know;
+ set_instantiated_value (cache, instantiate_below, chrec, res);
def_loop = find_common_loop (evolution_loop, def_bb->loop_father);
/* If the analysis yields a parametric chrec, instantiate the
result again. */
- bitmap_set_bit (already_instantiated, SSA_NAME_VERSION (chrec));
res = analyze_scalar_evolution (def_loop, chrec);
/* Don't instantiate loop-closed-ssa phi nodes. */
@@ -2085,23 +2082,21 @@ instantiate_scev_1 (struct loop *instantiation_loop,
}
else if (res != chrec_dont_know)
- res = instantiate_scev_1 (instantiation_loop, evolution_loop, res,
+ res = instantiate_scev_1 (instantiate_below, evolution_loop, res,
fold_conversions, cache, size_expr);
- bitmap_clear_bit (already_instantiated, SSA_NAME_VERSION (chrec));
-
/* Store the correct value to the cache. */
- set_instantiated_value (cache, chrec, res);
+ set_instantiated_value (cache, instantiate_below, chrec, res);
return res;
case POLYNOMIAL_CHREC:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
CHREC_LEFT (chrec), fold_conversions, cache,
size_expr);
if (op0 == chrec_dont_know)
return chrec_dont_know;
- op1 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op1 = instantiate_scev_1 (instantiate_below, evolution_loop,
CHREC_RIGHT (chrec), fold_conversions, cache,
size_expr);
if (op1 == chrec_dont_know)
@@ -2117,13 +2112,13 @@ instantiate_scev_1 (struct loop *instantiation_loop,
case POINTER_PLUS_EXPR:
case PLUS_EXPR:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0), fold_conversions, cache,
size_expr);
if (op0 == chrec_dont_know)
return chrec_dont_know;
- op1 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op1 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 1), fold_conversions, cache,
size_expr);
if (op1 == chrec_dont_know)
@@ -2139,13 +2134,13 @@ instantiate_scev_1 (struct loop *instantiation_loop,
return chrec;
case MINUS_EXPR:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0), fold_conversions, cache,
size_expr);
if (op0 == chrec_dont_know)
return chrec_dont_know;
- op1 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op1 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 1),
fold_conversions, cache, size_expr);
if (op1 == chrec_dont_know)
@@ -2161,13 +2156,13 @@ instantiate_scev_1 (struct loop *instantiation_loop,
return chrec;
case MULT_EXPR:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0),
fold_conversions, cache, size_expr);
if (op0 == chrec_dont_know)
return chrec_dont_know;
- op1 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op1 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 1),
fold_conversions, cache, size_expr);
if (op1 == chrec_dont_know)
@@ -2183,7 +2178,7 @@ instantiate_scev_1 (struct loop *instantiation_loop,
return chrec;
CASE_CONVERT:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0),
fold_conversions, cache, size_expr);
if (op0 == chrec_dont_know)
@@ -2221,19 +2216,19 @@ instantiate_scev_1 (struct loop *instantiation_loop,
switch (TREE_CODE_LENGTH (TREE_CODE (chrec)))
{
case 3:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0),
fold_conversions, cache, size_expr);
if (op0 == chrec_dont_know)
return chrec_dont_know;
- op1 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op1 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 1),
fold_conversions, cache, size_expr);
if (op1 == chrec_dont_know)
return chrec_dont_know;
- op2 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op2 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 2),
fold_conversions, cache, size_expr);
if (op2 == chrec_dont_know)
@@ -2248,13 +2243,13 @@ instantiate_scev_1 (struct loop *instantiation_loop,
TREE_TYPE (chrec), op0, op1, op2);
case 2:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0),
fold_conversions, cache, size_expr);
if (op0 == chrec_dont_know)
return chrec_dont_know;
- op1 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op1 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 1),
fold_conversions, cache, size_expr);
if (op1 == chrec_dont_know)
@@ -2266,7 +2261,7 @@ instantiate_scev_1 (struct loop *instantiation_loop,
return fold_build2 (TREE_CODE (chrec), TREE_TYPE (chrec), op0, op1);
case 1:
- op0 = instantiate_scev_1 (instantiation_loop, evolution_loop,
+ op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
TREE_OPERAND (chrec, 0),
fold_conversions, cache, size_expr);
if (op0 == chrec_dont_know)
@@ -2287,12 +2282,13 @@ instantiate_scev_1 (struct loop *instantiation_loop,
}
/* Analyze all the parameters of the chrec that were left under a
- symbolic form. INSTANTIATION_LOOP is the loop in which symbolic
- names have to be instantiated, and EVOLUTION_LOOP is the loop in
- which the evolution of scalars have to be analyzed. */
+ symbolic form. INSTANTIATE_BELOW is the basic block that stops the
+ recursive instantiation of parameters: a parameter is a variable
+ that is defined in a basic block that dominates INSTANTIATE_BELOW or
+ a function parameter. */
tree
-instantiate_scev (struct loop *instantiation_loop, struct loop *evolution_loop,
+instantiate_scev (basic_block instantiate_below, struct loop *evolution_loop,
tree chrec)
{
tree res;
@@ -2301,14 +2297,14 @@ instantiate_scev (struct loop *instantiation_loop, struct loop *evolution_loop,
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "(instantiate_scev \n");
- fprintf (dump_file, " (instantiation_loop = %d)\n", instantiation_loop->num);
+ fprintf (dump_file, " (instantiate_below = %d)\n", instantiate_below->index);
fprintf (dump_file, " (evolution_loop = %d)\n", evolution_loop->num);
fprintf (dump_file, " (chrec = ");
print_generic_expr (dump_file, chrec, 0);
fprintf (dump_file, ")\n");
}
- res = instantiate_scev_1 (instantiation_loop, evolution_loop, chrec, false,
+ res = instantiate_scev_1 (instantiate_below, evolution_loop, chrec, false,
cache, 0);
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2332,7 +2328,8 @@ tree
resolve_mixers (struct loop *loop, tree chrec)
{
htab_t cache = htab_create (10, hash_scev_info, eq_scev_info, del_scev_info);
- tree ret = instantiate_scev_1 (loop, loop, chrec, true, cache, 0);
+ tree ret = instantiate_scev_1 (block_before_loop (loop), loop, chrec, true,
+ cache, 0);
htab_delete (cache);
return ret;
}
@@ -2677,7 +2674,6 @@ scev_initialize (void)
del_scev_info,
ggc_calloc,
ggc_free);
- already_instantiated = BITMAP_ALLOC (NULL);
initialize_scalar_evolutions_analyzer ();
@@ -2791,7 +2787,6 @@ scev_finalize (void)
if (!scalar_evolution_info)
return;
htab_delete (scalar_evolution_info);
- BITMAP_FREE (already_instantiated);
scalar_evolution_info = NULL;
}
diff --git a/gcc/tree-scalar-evolution.h b/gcc/tree-scalar-evolution.h
index 5d6d711afa9..7ba0708354f 100644
--- a/gcc/tree-scalar-evolution.h
+++ b/gcc/tree-scalar-evolution.h
@@ -29,7 +29,7 @@ extern void scev_initialize (void);
extern void scev_reset (void);
extern void scev_finalize (void);
extern tree analyze_scalar_evolution (struct loop *, tree);
-extern tree instantiate_scev (struct loop *, struct loop *, tree);
+extern tree instantiate_scev (basic_block, struct loop *, tree);
extern tree resolve_mixers (struct loop *, tree);
extern void gather_stats_on_scev_database (void);
extern void scev_analysis (void);
@@ -37,6 +37,16 @@ unsigned int scev_const_prop (void);
extern bool simple_iv (struct loop *, gimple, tree, affine_iv *, bool);
+/* Returns the basic block preceding LOOP or ENTRY_BLOCK_PTR when the
+ loop is function's body. */
+
+static inline basic_block
+block_before_loop (loop_p loop)
+{
+ edge preheader = loop_preheader_edge (loop);
+ return (preheader ? preheader->src : ENTRY_BLOCK_PTR);
+}
+
/* Analyze all the parameters of the chrec that were left under a
symbolic form. LOOP is the loop in which symbolic names have to
be analyzed and instantiated. */
@@ -44,7 +54,7 @@ extern bool simple_iv (struct loop *, gimple, tree, affine_iv *, bool);
static inline tree
instantiate_parameters (struct loop *loop, tree chrec)
{
- return instantiate_scev (loop, loop, chrec);
+ return instantiate_scev (block_before_loop (loop), loop, chrec);
}
/* Returns the loop of the polynomial chrec CHREC. */
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 8f700c47be2..22626a53840 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1047,6 +1047,7 @@ ccp_fold (gimple stmt)
fn = val->value;
}
if (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (fn, 0)))
{
tree *args = XALLOCAVEC (tree, gimple_call_num_args (stmt));
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index cd7defa869c..bf2049eb8d8 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2179,7 +2179,8 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
{
gimple stmt, old_stmt;
bool may_optimize_p;
- bool may_have_exposed_new_symbols = false;
+ bool may_have_exposed_new_symbols;
+ bool modified_p = false;
old_stmt = stmt = gsi_stmt (si);
@@ -2188,7 +2189,6 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
update_stmt_if_modified (stmt);
opt_stats.num_stmts++;
- may_have_exposed_new_symbols = false;
push_stmt_changes (gsi_stmt_ptr (&si));
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2237,6 +2237,10 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
Indicate we will need to rescan and rewrite the statement. */
may_have_exposed_new_symbols = true;
+ /* Indicate that maybe_clean_or_replace_eh_stmt needs to be called,
+ even if fold_stmt updated the stmt already and thus cleared
+ gimple_modified_p flag on it. */
+ modified_p = true;
}
/* Check for redundant computations. Do this optimization only
@@ -2285,7 +2289,7 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
Ultimately I suspect we're going to need to change the interface
into the SSA_NAME manager. */
- if (gimple_modified_p (stmt))
+ if (gimple_modified_p (stmt) || modified_p)
{
tree val = NULL;
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index a4a74ee6be4..eedeb62938d 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -440,6 +440,25 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
else
return false;
+ /* As we strip non-widening conversions in finding a common
+ name that is tested make sure to end up with an integral
+ type for building the bit operations. */
+ if (TYPE_PRECISION (TREE_TYPE (bits1))
+ >= TYPE_PRECISION (TREE_TYPE (bits2)))
+ {
+ bits1 = fold_convert (unsigned_type_for (TREE_TYPE (bits1)), bits1);
+ name1 = fold_convert (TREE_TYPE (bits1), name1);
+ bits2 = fold_convert (unsigned_type_for (TREE_TYPE (bits2)), bits2);
+ bits2 = fold_convert (TREE_TYPE (bits1), bits2);
+ }
+ else
+ {
+ bits2 = fold_convert (unsigned_type_for (TREE_TYPE (bits2)), bits2);
+ name1 = fold_convert (TREE_TYPE (bits2), name1);
+ bits1 = fold_convert (unsigned_type_for (TREE_TYPE (bits1)), bits1);
+ bits1 = fold_convert (TREE_TYPE (bits2), bits1);
+ }
+
/* Do it. */
gsi = gsi_for_stmt (inner_cond);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), bits1, bits2);
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index fa3834d21c5..859c0c7427d 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -489,6 +489,13 @@ remove_unused_scope_block_p (tree scope)
if (TREE_CODE (*t) == FUNCTION_DECL)
unused = false;
+ /* Remove everything we don't generate debug info for. */
+ else if (DECL_IGNORED_P (*t))
+ {
+ *t = TREE_CHAIN (*t);
+ next = t;
+ }
+
/* When we are outputting debug info, we usually want to output
info about optimized-out variables in the scope blocks.
Exception are the scope blocks not containing any instructions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 0b995d6837d..09b2ee8fffd 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1607,13 +1607,17 @@ static bool
visit_copy (tree lhs, tree rhs)
{
/* Follow chains of copies to their destination. */
- while (SSA_VAL (rhs) != rhs && TREE_CODE (SSA_VAL (rhs)) == SSA_NAME)
+ while (TREE_CODE (rhs) == SSA_NAME
+ && SSA_VAL (rhs) != rhs)
rhs = SSA_VAL (rhs);
/* The copy may have a more interesting constant filled expression
(we don't, since we know our RHS is just an SSA name). */
- VN_INFO (lhs)->has_constants = VN_INFO (rhs)->has_constants;
- VN_INFO (lhs)->expr = VN_INFO (rhs)->expr;
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ VN_INFO (lhs)->has_constants = VN_INFO (rhs)->has_constants;
+ VN_INFO (lhs)->expr = VN_INFO (rhs)->expr;
+ }
return set_ssa_val_to (lhs, rhs);
}
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 3a77c5bab1c..17f3217160f 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -7332,6 +7332,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
access_fn = analyze_scalar_evolution (loop, PHI_RESULT (phi));
gcc_assert (access_fn);
+ STRIP_NOPS (access_fn);
evolution_part =
unshare_expr (evolution_part_in_loop_num (access_fn, loop->num));
gcc_assert (evolution_part != NULL_TREE);
diff --git a/gcc/tree.h b/gcc/tree.h
index 43531e59e4b..2dc3e6b9ec1 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5045,7 +5045,6 @@ extern void expand_asm_expr (tree);
extern tree resolve_asm_operand_names (tree, tree, tree);
extern void expand_case (tree);
extern void expand_decl (tree);
-extern void expand_anon_union_decl (tree, tree, tree);
#ifdef HARD_CONST
/* Silly ifdef to avoid having all includers depend on hard-reg-set.h. */
extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
diff --git a/include/ChangeLog b/include/ChangeLog
index 1636e982f79..64b0a6caeeb 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-09 Jason Merrill <jason@redhat.com>
+
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_DECLTYPE.
+
2008-07-07 Joel Brobecker <brobecker@adacore.com>
* safe-ctype.h: Add #include of ctype.h before redefining
diff --git a/include/demangle.h b/include/demangle.h
index 78e022dffe8..146d778e097 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -370,7 +370,9 @@ enum demangle_component_type
subtree is the first part and the right subtree the second. */
DEMANGLE_COMPONENT_COMPOUND_NAME,
/* A name formed by a single character. */
- DEMANGLE_COMPONENT_CHARACTER
+ DEMANGLE_COMPONENT_CHARACTER,
+ /* A decltype type. */
+ DEMANGLE_COMPONENT_DECLTYPE
};
/* Types which are only used internally. */
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 30b91d10f90..3a0b2483532 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,21 @@
+2008-09-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/37203
+ * intrinsics/reshape_generic.c: Add checking on
+ out-of-bounds and duplicate values of order argument.
+ * m4/reshape.m4: Likewise.
+ * generated/reshape_c10.c: Regenerated.
+ * generated/reshape_c16.c: Regenerated.
+ * generated/reshape_c4.c: Regenerated.
+ * generated/reshape_c8.c: Regenerated.
+ * generated/reshape_i16.c: Regenerated.
+ * generated/reshape_i4.c: Regenerated.
+ * generated/reshape_i8.c: Regenerated.
+ * generated/reshape_r10.c: Regenerated.
+ * generated/reshape_r16.c: Regenerated.
+ * generated/reshape_r4.c: Regenerated.
+ * generated/reshape_r8.c: Regenerated.
+
2008-09-06 Tobias Burnus <burnus@net-b.de>
* libgfortran.h (likely,unlikely): New makros.
diff --git a/libgfortran/generated/reshape_c10.c b/libgfortran/generated/reshape_c10.c
index 732d947a8da..ed54f1b637e 100644
--- a/libgfortran/generated/reshape_c10.c
+++ b/libgfortran/generated/reshape_c10.c
@@ -119,6 +119,33 @@ reshape_c10 (gfc_array_c10 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_c16.c b/libgfortran/generated/reshape_c16.c
index 71532c929ef..636150933a0 100644
--- a/libgfortran/generated/reshape_c16.c
+++ b/libgfortran/generated/reshape_c16.c
@@ -119,6 +119,33 @@ reshape_c16 (gfc_array_c16 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_c4.c b/libgfortran/generated/reshape_c4.c
index 4253b066815..869d6231239 100644
--- a/libgfortran/generated/reshape_c4.c
+++ b/libgfortran/generated/reshape_c4.c
@@ -119,6 +119,33 @@ reshape_c4 (gfc_array_c4 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_c8.c b/libgfortran/generated/reshape_c8.c
index add90f2f205..24ec469bcab 100644
--- a/libgfortran/generated/reshape_c8.c
+++ b/libgfortran/generated/reshape_c8.c
@@ -119,6 +119,33 @@ reshape_c8 (gfc_array_c8 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_i16.c b/libgfortran/generated/reshape_i16.c
index e2d5a275842..e857b6b6a24 100644
--- a/libgfortran/generated/reshape_i16.c
+++ b/libgfortran/generated/reshape_i16.c
@@ -119,6 +119,33 @@ reshape_16 (gfc_array_i16 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_i4.c b/libgfortran/generated/reshape_i4.c
index 3e0c9d68542..517d25d8703 100644
--- a/libgfortran/generated/reshape_i4.c
+++ b/libgfortran/generated/reshape_i4.c
@@ -119,6 +119,33 @@ reshape_4 (gfc_array_i4 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_i8.c b/libgfortran/generated/reshape_i8.c
index bf3185e1c2c..75ba3197f34 100644
--- a/libgfortran/generated/reshape_i8.c
+++ b/libgfortran/generated/reshape_i8.c
@@ -119,6 +119,33 @@ reshape_8 (gfc_array_i8 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_r10.c b/libgfortran/generated/reshape_r10.c
index 9f6159aeafb..2987ef7a58c 100644
--- a/libgfortran/generated/reshape_r10.c
+++ b/libgfortran/generated/reshape_r10.c
@@ -119,6 +119,33 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_r16.c b/libgfortran/generated/reshape_r16.c
index 69578f033a5..2d84b2b8672 100644
--- a/libgfortran/generated/reshape_r16.c
+++ b/libgfortran/generated/reshape_r16.c
@@ -119,6 +119,33 @@ reshape_r16 (gfc_array_r16 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_r4.c b/libgfortran/generated/reshape_r4.c
index 112dbf2955d..fa68f826dac 100644
--- a/libgfortran/generated/reshape_r4.c
+++ b/libgfortran/generated/reshape_r4.c
@@ -119,6 +119,33 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/generated/reshape_r8.c b/libgfortran/generated/reshape_r8.c
index 015546ffe1a..8af57393439 100644
--- a/libgfortran/generated/reshape_r8.c
+++ b/libgfortran/generated/reshape_r8.c
@@ -119,6 +119,33 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/intrinsics/reshape_generic.c b/libgfortran/intrinsics/reshape_generic.c
index de1e9426756..5abae82ca03 100644
--- a/libgfortran/intrinsics/reshape_generic.c
+++ b/libgfortran/intrinsics/reshape_generic.c
@@ -108,6 +108,33 @@ reshape_internal (parray *ret, parray *source, shape_type *shape,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4
index a10ad715584..400e82cde69 100644
--- a/libgfortran/m4/reshape.m4
+++ b/libgfortran/m4/reshape.m4
@@ -123,6 +123,33 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret,
if (shape_empty)
return;
+ if (unlikely (compile_options.bounds_check))
+ {
+ if (order)
+ {
+ int seen[GFC_MAX_DIMENSIONS];
+ index_type v;
+
+ for (n = 0; n < rdim; n++)
+ seen[n] = 0;
+
+ for (n = 0; n < rdim; n++)
+ {
+ v = order->data[n * order->dim[0].stride] - 1;
+
+ if (v < 0 || v >= rdim)
+ runtime_error("Value %ld out of range in ORDER argument"
+ " to RESHAPE intrinsic", (long int) v + 1);
+
+ if (seen[v] != 0)
+ runtime_error("Duplicate value %ld in ORDER argument to"
+ " RESHAPE intrinsic", (long int) v + 1);
+
+ seen[v] = 1;
+ }
+ }
+ }
+
rsize = 1;
for (n = 0; n < rdim; n++)
{
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 5ab73176760..e6980aea132 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,15 @@
+2008-09-09 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DECLTYPE.
+ (d_make_comp): Likewise.
+ (cplus_demangle_type): Handle decltype and DFP types.
+ (cplus_demangle_operators): Call operator takes 2 args.
+ (cplus_demangle_builtin_types): Add DFP types.
+ (d_exprlist): New fn.
+ (d_expression): Handle parm placeholders, T() and calls.
+ (d_print_comp): Handle decltype, T() and calls.
+ * testsuite/demangle-expected: Test the above.
+
2008-08-07 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* pex-win32.c (argv_to_argc): New function.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 82107bc3548..3d292f07d0a 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -660,6 +660,9 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_CHARACTER:
printf ("character '%c'\n", dc->u.s_character.character);
return;
+ case DEMANGLE_COMPONENT_DECLTYPE:
+ printf ("decltype\n");
+ break;
}
d_dump (d_left (dc), indent + 2);
@@ -807,6 +810,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
case DEMANGLE_COMPONENT_CAST:
case DEMANGLE_COMPONENT_JAVA_RESOURCE:
+ case DEMANGLE_COMPONENT_DECLTYPE:
if (left == NULL)
return NULL;
break;
@@ -1422,7 +1426,7 @@ const struct demangle_operator_info cplus_demangle_operators[] =
{ "aa", NL ("&&"), 2 },
{ "ad", NL ("&"), 1 },
{ "an", NL ("&"), 2 },
- { "cl", NL ("()"), 0 },
+ { "cl", NL ("()"), 2 },
{ "cm", NL (","), 2 },
{ "co", NL ("~"), 1 },
{ "dV", NL ("/="), 2 },
@@ -1871,12 +1875,15 @@ cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =
/* n */ { NL ("__int128"), NL ("__int128"), D_PRINT_DEFAULT },
/* o */ { NL ("unsigned __int128"), NL ("unsigned __int128"),
D_PRINT_DEFAULT },
- /* p */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
- /* q */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
- /* r */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* The decimal floating point and half-precision floating point types
+ don't use the normal builtin type encoding, they're just stuck into
+ holes in the table for convenience. */
+ /* p */ { NL ("decimal32"), NL ("decimal32"), D_PRINT_DEFAULT },
+ /* q */ { NL ("decimal64"), NL ("decimal64"), D_PRINT_DEFAULT },
+ /* r */ { NL ("decimal128"), NL ("decimal128"), D_PRINT_DEFAULT },
/* s */ { NL ("short"), NL ("short"), D_PRINT_DEFAULT },
/* t */ { NL ("unsigned short"), NL ("unsigned short"), D_PRINT_DEFAULT },
- /* u */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* u */ { NL ("half"), NL ("half"), D_PRINT_FLOAT },
/* v */ { NL ("void"), NL ("void"), D_PRINT_VOID },
/* w */ { NL ("wchar_t"), NL ("char"), D_PRINT_DEFAULT },
/* x */ { NL ("long long"), NL ("long"), D_PRINT_LONG_LONG },
@@ -2046,6 +2053,52 @@ cplus_demangle_type (struct d_info *di)
cplus_demangle_type (di), ret);
break;
+ case 'D':
+ can_subst = 0;
+ d_advance (di, 1);
+ peek = d_next_char (di);
+ switch (peek)
+ {
+ case 'T':
+ case 't':
+ /* decltype (expression) */
+ ret = d_make_comp (di, DEMANGLE_COMPONENT_DECLTYPE,
+ d_expression (di), NULL);
+ if (ret && d_next_char (di) != 'E')
+ ret = NULL;
+ break;
+
+ case 'p':
+ /* Pack expansion. */
+ return NULL;
+
+ case 'f':
+ /* 32-bit DFP */
+ ret = d_make_builtin_type (di,
+ &cplus_demangle_builtin_types['p' - 'a']);
+ di->expansion += ret->u.s_builtin.type->len;
+ break;
+ case 'd':
+ /* 64-bit decimal floating point */
+ ret = d_make_builtin_type (di,
+ &cplus_demangle_builtin_types['q' - 'a']);
+ di->expansion += ret->u.s_builtin.type->len;
+ break;
+ case 'e':
+ /* 128-bit DFP */
+ ret = d_make_builtin_type (di,
+ &cplus_demangle_builtin_types['r' - 'a']);
+ di->expansion += ret->u.s_builtin.type->len;
+ break;
+ case 'h':
+ /* 16-bit half-precision FP */
+ ret = d_make_builtin_type (di,
+ &cplus_demangle_builtin_types['u' - 'a']);
+ di->expansion += ret->u.s_builtin.type->len;
+ break;
+ }
+ break;
+
default:
return NULL;
}
@@ -2391,9 +2444,39 @@ d_template_arg (struct d_info *di)
}
}
+/* Subroutine of <expression> ::= cl <expression>+ E */
+
+static struct demangle_component *
+d_exprlist (struct d_info *di)
+{
+ struct demangle_component *list = NULL;
+ struct demangle_component **p = &list;
+
+ while (1)
+ {
+ struct demangle_component *arg = d_expression (di);
+ if (arg == NULL)
+ return NULL;
+
+ *p = d_make_comp (di, DEMANGLE_COMPONENT_ARGLIST, arg, NULL);
+ if (*p == NULL)
+ return NULL;
+ p = &d_right (*p);
+
+ if (d_peek_char (di) == 'E')
+ {
+ d_advance (di, 1);
+ break;
+ }
+ }
+
+ return list;
+}
+
/* <expression> ::= <(unary) operator-name> <expression>
::= <(binary) operator-name> <expression> <expression>
::= <(trinary) operator-name> <expression> <expression> <expression>
+ ::= cl <expression>+ E
::= st <type>
::= <template-param>
::= sr <type> <unqualified-name>
@@ -2426,6 +2509,12 @@ d_expression (struct d_info *di)
d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, name,
d_template_args (di)));
}
+ else if (peek == 's' && d_peek_next_char (di) == 'T')
+ {
+ /* Just demangle a parameter placeholder as its type. */
+ d_advance (di, 2);
+ return cplus_demangle_type (di);
+ }
else
{
struct demangle_component *op;
@@ -2454,7 +2543,12 @@ d_expression (struct d_info *di)
args = op->u.s_extended_operator.args;
break;
case DEMANGLE_COMPONENT_CAST:
- args = 1;
+ if (d_peek_char (di) == 'v')
+ /* T() encoded as an operand of void. */
+ return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op,
+ cplus_demangle_type (di));
+ else
+ args = 1;
break;
}
@@ -2466,13 +2560,18 @@ d_expression (struct d_info *di)
case 2:
{
struct demangle_component *left;
+ struct demangle_component *right;
left = d_expression (di);
+ if (!strcmp (op->u.s_operator.op->code, "cl"))
+ right = d_exprlist (di);
+ else
+ right = d_expression (di);
+
return d_make_comp (di, DEMANGLE_COMPONENT_BINARY, op,
d_make_comp (di,
DEMANGLE_COMPONENT_BINARY_ARGS,
- left,
- d_expression (di)));
+ left, right));
}
case 3:
{
@@ -3520,7 +3619,9 @@ d_print_comp (struct d_print_info *dpi,
d_append_char (dpi, ')');
}
d_append_char (dpi, '(');
- d_print_comp (dpi, d_right (dc));
+ if (d_left (dc)->type != DEMANGLE_COMPONENT_CAST
+ || d_right (dc)->type != DEMANGLE_COMPONENT_BUILTIN_TYPE)
+ d_print_comp (dpi, d_right (dc));
d_append_char (dpi, ')');
return;
@@ -3531,6 +3632,15 @@ d_print_comp (struct d_print_info *dpi,
return;
}
+ if (!strcmp (d_left (dc)->u.s_operator.op->code, "cl"))
+ {
+ d_print_comp (dpi, d_left (d_right (dc)));
+ d_append_string (dpi, " (");
+ d_print_comp (dpi, d_right (d_right (dc)));
+ d_append_char (dpi, ')');
+ return;
+ }
+
/* We wrap an expression which uses the greater-than operator in
an extra layer of parens so that it does not get confused
with the '>' which ends the template parameters. */
@@ -3681,6 +3791,12 @@ d_print_comp (struct d_print_info *dpi,
d_append_char (dpi, dc->u.s_character.character);
return;
+ case DEMANGLE_COMPONENT_DECLTYPE:
+ d_append_string (dpi, "decltype (");
+ d_print_comp (dpi, d_left (dc));
+ d_append_char (dpi, ')');
+ return;
+
default:
d_print_error (dpi);
return;
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 2745dd3d13b..9358204d2bd 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3882,3 +3882,19 @@ myspace::foo()::localstruct::f(myspace::foo()::otherlocalstruct)
--format=gnu-v3
_ZGr32_java$Sutil$Siso4217$_properties
java resource java/util/iso4217.properties
+# decltype/param placeholder test
+--format=gnu-v3
+_Z3addIidEDTplsTT_sTT0_ES0_S1_
+decltype ((int) + (double)) add<int, double>(int, double)
+# decltype/T() test
+--format=gnu-v3
+_Z4add2IidEDTplcvT_vcvT0_vES0_S1_
+decltype (((int)()) + ((double)())) add2<int, double>(int, double)
+# decltype/fn call test
+--format=gnu-v3
+_Z4add3IidEDTclL_Z1gEsTT_sTT0_EES0_S1_
+decltype (g (int, double)) add3<int, double>(int, double)
+# Extended floating point types test
+--format=gnu-v3
+_Z1fDfDdDeDh
+f(decimal32, decimal64, decimal128, half)
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 2fb11970508..d8f8b949e2f 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,17 @@
+2008-09-09 Andreas Schwab <schwab@suse.de>
+
+ * acinclude.m4 (GLIBCXX_CHECK_STANDARD_LAYOUT): Fix compile check
+ not to redefine main.
+
+2008-09-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Check wcstoimax and
+ wcstoumax, define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1.
+ * include/tr1_impl/cinttypes: Use the latter.
+ * testsuite/tr1/8_c_compatibility/cinttypes/functions.cc: Likewise.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
2008-09-05 Peter Dimov <pdimov@mmltd.net>
* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter_ref_2.cc: New.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index b334657042d..4936cc8cc4f 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1520,7 +1520,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
fi
# Check for the existence of <inttypes.h> functions (NB: doesn't make
- # sense if the previous check fails, per C99, 7.8/1).
+ # sense if the glibcxx_cv_c99_stdint_tr1 check fails, per C99, 7.8/1).
ac_c99_inttypes_tr1=no;
if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
AC_MSG_CHECKING([for ISO C99 support to TR1 in <inttypes.h>])
@@ -1541,6 +1541,27 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
<tr1/cinttypes> in namespace std::tr1.])
fi
+ # Check for the existence of whcar_t <inttypes.h> functions (NB: doesn't
+ # make sense if the glibcxx_cv_c99_stdint_tr1 check fails, per C99, 7.8/1).
+ ac_c99_inttypes_wchar_t_tr1=no;
+ if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
+ AC_MSG_CHECKING([for wchar_t ISO C99 support to TR1 in <inttypes.h>])
+ AC_TRY_COMPILE([#include <inttypes.h>],
+ [intmax_t base;
+ const wchar_t* s;
+ wchar_t** endptr;
+ intmax_t ret = wcstoimax(s, endptr, base);
+ uintmax_t uret = wcstoumax(s, endptr, base);
+ ],[ac_c99_inttypes_wchar_t_tr1=yes],
+ [ac_c99_inttypes_wchar_t_tr1=no])
+ fi
+ AC_MSG_RESULT($ac_c99_inttypes_wchar_t_tr1)
+ if test x"$ac_c99_inttypes_wchar_t_tr1" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1, 1,
+ [Define if wchar_t C99 functions in <inttypes.h> should be
+ imported in <tr1/cinttypes> in namespace std::tr1.])
+ fi
+
# Check for the existence of the <stdbool.h> header.
AC_CHECK_HEADERS(stdbool.h)
@@ -1643,14 +1664,9 @@ AC_DEFUN([GLIBCXX_CHECK_STANDARD_LAYOUT], [
private:
b& operator=(const b&);
b(const b&);
- };
-
- int main()
- {
- b tst1 = { false };
- return 0;
- }],,
- [ac_standard_layout=yes], [ac_standard_layout=no])
+ };],
+ [b tst1 = { false };],
+ [ac_standard_layout=yes], [ac_standard_layout=no])
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index e27a1d754d8..b9e9040443f 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -760,6 +760,10 @@
<tr1/cinttypes> in namespace std::tr1. */
#undef _GLIBCXX_USE_C99_INTTYPES_TR1
+/* Define if wchar_t C99 functions in <inttypes.h> should be imported in
+ <tr1/cinttypes> in namespace std::tr1. */
+#undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
+
/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
in namespace std. */
#undef _GLIBCXX_USE_C99_MATH
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index a6223e7a40d..cf0c4247d43 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -14285,16 +14285,10 @@ struct b
b& operator=(const b&);
b(const b&);
};
-
- int main()
- {
- b tst1 = { false };
- return 0;
- }
int
main ()
{
-
+b tst1 = { false };
;
return 0;
}
@@ -20351,7 +20345,7 @@ _ACEOF
fi
# Check for the existence of <inttypes.h> functions (NB: doesn't make
- # sense if the previous check fails, per C99, 7.8/1).
+ # sense if the glibcxx_cv_c99_stdint_tr1 check fails, per C99, 7.8/1).
ac_c99_inttypes_tr1=no;
if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <inttypes.h>" >&5
@@ -20419,6 +20413,73 @@ _ACEOF
fi
+ # Check for the existence of whcar_t <inttypes.h> functions (NB: doesn't
+ # make sense if the glibcxx_cv_c99_stdint_tr1 check fails, per C99, 7.8/1).
+ ac_c99_inttypes_wchar_t_tr1=no;
+ if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
+ echo "$as_me:$LINENO: checking for wchar_t ISO C99 support to TR1 in <inttypes.h>" >&5
+echo $ECHO_N "checking for wchar_t ISO C99 support to TR1 in <inttypes.h>... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <inttypes.h>
+int
+main ()
+{
+intmax_t base;
+ const wchar_t* s;
+ wchar_t** endptr;
+ intmax_t ret = wcstoimax(s, endptr, base);
+ uintmax_t uret = wcstoumax(s, endptr, base);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_c99_inttypes_wchar_t_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_inttypes_wchar_t_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_c99_inttypes_wchar_t_tr1" >&5
+echo "${ECHO_T}$ac_c99_inttypes_wchar_t_tr1" >&6
+ if test x"$ac_c99_inttypes_wchar_t_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 1
+_ACEOF
+
+ fi
+
# Check for the existence of the <stdbool.h> header.
for ac_header in stdbool.h
diff --git a/libstdc++-v3/include/tr1_impl/cinttypes b/libstdc++-v3/include/tr1_impl/cinttypes
index 17625931100..2dfafa824f9 100644
--- a/libstdc++-v3/include/tr1_impl/cinttypes
+++ b/libstdc++-v3/include/tr1_impl/cinttypes
@@ -1,6 +1,6 @@
// TR1 cinttypes -*- C++ -*-
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
using ::strtoimax;
using ::strtoumax;
-#ifdef _GLIBCXX_USE_WCHAR_T
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
using ::wcstoimax;
using ::wcstoumax;
#endif
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc
index cd5a0378554..97bab0c260b 100644
--- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc
@@ -2,7 +2,7 @@
// 2006-01-30 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -31,7 +31,7 @@ void test01()
std::tr1::intmax_t i = 0, numer = 0, denom = 0, base = 0;
const char* s = 0;
char** endptr = 0;
-#ifdef _GLIBCXX_USE_WCHAR_T
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
const wchar_t* ws = 0;
wchar_t** wendptr = 0;
#endif
@@ -49,7 +49,7 @@ void test01()
ret = std::tr1::strtoimax(s, endptr, base);
uret = std::tr1::strtoumax(s, endptr, base);
-#ifdef _GLIBCXX_USE_WCHAR_T
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
ret = std::tr1::wcstoimax(ws, wendptr, base);
uret = std::tr1::wcstoumax(ws, wendptr, base);
#endif