summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.MELT3
-rwxr-xr-xconfig.guess18
-rw-r--r--gcc/ChangeLog315
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/s-osinte-linux.ads13
-rw-r--r--gcc/ada/s-osinte-posix.adb31
-rw-r--r--gcc/ada/s-osprim-posix.adb42
-rw-r--r--gcc/ada/s-taprop-linux.adb26
-rw-r--r--gcc/cgraph.c166
-rw-r--r--gcc/cgraph.h9
-rw-r--r--gcc/cgraphunit.c34
-rw-r--r--gcc/config.gcc3
-rw-r--r--gcc/config/alpha/osf.h34
-rw-r--r--gcc/config/arm/arm-cores.def1
-rw-r--r--gcc/config/arm/arm-tune.md2
-rw-r--r--gcc/config/arm/arm.c9
-rw-r--r--gcc/config/arm/arm.h29
-rw-r--r--gcc/config/arm/bpabi.h2
-rw-r--r--gcc/config/arm/neon-docgen.ml1
-rw-r--r--gcc/config/darwin.h4
-rw-r--r--gcc/config/i386/i386-builtin-types.awk279
-rw-r--r--gcc/config/i386/i386-builtin-types.def375
-rw-r--r--gcc/config/i386/i386.c2254
-rw-r--r--gcc/config/i386/sse.md16
-rw-r--r--gcc/config/i386/t-i38611
-rw-r--r--gcc/config/rs6000/rs6000.c77
-rw-r--r--gcc/config/spu/spu.c2
-rw-r--r--gcc/cp/ChangeLog109
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/call.c16
-rw-r--r--gcc/cp/class.c40
-rw-r--r--gcc/cp/cp-tree.h40
-rw-r--r--gcc/cp/decl.c57
-rw-r--r--gcc/cp/decl2.c14
-rw-r--r--gcc/cp/error.c52
-rw-r--r--gcc/cp/except.c8
-rw-r--r--gcc/cp/optimize.c56
-rw-r--r--gcc/cp/parser.c147
-rw-r--r--gcc/cp/pt.c25
-rw-r--r--gcc/cp/semantics.c27
-rw-r--r--gcc/cp/typeck.c179
-rw-r--r--gcc/cp/typeck2.c3
-rw-r--r--gcc/df-scan.c6
-rw-r--r--gcc/doc/arm-neon-intrinsics.texi12
-rw-r--r--gcc/doc/invoke.texi8
-rw-r--r--gcc/doc/plugins.texi19
-rw-r--r--gcc/dwarf2out.c33
-rw-r--r--gcc/fortran/ChangeLog33
-rw-r--r--gcc/fortran/gfortran.texi7
-rw-r--r--gcc/fortran/intrinsic.texi3
-rw-r--r--gcc/fortran/module.c2
-rw-r--r--gcc/fortran/trans-expr.c273
-rw-r--r--gcc/gengtype-lex.l3
-rw-r--r--gcc/gimple.c42
-rw-r--r--gcc/gimple.h18
-rw-r--r--gcc/graphite-scop-detection.c3
-rw-r--r--gcc/graphite-sese-to-poly.c7
-rw-r--r--gcc/gsstruct.def1
-rw-r--r--gcc/ipa-cp.c2
-rw-r--r--gcc/ipa-inline.c18
-rw-r--r--gcc/ipa-prop.c90
-rw-r--r--gcc/ipa-prop.h3
-rw-r--r--gcc/ipa-struct-reorg.c68
-rw-r--r--gcc/lto-cgraph.c26
-rw-r--r--gcc/lto-streamer-in.c6
-rw-r--r--gcc/lto-symtab.c54
-rw-r--r--gcc/lto/ChangeLog17
-rw-r--r--gcc/lto/lto-elf.c23
-rw-r--r--gcc/lto/lto.c44
-rw-r--r--gcc/lto/lto.h2
-rw-r--r--gcc/params.def18
-rw-r--r--gcc/passes.c18
-rw-r--r--gcc/plugin.c3
-rw-r--r--gcc/predict.c3
-rw-r--r--gcc/predict.h1
-rw-r--r--gcc/reload.c2
-rw-r--r--gcc/sese.c96
-rw-r--r--gcc/testsuite/ChangeLog175
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle26.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle27.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle28.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle29.C2
-rw-r--r--gcc/testsuite/g++.dg/conversion/ptrmem9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist28.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr38646.C12
-rw-r--r--gcc/testsuite/g++.dg/expr/cond2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/injected-ttp.C15
-rw-r--r--gcc/testsuite/g++.dg/inherit/error4.C2
-rw-r--r--gcc/testsuite/g++.dg/init/array26.C11
-rw-r--r--gcc/testsuite/g++.dg/init/array27.C11
-rw-r--r--gcc/testsuite/g++.dg/lookup/name-clash4.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081109-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081118_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081119-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081120-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081120-2_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081123_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081204-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081219_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20090302_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20090313_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-2_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-3_0.C2
-rw-r--r--gcc/testsuite/g++.dg/overload/pmf2.C20
-rw-r--r--gcc/testsuite/g++.dg/plugin/selfassign.c3
-rw-r--r--gcc/testsuite/g++.dg/tc1/dr147.C4
-rw-r--r--gcc/testsuite/g++.dg/template/crash90.C2
-rw-r--r--gcc/testsuite/g++.dg/template/ctor9.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/13478.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/rfg20.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/temporary5.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/typeck1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash28.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ctor2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp41.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.rfg/00321_01-.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.rfg/00324_02-.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr40204.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41181.c1
-rw-r--r--gcc/testsuite/gcc.dg/c99-stdint-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/c99-stdint-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/c99-stdint-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/c99-stdint-6.c9
-rw-r--r--gcc/testsuite/gcc.dg/plugin/ggcplug.c3
-rw-r--r--gcc/testsuite/gcc.dg/plugin/selfassign.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr42078.c22
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp47.c5
-rw-r--r--gcc/testsuite/gcc.dg/utf-array-short-wchar.c1
-rw-r--r--gcc/testsuite/gcc.dg/utf-array.c1
-rw-r--r--gcc/testsuite/gcc.dg/utf8-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c20
-rw-r--r--gcc/testsuite/gcc.misc-tests/linkage.exp2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c20
-rw-r--r--gcc/testsuite/gfortran.dg/direct_io_11.f9055
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_8.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_23.f9073
-rw-r--r--gcc/testsuite/lib/lto.exp2
-rw-r--r--gcc/toplev.c12
-rw-r--r--gcc/tree-optimize.c73
-rw-r--r--gcc/tree-ssa-address.c8
-rw-r--r--gcc/tree-ssa-dom.c9
-rw-r--r--gcc/tree-ssa-math-opts.c1
-rw-r--r--gcc/tree-ssa-pre.c6
-rw-r--r--gcc/tree-ssa.c16
-rw-r--r--gcc/tree-vect-loop.c46
-rw-r--r--gcc/tree.c9
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/directives.c4
-rw-r--r--libcpp/include/cpplib.h3
-rw-r--r--libcpp/macro.c3
-rw-r--r--libgcc/ChangeLog8
-rw-r--r--libgcc/config/t-slibgcc-darwin63
-rw-r--r--libgfortran/ChangeLog14
-rw-r--r--libgfortran/io/fbuf.h4
-rw-r--r--libgfortran/io/format.h5
-rw-r--r--libgfortran/io/transfer.c4
-rw-r--r--libgfortran/io/unix.h5
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/pex-unix.c3
-rw-r--r--libjava/ChangeLog10
-rw-r--r--libjava/include/posix-threads.h7
-rw-r--r--libjava/posix-threads.cc90
-rw-r--r--libstdc++-v3/ChangeLog115
-rw-r--r--libstdc++-v3/doc/xml/manual/profile_mode.xml6
-rw-r--r--libstdc++-v3/include/Makefile.am1
-rw-r--r--libstdc++-v3/include/Makefile.in1
-rw-r--r--libstdc++-v3/include/bits/functional_hash.h239
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h8
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h46
-rw-r--r--libstdc++-v3/include/debug/bitset2
-rw-r--r--libstdc++-v3/include/debug/deque1
-rw-r--r--libstdc++-v3/include/debug/list1
-rw-r--r--libstdc++-v3/include/debug/map.h1
-rw-r--r--libstdc++-v3/include/debug/multimap.h1
-rw-r--r--libstdc++-v3/include/debug/multiset.h1
-rw-r--r--libstdc++-v3/include/debug/set.h1
-rw-r--r--libstdc++-v3/include/debug/string1
-rw-r--r--libstdc++-v3/include/debug/unordered_map2
-rw-r--r--libstdc++-v3/include/debug/unordered_set2
-rw-r--r--libstdc++-v3/include/debug/vector1
-rw-r--r--libstdc++-v3/include/parallel/partition.h11
-rw-r--r--libstdc++-v3/include/profile/bitset2
-rw-r--r--libstdc++-v3/include/profile/deque2
-rw-r--r--libstdc++-v3/include/profile/impl/profiler.h264
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_container_size.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_hash_func.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_hashtable_size.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_map_to_unordered_map.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_node.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_state.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_trace.h10
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_vector_size.h4
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_vector_to_list.h4
-rw-r--r--libstdc++-v3/include/profile/list2
-rw-r--r--libstdc++-v3/include/profile/map.h2
-rw-r--r--libstdc++-v3/include/profile/multimap.h2
-rw-r--r--libstdc++-v3/include/profile/multiset.h2
-rw-r--r--libstdc++-v3/include/profile/set.h2
-rw-r--r--libstdc++-v3/include/profile/unordered_map11
-rw-r--r--libstdc++-v3/include/profile/vector2
-rw-r--r--libstdc++-v3/include/std/functional1
-rw-r--r--libstdc++-v3/include/tr1/functional_hash.h164
-rw-r--r--libstdc++-v3/include/tr1/shared_ptr.h16
-rw-r--r--libstdc++-v3/include/tr1_impl/functional_hash.h183
-rw-r--r--libstdc++-v3/libsupc++/cxxabi-forced.h8
-rw-r--r--libstdc++-v3/src/Makefile.am6
-rw-r--r--libstdc++-v3/src/Makefile.in34
-rw-r--r--libstdc++-v3/src/bitmap_allocator.cc2
-rw-r--r--libstdc++-v3/src/compatibility-c++0x.cc102
-rw-r--r--libstdc++-v3/src/hash.cc6
-rw-r--r--libstdc++-v3/src/hash_c++0x.cc46
-rw-r--r--libstdc++-v3/src/ios.cc4
-rw-r--r--libstdc++-v3/src/localename.cc2
-rw-r--r--libstdc++-v3/src/pool_allocator.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/misc/42019.cc56
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/modifiers/1.h21
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/modifiers/2.h23
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/modifiers/3.h15
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc4
-rw-r--r--libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc35
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_api.h11
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_hooks.h17
-rw-r--r--lto-plugin/ChangeLog5
-rw-r--r--lto-plugin/lto-plugin.c2
233 files changed, 4814 insertions, 3262 deletions
diff --git a/ChangeLog b/ChangeLog
index 302516fbc00..cbba7424c31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-20 Ben Elliston <bje@au.ibm.com>
+
+ * config.guess: Update from upstream sources.
+
2009-11-16 Alexandre Oliva <aoliva@redhat.com>
* Makefile.def: Restore host and target settings for gmp.
diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index 4bc03c1da5e..29f2573d1d5 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,3 +1,6 @@
+2009-11-21 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk rev 154407
+
2009-11-17 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 154243
diff --git a/config.guess b/config.guess
index 5290569263e..d53e309f4b9 100755
--- a/config.guess
+++ b/config.guess
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
-timestamp='2009-11-08'
+timestamp='2009-11-19'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -891,7 +891,15 @@ EOF
echo frv-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-gnu
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -918,11 +926,7 @@ EOF
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5de6fcde733..fee14941bc8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,318 @@
+2009-11-21 Ben Elliston <bje@au.ibm.com>
+
+ * gengtype-lex.l: Enable noinput flex option.
+ (YY_NO_INPUT): Remove define.
+
+2009-11-21 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree-ssa.c (find_released_ssa_name): Handle NULL wi.
+ (insert_debug_temp_for_var_def): Handle degenerate PHI nodes.
+ (insert_debug_temps_for_defs): Handle PHI nodes.
+ * tree-ssa-dom.c (degenerate_phi_result): Don't crash on released
+ SSA names.
+
+2009-11-21 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree-ssa-pre.c (remove_dead_inserted_code): Don't release_defs
+ after remove_phi_node.
+
+2009-11-21 Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/42078
+ * gimple.h (gimple_replace_lhs): New declaration.
+ * gimple.c (gimple_replace_lhs): New function.
+ * tree-ssa-math-opts.c (execute_cse_reciprocals): Call it before
+ modifying the call.
+
+2009-11-20 Sebastian Pop <sebastian.pop@amd.com>
+
+ * config/i386/sse.md (*xop_pmacsdql_mem): Don't call reg_mentioned_p.
+ (xop_mulv2div2di3_low): Same.
+ (*xop_pmacsdqh_mem): Same.
+
+2009-11-20 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386-builtin-types.awk: New file.
+ * config/i386/i386-builtin-types.def: New file.
+ * config/i386/t-i386: Use them to build i386-builtin-types.inc.
+ * config/i386/i386.c: Include it.
+ (ix86_builtin_type_tab, ix86_get_builtin_type): New.
+ (ix86_builtin_func_type_tab, ix86_get_builtin_func_type): New.
+ (struct builtin_isa): Remove GTY marker. Replace tree type with
+ ix86_builtin_func_type; add set_and_not_built_p.
+ (def_builtin): Change type parameter to tcode; use
+ ix86_get_builtin_func_type; update all callers. Accept zero mask
+ to mean the builtin is unconditionally available.
+ (ix86_add_new_builtins): Use set_and_not_built_p instead of type
+ being set to NULL.
+ (enum ix86_special_builtin_type, enum ix86_builtin_type): Remove.
+ Update some users to rationalized enumeration codes from new include.
+ (enum multi_arg_type): Remove. Replace all enumeration values
+ with defines to new ix86_builtin_func_type.
+ (ix86_init_mmx_sse_builtins): Don't build any types here. Defer
+ all type resolution to def_builtin.
+ (ix86_init_builtin_types): Split out from ...
+ (ix86_init_builtins): ... here. Use ix86_get_builtin_func_type.
+
+2009-11-20 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/41787
+ * config/rs6000/rs6000.c (struct machine_function): Revert
+ 2009-10-23 change to set VRSAVE to non-0 if we use VSX.
+ (rs6000_expand_to_rtl_hook): Ditto.
+ (rs6000_check_vector_mode): Ditto.
+ (compute_vrsave_mask): Ditto.
+
+2009-11-20 Paul Brook <paul@codesourcery.com>
+
+ * doc/invoke.texi: Document ARM -mcpu=cortex-a5.
+ * config/arm/arm-cores.def: Add cortex-a5.
+ * config/arm/bpabi.h (BE8_LINK_SPEC): Add mcpu=cortex-a5.
+ * config/arm/arm-tune.md: Regenerate.
+
+2009-11-20 Olga Golovanevsky <olga@il.ibm.com>
+
+ PR middle-end/39960
+ * ipa-struct-reorg.c (find_pos_in_stmt): New parameter.
+ (ref_pos): New field in structure.
+ (insert_new_var_in_stmt): New function.
+
+
+2009-11-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.gcc (alpha*-dec-osf[45]*): Set use_gcc_stdint.
+ * config/alpha/osf.h (SIG_ATOMIC_TYPE): Define.
+ (INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE): Define.
+ (UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE): Define.
+ (INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
+ (INT_LEAST64_TYPE): Define.
+ (UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE,
+ UINT_LEAST64_TYPE): Define.
+ (INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE,
+ INT_FAST64_TYPE): Define.
+ (UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
+ UINT_FAST64_TYPE): Define.
+ (INTPTR_TYPE, UINTPTR_TYPE): Define.
+
+2009-11-20 Julian Brown <julian@codesourcery.com>
+
+ * config/arm/arm.h (ASM_OUTPUT_REG_PUSH): Handle STATIC_CHAIN_REGNUM
+ specially for Thumb-1.
+ (ASM_OUTPUT_REG_POP): Likewise.
+
+2009-11-19 Jason Merrill <jason@redhat.com>
+
+ * dwarf2out.c (get_context_die): Take TYPE_MAIN_VARIANT.
+
+2009-11-19 Basile Starynkevitch <basile@starynkevitch.net>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * doc/plugins.texi (Plugin initialization): Added advices for
+ retrieving the version of GCC at plugin compilation and loading
+ times.
+
+2009-11-19 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.
+ (dump_active_plugins): output to file everything. Use
+ internationalized dump & FMT_FOR_PLUGIN_EVENT.
+
+2009-11-19 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (canonicalize_cond_expr_cond): Strip conversions
+ around truth-valued expressions.
+ * tree.c (free_lang_data): Untangle check for LTO frontend.
+
+2009-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ * tree.c (need_assembler_name_p): Use cgraph_get_node instead
+ of cgraph_node_for_decl.
+ * cgraph.h (cgraph_node_for_decl): Remove prototype.
+ * cgraph.c (cgraph_node_for_decl): Remove.
+ (cgraph_get_node): Just return NULL if !cgraph_hash.
+
+2009-11-19 Paul Brook <paul@codesourcery.com>
+
+ * config.gcc: Add new ARM --with-fpu options.
+ * doc/invoke.texi: Docuent ARM -mfpu=fpv4-sp-d16.
+ * config/arm/arm.c (all_fpus): Add fpv4-sp-d16.
+
+2009-11-18 Richard Guenther <rguenther@suse.de>
+
+ * gimple.h (union gimple_statement_d): Add gsmembase member.
+ (gimple_vuse_op): Use gsmembase for access.
+ (gimple_vdef_op): Likewise.
+ (gimple_vuse): Likewise.
+ (gimple_vdef): Likewise.
+ (gimple_vuse_ptr): Likewise.
+ (gimple_vdef_ptr): Likewise.
+ (gimple_set_vuse): Likewise.
+ (gimple_set_vdef): Likewise.
+ * gsstruct.def (GSS_WITH_MEM_OPS_BASE): Add.
+
+2009-11-18 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * doc/arm-neon-intrinsics.texi: Regenerated.
+
+2009-11-18 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/arm/neon-docgen.ml (analyze_shape_elt): Handle
+ Alternatives.
+
+2009-11-18 Paul Brook <paul@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/arm/arm.c (FL_ARCH7EM, FL_FOR_ARCH7EM): Define.
+ (arm_arch7em): New variable.
+ (all_architectures): Add armv7e-m.
+ (arm_override_options): Set arm_arch7em.
+ * config/arm/arm.h (TARGET_DSP_MULTIPLY, TARGET_INT_SIMD):
+ Include arm_arch7em.
+ (arm_arch7em): Declare.
+
+2009-11-18 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-in.c (input_gimple_stmt): Assert that we find
+ a valid field decl if checking is enabled.
+
+2009-11-18 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.h (struct ipa_param_call_note): New field lto_stmt_uid.
+ (lto_ipa_fixup_call_notes): Declare.
+ * ipa-prop.c (ipa_note_param_call): Store gimple uid.
+ (update_call_notes_after_inlining): Copy call stmt uid to the new
+ edge.
+ (ipa_write_param_call_note): New function.
+ (ipa_read_param_call_note): New function
+ (ipa_write_node_info): Write also param call notes. Removed a bogus
+ comment, reformatted to fit 80 columns.
+ (ipa_read_node_info): Read also param call notes. Removed a bogus
+ comment. Remove ipa_edge_args_vector growth.
+ (lto_ipa_fixup_call_notes): New function.
+ * ipa-cp.c (pass_ipa_cp): Add stmt_fixup hook.
+ * ipa-inline.c (cgraph_mark_inline_edge): Perform indirect
+ inlining regardless of flag_wpa.
+ (cgraph_decide_inlining_of_small_functions): Likewise.
+ (cgraph_decide_inlining): Likewise.
+ (inline_read_summary): Likewise.
+
+2009-11-18 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (compute_function_frequency): Export.
+ * predict.h (compute_function_frequency): Declare.
+ * tree-optimize.c (execute_fixup_cfg): Rescale frequencies.
+
+2009-11-18 Martin Jambor <mjambor@suse.cz>
+
+ * passes.c (ipa_write_summaries): Call renumber_gimple_stmt_uids
+ on all nodes we write summaries for.
+
+2009-11-18 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR middle-end/22201
+ * params.def (PARAM_INLINE_UNIT_GROWTH)
+ PARAM_IPCP_UNIT_GROWTH)
+ (PARAM_EARLY_INLINING_INSNS, PARAM_IRA_MAX_LOOPS_NUM)
+ (PARAM_IRA_MAX_CONFLICT_TABLE_SIZE)
+ (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP)
+ (PARAM_MIN_INSN_TO_PREFETCH_RATIO)
+ (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO)
+ PARAM_IPA_SRA_PTR_GROWTH_FACTOR): Uppercase the first letter of the
+ description string.
+
+2009-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (loc_list_from_tree): Don't call rtl_for_decl_location
+ unnecessarily.
+ (rtl_for_decl_location): Try harder to get a rtl for TREE_STATIC vars.
+
+ PR c++/3187
+ * cgraph.h (struct cgraph_node): Add same_body and same_body_alias
+ fields.
+ (cgraph_same_body_alias, cgraph_remove_same_body_alias): New
+ prototypes.
+ * cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks,
+ cgraph_materialize_all_clones): Handle same_body aliases.
+ * cgraph.c (cgraph_allocate_node): New function.
+ (cgraph_create_node): Use it.
+ (cgraph_node_for_decl, cgraph_node, cgraph_get_node,
+ cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases.
+ (cgraph_same_body_alias, cgraph_remove_same_body_alias): New
+ functions.
+ * lto-cgraph.c (lto_output_node): Stream out same_body aliases.
+ (input_node): Stream in same_body aliases.
+ * lto-symtab.c (lto_cgraph_replace_node): Clear node pointers
+ for same_body aliases.
+ (lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases.
+
+2009-11-18 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR other/39888
+ * config/darwin.h: Use the extension stub libraries to access
+ current libgcc_s features.
+
+2009-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41926
+ * tree-vect-loop.c (vect_loop_kill_debug_uses): New.
+ (vect_transform_loop): Call it.
+
+2009-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree-ssa.c (insert_debug_temp_for_var_def): Fix handling of
+ released SSA names.
+
+2009-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41888
+ PR debug/41886
+ * graphite-scop-detection.c (stmt_simple_for_scop_p): Debug stmts
+ are ok.
+ * graphite-sese-to-poly.c (graphite_stmt_p): Likewise.
+ (try_generate_gimple_bb): Skip debug stmts when finding data refs.
+ * sese.c (sese_build_liveouts_bb): Skip debug stmts.
+ (sese_bad_liveouts_use): New.
+ (sese_reset_debug_liveouts_bb): New.
+ (sese_build_liveouts): Use it.
+ (rename_variables_in_stmt): Reset debug stmts rather than creating
+ new vars for them.
+ (expand_scalar_variable_stmt): Likewise.
+
+2009-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * df-scan.c (df_ref_create): Don't mark BB as dirty on debug insns.
+ (df_ref_remove): Likewise.
+
+2009-11-17 Jan Hubicka <jh@suse.cz>
+
+ * ipa-struct-reorg.c (update_cgraph_with_malloc_call): Fix profile
+ info.
+
+2009-11-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * toplev.c (process_options): Remove dead code.
+ * doc/invoke.texi (-frename-registers): Mention -fpeel-loops.
+
+2009-11-17 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-symtab.c (lto_symtab_resolve_symbols): Always initialize the
+ nodes.
+
+2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR tree-optimization/41857
+ * tree-ssa-address.c (move_hint_to_base): Use void pointer to
+ TYPE's address space instead of pointer to TYPE.
+
+2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * reload.c (find_reloads_address): Fix typo.
+
+2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (get_pic_reg): Use LAST_ARG_REGNUM as PIC
+ registers in leaf functions if possible.
+
2009-11-17 Maxim Kuvyrkov <maxim@codesourcery.com>
* config/m68k/m68k-devices.def: Add MCF5441x family.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index dd4e4bf8461..ecb16ef0a6b 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20091117
+20091121
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 02f4d8cd0a0..86f2bcc3c22 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2009-11-21 Eric Botcazou <ebotcazou@adacore.com>
+ Laurent GUERBY <laurent@guerby.net>
+
+ * s-osinte-linux.ads (struct_timeval, To_Duration, To_Timeval,
+ gettimeofday): Delete.
+ * s-osinte-posix.adb (To_Duration, To_Timeval): Delete.
+ * s-osprim-posix.adb (struct_timezone, struct_timeval,
+ gettimeofday): Delete.
+ (Clock): Use cal.c timeval_to_duration.
+ * s-taprop-linux.adb (Monotonic_Clock): Likewise.
+
2009-11-12 Eric Botcazou <ebotcazou@adacore.com>
Laurent GUERBY <laurent@guerby.net>
diff --git a/gcc/ada/s-osinte-linux.ads b/gcc/ada/s-osinte-linux.ads
index 5d2fdccb69f..2a620c5504a 100644
--- a/gcc/ada/s-osinte-linux.ads
+++ b/gcc/ada/s-osinte-linux.ads
@@ -228,19 +228,6 @@ package System.OS_Interface is
function To_Timespec (D : Duration) return timespec;
pragma Inline (To_Timespec);
- type struct_timeval is private;
-
- function To_Duration (TV : struct_timeval) return Duration;
- pragma Inline (To_Duration);
-
- function To_Timeval (D : Duration) return struct_timeval;
- pragma Inline (To_Timeval);
-
- function gettimeofday
- (tv : access struct_timeval;
- tz : System.Address := System.Null_Address) return int;
- pragma Import (C, gettimeofday, "gettimeofday");
-
function sysconf (name : int) return long;
pragma Import (C, sysconf);
diff --git a/gcc/ada/s-osinte-posix.adb b/gcc/ada/s-osinte-posix.adb
index c6460c2d241..310454ad15c 100644
--- a/gcc/ada/s-osinte-posix.adb
+++ b/gcc/ada/s-osinte-posix.adb
@@ -74,11 +74,6 @@ package body System.OS_Interface is
return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9;
end To_Duration;
- function To_Duration (TV : struct_timeval) return Duration is
- begin
- return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6;
- end To_Duration;
-
------------------------
-- To_Target_Priority --
------------------------
@@ -114,30 +109,4 @@ package body System.OS_Interface is
tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
end To_Timespec;
- ----------------
- -- To_Timeval --
- ----------------
-
- function To_Timeval (D : Duration) return struct_timeval is
- S : time_t;
- F : Duration;
-
- begin
- S := time_t (Long_Long_Integer (D));
- F := D - Duration (S);
-
- -- If F has negative value 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
- struct_timeval'
- (tv_sec => S,
- tv_usec => time_t (Long_Long_Integer (F * 10#1#E6)));
- end To_Timeval;
-
end System.OS_Interface;
diff --git a/gcc/ada/s-osprim-posix.adb b/gcc/ada/s-osprim-posix.adb
index c02ad98380c..e03a132c8a3 100644
--- a/gcc/ada/s-osprim-posix.adb
+++ b/gcc/ada/s-osprim-posix.adb
@@ -38,26 +38,8 @@ package body System.OS_Primitives is
-- these declarations in System.OS_Interface and move these ones in
-- the spec.
- type struct_timezone is record
- tz_minuteswest : Integer;
- tz_dsttime : Integer;
- end record;
- pragma Convention (C, struct_timezone);
- type struct_timezone_ptr is access all struct_timezone;
-
type time_t is new Long_Integer;
- type struct_timeval is record
- tv_sec : time_t;
- tv_usec : Long_Integer;
- end record;
- pragma Convention (C, struct_timeval);
-
- function gettimeofday
- (tv : not null access struct_timeval;
- tz : struct_timezone_ptr) return Integer;
- pragma Import (C, gettimeofday, "gettimeofday");
-
type timespec is record
tv_sec : time_t;
tv_nsec : Long_Integer;
@@ -72,11 +54,26 @@ package body System.OS_Primitives is
-----------
function Clock return Duration is
- TV : aliased struct_timeval;
-
+ type timeval is array (1 .. 2) of Long_Integer;
+
+ procedure timeval_to_duration
+ (T : not null access timeval;
+ sec : not null access Long_Integer;
+ usec : not null access Long_Integer);
+ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration");
+
+ Micro : constant := 10**6;
+ sec : aliased Long_Integer;
+ usec : aliased Long_Integer;
+ TV : aliased timeval;
Result : Integer;
pragma Unreferenced (Result);
+ function gettimeofday
+ (Tv : access timeval;
+ Tz : System.Address := System.Null_Address) return Integer;
+ pragma Import (C, gettimeofday, "gettimeofday");
+
begin
-- The return codes for gettimeofday are as follows (from man pages):
-- EPERM settimeofday is called by someone other than the superuser
@@ -86,8 +83,9 @@ package body System.OS_Primitives is
-- None of these codes signal a potential clock skew, hence the return
-- value is never checked.
- Result := gettimeofday (TV'Access, null);
- return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6;
+ Result := gettimeofday (TV'Access, System.Null_Address);
+ timeval_to_duration (TV'Access, sec'Access, usec'Access);
+ return Duration (sec) + Duration (usec) / Micro;
end Clock;
---------------------
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb
index 46b10a3f1f5..0f0773cec5e 100644
--- a/gcc/ada/s-taprop-linux.adb
+++ b/gcc/ada/s-taprop-linux.adb
@@ -589,12 +589,32 @@ package body System.Task_Primitives.Operations is
---------------------
function Monotonic_Clock return Duration is
- TV : aliased struct_timeval;
- Result : Interfaces.C.int;
+ use Interfaces;
+
+ type timeval is array (1 .. 2) of C.long;
+
+ procedure timeval_to_duration
+ (T : not null access timeval;
+ sec : not null access C.long;
+ usec : not null access C.long);
+ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration");
+
+ Micro : constant := 10**6;
+ sec : aliased C.long;
+ usec : aliased C.long;
+ TV : aliased timeval;
+ Result : int;
+
+ function gettimeofday
+ (Tv : access timeval;
+ Tz : System.Address := System.Null_Address) return int;
+ pragma Import (C, gettimeofday, "gettimeofday");
+
begin
Result := gettimeofday (TV'Access, System.Null_Address);
pragma Assert (Result = 0);
- return To_Duration (TV);
+ timeval_to_duration (TV'Access, sec'Access, usec'Access);
+ return Duration (sec) + Duration (usec) / Micro;
end Monotonic_Clock;
-------------------
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 391882ed2c8..3e5b8466d8c 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -406,32 +406,6 @@ hash_node (const void *p)
}
-/* Return the cgraph node associated with function DECL. If none
- exists, return NULL. */
-
-struct cgraph_node *
-cgraph_node_for_decl (tree decl)
-{
- struct cgraph_node *node;
- void **slot;
-
- gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
-
- node = NULL;
- if (cgraph_hash)
- {
- struct cgraph_node key;
-
- key.decl = decl;
- slot = htab_find_slot (cgraph_hash, &key, NO_INSERT);
- if (slot && *slot)
- node = (struct cgraph_node *) *slot;
- }
-
- return node;
-}
-
-
/* Returns nonzero if P1 and P2 are equal. */
static int
@@ -442,10 +416,10 @@ eq_node (const void *p1, const void *p2)
return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
-/* Allocate new callgraph node and insert it into basic data structures. */
+/* Allocate new callgraph node. */
-static struct cgraph_node *
-cgraph_create_node (void)
+static inline struct cgraph_node *
+cgraph_allocate_node (void)
{
struct cgraph_node *node;
@@ -460,6 +434,16 @@ cgraph_create_node (void)
node->uid = cgraph_max_uid++;
}
+ return node;
+}
+
+/* Allocate new callgraph node and insert it into basic data structures. */
+
+static struct cgraph_node *
+cgraph_create_node (void)
+{
+ struct cgraph_node *node = cgraph_allocate_node ();
+
node->next = cgraph_nodes;
node->pid = -1;
node->order = cgraph_order++;
@@ -491,6 +475,8 @@ cgraph_node (tree decl)
if (*slot)
{
node = *slot;
+ if (node->same_body_alias)
+ node = node->same_body;
return node;
}
@@ -521,6 +507,52 @@ cgraph_node (tree decl)
return node;
}
+/* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful.
+ Same body aliases are output whenever the body of DECL is output,
+ and cgraph_node (ALIAS) transparently returns cgraph_node (DECL). */
+
+bool
+cgraph_same_body_alias (tree alias, tree decl)
+{
+ struct cgraph_node key, *alias_node, *decl_node, **slot;
+
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+ gcc_assert (TREE_CODE (alias) == FUNCTION_DECL);
+ gcc_assert (!assembler_name_hash);
+
+#ifndef ASM_OUTPUT_DEF
+ /* If aliases aren't supported by the assembler, fail. */
+ return false;
+#endif
+
+ /* Comdat same body aliases are only supported when comdat groups
+ are supported and the symbols are weak. */
+ if (DECL_ONE_ONLY (decl) && (!HAVE_COMDAT_GROUP || !DECL_WEAK (decl)))
+ return false;
+
+ decl_node = cgraph_node (decl);
+
+ key.decl = alias;
+
+ slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, &key, INSERT);
+
+ /* If the cgraph_node has been already created, fail. */
+ if (*slot)
+ return false;
+
+ alias_node = cgraph_allocate_node ();
+ alias_node->decl = alias;
+ alias_node->same_body_alias = 1;
+ alias_node->same_body = decl_node;
+ alias_node->previous = NULL;
+ if (decl_node->same_body)
+ decl_node->same_body->previous = alias_node;
+ alias_node->next = decl_node->same_body;
+ decl_node->same_body = alias_node;
+ *slot = alias_node;
+ return true;
+}
+
/* Returns the cgraph node assigned to DECL or NULL if no cgraph node
is assigned. */
@@ -532,7 +564,7 @@ cgraph_get_node (tree decl)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
if (!cgraph_hash)
- cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
+ return NULL;
key.decl = decl;
@@ -540,7 +572,11 @@ cgraph_get_node (tree decl)
NO_INSERT);
if (slot && *slot)
- node = *slot;
+ {
+ node = *slot;
+ if (node->same_body_alias)
+ node = node->same_body;
+ }
return node;
}
@@ -601,9 +637,23 @@ cgraph_node_for_asm (tree asmname)
it is __builtin_strlen and strlen, for instance. Do we need to
record them all? Original implementation marked just first one
so lets hope for the best. */
- if (*slot)
- continue;
- *slot = node;
+ if (!*slot)
+ *slot = node;
+ if (node->same_body)
+ {
+ struct cgraph_node *alias;
+
+ for (alias = node->same_body; alias; alias = alias->next)
+ {
+ hashval_t hash;
+ name = DECL_ASSEMBLER_NAME (alias->decl);
+ hash = decl_assembler_name_hash (name);
+ slot = htab_find_slot_with_hash (assembler_name_hash, name,
+ hash, INSERT);
+ if (!*slot)
+ *slot = alias;
+ }
+ }
}
}
@@ -612,7 +662,12 @@ cgraph_node_for_asm (tree asmname)
NO_INSERT);
if (slot)
- return (struct cgraph_node *) *slot;
+ {
+ node = (struct cgraph_node *) *slot;
+ if (node->same_body_alias)
+ node = node->same_body;
+ return node;
+ }
return NULL;
}
@@ -1146,6 +1201,44 @@ cgraph_release_function_body (struct cgraph_node *node)
DECL_INITIAL (node->decl) = error_mark_node;
}
+/* Remove same body alias node. */
+
+void
+cgraph_remove_same_body_alias (struct cgraph_node *node)
+{
+ void **slot;
+ int uid = node->uid;
+
+ gcc_assert (node->same_body_alias);
+ if (node->previous)
+ node->previous->next = node->next;
+ else
+ node->same_body->same_body = node->next;
+ if (node->next)
+ node->next->previous = node->previous;
+ node->next = NULL;
+ node->previous = NULL;
+ slot = htab_find_slot (cgraph_hash, node, NO_INSERT);
+ if (*slot == node)
+ htab_clear_slot (cgraph_hash, slot);
+ if (assembler_name_hash)
+ {
+ tree name = DECL_ASSEMBLER_NAME (node->decl);
+ slot = htab_find_slot_with_hash (assembler_name_hash, name,
+ decl_assembler_name_hash (name),
+ NO_INSERT);
+ if (slot && *slot == node)
+ htab_clear_slot (assembler_name_hash, slot);
+ }
+
+ /* Clear out the node to NULL all pointers and add the node to the free
+ list. */
+ memset (node, 0, sizeof(*node));
+ node->uid = uid;
+ NEXT_FREE_NODE (node) = free_nodes;
+ free_nodes = node;
+}
+
/* Remove the node from cgraph. */
void
@@ -1283,6 +1376,9 @@ cgraph_remove_node (struct cgraph_node *node)
node->clone_of->clones = node->clones;
}
+ while (node->same_body)
+ cgraph_remove_same_body_alias (node->same_body);
+
/* While all the clones are removed after being proceeded, the function
itself is kept in the cgraph even after it is compiled. Check whether
we are done with this body and reclaim it proactively if this is the case.
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 33eb821dd5d..e09a858bdac 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -184,6 +184,9 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node {
struct cgraph_node *prev_sibling_clone;
struct cgraph_node *clones;
struct cgraph_node *clone_of;
+ /* For normal nodes pointer to the list of alias nodes, in alias
+ nodes pointer to the normal node. */
+ struct cgraph_node *same_body;
/* For functions with many calls sites it holds map from call expression
to the edge to speed up cgraph_edge function. */
htab_t GTY((param_is (struct cgraph_edge))) call_site_hash;
@@ -241,6 +244,9 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node {
unsigned alias : 1;
/* Set for nodes that was constructed and finalized by frontend. */
unsigned finalized_by_frontend : 1;
+ /* Set for alias nodes, same_body points to the node they are alias of
+ and they are linked through the next/previous pointers. */
+ unsigned same_body_alias : 1;
};
typedef struct cgraph_node *cgraph_node_ptr;
@@ -416,8 +422,9 @@ struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
struct cgraph_node * cgraph_get_node (tree);
struct cgraph_node *cgraph_node (tree);
+bool cgraph_same_body_alias (tree, tree);
+void cgraph_remove_same_body_alias (struct cgraph_node *);
struct cgraph_node *cgraph_node_for_asm (tree);
-struct cgraph_node *cgraph_node_for_decl (tree);
struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple);
void cgraph_set_call_stmt (struct cgraph_edge *, gimple);
void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 2c232a53ad2..e934b3d8abc 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1040,7 +1040,7 @@ cgraph_analyze_functions (void)
static void
cgraph_emit_thunks (void)
{
- struct cgraph_node *n;
+ struct cgraph_node *n, *alias;
for (n = cgraph_nodes; n; n = n->next)
{
@@ -1053,7 +1053,12 @@ cgraph_emit_thunks (void)
cgraph_mark_functions_to_output in cgraph_optimize). */
if (n->reachable
&& !DECL_EXTERNAL (n->decl))
- lang_hooks.callgraph.emit_associated_thunks (n->decl);
+ {
+ lang_hooks.callgraph.emit_associated_thunks (n->decl);
+ for (alias = n->same_body; alias; alias = alias->next)
+ if (!DECL_EXTERNAL (alias->decl))
+ lang_hooks.callgraph.emit_associated_thunks (alias->decl);
+ }
}
}
@@ -1175,6 +1180,14 @@ cgraph_expand_function (struct cgraph_node *node)
/* Make sure that BE didn't give up on compiling. */
gcc_assert (TREE_ASM_WRITTEN (decl));
current_function_decl = NULL;
+ if (node->same_body)
+ {
+ struct cgraph_node *alias;
+ bool saved_alias = node->alias;
+ for (alias = node->same_body; alias; alias = alias->next)
+ assemble_alias (alias->decl, DECL_ASSEMBLER_NAME (decl));
+ node->alias = saved_alias;
+ }
gcc_assert (!cgraph_preserve_function_body_p (decl));
cgraph_release_function_body (node);
/* Eliminate all call edges. This is important so the GIMPLE_CALL no longer
@@ -1924,7 +1937,22 @@ cgraph_materialize_all_clones (void)
{
gimple new_stmt;
gimple_stmt_iterator gsi;
-
+
+ if (e->callee->same_body)
+ {
+ struct cgraph_node *alias;
+
+ for (alias = e->callee->same_body;
+ alias;
+ alias = alias->next)
+ if (decl == alias->decl)
+ break;
+ /* Don't update call from same body alias to the real
+ function. */
+ if (alias)
+ continue;
+ }
+
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "updating call of %s in %s:",
diff --git a/gcc/config.gcc b/gcc/config.gcc
index dc22e38de72..90aa7a7cbfb 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -651,6 +651,7 @@ alpha*-dec-osf[45]*)
tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-crtfm alpha/t-osf4"
tm_file="${tm_file} alpha/osf.h"
extra_headers=va_list.h
+ use_gcc_stdint=provide
case ${target} in
*-*-osf4*)
# Define TARGET_SUPPORT_ARCH except on 4.0a.
@@ -2825,7 +2826,7 @@ case "${target}" in
case "$with_fpu" in
"" \
- | fpa | fpe2 | fpe3 | maverick | vfp | vfp3 | vfpv3 | vfpv3-fp16 | vfpv3-d16 | vfpv3-d16-fp16 | vfpv3xd | vfpv3xd-fp16 | neon | neon-fp16 )
+ | fpa | fpe2 | fpe3 | maverick | vfp | vfp3 | vfpv3 | vfpv3-fp16 | vfpv3-d16 | vfpv3-d16-fp16 | vfpv3xd | vfpv3xd-fp16 | neon | neon-fp16 | vfpv4 | vfpv4-d16 | fpv4-sp-d16 | neon-vfpv4)
# OK
;;
*)
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 81c12aa14fc..a384cc870f3 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003,
- 2004, 2007 Free Software Foundation, Inc.
+ 2004, 2007, 2009 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
@@ -162,6 +162,38 @@ __enable_execute_stack (void *addr) \
#define SIZE_TYPE "long unsigned int"
#define PTRDIFF_TYPE "long int"
+#define SIG_ATOMIC_TYPE "int"
+
+#define INT8_TYPE "signed char"
+#define INT16_TYPE "short int"
+#define INT32_TYPE "int"
+#define INT64_TYPE "long int"
+#define UINT8_TYPE "unsigned char"
+#define UINT16_TYPE "short unsigned int"
+#define UINT32_TYPE "unsigned int"
+#define UINT64_TYPE "long unsigned int"
+
+#define INT_LEAST8_TYPE "signed char"
+#define INT_LEAST16_TYPE "short int"
+#define INT_LEAST32_TYPE "int"
+#define INT_LEAST64_TYPE "long int"
+#define UINT_LEAST8_TYPE "unsigned char"
+#define UINT_LEAST16_TYPE "short unsigned int"
+#define UINT_LEAST32_TYPE "unsigned int"
+#define UINT_LEAST64_TYPE "long unsigned int"
+
+#define INT_FAST8_TYPE "signed char"
+#define INT_FAST16_TYPE "int"
+#define INT_FAST32_TYPE "int"
+#define INT_FAST64_TYPE "long int"
+#define UINT_FAST8_TYPE "unsigned char"
+#define UINT_FAST16_TYPE "unsigned int"
+#define UINT_FAST32_TYPE "unsigned int"
+#define UINT_FAST64_TYPE "long unsigned int"
+
+#define INTPTR_TYPE "long int"
+#define UINTPTR_TYPE "long unsigned int"
+
/* The linker will stick __main into the .init section. */
#define HAS_INIT_SECTION
#define LD_INIT_SWITCH "-init"
diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
index 478ee978780..a1a6960f5fd 100644
--- a/gcc/config/arm/arm-cores.def
+++ b/gcc/config/arm/arm-cores.def
@@ -118,6 +118,7 @@ ARM_CORE("mpcorenovfp", mpcorenovfp, 6K, FL_LDSCHED, 9e)
ARM_CORE("mpcore", mpcore, 6K, FL_LDSCHED | FL_VFPV2, 9e)
ARM_CORE("arm1156t2-s", arm1156t2s, 6T2, FL_LDSCHED, 9e)
ARM_CORE("arm1156t2f-s", arm1156t2fs, 6T2, FL_LDSCHED | FL_VFPV2, 9e)
+ARM_CORE("cortex-a5", cortexa5, 7A, FL_LDSCHED, 9e)
ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, 9e)
ARM_CORE("cortex-a9", cortexa9, 7A, FL_LDSCHED, 9e)
ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, 9e)
diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
index cbd1b4b6885..7aef5f5fb78 100644
--- a/gcc/config/arm/arm-tune.md
+++ b/gcc/config/arm/arm-tune.md
@@ -1,5 +1,5 @@
;; -*- buffer-read-only: t -*-
;; Generated automatically by gentune.sh from arm-cores.def
(define_attr "tune"
- "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,cortexa8,cortexa9,cortexr4,cortexr4f,cortexm3,cortexm1,cortexm0"
+ "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,cortexa5,cortexa8,cortexa9,cortexr4,cortexr4f,cortexm3,cortexm1,cortexm0"
(const (symbol_ref "((enum attr_tune) arm_tune)")))
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 617e0d3980a..3a9474535ea 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -574,6 +574,8 @@ static int thumb_call_reg_needed;
#define FL_DIV (1 << 18) /* Hardware divide. */
#define FL_VFPV3 (1 << 19) /* Vector Floating Point V3. */
#define FL_NEON (1 << 20) /* Neon instructions. */
+#define FL_ARCH7EM (1 << 21) /* Instructions present in the ARMv7E-M
+ architecture. */
#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */
@@ -598,6 +600,7 @@ static int thumb_call_reg_needed;
#define FL_FOR_ARCH7A (FL_FOR_ARCH7 | FL_NOTM)
#define FL_FOR_ARCH7R (FL_FOR_ARCH7A | FL_DIV)
#define FL_FOR_ARCH7M (FL_FOR_ARCH7 | FL_DIV)
+#define FL_FOR_ARCH7EM (FL_FOR_ARCH7M | FL_ARCH7EM)
/* The bits in this mask specify which
instructions we are allowed to generate. */
@@ -634,6 +637,9 @@ int arm_arch6k = 0;
/* Nonzero if instructions not present in the 'M' profile can be used. */
int arm_arch_notm = 0;
+/* Nonzero if instructions present in ARMv7E-M can be used. */
+int arm_arch7em = 0;
+
/* Nonzero if this chip can benefit from load scheduling. */
int arm_ld_sched = 0;
@@ -772,6 +778,7 @@ static const struct processors all_architectures[] =
{"armv7-a", cortexa8, "7A", FL_CO_PROC | FL_FOR_ARCH7A, NULL},
{"armv7-r", cortexr4, "7R", FL_CO_PROC | FL_FOR_ARCH7R, NULL},
{"armv7-m", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
+ {"armv7e-m", cortexm3, "7EM", FL_CO_PROC | FL_FOR_ARCH7EM, NULL},
{"ep9312", ep9312, "4T", FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4, NULL},
{"iwmmxt", iwmmxt, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL},
{"iwmmxt2", iwmmxt2, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL},
@@ -825,6 +832,7 @@ static const struct arm_fpu_desc all_fpus[] =
{"neon-fp16", ARM_FP_MODEL_VFP, 3, VFP_REG_D32, true , true },
{"vfpv4", ARM_FP_MODEL_VFP, 4, VFP_REG_D32, false, true},
{"vfpv4-d16", ARM_FP_MODEL_VFP, 4, VFP_REG_D16, false, true},
+ {"fpv4-sp-d16", ARM_FP_MODEL_VFP, 4, VFP_REG_SINGLE, false, true},
{"neon-vfpv4", ARM_FP_MODEL_VFP, 4, VFP_REG_D32, true, true},
/* Compatibility aliases. */
{"vfp3", ARM_FP_MODEL_VFP, 3, VFP_REG_D32, false, false},
@@ -1543,6 +1551,7 @@ arm_override_options (void)
arm_arch6 = (insn_flags & FL_ARCH6) != 0;
arm_arch6k = (insn_flags & FL_ARCH6K) != 0;
arm_arch_notm = (insn_flags & FL_NOTM) != 0;
+ arm_arch7em = (insn_flags & FL_ARCH7EM) != 0;
arm_arch_thumb2 = (insn_flags & FL_THUMB2) != 0;
arm_arch_xscale = (insn_flags & FL_XSCALE) != 0;
arm_arch_cirrus = (insn_flags & FL_CIRRUS) != 0;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 65d6708b04b..98abdb1ff0b 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -252,10 +252,10 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
/* "DSP" multiply instructions, eg. SMULxy. */
#define TARGET_DSP_MULTIPLY \
- (TARGET_32BIT && arm_arch5e && arm_arch_notm)
+ (TARGET_32BIT && arm_arch5e && (arm_arch_notm || arm_arch7em))
/* Integer SIMD instructions, and extend-accumulate instructions. */
#define TARGET_INT_SIMD \
- (TARGET_32BIT && arm_arch6 && arm_arch_notm)
+ (TARGET_32BIT && arm_arch6 && (arm_arch_notm || arm_arch7em))
/* Should MOVW/MOVT be used in preference to a constant pool. */
#define TARGET_USE_MOVT (arm_arch_thumb2 && !optimize_size)
@@ -399,6 +399,9 @@ extern int arm_arch6;
/* Nonzero if instructions not present in the 'M' profile can be used. */
extern int arm_arch_notm;
+/* Nonzero if instructions present in ARMv7E-M can be used. */
+extern int arm_arch7em;
+
/* Nonzero if this chip can benefit from load scheduling. */
extern int arm_ld_sched;
@@ -2271,24 +2274,44 @@ extern int making_const_table;
#define ASM_APP_OFF (TARGET_THUMB1 ? "\t.code\t16\n" : \
TARGET_THUMB2 ? "\t.thumb\n" : "")
-/* Output a push or a pop instruction (only used when profiling). */
+/* Output a push or a pop instruction (only used when profiling).
+ We can't push STATIC_CHAIN_REGNUM (r12) directly with Thumb-1. We know
+ that ASM_OUTPUT_REG_PUSH will be matched with ASM_OUTPUT_REG_POP, and
+ that r7 isn't used by the function profiler, so we can use it as a
+ scratch reg. WARNING: This isn't safe in the general case! It may be
+ sensitive to future changes in final.c:profile_function. */
#define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
do \
{ \
if (TARGET_ARM) \
asm_fprintf (STREAM,"\tstmfd\t%r!,{%r}\n", \
STACK_POINTER_REGNUM, REGNO); \
+ else if (TARGET_THUMB1 \
+ && (REGNO) == STATIC_CHAIN_REGNUM) \
+ { \
+ asm_fprintf (STREAM, "\tpush\t{r7}\n"); \
+ asm_fprintf (STREAM, "\tmov\tr7, %r\n", REGNO);\
+ asm_fprintf (STREAM, "\tpush\t{r7}\n"); \
+ } \
else \
asm_fprintf (STREAM, "\tpush {%r}\n", REGNO); \
} while (0)
+/* See comment for ASM_OUTPUT_REG_PUSH concerning Thumb-1 issue. */
#define ASM_OUTPUT_REG_POP(STREAM, REGNO) \
do \
{ \
if (TARGET_ARM) \
asm_fprintf (STREAM, "\tldmfd\t%r!,{%r}\n", \
STACK_POINTER_REGNUM, REGNO); \
+ else if (TARGET_THUMB1 \
+ && (REGNO) == STATIC_CHAIN_REGNUM) \
+ { \
+ asm_fprintf (STREAM, "\tpop\t{r7}\n"); \
+ asm_fprintf (STREAM, "\tmov\t%r, r7\n", REGNO);\
+ asm_fprintf (STREAM, "\tpop\t{r7}\n"); \
+ } \
else \
asm_fprintf (STREAM, "\tpop {%r}\n", REGNO); \
} while (0)
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index ba206022b75..8ab934631d8 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -53,7 +53,7 @@
#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4:--fix-v4bx}"
-#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}"
+#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}"
/* Tell the assembler to build BPABI binaries. */
#undef SUBTARGET_EXTRA_ASM_SPEC
diff --git a/gcc/config/arm/neon-docgen.ml b/gcc/config/arm/neon-docgen.ml
index b4802fdd240..23e37b49809 100644
--- a/gcc/config/arm/neon-docgen.ml
+++ b/gcc/config/arm/neon-docgen.ml
@@ -214,6 +214,7 @@ let rec analyze_shape shape =
| Element_of_dreg -> (analyze_shape_elt reg_no Dreg) ^ "[@var{0}]"
| Element_of_qreg -> (analyze_shape_elt reg_no Qreg) ^ "[@var{0}]"
| All_elements_of_dreg -> (analyze_shape_elt reg_no Dreg) ^ "[]"
+ | Alternatives alts -> (analyze_shape_elt reg_no (List.hd alts))
in
match shape with
All (n, elt) -> commas (analyze_shape_elt 0) (n_things n elt) ""
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index f67144286df..4152f2402cb 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -393,9 +393,13 @@ extern GTY(()) int darwin_ms_struct;
shared-libgcc|fexceptions|fgnu-runtime: \
%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
+ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
+ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
-lgcc; \
:%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
+ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
+ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
-lgcc}"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path.
diff --git a/gcc/config/i386/i386-builtin-types.awk b/gcc/config/i386/i386-builtin-types.awk
new file mode 100644
index 00000000000..0c54458d516
--- /dev/null
+++ b/gcc/config/i386/i386-builtin-types.awk
@@ -0,0 +1,279 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This program 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 3, or (at your option) any
+# later version.
+#
+# This program 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 this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Generates compressed tables for types for i386 builtin functions.
+
+function do_error(string) {
+ print FILENAME ":" FNR ": " string > "/dev/stderr"
+ errors = 1
+}
+
+function check_type(string) {
+ if (!(string in type_hash))
+ do_error("undefined type code " string)
+}
+
+# We can significantly reduce the size of the read-only tables
+# by forcing the compiler to use a smaller implementation type
+# for the enumerations.
+function attribute_mode(count) {
+ # ??? Except that we get strange "comparison always false" warnings
+ # for comparisons between different elements of the enumeration.
+ # print "#ifdef __GNUC__"
+ # if (count < 256)
+ # print " __attribute__((__mode__(__QI__)))"
+ # else
+ # print " __attribute__((__mode__(__HI__)))"
+ # print "#endif"
+}
+
+BEGIN {
+ FS = "[() \t,]+"
+
+ prim_defs = 0
+ vect_defs = 0
+ ptr_defs = 0
+ cptr_defs = 0
+ func_defs = 0
+ func_args = 0
+ alias_defs = 0
+}
+
+# Skip blank lines or comments.
+/^[ \t]*(#|$)/ {
+ next
+}
+
+$1 == "DEF_PRIMITIVE_TYPE" {
+ if (NF == 4) {
+ type_hash[$2] = 1
+ prim_name[prim_defs] = $2
+ prim_base[prim_defs] = $3
+ prim_defs++
+ } else
+ do_error("DEF_PRIMITIVE_TYPE expected 2 arguments")
+ next
+}
+
+$1 == "DEF_VECTOR_TYPE" {
+ if (NF == 4) {
+ check_type($3)
+ type_hash[$2] = 1
+ vect_mode[vect_defs] = $2
+ vect_base[vect_defs] = $3
+ vect_defs++
+ } else
+ do_error("DEF_VECTOR_TYPE expected 2 arguments")
+ next
+}
+
+$1 == "DEF_POINTER_TYPE" {
+ if (NF == 4) {
+ check_type($3)
+ type_hash[$2] = 1
+ ptr_name[ptr_defs] = $2
+ ptr_base[ptr_defs] = $3
+ ptr_defs++
+ } else if (NF == 5) {
+ check_type($3)
+ if ($4 == "CONST") {
+ type_hash[$2] = 1
+ cptr_name[cptr_defs] = $2
+ cptr_base[cptr_defs] = $3
+ cptr_defs++
+ } else
+ do_error("invalid qualifier \"" $4 "\"")
+ }
+ else
+ do_error("DEF_POINTER_TYPE expected 2 or 3 arguments")
+ next
+}
+
+$1 == "DEF_FUNCTION_TYPE" {
+ func_start[func_defs] = func_args
+ for (i = 2; i < NF; ++i) {
+ check_type($i)
+ func_types[func_args++] = $i
+ }
+
+ if (NF < 3)
+ do_error("DEF_FUNCTION_TYPE expected at least 1 argument")
+ else if (NF == 3)
+ name = $2 "_FTYPE_VOID"
+ else {
+ name = $2 "_FTYPE"
+ for (i = 3; i < NF; ++i)
+ name = name "_" $i
+ }
+ func_hash[name] = 1
+ func_name[func_defs++] = name
+ next
+}
+
+$1 == "DEF_FUNCTION_TYPE_ALIAS" {
+ if (NF == 4) {
+ if ($2 in func_hash) {
+ alias_base[alias_defs] = $2
+ alias_name[alias_defs] = $2 "_" $3
+ alias_defs++
+ } else
+ do_error("undefined function code " $2)
+ } else
+ do_error("DEF_FUNCTION_TYPE_ALIAS expected 2 arguments")
+ next
+}
+
+{
+ do_error("unknown directive \"" $1 "\"");
+}
+
+END {
+ if (errors)
+ exit 1
+
+ print "/* This file is auto-generated by i386-builtin-types.awk. */\n"
+
+ # This first enumeration contains all of the non-function types.
+ print "enum ix86_builtin_type {"
+ for (i = 0; i < prim_defs; ++i)
+ print " IX86_BT_" prim_name[i] ","
+ print " IX86_BT_LAST_PRIM = IX86_BT_" prim_name[i-1] ","
+ for (i = 0; i < vect_defs; ++i)
+ print " IX86_BT_" vect_mode[i] ","
+ print " IX86_BT_LAST_VECT = IX86_BT_" vect_mode[i-1] ","
+ for (i = 0; i < ptr_defs; ++i)
+ print " IX86_BT_" ptr_name[i] ","
+ print " IX86_BT_LAST_PTR = IX86_BT_" ptr_name[i-1] ","
+ for (i = 0; i < cptr_defs; ++i)
+ print " IX86_BT_" cptr_name[i] ","
+ print " IX86_BT_LAST_CPTR = IX86_BT_" cptr_name[i-1] "\n}"
+ attribute_mode(prim_defs + vect_defs + ptr_defs + cptr_defs)
+ print ";\n\n"
+
+ # We can't tabularize the initialization of the primitives, since
+ # at least one of them is created via a local variable. That's ok,
+ # just create a nice big macro to do all the work.
+ print "#define DEFINE_BUILTIN_PRIMITIVE_TYPES \\"
+ for (i = 0; i < prim_defs; ++i) {
+ printf " ix86_builtin_type_tab[(int)IX86_BT_" prim_name[i] \
+ "] = " prim_base[i]
+ if (i < prim_defs - 1)
+ print ", \\"
+ }
+ print "\n\n"
+
+ # The vector types are defined via two tables defining the real
+ # machine mode and the builtin primitive type. We use two tables
+ # rather than a structure to avoid structure padding and save space.
+ print "static const enum machine_mode ix86_builtin_type_vect_mode[] = {"
+ for (i = 0; i < vect_defs; ++i) {
+ if (i == 0)
+ printf " "
+ else if (i % 6 == 0)
+ printf ",\n "
+ else
+ printf ", "
+ printf vect_mode[i] "mode"
+ }
+ print "\n};\n\n"
+
+ print "static const enum ix86_builtin_type " \
+ "ix86_builtin_type_vect_base[] = {"
+ for (i = 0; i < vect_defs; ++i) {
+ if (i == 0)
+ printf " "
+ else if (i % 4 == 0)
+ printf ",\n "
+ else
+ printf ", "
+ printf "IX86_BT_" vect_base[i]
+ }
+ print "\n};\n\n"
+
+ # The pointer types are defined via a single table defining the
+ # builtin primitive type. The const-ness of the pointer is taken
+ # from the enumeration value > IX86_BT_LAST_PTR.
+ print "static const enum ix86_builtin_type " \
+ "ix86_builtin_type_ptr_base[] = {"
+ for (i = 0; i < ptr_defs; ++i) {
+ if (i == 0)
+ printf " "
+ else if (i % 4 == 0)
+ printf "\n "
+ printf " IX86_BT_" ptr_base[i] ","
+ }
+ print "\n /* pointer-to-constant defs start here */"
+ for (i = 0; i < cptr_defs; ++i) {
+ if (i == 0)
+ printf " "
+ else if (i % 4 == 0)
+ printf ",\n "
+ else
+ printf ", "
+ printf "IX86_BT_" cptr_base[i]
+ }
+ print "\n};\n\n"
+
+ # This second enumeration contains all of the function types.
+ print "enum ix86_builtin_func_type {"
+ for (i = 0; i < func_defs; ++i)
+ print " " func_name[i] ","
+ print " IX86_BT_LAST_FUNC = " func_name[i-1] ","
+ for (i = 0; i < alias_defs; ++i)
+ print " " alias_name[i] ","
+ print " IX86_BT_LAST_ALIAS = " alias_name[i-1] "\n}"
+ attribute_mode(func_defs + alias_defs)
+ print ";\n\n"
+
+ # The function types are defined via two tables. The first contains
+ # ranges consiting of the function's return type, followed by all of
+ # the function argument types. The ranges for all of the builtin
+ # functions are smooshed together in the same array. The second array
+ # contains, for each builtin, the index of the function's return type
+ # within the first array.
+ print "static const enum ix86_builtin_type ix86_builtin_func_args[] = {"
+ for (i = 0; i < func_args; ++i) {
+ if (i == 0)
+ printf " "
+ else if (i % 4 == 0)
+ printf ",\n "
+ else
+ printf ", "
+ printf "IX86_BT_" func_types[i]
+ }
+ print "\n};\n\n"
+
+ print "static const unsigned short ix86_builtin_func_start[] = {"
+ for (i = 0; i < func_defs; ++i) {
+ if (i == 0)
+ printf " "
+ else if (i % 10 == 0)
+ printf "\n "
+ printf " " func_start[i] ","
+ }
+ print " " func_args "\n};\n\n"
+
+ print "static const enum ix86_builtin_func_type " \
+ "ix86_builtin_func_alias_base[] = {"
+ for (i = 0; i < alias_defs; ++i) {
+ if (i == 0)
+ printf " "
+ else
+ printf ",\n "
+ printf alias_base[i]
+ }
+ print "\n};"
+}
diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def
new file mode 100644
index 00000000000..3f0b20b4de2
--- /dev/null
+++ b/gcc/config/i386/i386-builtin-types.def
@@ -0,0 +1,375 @@
+# This file provides a declarative way of describing the types that
+# are used when declaring ix86 builtin functions. It is processed
+# with i386-builtin-type.awk to produce C code.
+#
+# DEF_PRIMITIVE_TYPE (ENUM, TYPE)
+#
+# The ENUM is an identifier indicating which type is being defined.
+# TYPE is a variable that represents the type.
+# ??? Note that the awk program expects a single token for TYPE.
+# At present, that's all that's required; revisit if it turns out
+# that we need more than that.
+#
+# DEF_VECTOR_TYPE (ENUM, TYPE)
+#
+# This describes a vector type. ENUM doubles as both the identifier
+# to define in the enumeration as well as the mode of the vector; TYPE is
+# the enumeral for the inner type which should of course name a type of
+# the proper inner mode.
+#
+# DEF_POINTER_TYPE (ENUM, TYPE [, CONST])
+#
+# This describes a pointer type. ENUM is an identifier as above;
+# TYPE is the enumeral for the type pointed to. An optional third
+# argument is the keyword CONST, which defines this to be a pointer to
+# a constant type.
+#
+# DEF_FUNCTION_TYPE (RETURN, ARGN*)
+#
+# This describes a function type. The return type and the arguments
+# are the enumerals defined above. The enumeration name for the
+# function is formed by RETURN ## _FTYPE_ ## ARG1 ## _ ## ARG2 ...
+#
+# DEF_FUNCTION_TYPE_ALIAS (ENUM, SUFFIX)
+#
+# This defines an enumeration ENUM ## _ ## SUFFIX and arranges for
+# the function type to be copied from ENUM. This is used to control
+# how the expanders treat the function.
+#
+
+DEF_PRIMITIVE_TYPE (VOID, void_type_node)
+DEF_PRIMITIVE_TYPE (CHAR, char_type_node)
+DEF_PRIMITIVE_TYPE (UCHAR, unsigned_char_type_node)
+DEF_PRIMITIVE_TYPE (QI, intQI_type_node)
+DEF_PRIMITIVE_TYPE (HI, intHI_type_node)
+DEF_PRIMITIVE_TYPE (SI, intSI_type_node)
+DEF_PRIMITIVE_TYPE (DI, long_long_integer_type_node)
+DEF_PRIMITIVE_TYPE (USHORT, short_unsigned_type_node)
+DEF_PRIMITIVE_TYPE (INT, integer_type_node)
+DEF_PRIMITIVE_TYPE (UINT, unsigned_type_node)
+DEF_PRIMITIVE_TYPE (UNSIGNED, unsigned_type_node)
+DEF_PRIMITIVE_TYPE (LONGLONG, long_long_integer_type_node)
+DEF_PRIMITIVE_TYPE (ULONGLONG, long_long_unsigned_type_node)
+DEF_PRIMITIVE_TYPE (UINT8, unsigned_char_type_node)
+DEF_PRIMITIVE_TYPE (UINT16, short_unsigned_type_node)
+DEF_PRIMITIVE_TYPE (INT64, long_long_integer_type_node)
+DEF_PRIMITIVE_TYPE (UINT64, long_long_unsigned_type_node)
+DEF_PRIMITIVE_TYPE (FLOAT, float_type_node)
+DEF_PRIMITIVE_TYPE (DOUBLE, double_type_node)
+DEF_PRIMITIVE_TYPE (FLOAT80, float80_type_node)
+DEF_PRIMITIVE_TYPE (FLOAT128, float128_type_node)
+
+DEF_VECTOR_TYPE (V16HI, HI)
+DEF_VECTOR_TYPE (V16QI, CHAR)
+DEF_VECTOR_TYPE (V1DI, DI)
+DEF_VECTOR_TYPE (V2DF, DOUBLE)
+DEF_VECTOR_TYPE (V2DI, DI)
+DEF_VECTOR_TYPE (V2SF, FLOAT)
+DEF_VECTOR_TYPE (V2SI, SI)
+DEF_VECTOR_TYPE (V32QI, CHAR)
+DEF_VECTOR_TYPE (V4DF, DOUBLE)
+DEF_VECTOR_TYPE (V4DI, DI)
+DEF_VECTOR_TYPE (V4HI, HI)
+DEF_VECTOR_TYPE (V4SF, FLOAT)
+DEF_VECTOR_TYPE (V4SI, SI)
+DEF_VECTOR_TYPE (V8HI, HI)
+DEF_VECTOR_TYPE (V8QI, CHAR)
+DEF_VECTOR_TYPE (V8SF, FLOAT)
+DEF_VECTOR_TYPE (V8SI, SI)
+
+DEF_POINTER_TYPE (PCCHAR, CHAR, CONST)
+DEF_POINTER_TYPE (PCDOUBLE, DOUBLE, CONST)
+DEF_POINTER_TYPE (PCFLOAT, FLOAT, CONST)
+DEF_POINTER_TYPE (PCHAR, CHAR)
+DEF_POINTER_TYPE (PCVOID, VOID, CONST)
+DEF_POINTER_TYPE (PDOUBLE, DOUBLE)
+DEF_POINTER_TYPE (PFLOAT, FLOAT)
+DEF_POINTER_TYPE (PINT, INT)
+DEF_POINTER_TYPE (PULONGLONG, ULONGLONG)
+DEF_POINTER_TYPE (PUNSIGNED, UNSIGNED)
+
+DEF_POINTER_TYPE (PV2DF, V2DF)
+DEF_POINTER_TYPE (PV2DI, V2DI)
+DEF_POINTER_TYPE (PV2SF, V2SF)
+DEF_POINTER_TYPE (PV4DF, V4DF)
+DEF_POINTER_TYPE (PV4DI, V4DI)
+DEF_POINTER_TYPE (PV4SF, V4SF)
+DEF_POINTER_TYPE (PV8SF, V8SF)
+
+DEF_POINTER_TYPE (PCV2DF, V2DF, CONST)
+DEF_POINTER_TYPE (PCV2SF, V2SF, CONST)
+DEF_POINTER_TYPE (PCV4DF, V4DF, CONST)
+DEF_POINTER_TYPE (PCV4SF, V4SF, CONST)
+DEF_POINTER_TYPE (PCV8SF, V8SF, CONST)
+
+DEF_FUNCTION_TYPE (FLOAT128)
+DEF_FUNCTION_TYPE (UINT64)
+DEF_FUNCTION_TYPE (UNSIGNED)
+DEF_FUNCTION_TYPE (VOID)
+
+DEF_FUNCTION_TYPE (FLOAT, FLOAT)
+DEF_FUNCTION_TYPE (FLOAT128, FLOAT128)
+DEF_FUNCTION_TYPE (INT, INT)
+DEF_FUNCTION_TYPE (INT, V16QI)
+DEF_FUNCTION_TYPE (INT, V2DF)
+DEF_FUNCTION_TYPE (INT, V4DF)
+DEF_FUNCTION_TYPE (INT, V4SF)
+DEF_FUNCTION_TYPE (INT, V8QI)
+DEF_FUNCTION_TYPE (INT, V8SF)
+DEF_FUNCTION_TYPE (INT64, INT64)
+DEF_FUNCTION_TYPE (INT64, V2DF)
+DEF_FUNCTION_TYPE (INT64, V4SF)
+DEF_FUNCTION_TYPE (UINT64, INT)
+DEF_FUNCTION_TYPE (UINT64, PUNSIGNED)
+DEF_FUNCTION_TYPE (V16QI, PCCHAR)
+DEF_FUNCTION_TYPE (V16QI, V16QI)
+DEF_FUNCTION_TYPE (V2DF, PCDOUBLE)
+DEF_FUNCTION_TYPE (V2DF, V2DF)
+DEF_FUNCTION_TYPE (V2DF, V2SI)
+DEF_FUNCTION_TYPE (V2DF, V4DF)
+DEF_FUNCTION_TYPE (V2DF, V4SF)
+DEF_FUNCTION_TYPE (V2DF, V4SI)
+DEF_FUNCTION_TYPE (V2DI, PV2DI)
+DEF_FUNCTION_TYPE (V2DI, V16QI)
+DEF_FUNCTION_TYPE (V2DI, V2DI)
+DEF_FUNCTION_TYPE (V2DI, V4SI)
+DEF_FUNCTION_TYPE (V2DI, V8HI)
+DEF_FUNCTION_TYPE (V2SF, V2SF)
+DEF_FUNCTION_TYPE (V2SF, V2SI)
+DEF_FUNCTION_TYPE (V2SI, V2DF)
+DEF_FUNCTION_TYPE (V2SI, V2SF)
+DEF_FUNCTION_TYPE (V2SI, V2SI)
+DEF_FUNCTION_TYPE (V2SI, V4SF)
+DEF_FUNCTION_TYPE (V32QI, PCCHAR)
+DEF_FUNCTION_TYPE (V4DF, PCDOUBLE)
+DEF_FUNCTION_TYPE (V4DF, PCV2DF)
+DEF_FUNCTION_TYPE (V4DF, V2DF)
+DEF_FUNCTION_TYPE (V4DF, V4DF)
+DEF_FUNCTION_TYPE (V4DF, V4SF)
+DEF_FUNCTION_TYPE (V4DF, V4SI)
+DEF_FUNCTION_TYPE (V4HI, V4HI)
+DEF_FUNCTION_TYPE (V4SF, PCFLOAT)
+DEF_FUNCTION_TYPE (V4SF, V2DF)
+DEF_FUNCTION_TYPE (V4SF, V4DF)
+DEF_FUNCTION_TYPE (V4SF, V4SF)
+DEF_FUNCTION_TYPE (V4SF, V4SI)
+DEF_FUNCTION_TYPE (V4SF, V8SF)
+DEF_FUNCTION_TYPE (V4SI, V16QI)
+DEF_FUNCTION_TYPE (V4SI, V2DF)
+DEF_FUNCTION_TYPE (V4SI, V4DF)
+DEF_FUNCTION_TYPE (V4SI, V4SF)
+DEF_FUNCTION_TYPE (V4SI, V4SI)
+DEF_FUNCTION_TYPE (V4SI, V8HI)
+DEF_FUNCTION_TYPE (V4SI, V8SI)
+DEF_FUNCTION_TYPE (V8HI, V16QI)
+DEF_FUNCTION_TYPE (V8HI, V8HI)
+DEF_FUNCTION_TYPE (V8QI, V8QI)
+DEF_FUNCTION_TYPE (V8SF, PCFLOAT)
+DEF_FUNCTION_TYPE (V8SF, PCV4SF)
+DEF_FUNCTION_TYPE (V8SF, V4SF)
+DEF_FUNCTION_TYPE (V8SF, V8SF)
+DEF_FUNCTION_TYPE (V8SF, V8SI)
+DEF_FUNCTION_TYPE (V8SI, V4SI)
+DEF_FUNCTION_TYPE (V8SI, V8SF)
+DEF_FUNCTION_TYPE (VOID, PCVOID)
+DEF_FUNCTION_TYPE (VOID, UNSIGNED)
+
+DEF_FUNCTION_TYPE (DI, V2DI, INT)
+DEF_FUNCTION_TYPE (DOUBLE, V2DF, INT)
+DEF_FUNCTION_TYPE (FLOAT, V4SF, INT)
+DEF_FUNCTION_TYPE (FLOAT128, FLOAT128, FLOAT128)
+DEF_FUNCTION_TYPE (HI, V4HI, INT)
+DEF_FUNCTION_TYPE (HI, V8HI, INT)
+DEF_FUNCTION_TYPE (INT, V2DF, V2DF)
+DEF_FUNCTION_TYPE (INT, V2DI, V2DI)
+DEF_FUNCTION_TYPE (INT, V4DF, V4DF)
+DEF_FUNCTION_TYPE (INT, V4DI, V4DI)
+DEF_FUNCTION_TYPE (INT, V4SF, V4SF)
+DEF_FUNCTION_TYPE (INT, V8SF, V8SF)
+DEF_FUNCTION_TYPE (QI, V16QI, INT)
+DEF_FUNCTION_TYPE (QI, V8QI, INT)
+DEF_FUNCTION_TYPE (SI, V2SI, INT)
+DEF_FUNCTION_TYPE (SI, V4SI, INT)
+DEF_FUNCTION_TYPE (UINT, UINT, UCHAR)
+DEF_FUNCTION_TYPE (UINT, UINT, UINT)
+DEF_FUNCTION_TYPE (UINT, UINT, USHORT)
+DEF_FUNCTION_TYPE (UINT16, UINT16, INT)
+DEF_FUNCTION_TYPE (UINT64, UINT64, UINT64)
+DEF_FUNCTION_TYPE (UINT8, UINT8, INT)
+DEF_FUNCTION_TYPE (V16QI, V16QI, SI)
+DEF_FUNCTION_TYPE (V16QI, V16QI, V16QI)
+DEF_FUNCTION_TYPE (V16QI, V8HI, V8HI)
+DEF_FUNCTION_TYPE (V1DI, V1DI, SI)
+DEF_FUNCTION_TYPE (V1DI, V1DI, V1DI)
+DEF_FUNCTION_TYPE (V1DI, V2SI, V2SI)
+DEF_FUNCTION_TYPE (V1DI, V8QI, V8QI)
+DEF_FUNCTION_TYPE (V2DF, PCV2DF, V2DF)
+DEF_FUNCTION_TYPE (V2DF, V2DF, DI)
+DEF_FUNCTION_TYPE (V2DF, V2DF, INT)
+DEF_FUNCTION_TYPE (V2DF, V2DF, PCDOUBLE)
+DEF_FUNCTION_TYPE (V2DF, V2DF, SI)
+DEF_FUNCTION_TYPE (V2DF, V2DF, V2DF)
+DEF_FUNCTION_TYPE (V2DF, V2DF, V2DI)
+DEF_FUNCTION_TYPE (V2DF, V2DF, V4SF)
+DEF_FUNCTION_TYPE (V2DF, V4DF, INT)
+DEF_FUNCTION_TYPE (V2DI, V16QI, V16QI)
+DEF_FUNCTION_TYPE (V2DI, V2DF, V2DF)
+DEF_FUNCTION_TYPE (V2DI, V2DI, INT)
+DEF_FUNCTION_TYPE (V2DI, V2DI, SI)
+DEF_FUNCTION_TYPE (V2DI, V2DI, V16QI)
+DEF_FUNCTION_TYPE (V2DI, V2DI, V2DI)
+DEF_FUNCTION_TYPE (V2DI, V4SI, V4SI)
+DEF_FUNCTION_TYPE (V2SF, V2SF, V2SF)
+DEF_FUNCTION_TYPE (V2SI, INT, INT)
+DEF_FUNCTION_TYPE (V2SI, V2SF, V2SF)
+DEF_FUNCTION_TYPE (V2SI, V2SI, SI)
+DEF_FUNCTION_TYPE (V2SI, V2SI, V2SI)
+DEF_FUNCTION_TYPE (V2SI, V4HI, V4HI)
+DEF_FUNCTION_TYPE (V4DF, PCV4DF, V4DF)
+DEF_FUNCTION_TYPE (V4DF, V4DF, INT)
+DEF_FUNCTION_TYPE (V4DF, V4DF, V4DF)
+DEF_FUNCTION_TYPE (V4DF, V4DF, V4DI)
+DEF_FUNCTION_TYPE (V4HI, V2SI, V2SI)
+DEF_FUNCTION_TYPE (V4HI, V4HI, INT)
+DEF_FUNCTION_TYPE (V4HI, V4HI, SI)
+DEF_FUNCTION_TYPE (V4HI, V4HI, V4HI)
+DEF_FUNCTION_TYPE (V4HI, V8QI, V8QI)
+DEF_FUNCTION_TYPE (V4SF, PCV4SF, V4SF)
+DEF_FUNCTION_TYPE (V4SF, V4SF, DI)
+DEF_FUNCTION_TYPE (V4SF, V4SF, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, PCV2SF)
+DEF_FUNCTION_TYPE (V4SF, V4SF, SI)
+DEF_FUNCTION_TYPE (V4SF, V4SF, V2DF)
+DEF_FUNCTION_TYPE (V4SF, V4SF, V2SI)
+DEF_FUNCTION_TYPE (V4SF, V4SF, V4SF)
+DEF_FUNCTION_TYPE (V4SF, V4SF, V4SI)
+DEF_FUNCTION_TYPE (V4SF, V8SF, INT)
+DEF_FUNCTION_TYPE (V4SI, V2DF, V2DF)
+DEF_FUNCTION_TYPE (V4SI, V4SF, V4SF)
+DEF_FUNCTION_TYPE (V4SI, V4SI, INT)
+DEF_FUNCTION_TYPE (V4SI, V4SI, SI)
+DEF_FUNCTION_TYPE (V4SI, V4SI, V4SI)
+DEF_FUNCTION_TYPE (V4SI, V8HI, V8HI)
+DEF_FUNCTION_TYPE (V4SI, V8SI, INT)
+DEF_FUNCTION_TYPE (V8HI, V16QI, V16QI)
+DEF_FUNCTION_TYPE (V8HI, V4SI, V4SI)
+DEF_FUNCTION_TYPE (V8HI, V8HI, INT)
+DEF_FUNCTION_TYPE (V8HI, V8HI, SI)
+DEF_FUNCTION_TYPE (V8HI, V8HI, V8HI)
+DEF_FUNCTION_TYPE (V8QI, V4HI, V4HI)
+DEF_FUNCTION_TYPE (V8QI, V8QI, V8QI)
+DEF_FUNCTION_TYPE (V8SF, PCV8SF, V8SF)
+DEF_FUNCTION_TYPE (V8SF, V8SF, INT)
+DEF_FUNCTION_TYPE (V8SF, V8SF, V8SF)
+DEF_FUNCTION_TYPE (V8SF, V8SF, V8SI)
+DEF_FUNCTION_TYPE (VOID, PCHAR, V16QI)
+DEF_FUNCTION_TYPE (VOID, PCHAR, V32QI)
+DEF_FUNCTION_TYPE (VOID, PDOUBLE, V2DF)
+DEF_FUNCTION_TYPE (VOID, PDOUBLE, V4DF)
+DEF_FUNCTION_TYPE (VOID, PFLOAT, V4SF)
+DEF_FUNCTION_TYPE (VOID, PFLOAT, V8SF)
+DEF_FUNCTION_TYPE (VOID, PINT, INT)
+DEF_FUNCTION_TYPE (VOID, PULONGLONG, ULONGLONG)
+DEF_FUNCTION_TYPE (VOID, PV2DI, V2DI)
+DEF_FUNCTION_TYPE (VOID, PV2SF, V4SF)
+DEF_FUNCTION_TYPE (VOID, PV4DI, V4DI)
+DEF_FUNCTION_TYPE (VOID, UNSIGNED, UNSIGNED)
+
+DEF_FUNCTION_TYPE (INT, V16QI, V16QI, INT)
+DEF_FUNCTION_TYPE (UCHAR, UINT, UINT, UINT)
+DEF_FUNCTION_TYPE (UCHAR, UINT64, UINT, UINT)
+DEF_FUNCTION_TYPE (UCHAR, USHORT, UINT, USHORT)
+DEF_FUNCTION_TYPE (V16HI, V16HI, V16HI, V16HI)
+DEF_FUNCTION_TYPE (V16QI, V16QI, QI, INT)
+DEF_FUNCTION_TYPE (V16QI, V16QI, V16QI, INT)
+DEF_FUNCTION_TYPE (V16QI, V16QI, V16QI, V16QI)
+DEF_FUNCTION_TYPE (V1DI, V1DI, V1DI, INT)
+DEF_FUNCTION_TYPE (V2DF, V2DF, V2DF, INT)
+DEF_FUNCTION_TYPE (V2DF, V2DF, V2DF, V2DF)
+DEF_FUNCTION_TYPE (V2DI, V2DI, DI, INT)
+DEF_FUNCTION_TYPE (V2DI, V2DI, UINT, UINT)
+DEF_FUNCTION_TYPE (V2DI, V2DI, V2DI, INT)
+DEF_FUNCTION_TYPE (V2DI, V2DI, V2DI, V2DI)
+DEF_FUNCTION_TYPE (V32QI, V32QI, V32QI, V32QI)
+DEF_FUNCTION_TYPE (V4DF, V4DF, V2DF, INT)
+DEF_FUNCTION_TYPE (V4DF, V4DF, V4DF, INT)
+DEF_FUNCTION_TYPE (V4DF, V4DF, V4DF, V4DF)
+DEF_FUNCTION_TYPE (V4DI, V4DI, V4DI, V4DI)
+DEF_FUNCTION_TYPE (V4HI, V4HI, HI, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, FLOAT, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, V4SF, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, V4SF, V4SF)
+DEF_FUNCTION_TYPE (V4SI, V4SI, SI, INT)
+DEF_FUNCTION_TYPE (V4SI, V4SI, V4SI, INT)
+DEF_FUNCTION_TYPE (V4SI, V4SI, V4SI, V2DI)
+DEF_FUNCTION_TYPE (V4SI, V4SI, V4SI, V4SI)
+DEF_FUNCTION_TYPE (V8HI, V8HI, HI, INT)
+DEF_FUNCTION_TYPE (V8HI, V8HI, V8HI, INT)
+DEF_FUNCTION_TYPE (V8HI, V8HI, V8HI, V4SI)
+DEF_FUNCTION_TYPE (V8HI, V8HI, V8HI, V8HI)
+DEF_FUNCTION_TYPE (V8SF, V8SF, V4SF, INT)
+DEF_FUNCTION_TYPE (V8SF, V8SF, V8SF, INT)
+DEF_FUNCTION_TYPE (V8SF, V8SF, V8SF, V8SF)
+DEF_FUNCTION_TYPE (V8SI, V8SI, V4SI, INT)
+DEF_FUNCTION_TYPE (V8SI, V8SI, V8SI, INT)
+DEF_FUNCTION_TYPE (V8SI, V8SI, V8SI, V8SI)
+DEF_FUNCTION_TYPE (VOID, PCVOID, UNSIGNED, UNSIGNED)
+DEF_FUNCTION_TYPE (VOID, PV2DF, V2DF, V2DF)
+DEF_FUNCTION_TYPE (VOID, PV4DF, V4DF, V4DF)
+DEF_FUNCTION_TYPE (VOID, PV4SF, V4SF, V4SF)
+DEF_FUNCTION_TYPE (VOID, PV8SF, V8SF, V8SF)
+DEF_FUNCTION_TYPE (VOID, UINT, UINT, UINT)
+DEF_FUNCTION_TYPE (VOID, UINT64, UINT, UINT)
+DEF_FUNCTION_TYPE (VOID, USHORT, UINT, USHORT)
+DEF_FUNCTION_TYPE (VOID, V16QI, V16QI, PCHAR)
+DEF_FUNCTION_TYPE (VOID, V8QI, V8QI, PCHAR)
+
+DEF_FUNCTION_TYPE (V2DI, V2DI, V2DI, UINT, UINT)
+DEF_FUNCTION_TYPE (V4HI, HI, HI, HI, HI)
+
+DEF_FUNCTION_TYPE (INT, V16QI, INT, V16QI, INT, INT)
+DEF_FUNCTION_TYPE (V16QI, V16QI, INT, V16QI, INT, INT)
+
+DEF_FUNCTION_TYPE (V8QI, QI, QI, QI, QI, QI, QI, QI, QI)
+
+DEF_FUNCTION_TYPE_ALIAS (INT_FTYPE_V2DF_V2DF, PTEST)
+DEF_FUNCTION_TYPE_ALIAS (INT_FTYPE_V2DI_V2DI, PTEST)
+DEF_FUNCTION_TYPE_ALIAS (INT_FTYPE_V4DF_V4DF, PTEST)
+DEF_FUNCTION_TYPE_ALIAS (INT_FTYPE_V4DI_V4DI, PTEST)
+DEF_FUNCTION_TYPE_ALIAS (INT_FTYPE_V4SF_V4SF, PTEST)
+DEF_FUNCTION_TYPE_ALIAS (INT_FTYPE_V8SF_V8SF, PTEST)
+
+DEF_FUNCTION_TYPE_ALIAS (V2DF_FTYPE_V2DF, VEC_MERGE)
+DEF_FUNCTION_TYPE_ALIAS (V4SF_FTYPE_V4SF, VEC_MERGE)
+
+DEF_FUNCTION_TYPE_ALIAS (V1DI_FTYPE_V1DI_SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V2DI_FTYPE_V2DI_SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V2SI_FTYPE_V2SI_SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V4HI_FTYPE_V4HI_SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V4SI_FTYPE_V4SI_SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V8HI_FTYPE_V8HI_SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V1DI_FTYPE_V1DI_V1DI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V2DI_FTYPE_V2DI_V2DI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V2SI_FTYPE_V2SI_V2SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V4HI_FTYPE_V4HI_V4HI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V4SI_FTYPE_V4SI_V4SI, COUNT)
+DEF_FUNCTION_TYPE_ALIAS (V8HI_FTYPE_V8HI_V8HI, COUNT)
+
+DEF_FUNCTION_TYPE_ALIAS (V2DF_FTYPE_V2DF_V2DF, SWAP)
+DEF_FUNCTION_TYPE_ALIAS (V4SF_FTYPE_V4SF_V4SF, SWAP)
+
+DEF_FUNCTION_TYPE_ALIAS (V2DI_FTYPE_V2DI_INT, CONVERT)
+DEF_FUNCTION_TYPE_ALIAS (V2DI_FTYPE_V2DI_V2DI_INT, CONVERT)
+DEF_FUNCTION_TYPE_ALIAS (V1DI_FTYPE_V1DI_V1DI_INT, CONVERT)
+
+DEF_FUNCTION_TYPE_ALIAS (V16QI_FTYPE_V16QI_V16QI, CMP)
+DEF_FUNCTION_TYPE_ALIAS (V2DI_FTYPE_V2DI_V2DI, CMP)
+DEF_FUNCTION_TYPE_ALIAS (V4SI_FTYPE_V4SI_V4SI, CMP)
+DEF_FUNCTION_TYPE_ALIAS (V8HI_FTYPE_V8HI_V8HI, CMP)
+
+DEF_FUNCTION_TYPE_ALIAS (V16QI_FTYPE_V16QI_V16QI, TF)
+DEF_FUNCTION_TYPE_ALIAS (V2DF_FTYPE_V2DF_V2DF, TF)
+DEF_FUNCTION_TYPE_ALIAS (V2DI_FTYPE_V2DI_V2DI, TF)
+DEF_FUNCTION_TYPE_ALIAS (V4SF_FTYPE_V4SF_V4SF, TF)
+DEF_FUNCTION_TYPE_ALIAS (V4SI_FTYPE_V4SI_V4SI, TF)
+DEF_FUNCTION_TYPE_ALIAS (V8HI_FTYPE_V8HI_V8HI, TF)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 69e4e61b1b9..b85ef632c3a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -20194,6 +20194,108 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
#endif
}
+/* The following file contains several enumerations and data structures
+ built from the definitions in i386-builtin-types.def. */
+
+#include "i386-builtin-types.inc"
+
+/* Table for the ix86 builtin non-function types. */
+static GTY(()) tree ix86_builtin_type_tab[(int) IX86_BT_LAST_CPTR + 1];
+
+/* Retrieve an element from the above table, building some of
+ the types lazily. */
+
+static tree
+ix86_get_builtin_type (enum ix86_builtin_type tcode)
+{
+ unsigned int index;
+ tree type, itype;
+
+ gcc_assert ((unsigned)tcode < ARRAY_SIZE(ix86_builtin_type_tab));
+
+ type = ix86_builtin_type_tab[(int) tcode];
+ if (type != NULL)
+ return type;
+
+ gcc_assert (tcode > IX86_BT_LAST_PRIM);
+ if (tcode <= IX86_BT_LAST_VECT)
+ {
+ enum machine_mode mode;
+
+ index = tcode - IX86_BT_LAST_PRIM - 1;
+ itype = ix86_get_builtin_type (ix86_builtin_type_vect_base[index]);
+ mode = ix86_builtin_type_vect_mode[index];
+
+ type = build_vector_type_for_mode (itype, mode);
+ }
+ else
+ {
+ int quals;
+
+ index = tcode - IX86_BT_LAST_VECT - 1;
+ if (tcode <= IX86_BT_LAST_PTR)
+ quals = TYPE_UNQUALIFIED;
+ else
+ quals = TYPE_QUAL_CONST;
+
+ itype = ix86_get_builtin_type (ix86_builtin_type_ptr_base[index]);
+ if (quals != TYPE_UNQUALIFIED)
+ itype = build_qualified_type (itype, quals);
+
+ type = build_pointer_type (itype);
+ }
+
+ ix86_builtin_type_tab[(int) tcode] = type;
+ return type;
+}
+
+/* Table for the ix86 builtin function types. */
+static GTY(()) tree ix86_builtin_func_type_tab[(int) IX86_BT_LAST_ALIAS + 1];
+
+/* Retrieve an element from the above table, building some of
+ the types lazily. */
+
+static tree
+ix86_get_builtin_func_type (enum ix86_builtin_func_type tcode)
+{
+ tree type;
+
+ gcc_assert ((unsigned)tcode < ARRAY_SIZE (ix86_builtin_func_type_tab));
+
+ type = ix86_builtin_func_type_tab[(int) tcode];
+ if (type != NULL)
+ return type;
+
+ if (tcode <= IX86_BT_LAST_FUNC)
+ {
+ unsigned start = ix86_builtin_func_start[(int) tcode];
+ unsigned after = ix86_builtin_func_start[(int) tcode + 1];
+ tree rtype, atype, args = void_list_node;
+ unsigned i;
+
+ rtype = ix86_get_builtin_type (ix86_builtin_func_args[start]);
+ for (i = after - 1; i > start; --i)
+ {
+ atype = ix86_get_builtin_type (ix86_builtin_func_args[i]);
+ args = tree_cons (NULL, atype, args);
+ }
+
+ type = build_function_type (rtype, args);
+ }
+ else
+ {
+ unsigned index = tcode - IX86_BT_LAST_FUNC - 1;
+ enum ix86_builtin_func_type icode;
+
+ icode = ix86_builtin_func_alias_base[index];
+ type = ix86_get_builtin_func_type (icode);
+ }
+
+ ix86_builtin_func_type_tab[(int) tcode] = type;
+ return type;
+}
+
+
/* Codes for all the SSE/MMX builtins. */
enum ix86_builtins
{
@@ -21124,34 +21226,36 @@ static GTY(()) tree ix86_builtins[(int) IX86_BUILTIN_MAX];
/* Table of all of the builtin functions that are possible with different ISA's
but are waiting to be built until a function is declared to use that
ISA. */
-struct GTY(()) builtin_isa {
- tree type; /* builtin type to use in the declaration */
+struct builtin_isa {
const char *name; /* function name */
+ enum ix86_builtin_func_type tcode; /* type to use in the declaration */
int isa; /* isa_flags this builtin is defined for */
bool const_p; /* true if the declaration is constant */
+ bool set_and_not_built_p;
};
-static GTY(()) struct builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
+static struct builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
/* Add an ix86 target builtin function with CODE, NAME and TYPE. Save the MASK
- * of which isa_flags to use in the ix86_builtins_isa array. Stores the
- * function decl in the ix86_builtins array. Returns the function decl or
- * NULL_TREE, if the builtin was not added.
- *
- * If the front end has a special hook for builtin functions, delay adding
- * builtin functions that aren't in the current ISA until the ISA is changed
- * with function specific optimization. Doing so, can save about 300K for the
- * default compiler. When the builtin is expanded, check at that time whether
- * it is valid.
- *
- * If the front end doesn't have a special hook, record all builtins, even if
- * it isn't an instruction set in the current ISA in case the user uses
- * function specific options for a different ISA, so that we don't get scope
- * errors if a builtin is added in the middle of a function scope. */
+ of which isa_flags to use in the ix86_builtins_isa array. Stores the
+ function decl in the ix86_builtins array. Returns the function decl or
+ NULL_TREE, if the builtin was not added.
+
+ If the front end has a special hook for builtin functions, delay adding
+ builtin functions that aren't in the current ISA until the ISA is changed
+ with function specific optimization. Doing so, can save about 300K for the
+ default compiler. When the builtin is expanded, check at that time whether
+ it is valid.
+
+ If the front end doesn't have a special hook, record all builtins, even if
+ it isn't an instruction set in the current ISA in case the user uses
+ function specific options for a different ISA, so that we don't get scope
+ errors if a builtin is added in the middle of a function scope. */
static inline tree
-def_builtin (int mask, const char *name, tree type, enum ix86_builtins code)
+def_builtin (int mask, const char *name, enum ix86_builtin_func_type tcode,
+ enum ix86_builtins code)
{
tree decl = NULL_TREE;
@@ -21159,22 +21263,25 @@ def_builtin (int mask, const char *name, tree type, enum ix86_builtins code)
{
ix86_builtins_isa[(int) code].isa = mask;
- if ((mask & ix86_isa_flags) != 0
+ if (mask == 0
+ || (mask & ix86_isa_flags) != 0
|| (lang_hooks.builtin_function
== lang_hooks.builtin_function_ext_scope))
{
- decl = add_builtin_function (name, type, code, BUILT_IN_MD, NULL,
- NULL_TREE);
+ tree type = ix86_get_builtin_func_type (tcode);
+ decl = add_builtin_function (name, type, code, BUILT_IN_MD,
+ NULL, NULL_TREE);
ix86_builtins[(int) code] = decl;
- ix86_builtins_isa[(int) code].type = NULL_TREE;
+ ix86_builtins_isa[(int) code].set_and_not_built_p = false;
}
else
{
ix86_builtins[(int) code] = NULL_TREE;
- ix86_builtins_isa[(int) code].const_p = false;
- ix86_builtins_isa[(int) code].type = type;
+ ix86_builtins_isa[(int) code].tcode = tcode;
ix86_builtins_isa[(int) code].name = name;
+ ix86_builtins_isa[(int) code].const_p = false;
+ ix86_builtins_isa[(int) code].set_and_not_built_p = true;
}
}
@@ -21184,10 +21291,10 @@ def_builtin (int mask, const char *name, tree type, enum ix86_builtins code)
/* Like def_builtin, but also marks the function decl "const". */
static inline tree
-def_builtin_const (int mask, const char *name, tree type,
- enum ix86_builtins code)
+def_builtin_const (int mask, const char *name,
+ enum ix86_builtin_func_type tcode, enum ix86_builtins code)
{
- tree decl = def_builtin (mask, name, type, code);
+ tree decl = def_builtin (mask, name, tcode, code);
if (decl)
TREE_READONLY (decl) = 1;
else
@@ -21204,20 +21311,23 @@ static void
ix86_add_new_builtins (int isa)
{
int i;
- tree decl;
for (i = 0; i < (int)IX86_BUILTIN_MAX; i++)
{
if ((ix86_builtins_isa[i].isa & isa) != 0
- && ix86_builtins_isa[i].type != NULL_TREE)
+ && ix86_builtins_isa[i].set_and_not_built_p)
{
+ tree decl, type;
+
+ /* Don't define the builtin again. */
+ ix86_builtins_isa[i].set_and_not_built_p = false;
+
+ type = ix86_get_builtin_func_type (ix86_builtins_isa[i].tcode);
decl = add_builtin_function_ext_scope (ix86_builtins_isa[i].name,
- ix86_builtins_isa[i].type,
- i, BUILT_IN_MD, NULL,
+ type, i, BUILT_IN_MD, NULL,
NULL_TREE);
ix86_builtins[i] = decl;
- ix86_builtins_isa[i].type = NULL_TREE;
if (ix86_builtins_isa[i].const_p)
TREE_READONLY (decl) = 1;
}
@@ -21292,214 +21402,6 @@ static const struct builtin_description bdesc_pcmpistr[] =
{ OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_pcmpistr, "__builtin_ia32_pcmpistriz128", IX86_BUILTIN_PCMPISTRZ128, UNKNOWN, (int) CCZmode },
};
-/* Special builtin types */
-enum ix86_special_builtin_type
-{
- SPECIAL_FTYPE_UNKNOWN,
- VOID_FTYPE_VOID,
- UINT64_FTYPE_VOID,
- UINT64_FTYPE_PUNSIGNED,
- V32QI_FTYPE_PCCHAR,
- V16QI_FTYPE_PCCHAR,
- V8SF_FTYPE_PCV4SF,
- V8SF_FTYPE_PCFLOAT,
- V4DF_FTYPE_PCV2DF,
- V4DF_FTYPE_PCDOUBLE,
- V4SF_FTYPE_PCFLOAT,
- V2DF_FTYPE_PCDOUBLE,
- V8SF_FTYPE_PCV8SF_V8SF,
- V4DF_FTYPE_PCV4DF_V4DF,
- V4SF_FTYPE_V4SF_PCV2SF,
- V4SF_FTYPE_PCV4SF_V4SF,
- V2DF_FTYPE_V2DF_PCDOUBLE,
- V2DF_FTYPE_PCV2DF_V2DF,
- V2DI_FTYPE_PV2DI,
- VOID_FTYPE_PV2SF_V4SF,
- VOID_FTYPE_PV4DI_V4DI,
- VOID_FTYPE_PV2DI_V2DI,
- VOID_FTYPE_PCHAR_V32QI,
- VOID_FTYPE_PCHAR_V16QI,
- VOID_FTYPE_PFLOAT_V8SF,
- VOID_FTYPE_PFLOAT_V4SF,
- VOID_FTYPE_PDOUBLE_V4DF,
- VOID_FTYPE_PDOUBLE_V2DF,
- VOID_FTYPE_PDI_DI,
- VOID_FTYPE_PINT_INT,
- VOID_FTYPE_PV8SF_V8SF_V8SF,
- VOID_FTYPE_PV4DF_V4DF_V4DF,
- VOID_FTYPE_PV4SF_V4SF_V4SF,
- VOID_FTYPE_PV2DF_V2DF_V2DF,
- VOID_FTYPE_USHORT_UINT_USHORT,
- VOID_FTYPE_UINT_UINT_UINT,
- VOID_FTYPE_UINT64_UINT_UINT,
- UCHAR_FTYPE_USHORT_UINT_USHORT,
- UCHAR_FTYPE_UINT_UINT_UINT,
- UCHAR_FTYPE_UINT64_UINT_UINT
-};
-
-/* Builtin types */
-enum ix86_builtin_type
-{
- FTYPE_UNKNOWN,
- FLOAT128_FTYPE_FLOAT128,
- FLOAT_FTYPE_FLOAT,
- FLOAT128_FTYPE_FLOAT128_FLOAT128,
- INT_FTYPE_V8SF_V8SF_PTEST,
- INT_FTYPE_V4DI_V4DI_PTEST,
- INT_FTYPE_V4DF_V4DF_PTEST,
- INT_FTYPE_V4SF_V4SF_PTEST,
- INT_FTYPE_V2DI_V2DI_PTEST,
- INT_FTYPE_V2DF_V2DF_PTEST,
- INT_FTYPE_INT,
- UINT64_FTYPE_INT,
- INT64_FTYPE_INT64,
- INT64_FTYPE_V4SF,
- INT64_FTYPE_V2DF,
- INT_FTYPE_V16QI,
- INT_FTYPE_V8QI,
- INT_FTYPE_V8SF,
- INT_FTYPE_V4DF,
- INT_FTYPE_V4SF,
- INT_FTYPE_V2DF,
- V16QI_FTYPE_V16QI,
- V8SI_FTYPE_V8SF,
- V8SI_FTYPE_V4SI,
- V8HI_FTYPE_V8HI,
- V8HI_FTYPE_V16QI,
- V8QI_FTYPE_V8QI,
- V8SF_FTYPE_V8SF,
- V8SF_FTYPE_V8SI,
- V8SF_FTYPE_V4SF,
- V4SI_FTYPE_V4SI,
- V4SI_FTYPE_V16QI,
- V4SI_FTYPE_V8SI,
- V4SI_FTYPE_V8HI,
- V4SI_FTYPE_V4DF,
- V4SI_FTYPE_V4SF,
- V4SI_FTYPE_V2DF,
- V4HI_FTYPE_V4HI,
- V4DF_FTYPE_V4DF,
- V4DF_FTYPE_V4SI,
- V4DF_FTYPE_V4SF,
- V4DF_FTYPE_V2DF,
- V4SF_FTYPE_V4DF,
- V4SF_FTYPE_V4SF,
- V4SF_FTYPE_V4SF_VEC_MERGE,
- V4SF_FTYPE_V8SF,
- V4SF_FTYPE_V4SI,
- V4SF_FTYPE_V2DF,
- V2DI_FTYPE_V2DI,
- V2DI_FTYPE_V16QI,
- V2DI_FTYPE_V8HI,
- V2DI_FTYPE_V4SI,
- V2DF_FTYPE_V2DF,
- V2DF_FTYPE_V2DF_VEC_MERGE,
- V2DF_FTYPE_V4SI,
- V2DF_FTYPE_V4DF,
- V2DF_FTYPE_V4SF,
- V2DF_FTYPE_V2SI,
- V2SI_FTYPE_V2SI,
- V2SI_FTYPE_V4SF,
- V2SI_FTYPE_V2SF,
- V2SI_FTYPE_V2DF,
- V2SF_FTYPE_V2SF,
- V2SF_FTYPE_V2SI,
- V16QI_FTYPE_V16QI_V16QI,
- V16QI_FTYPE_V8HI_V8HI,
- V8QI_FTYPE_V8QI_V8QI,
- V8QI_FTYPE_V4HI_V4HI,
- V8HI_FTYPE_V8HI_V8HI,
- V8HI_FTYPE_V8HI_V8HI_COUNT,
- V8HI_FTYPE_V16QI_V16QI,
- V8HI_FTYPE_V4SI_V4SI,
- V8HI_FTYPE_V8HI_SI_COUNT,
- V8SF_FTYPE_V8SF_V8SF,
- V8SF_FTYPE_V8SF_V8SI,
- V4SI_FTYPE_V4SI_V4SI,
- V4SI_FTYPE_V4SI_V4SI_COUNT,
- V4SI_FTYPE_V8HI_V8HI,
- V4SI_FTYPE_V4SF_V4SF,
- V4SI_FTYPE_V2DF_V2DF,
- V4SI_FTYPE_V4SI_SI_COUNT,
- V4HI_FTYPE_V4HI_V4HI,
- V4HI_FTYPE_V4HI_V4HI_COUNT,
- V4HI_FTYPE_V8QI_V8QI,
- V4HI_FTYPE_V2SI_V2SI,
- V4HI_FTYPE_V4HI_SI_COUNT,
- V4DF_FTYPE_V4DF_V4DF,
- V4DF_FTYPE_V4DF_V4DI,
- V4SF_FTYPE_V4SF_V4SF,
- V4SF_FTYPE_V4SF_V4SF_SWAP,
- V4SF_FTYPE_V4SF_V4SI,
- V4SF_FTYPE_V4SF_V2SI,
- V4SF_FTYPE_V4SF_V2DF,
- V4SF_FTYPE_V4SF_DI,
- V4SF_FTYPE_V4SF_SI,
- V2DI_FTYPE_V2DI_V2DI,
- V2DI_FTYPE_V2DI_V2DI_COUNT,
- V2DI_FTYPE_V16QI_V16QI,
- V2DI_FTYPE_V4SI_V4SI,
- V2DI_FTYPE_V2DI_V16QI,
- V2DI_FTYPE_V2DF_V2DF,
- V2DI_FTYPE_V2DI_SI_COUNT,
- V2SI_FTYPE_V2SI_V2SI,
- V2SI_FTYPE_V2SI_V2SI_COUNT,
- V2SI_FTYPE_V4HI_V4HI,
- V2SI_FTYPE_V2SF_V2SF,
- V2SI_FTYPE_V2SI_SI_COUNT,
- V2DF_FTYPE_V2DF_V2DF,
- V2DF_FTYPE_V2DF_V2DF_SWAP,
- V2DF_FTYPE_V2DF_V4SF,
- V2DF_FTYPE_V2DF_V2DI,
- V2DF_FTYPE_V2DF_DI,
- V2DF_FTYPE_V2DF_SI,
- V2SF_FTYPE_V2SF_V2SF,
- V1DI_FTYPE_V1DI_V1DI,
- V1DI_FTYPE_V1DI_V1DI_COUNT,
- V1DI_FTYPE_V8QI_V8QI,
- V1DI_FTYPE_V2SI_V2SI,
- V1DI_FTYPE_V1DI_SI_COUNT,
- UINT64_FTYPE_UINT64_UINT64,
- UINT_FTYPE_UINT_UINT,
- UINT_FTYPE_UINT_USHORT,
- UINT_FTYPE_UINT_UCHAR,
- UINT16_FTYPE_UINT16_INT,
- UINT8_FTYPE_UINT8_INT,
- V8HI_FTYPE_V8HI_INT,
- V4SI_FTYPE_V4SI_INT,
- V4HI_FTYPE_V4HI_INT,
- V8SF_FTYPE_V8SF_INT,
- V4SI_FTYPE_V8SI_INT,
- V4SF_FTYPE_V8SF_INT,
- V2DF_FTYPE_V4DF_INT,
- V4DF_FTYPE_V4DF_INT,
- V4SF_FTYPE_V4SF_INT,
- V2DI_FTYPE_V2DI_INT,
- V2DI2TI_FTYPE_V2DI_INT,
- V2DF_FTYPE_V2DF_INT,
- V16QI_FTYPE_V16QI_V16QI_V16QI,
- V8SF_FTYPE_V8SF_V8SF_V8SF,
- V4DF_FTYPE_V4DF_V4DF_V4DF,
- V4SF_FTYPE_V4SF_V4SF_V4SF,
- V2DF_FTYPE_V2DF_V2DF_V2DF,
- V16QI_FTYPE_V16QI_V16QI_INT,
- V8SI_FTYPE_V8SI_V8SI_INT,
- V8SI_FTYPE_V8SI_V4SI_INT,
- V8HI_FTYPE_V8HI_V8HI_INT,
- V8SF_FTYPE_V8SF_V8SF_INT,
- V8SF_FTYPE_V8SF_V4SF_INT,
- V4SI_FTYPE_V4SI_V4SI_INT,
- V4DF_FTYPE_V4DF_V4DF_INT,
- V4DF_FTYPE_V4DF_V2DF_INT,
- V4SF_FTYPE_V4SF_V4SF_INT,
- V2DI_FTYPE_V2DI_V2DI_INT,
- V2DI2TI_FTYPE_V2DI_V2DI_INT,
- V1DI2DI_FTYPE_V1DI_V1DI_INT,
- V2DF_FTYPE_V2DF_V2DF_INT,
- V2DI_FTYPE_V2DI_UINT_UINT,
- V2DI_FTYPE_V2DI_V2DI_UINT_UINT
-};
-
/* Special builtins with variable number of arguments. */
static const struct builtin_description bdesc_special_args[] =
{
@@ -21524,7 +21426,7 @@ static const struct builtin_description bdesc_special_args[] =
/* SSE or 3DNow!A */
{ OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_sse_sfence, "__builtin_ia32_sfence", IX86_BUILTIN_SFENCE, UNKNOWN, (int) VOID_FTYPE_VOID },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_sse_movntdi, "__builtin_ia32_movntq", IX86_BUILTIN_MOVNTQ, UNKNOWN, (int) VOID_FTYPE_PDI_DI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_sse_movntdi, "__builtin_ia32_movntq", IX86_BUILTIN_MOVNTQ, UNKNOWN, (int) VOID_FTYPE_PULONGLONG_ULONGLONG },
/* SSE2 */
{ OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_lfence, "__builtin_ia32_lfence", IX86_BUILTIN_LFENCE, UNKNOWN, (int) VOID_FTYPE_VOID },
@@ -21937,7 +21839,7 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsd2ss, "__builtin_ia32_cvtsd2ss", IX86_BUILTIN_CVTSD2SS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V2DF },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtss2sd, "__builtin_ia32_cvtss2sd", IX86_BUILTIN_CVTSS2SD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V4SF },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ashlti3, "__builtin_ia32_pslldqi128", IX86_BUILTIN_PSLLDQI128, UNKNOWN, (int) V2DI2TI_FTYPE_V2DI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ashlti3, "__builtin_ia32_pslldqi128", IX86_BUILTIN_PSLLDQI128, UNKNOWN, (int) V2DI_FTYPE_V2DI_INT_CONVERT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv8hi3, "__builtin_ia32_psllwi128", IX86_BUILTIN_PSLLWI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_SI_COUNT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv4si3, "__builtin_ia32_pslldi128", IX86_BUILTIN_PSLLDI128, UNKNOWN, (int) V4SI_FTYPE_V4SI_SI_COUNT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv2di3, "__builtin_ia32_psllqi128", IX86_BUILTIN_PSLLQI128, UNKNOWN, (int) V2DI_FTYPE_V2DI_SI_COUNT },
@@ -21945,7 +21847,7 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv4si3, "__builtin_ia32_pslld128", IX86_BUILTIN_PSLLD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI_COUNT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv2di3, "__builtin_ia32_psllq128", IX86_BUILTIN_PSLLQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_COUNT },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_lshrti3, "__builtin_ia32_psrldqi128", IX86_BUILTIN_PSRLDQI128, UNKNOWN, (int) V2DI2TI_FTYPE_V2DI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_lshrti3, "__builtin_ia32_psrldqi128", IX86_BUILTIN_PSRLDQI128, UNKNOWN, (int) V2DI_FTYPE_V2DI_INT_CONVERT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv8hi3, "__builtin_ia32_psrlwi128", IX86_BUILTIN_PSRLWI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_SI_COUNT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv4si3, "__builtin_ia32_psrldi128", IX86_BUILTIN_PSRLDI128, UNKNOWN, (int) V4SI_FTYPE_V4SI_SI_COUNT },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv2di3, "__builtin_ia32_psrlqi128", IX86_BUILTIN_PSRLQI128, UNKNOWN, (int) V2DI_FTYPE_V2DI_SI_COUNT },
@@ -22018,8 +21920,8 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv2si3, "__builtin_ia32_psignd", IX86_BUILTIN_PSIGND, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
/* SSSE3. */
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_palignrti, "__builtin_ia32_palignr128", IX86_BUILTIN_PALIGNR128, UNKNOWN, (int) V2DI2TI_FTYPE_V2DI_V2DI_INT },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_palignrdi, "__builtin_ia32_palignr", IX86_BUILTIN_PALIGNR, UNKNOWN, (int) V1DI2DI_FTYPE_V1DI_V1DI_INT },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_palignrti, "__builtin_ia32_palignr128", IX86_BUILTIN_PALIGNR128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_INT_CONVERT },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_palignrdi, "__builtin_ia32_palignr", IX86_BUILTIN_PALIGNR, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI_INT_CONVERT },
/* SSE4.1 */
{ OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_blendpd, "__builtin_ia32_blendpd", IX86_BUILTIN_BLENDPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT },
@@ -22211,58 +22113,54 @@ static const struct builtin_description bdesc_args[] =
};
/* FMA4 and XOP. */
-enum multi_arg_type {
- MULTI_ARG_UNKNOWN,
- MULTI_ARG_3_SF,
- MULTI_ARG_3_DF,
- MULTI_ARG_3_SF2,
- MULTI_ARG_3_DF2,
- MULTI_ARG_3_DI,
- MULTI_ARG_3_SI,
- MULTI_ARG_3_SI_DI,
- MULTI_ARG_3_HI,
- MULTI_ARG_3_HI_SI,
- MULTI_ARG_3_QI,
- MULTI_ARG_3_DI2,
- MULTI_ARG_3_SI2,
- MULTI_ARG_3_HI2,
- MULTI_ARG_3_QI2,
- MULTI_ARG_2_SF,
- MULTI_ARG_2_DF,
- MULTI_ARG_2_DI,
- MULTI_ARG_2_SI,
- MULTI_ARG_2_HI,
- MULTI_ARG_2_QI,
- MULTI_ARG_2_DI_IMM,
- MULTI_ARG_2_SI_IMM,
- MULTI_ARG_2_HI_IMM,
- MULTI_ARG_2_QI_IMM,
- MULTI_ARG_2_DI_CMP,
- MULTI_ARG_2_SI_CMP,
- MULTI_ARG_2_HI_CMP,
- MULTI_ARG_2_QI_CMP,
- MULTI_ARG_2_DI_TF,
- MULTI_ARG_2_SI_TF,
- MULTI_ARG_2_HI_TF,
- MULTI_ARG_2_QI_TF,
- MULTI_ARG_2_SF_TF,
- MULTI_ARG_2_DF_TF,
- MULTI_ARG_1_SF,
- MULTI_ARG_1_DF,
- MULTI_ARG_1_SF2,
- MULTI_ARG_1_DF2,
- MULTI_ARG_1_DI,
- MULTI_ARG_1_SI,
- MULTI_ARG_1_HI,
- MULTI_ARG_1_QI,
- MULTI_ARG_1_SI_DI,
- MULTI_ARG_1_HI_DI,
- MULTI_ARG_1_HI_SI,
- MULTI_ARG_1_QI_DI,
- MULTI_ARG_1_QI_SI,
- MULTI_ARG_1_QI_HI
-
-};
+#define MULTI_ARG_3_SF V4SF_FTYPE_V4SF_V4SF_V4SF
+#define MULTI_ARG_3_DF V2DF_FTYPE_V2DF_V2DF_V2DF
+#define MULTI_ARG_3_SF2 V8SF_FTYPE_V8SF_V8SF_V8SF
+#define MULTI_ARG_3_DF2 V4DF_FTYPE_V4DF_V4DF_V4DF
+#define MULTI_ARG_3_DI V2DI_FTYPE_V2DI_V2DI_V2DI
+#define MULTI_ARG_3_SI V4SI_FTYPE_V4SI_V4SI_V4SI
+#define MULTI_ARG_3_SI_DI V4SI_FTYPE_V4SI_V4SI_V2DI
+#define MULTI_ARG_3_HI V8HI_FTYPE_V8HI_V8HI_V8HI
+#define MULTI_ARG_3_HI_SI V8HI_FTYPE_V8HI_V8HI_V4SI
+#define MULTI_ARG_3_QI V16QI_FTYPE_V16QI_V16QI_V16QI
+#define MULTI_ARG_3_DI2 V4DI_FTYPE_V4DI_V4DI_V4DI
+#define MULTI_ARG_3_SI2 V8SI_FTYPE_V8SI_V8SI_V8SI
+#define MULTI_ARG_3_HI2 V16HI_FTYPE_V16HI_V16HI_V16HI
+#define MULTI_ARG_3_QI2 V32QI_FTYPE_V32QI_V32QI_V32QI
+#define MULTI_ARG_2_SF V4SF_FTYPE_V4SF_V4SF
+#define MULTI_ARG_2_DF V2DF_FTYPE_V2DF_V2DF
+#define MULTI_ARG_2_DI V2DI_FTYPE_V2DI_V2DI
+#define MULTI_ARG_2_SI V4SI_FTYPE_V4SI_V4SI
+#define MULTI_ARG_2_HI V8HI_FTYPE_V8HI_V8HI
+#define MULTI_ARG_2_QI V16QI_FTYPE_V16QI_V16QI
+#define MULTI_ARG_2_DI_IMM V2DI_FTYPE_V2DI_SI
+#define MULTI_ARG_2_SI_IMM V4SI_FTYPE_V4SI_SI
+#define MULTI_ARG_2_HI_IMM V8HI_FTYPE_V8HI_SI
+#define MULTI_ARG_2_QI_IMM V16QI_FTYPE_V16QI_SI
+#define MULTI_ARG_2_DI_CMP V2DI_FTYPE_V2DI_V2DI_CMP
+#define MULTI_ARG_2_SI_CMP V4SI_FTYPE_V4SI_V4SI_CMP
+#define MULTI_ARG_2_HI_CMP V8HI_FTYPE_V8HI_V8HI_CMP
+#define MULTI_ARG_2_QI_CMP V16QI_FTYPE_V16QI_V16QI_CMP
+#define MULTI_ARG_2_SF_TF V4SF_FTYPE_V4SF_V4SF_TF
+#define MULTI_ARG_2_DF_TF V2DF_FTYPE_V2DF_V2DF_TF
+#define MULTI_ARG_2_DI_TF V2DI_FTYPE_V2DI_V2DI_TF
+#define MULTI_ARG_2_SI_TF V4SI_FTYPE_V4SI_V4SI_TF
+#define MULTI_ARG_2_HI_TF V8HI_FTYPE_V8HI_V8HI_TF
+#define MULTI_ARG_2_QI_TF V16QI_FTYPE_V16QI_V16QI_TF
+#define MULTI_ARG_1_SF V4SF_FTYPE_V4SF
+#define MULTI_ARG_1_DF V2DF_FTYPE_V2DF
+#define MULTI_ARG_1_SF2 V8SF_FTYPE_V8SF
+#define MULTI_ARG_1_DF2 V4DF_FTYPE_V4DF
+#define MULTI_ARG_1_DI V2DI_FTYPE_V2DI
+#define MULTI_ARG_1_SI V4SI_FTYPE_V4SI
+#define MULTI_ARG_1_HI V8HI_FTYPE_V8HI
+#define MULTI_ARG_1_QI V16QI_FTYPE_V16QI
+#define MULTI_ARG_1_SI_DI V2DI_FTYPE_V4SI
+#define MULTI_ARG_1_HI_DI V2DI_FTYPE_V8HI
+#define MULTI_ARG_1_HI_SI V4SI_FTYPE_V8HI
+#define MULTI_ARG_1_QI_DI V2DI_FTYPE_V16QI
+#define MULTI_ARG_1_QI_SI V4SI_FTYPE_V16QI
+#define MULTI_ARG_1_QI_HI V8HI_FTYPE_V16QI
static const struct builtin_description bdesc_multi_arg[] =
{
@@ -22467,975 +22365,19 @@ static void
ix86_init_mmx_sse_builtins (void)
{
const struct builtin_description * d;
+ enum ix86_builtin_func_type ftype;
size_t i;
- tree V16QI_type_node = build_vector_type_for_mode (char_type_node, V16QImode);
- tree V2SI_type_node = build_vector_type_for_mode (intSI_type_node, V2SImode);
- tree V1DI_type_node
- = build_vector_type_for_mode (long_long_integer_type_node, V1DImode);
- tree V2SF_type_node = build_vector_type_for_mode (float_type_node, V2SFmode);
- tree V2DI_type_node
- = build_vector_type_for_mode (long_long_integer_type_node, V2DImode);
- tree V2DF_type_node = build_vector_type_for_mode (double_type_node, V2DFmode);
- tree V4SF_type_node = build_vector_type_for_mode (float_type_node, V4SFmode);
- tree V4SI_type_node = build_vector_type_for_mode (intSI_type_node, V4SImode);
- tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode);
- tree V8QI_type_node = build_vector_type_for_mode (char_type_node, V8QImode);
- tree V8HI_type_node = build_vector_type_for_mode (intHI_type_node, V8HImode);
-
- tree pchar_type_node = build_pointer_type (char_type_node);
- tree pcchar_type_node
- = build_pointer_type (build_type_variant (char_type_node, 1, 0));
- tree pfloat_type_node = build_pointer_type (float_type_node);
- tree pcfloat_type_node
- = build_pointer_type (build_type_variant (float_type_node, 1, 0));
- tree pv2sf_type_node = build_pointer_type (V2SF_type_node);
- tree pcv2sf_type_node
- = build_pointer_type (build_type_variant (V2SF_type_node, 1, 0));
- tree pv2di_type_node = build_pointer_type (V2DI_type_node);
- tree pdi_type_node = build_pointer_type (long_long_unsigned_type_node);
-
- /* Comparisons. */
- tree int_ftype_v4sf_v4sf
- = build_function_type_list (integer_type_node,
- V4SF_type_node, V4SF_type_node, NULL_TREE);
- tree v4si_ftype_v4sf_v4sf
- = build_function_type_list (V4SI_type_node,
- V4SF_type_node, V4SF_type_node, NULL_TREE);
- /* MMX/SSE/integer conversions. */
- tree int_ftype_v4sf
- = build_function_type_list (integer_type_node,
- V4SF_type_node, NULL_TREE);
- tree int64_ftype_v4sf
- = build_function_type_list (long_long_integer_type_node,
- V4SF_type_node, NULL_TREE);
- tree int_ftype_v8qi
- = build_function_type_list (integer_type_node, V8QI_type_node, NULL_TREE);
- tree v4sf_ftype_v4sf_int
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, integer_type_node, NULL_TREE);
- tree v4sf_ftype_v4sf_int64
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, long_long_integer_type_node,
- NULL_TREE);
- tree v4sf_ftype_v4sf_v2si
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, V2SI_type_node, NULL_TREE);
-
- /* Miscellaneous. */
- tree v8qi_ftype_v4hi_v4hi
- = build_function_type_list (V8QI_type_node,
- V4HI_type_node, V4HI_type_node, NULL_TREE);
- tree v4hi_ftype_v2si_v2si
- = build_function_type_list (V4HI_type_node,
- V2SI_type_node, V2SI_type_node, NULL_TREE);
- tree v4sf_ftype_v4sf_v4sf_int
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, V4SF_type_node,
- integer_type_node, NULL_TREE);
- tree v2si_ftype_v4hi_v4hi
- = build_function_type_list (V2SI_type_node,
- V4HI_type_node, V4HI_type_node, NULL_TREE);
- tree v4hi_ftype_v4hi_int
- = build_function_type_list (V4HI_type_node,
- V4HI_type_node, integer_type_node, NULL_TREE);
- tree v2si_ftype_v2si_int
- = build_function_type_list (V2SI_type_node,
- V2SI_type_node, integer_type_node, NULL_TREE);
- tree v1di_ftype_v1di_int
- = build_function_type_list (V1DI_type_node,
- V1DI_type_node, integer_type_node, NULL_TREE);
-
- tree void_ftype_void
- = build_function_type (void_type_node, void_list_node);
- tree void_ftype_unsigned
- = build_function_type_list (void_type_node, unsigned_type_node, NULL_TREE);
- tree void_ftype_unsigned_unsigned
- = build_function_type_list (void_type_node, unsigned_type_node,
- unsigned_type_node, NULL_TREE);
- tree void_ftype_pcvoid_unsigned_unsigned
- = build_function_type_list (void_type_node, const_ptr_type_node,
- unsigned_type_node, unsigned_type_node,
- NULL_TREE);
- tree unsigned_ftype_void
- = build_function_type (unsigned_type_node, void_list_node);
- tree v2si_ftype_v4sf
- = build_function_type_list (V2SI_type_node, V4SF_type_node, NULL_TREE);
- /* Loads/stores. */
- tree void_ftype_v8qi_v8qi_pchar
- = build_function_type_list (void_type_node,
- V8QI_type_node, V8QI_type_node,
- pchar_type_node, NULL_TREE);
- tree v4sf_ftype_pcfloat
- = build_function_type_list (V4SF_type_node, pcfloat_type_node, NULL_TREE);
- tree v4sf_ftype_v4sf_pcv2sf
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, pcv2sf_type_node, NULL_TREE);
- tree void_ftype_pv2sf_v4sf
- = build_function_type_list (void_type_node,
- pv2sf_type_node, V4SF_type_node, NULL_TREE);
- tree void_ftype_pfloat_v4sf
- = build_function_type_list (void_type_node,
- pfloat_type_node, V4SF_type_node, NULL_TREE);
- tree void_ftype_pdi_di
- = build_function_type_list (void_type_node,
- pdi_type_node, long_long_unsigned_type_node,
- NULL_TREE);
- tree void_ftype_pv2di_v2di
- = build_function_type_list (void_type_node,
- pv2di_type_node, V2DI_type_node, NULL_TREE);
- /* Normal vector unops. */
- tree v4sf_ftype_v4sf
- = build_function_type_list (V4SF_type_node, V4SF_type_node, NULL_TREE);
- tree v16qi_ftype_v16qi
- = build_function_type_list (V16QI_type_node, V16QI_type_node, NULL_TREE);
- tree v8hi_ftype_v8hi
- = build_function_type_list (V8HI_type_node, V8HI_type_node, NULL_TREE);
- tree v4si_ftype_v4si
- = build_function_type_list (V4SI_type_node, V4SI_type_node, NULL_TREE);
- tree v8qi_ftype_v8qi
- = build_function_type_list (V8QI_type_node, V8QI_type_node, NULL_TREE);
- tree v4hi_ftype_v4hi
- = build_function_type_list (V4HI_type_node, V4HI_type_node, NULL_TREE);
-
- /* Normal vector binops. */
- tree v4sf_ftype_v4sf_v4sf
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, V4SF_type_node, NULL_TREE);
- tree v8qi_ftype_v8qi_v8qi
- = build_function_type_list (V8QI_type_node,
- V8QI_type_node, V8QI_type_node, NULL_TREE);
- tree v4hi_ftype_v4hi_v4hi
- = build_function_type_list (V4HI_type_node,
- V4HI_type_node, V4HI_type_node, NULL_TREE);
- tree v2si_ftype_v2si_v2si
- = build_function_type_list (V2SI_type_node,
- V2SI_type_node, V2SI_type_node, NULL_TREE);
- tree v1di_ftype_v1di_v1di
- = build_function_type_list (V1DI_type_node,
- V1DI_type_node, V1DI_type_node, NULL_TREE);
- tree v1di_ftype_v1di_v1di_int
- = build_function_type_list (V1DI_type_node,
- V1DI_type_node, V1DI_type_node,
- integer_type_node, NULL_TREE);
- tree v2si_ftype_v2sf
- = build_function_type_list (V2SI_type_node, V2SF_type_node, NULL_TREE);
- tree v2sf_ftype_v2si
- = build_function_type_list (V2SF_type_node, V2SI_type_node, NULL_TREE);
- tree v2si_ftype_v2si
- = build_function_type_list (V2SI_type_node, V2SI_type_node, NULL_TREE);
- tree v2sf_ftype_v2sf
- = build_function_type_list (V2SF_type_node, V2SF_type_node, NULL_TREE);
- tree v2sf_ftype_v2sf_v2sf
- = build_function_type_list (V2SF_type_node,
- V2SF_type_node, V2SF_type_node, NULL_TREE);
- tree v2si_ftype_v2sf_v2sf
- = build_function_type_list (V2SI_type_node,
- V2SF_type_node, V2SF_type_node, NULL_TREE);
- tree pint_type_node = build_pointer_type (integer_type_node);
- tree pdouble_type_node = build_pointer_type (double_type_node);
- tree pcdouble_type_node = build_pointer_type (
- build_type_variant (double_type_node, 1, 0));
- tree int_ftype_v2df_v2df
- = build_function_type_list (integer_type_node,
- V2DF_type_node, V2DF_type_node, NULL_TREE);
-
- tree void_ftype_pcvoid
- = build_function_type_list (void_type_node, const_ptr_type_node, NULL_TREE);
- tree v4sf_ftype_v4si
- = build_function_type_list (V4SF_type_node, V4SI_type_node, NULL_TREE);
- tree v4si_ftype_v4sf
- = build_function_type_list (V4SI_type_node, V4SF_type_node, NULL_TREE);
- tree v2df_ftype_v4si
- = build_function_type_list (V2DF_type_node, V4SI_type_node, NULL_TREE);
- tree v4si_ftype_v2df
- = build_function_type_list (V4SI_type_node, V2DF_type_node, NULL_TREE);
- tree v4si_ftype_v2df_v2df
- = build_function_type_list (V4SI_type_node,
- V2DF_type_node, V2DF_type_node, NULL_TREE);
- tree v2si_ftype_v2df
- = build_function_type_list (V2SI_type_node, V2DF_type_node, NULL_TREE);
- tree v4sf_ftype_v2df
- = build_function_type_list (V4SF_type_node, V2DF_type_node, NULL_TREE);
- tree v2df_ftype_v2si
- = build_function_type_list (V2DF_type_node, V2SI_type_node, NULL_TREE);
- tree v2df_ftype_v4sf
- = build_function_type_list (V2DF_type_node, V4SF_type_node, NULL_TREE);
- tree int_ftype_v2df
- = build_function_type_list (integer_type_node, V2DF_type_node, NULL_TREE);
- tree int64_ftype_v2df
- = build_function_type_list (long_long_integer_type_node,
- V2DF_type_node, NULL_TREE);
- tree v2df_ftype_v2df_int
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, integer_type_node, NULL_TREE);
- tree v2df_ftype_v2df_int64
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, long_long_integer_type_node,
- NULL_TREE);
- tree v4sf_ftype_v4sf_v2df
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, V2DF_type_node, NULL_TREE);
- tree v2df_ftype_v2df_v4sf
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, V4SF_type_node, NULL_TREE);
- tree v2df_ftype_v2df_v2df_int
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, V2DF_type_node,
- integer_type_node,
- NULL_TREE);
- tree v2df_ftype_v2df_pcdouble
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, pcdouble_type_node, NULL_TREE);
- tree void_ftype_pdouble_v2df
- = build_function_type_list (void_type_node,
- pdouble_type_node, V2DF_type_node, NULL_TREE);
- tree void_ftype_pint_int
- = build_function_type_list (void_type_node,
- pint_type_node, integer_type_node, NULL_TREE);
- tree void_ftype_v16qi_v16qi_pchar
- = build_function_type_list (void_type_node,
- V16QI_type_node, V16QI_type_node,
- pchar_type_node, NULL_TREE);
- tree v2df_ftype_pcdouble
- = build_function_type_list (V2DF_type_node, pcdouble_type_node, NULL_TREE);
- tree v2df_ftype_v2df_v2df
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, V2DF_type_node, NULL_TREE);
- tree v16qi_ftype_v16qi_v16qi
- = build_function_type_list (V16QI_type_node,
- V16QI_type_node, V16QI_type_node, NULL_TREE);
- tree v8hi_ftype_v8hi_v8hi
- = build_function_type_list (V8HI_type_node,
- V8HI_type_node, V8HI_type_node, NULL_TREE);
- tree v4si_ftype_v4si_v4si
- = build_function_type_list (V4SI_type_node,
- V4SI_type_node, V4SI_type_node, NULL_TREE);
- tree v2di_ftype_v2di_v2di
- = build_function_type_list (V2DI_type_node,
- V2DI_type_node, V2DI_type_node, NULL_TREE);
- tree v2di_ftype_v2df_v2df
- = build_function_type_list (V2DI_type_node,
- V2DF_type_node, V2DF_type_node, NULL_TREE);
- tree v2df_ftype_v2df
- = build_function_type_list (V2DF_type_node, V2DF_type_node, NULL_TREE);
- tree v2di_ftype_v2di_int
- = build_function_type_list (V2DI_type_node,
- V2DI_type_node, integer_type_node, NULL_TREE);
- tree v2di_ftype_v2di_v2di_int
- = build_function_type_list (V2DI_type_node, V2DI_type_node,
- V2DI_type_node, integer_type_node, NULL_TREE);
- tree v4si_ftype_v4si_int
- = build_function_type_list (V4SI_type_node,
- V4SI_type_node, integer_type_node, NULL_TREE);
- tree v8hi_ftype_v8hi_int
- = build_function_type_list (V8HI_type_node,
- V8HI_type_node, integer_type_node, NULL_TREE);
- tree v4si_ftype_v8hi_v8hi
- = build_function_type_list (V4SI_type_node,
- V8HI_type_node, V8HI_type_node, NULL_TREE);
- tree v1di_ftype_v8qi_v8qi
- = build_function_type_list (V1DI_type_node,
- V8QI_type_node, V8QI_type_node, NULL_TREE);
- tree v1di_ftype_v2si_v2si
- = build_function_type_list (V1DI_type_node,
- V2SI_type_node, V2SI_type_node, NULL_TREE);
- tree v2di_ftype_v16qi_v16qi
- = build_function_type_list (V2DI_type_node,
- V16QI_type_node, V16QI_type_node, NULL_TREE);
- tree v2di_ftype_v4si_v4si
- = build_function_type_list (V2DI_type_node,
- V4SI_type_node, V4SI_type_node, NULL_TREE);
- tree int_ftype_v16qi
- = build_function_type_list (integer_type_node, V16QI_type_node, NULL_TREE);
- tree v16qi_ftype_pcchar
- = build_function_type_list (V16QI_type_node, pcchar_type_node, NULL_TREE);
- tree void_ftype_pchar_v16qi
- = build_function_type_list (void_type_node,
- pchar_type_node, V16QI_type_node, NULL_TREE);
-
- tree v2di_ftype_v2di_unsigned_unsigned
- = build_function_type_list (V2DI_type_node, V2DI_type_node,
- unsigned_type_node, unsigned_type_node,
- NULL_TREE);
- tree v2di_ftype_v2di_v2di_unsigned_unsigned
- = build_function_type_list (V2DI_type_node, V2DI_type_node, V2DI_type_node,
- unsigned_type_node, unsigned_type_node,
- NULL_TREE);
- tree v2di_ftype_v2di_v16qi
- = build_function_type_list (V2DI_type_node, V2DI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v2df_ftype_v2df_v2df_v2df
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, V2DF_type_node,
- V2DF_type_node, NULL_TREE);
- tree v4sf_ftype_v4sf_v4sf_v4sf
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, V4SF_type_node,
- V4SF_type_node, NULL_TREE);
- tree v8hi_ftype_v16qi
- = build_function_type_list (V8HI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v4si_ftype_v16qi
- = build_function_type_list (V4SI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v2di_ftype_v16qi
- = build_function_type_list (V2DI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v4si_ftype_v8hi
- = build_function_type_list (V4SI_type_node, V8HI_type_node,
- NULL_TREE);
- tree v2di_ftype_v8hi
- = build_function_type_list (V2DI_type_node, V8HI_type_node,
- NULL_TREE);
- tree v2di_ftype_v4si
- = build_function_type_list (V2DI_type_node, V4SI_type_node,
- NULL_TREE);
- tree v2di_ftype_pv2di
- = build_function_type_list (V2DI_type_node, pv2di_type_node,
- NULL_TREE);
- tree v16qi_ftype_v16qi_v16qi_int
- = build_function_type_list (V16QI_type_node, V16QI_type_node,
- V16QI_type_node, integer_type_node,
- NULL_TREE);
- tree v16qi_ftype_v16qi_v16qi_v16qi
- = build_function_type_list (V16QI_type_node, V16QI_type_node,
- V16QI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v8hi_ftype_v8hi_v8hi_int
- = build_function_type_list (V8HI_type_node, V8HI_type_node,
- V8HI_type_node, integer_type_node,
- NULL_TREE);
- tree v4si_ftype_v4si_v4si_int
- = build_function_type_list (V4SI_type_node, V4SI_type_node,
- V4SI_type_node, integer_type_node,
- NULL_TREE);
- tree int_ftype_v2di_v2di
- = build_function_type_list (integer_type_node,
- V2DI_type_node, V2DI_type_node,
- NULL_TREE);
- tree int_ftype_v16qi_int_v16qi_int_int
- = build_function_type_list (integer_type_node,
- V16QI_type_node,
- integer_type_node,
- V16QI_type_node,
- integer_type_node,
- integer_type_node,
- NULL_TREE);
- tree v16qi_ftype_v16qi_int_v16qi_int_int
- = build_function_type_list (V16QI_type_node,
- V16QI_type_node,
- integer_type_node,
- V16QI_type_node,
- integer_type_node,
- integer_type_node,
- NULL_TREE);
- tree int_ftype_v16qi_v16qi_int
- = build_function_type_list (integer_type_node,
- V16QI_type_node,
- V16QI_type_node,
- integer_type_node,
- NULL_TREE);
-
- /* AVX builtins */
- tree V32QI_type_node = build_vector_type_for_mode (char_type_node,
- V32QImode);
- tree V8SI_type_node = build_vector_type_for_mode (intSI_type_node,
- V8SImode);
- tree V8SF_type_node = build_vector_type_for_mode (float_type_node,
- V8SFmode);
- tree V4DI_type_node = build_vector_type_for_mode (long_long_integer_type_node,
- V4DImode);
- tree V4DF_type_node = build_vector_type_for_mode (double_type_node,
- V4DFmode);
- tree V16HI_type_node = build_vector_type_for_mode (intHI_type_node,
- V16HImode);
- tree v8sf_ftype_v8sf
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node,
- NULL_TREE);
- tree v8si_ftype_v8sf
- = build_function_type_list (V8SI_type_node,
- V8SF_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8si
- = build_function_type_list (V8SF_type_node,
- V8SI_type_node,
- NULL_TREE);
- tree v4si_ftype_v4df
- = build_function_type_list (V4SI_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree v4df_ftype_v4si
- = build_function_type_list (V4DF_type_node,
- V4SI_type_node,
- NULL_TREE);
- tree v4df_ftype_v4sf
- = build_function_type_list (V4DF_type_node,
- V4SF_type_node,
- NULL_TREE);
- tree v4sf_ftype_v4df
- = build_function_type_list (V4SF_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8sf_v8sf
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node, V8SF_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df_v4df
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node, V4DF_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8sf_int
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node, integer_type_node,
- NULL_TREE);
- tree v4si_ftype_v8si_int
- = build_function_type_list (V4SI_type_node,
- V8SI_type_node, integer_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df_int
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node, integer_type_node,
- NULL_TREE);
- tree v4sf_ftype_v8sf_int
- = build_function_type_list (V4SF_type_node,
- V8SF_type_node, integer_type_node,
- NULL_TREE);
- tree v2df_ftype_v4df_int
- = build_function_type_list (V2DF_type_node,
- V4DF_type_node, integer_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8sf_v8sf_int
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node, V8SF_type_node,
- integer_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8sf_v8sf_v8sf
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node, V8SF_type_node,
- V8SF_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df_v4df_v4df
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node, V4DF_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree v8si_ftype_v8si_v8si_int
- = build_function_type_list (V8SI_type_node,
- V8SI_type_node, V8SI_type_node,
- integer_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df_v4df_int
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node, V4DF_type_node,
- integer_type_node,
- NULL_TREE);
- tree v8sf_ftype_pcfloat
- = build_function_type_list (V8SF_type_node,
- pcfloat_type_node,
- NULL_TREE);
- tree v4df_ftype_pcdouble
- = build_function_type_list (V4DF_type_node,
- pcdouble_type_node,
- NULL_TREE);
- tree pcv4sf_type_node
- = build_pointer_type (build_type_variant (V4SF_type_node, 1, 0));
- tree pcv2df_type_node
- = build_pointer_type (build_type_variant (V2DF_type_node, 1, 0));
- tree v8sf_ftype_pcv4sf
- = build_function_type_list (V8SF_type_node,
- pcv4sf_type_node,
- NULL_TREE);
- tree v4df_ftype_pcv2df
- = build_function_type_list (V4DF_type_node,
- pcv2df_type_node,
- NULL_TREE);
- tree v32qi_ftype_pcchar
- = build_function_type_list (V32QI_type_node,
- pcchar_type_node,
- NULL_TREE);
- tree void_ftype_pchar_v32qi
- = build_function_type_list (void_type_node,
- pchar_type_node, V32QI_type_node,
- NULL_TREE);
- tree v8si_ftype_v8si_v4si_int
- = build_function_type_list (V8SI_type_node,
- V8SI_type_node, V4SI_type_node,
- integer_type_node,
- NULL_TREE);
- tree pv4di_type_node = build_pointer_type (V4DI_type_node);
- tree void_ftype_pv4di_v4di
- = build_function_type_list (void_type_node,
- pv4di_type_node, V4DI_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8sf_v4sf_int
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node, V4SF_type_node,
- integer_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df_v2df_int
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node, V2DF_type_node,
- integer_type_node,
- NULL_TREE);
- tree void_ftype_pfloat_v8sf
- = build_function_type_list (void_type_node,
- pfloat_type_node, V8SF_type_node,
- NULL_TREE);
- tree void_ftype_pdouble_v4df
- = build_function_type_list (void_type_node,
- pdouble_type_node, V4DF_type_node,
- NULL_TREE);
- tree pv8sf_type_node = build_pointer_type (V8SF_type_node);
- tree pv4sf_type_node = build_pointer_type (V4SF_type_node);
- tree pv4df_type_node = build_pointer_type (V4DF_type_node);
- tree pv2df_type_node = build_pointer_type (V2DF_type_node);
- tree pcv8sf_type_node
- = build_pointer_type (build_type_variant (V8SF_type_node, 1, 0));
- tree pcv4df_type_node
- = build_pointer_type (build_type_variant (V4DF_type_node, 1, 0));
- tree v8sf_ftype_pcv8sf_v8sf
- = build_function_type_list (V8SF_type_node,
- pcv8sf_type_node, V8SF_type_node,
- NULL_TREE);
- tree v4df_ftype_pcv4df_v4df
- = build_function_type_list (V4DF_type_node,
- pcv4df_type_node, V4DF_type_node,
- NULL_TREE);
- tree v4sf_ftype_pcv4sf_v4sf
- = build_function_type_list (V4SF_type_node,
- pcv4sf_type_node, V4SF_type_node,
- NULL_TREE);
- tree v2df_ftype_pcv2df_v2df
- = build_function_type_list (V2DF_type_node,
- pcv2df_type_node, V2DF_type_node,
- NULL_TREE);
- tree void_ftype_pv8sf_v8sf_v8sf
- = build_function_type_list (void_type_node,
- pv8sf_type_node, V8SF_type_node,
- V8SF_type_node,
- NULL_TREE);
- tree void_ftype_pv4df_v4df_v4df
- = build_function_type_list (void_type_node,
- pv4df_type_node, V4DF_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree void_ftype_pv4sf_v4sf_v4sf
- = build_function_type_list (void_type_node,
- pv4sf_type_node, V4SF_type_node,
- V4SF_type_node,
- NULL_TREE);
- tree void_ftype_pv2df_v2df_v2df
- = build_function_type_list (void_type_node,
- pv2df_type_node, V2DF_type_node,
- V2DF_type_node,
- NULL_TREE);
- tree v4df_ftype_v2df
- = build_function_type_list (V4DF_type_node,
- V2DF_type_node,
- NULL_TREE);
- tree v8sf_ftype_v4sf
- = build_function_type_list (V8SF_type_node,
- V4SF_type_node,
- NULL_TREE);
- tree v8si_ftype_v4si
- = build_function_type_list (V8SI_type_node,
- V4SI_type_node,
- NULL_TREE);
- tree v2df_ftype_v4df
- = build_function_type_list (V2DF_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree v4sf_ftype_v8sf
- = build_function_type_list (V4SF_type_node,
- V8SF_type_node,
- NULL_TREE);
- tree v4si_ftype_v8si
- = build_function_type_list (V4SI_type_node,
- V8SI_type_node,
- NULL_TREE);
- tree int_ftype_v4df
- = build_function_type_list (integer_type_node,
- V4DF_type_node,
- NULL_TREE);
- tree int_ftype_v8sf
- = build_function_type_list (integer_type_node,
- V8SF_type_node,
- NULL_TREE);
- tree int_ftype_v8sf_v8sf
- = build_function_type_list (integer_type_node,
- V8SF_type_node, V8SF_type_node,
- NULL_TREE);
- tree int_ftype_v4di_v4di
- = build_function_type_list (integer_type_node,
- V4DI_type_node, V4DI_type_node,
- NULL_TREE);
- tree int_ftype_v4df_v4df
- = build_function_type_list (integer_type_node,
- V4DF_type_node, V4DF_type_node,
- NULL_TREE);
- tree v8sf_ftype_v8sf_v8si
- = build_function_type_list (V8SF_type_node,
- V8SF_type_node, V8SI_type_node,
- NULL_TREE);
- tree v4df_ftype_v4df_v4di
- = build_function_type_list (V4DF_type_node,
- V4DF_type_node, V4DI_type_node,
- NULL_TREE);
- tree v4sf_ftype_v4sf_v4si
- = build_function_type_list (V4SF_type_node,
- V4SF_type_node, V4SI_type_node, NULL_TREE);
- tree v2df_ftype_v2df_v2di
- = build_function_type_list (V2DF_type_node,
- V2DF_type_node, V2DI_type_node, NULL_TREE);
-
- /* XOP instructions */
- tree v2di_ftype_v2di_v2di_v2di
- = build_function_type_list (V2DI_type_node,
- V2DI_type_node,
- V2DI_type_node,
- V2DI_type_node,
- NULL_TREE);
-
- tree v4di_ftype_v4di_v4di_v4di
- = build_function_type_list (V4DI_type_node,
- V4DI_type_node,
- V4DI_type_node,
- V4DI_type_node,
- NULL_TREE);
-
- tree v4si_ftype_v4si_v4si_v4si
- = build_function_type_list (V4SI_type_node,
- V4SI_type_node,
- V4SI_type_node,
- V4SI_type_node,
- NULL_TREE);
-
- tree v8si_ftype_v8si_v8si_v8si
- = build_function_type_list (V8SI_type_node,
- V8SI_type_node,
- V8SI_type_node,
- V8SI_type_node,
- NULL_TREE);
-
- tree v32qi_ftype_v32qi_v32qi_v32qi
- = build_function_type_list (V32QI_type_node,
- V32QI_type_node,
- V32QI_type_node,
- V32QI_type_node,
- NULL_TREE);
-
- tree v4si_ftype_v4si_v4si_v2di
- = build_function_type_list (V4SI_type_node,
- V4SI_type_node,
- V4SI_type_node,
- V2DI_type_node,
- NULL_TREE);
-
- tree v8hi_ftype_v8hi_v8hi_v8hi
- = build_function_type_list (V8HI_type_node,
- V8HI_type_node,
- V8HI_type_node,
- V8HI_type_node,
- NULL_TREE);
-
- tree v16hi_ftype_v16hi_v16hi_v16hi
- = build_function_type_list (V16HI_type_node,
- V16HI_type_node,
- V16HI_type_node,
- V16HI_type_node,
- NULL_TREE);
-
- tree v8hi_ftype_v8hi_v8hi_v4si
- = build_function_type_list (V8HI_type_node,
- V8HI_type_node,
- V8HI_type_node,
- V4SI_type_node,
- NULL_TREE);
-
- tree v2di_ftype_v2di_si
- = build_function_type_list (V2DI_type_node,
- V2DI_type_node,
- integer_type_node,
- NULL_TREE);
-
- tree v4si_ftype_v4si_si
- = build_function_type_list (V4SI_type_node,
- V4SI_type_node,
- integer_type_node,
- NULL_TREE);
-
- tree v8hi_ftype_v8hi_si
- = build_function_type_list (V8HI_type_node,
- V8HI_type_node,
- integer_type_node,
- NULL_TREE);
-
- tree v16qi_ftype_v16qi_si
- = build_function_type_list (V16QI_type_node,
- V16QI_type_node,
- integer_type_node,
- NULL_TREE);
-
- tree v2di_ftype_v2di
- = build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE);
-
- tree v16qi_ftype_v8hi_v8hi
- = build_function_type_list (V16QI_type_node,
- V8HI_type_node, V8HI_type_node,
- NULL_TREE);
- tree v8hi_ftype_v4si_v4si
- = build_function_type_list (V8HI_type_node,
- V4SI_type_node, V4SI_type_node,
- NULL_TREE);
- tree v8hi_ftype_v16qi_v16qi
- = build_function_type_list (V8HI_type_node,
- V16QI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v4hi_ftype_v8qi_v8qi
- = build_function_type_list (V4HI_type_node,
- V8QI_type_node, V8QI_type_node,
- NULL_TREE);
- tree unsigned_ftype_unsigned_uchar
- = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- unsigned_char_type_node,
- NULL_TREE);
- tree unsigned_ftype_unsigned_ushort
- = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- short_unsigned_type_node,
- NULL_TREE);
- tree unsigned_ftype_unsigned_unsigned
- = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
- tree uint64_ftype_uint64_uint64
- = build_function_type_list (long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- NULL_TREE);
- tree float_ftype_float
- = build_function_type_list (float_type_node,
- float_type_node,
- NULL_TREE);
-
- /* Integer intrinsics. */
- tree uint64_ftype_void
- = build_function_type (long_long_unsigned_type_node,
- void_list_node);
- tree int_ftype_int
- = build_function_type_list (integer_type_node,
- integer_type_node, NULL_TREE);
- tree int64_ftype_int64
- = build_function_type_list (long_long_integer_type_node,
- long_long_integer_type_node,
- NULL_TREE);
- tree uint64_ftype_int
- = build_function_type_list (long_long_unsigned_type_node,
- integer_type_node, NULL_TREE);
- tree punsigned_type_node = build_pointer_type (unsigned_type_node);
- tree uint64_ftype_punsigned
- = build_function_type_list (long_long_unsigned_type_node,
- punsigned_type_node, NULL_TREE);
- tree ushort_ftype_ushort_int
- = build_function_type_list (short_unsigned_type_node,
- short_unsigned_type_node,
- integer_type_node,
- NULL_TREE);
- tree uchar_ftype_uchar_int
- = build_function_type_list (unsigned_char_type_node,
- unsigned_char_type_node,
- integer_type_node,
- NULL_TREE);
-
- /* LWP instructions. */
-
- tree void_ftype_ushort_unsigned_ushort
- = build_function_type_list (void_type_node,
- short_unsigned_type_node,
- unsigned_type_node,
- short_unsigned_type_node,
- NULL_TREE);
-
- tree void_ftype_unsigned_unsigned_unsigned
- = build_function_type_list (void_type_node,
- unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
-
- tree void_ftype_uint64_unsigned_unsigned
- = build_function_type_list (void_type_node,
- long_long_unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
-
- tree uchar_ftype_ushort_unsigned_ushort
- = build_function_type_list (unsigned_char_type_node,
- short_unsigned_type_node,
- unsigned_type_node,
- short_unsigned_type_node,
- NULL_TREE);
-
- tree uchar_ftype_unsigned_unsigned_unsigned
- = build_function_type_list (unsigned_char_type_node,
- unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
-
- tree uchar_ftype_uint64_unsigned_unsigned
- = build_function_type_list (unsigned_char_type_node,
- long_long_unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
-
- tree ftype;
-
/* Add all special builtins with variable number of operands. */
for (i = 0, d = bdesc_special_args;
i < ARRAY_SIZE (bdesc_special_args);
i++, d++)
{
- tree type;
-
if (d->name == 0)
continue;
- switch ((enum ix86_special_builtin_type) d->flag)
- {
- case VOID_FTYPE_VOID:
- type = void_ftype_void;
- break;
- case UINT64_FTYPE_VOID:
- type = uint64_ftype_void;
- break;
- case UINT64_FTYPE_PUNSIGNED:
- type = uint64_ftype_punsigned;
- break;
- case V32QI_FTYPE_PCCHAR:
- type = v32qi_ftype_pcchar;
- break;
- case V16QI_FTYPE_PCCHAR:
- type = v16qi_ftype_pcchar;
- break;
- case V8SF_FTYPE_PCV4SF:
- type = v8sf_ftype_pcv4sf;
- break;
- case V8SF_FTYPE_PCFLOAT:
- type = v8sf_ftype_pcfloat;
- break;
- case V4DF_FTYPE_PCV2DF:
- type = v4df_ftype_pcv2df;
- break;
- case V4DF_FTYPE_PCDOUBLE:
- type = v4df_ftype_pcdouble;
- break;
- case V4SF_FTYPE_PCFLOAT:
- type = v4sf_ftype_pcfloat;
- break;
- case V2DI_FTYPE_PV2DI:
- type = v2di_ftype_pv2di;
- break;
- case V2DF_FTYPE_PCDOUBLE:
- type = v2df_ftype_pcdouble;
- break;
- case V8SF_FTYPE_PCV8SF_V8SF:
- type = v8sf_ftype_pcv8sf_v8sf;
- break;
- case V4DF_FTYPE_PCV4DF_V4DF:
- type = v4df_ftype_pcv4df_v4df;
- break;
- case V4SF_FTYPE_V4SF_PCV2SF:
- type = v4sf_ftype_v4sf_pcv2sf;
- break;
- case V4SF_FTYPE_PCV4SF_V4SF:
- type = v4sf_ftype_pcv4sf_v4sf;
- break;
- case V2DF_FTYPE_V2DF_PCDOUBLE:
- type = v2df_ftype_v2df_pcdouble;
- break;
- case V2DF_FTYPE_PCV2DF_V2DF:
- type = v2df_ftype_pcv2df_v2df;
- break;
- case VOID_FTYPE_PV2SF_V4SF:
- type = void_ftype_pv2sf_v4sf;
- break;
- case VOID_FTYPE_PV4DI_V4DI:
- type = void_ftype_pv4di_v4di;
- break;
- case VOID_FTYPE_PV2DI_V2DI:
- type = void_ftype_pv2di_v2di;
- break;
- case VOID_FTYPE_PCHAR_V32QI:
- type = void_ftype_pchar_v32qi;
- break;
- case VOID_FTYPE_PCHAR_V16QI:
- type = void_ftype_pchar_v16qi;
- break;
- case VOID_FTYPE_PFLOAT_V8SF:
- type = void_ftype_pfloat_v8sf;
- break;
- case VOID_FTYPE_PFLOAT_V4SF:
- type = void_ftype_pfloat_v4sf;
- break;
- case VOID_FTYPE_PDOUBLE_V4DF:
- type = void_ftype_pdouble_v4df;
- break;
- case VOID_FTYPE_PDOUBLE_V2DF:
- type = void_ftype_pdouble_v2df;
- break;
- case VOID_FTYPE_PDI_DI:
- type = void_ftype_pdi_di;
- break;
- case VOID_FTYPE_PINT_INT:
- type = void_ftype_pint_int;
- break;
- case VOID_FTYPE_PV8SF_V8SF_V8SF:
- type = void_ftype_pv8sf_v8sf_v8sf;
- break;
- case VOID_FTYPE_PV4DF_V4DF_V4DF:
- type = void_ftype_pv4df_v4df_v4df;
- break;
- case VOID_FTYPE_PV4SF_V4SF_V4SF:
- type = void_ftype_pv4sf_v4sf_v4sf;
- break;
- case VOID_FTYPE_PV2DF_V2DF_V2DF:
- type = void_ftype_pv2df_v2df_v2df;
- break;
- case VOID_FTYPE_USHORT_UINT_USHORT:
- type = void_ftype_ushort_unsigned_ushort;
- break;
- case VOID_FTYPE_UINT_UINT_UINT:
- type = void_ftype_unsigned_unsigned_unsigned;
- break;
- case VOID_FTYPE_UINT64_UINT_UINT:
- type = void_ftype_uint64_unsigned_unsigned;
- break;
- case UCHAR_FTYPE_USHORT_UINT_USHORT:
- type = uchar_ftype_ushort_unsigned_ushort;
- break;
- case UCHAR_FTYPE_UINT_UINT_UINT:
- type = uchar_ftype_unsigned_unsigned_unsigned;
- break;
- case UCHAR_FTYPE_UINT64_UINT_UINT:
- type = uchar_ftype_uint64_unsigned_unsigned;
- break;
-
- default:
- gcc_unreachable ();
- }
-
- def_builtin (d->mask, d->name, type, d->code);
+ ftype = (enum ix86_builtin_func_type) d->flag;
+ def_builtin (d->mask, d->name, ftype, d->code);
}
/* Add all builtins with variable number of operands. */
@@ -23443,459 +22385,11 @@ ix86_init_mmx_sse_builtins (void)
i < ARRAY_SIZE (bdesc_args);
i++, d++)
{
- tree type;
-
if (d->name == 0)
continue;
- switch ((enum ix86_builtin_type) d->flag)
- {
- case FLOAT_FTYPE_FLOAT:
- type = float_ftype_float;
- break;
- case INT_FTYPE_V8SF_V8SF_PTEST:
- type = int_ftype_v8sf_v8sf;
- break;
- case INT_FTYPE_V4DI_V4DI_PTEST:
- type = int_ftype_v4di_v4di;
- break;
- case INT_FTYPE_V4DF_V4DF_PTEST:
- type = int_ftype_v4df_v4df;
- break;
- case INT_FTYPE_V4SF_V4SF_PTEST:
- type = int_ftype_v4sf_v4sf;
- break;
- case INT_FTYPE_V2DI_V2DI_PTEST:
- type = int_ftype_v2di_v2di;
- break;
- case INT_FTYPE_V2DF_V2DF_PTEST:
- type = int_ftype_v2df_v2df;
- break;
- case INT_FTYPE_INT:
- type = int_ftype_int;
- break;
- case UINT64_FTYPE_INT:
- type = uint64_ftype_int;
- break;
- case INT64_FTYPE_INT64:
- type = int64_ftype_int64;
- break;
- case INT64_FTYPE_V4SF:
- type = int64_ftype_v4sf;
- break;
- case INT64_FTYPE_V2DF:
- type = int64_ftype_v2df;
- break;
- case INT_FTYPE_V16QI:
- type = int_ftype_v16qi;
- break;
- case INT_FTYPE_V8QI:
- type = int_ftype_v8qi;
- break;
- case INT_FTYPE_V8SF:
- type = int_ftype_v8sf;
- break;
- case INT_FTYPE_V4DF:
- type = int_ftype_v4df;
- break;
- case INT_FTYPE_V4SF:
- type = int_ftype_v4sf;
- break;
- case INT_FTYPE_V2DF:
- type = int_ftype_v2df;
- break;
- case V16QI_FTYPE_V16QI:
- type = v16qi_ftype_v16qi;
- break;
- case V8SI_FTYPE_V8SF:
- type = v8si_ftype_v8sf;
- break;
- case V8SI_FTYPE_V4SI:
- type = v8si_ftype_v4si;
- break;
- case V8HI_FTYPE_V8HI:
- type = v8hi_ftype_v8hi;
- break;
- case V8HI_FTYPE_V16QI:
- type = v8hi_ftype_v16qi;
- break;
- case V8QI_FTYPE_V8QI:
- type = v8qi_ftype_v8qi;
- break;
- case V8SF_FTYPE_V8SF:
- type = v8sf_ftype_v8sf;
- break;
- case V8SF_FTYPE_V8SI:
- type = v8sf_ftype_v8si;
- break;
- case V8SF_FTYPE_V4SF:
- type = v8sf_ftype_v4sf;
- break;
- case V4SI_FTYPE_V4DF:
- type = v4si_ftype_v4df;
- break;
- case V4SI_FTYPE_V4SI:
- type = v4si_ftype_v4si;
- break;
- case V4SI_FTYPE_V16QI:
- type = v4si_ftype_v16qi;
- break;
- case V4SI_FTYPE_V8SI:
- type = v4si_ftype_v8si;
- break;
- case V4SI_FTYPE_V8HI:
- type = v4si_ftype_v8hi;
- break;
- case V4SI_FTYPE_V4SF:
- type = v4si_ftype_v4sf;
- break;
- case V4SI_FTYPE_V2DF:
- type = v4si_ftype_v2df;
- break;
- case V4HI_FTYPE_V4HI:
- type = v4hi_ftype_v4hi;
- break;
- case V4DF_FTYPE_V4DF:
- type = v4df_ftype_v4df;
- break;
- case V4DF_FTYPE_V4SI:
- type = v4df_ftype_v4si;
- break;
- case V4DF_FTYPE_V4SF:
- type = v4df_ftype_v4sf;
- break;
- case V4DF_FTYPE_V2DF:
- type = v4df_ftype_v2df;
- break;
- case V4SF_FTYPE_V4SF:
- case V4SF_FTYPE_V4SF_VEC_MERGE:
- type = v4sf_ftype_v4sf;
- break;
- case V4SF_FTYPE_V8SF:
- type = v4sf_ftype_v8sf;
- break;
- case V4SF_FTYPE_V4SI:
- type = v4sf_ftype_v4si;
- break;
- case V4SF_FTYPE_V4DF:
- type = v4sf_ftype_v4df;
- break;
- case V4SF_FTYPE_V2DF:
- type = v4sf_ftype_v2df;
- break;
- case V2DI_FTYPE_V2DI:
- type = v2di_ftype_v2di;
- break;
- case V2DI_FTYPE_V16QI:
- type = v2di_ftype_v16qi;
- break;
- case V2DI_FTYPE_V8HI:
- type = v2di_ftype_v8hi;
- break;
- case V2DI_FTYPE_V4SI:
- type = v2di_ftype_v4si;
- break;
- case V2SI_FTYPE_V2SI:
- type = v2si_ftype_v2si;
- break;
- case V2SI_FTYPE_V4SF:
- type = v2si_ftype_v4sf;
- break;
- case V2SI_FTYPE_V2DF:
- type = v2si_ftype_v2df;
- break;
- case V2SI_FTYPE_V2SF:
- type = v2si_ftype_v2sf;
- break;
- case V2DF_FTYPE_V4DF:
- type = v2df_ftype_v4df;
- break;
- case V2DF_FTYPE_V4SF:
- type = v2df_ftype_v4sf;
- break;
- case V2DF_FTYPE_V2DF:
- case V2DF_FTYPE_V2DF_VEC_MERGE:
- type = v2df_ftype_v2df;
- break;
- case V2DF_FTYPE_V2SI:
- type = v2df_ftype_v2si;
- break;
- case V2DF_FTYPE_V4SI:
- type = v2df_ftype_v4si;
- break;
- case V2SF_FTYPE_V2SF:
- type = v2sf_ftype_v2sf;
- break;
- case V2SF_FTYPE_V2SI:
- type = v2sf_ftype_v2si;
- break;
- case V16QI_FTYPE_V16QI_V16QI:
- type = v16qi_ftype_v16qi_v16qi;
- break;
- case V16QI_FTYPE_V8HI_V8HI:
- type = v16qi_ftype_v8hi_v8hi;
- break;
- case V8QI_FTYPE_V8QI_V8QI:
- type = v8qi_ftype_v8qi_v8qi;
- break;
- case V8QI_FTYPE_V4HI_V4HI:
- type = v8qi_ftype_v4hi_v4hi;
- break;
- case V8HI_FTYPE_V8HI_V8HI:
- case V8HI_FTYPE_V8HI_V8HI_COUNT:
- type = v8hi_ftype_v8hi_v8hi;
- break;
- case V8HI_FTYPE_V16QI_V16QI:
- type = v8hi_ftype_v16qi_v16qi;
- break;
- case V8HI_FTYPE_V4SI_V4SI:
- type = v8hi_ftype_v4si_v4si;
- break;
- case V8HI_FTYPE_V8HI_SI_COUNT:
- type = v8hi_ftype_v8hi_int;
- break;
- case V8SF_FTYPE_V8SF_V8SF:
- type = v8sf_ftype_v8sf_v8sf;
- break;
- case V8SF_FTYPE_V8SF_V8SI:
- type = v8sf_ftype_v8sf_v8si;
- break;
- case V4SI_FTYPE_V4SI_V4SI:
- case V4SI_FTYPE_V4SI_V4SI_COUNT:
- type = v4si_ftype_v4si_v4si;
- break;
- case V4SI_FTYPE_V8HI_V8HI:
- type = v4si_ftype_v8hi_v8hi;
- break;
- case V4SI_FTYPE_V4SF_V4SF:
- type = v4si_ftype_v4sf_v4sf;
- break;
- case V4SI_FTYPE_V2DF_V2DF:
- type = v4si_ftype_v2df_v2df;
- break;
- case V4SI_FTYPE_V4SI_SI_COUNT:
- type = v4si_ftype_v4si_int;
- break;
- case V4HI_FTYPE_V4HI_V4HI:
- case V4HI_FTYPE_V4HI_V4HI_COUNT:
- type = v4hi_ftype_v4hi_v4hi;
- break;
- case V4HI_FTYPE_V8QI_V8QI:
- type = v4hi_ftype_v8qi_v8qi;
- break;
- case V4HI_FTYPE_V2SI_V2SI:
- type = v4hi_ftype_v2si_v2si;
- break;
- case V4HI_FTYPE_V4HI_SI_COUNT:
- type = v4hi_ftype_v4hi_int;
- break;
- case V4DF_FTYPE_V4DF_V4DF:
- type = v4df_ftype_v4df_v4df;
- break;
- case V4DF_FTYPE_V4DF_V4DI:
- type = v4df_ftype_v4df_v4di;
- break;
- case V4SF_FTYPE_V4SF_V4SF:
- case V4SF_FTYPE_V4SF_V4SF_SWAP:
- type = v4sf_ftype_v4sf_v4sf;
- break;
- case V4SF_FTYPE_V4SF_V4SI:
- type = v4sf_ftype_v4sf_v4si;
- break;
- case V4SF_FTYPE_V4SF_V2SI:
- type = v4sf_ftype_v4sf_v2si;
- break;
- case V4SF_FTYPE_V4SF_V2DF:
- type = v4sf_ftype_v4sf_v2df;
- break;
- case V4SF_FTYPE_V4SF_DI:
- type = v4sf_ftype_v4sf_int64;
- break;
- case V4SF_FTYPE_V4SF_SI:
- type = v4sf_ftype_v4sf_int;
- break;
- case V2DI_FTYPE_V2DI_V2DI:
- case V2DI_FTYPE_V2DI_V2DI_COUNT:
- type = v2di_ftype_v2di_v2di;
- break;
- case V2DI_FTYPE_V16QI_V16QI:
- type = v2di_ftype_v16qi_v16qi;
- break;
- case V2DI_FTYPE_V4SI_V4SI:
- type = v2di_ftype_v4si_v4si;
- break;
- case V2DI_FTYPE_V2DI_V16QI:
- type = v2di_ftype_v2di_v16qi;
- break;
- case V2DI_FTYPE_V2DF_V2DF:
- type = v2di_ftype_v2df_v2df;
- break;
- case V2DI_FTYPE_V2DI_SI_COUNT:
- type = v2di_ftype_v2di_int;
- break;
- case V2SI_FTYPE_V2SI_V2SI:
- case V2SI_FTYPE_V2SI_V2SI_COUNT:
- type = v2si_ftype_v2si_v2si;
- break;
- case V2SI_FTYPE_V4HI_V4HI:
- type = v2si_ftype_v4hi_v4hi;
- break;
- case V2SI_FTYPE_V2SF_V2SF:
- type = v2si_ftype_v2sf_v2sf;
- break;
- case V2SI_FTYPE_V2SI_SI_COUNT:
- type = v2si_ftype_v2si_int;
- break;
- case V2DF_FTYPE_V2DF_V2DF:
- case V2DF_FTYPE_V2DF_V2DF_SWAP:
- type = v2df_ftype_v2df_v2df;
- break;
- case V2DF_FTYPE_V2DF_V4SF:
- type = v2df_ftype_v2df_v4sf;
- break;
- case V2DF_FTYPE_V2DF_V2DI:
- type = v2df_ftype_v2df_v2di;
- break;
- case V2DF_FTYPE_V2DF_DI:
- type = v2df_ftype_v2df_int64;
- break;
- case V2DF_FTYPE_V2DF_SI:
- type = v2df_ftype_v2df_int;
- break;
- case V2SF_FTYPE_V2SF_V2SF:
- type = v2sf_ftype_v2sf_v2sf;
- break;
- case V1DI_FTYPE_V1DI_V1DI:
- case V1DI_FTYPE_V1DI_V1DI_COUNT:
- type = v1di_ftype_v1di_v1di;
- break;
- case V1DI_FTYPE_V8QI_V8QI:
- type = v1di_ftype_v8qi_v8qi;
- break;
- case V1DI_FTYPE_V2SI_V2SI:
- type = v1di_ftype_v2si_v2si;
- break;
- case V1DI_FTYPE_V1DI_SI_COUNT:
- type = v1di_ftype_v1di_int;
- break;
- case UINT64_FTYPE_UINT64_UINT64:
- type = uint64_ftype_uint64_uint64;
- break;
- case UINT_FTYPE_UINT_UINT:
- type = unsigned_ftype_unsigned_unsigned;
- break;
- case UINT_FTYPE_UINT_USHORT:
- type = unsigned_ftype_unsigned_ushort;
- break;
- case UINT_FTYPE_UINT_UCHAR:
- type = unsigned_ftype_unsigned_uchar;
- break;
- case UINT16_FTYPE_UINT16_INT:
- type = ushort_ftype_ushort_int;
- break;
- case UINT8_FTYPE_UINT8_INT:
- type = uchar_ftype_uchar_int;
- break;
- case V8HI_FTYPE_V8HI_INT:
- type = v8hi_ftype_v8hi_int;
- break;
- case V8SF_FTYPE_V8SF_INT:
- type = v8sf_ftype_v8sf_int;
- break;
- case V4SI_FTYPE_V4SI_INT:
- type = v4si_ftype_v4si_int;
- break;
- case V4SI_FTYPE_V8SI_INT:
- type = v4si_ftype_v8si_int;
- break;
- case V4HI_FTYPE_V4HI_INT:
- type = v4hi_ftype_v4hi_int;
- break;
- case V4DF_FTYPE_V4DF_INT:
- type = v4df_ftype_v4df_int;
- break;
- case V4SF_FTYPE_V4SF_INT:
- type = v4sf_ftype_v4sf_int;
- break;
- case V4SF_FTYPE_V8SF_INT:
- type = v4sf_ftype_v8sf_int;
- break;
- case V2DI_FTYPE_V2DI_INT:
- case V2DI2TI_FTYPE_V2DI_INT:
- type = v2di_ftype_v2di_int;
- break;
- case V2DF_FTYPE_V2DF_INT:
- type = v2df_ftype_v2df_int;
- break;
- case V2DF_FTYPE_V4DF_INT:
- type = v2df_ftype_v4df_int;
- break;
- case V16QI_FTYPE_V16QI_V16QI_V16QI:
- type = v16qi_ftype_v16qi_v16qi_v16qi;
- break;
- case V8SF_FTYPE_V8SF_V8SF_V8SF:
- type = v8sf_ftype_v8sf_v8sf_v8sf;
- break;
- case V4DF_FTYPE_V4DF_V4DF_V4DF:
- type = v4df_ftype_v4df_v4df_v4df;
- break;
- case V4SF_FTYPE_V4SF_V4SF_V4SF:
- type = v4sf_ftype_v4sf_v4sf_v4sf;
- break;
- case V2DF_FTYPE_V2DF_V2DF_V2DF:
- type = v2df_ftype_v2df_v2df_v2df;
- break;
- case V16QI_FTYPE_V16QI_V16QI_INT:
- type = v16qi_ftype_v16qi_v16qi_int;
- break;
- case V8SI_FTYPE_V8SI_V8SI_INT:
- type = v8si_ftype_v8si_v8si_int;
- break;
- case V8SI_FTYPE_V8SI_V4SI_INT:
- type = v8si_ftype_v8si_v4si_int;
- break;
- case V8HI_FTYPE_V8HI_V8HI_INT:
- type = v8hi_ftype_v8hi_v8hi_int;
- break;
- case V8SF_FTYPE_V8SF_V8SF_INT:
- type = v8sf_ftype_v8sf_v8sf_int;
- break;
- case V8SF_FTYPE_V8SF_V4SF_INT:
- type = v8sf_ftype_v8sf_v4sf_int;
- break;
- case V4SI_FTYPE_V4SI_V4SI_INT:
- type = v4si_ftype_v4si_v4si_int;
- break;
- case V4DF_FTYPE_V4DF_V4DF_INT:
- type = v4df_ftype_v4df_v4df_int;
- break;
- case V4DF_FTYPE_V4DF_V2DF_INT:
- type = v4df_ftype_v4df_v2df_int;
- break;
- case V4SF_FTYPE_V4SF_V4SF_INT:
- type = v4sf_ftype_v4sf_v4sf_int;
- break;
- case V2DI_FTYPE_V2DI_V2DI_INT:
- case V2DI2TI_FTYPE_V2DI_V2DI_INT:
- type = v2di_ftype_v2di_v2di_int;
- break;
- case V2DF_FTYPE_V2DF_V2DF_INT:
- type = v2df_ftype_v2df_v2df_int;
- break;
- case V2DI_FTYPE_V2DI_UINT_UINT:
- type = v2di_ftype_v2di_unsigned_unsigned;
- break;
- case V2DI_FTYPE_V2DI_V2DI_UINT_UINT:
- type = v2di_ftype_v2di_v2di_unsigned_unsigned;
- break;
- case V1DI2DI_FTYPE_V1DI_V1DI_INT:
- type = v1di_ftype_v1di_v1di_int;
- break;
- default:
- gcc_unreachable ();
- }
-
- def_builtin_const (d->mask, d->name, type, d->code);
+ ftype = (enum ix86_builtin_func_type) d->flag;
+ def_builtin_const (d->mask, d->name, ftype, d->code);
}
/* pcmpestr[im] insns. */
@@ -23904,9 +22398,9 @@ ix86_init_mmx_sse_builtins (void)
i++, d++)
{
if (d->code == IX86_BUILTIN_PCMPESTRM128)
- ftype = v16qi_ftype_v16qi_int_v16qi_int_int;
+ ftype = V16QI_FTYPE_V16QI_INT_V16QI_INT_INT;
else
- ftype = int_ftype_v16qi_int_v16qi_int_int;
+ ftype = INT_FTYPE_V16QI_INT_V16QI_INT_INT;
def_builtin_const (d->mask, d->name, ftype, d->code);
}
@@ -23916,199 +22410,135 @@ ix86_init_mmx_sse_builtins (void)
i++, d++)
{
if (d->code == IX86_BUILTIN_PCMPISTRM128)
- ftype = v16qi_ftype_v16qi_v16qi_int;
+ ftype = V16QI_FTYPE_V16QI_V16QI_INT;
else
- ftype = int_ftype_v16qi_v16qi_int;
+ ftype = INT_FTYPE_V16QI_V16QI_INT;
def_builtin_const (d->mask, d->name, ftype, d->code);
}
/* comi/ucomi insns. */
for (i = 0, d = bdesc_comi; i < ARRAY_SIZE (bdesc_comi); i++, d++)
- if (d->mask == OPTION_MASK_ISA_SSE2)
- def_builtin_const (d->mask, d->name, int_ftype_v2df_v2df, d->code);
- else
- def_builtin_const (d->mask, d->name, int_ftype_v4sf_v4sf, d->code);
+ {
+ if (d->mask == OPTION_MASK_ISA_SSE2)
+ ftype = INT_FTYPE_V2DF_V2DF;
+ else
+ ftype = INT_FTYPE_V4SF_V4SF;
+ def_builtin_const (d->mask, d->name, ftype, d->code);
+ }
/* SSE */
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_ldmxcsr", void_ftype_unsigned, IX86_BUILTIN_LDMXCSR);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_stmxcsr", unsigned_ftype_void, IX86_BUILTIN_STMXCSR);
+ def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_ldmxcsr",
+ VOID_FTYPE_UNSIGNED, IX86_BUILTIN_LDMXCSR);
+ def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_stmxcsr",
+ UNSIGNED_FTYPE_VOID, IX86_BUILTIN_STMXCSR);
/* SSE or 3DNow!A */
- def_builtin (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_maskmovq", void_ftype_v8qi_v8qi_pchar, IX86_BUILTIN_MASKMOVQ);
+ def_builtin (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A,
+ "__builtin_ia32_maskmovq", VOID_FTYPE_V8QI_V8QI_PCHAR,
+ IX86_BUILTIN_MASKMOVQ);
/* SSE2 */
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_maskmovdqu", void_ftype_v16qi_v16qi_pchar, IX86_BUILTIN_MASKMOVDQU);
+ def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_maskmovdqu",
+ VOID_FTYPE_V16QI_V16QI_PCHAR, IX86_BUILTIN_MASKMOVDQU);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_clflush", void_ftype_pcvoid, IX86_BUILTIN_CLFLUSH);
- x86_mfence = def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_mfence", void_ftype_void, IX86_BUILTIN_MFENCE);
+ def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_clflush",
+ VOID_FTYPE_PCVOID, IX86_BUILTIN_CLFLUSH);
+ x86_mfence = def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_mfence",
+ VOID_FTYPE_VOID, IX86_BUILTIN_MFENCE);
/* SSE3. */
- def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_monitor", void_ftype_pcvoid_unsigned_unsigned, IX86_BUILTIN_MONITOR);
- def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_mwait", void_ftype_unsigned_unsigned, IX86_BUILTIN_MWAIT);
+ def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_monitor",
+ VOID_FTYPE_PCVOID_UNSIGNED_UNSIGNED, IX86_BUILTIN_MONITOR);
+ def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_mwait",
+ VOID_FTYPE_UNSIGNED_UNSIGNED, IX86_BUILTIN_MWAIT);
/* AES */
- def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesenc128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESENC128);
- def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesenclast128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESENCLAST128);
- def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesdec128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESDEC128);
- def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesdeclast128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESDECLAST128);
- def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesimc128", v2di_ftype_v2di, IX86_BUILTIN_AESIMC128);
- def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aeskeygenassist128", v2di_ftype_v2di_int, IX86_BUILTIN_AESKEYGENASSIST128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesenc128",
+ V2DI_FTYPE_V2DI_V2DI, IX86_BUILTIN_AESENC128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesenclast128",
+ V2DI_FTYPE_V2DI_V2DI, IX86_BUILTIN_AESENCLAST128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesdec128",
+ V2DI_FTYPE_V2DI_V2DI, IX86_BUILTIN_AESDEC128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesdeclast128",
+ V2DI_FTYPE_V2DI_V2DI, IX86_BUILTIN_AESDECLAST128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesimc128",
+ V2DI_FTYPE_V2DI, IX86_BUILTIN_AESIMC128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aeskeygenassist128",
+ V2DI_FTYPE_V2DI_INT, IX86_BUILTIN_AESKEYGENASSIST128);
/* PCLMUL */
- def_builtin_const (OPTION_MASK_ISA_PCLMUL, "__builtin_ia32_pclmulqdq128", v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PCLMULQDQ128);
+ def_builtin_const (OPTION_MASK_ISA_PCLMUL, "__builtin_ia32_pclmulqdq128",
+ V2DI_FTYPE_V2DI_V2DI_INT, IX86_BUILTIN_PCLMULQDQ128);
/* AVX */
- def_builtin (OPTION_MASK_ISA_AVX, "__builtin_ia32_vzeroupper", void_ftype_void,
- TARGET_64BIT ? IX86_BUILTIN_VZEROUPPER_REX64 : IX86_BUILTIN_VZEROUPPER);
-
- /* Access to the vec_init patterns. */
- ftype = build_function_type_list (V2SI_type_node, integer_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v2si", ftype, IX86_BUILTIN_VEC_INIT_V2SI);
-
- ftype = build_function_type_list (V4HI_type_node, short_integer_type_node,
- short_integer_type_node,
- short_integer_type_node,
- short_integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v4hi", ftype, IX86_BUILTIN_VEC_INIT_V4HI);
-
- ftype = build_function_type_list (V8QI_type_node, char_type_node,
- char_type_node, char_type_node,
- char_type_node, char_type_node,
- char_type_node, char_type_node,
- char_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v8qi", ftype, IX86_BUILTIN_VEC_INIT_V8QI);
+ def_builtin (OPTION_MASK_ISA_AVX, "__builtin_ia32_vzeroupper",
+ VOID_FTYPE_VOID,
+ (TARGET_64BIT ? IX86_BUILTIN_VZEROUPPER_REX64
+ : IX86_BUILTIN_VZEROUPPER));
- /* Access to the vec_extract patterns. */
- ftype = build_function_type_list (double_type_node, V2DF_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v2df", ftype, IX86_BUILTIN_VEC_EXT_V2DF);
+ /* MMX access to the vec_init patterns. */
+ def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v2si",
+ V2SI_FTYPE_INT_INT, IX86_BUILTIN_VEC_INIT_V2SI);
- ftype = build_function_type_list (long_long_integer_type_node,
- V2DI_type_node, integer_type_node,
- NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v2di", ftype, IX86_BUILTIN_VEC_EXT_V2DI);
+ def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v4hi",
+ V4HI_FTYPE_HI_HI_HI_HI,
+ IX86_BUILTIN_VEC_INIT_V4HI);
- ftype = build_function_type_list (float_type_node, V4SF_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_vec_ext_v4sf", ftype, IX86_BUILTIN_VEC_EXT_V4SF);
+ def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_init_v8qi",
+ V8QI_FTYPE_QI_QI_QI_QI_QI_QI_QI_QI,
+ IX86_BUILTIN_VEC_INIT_V8QI);
- ftype = build_function_type_list (intSI_type_node, V4SI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v4si", ftype, IX86_BUILTIN_VEC_EXT_V4SI);
+ /* Access to the vec_extract patterns. */
+ def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v2df",
+ DOUBLE_FTYPE_V2DF_INT, IX86_BUILTIN_VEC_EXT_V2DF);
+ def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v2di",
+ DI_FTYPE_V2DI_INT, IX86_BUILTIN_VEC_EXT_V2DI);
+ def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_vec_ext_v4sf",
+ FLOAT_FTYPE_V4SF_INT, IX86_BUILTIN_VEC_EXT_V4SF);
+ def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v4si",
+ SI_FTYPE_V4SI_INT, IX86_BUILTIN_VEC_EXT_V4SI);
+ def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v8hi",
+ HI_FTYPE_V8HI_INT, IX86_BUILTIN_VEC_EXT_V8HI);
+
+ def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A,
+ "__builtin_ia32_vec_ext_v4hi",
+ HI_FTYPE_V4HI_INT, IX86_BUILTIN_VEC_EXT_V4HI);
+
+ def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_ext_v2si",
+ SI_FTYPE_V2SI_INT, IX86_BUILTIN_VEC_EXT_V2SI);
+
+ def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v16qi",
+ QI_FTYPE_V16QI_INT, IX86_BUILTIN_VEC_EXT_V16QI);
- ftype = build_function_type_list (intHI_type_node, V8HI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v8hi", ftype, IX86_BUILTIN_VEC_EXT_V8HI);
+ /* Access to the vec_set patterns. */
+ def_builtin_const (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_64BIT,
+ "__builtin_ia32_vec_set_v2di",
+ V2DI_FTYPE_V2DI_DI_INT, IX86_BUILTIN_VEC_SET_V2DI);
- ftype = build_function_type_list (intHI_type_node, V4HI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_vec_ext_v4hi", ftype, IX86_BUILTIN_VEC_EXT_V4HI);
+ def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_vec_set_v4sf",
+ V4SF_FTYPE_V4SF_FLOAT_INT, IX86_BUILTIN_VEC_SET_V4SF);
- ftype = build_function_type_list (intSI_type_node, V2SI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_vec_ext_v2si", ftype, IX86_BUILTIN_VEC_EXT_V2SI);
+ def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_vec_set_v4si",
+ V4SI_FTYPE_V4SI_SI_INT, IX86_BUILTIN_VEC_SET_V4SI);
- ftype = build_function_type_list (intQI_type_node, V16QI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v16qi", ftype, IX86_BUILTIN_VEC_EXT_V16QI);
+ def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_set_v8hi",
+ V8HI_FTYPE_V8HI_HI_INT, IX86_BUILTIN_VEC_SET_V8HI);
+
+ def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A,
+ "__builtin_ia32_vec_set_v4hi",
+ V4HI_FTYPE_V4HI_HI_INT, IX86_BUILTIN_VEC_SET_V4HI);
+
+ def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_vec_set_v16qi",
+ V16QI_FTYPE_V16QI_QI_INT, IX86_BUILTIN_VEC_SET_V16QI);
- /* Access to the vec_set patterns. */
- ftype = build_function_type_list (V2DI_type_node, V2DI_type_node,
- intDI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_64BIT, "__builtin_ia32_vec_set_v2di", ftype, IX86_BUILTIN_VEC_SET_V2DI);
-
- ftype = build_function_type_list (V4SF_type_node, V4SF_type_node,
- float_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_vec_set_v4sf", ftype, IX86_BUILTIN_VEC_SET_V4SF);
-
- ftype = build_function_type_list (V4SI_type_node, V4SI_type_node,
- intSI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_vec_set_v4si", ftype, IX86_BUILTIN_VEC_SET_V4SI);
-
- ftype = build_function_type_list (V8HI_type_node, V8HI_type_node,
- intHI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_set_v8hi", ftype, IX86_BUILTIN_VEC_SET_V8HI);
-
- ftype = build_function_type_list (V4HI_type_node, V4HI_type_node,
- intHI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_vec_set_v4hi", ftype, IX86_BUILTIN_VEC_SET_V4HI);
-
- ftype = build_function_type_list (V16QI_type_node, V16QI_type_node,
- intQI_type_node,
- integer_type_node, NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_vec_set_v16qi", ftype, IX86_BUILTIN_VEC_SET_V16QI);
/* Add FMA4 multi-arg argument instructions */
for (i = 0, d = bdesc_multi_arg; i < ARRAY_SIZE (bdesc_multi_arg); i++, d++)
{
- tree mtype = NULL_TREE;
-
if (d->name == 0)
continue;
- switch ((enum multi_arg_type)d->flag)
- {
- case MULTI_ARG_3_SF: mtype = v4sf_ftype_v4sf_v4sf_v4sf; break;
- case MULTI_ARG_3_DF: mtype = v2df_ftype_v2df_v2df_v2df; break;
- case MULTI_ARG_3_SF2: mtype = v8sf_ftype_v8sf_v8sf_v8sf; break;
- case MULTI_ARG_3_DF2: mtype = v4df_ftype_v4df_v4df_v4df; break;
- case MULTI_ARG_3_DI: mtype = v2di_ftype_v2di_v2di_v2di; break;
- case MULTI_ARG_3_SI: mtype = v4si_ftype_v4si_v4si_v4si; break;
- case MULTI_ARG_3_SI_DI: mtype = v4si_ftype_v4si_v4si_v2di; break;
- case MULTI_ARG_3_HI: mtype = v8hi_ftype_v8hi_v8hi_v8hi; break;
- case MULTI_ARG_3_HI_SI: mtype = v8hi_ftype_v8hi_v8hi_v4si; break;
- case MULTI_ARG_3_QI: mtype = v16qi_ftype_v16qi_v16qi_v16qi; break;
- case MULTI_ARG_3_DI2: mtype = v4di_ftype_v4di_v4di_v4di; break;
- case MULTI_ARG_3_SI2: mtype = v8si_ftype_v8si_v8si_v8si; break;
- case MULTI_ARG_3_HI2: mtype = v16hi_ftype_v16hi_v16hi_v16hi; break;
- case MULTI_ARG_3_QI2: mtype = v32qi_ftype_v32qi_v32qi_v32qi; break;
- case MULTI_ARG_2_SF: mtype = v4sf_ftype_v4sf_v4sf; break;
- case MULTI_ARG_2_DF: mtype = v2df_ftype_v2df_v2df; break;
- case MULTI_ARG_2_DI: mtype = v2di_ftype_v2di_v2di; break;
- case MULTI_ARG_2_SI: mtype = v4si_ftype_v4si_v4si; break;
- case MULTI_ARG_2_HI: mtype = v8hi_ftype_v8hi_v8hi; break;
- case MULTI_ARG_2_QI: mtype = v16qi_ftype_v16qi_v16qi; break;
- case MULTI_ARG_2_DI_IMM: mtype = v2di_ftype_v2di_si; break;
- case MULTI_ARG_2_SI_IMM: mtype = v4si_ftype_v4si_si; break;
- case MULTI_ARG_2_HI_IMM: mtype = v8hi_ftype_v8hi_si; break;
- case MULTI_ARG_2_QI_IMM: mtype = v16qi_ftype_v16qi_si; break;
- case MULTI_ARG_2_DI_CMP: mtype = v2di_ftype_v2di_v2di; break;
- case MULTI_ARG_2_SI_CMP: mtype = v4si_ftype_v4si_v4si; break;
- case MULTI_ARG_2_HI_CMP: mtype = v8hi_ftype_v8hi_v8hi; break;
- case MULTI_ARG_2_QI_CMP: mtype = v16qi_ftype_v16qi_v16qi; break;
- case MULTI_ARG_2_SF_TF: mtype = v4sf_ftype_v4sf_v4sf; break;
- case MULTI_ARG_2_DF_TF: mtype = v2df_ftype_v2df_v2df; break;
- case MULTI_ARG_2_DI_TF: mtype = v2di_ftype_v2di_v2di; break;
- case MULTI_ARG_2_SI_TF: mtype = v4si_ftype_v4si_v4si; break;
- case MULTI_ARG_2_HI_TF: mtype = v8hi_ftype_v8hi_v8hi; break;
- case MULTI_ARG_2_QI_TF: mtype = v16qi_ftype_v16qi_v16qi; break;
- case MULTI_ARG_1_SF: mtype = v4sf_ftype_v4sf; break;
- case MULTI_ARG_1_DF: mtype = v2df_ftype_v2df; break;
- case MULTI_ARG_1_SF2: mtype = v8sf_ftype_v8sf; break;
- case MULTI_ARG_1_DF2: mtype = v4df_ftype_v4df; break;
- case MULTI_ARG_1_DI: mtype = v2di_ftype_v2di; break;
- case MULTI_ARG_1_SI: mtype = v4si_ftype_v4si; break;
- case MULTI_ARG_1_HI: mtype = v8hi_ftype_v8hi; break;
- case MULTI_ARG_1_QI: mtype = v16qi_ftype_v16qi; break;
- case MULTI_ARG_1_SI_DI: mtype = v2di_ftype_v4si; break;
- case MULTI_ARG_1_HI_DI: mtype = v2di_ftype_v8hi; break;
- case MULTI_ARG_1_HI_SI: mtype = v4si_ftype_v8hi; break;
- case MULTI_ARG_1_QI_DI: mtype = v2di_ftype_v16qi; break;
- case MULTI_ARG_1_QI_SI: mtype = v4si_ftype_v16qi; break;
- case MULTI_ARG_1_QI_HI: mtype = v8hi_ftype_v16qi; break;
-
- case MULTI_ARG_UNKNOWN:
- default:
- gcc_unreachable ();
- }
-
- if (mtype)
- def_builtin_const (d->mask, d->name, mtype, d->code);
+ ftype = (enum ix86_builtin_func_type) d->flag;
+ def_builtin_const (d->mask, d->name, ftype, d->code);
}
}
@@ -24162,66 +22592,61 @@ ix86_init_builtins_va_builtins_abi (void)
}
static void
-ix86_init_builtins (void)
+ix86_init_builtin_types (void)
{
- tree float128_type_node = make_node (REAL_TYPE);
- tree ftype, decl;
+ tree float128_type_node, float80_type_node;
/* The __float80 type. */
- if (TYPE_MODE (long_double_type_node) == XFmode)
- (*lang_hooks.types.register_builtin_type) (long_double_type_node,
- "__float80");
- else
+ float80_type_node = long_double_type_node;
+ if (TYPE_MODE (float80_type_node) != XFmode)
{
/* The __float80 type. */
- tree float80_type_node = make_node (REAL_TYPE);
+ float80_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (float80_type_node) = 80;
layout_type (float80_type_node);
- (*lang_hooks.types.register_builtin_type) (float80_type_node,
- "__float80");
}
+ (*lang_hooks.types.register_builtin_type) (float80_type_node, "__float80");
/* The __float128 type. */
+ float128_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (float128_type_node) = 128;
layout_type (float128_type_node);
- (*lang_hooks.types.register_builtin_type) (float128_type_node,
- "__float128");
+ (*lang_hooks.types.register_builtin_type) (float128_type_node, "__float128");
- /* TFmode support builtins. */
- ftype = build_function_type (float128_type_node, void_list_node);
- decl = add_builtin_function ("__builtin_infq", ftype,
- IX86_BUILTIN_INFQ, BUILT_IN_MD,
- NULL, NULL_TREE);
- ix86_builtins[(int) IX86_BUILTIN_INFQ] = decl;
+ /* This macro is built by i386-builtin-types.awk. */
+ DEFINE_BUILTIN_PRIMITIVE_TYPES;
+}
+
+static void
+ix86_init_builtins (void)
+{
+ tree t;
+
+ ix86_init_builtin_types ();
- decl = add_builtin_function ("__builtin_huge_valq", ftype,
- IX86_BUILTIN_HUGE_VALQ, BUILT_IN_MD,
- NULL, NULL_TREE);
- ix86_builtins[(int) IX86_BUILTIN_HUGE_VALQ] = decl;
+ /* TFmode support builtins. */
+ def_builtin_const (0, "__builtin_infq",
+ FLOAT128_FTYPE_VOID, IX86_BUILTIN_INFQ);
+ def_builtin_const (0, "__builtin_huge_valq",
+ FLOAT128_FTYPE_VOID, IX86_BUILTIN_HUGE_VALQ);
/* We will expand them to normal call if SSE2 isn't available since
they are used by libgcc. */
- ftype = build_function_type_list (float128_type_node,
- float128_type_node,
- NULL_TREE);
- decl = add_builtin_function ("__builtin_fabsq", ftype,
- IX86_BUILTIN_FABSQ, BUILT_IN_MD,
- "__fabstf2", NULL_TREE);
- ix86_builtins[(int) IX86_BUILTIN_FABSQ] = decl;
- TREE_READONLY (decl) = 1;
-
- ftype = build_function_type_list (float128_type_node,
- float128_type_node,
- float128_type_node,
- NULL_TREE);
- decl = add_builtin_function ("__builtin_copysignq", ftype,
- IX86_BUILTIN_COPYSIGNQ, BUILT_IN_MD,
- "__copysigntf3", NULL_TREE);
- ix86_builtins[(int) IX86_BUILTIN_COPYSIGNQ] = decl;
- TREE_READONLY (decl) = 1;
+ t = ix86_get_builtin_func_type (FLOAT128_FTYPE_FLOAT128);
+ t = add_builtin_function ("__builtin_fabsq", t, IX86_BUILTIN_FABSQ,
+ BUILT_IN_MD, "__fabstf2", NULL_TREE);
+ TREE_READONLY (t) = 1;
+ ix86_builtins[(int) IX86_BUILTIN_FABSQ] = t;
+
+ t = ix86_get_builtin_func_type (FLOAT128_FTYPE_FLOAT128_FLOAT128);
+ t = add_builtin_function ("__builtin_copysignq", t, IX86_BUILTIN_COPYSIGNQ,
+ BUILT_IN_MD, "__copysigntf3", NULL_TREE);
+ TREE_READONLY (t) = 1;
+ ix86_builtins[(int) IX86_BUILTIN_COPYSIGNQ] = t;
ix86_init_mmx_sse_builtins ();
+
if (TARGET_64BIT)
ix86_init_builtins_va_builtins_abi ();
}
@@ -24297,7 +22722,7 @@ ix86_expand_binop_builtin (enum insn_code icode, tree exp, rtx target)
static rtx
ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target,
- enum multi_arg_type m_type,
+ enum ix86_builtin_func_type m_type,
enum rtx_code sub_code)
{
rtx pat;
@@ -24385,7 +22810,6 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target,
tf_p = true;
break;
- case MULTI_ARG_UNKNOWN:
default:
gcc_unreachable ();
}
@@ -24879,7 +23303,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
bool swap = false;
enum rtx_code comparison = d->comparison;
- switch ((enum ix86_builtin_type) d->flag)
+ switch ((enum ix86_builtin_func_type) d->flag)
{
case INT_FTYPE_V8SF_V8SF_PTEST:
case INT_FTYPE_V4DI_V4DI_PTEST:
@@ -25022,7 +23446,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case UINT8_FTYPE_UINT8_INT:
nargs = 2;
break;
- case V2DI2TI_FTYPE_V2DI_INT:
+ case V2DI_FTYPE_V2DI_INT_CONVERT:
nargs = 2;
rmode = V2DImode;
nargs_constant = 1;
@@ -25063,12 +23487,12 @@ ix86_expand_args_builtin (const struct builtin_description *d,
nargs = 3;
nargs_constant = 1;
break;
- case V2DI2TI_FTYPE_V2DI_V2DI_INT:
+ case V2DI_FTYPE_V2DI_V2DI_INT_CONVERT:
nargs = 3;
rmode = V2DImode;
nargs_constant = 1;
break;
- case V1DI2DI_FTYPE_V1DI_V1DI_INT:
+ case V1DI_FTYPE_V1DI_V1DI_INT_CONVERT:
nargs = 3;
rmode = DImode;
nargs_constant = 1;
@@ -25259,7 +23683,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
enum machine_mode tmode = insn_p->operand[0].mode;
enum { load, store } klass;
- switch ((enum ix86_special_builtin_type) d->flag)
+ switch ((enum ix86_builtin_func_type) d->flag)
{
case VOID_FTYPE_VOID:
emit_insn (GEN_FCN (icode) (target));
@@ -25292,7 +23716,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
case VOID_FTYPE_PFLOAT_V4SF:
case VOID_FTYPE_PDOUBLE_V4DF:
case VOID_FTYPE_PDOUBLE_V2DF:
- case VOID_FTYPE_PDI_DI:
+ case VOID_FTYPE_PULONGLONG_ULONGLONG:
case VOID_FTYPE_PINT_INT:
nargs = 1;
klass = store;
@@ -25753,8 +24177,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
for (i = 0, d = bdesc_multi_arg; i < ARRAY_SIZE (bdesc_multi_arg); i++, d++)
if (d->code == fcode)
return ix86_expand_multi_arg_builtin (d->icode, exp, target,
- (enum multi_arg_type)d->flag,
- d->comparison);
+ (enum ix86_builtin_func_type)
+ d->flag, d->comparison);
gcc_unreachable ();
}
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 9a87cb1f4f9..71447993c2d 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -10647,9 +10647,7 @@
(match_operand:V2DI 3 "memory_operand" "m,m")))]
"TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, -1, true)"
"#"
- "&& (reload_completed
- || (!reg_mentioned_p (operands[0], operands[1])
- && !reg_mentioned_p (operands[0], operands[2])))"
+ "&& reload_completed"
[(set (match_dup 0)
(match_dup 3))
(set (match_dup 0)
@@ -10686,9 +10684,7 @@
(const_int 3)])))))]
"TARGET_XOP"
"#"
- "&& (reload_completed
- || (!reg_mentioned_p (operands[0], operands[1])
- && !reg_mentioned_p (operands[0], operands[2])))"
+ "&& reload_completed"
[(set (match_dup 0)
(match_dup 3))
(set (match_dup 0)
@@ -10750,9 +10746,7 @@
(match_operand:V2DI 3 "memory_operand" "m,m")))]
"TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, -1, true)"
"#"
- "&& (reload_completed
- || (!reg_mentioned_p (operands[0], operands[1])
- && !reg_mentioned_p (operands[0], operands[2])))"
+ "&& reload_completed"
[(set (match_dup 0)
(match_dup 3))
(set (match_dup 0)
@@ -10789,9 +10783,7 @@
(const_int 2)])))))]
"TARGET_XOP"
"#"
- "&& (reload_completed
- || (!reg_mentioned_p (operands[0], operands[1])
- && !reg_mentioned_p (operands[0], operands[2])))"
+ "&& reload_completed"
[(set (match_dup 0)
(match_dup 3))
(set (match_dup 0)
diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386
index 087c4743d2f..87a25fbc075 100644
--- a/gcc/config/i386/t-i386
+++ b/gcc/config/i386/t-i386
@@ -22,7 +22,8 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(INSN_ATTR_H) $(FLAGS_H) $(C_COMMON_H) except.h $(FUNCTION_H) \
$(RECOG_H) $(EXPR_H) $(OPTABS_H) toplev.h $(BASIC_BLOCK_H) \
$(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \
- $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H)
+ $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H) \
+ i386-builtin-types.inc
i386-c.o: $(srcdir)/config/i386/i386-c.c \
$(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -30,3 +31,11 @@ i386-c.o: $(srcdir)/config/i386/i386-c.c \
$(TARGET_H) $(TARGET_DEF_H) $(CPPLIB_H) $(C_PRAGMA_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/i386/i386-c.c
+
+
+i386-builtin-types.inc: s-i386-bt ; @true
+s-i386-bt: $(srcdir)/config/i386/i386-builtin-types.awk \
+ $(srcdir)/config/i386/i386-builtin-types.def
+ $(AWK) -f $^ > tmp-bt.inc
+ $(SHELL) $(srcdir)/../move-if-change tmp-bt.inc i386-builtin-types.inc
+ $(STAMP) $@
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 88649ea0735..9b03a9bfe68 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -130,8 +130,6 @@ typedef struct GTY(()) machine_function
64-bits wide and is allocated early enough so that the offset
does not overflow the 16-bit load/store offset field. */
rtx sdmode_stack_slot;
- /* True if any VSX or ALTIVEC vector type was used. */
- bool vsx_or_altivec_used_p;
} machine_function;
/* Target cpu type */
@@ -915,7 +913,7 @@ static void rs6000_elf_encode_section_info (tree, rtx, int)
ATTRIBUTE_UNUSED;
#endif
static bool rs6000_use_blocks_for_constant_p (enum machine_mode, const_rtx);
-static void rs6000_expand_to_rtl_hook (void);
+static void rs6000_alloc_sdmode_stack_slot (void);
static void rs6000_instantiate_decls (void);
#if TARGET_XCOFF
static void rs6000_xcoff_asm_output_anchor (rtx);
@@ -1507,7 +1505,7 @@ static const struct attribute_spec rs6000_attribute_table[] =
#define TARGET_BUILTIN_RECIPROCAL rs6000_builtin_reciprocal
#undef TARGET_EXPAND_TO_RTL_HOOK
-#define TARGET_EXPAND_TO_RTL_HOOK rs6000_expand_to_rtl_hook
+#define TARGET_EXPAND_TO_RTL_HOOK rs6000_alloc_sdmode_stack_slot
#undef TARGET_INSTANTIATE_DECLS
#define TARGET_INSTANTIATE_DECLS rs6000_instantiate_decls
@@ -13192,38 +13190,6 @@ rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return NULL_TREE;
}
-static tree
-rs6000_check_vector_mode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
-{
- /* Don't walk into types. */
- if (*tp == NULL_TREE || *tp == error_mark_node || TYPE_P (*tp))
- {
- *walk_subtrees = 0;
- return NULL_TREE;
- }
-
- switch (TREE_CODE (*tp))
- {
- case VAR_DECL:
- case PARM_DECL:
- case FIELD_DECL:
- case RESULT_DECL:
- case SSA_NAME:
- case REAL_CST:
- case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
- case MISALIGNED_INDIRECT_REF:
- case VIEW_CONVERT_EXPR:
- if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (*tp))))
- return *tp;
- break;
- default:
- break;
- }
-
- return NULL_TREE;
-}
-
enum reload_reg_type {
GPR_REGISTER_TYPE,
VECTOR_REGISTER_TYPE,
@@ -13664,17 +13630,11 @@ rs6000_ira_cover_classes (void)
return (TARGET_VSX) ? cover_vsx : cover_pre_vsx;
}
-/* Scan the trees looking for certain types.
-
- Allocate a 64-bit stack slot to be used for copying SDmode values through if
- this function has any SDmode references.
-
- If VSX, note whether any vector operation was done so we can set VRSAVE to
- non-zero, even if we just use the floating point registers to tell the
- kernel to save the vector registers. */
+/* Allocate a 64-bit stack slot to be used for copying SDmode
+ values through if this function has any SDmode references. */
static void
-rs6000_expand_to_rtl_hook (void)
+rs6000_alloc_sdmode_stack_slot (void)
{
tree t;
basic_block bb;
@@ -13682,24 +13642,6 @@ rs6000_expand_to_rtl_hook (void)
gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
- /* Check for vectors. */
- if (TARGET_VSX)
- {
- FOR_EACH_BB (bb)
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- if (walk_gimple_op (gsi_stmt (gsi), rs6000_check_vector_mode,
- NULL))
- {
- cfun->machine->vsx_or_altivec_used_p = true;
- goto found_vector;
- }
- }
- found_vector:
- ;
- }
-
- /* Check for SDmode being used. */
FOR_EACH_BB (bb)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -16841,15 +16783,6 @@ compute_vrsave_mask (void)
if (df_regs_ever_live_p (i))
mask |= ALTIVEC_REG_BIT (i);
- /* If VSX is used, we might have used a traditional floating point register
- in a vector mode without using any altivec registers. However the VRSAVE
- register does not have room to indicate the floating point registers.
- Modern kernels only look to see if the value is non-zero to determine if
- they need to save the vector registers, so we just set an arbitrary
- value if any vector type was used. */
- if (mask == 0 && TARGET_VSX && cfun->machine->vsx_or_altivec_used_p)
- mask = 0xFFF;
-
if (mask == 0)
return mask;
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 2888da67281..a75f04a61ab 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -1710,6 +1710,8 @@ get_pic_reg (void)
rtx pic_reg = pic_offset_table_rtx;
if (!reload_completed && !reload_in_progress)
abort ();
+ if (current_function_is_leaf && !df_regs_ever_live_p (LAST_ARG_REGNUM))
+ pic_reg = gen_rtx_REG (SImode, LAST_ARG_REGNUM);
return pic_reg;
}
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4f5f9b54248..b9f1cbebbfb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,112 @@
+2009-11-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/9050, DR 147, DR 318
+ * parser.c (cp_parser_lookup_name): If the name matches the explicit
+ class scope, we're naming the constructor.
+ (cp_parser_constructor_declarator_p): Just use cp_parser_unqualified_id
+ if we have a nested-name-specifier.
+ (cp_parser_direct_declarator): Handle getting an overload set as a
+ constructor declarator.
+ (cp_parser_unqualified_id): Avoid looking up the constructor when
+ naming the destructor.
+ (cp_parser_diagnose_invalid_type_name): Give good
+ diagnostic for improper use of constructor as template.
+ * typeck.c (finish_class_member_access_expr): Give good diagnostic
+ about calling constructor.
+
+ * error.c (dump_aggr_type): Don't print A::A for injected-class-name.
+
+2009-11-20 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/38646
+ * pt.c (process_partial_specialization): Do not turn wrongly located
+ parameter pack arguments into error_mark_node.
+ Split too long lines into two.
+
+2009-11-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/42060
+ * except.c (build_throw): Check the tree returned by
+ decay_conversion for error_mark_node.
+
+2009-11-20 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR c++/29017
+ * cp-tree.h (composite_pointer_operation): New type.
+ (composite_pointer_type): Adjust prototype with new argument.
+ * typeck.c (composite_pointer_type): Accept
+ composite_pointer_operation as argument and emit diagnostic to be
+ visible to gettext and checked at compile time.
+ (composite_pointer_type_r): Likewise.
+ (common_pointer_type): Update call to composite_pointer_type.
+ (cp_build_binary_op): Likewise.
+ * call.c (build_conditional_expr): Likewise.
+
+2009-11-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/42115
+ * call.c (build_op_delete_call): Don't complain about using
+ op delete (void *, size_t) for placement delete if there's an
+ op delete (void *).
+
+ DR 176 permissiveness
+ * class.c (build_self_reference): Call set_underlying_type.
+ * decl.c (check_elaborated_type_specifier): Don't complain about
+ injected-class-name.
+ (type_is_deprecated): Use TYPE_MAIN_VARIANT.
+ * pt.c (convert_template_argument): Handle injected-class-name used
+ as template template argument.
+ * typeck2.c (abstract_virtuals_error): Use TYPE_MAIN_VARIANT.
+
+ PR c++/561
+ * decl.c (static_fn_type): Split out...
+ (revert_static_member_fn): ...from here.
+ * cp-tree.h: Declare it.
+ * class.c (resolve_address_of_overloaded_function): Use it to compare
+ pointers to member functions.
+ * typeck.c (build_static_cast_1): Call instantiate_type.
+
+2009-11-18 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR c++/40892
+ * error.c (maybe_warn_cpp0x): Accept enum cpp0x_warn_str as argument.
+ (maybe_warn_variadic_templates): Update the maybe_warn_cpp0x calls to
+ match the new declaration.
+ * cp-tree.h (cpp0x_warn_str): New type.
+ (maybe_warn_cpp0x): Adjust prototype with new argument.
+ * call.c (reference_binding): Update the maybe_warn_cpp0x calls.
+ * decl.c (reshape_init_r, check_initializer, grokdeclarator):
+ Likewise.
+ * parser.c (cp_parser_primary_expression)
+ (cp_parser_parenthesized_expression_list, cp_parser_new_initializer)
+ (cp_parser_assignment_expression, cp_parser_condition)
+ (cp_parser_jump_statement, cp_parser_mem_initializer)
+ (cp_parser_simple_type_specifier, cp_parser_elaborated_type_specifier)
+ (cp_parser_enum_specifier, cp_parser_initializer)
+ (cp_parser_pure_specifier, cp_parser_functional_cast): Likewise.
+
+2009-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/3187
+ * cp-tree.h (expand_or_defer_fn_1): New prototype.
+ * decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL
+ also all same_body aliases.
+ * semantics.c (expand_or_defer_fn): Move most of the function
+ except registering with cgraph to ...
+ (expand_or_defer_fn_1): ... here. New function.
+ * optimize.c: Include cgraph.h.
+ (maybe_clone_body): If in charge parm is not used and both base
+ and complete clones are created and are not comdat, tell cgraph
+ they have the same body.
+ * Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H).
+
+2009-11-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/42058
+ * typeck2.c (digest_init_r): Check init for error_operand_p.
+ * decl.c (reshape_init_class): Check return value of reshape_init_r
+ for error_mark_node.
+
2009-11-17 Jakub Jelinek <jakub@redhat.com>
PR c++/42061
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 861c93df066..f5c652ec552 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -303,7 +303,7 @@ cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \
cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H)
cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \
insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(GIMPLE_H) \
- $(TARGET_H) tree-iterator.h
+ $(TARGET_H) tree-iterator.h $(CGRAPH_H)
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \
gt-cp-mangle.h $(TARGET_H) $(TM_P_H)
cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e051e907220..b4c8176c626 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1228,7 +1228,7 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags)
if (expr && BRACE_ENCLOSED_INITIALIZER_P (expr))
{
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
conv = implicit_conversion (to, from, expr, c_cast_p,
flags);
if (!CLASS_TYPE_P (to)
@@ -3977,7 +3977,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
|| (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type)))
{
result_type = composite_pointer_type (arg2_type, arg3_type, arg2,
- arg3, "conditional expression",
+ arg3, CPO_CONDITIONAL_EXPR,
complain);
if (result_type == error_mark_node)
return error_mark_node;
@@ -4622,8 +4622,20 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
allocation function, the program is ill-formed." */
if (non_placement_deallocation_fn_p (fn))
{
+ /* But if the class has an operator delete (void *), then that is
+ the usual deallocation function, so we shouldn't complain
+ about using the operator delete (void *, size_t). */
+ for (t = BASELINK_P (fns) ? BASELINK_FUNCTIONS (fns) : fns;
+ t; t = OVL_NEXT (t))
+ {
+ tree elt = OVL_CURRENT (t);
+ if (non_placement_deallocation_fn_p (elt)
+ && FUNCTION_ARG_CHAIN (elt) == void_list_node)
+ goto ok;
+ }
permerror (0, "non-placement deallocation function %q+D", fn);
permerror (input_location, "selected for placement delete");
+ ok:;
}
}
else
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c798ba2833f..38eb73f4004 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6065,6 +6065,7 @@ resolve_address_of_overloaded_function (tree target_type,
interoperability with most_specialized_instantiation. */
tree matches = NULL_TREE;
tree fn;
+ tree target_fn_type;
/* By the time we get here, we should be seeing only real
pointer-to-member types, not the internal POINTER_TYPE to
@@ -6096,6 +6097,15 @@ resolve_address_of_overloaded_function (tree target_type,
return error_mark_node;
}
+ /* Non-member functions and static member functions match targets of type
+ "pointer-to-function" or "reference-to-function." Nonstatic member
+ functions match targets of type "pointer-to-member-function;" the
+ function type of the pointer to member is used to select the member
+ function from the set of overloaded member functions.
+
+ So figure out the FUNCTION_TYPE that we want to match against. */
+ target_fn_type = static_fn_type (target_type);
+
/* If we can find a non-template function that matches, we can just
use it. There's no point in generating template instantiations
if we're just going to throw them out anyhow. But, of course, we
@@ -6107,7 +6117,6 @@ resolve_address_of_overloaded_function (tree target_type,
for (fns = overload; fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
- tree fntype;
if (TREE_CODE (fn) == TEMPLATE_DECL)
/* We're not looking for templates just yet. */
@@ -6125,13 +6134,7 @@ resolve_address_of_overloaded_function (tree target_type,
continue;
/* See if there's a match. */
- fntype = TREE_TYPE (fn);
- if (is_ptrmem)
- fntype = build_ptrmemfunc_type (build_pointer_type (fntype));
- else if (!is_reference)
- fntype = build_pointer_type (fntype);
-
- if (can_convert_arg (target_type, fntype, fn, LOOKUP_NORMAL))
+ if (same_type_p (target_fn_type, static_fn_type (fn)))
matches = tree_cons (fn, NULL_TREE, matches);
}
}
@@ -6141,7 +6144,6 @@ resolve_address_of_overloaded_function (tree target_type,
match we need to look at them, too. */
if (!matches)
{
- tree target_fn_type;
tree target_arg_types;
tree target_ret_type;
tree fns;
@@ -6149,18 +6151,9 @@ resolve_address_of_overloaded_function (tree target_type,
unsigned int nargs, ia;
tree arg;
- if (is_ptrmem)
- target_fn_type
- = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (target_type));
- else
- target_fn_type = TREE_TYPE (target_type);
target_arg_types = TYPE_ARG_TYPES (target_fn_type);
target_ret_type = TREE_TYPE (target_fn_type);
- /* Never do unification on the 'this' parameter. */
- if (TREE_CODE (target_fn_type) == METHOD_TYPE)
- target_arg_types = TREE_CHAIN (target_arg_types);
-
nargs = list_length (target_arg_types);
args = XALLOCAVEC (tree, nargs);
for (arg = target_arg_types, ia = 0;
@@ -6173,7 +6166,6 @@ resolve_address_of_overloaded_function (tree target_type,
{
tree fn = OVL_CURRENT (fns);
tree instantiation;
- tree instantiation_type;
tree targs;
if (TREE_CODE (fn) != TEMPLATE_DECL)
@@ -6201,14 +6193,7 @@ resolve_address_of_overloaded_function (tree target_type,
continue;
/* See if there's a match. */
- instantiation_type = TREE_TYPE (instantiation);
- if (is_ptrmem)
- instantiation_type =
- build_ptrmemfunc_type (build_pointer_type (instantiation_type));
- else if (!is_reference)
- instantiation_type = build_pointer_type (instantiation_type);
- if (can_convert_arg (target_type, instantiation_type, instantiation,
- LOOKUP_NORMAL))
+ if (same_type_p (target_fn_type, static_fn_type (instantiation)))
matches = tree_cons (instantiation, fn, matches);
}
@@ -6528,6 +6513,7 @@ build_self_reference (void)
DECL_CONTEXT (value) = current_class_type;
DECL_ARTIFICIAL (value) = 1;
SET_DECL_SELF_REFERENCE_P (value);
+ set_underlying_type (value);
if (processing_template_decl)
value = push_template_decl (value);
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index a71dc739cfa..88387705a1b 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -382,6 +382,39 @@ typedef enum cp_id_kind
CP_ID_KIND_QUALIFIED
} cp_id_kind;
+
+/* The various kinds of C++0x warnings we encounter. */
+
+typedef enum cpp0x_warn_str
+{
+ /* extended initializer lists */
+ CPP0X_INITIALIZER_LISTS,
+ /* explicit conversion operators */
+ CPP0X_EXPLICIT_CONVERSION,
+ /* variadic templates */
+ CPP0X_VARIADIC_TEMPLATES,
+ /* lambda expressions */
+ CPP0X_LAMBDA_EXPR,
+ /* C++0x auto */
+ CPP0X_AUTO,
+ /* scoped enums */
+ CPP0X_SCOPED_ENUMS,
+ /* defaulted and deleted functions */
+ CPP0X_DEFAULTED_DELETED
+} cpp0x_warn_str;
+
+/* The various kinds of operation used by composite_pointer_type. */
+
+typedef enum composite_pointer_operation
+{
+ /* comparison */
+ CPO_COMPARISON,
+ /* conversion */
+ CPO_CONVERSION,
+ /* conditional expression */
+ CPO_CONDITIONAL_EXPR
+} composite_pointer_operation;
+
/* Macros for access to language-specific slots in an identifier. */
#define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
@@ -4588,6 +4621,7 @@ extern void maybe_register_incomplete_var (tree);
extern void maybe_commonize_var (tree);
extern void complete_vars (tree);
extern void finish_stmt (void);
+extern tree static_fn_type (tree);
extern void revert_static_member_fn (tree);
extern void fixup_anonymous_aggr (tree);
extern int check_static_variable_definition (tree, tree);
@@ -4672,7 +4706,7 @@ extern const char *language_to_string (enum languages);
extern const char *class_key_or_enum_as_string (tree);
extern void print_instantiation_context (void);
extern void maybe_warn_variadic_templates (void);
-extern void maybe_warn_cpp0x (const char *);
+extern void maybe_warn_cpp0x (cpp0x_warn_str str);
extern bool pedwarn_cxx98 (location_t, int, const char *, ...) ATTRIBUTE_GCC_CXXDIAG(3,4);
/* in except.c */
@@ -5037,6 +5071,7 @@ extern void finish_eh_cleanup (tree);
extern void emit_associated_thunks (tree);
extern void finish_mem_initializers (tree);
extern tree check_template_template_default_arg (tree);
+extern bool expand_or_defer_fn_1 (tree);
extern void expand_or_defer_fn (tree);
extern void check_accessibility_of_qualified_id (tree, tree, tree);
extern tree finish_qualified_id_expr (tree, tree, bool, bool,
@@ -5257,7 +5292,8 @@ extern void expand_ptrmemfunc_cst (tree, tree *, tree *);
extern tree type_after_usual_arithmetic_conversions (tree, tree);
extern tree common_pointer_type (tree, tree);
extern tree composite_pointer_type (tree, tree, tree, tree,
- const char*, tsubst_flags_t);
+ composite_pointer_operation,
+ tsubst_flags_t);
extern tree merge_types (tree, tree);
extern tree check_return_expr (tree, bool *);
extern tree cp_build_binary_op (location_t,
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 851edeb5251..7f5a688873b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4878,6 +4878,9 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p)
field_init = reshape_init_r (TREE_TYPE (field), d,
/*first_initializer_p=*/false);
+ if (field_init == error_mark_node)
+ return error_mark_node;
+
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init), field, field_init);
/* [dcl.init.aggr]
@@ -4926,7 +4929,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p)
init = error_mark_node;
}
else
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
}
d->cur++;
@@ -5170,7 +5173,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
{
if (init_len == 0)
{
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
init = build_zero_init (type, NULL_TREE, false);
}
else if (init_len != 1)
@@ -8523,7 +8526,7 @@ grokdeclarator (const cp_declarator *declarator,
{
if (explicitp == 1)
{
- maybe_warn_cpp0x ("explicit conversion operators");
+ maybe_warn_cpp0x (CPP0X_EXPLICIT_CONVERSION);
explicitp = 2;
}
}
@@ -9784,6 +9787,10 @@ type_is_deprecated (tree type)
&& TREE_DEPRECATED (TYPE_NAME (type)))
return type;
+ /* Do warn about using typedefs to a deprecated class. */
+ if (TAGGED_TYPE_P (type) && type != TYPE_MAIN_VARIANT (type))
+ return type_is_deprecated (TYPE_MAIN_VARIANT (type));
+
code = TREE_CODE (type);
if (code == POINTER_TYPE || code == REFERENCE_TYPE
@@ -10605,6 +10612,7 @@ check_elaborated_type_specifier (enum tag_types tag_code,
elaborated type specifier is the implicit typedef created when
the type is declared. */
else if (!DECL_IMPLICIT_TYPEDEF_P (decl)
+ && !DECL_SELF_REFERENCE_P (decl)
&& tag_code != typename_type)
{
error ("using typedef-name %qD after %qs", decl, tag_name (tag_code));
@@ -12809,26 +12817,47 @@ finish_stmt (void)
{
}
+/* Return the FUNCTION_TYPE that corresponds to MEMFNTYPE, which can be a
+ FUNCTION_DECL, METHOD_TYPE, FUNCTION_TYPE, pointer or reference to
+ METHOD_TYPE or FUNCTION_TYPE, or pointer to member function. */
+
+tree
+static_fn_type (tree memfntype)
+{
+ tree fntype;
+ tree args;
+ int quals;
+
+ if (TYPE_PTRMEMFUNC_P (memfntype))
+ memfntype = TYPE_PTRMEMFUNC_FN_TYPE (memfntype);
+ if (POINTER_TYPE_P (memfntype)
+ || TREE_CODE (memfntype) == FUNCTION_DECL)
+ memfntype = TREE_TYPE (memfntype);
+ if (TREE_CODE (memfntype) == FUNCTION_TYPE)
+ return memfntype;
+ gcc_assert (TREE_CODE (memfntype) == METHOD_TYPE);
+ args = TYPE_ARG_TYPES (memfntype);
+ fntype = build_function_type (TREE_TYPE (memfntype), TREE_CHAIN (args));
+ quals = cp_type_quals (TREE_TYPE (TREE_VALUE (args)));
+ fntype = build_qualified_type (fntype, quals);
+ fntype = (cp_build_type_attribute_variant
+ (fntype, TYPE_ATTRIBUTES (memfntype)));
+ fntype = (build_exception_variant
+ (fntype, TYPE_RAISES_EXCEPTIONS (memfntype)));
+ return fntype;
+}
+
/* DECL was originally constructed as a non-static member function,
but turned out to be static. Update it accordingly. */
void
revert_static_member_fn (tree decl)
{
- tree tmp;
- tree function = TREE_TYPE (decl);
- tree args = TYPE_ARG_TYPES (function);
+ TREE_TYPE (decl) = static_fn_type (decl);
- if (cp_type_quals (TREE_TYPE (TREE_VALUE (args)))
- != TYPE_UNQUALIFIED)
+ if (cp_type_quals (TREE_TYPE (decl)) != TYPE_UNQUALIFIED)
error ("static member function %q#D declared with type qualifiers", decl);
- args = TREE_CHAIN (args);
- tmp = build_function_type (TREE_TYPE (function), args);
- tmp = build_qualified_type (tmp, cp_type_quals (function));
- tmp = build_exception_variant (tmp,
- TYPE_RAISES_EXCEPTIONS (function));
- TREE_TYPE (decl) = tmp;
if (DECL_ARGUMENTS (decl))
DECL_ARGUMENTS (decl) = TREE_CHAIN (DECL_ARGUMENTS (decl));
DECL_STATIC_FUNCTION_P (decl) = 1;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 7c3f7c058d6..c0febad2515 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3658,7 +3658,19 @@ cp_write_global_declarations (void)
if (DECL_NOT_REALLY_EXTERN (decl)
&& DECL_INITIAL (decl)
&& decl_needed_p (decl))
- DECL_EXTERNAL (decl) = 0;
+ {
+ struct cgraph_node *node = cgraph_get_node (decl), *alias;
+
+ DECL_EXTERNAL (decl) = 0;
+ /* If we mark !DECL_EXTERNAL one of the same body aliases,
+ we need to mark all of them that way. */
+ if (node && node->same_body)
+ {
+ DECL_EXTERNAL (node->decl) = 0;
+ for (alias = node->same_body; alias; alias = alias->next)
+ DECL_EXTERNAL (alias->decl) = 0;
+ }
+ }
/* If we're going to need to write this function out, and
there's already a body for it, create RTL for it now.
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 7266d8872d5..e0e5ae52ceb 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -568,10 +568,11 @@ dump_aggr_type (tree t, int flags)
{
typdef = !DECL_ARTIFICIAL (name);
- if (typdef
- && ((flags & TFF_CHASE_TYPEDEF)
- || (!flag_pretty_templates && DECL_LANG_SPECIFIC (name)
- && DECL_TEMPLATE_INFO (name))))
+ if ((typdef
+ && ((flags & TFF_CHASE_TYPEDEF)
+ || (!flag_pretty_templates && DECL_LANG_SPECIFIC (name)
+ && DECL_TEMPLATE_INFO (name))))
+ || DECL_SELF_REFERENCE_P (name))
{
t = TYPE_MAIN_VARIANT (t);
name = TYPE_NAME (t);
@@ -2885,20 +2886,57 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec,
/* Warn about the use of C++0x features when appropriate. */
void
-maybe_warn_cpp0x (const char* str)
+maybe_warn_cpp0x (cpp0x_warn_str str)
{
if ((cxx_dialect == cxx98) && !in_system_header)
/* We really want to suppress this warning in system headers,
because libstdc++ uses variadic templates even when we aren't
in C++0x mode. */
- pedwarn (input_location, 0, "%s only available with -std=c++0x or -std=gnu++0x", str);
+ switch (str)
+ {
+ case CPP0X_INITIALIZER_LISTS:
+ pedwarn (input_location, 0,
+ "extended initializer lists "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
+ case CPP0X_EXPLICIT_CONVERSION:
+ pedwarn (input_location, 0,
+ "explicit conversion operators "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
+ case CPP0X_VARIADIC_TEMPLATES:
+ pedwarn (input_location, 0,
+ "variadic templates "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
+ case CPP0X_LAMBDA_EXPR:
+ pedwarn (input_location, 0,
+ "lambda expressions "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
+ case CPP0X_AUTO:
+ pedwarn (input_location, 0,
+ "C++0x auto only available with -std=c++0x or -std=gnu++0x");
+ break;
+ case CPP0X_SCOPED_ENUMS:
+ pedwarn (input_location, 0,
+ "scoped enums only available with -std=c++0x or -std=gnu++0x");
+ break;
+ case CPP0X_DEFAULTED_DELETED:
+ pedwarn (input_location, 0,
+ "defaulted and deleted functions "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
+ default:
+ gcc_unreachable();
+ }
}
/* Warn about the use of variadic templates when appropriate. */
void
maybe_warn_variadic_templates (void)
{
- maybe_warn_cpp0x ("variadic templates");
+ maybe_warn_cpp0x (CPP0X_VARIADIC_TEMPLATES);
}
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 1b13819ed67..66dc14eaefb 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -752,8 +752,12 @@ build_throw (tree exp)
}
}
else
- exp = build2 (INIT_EXPR, temp_type, object,
- decay_conversion (exp));
+ {
+ tmp = decay_conversion (exp);
+ if (tmp == error_mark_node)
+ return error_mark_node;
+ exp = build2 (INIT_EXPR, temp_type, object, tmp);
+ }
/* Pre-evaluate the thrown expression first, since if we allocated
the space first we would have to deal with cleaning it up if
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 662bd4a22a3..c691f0b6a0b 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "gimple.h"
#include "tree-iterator.h"
+#include "cgraph.h"
/* Prototypes. */
@@ -149,8 +150,10 @@ bool
maybe_clone_body (tree fn)
{
tree clone;
- tree complete_dtor = NULL_TREE;
+ tree fns[3];
bool first = true;
+ bool in_charge_parm_used;
+ int idx;
/* We only clone constructors and destructors. */
if (!DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)
@@ -160,25 +163,40 @@ maybe_clone_body (tree fn)
/* Emit the DWARF1 abstract instance. */
(*debug_hooks->deferred_inline_function) (fn);
+ in_charge_parm_used = CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn)) != NULL;
+ fns[0] = NULL_TREE;
+ fns[1] = NULL_TREE;
+ fns[2] = NULL_TREE;
+
/* Look for the complete destructor which may be used to build the
delete destructor. */
FOR_EACH_CLONE (clone, fn)
- if (DECL_NAME (clone) == complete_dtor_identifier)
- {
- complete_dtor = clone;
- break;
- }
+ if (DECL_NAME (clone) == complete_dtor_identifier
+ || DECL_NAME (clone) == complete_ctor_identifier)
+ fns[1] = clone;
+ else if (DECL_NAME (clone) == base_dtor_identifier
+ || DECL_NAME (clone) == base_ctor_identifier)
+ fns[0] = clone;
+ else if (DECL_NAME (clone) == deleting_dtor_identifier)
+ fns[2] = clone;
+ else
+ gcc_unreachable ();
/* We know that any clones immediately follow FN in the TYPE_METHODS
list. */
push_to_top_level ();
- FOR_EACH_CLONE (clone, fn)
+ for (idx = 0; idx < 3; idx++)
{
tree parm;
tree clone_parm;
int parmno;
+ bool alias = false;
struct pointer_map_t *decl_map;
+ clone = fns[idx];
+ if (!clone)
+ continue;
+
/* Update CLONE's source position information to match FN's. */
DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
@@ -223,12 +241,25 @@ maybe_clone_body (tree fn)
/* Start processing the function. */
start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED);
+ /* Tell cgraph if both ctors or both dtors are known to have
+ the same body. */
+ if (!in_charge_parm_used
+ && fns[0]
+ && idx == 1
+ && !flag_use_repository
+ && DECL_INTERFACE_KNOWN (fns[0])
+ && !DECL_ONE_ONLY (fns[0])
+ && cgraph_same_body_alias (clone, fns[0]))
+ alias = true;
+
/* Build the delete destructor by calling complete destructor
and delete function. */
- if (DECL_NAME (clone) == deleting_dtor_identifier)
- build_delete_destructor_body (clone, complete_dtor);
+ if (idx == 2)
+ build_delete_destructor_body (clone, fns[1]);
+ else if (alias)
+ /* No need to populate body. */ ;
else
- {
+ {
/* Remap the parameters. */
decl_map = pointer_map_create ();
for (parmno = 0,
@@ -291,7 +322,10 @@ maybe_clone_body (tree fn)
/* Now, expand this function into RTL, if appropriate. */
finish_function (0);
BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn);
- expand_or_defer_fn (clone);
+ if (alias)
+ expand_or_defer_fn_1 (clone);
+ else
+ expand_or_defer_fn (clone);
first = false;
}
pop_from_top_level ();
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 576842641fe..c7560a872b4 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2400,6 +2400,12 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser,
if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
error_at (location, "%qE in namespace %qE does not name a type",
id, parser->scope);
+ else if (CLASS_TYPE_P (parser->scope)
+ && constructor_name_p (id, parser->scope)
+ && cp_lexer_next_token_is (parser->lexer, CPP_LESS))
+ /* A<T>::A<T>() */
+ error_at (location, "invalid use of constructor %<%T::%E%> as "
+ "template", parser->scope, id);
else if (TYPE_P (parser->scope)
&& dependent_scope_p (parser->scope))
error_at (location, "need %<typename%> before %<%T::%E%> because "
@@ -3329,7 +3335,7 @@ cp_parser_primary_expression (cp_parser *parser,
if (c_dialect_objc ())
/* We have an Objective-C++ message. */
return cp_parser_objc_expression (parser);
- maybe_warn_cpp0x ("lambda expressions");
+ maybe_warn_cpp0x (CPP0X_LAMBDA_EXPR);
return cp_parser_lambda_expression (parser);
case CPP_OBJC_STRING:
@@ -3890,7 +3896,7 @@ cp_parser_unqualified_id (cp_parser* parser,
if (scope
&& token->type == CPP_NAME
&& (cp_lexer_peek_nth_token (parser->lexer, 2)->type
- == CPP_OPEN_PAREN)
+ != CPP_LESS)
&& constructor_name_p (token->u.value, scope))
{
cp_lexer_consume_token (parser->lexer);
@@ -3898,7 +3904,11 @@ cp_parser_unqualified_id (cp_parser* parser,
}
/* If there was an explicit qualification (S::~T), first look
- in the scope given by the qualification (i.e., S). */
+ in the scope given by the qualification (i.e., S).
+
+ Note: in the calls to cp_parser_class_name below we pretend that
+ the lookup had an explicit 'class' tag so that lookup finds the
+ injected-class-name rather than the constructor. */
done = false;
type_decl = NULL_TREE;
if (scope)
@@ -3907,7 +3917,7 @@ cp_parser_unqualified_id (cp_parser* parser,
type_decl = cp_parser_class_name (parser,
/*typename_keyword_p=*/false,
/*template_keyword_p=*/false,
- none_type,
+ class_type,
/*check_dependency=*/false,
/*class_head_p=*/false,
declarator_p);
@@ -3925,7 +3935,7 @@ cp_parser_unqualified_id (cp_parser* parser,
= cp_parser_class_name (parser,
/*typename_keyword_p=*/false,
/*template_keyword_p=*/false,
- none_type,
+ class_type,
/*check_dependency=*/false,
/*class_head_p=*/false,
declarator_p);
@@ -3943,7 +3953,7 @@ cp_parser_unqualified_id (cp_parser* parser,
= cp_parser_class_name (parser,
/*typename_keyword_p=*/false,
/*template_keyword_p=*/false,
- none_type,
+ class_type,
/*check_dependency=*/false,
/*class_head_p=*/false,
declarator_p);
@@ -3962,7 +3972,7 @@ cp_parser_unqualified_id (cp_parser* parser,
= cp_parser_class_name (parser,
/*typename_keyword_p=*/false,
/*template_keyword_p=*/false,
- none_type,
+ class_type,
/*check_dependency=*/false,
/*class_head_p=*/false,
declarator_p);
@@ -5275,7 +5285,7 @@ cp_parser_parenthesized_expression_list (cp_parser* parser,
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
/* A braced-init-list. */
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
expr = cp_parser_braced_list (parser, &expr_non_constant_p);
if (non_constant_p && expr_non_constant_p)
*non_constant_p = true;
@@ -5992,7 +6002,7 @@ cp_parser_new_initializer (cp_parser* parser)
{
tree t;
bool expr_non_constant_p;
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
t = cp_parser_braced_list (parser, &expr_non_constant_p);
CONSTRUCTOR_IS_DIRECT_INIT (t) = 1;
expression_list = make_tree_vector_single (t);
@@ -6553,7 +6563,7 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p,
tree rhs = cp_parser_initializer_clause (parser, &non_constant_p);
if (BRACE_ENCLOSED_INITIALIZER_P (rhs))
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
/* An assignment may not appear in a
constant-expression. */
@@ -8143,7 +8153,7 @@ cp_parser_condition (cp_parser* parser)
initializer = cp_parser_initializer_clause (parser, &non_constant_p);
}
if (BRACE_ENCLOSED_INITIALIZER_P (initializer))
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
if (!non_constant_p)
initializer = fold_non_dependent_expr (initializer);
@@ -8407,7 +8417,7 @@ cp_parser_jump_statement (cp_parser* parser)
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
expr = cp_parser_braced_list (parser, &expr_non_constant_p);
}
else if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
@@ -9922,7 +9932,7 @@ cp_parser_mem_initializer (cp_parser* parser)
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
bool expr_non_constant_p;
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
expression_list = cp_parser_braced_list (parser, &expr_non_constant_p);
CONSTRUCTOR_IS_DIRECT_INIT (expression_list) = 1;
expression_list = build_tree_list (NULL_TREE, expression_list);
@@ -11933,7 +11943,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
break;
case RID_AUTO:
- maybe_warn_cpp0x ("C++0x auto");
+ maybe_warn_cpp0x (CPP0X_AUTO);
type = make_auto ();
break;
@@ -12240,7 +12250,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
|| cp_lexer_next_token_is_keyword (parser->lexer, RID_STRUCT))
{
if (cxx_dialect == cxx98)
- maybe_warn_cpp0x ("scoped enums");
+ maybe_warn_cpp0x (CPP0X_SCOPED_ENUMS);
/* Consume the `struct' or `class'. */
cp_lexer_consume_token (parser->lexer);
@@ -12577,7 +12587,7 @@ cp_parser_enum_specifier (cp_parser* parser)
|| cp_lexer_next_token_is_keyword (parser->lexer, RID_STRUCT))
{
if (cxx_dialect == cxx98)
- maybe_warn_cpp0x ("scoped enums");
+ maybe_warn_cpp0x (CPP0X_SCOPED_ENUMS);
/* Consume the `struct' or `class' token. */
cp_lexer_consume_token (parser->lexer);
@@ -12611,7 +12621,7 @@ cp_parser_enum_specifier (cp_parser* parser)
return NULL_TREE;
if (cxx_dialect == cxx98)
- maybe_warn_cpp0x ("scoped enums");
+ maybe_warn_cpp0x (CPP0X_SCOPED_ENUMS);
has_underlying_type = true;
@@ -14275,6 +14285,10 @@ cp_parser_direct_declarator (cp_parser* parser,
unqualified_name = constructor_name (class_type);
sfk = sfk_constructor;
}
+ else if (is_overloaded_fn (unqualified_name)
+ && DECL_CONSTRUCTOR_P (get_first_fn
+ (unqualified_name)))
+ sfk = sfk_constructor;
if (ctor_dtor_or_conv_p && sfk != sfk_none)
*ctor_dtor_or_conv_p = -1;
@@ -15425,7 +15439,7 @@ cp_parser_initializer (cp_parser* parser, bool* is_direct_init,
}
else if (token->type == CPP_OPEN_BRACE)
{
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
init = cp_parser_braced_list (parser, non_constant_p);
CONSTRUCTOR_IS_DIRECT_INIT (init) = 1;
}
@@ -16895,7 +16909,7 @@ cp_parser_pure_specifier (cp_parser* parser)
if (token->keyword == RID_DEFAULT
|| token->keyword == RID_DELETE)
{
- maybe_warn_cpp0x ("defaulted and deleted functions");
+ maybe_warn_cpp0x (CPP0X_DEFAULTED_DELETED);
return token->u.value;
}
@@ -17969,6 +17983,26 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
lookup_member, we must enter the scope here. */
if (dependent_p)
pushed_scope = push_scope (parser->scope);
+
+ /* 3.4.3.1: In a lookup in which the constructor is an acceptable
+ lookup result and the nested-name-specifier nominates a class C:
+ * if the name specified after the nested-name-specifier, when
+ looked up in C, is the injected-class-name of C (Clause 9), or
+ * if the name specified after the nested-name-specifier is the
+ same as the identifier or the simple-template-id's template-
+ name in the last component of the nested-name-specifier,
+ the name is instead considered to name the constructor of
+ class C. [ Note: for example, the constructor is not an
+ acceptable lookup result in an elaborated-type-specifier so
+ the constructor would not be used in place of the
+ injected-class-name. --end note ] Such a constructor name
+ shall be used only in the declarator-id of a declaration that
+ names a constructor or in a using-declaration. */
+ if (tag_type == none_type
+ && CLASS_TYPE_P (parser->scope)
+ && constructor_name_p (name, parser->scope))
+ name = ctor_identifier;
+
/* If the PARSER->SCOPE is a template specialization, it
may be instantiated during name lookup. In that case,
errors may be issued. Even if we rollback the current
@@ -18320,8 +18354,7 @@ static bool
cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
{
bool constructor_p;
- tree type_decl = NULL_TREE;
- bool nested_name_p;
+ tree nested_name_specifier;
cp_token *next_token;
/* The common case is that this is not a constructor declarator, so
@@ -18347,34 +18380,48 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
cp_parser_global_scope_opt (parser,
/*current_scope_valid_p=*/false);
/* Look for the nested-name-specifier. */
- nested_name_p
+ nested_name_specifier
= (cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/false,
/*type_p=*/false,
- /*is_declaration=*/false)
- != NULL_TREE);
+ /*is_declaration=*/false));
/* Outside of a class-specifier, there must be a
nested-name-specifier. */
- if (!nested_name_p &&
+ if (!nested_name_specifier &&
(!at_class_scope_p () || !TYPE_BEING_DEFINED (current_class_type)
|| friend_p))
constructor_p = false;
+ else if (nested_name_specifier == error_mark_node)
+ constructor_p = false;
+
+ /* If we have a class scope, this is easy; DR 147 says that S::S always
+ names the constructor, and no other qualified name could. */
+ if (constructor_p && nested_name_specifier
+ && TYPE_P (nested_name_specifier))
+ {
+ tree id = cp_parser_unqualified_id (parser,
+ /*template_keyword_p=*/false,
+ /*check_dependency_p=*/false,
+ /*declarator_p=*/true,
+ /*optional_p=*/false);
+ if (is_overloaded_fn (id))
+ id = DECL_NAME (get_first_fn (id));
+ if (!constructor_name_p (id, nested_name_specifier))
+ constructor_p = false;
+ }
/* If we still think that this might be a constructor-declarator,
look for a class-name. */
- if (constructor_p)
+ else if (constructor_p)
{
/* If we have:
- template <typename T> struct S { S(); };
- template <typename T> S<T>::S ();
-
- we must recognize that the nested `S' names a class.
- Similarly, for:
+ template <typename T> struct S {
+ S();
+ };
- template <typename T> S<T>::S<T> ();
-
- we must recognize that the nested `S' names a template. */
+ we must recognize that the nested `S' names a class. */
+ tree type_decl;
type_decl = cp_parser_class_name (parser,
/*typename_keyword_p=*/false,
/*template_keyword_p=*/false,
@@ -18384,22 +18431,23 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
/*is_declaration=*/false);
/* If there was no class-name, then this is not a constructor. */
constructor_p = !cp_parser_error_occurred (parser);
- }
- /* If we're still considering a constructor, we have to see a `(',
- to begin the parameter-declaration-clause, followed by either a
- `)', an `...', or a decl-specifier. We need to check for a
- type-specifier to avoid being fooled into thinking that:
+ /* If we're still considering a constructor, we have to see a `(',
+ to begin the parameter-declaration-clause, followed by either a
+ `)', an `...', or a decl-specifier. We need to check for a
+ type-specifier to avoid being fooled into thinking that:
- S::S (f) (int);
+ S (f) (int);
- is a constructor. (It is actually a function named `f' that
- takes one parameter (of type `int') and returns a value of type
- `S::S'. */
- if (constructor_p
- && cp_parser_require (parser, CPP_OPEN_PAREN, "%<(%>"))
- {
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)
+ is a constructor. (It is actually a function named `f' that
+ takes one parameter (of type `int') and returns a value of type
+ `S'. */
+ if (constructor_p
+ && !cp_parser_require (parser, CPP_OPEN_PAREN, "%<(%>"))
+ constructor_p = false;
+
+ if (constructor_p
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)
&& cp_lexer_next_token_is_not (parser->lexer, CPP_ELLIPSIS)
/* A parameter declaration begins with a decl-specifier,
which is either the "attribute" keyword, a storage class
@@ -18454,8 +18502,7 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
constructor_p = !cp_parser_error_occurred (parser);
}
}
- else
- constructor_p = false;
+
/* We did not really want to consume any tokens. */
cp_parser_abort_tentative_parse (parser);
@@ -18895,7 +18942,7 @@ cp_parser_functional_cast (cp_parser* parser, tree type)
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
- maybe_warn_cpp0x ("extended initializer lists");
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
expression_list = cp_parser_braced_list (parser, &nonconst_p);
CONSTRUCTOR_IS_DIRECT_INIT (expression_list) = 1;
if (TREE_CODE (type) == TYPE_DECL)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9c82e3c19a5..0a194440ae6 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3795,12 +3795,11 @@ process_partial_specialization (tree decl)
|| (!packed_args && i < nargs - 1))
{
if (TREE_CODE (arg) == EXPR_PACK_EXPANSION)
- error ("parameter pack argument %qE must be at the end of the template argument list", arg);
+ error ("parameter pack argument %qE must be at the "
+ "end of the template argument list", arg);
else
- error ("parameter pack argument %qT must be at the end of the template argument list", arg);
-
- if (packed_args)
- TREE_VEC_ELT (packed_args, j) = error_mark_node;
+ error ("parameter pack argument %qT must be at the "
+ "end of the template argument list", arg);
}
}
@@ -5370,6 +5369,22 @@ convert_template_argument (tree parm,
if (TREE_CODE (arg) == TYPE_PACK_EXPANSION)
arg = PACK_EXPANSION_PATTERN (arg);
+ /* Deal with an injected-class-name used as a template template arg. */
+ if (requires_tmpl_type && CLASS_TYPE_P (arg))
+ {
+ tree t = maybe_get_template_decl_from_type_decl (TYPE_NAME (arg));
+ if (TREE_CODE (t) == TEMPLATE_DECL)
+ {
+ if (complain & tf_warning_or_error)
+ pedwarn (input_location, OPT_pedantic, "injected-class-name %qD"
+ " used as template template argument", TYPE_NAME (arg));
+ else if (flag_pedantic_errors)
+ t = arg;
+
+ arg = t;
+ }
+ }
+
is_tmpl_type =
((TREE_CODE (arg) == TEMPLATE_DECL
&& TREE_CODE (DECL_TEMPLATE_RESULT (arg)) == TYPE_DECL)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c1df24bfffa..7401593bcc6 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3315,8 +3315,8 @@ emit_associated_thunks (tree fn)
/* Generate RTL for FN. */
-void
-expand_or_defer_fn (tree fn)
+bool
+expand_or_defer_fn_1 (tree fn)
{
/* When the parser calls us after finishing the body of a template
function, we don't really want to expand the body. */
@@ -3330,7 +3330,7 @@ expand_or_defer_fn (tree fn)
is not a GC root. */
if (!function_depth)
ggc_collect ();
- return;
+ return false;
}
gcc_assert (DECL_SAVED_TREE (fn));
@@ -3343,7 +3343,7 @@ expand_or_defer_fn (tree fn)
it out, even though we haven't. */
TREE_ASM_WRITTEN (fn) = 1;
DECL_SAVED_TREE (fn) = NULL_TREE;
- return;
+ return false;
}
/* We make a decision about linkage for these functions at the end
@@ -3390,14 +3390,23 @@ expand_or_defer_fn (tree fn)
/* There's no reason to do any of the work here if we're only doing
semantic analysis; this code just generates RTL. */
if (flag_syntax_only)
- return;
+ return false;
- function_depth++;
+ return true;
+}
+
+void
+expand_or_defer_fn (tree fn)
+{
+ if (expand_or_defer_fn_1 (fn))
+ {
+ function_depth++;
- /* Expand or defer, at the whim of the compilation unit manager. */
- cgraph_finalize_function (fn, function_depth > 1);
+ /* Expand or defer, at the whim of the compilation unit manager. */
+ cgraph_finalize_function (fn, function_depth > 1);
- function_depth--;
+ function_depth--;
+ }
}
struct nrv_data
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 3a9525913d1..307825f6516 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -421,10 +421,11 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
}
/* Subroutine of composite_pointer_type to implement the recursive
- case. See that function for documentation fo the parameters. */
+ case. See that function for documentation of the parameters. */
static tree
-composite_pointer_type_r (tree t1, tree t2, const char* location,
+composite_pointer_type_r (tree t1, tree t2,
+ composite_pointer_operation operation,
tsubst_flags_t complain)
{
tree pointee1;
@@ -457,14 +458,33 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
&& TREE_CODE (pointee2) == POINTER_TYPE)
|| (TYPE_PTR_TO_MEMBER_P (pointee1)
&& TYPE_PTR_TO_MEMBER_P (pointee2)))
- result_type = composite_pointer_type_r (pointee1, pointee2, location,
+ result_type = composite_pointer_type_r (pointee1, pointee2, operation,
complain);
else
{
if (complain & tf_error)
- permerror (input_location, "%s between distinct pointer types %qT and %qT "
- "lacks a cast",
- location, t1, t2);
+ {
+ switch (operation)
+ {
+ case CPO_COMPARISON:
+ permerror (input_location, "comparison between "
+ "distinct pointer types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ case CPO_CONVERSION:
+ permerror (input_location, "conversion between "
+ "distinct pointer types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ case CPO_CONDITIONAL_EXPR:
+ permerror (input_location, "conditional expression between "
+ "distinct pointer types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
result_type = void_type_node;
}
result_type = cp_build_qualified_type (result_type,
@@ -477,9 +497,28 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2))
&& (complain & tf_error))
- permerror (input_location, "%s between distinct pointer types %qT and %qT "
- "lacks a cast",
- location, t1, t2);
+ {
+ switch (operation)
+ {
+ case CPO_COMPARISON:
+ permerror (input_location, "comparison between "
+ "distinct pointer types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ case CPO_CONVERSION:
+ permerror (input_location, "conversion between "
+ "distinct pointer types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ case CPO_CONDITIONAL_EXPR:
+ permerror (input_location, "conditional expression between "
+ "distinct pointer types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
result_type);
}
@@ -492,15 +531,17 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
}
/* Return the composite pointer type (see [expr.rel]) for T1 and T2.
- ARG1 and ARG2 are the values with those types. The LOCATION is a
- string describing the current location, in case an error occurs.
+ ARG1 and ARG2 are the values with those types. The OPERATION is to
+ describe the operation between the pointer types,
+ in case an error occurs.
This routine also implements the computation of a common type for
pointers-to-members as per [expr.eq]. */
tree
composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
- const char* location, tsubst_flags_t complain)
+ composite_pointer_operation operation,
+ tsubst_flags_t complain)
{
tree class1;
tree class2;
@@ -539,9 +580,28 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
tree result_type;
if (TYPE_PTRFN_P (t2) && (complain & tf_error))
- pedwarn (input_location, OPT_pedantic, "ISO C++ forbids %s "
- "between pointer of type %<void *%> and pointer-to-function",
- location);
+ {
+ switch (operation)
+ {
+ case CPO_COMPARISON:
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids comparison between "
+ "pointer of type %<void *%> and pointer-to-function");
+ break;
+ case CPO_CONVERSION:
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids conversion between "
+ "pointer of type %<void *%> and pointer-to-function");
+ break;
+ case CPO_CONDITIONAL_EXPR:
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids conditional expression between "
+ "pointer of type %<void *%> and pointer-to-function");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
result_type
= cp_build_qualified_type (void_type_node,
(cp_type_quals (TREE_TYPE (t1))
@@ -577,17 +637,32 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
t1 = (build_pointer_type
(cp_build_qualified_type (class2, TYPE_QUALS (class1))));
else
- {
- if (complain & tf_error)
- error ("%s between distinct pointer types %qT and %qT "
- "lacks a cast", location, t1, t2);
- return error_mark_node;
- }
+ {
+ if (complain & tf_error)
+ switch (operation)
+ {
+ case CPO_COMPARISON:
+ error ("comparison between distinct "
+ "pointer types %qT and %qT lacks a cast", t1, t2);
+ break;
+ case CPO_CONVERSION:
+ error ("conversion between distinct "
+ "pointer types %qT and %qT lacks a cast", t1, t2);
+ break;
+ case CPO_CONDITIONAL_EXPR:
+ error ("conditional expression between distinct "
+ "pointer types %qT and %qT lacks a cast", t1, t2);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ return error_mark_node;
+ }
}
/* [expr.eq] permits the application of a pointer-to-member
conversion to change the class type of one of the types. */
else if (TYPE_PTR_TO_MEMBER_P (t1)
- && !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
+ && !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2)))
{
class1 = TYPE_PTRMEM_CLASS_TYPE (t1);
@@ -598,15 +673,33 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
else if (DERIVED_FROM_P (class2, class1))
t2 = build_ptrmem_type (class1, TYPE_PTRMEM_POINTED_TO_TYPE (t2));
else
- {
- if (complain & tf_error)
- error ("%s between distinct pointer-to-member types %qT and %qT "
- "lacks a cast", location, t1, t2);
- return error_mark_node;
- }
+ {
+ if (complain & tf_error)
+ switch (operation)
+ {
+ case CPO_COMPARISON:
+ error ("comparison between distinct "
+ "pointer-to-member types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ case CPO_CONVERSION:
+ error ("conversion between distinct "
+ "pointer-to-member types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ case CPO_CONDITIONAL_EXPR:
+ error ("conditional expression between distinct "
+ "pointer-to-member types %qT and %qT lacks a cast",
+ t1, t2);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ return error_mark_node;
+ }
}
- return composite_pointer_type_r (t1, t2, location, complain);
+ return composite_pointer_type_r (t1, t2, operation, complain);
}
/* Return the merged type of two types.
@@ -820,7 +913,7 @@ common_pointer_type (tree t1, tree t2)
|| (TYPE_PTRMEMFUNC_P (t1) && TYPE_PTRMEMFUNC_P (t2)));
return composite_pointer_type (t1, t2, error_mark_node, error_mark_node,
- "conversion", tf_warning_or_error);
+ CPO_CONVERSION, tf_warning_or_error);
}
/* Compare two exception specifier types for exactness or subsetness, if
@@ -2336,6 +2429,14 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE
|| TREE_CODE (name) == BIT_NOT_EXPR);
+ if (constructor_name_p (name, scope))
+ {
+ if (complain & tf_error)
+ error ("cannot call constructor %<%T::%D%> directly",
+ scope, name);
+ return error_mark_node;
+ }
+
/* Find the base of OBJECT_TYPE corresponding to SCOPE. */
access_path = lookup_base (object_type, scope, ba_check, NULL);
if (access_path == error_mark_node)
@@ -3683,7 +3784,7 @@ cp_build_binary_op (location_t location,
else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE)
|| (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1)))
result_type = composite_pointer_type (type0, type1, op0, op1,
- "comparison", complain);
+ CPO_COMPARISON, complain);
else if ((code0 == POINTER_TYPE || TYPE_PTRMEM_P (type0))
&& null_ptr_cst_p (op1))
{
@@ -3772,8 +3873,8 @@ cp_build_binary_op (location_t location,
tree delta0;
tree delta1;
- type = composite_pointer_type (type0, type1, op0, op1, "comparison",
- complain);
+ type = composite_pointer_type (type0, type1, op0, op1,
+ CPO_COMPARISON, complain);
if (!same_type_p (TREE_TYPE (op0), type))
op0 = cp_convert_and_check (type, op0);
@@ -3884,7 +3985,7 @@ cp_build_binary_op (location_t location,
shorten = 1;
else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
result_type = composite_pointer_type (type0, type1, op0, op1,
- "comparison", complain);
+ CPO_COMPARISON, complain);
break;
case LE_EXPR:
@@ -3904,7 +4005,7 @@ cp_build_binary_op (location_t location,
short_compare = 1;
else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
result_type = composite_pointer_type (type0, type1, op0, op1,
- "comparison", complain);
+ CPO_COMPARISON, complain);
else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST
&& integer_zerop (op1))
result_type = type0;
@@ -5346,6 +5447,14 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
orig = expr;
+ /* Resolve overloaded address here rather than once in
+ implicit_conversion and again in the inverse code below. */
+ if (TYPE_PTRMEMFUNC_P (type) && type_unknown_p (expr))
+ {
+ expr = instantiate_type (type, expr, complain);
+ intype = TREE_TYPE (expr);
+ }
+
/* [expr.static.cast]
An expression e can be explicitly converted to a type T using a
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 96fa442f6d1..a296caae26e 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -236,6 +236,7 @@ abstract_virtuals_error (tree decl, tree type)
be abstract. */
if (!CLASS_TYPE_P (type))
return 0;
+ type = TYPE_MAIN_VARIANT (type);
/* If the type is incomplete, we register it within a hash table,
so that we can check again once it is completed. This makes sense
@@ -723,7 +724,7 @@ digest_init_r (tree type, tree init, bool nested, int flags)
{
enum tree_code code = TREE_CODE (type);
- if (init == error_mark_node)
+ if (error_operand_p (init))
return error_mark_node;
gcc_assert (init);
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 101234b55bc..c12c00e8a4e 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -829,7 +829,8 @@ df_ref_create (rtx reg, rtx *loc, rtx insn,
/* By adding the ref directly, df_insn_rescan my not find any
differences even though the block will have changed. So we need
to mark the block dirty ourselves. */
- df_set_bb_dirty (bb);
+ if (!DEBUG_INSN_P (DF_REF_INSN (ref)))
+ df_set_bb_dirty (bb);
return ref;
}
@@ -1027,7 +1028,8 @@ df_ref_remove (df_ref ref)
/* By deleting the ref directly, df_insn_rescan my not find any
differences even though the block will have changed. So we need
to mark the block dirty ourselves. */
- df_set_bb_dirty (DF_REF_BB (ref));
+ if (!DEBUG_INSN_P (DF_REF_INSN (ref)))
+ df_set_bb_dirty (DF_REF_BB (ref));
df_reg_chain_unlink (ref);
}
diff --git a/gcc/doc/arm-neon-intrinsics.texi b/gcc/doc/arm-neon-intrinsics.texi
index c35662c01e9..0016111d247 100644
--- a/gcc/doc/arm-neon-intrinsics.texi
+++ b/gcc/doc/arm-neon-intrinsics.texi
@@ -4696,7 +4696,7 @@
@itemize @bullet
@item uint32_t vget_lane_u32 (uint32x2_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov.u32 @var{r0}, @var{d0}[@var{0}]}
+@*@emph{Form of expected instruction(s):} @code{vmov.32 @var{r0}, @var{d0}[@var{0}]}
@end itemize
@@ -4714,7 +4714,7 @@
@itemize @bullet
@item int32_t vget_lane_s32 (int32x2_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov.s32 @var{r0}, @var{d0}[@var{0}]}
+@*@emph{Form of expected instruction(s):} @code{vmov.32 @var{r0}, @var{d0}[@var{0}]}
@end itemize
@@ -4732,7 +4732,7 @@
@itemize @bullet
@item float32_t vget_lane_f32 (float32x2_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov.f32 @var{r0}, @var{d0}[@var{0}]}
+@*@emph{Form of expected instruction(s):} @code{vmov.32 @var{r0}, @var{d0}[@var{0}]}
@end itemize
@@ -4762,7 +4762,7 @@
@itemize @bullet
@item uint32_t vgetq_lane_u32 (uint32x4_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov.u32 @var{r0}, @var{d0}[@var{0}]}
+@*@emph{Form of expected instruction(s):} @code{vmov.32 @var{r0}, @var{d0}[@var{0}]}
@end itemize
@@ -4780,7 +4780,7 @@
@itemize @bullet
@item int32_t vgetq_lane_s32 (int32x4_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov.s32 @var{r0}, @var{d0}[@var{0}]}
+@*@emph{Form of expected instruction(s):} @code{vmov.32 @var{r0}, @var{d0}[@var{0}]}
@end itemize
@@ -4798,7 +4798,7 @@
@itemize @bullet
@item float32_t vgetq_lane_f32 (float32x4_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov.f32 @var{r0}, @var{d0}[@var{0}]}
+@*@emph{Form of expected instruction(s):} @code{vmov.32 @var{r0}, @var{d0}[@var{0}]}
@end itemize
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 724473798de..9d549920681 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7731,7 +7731,7 @@ debug information format adopted by the target, however, it can
make debugging impossible, since variables will no longer stay in
a ``home register''.
-Enabled by default with @option{-funroll-loops}.
+Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
@item -ftracer
@opindex ftracer
@@ -9760,7 +9760,7 @@ assembly code. Permissible names are: @samp{arm2}, @samp{arm250},
@samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
@samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
@samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
-@samp{cortex-a8}, @samp{cortex-a9},
+@samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9},
@samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
@samp{cortex-m1},
@samp{cortex-m0},
@@ -9800,8 +9800,8 @@ This specifies what floating point hardware (or hardware emulation) is
available on the target. Permissible names are: @samp{fpa}, @samp{fpe2},
@samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
@samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
-@samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16} and
-@samp{neon-vfpv4}.
+@samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
+@samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
@option{-mfp} and @option{-mfpe} are synonyms for
@option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
of GCC@.
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index 6639a4e209a..eb1008e8f2c 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -105,6 +105,25 @@ The function @code{plugin_default_version_check} takes two pointers to
such structure and compare them field by field. It can be used by the
plugin's @code{plugin_init} function.
+The version of GCC used to compile the plugin can be found in the symbol
+@code{gcc_version} defined in the header @file{plugin-version.h}. The
+recommended version check to perform looks like
+
+@smallexample
+#include "plugin-version.h"
+...
+
+int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+@{
+ if (!plugin_default_version_check (version, &gcc_version))
+ return 1;
+
+@}
+@end smallexample
+
+but you can also check the individual fields if you want a less strict check.
@subsection Plugin callbacks
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2ebe0ae522b..0394114e1d6 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -14309,13 +14309,17 @@ loc_list_from_tree (tree loc, int want_address)
case RESULT_DECL:
case FUNCTION_DECL:
{
- rtx rtl = rtl_for_decl_location (loc);
+ rtx rtl;
var_loc_list *loc_list = lookup_decl_loc (loc);
if (loc_list && loc_list->first
&& (list_ret = dw_loc_list (loc_list, loc, want_address)))
- have_address = want_address != 0;
- else if (rtl == NULL_RTX)
+ {
+ have_address = want_address != 0;
+ break;
+ }
+ rtl = rtl_for_decl_location (loc);
+ if (rtl == NULL_RTX)
{
expansion_failed (loc, NULL_RTX, "DECL has no RTL");
return 0;
@@ -15605,6 +15609,27 @@ rtl_for_decl_location (tree decl)
if (rtl)
rtl = avoid_constant_pool_reference (rtl);
+ /* Try harder to get a rtl. If this symbol ends up not being emitted
+ in the current CU, resolve_addr will remove the expression referencing
+ it. */
+ if (rtl == NULL_RTX
+ && TREE_CODE (decl) == VAR_DECL
+ && !DECL_EXTERNAL (decl)
+ && TREE_STATIC (decl)
+ && DECL_NAME (decl)
+ && !DECL_HARD_REGISTER (decl)
+ && DECL_MODE (decl) != VOIDmode)
+ {
+ rtl = DECL_RTL (decl);
+ /* Reset DECL_RTL back, as various parts of the compiler expects
+ DECL_RTL set meaning it is actually going to be output. */
+ SET_DECL_RTL (decl, NULL);
+ if (!MEM_P (rtl)
+ || GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF
+ || SYMBOL_REF_DECL (XEXP (rtl, 0)) != decl)
+ rtl = NULL_RTX;
+ }
+
return rtl;
}
@@ -19064,7 +19089,7 @@ get_context_die (tree context)
{
/* Find die that represents this context. */
if (TYPE_P (context))
- return force_type_die (context);
+ return force_type_die (TYPE_MAIN_VARIANT (context));
else
return force_decl_die (context);
}
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 19e4a293367..234a0d166b9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,36 @@
+2009-11-20 Janus Weil <janus@gcc.gnu.org>
+
+ * intrinsic.texi (C_F_PROCPOINTER): Remove obsolete comment.
+
+2009-11-20 Paul Thomas <pault@gcc.gnu.org>
+ Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/42104
+ * trans-expr.c (gfc_conv_procedure_call): If procedure pointer
+ component call, use the component's 'always_explicit' attr
+ for array arguments.
+
+2009-11-19 Janus Weil <janus@gcc.gnu.org>
+
+ * trans-expr.c (conv_isocbinding_procedure): New function.
+ (gfc_conv_procedure_call): Move ISO_C_BINDING stuff to
+ separate function.
+
+2009-11-19 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.texi (Interoperable Subroutines and Functions): Fix
+ example.
+
+2009-11-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/42072
+ * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointer
+ dummies which are passed to C_F_PROCPOINTER.
+
+2009-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * module.c (mio_f2k_derived): Initialize op.
+
2009-11-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/42048
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index c4992ef2bce..1430c8a658e 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -2009,9 +2009,10 @@ Thus the following C prototype
matches the Fortran declaration
@smallexample
- integer(c_int) func(i,j)
- integer, VALUE :: i
- integer :: j
+ integer(c_int) function func(i,j)
+ use iso_c_binding, only: c_int
+ integer(c_int), VALUE :: i
+ integer(c_int) :: j
@end smallexample
Note that pointer arguments also frequently need the @code{VALUE} attribute.
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 7e01315a41f..615f0364e1c 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -2005,9 +2005,6 @@ end program main
@code{C_F_PROCPOINTER(CPTR, FPTR)} Assign the target of the C function pointer
@var{CPTR} to the Fortran procedure pointer @var{FPTR}.
-Note: Due to the currently lacking support of procedure pointers in GNU Fortran
-this function is not fully operable.
-
@item @emph{Standard}:
Fortran 2003 and later
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index b2ad6ecc477..43acd450062 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3469,7 +3469,7 @@ mio_f2k_derived (gfc_namespace *f2k)
else
while (peek_atom () != ATOM_RPAREN)
{
- gfc_intrinsic_op op;
+ gfc_intrinsic_op op = 0; /* Silence GCC. */
mio_lparen ();
mio_intrinsic_op (&op);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 5a45f4f6368..6646b266a6d 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2533,6 +2533,150 @@ conv_arglist_function (gfc_se *se, gfc_expr *expr, const char *name)
}
+/* The following routine generates code for the intrinsic
+ procedures from the ISO_C_BINDING module:
+ * C_LOC (function)
+ * C_FUNLOC (function)
+ * C_F_POINTER (subroutine)
+ * C_F_PROCPOINTER (subroutine)
+ * C_ASSOCIATED (function)
+ One exception which is not handled here is C_F_POINTER with non-scalar
+ arguments. Returns 1 if the call was replaced by inline code (else: 0). */
+
+static int
+conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
+ gfc_actual_arglist * arg)
+{
+ gfc_symbol *fsym;
+ gfc_ss *argss;
+
+ if (sym->intmod_sym_id == ISOCBINDING_LOC)
+ {
+ if (arg->expr->rank == 0)
+ gfc_conv_expr_reference (se, arg->expr);
+ else
+ {
+ int f;
+ /* This is really the actual arg because no formal arglist is
+ created for C_LOC. */
+ fsym = arg->expr->symtree->n.sym;
+
+ /* We should want it to do g77 calling convention. */
+ f = (fsym != NULL)
+ && !(fsym->attr.pointer || fsym->attr.allocatable)
+ && fsym->as->type != AS_ASSUMED_SHAPE;
+ f = f || !sym->attr.always_explicit;
+
+ argss = gfc_walk_expr (arg->expr);
+ gfc_conv_array_parameter (se, arg->expr, argss, f,
+ NULL, NULL, NULL);
+ }
+
+ /* TODO -- the following two lines shouldn't be necessary, but if
+ they're removed, a bug is exposed later in the code path.
+ This workaround was thus introduced, but will have to be
+ removed; please see PR 35150 for details about the issue. */
+ se->expr = convert (pvoid_type_node, se->expr);
+ se->expr = gfc_evaluate_now (se->expr, &se->pre);
+
+ return 1;
+ }
+ else if (sym->intmod_sym_id == ISOCBINDING_FUNLOC)
+ {
+ arg->expr->ts.type = sym->ts.u.derived->ts.type;
+ arg->expr->ts.f90_type = sym->ts.u.derived->ts.f90_type;
+ arg->expr->ts.kind = sym->ts.u.derived->ts.kind;
+ gfc_conv_expr_reference (se, arg->expr);
+
+ return 1;
+ }
+ else if ((sym->intmod_sym_id == ISOCBINDING_F_POINTER
+ && arg->next->expr->rank == 0)
+ || sym->intmod_sym_id == ISOCBINDING_F_PROCPOINTER)
+ {
+ /* Convert c_f_pointer if fptr is a scalar
+ and convert c_f_procpointer. */
+ gfc_se cptrse;
+ gfc_se fptrse;
+
+ gfc_init_se (&cptrse, NULL);
+ gfc_conv_expr (&cptrse, arg->expr);
+ gfc_add_block_to_block (&se->pre, &cptrse.pre);
+ gfc_add_block_to_block (&se->post, &cptrse.post);
+
+ gfc_init_se (&fptrse, NULL);
+ if (sym->intmod_sym_id == ISOCBINDING_F_POINTER
+ || gfc_is_proc_ptr_comp (arg->next->expr, NULL))
+ fptrse.want_pointer = 1;
+
+ gfc_conv_expr (&fptrse, arg->next->expr);
+ gfc_add_block_to_block (&se->pre, &fptrse.pre);
+ gfc_add_block_to_block (&se->post, &fptrse.post);
+
+ if (arg->next->expr->symtree->n.sym->attr.proc_pointer
+ && arg->next->expr->symtree->n.sym->attr.dummy)
+ fptrse.expr = build_fold_indirect_ref_loc (input_location,
+ fptrse.expr);
+
+ se->expr = fold_build2 (MODIFY_EXPR, TREE_TYPE (fptrse.expr),
+ fptrse.expr,
+ fold_convert (TREE_TYPE (fptrse.expr),
+ cptrse.expr));
+
+ return 1;
+ }
+ else if (sym->intmod_sym_id == ISOCBINDING_ASSOCIATED)
+ {
+ gfc_se arg1se;
+ gfc_se arg2se;
+
+ /* Build the addr_expr for the first argument. The argument is
+ already an *address* so we don't need to set want_pointer in
+ the gfc_se. */
+ gfc_init_se (&arg1se, NULL);
+ gfc_conv_expr (&arg1se, arg->expr);
+ gfc_add_block_to_block (&se->pre, &arg1se.pre);
+ gfc_add_block_to_block (&se->post, &arg1se.post);
+
+ /* See if we were given two arguments. */
+ if (arg->next == NULL)
+ /* Only given one arg so generate a null and do a
+ not-equal comparison against the first arg. */
+ se->expr = fold_build2 (NE_EXPR, boolean_type_node, arg1se.expr,
+ fold_convert (TREE_TYPE (arg1se.expr),
+ null_pointer_node));
+ else
+ {
+ tree eq_expr;
+ tree not_null_expr;
+
+ /* Given two arguments so build the arg2se from second arg. */
+ gfc_init_se (&arg2se, NULL);
+ gfc_conv_expr (&arg2se, arg->next->expr);
+ gfc_add_block_to_block (&se->pre, &arg2se.pre);
+ gfc_add_block_to_block (&se->post, &arg2se.post);
+
+ /* Generate test to compare that the two args are equal. */
+ eq_expr = fold_build2 (EQ_EXPR, boolean_type_node,
+ arg1se.expr, arg2se.expr);
+ /* Generate test to ensure that the first arg is not null. */
+ not_null_expr = fold_build2 (NE_EXPR, boolean_type_node,
+ arg1se.expr, null_pointer_node);
+
+ /* Finally, the generated test must check that both arg1 is not
+ NULL and that it is equal to the second arg. */
+ se->expr = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
+ not_null_expr, eq_expr);
+ }
+
+ return 1;
+ }
+
+ /* Nothing was done. */
+ return 0;
+}
+
+
/* Generate code for a procedure call. Note can return se->post != NULL.
If se->direct_byref is set then se->expr contains the return parameter.
Return nonzero, if the call has alternate specifiers.
@@ -2576,127 +2720,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
len = NULL_TREE;
gfc_clear_ts (&ts);
- if (sym->from_intmod == INTMOD_ISO_C_BINDING)
- {
- if (sym->intmod_sym_id == ISOCBINDING_LOC)
- {
- if (arg->expr->rank == 0)
- gfc_conv_expr_reference (se, arg->expr);
- else
- {
- int f;
- /* This is really the actual arg because no formal arglist is
- created for C_LOC. */
- fsym = arg->expr->symtree->n.sym;
-
- /* We should want it to do g77 calling convention. */
- f = (fsym != NULL)
- && !(fsym->attr.pointer || fsym->attr.allocatable)
- && fsym->as->type != AS_ASSUMED_SHAPE;
- f = f || !sym->attr.always_explicit;
-
- argss = gfc_walk_expr (arg->expr);
- gfc_conv_array_parameter (se, arg->expr, argss, f,
- NULL, NULL, NULL);
- }
-
- /* TODO -- the following two lines shouldn't be necessary, but
- they're removed a bug is exposed later in the codepath.
- This is workaround was thus introduced, but will have to be
- removed; please see PR 35150 for details about the issue. */
- se->expr = convert (pvoid_type_node, se->expr);
- se->expr = gfc_evaluate_now (se->expr, &se->pre);
-
- return 0;
- }
- else if (sym->intmod_sym_id == ISOCBINDING_FUNLOC)
- {
- arg->expr->ts.type = sym->ts.u.derived->ts.type;
- arg->expr->ts.f90_type = sym->ts.u.derived->ts.f90_type;
- arg->expr->ts.kind = sym->ts.u.derived->ts.kind;
- gfc_conv_expr_reference (se, arg->expr);
-
- return 0;
- }
- else if ((sym->intmod_sym_id == ISOCBINDING_F_POINTER
- && arg->next->expr->rank == 0)
- || sym->intmod_sym_id == ISOCBINDING_F_PROCPOINTER)
- {
- /* Convert c_f_pointer if fptr is a scalar
- and convert c_f_procpointer. */
- gfc_se cptrse;
- gfc_se fptrse;
-
- gfc_init_se (&cptrse, NULL);
- gfc_conv_expr (&cptrse, arg->expr);
- gfc_add_block_to_block (&se->pre, &cptrse.pre);
- gfc_add_block_to_block (&se->post, &cptrse.post);
-
- gfc_init_se (&fptrse, NULL);
- if (sym->intmod_sym_id == ISOCBINDING_F_POINTER
- || gfc_is_proc_ptr_comp (arg->next->expr, NULL))
- fptrse.want_pointer = 1;
-
- gfc_conv_expr (&fptrse, arg->next->expr);
- gfc_add_block_to_block (&se->pre, &fptrse.pre);
- gfc_add_block_to_block (&se->post, &fptrse.post);
-
- if (gfc_is_proc_ptr_comp (arg->next->expr, NULL))
- tmp = gfc_get_ppc_type (arg->next->expr->ref->u.c.component);
- else
- tmp = TREE_TYPE (arg->next->expr->symtree->n.sym->backend_decl);
- se->expr = fold_build2 (MODIFY_EXPR, tmp, fptrse.expr,
- fold_convert (tmp, cptrse.expr));
-
- return 0;
- }
- else if (sym->intmod_sym_id == ISOCBINDING_ASSOCIATED)
- {
- gfc_se arg1se;
- gfc_se arg2se;
-
- /* Build the addr_expr for the first argument. The argument is
- already an *address* so we don't need to set want_pointer in
- the gfc_se. */
- gfc_init_se (&arg1se, NULL);
- gfc_conv_expr (&arg1se, arg->expr);
- gfc_add_block_to_block (&se->pre, &arg1se.pre);
- gfc_add_block_to_block (&se->post, &arg1se.post);
-
- /* See if we were given two arguments. */
- if (arg->next == NULL)
- /* Only given one arg so generate a null and do a
- not-equal comparison against the first arg. */
- se->expr = fold_build2 (NE_EXPR, boolean_type_node, arg1se.expr,
- fold_convert (TREE_TYPE (arg1se.expr),
- null_pointer_node));
- else
- {
- tree eq_expr;
- tree not_null_expr;
-
- /* Given two arguments so build the arg2se from second arg. */
- gfc_init_se (&arg2se, NULL);
- gfc_conv_expr (&arg2se, arg->next->expr);
- gfc_add_block_to_block (&se->pre, &arg2se.pre);
- gfc_add_block_to_block (&se->post, &arg2se.post);
-
- /* Generate test to compare that the two args are equal. */
- eq_expr = fold_build2 (EQ_EXPR, boolean_type_node,
- arg1se.expr, arg2se.expr);
- /* Generate test to ensure that the first arg is not null. */
- not_null_expr = fold_build2 (NE_EXPR, boolean_type_node,
- arg1se.expr, null_pointer_node);
-
- /* Finally, the generated test must check that both arg1 is not
- NULL and that it is equal to the second arg. */
- se->expr = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
- not_null_expr, eq_expr);
- }
-
- return 0;
- }
- }
+ if (sym->from_intmod == INTMOD_ISO_C_BINDING
+ && conv_isocbinding_procedure (se, sym, arg))
+ return 0;
gfc_is_proc_ptr_comp (expr, &comp);
@@ -2953,7 +2979,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
f = (fsym != NULL)
&& !(fsym->attr.pointer || fsym->attr.allocatable)
&& fsym->as->type != AS_ASSUMED_SHAPE;
- f = f || !sym->attr.always_explicit;
+ if (comp)
+ f = f || !comp->attr.always_explicit;
+ else
+ f = f || !sym->attr.always_explicit;
if (e->expr_type == EXPR_VARIABLE
&& is_subref_array (e))
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index da118d02b28..297ebf857a8 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+%option noinput
+
%{
#include "bconfig.h"
#include "system.h"
@@ -28,7 +30,6 @@ along with GCC; see the file COPYING3. If not see
#include "gengtype.h"
-#define YY_NO_INPUT
#define YY_DECL int yylex (const char **yylval)
#define yyterminate() return EOF_TOKEN
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 676e3fd4678..f84a20cd6c1 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1981,6 +1981,39 @@ gimple_set_lhs (gimple stmt, tree lhs)
gcc_unreachable();
}
+/* Replace the LHS of STMT, an assignment, either a GIMPLE_ASSIGN or a
+ GIMPLE_CALL, with NLHS, in preparation for modifying the RHS to an
+ expression with a different value.
+
+ This will update any annotations (say debug bind stmts) referring
+ to the original LHS, so that they use the RHS instead. This is
+ done even if NLHS and LHS are the same, for it is understood that
+ the RHS will be modified afterwards, and NLHS will not be assigned
+ an equivalent value.
+
+ Adjusting any non-annotation uses of the LHS, if needed, is a
+ responsibility of the caller.
+
+ The effect of this call should be pretty much the same as that of
+ inserting a copy of STMT before STMT, and then removing the
+ original stmt, at which time gsi_remove() would have update
+ annotations, but using this function saves all the inserting,
+ copying and removing. */
+
+void
+gimple_replace_lhs (gimple stmt, tree nlhs)
+{
+ if (MAY_HAVE_DEBUG_STMTS)
+ {
+ tree lhs = gimple_get_lhs (stmt);
+
+ gcc_assert (SSA_NAME_DEF_STMT (lhs) == stmt);
+
+ insert_debug_temp_for_var_def (NULL, lhs);
+ }
+
+ gimple_set_lhs (stmt, nlhs);
+}
/* Return a deep copy of statement STMT. All the operands from STMT
are reallocated and copied using unshare_expr. The DEF, USE, VDEF
@@ -2937,9 +2970,14 @@ recalculate_side_effects (tree t)
tree
canonicalize_cond_expr_cond (tree t)
{
+ /* Strip conversions around boolean operations. */
+ if (CONVERT_EXPR_P (t)
+ && truth_value_p (TREE_CODE (TREE_OPERAND (t, 0))))
+ t = TREE_OPERAND (t, 0);
+
/* For (bool)x use x != 0. */
- if (TREE_CODE (t) == NOP_EXPR
- && TREE_TYPE (t) == boolean_type_node)
+ if (CONVERT_EXPR_P (t)
+ && TREE_CODE (TREE_TYPE (t)) == BOOLEAN_TYPE)
{
tree top0 = TREE_OPERAND (t, 0);
t = build2 (NE_EXPR, TREE_TYPE (t),
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 8f6b3522098..f355ab1ba35 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -737,6 +737,7 @@ enum gimple_statement_structure_enum {
union GTY ((desc ("gimple_statement_structure (&%h)"))) gimple_statement_d {
struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
+ struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
@@ -842,6 +843,7 @@ void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
tree, tree);
tree gimple_get_lhs (const_gimple);
void gimple_set_lhs (gimple, tree);
+void gimple_replace_lhs (gimple, tree);
gimple gimple_copy (gimple);
bool is_gimple_operand (const_tree);
void gimple_set_modified (gimple, bool);
@@ -1330,7 +1332,7 @@ gimple_vuse_op (const_gimple g)
return NULL_USE_OPERAND_P;
ops = g->gsops.opbase.use_ops;
if (ops
- && USE_OP_PTR (ops)->use == &g->gsmem.membase.vuse)
+ && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
return USE_OP_PTR (ops);
return NULL_USE_OPERAND_P;
}
@@ -1345,7 +1347,7 @@ gimple_vdef_op (const_gimple g)
return NULL_DEF_OPERAND_P;
ops = g->gsops.opbase.def_ops;
if (ops
- && DEF_OP_PTR (ops) == &g->gsmem.membase.vdef)
+ && DEF_OP_PTR (ops) == &g->gsmembase.vdef)
return DEF_OP_PTR (ops);
return NULL_DEF_OPERAND_P;
}
@@ -1358,7 +1360,7 @@ gimple_vuse (const_gimple g)
{
if (!gimple_has_mem_ops (g))
return NULL_TREE;
- return g->gsmem.membase.vuse;
+ return g->gsmembase.vuse;
}
/* Return the single VDEF operand of the statement G. */
@@ -1368,7 +1370,7 @@ gimple_vdef (const_gimple g)
{
if (!gimple_has_mem_ops (g))
return NULL_TREE;
- return g->gsmem.membase.vdef;
+ return g->gsmembase.vdef;
}
/* Return the single VUSE operand of the statement G. */
@@ -1378,7 +1380,7 @@ gimple_vuse_ptr (gimple g)
{
if (!gimple_has_mem_ops (g))
return NULL;
- return &g->gsmem.membase.vuse;
+ return &g->gsmembase.vuse;
}
/* Return the single VDEF operand of the statement G. */
@@ -1388,7 +1390,7 @@ gimple_vdef_ptr (gimple g)
{
if (!gimple_has_mem_ops (g))
return NULL;
- return &g->gsmem.membase.vdef;
+ return &g->gsmembase.vdef;
}
/* Set the single VUSE operand of the statement G. */
@@ -1397,7 +1399,7 @@ static inline void
gimple_set_vuse (gimple g, tree vuse)
{
gcc_assert (gimple_has_mem_ops (g));
- g->gsmem.membase.vuse = vuse;
+ g->gsmembase.vuse = vuse;
}
/* Set the single VDEF operand of the statement G. */
@@ -1406,7 +1408,7 @@ static inline void
gimple_set_vdef (gimple g, tree vdef)
{
gcc_assert (gimple_has_mem_ops (g));
- g->gsmem.membase.vdef = vdef;
+ g->gsmembase.vdef = vdef;
}
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 9fdf6b373e5..596a3341337 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -372,6 +372,9 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop,
|| (gimple_code (stmt) == GIMPLE_ASM))
return false;
+ if (is_gimple_debug (stmt))
+ return true;
+
if (!stmt_has_simple_data_refs_p (outermost_loop, stmt))
return false;
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 2eb50df2575..2c842a054f6 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -232,6 +232,7 @@ graphite_stmt_p (sese region, basic_block bb,
switch (gimple_code (stmt))
{
+ case GIMPLE_DEBUG:
/* Control flow expressions can be ignored, as they are
represented in the iteration domains and will be
regenerated by graphite. */
@@ -338,7 +339,11 @@ try_generate_gimple_bb (scop_p scop, basic_block bb)
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- graphite_find_data_references_in_stmt (nest, gsi_stmt (gsi), &drs);
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (!is_gimple_debug (stmt))
+ graphite_find_data_references_in_stmt (nest, stmt, &drs);
+ }
if (!graphite_stmt_p (SCOP_REGION (scop), bb, drs))
free_data_refs (drs);
diff --git a/gcc/gsstruct.def b/gcc/gsstruct.def
index 29cb90d913c..7fd9547f650 100644
--- a/gcc/gsstruct.def
+++ b/gcc/gsstruct.def
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
DEFGSSTRUCT(GSS_BASE, gimple_statement_base, false)
DEFGSSTRUCT(GSS_WITH_OPS, gimple_statement_with_ops, true)
+DEFGSSTRUCT(GSS_WITH_MEM_OPS_BASE, gimple_statement_with_memory_ops_base, false)
DEFGSSTRUCT(GSS_WITH_MEM_OPS, gimple_statement_with_memory_ops, true)
DEFGSSTRUCT(GSS_ASM, gimple_statement_asm, true)
DEFGSSTRUCT(GSS_BIND, gimple_statement_bind, false)
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 2c3b5b737db..4b632c0d9fb 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1327,7 +1327,7 @@ struct ipa_opt_pass_d pass_ipa_cp =
ipcp_write_summary, /* write_summary */
ipcp_read_summary, /* read_summary */
NULL, /* function_read_summary */
- NULL, /* stmt_fixup */
+ lto_ipa_fixup_call_notes, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL, /* variable_transform */
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index e9d831153fe..786c21c0ca3 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -334,7 +334,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
overall_size -= orig_size;
ncalls_inlined++;
- if (flag_indirect_inlining && !flag_wpa)
+ if (flag_indirect_inlining)
return ipa_propagate_indirect_call_infos (curr, new_edges);
else
return false;
@@ -900,7 +900,7 @@ cgraph_decide_inlining_of_small_functions (void)
int min_size, max_size;
VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
- if (flag_indirect_inlining && !flag_wpa)
+ if (flag_indirect_inlining)
new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
if (dump_file)
@@ -1047,10 +1047,10 @@ cgraph_decide_inlining_of_small_functions (void)
if (where->global.inlined_to)
where = where->global.inlined_to;
if (!cgraph_decide_recursive_inlining (where,
- flag_indirect_inlining && !flag_wpa
+ flag_indirect_inlining
? &new_indirect_edges : NULL))
continue;
- if (flag_indirect_inlining && !flag_wpa)
+ if (flag_indirect_inlining)
add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, where, updated_nodes);
}
@@ -1069,7 +1069,7 @@ cgraph_decide_inlining_of_small_functions (void)
}
callee = edge->callee;
cgraph_mark_inline_edge (edge, true, &new_indirect_edges);
- if (flag_indirect_inlining && !flag_wpa)
+ if (flag_indirect_inlining)
add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, callee, updated_nodes);
@@ -1138,7 +1138,7 @@ cgraph_decide_inlining (void)
int initial_size = 0;
cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
- if (in_lto_p && flag_indirect_inlining && !flag_wpa)
+ if (in_lto_p && flag_indirect_inlining)
ipa_update_after_lto_read ();
max_count = 0;
@@ -1294,7 +1294,7 @@ cgraph_decide_inlining (void)
}
/* Free ipa-prop structures if they are no longer needed. */
- if (flag_indirect_inlining && !flag_wpa)
+ if (flag_indirect_inlining)
free_all_ipa_structures_after_iinln ();
if (dump_file)
@@ -2001,7 +2001,7 @@ inline_transform (struct cgraph_node *node)
static void
inline_read_summary (void)
{
- if (flag_indirect_inlining && !flag_wpa)
+ if (flag_indirect_inlining)
{
ipa_register_cgraph_hooks ();
if (!flag_ipa_cp)
@@ -2044,7 +2044,7 @@ struct ipa_opt_pass_d pass_ipa_inline =
inline_write_summary, /* write_summary */
inline_read_summary, /* read_summary */
NULL, /* function_read_summary */
- NULL, /* stmt_fixup */
+ lto_ipa_fixup_call_notes, /* stmt_fixup */
0, /* TODOs */
inline_transform, /* function_transform */
NULL, /* variable_transform */
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 31f435110ac..7394f911771 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -751,6 +751,7 @@ ipa_note_param_call (struct ipa_node_params *info, int formal_id,
note = XCNEW (struct ipa_param_call_note);
note->formal_id = formal_id;
note->stmt = stmt;
+ note->lto_stmt_uid = gimple_uid (stmt);
note->count = bb->count;
note->frequency = compute_call_stmt_bb_frequency (current_function_decl, bb);
@@ -1100,6 +1101,7 @@ update_call_notes_after_inlining (struct cgraph_edge *cs,
new_indirect_edge = cgraph_create_edge (node, callee, nt->stmt,
nt->count, nt->frequency,
nt->loop_nest);
+ new_indirect_edge->lto_stmt_uid = nt->lto_stmt_uid;
new_indirect_edge->indirect_call = 1;
ipa_check_create_edge_args ();
if (new_edges)
@@ -1961,6 +1963,40 @@ ipa_read_jump_function (struct lto_input_block *ib,
}
}
+/* Stream out a parameter call note. */
+
+static void
+ipa_write_param_call_note (struct output_block *ob,
+ struct ipa_param_call_note *note)
+{
+ gcc_assert (!note->processed);
+ lto_output_uleb128_stream (ob->main_stream, gimple_uid (note->stmt));
+ lto_output_sleb128_stream (ob->main_stream, note->formal_id);
+ lto_output_sleb128_stream (ob->main_stream, note->count);
+ lto_output_sleb128_stream (ob->main_stream, note->frequency);
+ lto_output_sleb128_stream (ob->main_stream, note->loop_nest);
+}
+
+/* Read in a parameter call note. */
+
+static void
+ipa_read_param_call_note (struct lto_input_block *ib,
+ struct ipa_node_params *info)
+
+{
+ struct ipa_param_call_note *note = XCNEW (struct ipa_param_call_note);
+
+ note->lto_stmt_uid = (unsigned int) lto_input_uleb128 (ib);
+ note->formal_id = (int) lto_input_sleb128 (ib);
+ note->count = (gcov_type) lto_input_sleb128 (ib);
+ note->frequency = (int) lto_input_sleb128 (ib);
+ note->loop_nest = (int) lto_input_sleb128 (ib);
+
+ note->next = info->param_calls;
+ info->param_calls = note;
+}
+
+
/* Stream out NODE info to OB. */
static void
@@ -1972,16 +2008,17 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node)
int j;
struct cgraph_edge *e;
struct bitpack_d *bp;
+ int note_count;
+ struct ipa_param_call_note *note;
encoder = ob->decl_state->cgraph_node_encoder;
node_ref = lto_cgraph_encoder_encode (encoder, node);
lto_output_uleb128_stream (ob->main_stream, node_ref);
- /* Note that flags will need to be read in the opposite
- order as we are pushing the bitflags into FLAGS. */
bp = bitpack_create ();
bp_pack_value (bp, info->called_with_var_arguments, 1);
- gcc_assert (info->modification_analysis_done || ipa_get_param_count (info) == 0);
+ gcc_assert (info->modification_analysis_done
+ || ipa_get_param_count (info) == 0);
gcc_assert (info->uses_analysis_done || ipa_get_param_count (info) == 0);
gcc_assert (!info->node_enqueued);
gcc_assert (!info->ipcp_orig_node);
@@ -1996,10 +2033,17 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node)
{
struct ipa_edge_args *args = IPA_EDGE_REF (e);
- lto_output_uleb128_stream (ob->main_stream, ipa_get_cs_argument_count (args));
+ lto_output_uleb128_stream (ob->main_stream,
+ ipa_get_cs_argument_count (args));
for (j = 0; j < ipa_get_cs_argument_count (args); j++)
ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j));
}
+
+ for (note = info->param_calls; note; note = note->next)
+ note_count++;
+ lto_output_uleb128_stream (ob->main_stream, note_count);
+ for (note = info->param_calls; note; note = note->next)
+ ipa_write_param_call_note (ob, note);
}
/* Srtream in NODE info from IB. */
@@ -2012,12 +2056,10 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
int k;
struct cgraph_edge *e;
struct bitpack_d *bp;
+ int i, note_count;
ipa_initialize_node_params (node);
- /* Note that the flags must be read in the opposite
- order in which they were written (the bitflags were
- pushed into FLAGS). */
bp = lto_input_bitpack (ib);
info->called_with_var_arguments = bp_unpack_value (bp, 1);
if (ipa_get_param_count (info) != 0)
@@ -2037,10 +2079,6 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
struct ipa_edge_args *args = IPA_EDGE_REF (e);
int count = lto_input_uleb128 (ib);
- if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
- <= (unsigned) cgraph_edge_max_uid)
- VEC_safe_grow_cleared (ipa_edge_args_t, gc,
- ipa_edge_args_vector, cgraph_edge_max_uid + 1);
ipa_set_cs_argument_count (args, count);
if (!count)
continue;
@@ -2050,6 +2088,10 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
for (k = 0; k < ipa_get_cs_argument_count (args); k++)
ipa_read_jump_function (ib, ipa_get_ith_jump_func (args, k), data_in);
}
+
+ note_count = lto_input_uleb128 (ib);
+ for (i = 0; i < note_count; i++)
+ ipa_read_param_call_note (ib, info);
}
/* Write jump functions for nodes in SET. */
@@ -2174,3 +2216,29 @@ ipa_update_after_lto_read (void)
}
}
}
+
+/* Walk param call notes of NODE and set their call statements given the uid
+ stored in each note and STMTS which is an array of statements indexed by the
+ uid. */
+
+void
+lto_ipa_fixup_call_notes (struct cgraph_node *node, gimple *stmts)
+{
+ struct ipa_node_params *info;
+ struct ipa_param_call_note *note;
+
+ ipa_check_create_node_params ();
+ info = IPA_NODE_REF (node);
+ note = info->param_calls;
+ /* If there are no notes or they have already been fixed up (the same fixup
+ is called for both inlining and ipa-cp), there's nothing to do. */
+ if (!note || note->stmt)
+ return;
+
+ do
+ {
+ note->stmt = stmts[note->lto_stmt_uid];
+ note = note->next;
+ }
+ while (note);
+}
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 35005954deb..4dc87d78503 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -143,6 +143,8 @@ struct ipa_param_call_note
struct ipa_param_call_note *next;
/* Statement that contains the call to the parameter above. */
gimple stmt;
+ /* When in LTO, we the above stmt will be NULL and we need an uid. */
+ unsigned int lto_stmt_uid;
/* Index of the parameter that is called. */
int formal_id;
/* Expected number of executions: calculated in profile.c. */
@@ -508,6 +510,7 @@ void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree);
void ipa_prop_write_jump_functions (cgraph_node_set set);
void ipa_prop_read_jump_functions (void);
void ipa_update_after_lto_read (void);
+void lto_ipa_fixup_call_notes (struct cgraph_node *, gimple *);
/* From tree-sra.c: */
bool build_ref_for_offset (tree *, tree, HOST_WIDE_INT, tree, bool);
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index 147610a43e4..d2187b82b99 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -868,6 +868,7 @@ struct ref_pos
{
tree *pos;
tree ref;
+ tree container;
};
@@ -890,6 +891,7 @@ find_pos_in_stmt_1 (tree *tp, int *walk_subtrees, void * data)
return t;
}
+ r_pos->container = t;
*walk_subtrees = 1;
return NULL_TREE;
}
@@ -899,18 +901,18 @@ find_pos_in_stmt_1 (tree *tp, int *walk_subtrees, void * data)
It returns it, if found, and NULL otherwise. */
static tree *
-find_pos_in_stmt (gimple stmt, tree ref)
+find_pos_in_stmt (gimple stmt, tree ref, struct ref_pos * r_pos)
{
- struct ref_pos r_pos;
struct walk_stmt_info wi;
- r_pos.ref = ref;
- r_pos.pos = NULL;
+ r_pos->ref = ref;
+ r_pos->pos = NULL;
+ r_pos->container = NULL_TREE;
memset (&wi, 0, sizeof (wi));
- wi.info = &r_pos;
+ wi.info = r_pos;
walk_gimple_op (stmt, find_pos_in_stmt_1, &wi);
- return r_pos.pos;
+ return r_pos->pos;
}
/* This structure is used to represent array
@@ -948,6 +950,7 @@ replace_field_acc (struct field_access_site *acc, tree new_type)
tree field_id = DECL_NAME (acc->field_decl);
VEC (type_wrapper_t, heap) *wrapper = VEC_alloc (type_wrapper_t, heap, 10);
type_wrapper_t *wr_p = NULL;
+ struct ref_pos r_pos;
while (TREE_CODE (ref_var) == INDIRECT_REF
|| TREE_CODE (ref_var) == ARRAY_REF)
@@ -999,14 +1002,14 @@ replace_field_acc (struct field_access_site *acc, tree new_type)
gimple_assign_set_rhs1 (acc->stmt, new_acc);
else
{
- pos = find_pos_in_stmt (acc->stmt, acc->comp_ref);
+ pos = find_pos_in_stmt (acc->stmt, acc->comp_ref, &r_pos);
gcc_assert (pos);
*pos = new_acc;
}
}
else
{
- pos = find_pos_in_stmt (acc->stmt, acc->comp_ref);
+ pos = find_pos_in_stmt (acc->stmt, acc->comp_ref, &r_pos);
gcc_assert (pos);
*pos = new_acc;
}
@@ -1244,6 +1247,35 @@ create_new_stmts_for_cond_expr (gimple stmt)
}
}
+/* This function looks for VAR in STMT, and replace it with NEW_VAR.
+ If needed, it wraps NEW_VAR in pointers and indirect references
+ before insertion. */
+
+static void
+insert_new_var_in_stmt (gimple stmt, tree var, tree new_var)
+{
+ struct ref_pos r_pos;
+ tree *pos;
+
+ pos = find_pos_in_stmt (stmt, var, &r_pos);
+ gcc_assert (pos);
+
+ while (r_pos.container && (TREE_CODE(r_pos.container) == INDIRECT_REF
+ || TREE_CODE(r_pos.container) == ADDR_EXPR))
+ {
+ tree type = TREE_TYPE (TREE_TYPE (new_var));
+
+ if (TREE_CODE(r_pos.container) == INDIRECT_REF)
+ new_var = build1 (INDIRECT_REF, type, new_var);
+ else
+ new_var = build_fold_addr_expr (new_var);
+ pos = find_pos_in_stmt (stmt, r_pos.container, &r_pos);
+ }
+
+ *pos = new_var;
+}
+
+
/* Create a new general access to replace original access ACC
for structure type NEW_TYPE. */
@@ -1264,7 +1296,6 @@ create_general_new_stmt (struct access_site *acc, tree new_type)
for (i = 0; VEC_iterate (tree, acc->vars, i, var); i++)
{
- tree *pos;
tree new_var = find_new_var_of_type (var, new_type);
tree lhs, rhs = NULL_TREE;
@@ -1296,20 +1327,10 @@ create_general_new_stmt (struct access_site *acc, tree new_type)
else if (rhs == var)
gimple_assign_set_rhs1 (new_stmt, new_var);
else
- {
- pos = find_pos_in_stmt (new_stmt, var);
- gcc_assert (pos);
- /* ??? This misses adjustments to the type of the
- INDIRECT_REF we possibly replace the operand of. */
- *pos = new_var;
- }
+ insert_new_var_in_stmt (new_stmt, var, new_var);
}
else
- {
- pos = find_pos_in_stmt (new_stmt, var);
- gcc_assert (pos);
- *pos = new_var;
- }
+ insert_new_var_in_stmt (new_stmt, var, new_var);
}
finalize_stmt (new_stmt);
@@ -1690,7 +1711,10 @@ update_cgraph_with_malloc_call (gimple malloc_stmt, tree context)
src = cgraph_node (context);
dest = cgraph_node (malloc_fn_decl);
cgraph_create_edge (src, dest, malloc_stmt,
- 0, 0, gimple_bb (malloc_stmt)->loop_depth);
+ gimple_bb (malloc_stmt)->count,
+ compute_call_stmt_bb_frequency
+ (context, gimple_bb (malloc_stmt)),
+ gimple_bb (malloc_stmt)->loop_depth);
}
/* This function generates set of statements required
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 38d02b83175..a3c7719ffbf 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -306,6 +306,23 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
lto_output_sleb128_stream (ob->main_stream,
node->global.estimated_growth);
lto_output_uleb128_stream (ob->main_stream, node->global.inlined);
+ if (node->same_body)
+ {
+ struct cgraph_node *alias;
+ unsigned long alias_count = 1;
+ for (alias = node->same_body; alias->next; alias = alias->next)
+ alias_count++;
+ lto_output_uleb128_stream (ob->main_stream, alias_count);
+ do
+ {
+ lto_output_fn_decl_index (ob->decl_state, ob->main_stream,
+ alias->decl);
+ alias = alias->previous;
+ }
+ while (alias);
+ }
+ else
+ lto_output_uleb128_stream (ob->main_stream, 0);
}
/* Stream out profile_summary to OB. */
@@ -495,6 +512,7 @@ input_node (struct lto_file_decl_data *file_data,
int self_size = 0;
int time_inlining_benefit = 0;
int size_inlining_benefit = 0;
+ unsigned long same_body_count = 0;
bool inlined = false;
clone_p = (lto_input_uleb128 (ib) != 0);
@@ -528,6 +546,7 @@ input_node (struct lto_file_decl_data *file_data,
size = lto_input_sleb128 (ib);
estimated_growth = lto_input_sleb128 (ib);
inlined = lto_input_uleb128 (ib);
+ same_body_count = lto_input_uleb128 (ib);
/* Make sure that we have not read this node before. Nodes that
have already been read will have their tag stored in the 'aux'
@@ -553,6 +572,13 @@ input_node (struct lto_file_decl_data *file_data,
node->global.estimated_growth = estimated_growth;
node->global.inlined = inlined;
+ while (same_body_count-- > 0)
+ {
+ tree alias_decl;
+ decl_index = lto_input_uleb128 (ib);
+ alias_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
+ cgraph_same_body_alias (alias_decl, fn_decl);
+ }
return node;
}
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index dcc92fde13d..751e70472e4 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1090,7 +1090,11 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
}
/* In case of type mismatches across units we can fail
to unify some types and thus not find a proper
- field-decl here. Just do nothing in this case. */
+ field-decl here. So only assert here if checking
+ is enabled. */
+#ifdef ENABLE_CHECKING
+ gcc_assert (tem != NULL_TREE);
+#endif
if (tem != NULL_TREE)
TREE_OPERAND (op, 1) = tem;
}
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 642b6235d90..3b2823bb12e 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -221,6 +221,25 @@ lto_cgraph_replace_node (struct cgraph_node *node,
cgraph_remove_edge (e);
}
+ if (node->same_body)
+ {
+ struct cgraph_node *alias;
+
+ for (alias = node->same_body; alias; alias = alias->next)
+ if (DECL_ASSEMBLER_NAME_SET_P (alias->decl))
+ {
+ lto_symtab_entry_t se
+ = lto_symtab_get (DECL_ASSEMBLER_NAME (alias->decl));
+
+ for (; se; se = se->next)
+ if (se->node == node)
+ {
+ se->node = NULL;
+ break;
+ }
+ }
+ }
+
/* Finally remove the replaced node. */
cgraph_remove_node (node);
}
@@ -376,20 +395,26 @@ lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e)
static void
lto_symtab_resolve_symbols (void **slot)
{
- lto_symtab_entry_t e = (lto_symtab_entry_t) *slot;
+ lto_symtab_entry_t e;
lto_symtab_entry_t prevailing = NULL;
- /* If the chain is already resolved there is nothing to do. */
+ /* Always set e->node so that edges are updated to reflect decl merging. */
+ for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
+ {
+ if (TREE_CODE (e->decl) == FUNCTION_DECL)
+ e->node = cgraph_get_node (e->decl);
+ }
+
+ e = (lto_symtab_entry_t) *slot;
+
+ /* If the chain is already resolved there is nothing else to do. */
if (e->resolution != LDPR_UNKNOWN)
return;
/* Find the single non-replaceable prevailing symbol and
diagnose ODR violations. */
- for (; e; e = e->next)
+ for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
{
- if (TREE_CODE (e->decl) == FUNCTION_DECL)
- e->node = cgraph_get_node (e->decl);
-
if (!lto_symtab_resolve_can_prevail_p (e))
{
e->resolution = LDPR_RESOLVED_IR;
@@ -628,7 +653,22 @@ lto_symtab_merge_cgraph_nodes_1 (void **slot, void *data ATTRIBUTE_UNUSED)
for (e = prevailing->next; e; e = e->next)
{
if (e->node != NULL)
- lto_cgraph_replace_node (e->node, prevailing->node);
+ {
+ if (e->node->decl != e->decl && e->node->same_body)
+ {
+ struct cgraph_node *alias;
+
+ for (alias = e->node->same_body; alias; alias = alias->next)
+ if (alias->decl == e->decl)
+ break;
+ if (alias)
+ {
+ cgraph_remove_same_body_alias (alias);
+ continue;
+ }
+ }
+ lto_cgraph_replace_node (e->node, prevailing->node);
+ }
}
/* Drop all but the prevailing decl from the symtab. */
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index b37c549fde8..6792d183a51 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,20 @@
+2009-11-19 Rafael Avila de Espindola <espindola@google.com>
+
+ PR bootstrap/42096
+ * lto-elf.c (lto_elf_file_open): Use lto_parse_hex.
+ * lto.c (lto_parse_hex): New.
+ (lto_resolution_read): Use lto_parse_hex.
+ * lto.h (lto_parse_hex): New.
+
+2009-11-17 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-elf.c (lto_file_init): Add offset argument.
+ (lto_elf_file_open): Record the offset.
+ * lto.c (lto_resolution_read): Change file_name into a lto_file
+ argument. Check offsets.
+ (lto_file_read): Update call to lto_resolution_read.
+ * lto.h (lto_file_struct): Add the offset field.
+
2009-11-16 Rafael Avila de Espindola <espindola@google.com>
* lto-elf.c (lto_elf_file_open): Use strtoll to parse the offset.
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
index bc8e137ccc2..7c5453a41bf 100644
--- a/gcc/lto/lto-elf.c
+++ b/gcc/lto/lto-elf.c
@@ -32,9 +32,10 @@ along with GCC; see the file COPYING3. If not see
/* Initialize FILE, an LTO file object for FILENAME. */
static void
-lto_file_init (lto_file *file, const char *filename)
+lto_file_init (lto_file *file, const char *filename, off_t offset)
{
file->filename = filename;
+ file->offset = offset;
}
/* An ELF file. */
@@ -542,6 +543,7 @@ lto_elf_file_open (const char *filename, bool writable)
lto_elf_file *elf_file;
lto_file *result = NULL;
off_t offset;
+ off_t header_offset;
const char *offset_p;
char *fname;
@@ -550,30 +552,25 @@ lto_elf_file_open (const char *filename, bool writable)
{
fname = xstrdup (filename);
offset = 0;
+ header_offset = 0;
}
else
{
fname = (char *) xmalloc (offset_p - filename + 1);
memcpy (fname, filename, offset_p - filename);
fname[offset_p - filename] = '\0';
- offset_p++;
- errno = 0;
- offset = strtoll (offset_p, NULL, 10);
- if (errno != 0)
- {
- error ("could not parse offset %s", offset_p);
- goto fail;
- }
+ offset_p += 3; /* skip the @0x */
+ offset = lto_parse_hex (offset_p);
/* elf_rand expects the offset to point to the ar header, not the
object itself. Subtract the size of the ar header (60 bytes).
We don't uses sizeof (struct ar_hd) to avoid including ar.h */
- offset -= 60;
+ header_offset = offset - 60;
}
/* Set up. */
elf_file = XCNEW (lto_elf_file);
result = (lto_file *) elf_file;
- lto_file_init (result, fname);
+ lto_file_init (result, fname, offset);
elf_file->fd = -1;
/* Open the file. */
@@ -603,8 +600,8 @@ lto_elf_file_open (const char *filename, bool writable)
if (offset != 0)
{
Elf *e;
- off_t t = elf_rand (elf_file->elf, offset);
- if (t != offset)
+ off_t t = elf_rand (elf_file->elf, header_offset);
+ if (t != header_offset)
{
error ("could not seek in archive");
goto fail;
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 40f3c30fb64..4d7c3079b49 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -249,12 +249,34 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
lto_data_in_delete (data_in);
}
+/* strtoll is not portable. */
+int64_t
+lto_parse_hex (const char *p) {
+ uint64_t ret = 0;
+ for (; *p != '\0'; ++p)
+ {
+ char c = *p;
+ unsigned char part;
+ ret <<= 4;
+ if (c >= '0' && c <= '9')
+ part = c - '0';
+ else if (c >= 'a' && c <= 'f')
+ part = c - 'a' + 10;
+ else if (c >= 'A' && c <= 'F')
+ part = c - 'A' + 10;
+ else
+ internal_error ("could not parse hex number");
+ ret |= part;
+ }
+ return ret;
+}
+
/* Read resolution for file named FILE_NAME. The resolution is read from
RESOLUTION. An array with the symbol resolution is returned. The array
size is written to SIZE. */
static VEC(ld_plugin_symbol_resolution_t,heap) *
-lto_resolution_read (FILE *resolution, const char *file_name)
+lto_resolution_read (FILE *resolution, lto_file *file)
{
/* We require that objects in the resolution file are in the same
order as the lto1 command line. */
@@ -268,15 +290,27 @@ lto_resolution_read (FILE *resolution, const char *file_name)
if (!resolution)
return NULL;
- name_len = strlen (file_name);
+ name_len = strlen (file->filename);
obj_name = XNEWVEC (char, name_len + 1);
fscanf (resolution, " "); /* Read white space. */
fread (obj_name, sizeof (char), name_len, resolution);
obj_name[name_len] = '\0';
- if (strcmp (obj_name, file_name) != 0)
+ if (strcmp (obj_name, file->filename) != 0)
internal_error ("unexpected file name %s in linker resolution file. "
- "Expected %s", obj_name, file_name);
+ "Expected %s", obj_name, file->filename);
+ if (file->offset != 0)
+ {
+ int t;
+ char offset_p[17];
+ int64_t offset;
+ t = fscanf (resolution, "@0x%16s", offset_p);
+ if (t != 1)
+ internal_error ("could not parse file offset");
+ offset = lto_parse_hex (offset_p);
+ if (offset != file->offset)
+ internal_error ("unexpected offset");
+ }
free (obj_name);
@@ -332,7 +366,7 @@ lto_file_read (lto_file *file, FILE *resolution_file)
size_t len;
VEC(ld_plugin_symbol_resolution_t,heap) *resolutions;
- resolutions = lto_resolution_read (resolution_file, file->filename);
+ resolutions = lto_resolution_read (resolution_file, file);
file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename;
diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h
index cdd1e06de93..0c4305a1731 100644
--- a/gcc/lto/lto.h
+++ b/gcc/lto/lto.h
@@ -28,6 +28,7 @@ typedef struct lto_file_struct
{
/* The name of the file. */
const char *filename;
+ off_t offset;
} lto_file;
/* In lto-lang.c */
@@ -56,5 +57,6 @@ struct lto_section_slot
size_t len;
};
+int64_t lto_parse_hex (const char *p);
#endif /* LTO_H */
diff --git a/gcc/params.def b/gcc/params.def
index 6c766b84c2c..183fd735ce2 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -176,15 +176,15 @@ DEFPARAM(PARAM_LARGE_UNIT_INSNS,
10000, 0, 0)
DEFPARAM(PARAM_INLINE_UNIT_GROWTH,
"inline-unit-growth",
- "how much can given compilation unit grow because of the inlining (in percent)",
+ "How much can given compilation unit grow because of the inlining (in percent)",
30, 0, 0)
DEFPARAM(PARAM_IPCP_UNIT_GROWTH,
"ipcp-unit-growth",
- "how much can given compilation unit grow because of the interprocedural constant propagation (in percent)",
+ "How much can given compilation unit grow because of the interprocedural constant propagation (in percent)",
10, 0, 0)
DEFPARAM(PARAM_EARLY_INLINING_INSNS,
"early-inlining-insns",
- "maximal estimated growth of function body caused by early inlining of single call",
+ "Maximal estimated growth of function body caused by early inlining of single call",
8, 0, 0)
DEFPARAM(PARAM_LARGE_STACK_FRAME,
"large-stack-frame",
@@ -728,12 +728,12 @@ DEFPARAM (PARAM_SCCVN_MAX_SCC_SIZE,
DEFPARAM (PARAM_IRA_MAX_LOOPS_NUM,
"ira-max-loops-num",
- "max loops number for regional RA",
+ "Max loops number for regional RA",
100, 0, 0)
DEFPARAM (PARAM_IRA_MAX_CONFLICT_TABLE_SIZE,
"ira-max-conflict-table-size",
- "max size of conflict table in MB",
+ "Max size of conflict table in MB",
1000, 0, 0)
DEFPARAM (PARAM_IRA_LOOP_RESERVED_REGS,
@@ -754,7 +754,7 @@ DEFPARAM (PARAM_SWITCH_CONVERSION_BRANCH_RATIO,
DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,
"loop-invariant-max-bbs-in-loop",
- "max basic blocks number in loop for loop invariant motion",
+ "Max basic blocks number in loop for loop invariant motion",
10000, 0, 0)
/* Avoid SLP vectorization of large basic blocks. */
@@ -765,13 +765,13 @@ DEFPARAM (PARAM_SLP_MAX_INSNS_IN_BB,
DEFPARAM (PARAM_MIN_INSN_TO_PREFETCH_RATIO,
"min-insn-to-prefetch-ratio",
- "min. ratio of insns to prefetches to enable prefetching for "
+ "Min. ratio of insns to prefetches to enable prefetching for "
"a loop with an unknown trip count",
10, 0, 0)
DEFPARAM (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO,
"prefetch-min-insn-to-mem-ratio",
- "min. ratio of insns to mem ops to enable prefetching in a loop",
+ "Min. ratio of insns to mem ops to enable prefetching in a loop",
3, 0, 0)
/* Set minimum insn uid for non-debug insns. */
@@ -783,7 +783,7 @@ DEFPARAM (PARAM_MIN_NONDEBUG_INSN_UID,
DEFPARAM (PARAM_IPA_SRA_PTR_GROWTH_FACTOR,
"ipa-sra-ptr-growth-factor",
- "maximum allowed growth of size of new parameters ipa-sra replaces "
+ "Maximum allowed growth of size of new parameters ipa-sra replaces "
"a pointer to an aggregate with",
2, 0, 0)
diff --git a/gcc/passes.c b/gcc/passes.c
index e92d0860bd9..0c39a7a22bb 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1660,7 +1660,23 @@ ipa_write_summaries (void)
gcc_assert (order_pos == cgraph_n_nodes);
for (i = order_pos - 1; i >= 0; i--)
- cgraph_node_set_add (set, order[i]);
+ {
+ struct cgraph_node *node = order[i];
+
+ if (node->analyzed)
+ {
+ /* When streaming out references to statements as part of some IPA
+ pass summary, the statements need to have uids assigned and the
+ following does that for all the IPA passes here. Naturally, this
+ ordering then matches the one IPA-passes get in their stmt_fixup
+ hooks. */
+
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+ renumber_gimple_stmt_uids ();
+ pop_cfun ();
+ }
+ cgraph_node_set_add (set, node);
+ }
ipa_write_summaries_1 (set);
lto_delete_extern_inline_states ();
diff --git a/gcc/plugin.c b/gcc/plugin.c
index 7b344ff2f09..b189197e8a1 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -66,6 +66,9 @@ const char *plugin_event_name[] =
/* a printf format large enough for the largest event above */
#define FMT_FOR_PLUGIN_EVENT "%-26s"
+/* A printf format large enough for the largest event above. */
+#define FMT_FOR_PLUGIN_EVENT "%-26s"
+
/* Hash table for the plugin_name_args objects created during command-line
parsing. */
static htab_t plugin_name_args_tab = NULL;
diff --git a/gcc/predict.c b/gcc/predict.c
index becff10615b..df859066b96 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -77,7 +77,6 @@ static sreal real_zero, real_one, real_almost_one, real_br_prob_base,
static void combine_predictions_for_insn (rtx, basic_block);
static void dump_prediction (FILE *, enum br_predictor, int, basic_block, int);
static void predict_paths_leading_to (basic_block, enum br_predictor, enum prediction);
-static void compute_function_frequency (void);
static void choose_function_section (void);
static bool can_predict_insn_p (const_rtx);
@@ -2145,7 +2144,7 @@ estimate_bb_frequencies (void)
}
/* Decide whether function is hot, cold or unlikely executed. */
-static void
+void
compute_function_frequency (void)
{
basic_block bb;
diff --git a/gcc/predict.h b/gcc/predict.h
index 0e040410768..18e57d77065 100644
--- a/gcc/predict.h
+++ b/gcc/predict.h
@@ -41,5 +41,6 @@ extern void estimate_bb_frequencies (void);
extern const char *predictor_name (enum br_predictor);
extern tree build_predict_expr (enum br_predictor, enum prediction);
extern void tree_estimate_probability (void);
+extern void compute_function_frequency (void);
#endif /* GCC_PREDICT_H */
diff --git a/gcc/reload.c b/gcc/reload.c
index 3333697f2e0..a7791c2869e 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5239,7 +5239,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
if (CONSTANT_P (ad) && ! strict_memory_address_addr_space_p (mode, ad, as))
{
enum machine_mode address_mode = GET_MODE (ad);
- if (ad == VOIDmode)
+ if (address_mode == VOIDmode)
address_mode = targetm.addr_space.address_mode (as);
/* If AD is an address in the constant pool, the MEM rtx may be shared.
diff --git a/gcc/sese.c b/gcc/sese.c
index e2c9eb8848f..2c38b24388c 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -235,8 +235,73 @@ sese_build_liveouts_bb (sese region, bitmap liveouts, basic_block bb)
PHI_ARG_DEF_FROM_EDGE (gsi_stmt (bsi), e));
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
- FOR_EACH_SSA_USE_OPERAND (use_p, gsi_stmt (bsi), iter, SSA_OP_ALL_USES)
- sese_build_liveouts_use (region, liveouts, bb, USE_FROM_PTR (use_p));
+ {
+ gimple stmt = gsi_stmt (bsi);
+
+ if (is_gimple_debug (stmt))
+ continue;
+
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
+ sese_build_liveouts_use (region, liveouts, bb, USE_FROM_PTR (use_p));
+ }
+}
+
+/* For a USE in BB, return true if BB is outside REGION and it's not
+ in the LIVEOUTS set. */
+
+static bool
+sese_bad_liveouts_use (sese region, bitmap liveouts, basic_block bb,
+ tree use)
+{
+ unsigned ver;
+ basic_block def_bb;
+
+ if (TREE_CODE (use) != SSA_NAME)
+ return false;
+
+ ver = SSA_NAME_VERSION (use);
+
+ /* If it's in liveouts, the variable will get a new PHI node, and
+ the debug use will be properly adjusted. */
+ if (bitmap_bit_p (liveouts, ver))
+ return false;
+
+ def_bb = gimple_bb (SSA_NAME_DEF_STMT (use));
+
+ if (!def_bb
+ || !bb_in_sese_p (def_bb, region)
+ || bb_in_sese_p (bb, region))
+ return false;
+
+ return true;
+}
+
+/* Reset debug stmts that reference SSA_NAMES defined in REGION that
+ are not marked as liveouts. */
+
+static void
+sese_reset_debug_liveouts_bb (sese region, bitmap liveouts, basic_block bb)
+{
+ gimple_stmt_iterator bsi;
+ ssa_op_iter iter;
+ use_operand_p use_p;
+
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ gimple stmt = gsi_stmt (bsi);
+
+ if (!is_gimple_debug (stmt))
+ continue;
+
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
+ if (sese_bad_liveouts_use (region, liveouts, bb,
+ USE_FROM_PTR (use_p)))
+ {
+ gimple_debug_bind_reset_value (stmt);
+ update_stmt (stmt);
+ break;
+ }
+ }
}
/* Build the LIVEOUTS of REGION: the set of variables defined inside
@@ -249,6 +314,9 @@ sese_build_liveouts (sese region, bitmap liveouts)
FOR_EACH_BB (bb)
sese_build_liveouts_bb (region, liveouts, bb);
+ if (MAY_HAVE_DEBUG_INSNS)
+ FOR_EACH_BB (bb)
+ sese_reset_debug_liveouts_bb (region, liveouts, bb);
}
/* Builds a new SESE region from edges ENTRY and EXIT. */
@@ -534,7 +602,19 @@ rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_
|| (TREE_CODE (expr) != SSA_NAME
&& is_gimple_reg (use)))
{
- tree var = create_tmp_var (type_use, "var");
+ tree var;
+
+ if (is_gimple_debug (stmt))
+ {
+ if (gimple_debug_bind_p (stmt))
+ gimple_debug_bind_reset_value (stmt);
+ else
+ gcc_unreachable ();
+
+ break;
+ }
+
+ var = create_tmp_var (type_use, "var");
if (type_use != type_expr)
expr = fold_convert (type_use, expr);
@@ -827,6 +907,16 @@ expand_scalar_variables_stmt (gimple stmt, basic_block bb, sese region,
if (use_expr == use)
continue;
+ if (is_gimple_debug (stmt))
+ {
+ if (gimple_debug_bind_p (stmt))
+ gimple_debug_bind_reset_value (stmt);
+ else
+ gcc_unreachable ();
+
+ break;
+ }
+
if (TREE_CODE (use_expr) != SSA_NAME)
{
tree var = create_tmp_var (type, "var");
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f73a427fa09..c0cf2d2d124 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,174 @@
+2009-11-21 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gcc.dg/tree-ssa/vrp47.c: Fix target check.
+
+2009-11-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/9050, DR 147, DR 318
+ * g++.dg/template/ctor9.C: New.
+ * g++.dg/tc1/dr147.C: Remove xfails.
+ * g++.dg/lookup/name-clash4.C: Adjust.
+ * g++.old-deja/g++.jason/temporary5.C: Adjust.
+ * g++.old-deja/g++.pt/ctor2.C: Adjust.
+
+2009-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/42078
+ * gcc.dg/pr42078.c: New test.
+
+2009-11-19 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ PR Testsuite/42114
+ * gcc-dg/c99-stdint-1.c: Condition test for target without signal.h.
+ XFAIL ptrdiff range test for avr.
+ * gcc-dg/c99-stdint-2.c: XFAIL for avr target.
+ * gcc-dg/c99-stdint-5.c: Condition test for target without signal.h.
+ * gcc-dg/c99-stdint-6.c: Ditto.
+
+2009-11-20 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c: Delete,
+ 2009-10-23 change to set VRSAVE if VSX has been reverted.
+
+2009-11-20 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/38646
+ * g++.dg/cpp0x/pr38646.C: New test.
+
+2009-11-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/c99-stdint-6.c: Set dg-options for alpha*-dec-osf5*.
+ Wrap *int_least*_t tests in !NO_LEAST_TYPES.
+ Wrap *intmax_t tests in !NO_MAX_TYPES.
+
+2009-11-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/42060
+ * g++.dg/cpp0x/initlist28.C: New.
+
+2009-11-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gfortran.dg/proc_ptr_comp_23.f90: Add a missing space.
+
+2009-11-20 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gcc.dg/tree-ssa/vrp47.c: Skip on S/390.
+
+2009-11-20 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * g++.old-deja/g++.jason/rfg20.C: Make expected dg-error strings
+ explicit.
+ * g++.old-deja/g++.rfg/00321_01-.C: Likewise.
+ * g++.old-deja/g++.rfg/00324_02-.C: Likewise.
+ * g++.old-deja/g++.law/typeck1.C: Likewise.
+ * g++.old-deja/g++.bugs/900324_02.C: Likewise.
+ * g++.dg/conversion/ptrmem9.C: Likewise.
+ * g++.dg/expr/cond2.C: Likewise.
+
+2009-11-20 Paul Thomas <pault@gcc.gnu.org>
+ Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/42104
+ * gfortran.dg/proc_ptr_comp_23.f90: New test.
+
+2009-11-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/42115
+ * g++.dg/init/placement5.C: Add positive test.
+
+ DR 176 permissiveness
+ * g++.dg/ext/injected-ttp.C: New.
+ * g++.old-deja/g++.pt/niklas01a.C: Adjust.
+ * g++.old-deja/g++.pt/ttp41.C: Adjust.
+
+2009-11-19 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ * gcc.c-torture/compile/pr40204.c: Test only for int32 target.
+ * gcc.c-torture/compile/pr41181.c: Skip test for avr target.
+
+2009-11-19 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ * gcc-dg/raw-string-1.c: Skip test for avr target.
+ * gcc-dg/utf-array-short-wchar.c: Ditto.
+ * gcc-dg/utf-array.c: Ditto.
+ * gcc-dg/utf8-2.c: Ditto.
+
+2009-11-19 Rafael Avila de Espindola <espindola@google.com>
+
+ * g++.dg/plugin/selfassign.c: Include plugin-version.h.
+ (plugin_init): Pass correct version to plugin_default_version_check.
+ * gcc.dg/plugin/ggcplug.c: Include plugin-version.h.
+ (plugin_init): Pass correct version to plugin_default_version_check.
+ * gcc.dg/plugin/selfassign.c: Include plugin-version.h.
+ (plugin_init): Pass correct version to plugin_default_version_check.
+
+2009-11-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/561
+ * g++.dg/overload/pmf2.C: New.
+
+2009-11-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/42090
+ * gfortran.dg/direct_io_11.f90: New test.
+
+2009-11-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.misc-tests/linkage.exp: Also check -m32 for i*86-*-linux*.
+
+2009-11-18 Nick Clifton <nickc@redhat.com>
+
+ * g++.dg/lto/20091002-1_0.C: Replace -shared with -r -nostlib.
+ * g++.dg/lto/20081120-1_0.C: Likewise.
+ * g++.dg/lto/20091002-2_0.C: Likewise.
+ * g++.dg/lto/20081120-2_0.C: Likewise.
+ * g++.dg/lto/20091002-3_0.C: Likewise.
+ * g++.dg/lto/20081123_0.C: Likewise.
+ * g++.dg/lto/20090313_0.C: Likewise.
+ * g++.dg/lto/20081109-1_0.C: Likewise.
+ * g++.dg/lto/20081219_0.C: Likewise.
+ * g++.dg/lto/20081204-1_0.C: Likewise.
+ * g++.dg/lto/20090302_0.C: Likewise.
+ * g++.dg/lto/20081119-1_0.C: Likewise.
+ * g++.dg/lto/20081118_0.C: Likewise.
+
+2009-11-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/41913
+ * lib/lto.exp (scan-symbol): Properly check if target exist.
+
+2009-11-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/42072
+ * gfortran.dg/proc_ptr_8.f90: Extended.
+
+2009-11-18 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * g++.old-deja/g++.other/crash28.C: Make expected dg-error strings
+ explicit.
+ * g++.dg/inherit/error4.C: Likewise.
+ * g++.dg/template/crash90.C: Likewise.
+
+2009-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/3187
+ * g++.dg/abi/mangle26.C: Also match *C2* definition.
+ * g++.dg/abi/mangle27.C: Likewise.
+ * g++.dg/abi/mangle28.C: Likewise.
+ * g++.dg/abi/mangle29.C: Likewise.
+
+2009-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41926
+ * gcc.dg/vect/vect-debug-pr41926.c: New.
+
+2009-11-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/42058
+ * g++.dg/init/array26.C: New.
+ * g++.dg/init/array27.C: Likewise.
+ * g++.old-deja/g++.benjamin/13478.C: Adjust dg-errors.
+
2009-11-17 Jakub Jelinek <jakub@redhat.com>
PR c++/42061
@@ -20,12 +191,12 @@
2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/42055
- * testsuite/g++.dg/template/crash92.C: New.
+ * g++.dg/template/crash92.C: New.
2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/32056
- * testsuite/g++.dg/template/error44.C: New.
+ * g++.dg/template/error44.C: New.
2009-11-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
diff --git a/gcc/testsuite/g++.dg/abi/mangle26.C b/gcc/testsuite/g++.dg/abi/mangle26.C
index cfec4b93872..77b0eabdaa5 100644
--- a/gcc/testsuite/g++.dg/abi/mangle26.C
+++ b/gcc/testsuite/g++.dg/abi/mangle26.C
@@ -11,4 +11,4 @@ namespace std {
std::A a;
-// { dg-final { scan-assembler "\n_?_ZNSt1AC1Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZNSt1AC\[12\]Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle27.C b/gcc/testsuite/g++.dg/abi/mangle27.C
index da4efbae696..2d15abbf961 100644
--- a/gcc/testsuite/g++.dg/abi/mangle27.C
+++ b/gcc/testsuite/g++.dg/abi/mangle27.C
@@ -11,4 +11,4 @@ namespace std {
std::basic_iostream<char,std::char_traits<char> > s1;
-// { dg-final { scan-assembler "\n_?_ZNSdC1Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZNSdC\[12\]Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle28.C b/gcc/testsuite/g++.dg/abi/mangle28.C
index b8c40ca8d85..bea8ce01974 100644
--- a/gcc/testsuite/g++.dg/abi/mangle28.C
+++ b/gcc/testsuite/g++.dg/abi/mangle28.C
@@ -11,4 +11,4 @@ namespace std {
std::basic_istream<char,std::char_traits<char> > s1;
-// { dg-final { scan-assembler "\n_?_ZNSiC1Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZNSiC\[12\]Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle29.C b/gcc/testsuite/g++.dg/abi/mangle29.C
index 4f64efb676a..aaff2b4eb68 100644
--- a/gcc/testsuite/g++.dg/abi/mangle29.C
+++ b/gcc/testsuite/g++.dg/abi/mangle29.C
@@ -11,4 +11,4 @@ namespace std {
std::basic_ostream<char,std::char_traits<char> > s1;
-// { dg-final { scan-assembler "\n_?_ZNSoC1Ev\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_ZNSoC\[12\]Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/conversion/ptrmem9.C b/gcc/testsuite/g++.dg/conversion/ptrmem9.C
index 2ccd6837c47..d4a260f9273 100644
--- a/gcc/testsuite/g++.dg/conversion/ptrmem9.C
+++ b/gcc/testsuite/g++.dg/conversion/ptrmem9.C
@@ -22,5 +22,5 @@ void f ()
pd == pb;
pd == pbv; // { dg-error "" }
- pd == pc; // { dg-error "" }
+ pd == pc; // { dg-error "comparison between distinct pointer-to-member types" }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist28.C b/gcc/testsuite/g++.dg/cpp0x/initlist28.C
new file mode 100644
index 00000000000..3b959a03a53
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist28.C
@@ -0,0 +1,8 @@
+// PR c++/42060
+// { dg-options "-std=c++0x" }
+
+void foo()
+{
+ int a[1];
+ throw a = {}; // { dg-error "invalid use of non-lvalue array" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr38646.C b/gcc/testsuite/g++.dg/cpp0x/pr38646.C
new file mode 100644
index 00000000000..3ef74cd4866
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr38646.C
@@ -0,0 +1,12 @@
+/* PR c++/38646 */
+/* { dg-do "compile" } */
+/* { dg-options "-std=c++0x" } */
+
+template<int...> struct A;
+
+template<int... N> struct A<N..., N...> /* { dg-error "must be at the end" } */
+{
+ template<typename> struct B;
+
+ template<typename T> struct B<T*> {};
+};
diff --git a/gcc/testsuite/g++.dg/expr/cond2.C b/gcc/testsuite/g++.dg/expr/cond2.C
index d9c2e7031f6..68a26a22f34 100644
--- a/gcc/testsuite/g++.dg/expr/cond2.C
+++ b/gcc/testsuite/g++.dg/expr/cond2.C
@@ -8,5 +8,5 @@ struct IsZero : Term {
Term*
IsZero::eval()
{
- return true ? new Boolean(false) : this; // { dg-error "" }
+ return true ? new Boolean(false) : this; // { dg-error "conditional expression" }
}
diff --git a/gcc/testsuite/g++.dg/ext/injected-ttp.C b/gcc/testsuite/g++.dg/ext/injected-ttp.C
new file mode 100644
index 00000000000..405bee88cdf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/injected-ttp.C
@@ -0,0 +1,15 @@
+// Test for doing the right thing with injected-class-name used as template
+// type argument. This is an extension from DR 176.
+
+// { dg-options "-pedantic" }
+
+template <class T>
+struct A { };
+
+template <template <class> class TTP>
+struct B { };
+
+struct C: A<int>
+{
+ B<A> b; // { dg-warning "injected-class-name" }
+};
diff --git a/gcc/testsuite/g++.dg/inherit/error4.C b/gcc/testsuite/g++.dg/inherit/error4.C
index d56d67f7556..4f6866ed8ee 100644
--- a/gcc/testsuite/g++.dg/inherit/error4.C
+++ b/gcc/testsuite/g++.dg/inherit/error4.C
@@ -2,7 +2,7 @@
struct A { virtual ~A(); };
-struct B : A A {}; // { dg-error "" }
+struct B : A A {}; // { dg-error "expected|initializer|invalid" }
A foo(const B &b) // { dg-error "" }
{
diff --git a/gcc/testsuite/g++.dg/init/array26.C b/gcc/testsuite/g++.dg/init/array26.C
new file mode 100644
index 00000000000..83c4e0c4a4d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array26.C
@@ -0,0 +1,11 @@
+// PR c++/42058
+// { dg-options "" }
+
+struct A;
+
+struct B
+{
+ A a; // { dg-error "incomplete type" }
+};
+
+B b[1] = (B[]) { 0 }; // { dg-error "initializer" }
diff --git a/gcc/testsuite/g++.dg/init/array27.C b/gcc/testsuite/g++.dg/init/array27.C
new file mode 100644
index 00000000000..988501545f0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array27.C
@@ -0,0 +1,11 @@
+// PR c++/42058
+// { dg-options "" }
+
+struct A {};
+
+struct B
+{
+ A a;
+};
+
+B b[1] = (B[]) { 0 }; // { dg-error "initializer" }
diff --git a/gcc/testsuite/g++.dg/lookup/name-clash4.C b/gcc/testsuite/g++.dg/lookup/name-clash4.C
index d4ff5513393..d6c6d97bbc1 100644
--- a/gcc/testsuite/g++.dg/lookup/name-clash4.C
+++ b/gcc/testsuite/g++.dg/lookup/name-clash4.C
@@ -9,4 +9,4 @@ struct A
template<int> struct A {}; // { dg-error "same name" }
};
-A::A<0> a; // { dg-error "not a template" }
+A::A<0> a; // { dg-error "not a template|invalid use of constructor" }
diff --git a/gcc/testsuite/g++.dg/lto/20081109-1_0.C b/gcc/testsuite/g++.dg/lto/20081109-1_0.C
index 243f0ed7246..58be091ce16 100644
--- a/gcc/testsuite/g++.dg/lto/20081109-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081109-1_0.C
@@ -1,5 +1,5 @@
// { dg-lto-do link }
// { dg-lto-options {{-fPIC -fwhopr}} }
-// { dg-extra-ld-options "-fPIC -fwhopr -shared -fno-exceptions" }
+// { dg-extra-ld-options "-fPIC -fwhopr -r -nostdlib -fno-exceptions" }
void func(); class Foo { };
void bar() { try { func(); } catch (Foo) { } };
diff --git a/gcc/testsuite/g++.dg/lto/20081118_0.C b/gcc/testsuite/g++.dg/lto/20081118_0.C
index cbac06a4747..5b5c82c5949 100644
--- a/gcc/testsuite/g++.dg/lto/20081118_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081118_0.C
@@ -1,5 +1,5 @@
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -fwhopr -shared}} } */
+/* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
/* We used to ICE because of dangling pointers. */
diff --git a/gcc/testsuite/g++.dg/lto/20081119-1_0.C b/gcc/testsuite/g++.dg/lto/20081119-1_0.C
index d38fca3d44d..5513db2f213 100644
--- a/gcc/testsuite/g++.dg/lto/20081119-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081119-1_0.C
@@ -1,5 +1,5 @@
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -fwhopr -shared}} } */
+/* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
#include "20081119-1.h"
diff --git a/gcc/testsuite/g++.dg/lto/20081120-1_0.C b/gcc/testsuite/g++.dg/lto/20081120-1_0.C
index 3cb97538945..6827337787c 100644
--- a/gcc/testsuite/g++.dg/lto/20081120-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081120-1_0.C
@@ -1,5 +1,5 @@
// { dg-lto-do link }
-// { dg-lto-options {{-flto -shared}} }
+// { dg-lto-options {{-flto -r -nostdlib}} }
extern "C"
{
extern __inline __attribute__((__gnu_inline__)) int pthread_equal(int, int)
diff --git a/gcc/testsuite/g++.dg/lto/20081120-2_0.C b/gcc/testsuite/g++.dg/lto/20081120-2_0.C
index d4e4cd43cc5..3efe26c0197 100644
--- a/gcc/testsuite/g++.dg/lto/20081120-2_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081120-2_0.C
@@ -1,5 +1,5 @@
// { dg-lto-do link }
-// { dg-lto-options {{-flto -shared}} }
+// { dg-lto-options {{-flto -r -nostdlib}} }
template < typename > struct Foo
{
inline void rdstate() {
diff --git a/gcc/testsuite/g++.dg/lto/20081123_0.C b/gcc/testsuite/g++.dg/lto/20081123_0.C
index 2b182a95e42..3177063b504 100644
--- a/gcc/testsuite/g++.dg/lto/20081123_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081123_0.C
@@ -1,5 +1,5 @@
// { dg-lto-do link }
-// { dg-lto-options {{-fwhopr -shared -fPIC}} }
+// { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} }
int
f(void)
diff --git a/gcc/testsuite/g++.dg/lto/20081204-1_0.C b/gcc/testsuite/g++.dg/lto/20081204-1_0.C
index 8c625f51e47..a94b4823072 100644
--- a/gcc/testsuite/g++.dg/lto/20081204-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081204-1_0.C
@@ -1,5 +1,5 @@
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fwhopr -fPIC -shared}} } */
+/* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
/* Tests for the absence during linking of:
lto1: error: type of '_ZTVN10__cxxabiv120__si_class_type_infoE' does
diff --git a/gcc/testsuite/g++.dg/lto/20081219_0.C b/gcc/testsuite/g++.dg/lto/20081219_0.C
index 29ad575d0a7..fd4c9738e1e 100644
--- a/gcc/testsuite/g++.dg/lto/20081219_0.C
+++ b/gcc/testsuite/g++.dg/lto/20081219_0.C
@@ -1,6 +1,6 @@
// { dg-lto-do link }
// { dg-lto-options {{-fPIC -fwhopr -O2}} }
-// { dg-extra-ld-options "-O2 -fPIC -fwhopr -shared" }
+// { dg-extra-ld-options "-O2 -fPIC -fwhopr -r -nostdlib" }
typedef long int ptrdiff_t;
extern "C"
diff --git a/gcc/testsuite/g++.dg/lto/20090302_0.C b/gcc/testsuite/g++.dg/lto/20090302_0.C
index c71e062f319..21200a21124 100644
--- a/gcc/testsuite/g++.dg/lto/20090302_0.C
+++ b/gcc/testsuite/g++.dg/lto/20090302_0.C
@@ -1,5 +1,5 @@
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -fwhopr -shared}} } */
+/* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
struct Foo {
bool Mumble();
static void Bar() { if (foo_->Mumble()) foo_ = 0; }
diff --git a/gcc/testsuite/g++.dg/lto/20090313_0.C b/gcc/testsuite/g++.dg/lto/20090313_0.C
index df1a94287b2..b000200c584 100644
--- a/gcc/testsuite/g++.dg/lto/20090313_0.C
+++ b/gcc/testsuite/g++.dg/lto/20090313_0.C
@@ -1,5 +1,5 @@
// { dg-lto-do link }
// { dg-lto-options {{-fwhopr -fPIC}} }
-// { dg-extra-ld-options "-fwhopr -shared" }
+// { dg-extra-ld-options "-fwhopr -r -nostdlib" }
int X;
diff --git a/gcc/testsuite/g++.dg/lto/20091002-1_0.C b/gcc/testsuite/g++.dg/lto/20091002-1_0.C
index ad1ecf673f5..050211ac355 100644
--- a/gcc/testsuite/g++.dg/lto/20091002-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/20091002-1_0.C
@@ -1,6 +1,6 @@
// { dg-lto-do link }
// { dg-lto-options {{-fPIC -flto}} }
-// { dg-extra-ld-options "-fPIC -shared" }
+// { dg-extra-ld-options "-fPIC -r -nostdlib" }
namespace std __attribute__ ((__visibility__ ("default")))
{
diff --git a/gcc/testsuite/g++.dg/lto/20091002-2_0.C b/gcc/testsuite/g++.dg/lto/20091002-2_0.C
index 5b000fa580c..c150e977d14 100644
--- a/gcc/testsuite/g++.dg/lto/20091002-2_0.C
+++ b/gcc/testsuite/g++.dg/lto/20091002-2_0.C
@@ -1,6 +1,6 @@
// { dg-lto-do link }
// { dg-lto-options {{-fPIC}} }
-// { dg-extra-ld-options "-fPIC -shared" }
+// { dg-extra-ld-options "-fPIC -r -nostdlib" }
class DataArray {
int max() const { }
diff --git a/gcc/testsuite/g++.dg/lto/20091002-3_0.C b/gcc/testsuite/g++.dg/lto/20091002-3_0.C
index 7ed81559dd3..3c77f4b596f 100644
--- a/gcc/testsuite/g++.dg/lto/20091002-3_0.C
+++ b/gcc/testsuite/g++.dg/lto/20091002-3_0.C
@@ -1,6 +1,6 @@
// { dg-lto-do link }
// { dg-lto-options {{-fPIC}} }
-// { dg-extra-ld-options "-fPIC -shared" }
+// { dg-extra-ld-options "-fPIC -r -nostdlib" }
template < class T >
class DataArray {
diff --git a/gcc/testsuite/g++.dg/overload/pmf2.C b/gcc/testsuite/g++.dg/overload/pmf2.C
new file mode 100644
index 00000000000..e95e1f83a61
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/pmf2.C
@@ -0,0 +1,20 @@
+// PR c++/561
+
+class A { };
+
+struct B : public A
+{
+ void foo ();
+ void foo (int);
+ template <class T>
+ void bar (T);
+ template <class T>
+ void bar (T, T);
+};
+
+int main ()
+{
+ void (A::*f1)() = (void (A::*)()) &B::foo;
+ void (A::*f2)(int) = (void (A::*)(int)) &B::bar;
+ void (A::*f3)(int) = (void (A::*)(int)) &B::bar<int>;
+}
diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c
index 6dade300ff0..8d76301d815 100644
--- a/gcc/testsuite/g++.dg/plugin/selfassign.c
+++ b/gcc/testsuite/g++.dg/plugin/selfassign.c
@@ -13,6 +13,7 @@
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
+#include "plugin-version.h"
int plugin_is_GPL_compatible;
@@ -305,7 +306,7 @@ plugin_init (struct plugin_name_args *plugin_info,
bool enabled = true;
int i;
- if (!plugin_default_version_check (version, version))
+ if (!plugin_default_version_check (version, &gcc_version))
return 1;
/* Self-assign detection should happen after SSA is constructed. */
diff --git a/gcc/testsuite/g++.dg/tc1/dr147.C b/gcc/testsuite/g++.dg/tc1/dr147.C
index 26ac6a60ecc..9c90d982f5f 100644
--- a/gcc/testsuite/g++.dg/tc1/dr147.C
+++ b/gcc/testsuite/g++.dg/tc1/dr147.C
@@ -11,7 +11,7 @@ A::A() { }
B::B() { }
B::A ba;
-A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup" { xfail *-*-* } }
+A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup" }
}
@@ -26,6 +26,6 @@ template <class T> struct A {
template <class T2> A(T2);
static A x;
};
-template<> A<int>::A<int>(A<int>::x); // { dg-error "" "this is an invalid declaration of the constructor" { xfail *-*-* } }
+template<> A<int>::A<int>(A<int>::x); // { dg-error "" "this is an invalid declaration of the constructor" }
}
diff --git a/gcc/testsuite/g++.dg/template/crash90.C b/gcc/testsuite/g++.dg/template/crash90.C
index da24359c737..6fe247cc30d 100644
--- a/gcc/testsuite/g++.dg/template/crash90.C
+++ b/gcc/testsuite/g++.dg/template/crash90.C
@@ -4,5 +4,5 @@ template < unsigned >
struct A ;
template < typename >
struct B ;
-template < typename T , A < B < T > // { dg-error "" }
+template < typename T , A < B < T > // { dg-error "initializer|parse error|valid type|expected" }
{ }
diff --git a/gcc/testsuite/g++.dg/template/ctor9.C b/gcc/testsuite/g++.dg/template/ctor9.C
new file mode 100644
index 00000000000..819ca1c9401
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ctor9.C
@@ -0,0 +1,9 @@
+// PR c++/9050, DR 147, 318
+
+struct Y
+{
+ template <typename T> Y (T);
+ template <typename T> void foo (T);
+};
+
+template <> Y::Y<int> (int) { }
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C b/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C
index 7b560b94235..e1d52e14b06 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C
@@ -27,10 +27,4 @@ const hand_table Agent::table_1[] =
{0, &Agent::table_2},
{first, &Agent::foo},
{last, &(hand)Agent::foo} // { dg-error "" } no match
-}; // { dg-error "" } cannot convert
-
-
-
-
-
-
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C b/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C
index bb612c66be4..b77cc0375a8 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C
@@ -13,7 +13,7 @@ void (*fp)(void);
void function_1 ()
{
- fp = 1 ? function_0 : fp; // { dg-error "" }
+ fp = 1 ? function_0 : fp; // { dg-error "conditional expression|invalid conversion" }
}
int main () { return 0; }
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rfg20.C b/gcc/testsuite/g++.old-deja/g++.jason/rfg20.C
index 379629456a3..505f7c94968 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/rfg20.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/rfg20.C
@@ -6,5 +6,5 @@ void *vp;
void example ()
{
- vp != fp; // { dg-error "" } no conversion from pfn to void*
+ vp != fp; // { dg-error "forbids comparison" } no conversion from pfn to void*
}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/temporary5.C b/gcc/testsuite/g++.old-deja/g++.jason/temporary5.C
index d233fa9b3ad..eef2e200539 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/temporary5.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/temporary5.C
@@ -1,6 +1,6 @@
-// { dg-do run }
// PRMS Id: 6604
-// Bug: Scoped constructor call is not properly recognized as a functional cast
+// Old bug: Scoped constructor call is not properly recognized as a functional cast
+// But after DR 147 A::A() is a constructor call, not a functional cast.
int c;
@@ -12,6 +12,8 @@ struct A {
int main ()
{
- A::A();
+ A a;
+ a.A::A(); // { dg-error "" }
+ A::A(); // { dg-error "" }
return c;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/typeck1.C b/gcc/testsuite/g++.old-deja/g++.law/typeck1.C
index 2b5e230274a..12a8ff6e8cf 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/typeck1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/typeck1.C
@@ -13,6 +13,6 @@
int test( const foo* f, const bar* b )
{
- return f == b;// { dg-error "" }
+ return f == b;// { dg-error "comparison between distinct pointer types" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash28.C b/gcc/testsuite/g++.old-deja/g++.other/crash28.C
index 4f1115be16d..59f1e844eea 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash28.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash28.C
@@ -31,5 +31,5 @@ public:
};
void foo::x() throw(bar)
{
- if (!b) throw bar (static_cast<::N::X*>(this)); // { dg-error "" } parse error
+ if (!b) throw bar (static_cast<::N::X*>(this)); // { dg-error "lambda expressions|expected" } parse error
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C b/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C
index 46039ace817..802c2a4a446 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C
@@ -10,4 +10,4 @@ struct A {
template <class T>
A<T>::A<T>() // { dg-error "invalid use of constructor|qualified name" }
{
-}
+} // { dg-error "end of input" }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C b/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C
index 7fe07a2df0e..eec11ab0033 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C
@@ -2,7 +2,7 @@
// { dg-options "-fshow-column" }
struct A { // { dg-error "" } forward declaration
- friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A'" }
+ friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" }
int x;
}; // { dg-error "class definition may not be declared a friend" "" { target *-*-* } { 5 } }
int y;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
index b260961e813..564294e3840 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options "" }
template<template<class> class D,class E> class C
{
public:
@@ -13,8 +14,8 @@ template<class T> class D
template<class T> int D<T>::f()
{
- C<D,D> c; // { dg-error "" }
- return c.g(); // { dg-error "" }
+ C<D,D> c;
+ return c.g();
}
int main()
diff --git a/gcc/testsuite/g++.old-deja/g++.rfg/00321_01-.C b/gcc/testsuite/g++.old-deja/g++.rfg/00321_01-.C
index 8d0f35efff6..dcc607e329a 100644
--- a/gcc/testsuite/g++.old-deja/g++.rfg/00321_01-.C
+++ b/gcc/testsuite/g++.old-deja/g++.rfg/00321_01-.C
@@ -9,6 +9,6 @@ int (*p2)[5];
void
test ()
{
- p1 == p2; // { dg-error "" } comparison.*
- p1 > p2; // { dg-error "" } comparison.*
+ p1 == p2; // { dg-error "comparison between distinct pointer types" } comparison.*
+ p1 > p2; // { dg-error "comparison between distinct pointer types" } comparison.*
}
diff --git a/gcc/testsuite/g++.old-deja/g++.rfg/00324_02-.C b/gcc/testsuite/g++.old-deja/g++.rfg/00324_02-.C
index 4fc2a50641b..1e742cb0d04 100644
--- a/gcc/testsuite/g++.old-deja/g++.rfg/00324_02-.C
+++ b/gcc/testsuite/g++.old-deja/g++.rfg/00324_02-.C
@@ -12,5 +12,5 @@ int i;
void
test ()
{
- i ? f : fp; // { dg-error "" }
+ i ? f : fp; // { dg-error "conditional expression|invalid conversion" }
}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40204.c b/gcc/testsuite/gcc.c-torture/compile/pr40204.c
index 3193284ff7a..149302a8303 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr40204.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr40204.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
/* PR middle-end/40204 */
struct S
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41181.c b/gcc/testsuite/gcc.c-torture/compile/pr41181.c
index d0af52d912b..9e42f420939 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr41181.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41181.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "The array is too big" { "avr-*-*" } { "*" } { "" } } */
char paths[1024];
static void x264_slicetype_path(char (*best_paths)[250], int n, int length)
{
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-1.c b/gcc/testsuite/gcc.dg/c99-stdint-1.c
index 109aed4d284..37e1203f0ae 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-1.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-1.c
@@ -14,7 +14,9 @@
#include <stdint.h>
/* This and the later SIG_ATOMIC_* tests should be appropriately
conditioned for any freestanding targets with no <signal.h>. */
+#ifndef SIGNAL_SUPPRESS
#include <signal.h>
+#endif
/* Note that some of these conditions assume two's complement and no
padding bits; GCC only supports two's complement, and no supported
@@ -212,8 +214,11 @@ test_max (void)
void
test_misc_limits (void)
{
+/* { dg-bogus "size" "ptrdiff is 16bits" { xfail avr-*-* } 218 } */
CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, PTRDIFF_MAX, -65535L, 65535L);
+#ifndef SIGNAL_SUPPRESS
CHECK_LIMITS_2(sig_atomic_t, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, -127, 127, 255);
+#endif
CHECK_UNSIGNED_LIMITS_2(__SIZE_TYPE__, SIZE_MAX, 65535U);
CHECK_LIMITS_2(__WCHAR_TYPE__, WCHAR_MIN, WCHAR_MAX, -127, 127, 255);
CHECK_LIMITS_2(__WINT_TYPE__, WINT_MIN, WINT_MAX, -32767, 32767, 65535);
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-2.c b/gcc/testsuite/gcc.dg/c99-stdint-2.c
index 0187b034c99..d1be0fb6332 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-2.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-2.c
@@ -2,7 +2,7 @@
Freestanding version. */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */
-
+/* { dg-xfail-if "ptrdiff size is 16bits" { avr-*-* } } */
/* The test is that there are no diagnostics, so just include the
hosted version. */
#include "c99-stdint-1.c"
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc/testsuite/gcc.dg/c99-stdint-5.c
index da2f356643b..9c224edc1cb 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-5.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-5.c
@@ -5,7 +5,9 @@
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
#include <stdint.h>
+#ifndef SIGNAL_SUPPRESS
#include <signal.h>
+#endif
#define CHECK_TYPES(TYPE1, TYPE2) \
do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
@@ -61,5 +63,7 @@ check_types (void)
#endif
CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
+#ifndef SIGNAL_SUPPRESS
CHECK_TYPES(__SIG_ATOMIC_TYPE__, sig_atomic_t);
+#endif
}
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc/testsuite/gcc.dg/c99-stdint-6.c
index 5007f54163b..3d554e9b126 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-6.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-6.c
@@ -3,9 +3,12 @@
/* { dg-do compile { target inttypes_types } } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
/* { dg-options "-std=gnu99 -pedantic-errors -DNO_FAST_TYPES" { target *-*-solaris2.[789]* } } */
+/* { dg-options "-std=gnu99 -pedantic-errors -DNO_LEAST_TYPES -DNO_FAST_TYPES -DNO_MAX_TYPES" { target alpha*-dec-osf5* } } */
#include <inttypes.h>
+#ifndef SIGNAL_SUPPRESS
#include <signal.h>
+#endif
#define CHECK_TYPES(TYPE1, TYPE2) \
do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
@@ -37,6 +40,7 @@ check_types (void)
#ifdef __UINT64_TYPE__
CHECK_TYPES(__UINT64_TYPE__, uint64_t);
#endif
+#ifndef NO_LEAST_TYPES
CHECK_TYPES(__INT_LEAST8_TYPE__, int_least8_t);
CHECK_TYPES(__INT_LEAST16_TYPE__, int_least16_t);
CHECK_TYPES(__INT_LEAST32_TYPE__, int_least32_t);
@@ -45,6 +49,7 @@ check_types (void)
CHECK_TYPES(__UINT_LEAST16_TYPE__, uint_least16_t);
CHECK_TYPES(__UINT_LEAST32_TYPE__, uint_least32_t);
CHECK_TYPES(__UINT_LEAST64_TYPE__, uint_least64_t);
+#endif
#ifndef NO_FAST_TYPES
CHECK_TYPES(__INT_FAST8_TYPE__, int_fast8_t);
CHECK_TYPES(__INT_FAST16_TYPE__, int_fast16_t);
@@ -61,7 +66,11 @@ check_types (void)
#ifdef __UINTPTR_TYPE__
CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
#endif
+#ifndef NO_MAX_TYPES
CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
+#endif
+#ifndef SIGNAL_SUPPRESS
CHECK_TYPES(__SIG_ATOMIC_TYPE__, sig_atomic_t);
+#endif
}
diff --git a/gcc/testsuite/gcc.dg/plugin/ggcplug.c b/gcc/testsuite/gcc.dg/plugin/ggcplug.c
index 49b5c95e4e9..03bd563b5ad 100644
--- a/gcc/testsuite/gcc.dg/plugin/ggcplug.c
+++ b/gcc/testsuite/gcc.dg/plugin/ggcplug.c
@@ -12,6 +12,7 @@
#include "tree-pass.h"
#include "intl.h"
#include "gcc-plugin.h"
+#include "plugin-version.h"
int plugin_is_GPL_compatible;
@@ -43,7 +44,7 @@ plugin_init (struct plugin_name_args *plugin_info,
int argc = plugin_info->argc;
int i = 0;
struct plugin_argument *argv = plugin_info->argv;
- if (!plugin_default_version_check (version, version))
+ if (!plugin_default_version_check (version, &gcc_version))
return 1;
/* Process the plugin arguments. This plugin takes the following arguments:
count-ggc-start count-ggc-end count-ggc-mark */
diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c
index f804222826d..8d76301d815 100644
--- a/gcc/testsuite/gcc.dg/plugin/selfassign.c
+++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -13,7 +13,7 @@
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
-
+#include "plugin-version.h"
int plugin_is_GPL_compatible;
@@ -306,7 +306,7 @@ plugin_init (struct plugin_name_args *plugin_info,
bool enabled = true;
int i;
- if (!plugin_default_version_check (version, version))
+ if (!plugin_default_version_check (version, &gcc_version))
return 1;
/* Self-assign detection should happen after SSA is constructed. */
diff --git a/gcc/testsuite/gcc.dg/pr42078.c b/gcc/testsuite/gcc.dg/pr42078.c
new file mode 100644
index 00000000000..8107ff5557a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42078.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/42078 */
+/* { dg-do compile } */
+/* { dg-options "-g -O -ffast-math" } */
+
+double sqrt (double x);
+
+float
+foo (float x)
+{
+ float y = sqrt (x);
+ return x / y;
+}
+
+inline float
+bar (float x)
+{
+ float y = sqrt (x);
+ float a = y;
+ float b = y;
+ float c = y;
+ return x / y;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-1.c b/gcc/testsuite/gcc.dg/raw-string-1.c
index b499e5cce69..679e9a6c893 100644
--- a/gcc/testsuite/gcc.dg/raw-string-1.c
+++ b/gcc/testsuite/gcc.dg/raw-string-1.c
@@ -1,4 +1,5 @@
/* { dg-do run } */
+/* { dg-skip-if "No wchar.h" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=gnu99" } */
#include <wchar.h>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c
index 2e9d08b59fa..663e7baf753 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c
@@ -1,6 +1,9 @@
/* Skip on MIPS, where LOGICAL_OP_NON_SHORT_CIRCUIT inhibits the setcc
optimizations that expose the VRP opportunity. */
-/* { dg-do compile { target { ! mips*-*-* } } } */
+/* Skip on S/390. Lower values in BRANCH_COST lead to two conditional
+ jumps when evaluating an && condition. VRP is not able to optimize
+ this. */
+/* { dg-do compile { target { { ! mips*-*-* } && { ! s390*-*-* } } } } */
/* { dg-options "-O2 -fdump-tree-vrp -fdump-tree-dom" } */
int h(int x, int y)
diff --git a/gcc/testsuite/gcc.dg/utf-array-short-wchar.c b/gcc/testsuite/gcc.dg/utf-array-short-wchar.c
index 55d164fc287..91f48273e85 100644
--- a/gcc/testsuite/gcc.dg/utf-array-short-wchar.c
+++ b/gcc/testsuite/gcc.dg/utf-array-short-wchar.c
@@ -1,6 +1,7 @@
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Expected errors for char16_t/char32_t string literals. */
/* { dg-do compile } */
+/* { dg-skip-if "No wchar.h" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=gnu99 -fshort-wchar" } */
#include <wchar.h>
diff --git a/gcc/testsuite/gcc.dg/utf-array.c b/gcc/testsuite/gcc.dg/utf-array.c
index bbe0976a539..b25c2af0c69 100644
--- a/gcc/testsuite/gcc.dg/utf-array.c
+++ b/gcc/testsuite/gcc.dg/utf-array.c
@@ -1,6 +1,7 @@
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Expected errors for char16_t/char32_t string literals. */
/* { dg-do compile } */
+/* { dg-skip-if "No wchar.h" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=gnu99" } */
#include <wchar.h>
diff --git a/gcc/testsuite/gcc.dg/utf8-2.c b/gcc/testsuite/gcc.dg/utf8-2.c
index 9c0442fde3f..173d797e1af 100644
--- a/gcc/testsuite/gcc.dg/utf8-2.c
+++ b/gcc/testsuite/gcc.dg/utf8-2.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "No wchar.h" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=gnu99" } */
#include <wchar.h>
diff --git a/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c b/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c
new file mode 100644
index 00000000000..6eea84ae129
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c
@@ -0,0 +1,20 @@
+/* PR debug/41926 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -ffast-math -funroll-loops -ftree-vectorize -msse2" { target { i?86-*-* x86_64-*-* } } } */
+
+void
+foo (double (*__restrict p)[4], double (*__restrict q)[4],
+ double *__restrict prim, double scale, double pp, double pq)
+{
+ int md, mc, mb, ma, p_index = 0;
+
+ for (md = 0; md < 1; md++)
+ for (mc = 0; mc < 1; mc++)
+ for (mb = 0; mb < 1; mb++)
+ for (ma = 0; ma < 4; ma++)
+ {
+ double tmp = scale * prim[p_index++];
+ p[md][ma] = p[md][ma] - tmp * pp;
+ q[mc][ma] = q[mc][ma] - tmp * pq;
+ }
+}
diff --git a/gcc/testsuite/gcc.misc-tests/linkage.exp b/gcc/testsuite/gcc.misc-tests/linkage.exp
index 05c0311adab..69e318306e8 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage.exp
+++ b/gcc/testsuite/gcc.misc-tests/linkage.exp
@@ -57,7 +57,7 @@ if { [isnative] && ![is_remote host] } then {
if [ string match "*64-bit*" $file_string ] {
set native_cflags "-m64"
}
- } elseif [istarget "x86_64-*-linux*"] {
+ } elseif {[istarget "i*86-*-linux*"] || [istarget "x86_64-*-linux*"]} {
set file_string [exec file "linkage-x.o"]
if [ string match "*32-bit*" $file_string ] {
set native_cflags "-m32"
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c b/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c
deleted file mode 100644
index 83125f67fcc..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
-/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -mcpu=power7" } */
-/* { dg-final { scan-assembler-times "mtvrsave" 2 } } */
-
-/* Check whether VRSAVE is set to non-zero if VSX vector operations were
- used, but it should not be set if there are no vector operations. */
-
-void
-generates_vrsave (vector double *a, vector double *b, vector double *c)
-{
- *a = *b + *c;
-}
-
-void
-no_vrsave (double *a, double *b, double *c)
-{
- *a = *b + *c;
-}
diff --git a/gcc/testsuite/gfortran.dg/direct_io_11.f90 b/gcc/testsuite/gfortran.dg/direct_io_11.f90
new file mode 100644
index 00000000000..a2b8afc358f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/direct_io_11.f90
@@ -0,0 +1,55 @@
+! { dg-do run }
+! PR42090 Problems reading partial records in formatted direct access files
+! Test case from PR, prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program da_good_now
+ implicit none
+ real :: a, b
+
+ a = 1.111111111
+ b = 2.222222222
+
+ open( 10, file = 't.dat', form = 'formatted', access = 'direct', recl = 12 )
+ write( 10, rec = 1, fmt = '( f6.4, /, f6.4 )' ) a, b
+ close( 10 )
+
+ a = -1.0
+ b = -1.0
+
+ open( 10, file = 't.dat', form = 'formatted', access = 'direct', recl = 12 )
+
+ read( 10, rec = 1, fmt = '( f6.4, /, f6.4 )' ) a, b
+ !write( *, '( "partial record 1", t25, 2( f6.4, 1x ) )' ) a, b
+ a = -1.0
+ b = -1.0
+
+ read( 10, rec = 1, fmt = '( f6.4 )' ) a, b
+ !write( *, '( "partial record 2", t25, 2( f6.4, 1x ) )' ) a, b
+ if (a /= 1.1111 .and. b /= 2.2222) call abort()
+ a = -1.0
+ b = -1.0
+
+ read( 10, rec = 1, fmt = '( f12.4, /, f12.4 )' ) a, b
+ !write( *, '( "full record 1", t25, 2( f6.4, 1x ) )' ) a, b
+ if (a /= 1.1111 .and. b /= 2.2222) call abort()
+ a = -1.0
+ b = -1.0
+
+ read( 10, rec = 1, fmt = '( f12.4 )' ) a, b
+ !write( *, '( "full record 2", t25, 2( f6.4, 1x ) )' ) a, b
+ if (a /= 1.1111 .and. b /= 2.2222) call abort()
+ a = -1.0
+ b = -1.0
+
+ read( 10, rec = 1, fmt = '( f6.4, 6x, /, f6.4, 6x )' ) a, b
+ !write( *, '( "full record with 6x", t25, 2( f6.4, 1x ) )' ) a, b
+ if (a /= 1.1111 .and. b /= 2.2222) call abort()
+ a = -1.0
+ b = -1.0
+
+ read( 10, rec = 1, fmt = '( f6.4 )' ) a
+ read( 10, rec = 2, fmt = '( f6.4 )' ) b
+ !write( *, '( "record at a time", t25, 2( f6.4, 1x ) )' ) a, b
+ if (a /= 1.1111 .and. b /= 2.2222) call abort()
+
+ close( 10, status="delete")
+end program da_good_now
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_8.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_8.f90
index 80d26619bc0..f45d114f833 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_8.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_8.f90
@@ -23,12 +23,23 @@ MODULE X
END MODULE X
USE X
-PROCEDURE(mytype), POINTER :: ptype
+PROCEDURE(mytype), POINTER :: ptype,ptype2
CALL init()
CALL C_F_PROCPOINTER(funpointer,ptype)
if (ptype(3) /= 9) call abort()
+! the stuff below was added with PR 42072
+call setpointer(ptype2)
+if (ptype2(4) /= 12) call abort()
+
+contains
+
+ subroutine setpointer (p)
+ PROCEDURE(mytype), POINTER :: p
+ CALL C_F_PROCPOINTER(funpointer,p)
+ end subroutine
+
END
! { dg-final { cleanup-modules "X" } }
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_23.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_23.f90
new file mode 100644
index 00000000000..8b1c6912d27
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_23.f90
@@ -0,0 +1,73 @@
+! { dg-do run }
+! Tests the fix for PR42104 in which the call to the procedure pointer
+! component caused an ICE because the "always_implicit flag was not used
+! to force the passing of a descriptor for the array argument.
+!
+! Contributed by Martien Hulsen <m.a.hulsen@tue.nl>
+!
+module poisson_functions_m
+
+ implicit none
+
+contains
+
+ function func ( nr, x )
+ integer, intent(in) :: nr
+ real, intent(in), dimension(:) :: x
+ real :: func
+
+ real :: pi
+
+ pi = 4 * atan(1.)
+
+ select case(nr)
+ case(1)
+ func = 0
+ case(2)
+ func = 1
+ case(3)
+ func = 1 + cos(pi*x(1))*cos(pi*x(2))
+ case default
+ write(*,'(/a,i0/)') 'Error func: wrong function number: ', nr
+ stop
+ end select
+
+ end function func
+
+end module poisson_functions_m
+
+module element_defs_m
+
+ implicit none
+
+ abstract interface
+ function dummyfunc ( nr, x )
+ integer, intent(in) :: nr
+ real, intent(in), dimension(:) :: x
+ real :: dummyfunc
+ end function dummyfunc
+ end interface
+
+ type function_p
+ procedure(dummyfunc), nopass, pointer :: p => null()
+ end type function_p
+
+end module element_defs_m
+
+program t
+
+use poisson_functions_m
+use element_defs_m
+
+procedure(dummyfunc), pointer :: p => null()
+type(function_p) :: funcp
+
+p => func
+funcp%p => func
+
+print *, func(nr=3,x=(/0.1,0.1/))
+print *, p(nr=3,x=(/0.1,0.1/))
+print *, funcp%p(nr=3,x=(/0.1,0.1/))
+
+end program t
+! { dg-final { cleanup-modules "poisson_functions_m element_defs_m" } }
diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp
index c3ff61aa2ce..9e9084d1b68 100644
--- a/gcc/testsuite/lib/lto.exp
+++ b/gcc/testsuite/lib/lto.exp
@@ -520,7 +520,7 @@ proc scan-symbol { args } {
verbose -log "nm is $nm"
}
- set output_file $execname
+ set output_file "[glob -nocomplain $execname]"
if { $output_file == "" } {
fail "scan-symbol $args: dump file does not exist"
return
diff --git a/gcc/toplev.c b/gcc/toplev.c
index ecad8ca02a8..25fb5f898bb 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1862,11 +1862,12 @@ process_options (void)
/* The loop unrolling code assumes that cse will be run after loop.
web and rename-registers also help when run after loop unrolling. */
-
if (flag_rerun_cse_after_loop == AUTODETECT_VALUE)
flag_rerun_cse_after_loop = flag_unroll_loops || flag_peel_loops;
+
if (flag_web == AUTODETECT_VALUE)
flag_web = flag_unroll_loops || flag_peel_loops;
+
if (flag_rename_registers == AUTODETECT_VALUE)
flag_rename_registers = flag_unroll_loops || flag_peel_loops;
@@ -2010,9 +2011,8 @@ process_options (void)
error ("target system does not support the \"%s\" debug format",
debug_type_names[write_symbols]);
- /* Now we know which debug output will be used so we can set
- flag_var_tracking, flag_rename_registers if the user has
- not specified them. */
+ /* We know which debug output will be used so we can set flag_var_tracking
+ and flag_var_tracking_uninit if the user has not specified them. */
if (debug_info_level < DINFO_LEVEL_NORMAL
|| debug_hooks->var_location == do_nothing_debug_hooks.var_location)
{
@@ -2053,10 +2053,6 @@ process_options (void)
&& (flag_selective_scheduling || flag_selective_scheduling2))
warning (0, "var-tracking-assignments changes selective scheduling");
- if (flag_rename_registers == AUTODETECT_VALUE)
- flag_rename_registers = default_debug_hooks->var_location
- != do_nothing_debug_hooks.var_location;
-
if (flag_tree_cselim == AUTODETECT_VALUE)
#ifdef HAVE_conditional_move
flag_tree_cselim = 1;
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 7affd1627c5..61d687daa13 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -245,36 +245,51 @@ execute_fixup_cfg (void)
basic_block bb;
gimple_stmt_iterator gsi;
int todo = gimple_in_ssa_p (cfun) ? TODO_verify_ssa : 0;
+ gcov_type count_scale;
+ edge e;
+ edge_iterator ei;
- if (cfun->eh)
- FOR_EACH_BB (bb)
- {
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
- tree decl = is_gimple_call (stmt)
- ? gimple_call_fndecl (stmt)
- : NULL;
-
- if (decl
- && gimple_call_flags (stmt) & (ECF_CONST
- | ECF_PURE
- | ECF_LOOPING_CONST_OR_PURE))
- {
- if (gimple_in_ssa_p (cfun))
- {
- todo |= TODO_update_ssa | TODO_cleanup_cfg;
- mark_symbols_for_renaming (stmt);
- update_stmt (stmt);
- }
- }
-
- maybe_clean_eh_stmt (stmt);
- }
-
- if (gimple_purge_dead_eh_edges (bb))
- todo |= TODO_cleanup_cfg;
- }
+ if (ENTRY_BLOCK_PTR->count)
+ count_scale = (cgraph_node (current_function_decl)->count * REG_BR_PROB_BASE
+ + ENTRY_BLOCK_PTR->count / 2) / ENTRY_BLOCK_PTR->count;
+ else
+ count_scale = REG_BR_PROB_BASE;
+
+ FOR_EACH_BB (bb)
+ {
+ bb->count = (bb->count * count_scale
+ + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ tree decl = is_gimple_call (stmt)
+ ? gimple_call_fndecl (stmt)
+ : NULL;
+
+ if (decl
+ && gimple_call_flags (stmt) & (ECF_CONST
+ | ECF_PURE
+ | ECF_LOOPING_CONST_OR_PURE))
+ {
+ if (gimple_in_ssa_p (cfun))
+ {
+ todo |= TODO_update_ssa | TODO_cleanup_cfg;
+ mark_symbols_for_renaming (stmt);
+ update_stmt (stmt);
+ }
+ }
+
+ maybe_clean_eh_stmt (stmt);
+ }
+
+ if (gimple_purge_dead_eh_edges (bb))
+ todo |= TODO_cleanup_cfg;
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ e->count = (e->count * count_scale
+ + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ }
+ if (count_scale != REG_BR_PROB_BASE)
+ compute_function_frequency ();
/* Dump a textual representation of the flowgraph. */
if (dump_file)
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 37bce5e2d2e..d96b66b1aa8 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -400,6 +400,7 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
{
unsigned i;
tree val = NULL_TREE;
+ int qual;
for (i = 0; i < addr->n; i++)
{
@@ -414,7 +415,12 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
if (i == addr->n)
return;
- /* Cast value to appropriate pointer type. */
+ /* Cast value to appropriate pointer type. We cannot use a pointer
+ to TYPE directly, as the back-end will assume registers of pointer
+ type are aligned, and just the base itself may not actually be.
+ We use void pointer to the type's address space instead. */
+ qual = ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (type));
+ type = build_qualified_type (void_type_node, qual);
parts->base = fold_convert (build_pointer_type (type), val);
aff_combination_remove_elt (addr, i);
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 6e861b15e4c..db21218629e 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2398,7 +2398,14 @@ degenerate_phi_result (gimple phi)
continue;
else if (!val)
val = arg;
- else if (!operand_equal_p (arg, val, 0))
+ else if (arg == val)
+ continue;
+ /* We bring in some of operand_equal_p not only to speed things
+ up, but also to avoid crashing when dereferencing the type of
+ a released SSA name. */
+ else if (!arg || TREE_CODE (val) != TREE_CODE (arg)
+ || TREE_CODE (val) == SSA_NAME
+ || !operand_equal_p (arg, val, 0))
break;
}
return (i == gimple_phi_num_args (phi) ? val : NULL);
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index c0ddc8afa30..948707eb1a0 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -563,6 +563,7 @@ execute_cse_reciprocals (void)
if (fail)
continue;
+ gimple_replace_lhs (stmt1, arg1);
gimple_call_set_fndecl (stmt1, fndecl);
update_stmt (stmt1);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 2ef6d76a40a..7e44f846590 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4462,8 +4462,10 @@ remove_dead_inserted_code (void)
if (gimple_code (t) == GIMPLE_PHI)
remove_phi_node (&gsi, true);
else
- gsi_remove (&gsi, true);
- release_defs (t);
+ {
+ gsi_remove (&gsi, true);
+ release_defs (t);
+ }
}
}
VEC_free (gimple, heap, worklist);
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index e6a9a07a5d8..4d0ccb066b1 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -279,7 +279,7 @@ find_released_ssa_name (tree *tp, int *walk_subtrees, void *data_)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data_;
- if (wi->is_lhs)
+ if (wi && wi->is_lhs)
return NULL_TREE;
if (TREE_CODE (*tp) == SSA_NAME)
@@ -346,7 +346,13 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
/* If we didn't get an insertion point, and the stmt has already
been removed, we won't be able to insert the debug bind stmt, so
we'll have to drop debug information. */
- if (is_gimple_assign (def_stmt))
+ if (gimple_code (def_stmt) == GIMPLE_PHI)
+ {
+ value = degenerate_phi_result (def_stmt);
+ if (value && walk_tree (&value, find_released_ssa_name, NULL, NULL))
+ value = NULL;
+ }
+ else if (is_gimple_assign (def_stmt))
{
bool no_value = false;
@@ -383,8 +389,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
dead SSA NAMEs. SSA verification shall catch any
errors. */
if ((!gsi && !gimple_bb (def_stmt))
- || !walk_gimple_op (def_stmt, find_released_ssa_name,
- &wi))
+ || walk_gimple_op (def_stmt, find_released_ssa_name, &wi))
no_value = true;
}
@@ -409,6 +414,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
at the expense of duplication of expressions. */
if (CONSTANT_CLASS_P (value)
+ || gimple_code (def_stmt) == GIMPLE_PHI
|| (usecount == 1
&& (!gimple_assign_single_p (def_stmt)
|| is_gimple_min_invariant (value)))
@@ -479,7 +485,7 @@ insert_debug_temps_for_defs (gimple_stmt_iterator *gsi)
stmt = gsi_stmt (*gsi);
- FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_DEF)
+ FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF)
{
tree var = DEF_FROM_PTR (def_p);
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index c23577034b1..55b9fb2bf99 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4112,6 +4112,44 @@ vectorizable_live_operation (gimple stmt,
return true;
}
+/* Kill any debug uses outside LOOP of SSA names defined in STMT. */
+
+static void
+vect_loop_kill_debug_uses (struct loop *loop, gimple stmt)
+{
+ ssa_op_iter op_iter;
+ imm_use_iterator imm_iter;
+ def_operand_p def_p;
+ gimple ustmt;
+
+ FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF)
+ {
+ FOR_EACH_IMM_USE_STMT (ustmt, imm_iter, DEF_FROM_PTR (def_p))
+ {
+ basic_block bb;
+
+ if (!is_gimple_debug (ustmt))
+ continue;
+
+ bb = gimple_bb (ustmt);
+
+ if (!flow_bb_inside_loop_p (loop, bb))
+ {
+ if (gimple_debug_bind_p (ustmt))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "killing debug use");
+
+ gimple_debug_bind_reset_value (ustmt);
+ update_stmt (ustmt);
+ }
+ else
+ gcc_unreachable ();
+ }
+ }
+ }
+}
+
/* Function vect_transform_loop.
The analysis phase has determined that the loop is vectorizable.
@@ -4202,7 +4240,11 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (!STMT_VINFO_RELEVANT_P (stmt_info)
&& !STMT_VINFO_LIVE_P (stmt_info))
- continue;
+ {
+ if (MAY_HAVE_DEBUG_STMTS)
+ vect_loop_kill_debug_uses (loop, phi);
+ continue;
+ }
if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info))
!= (unsigned HOST_WIDE_INT) vectorization_factor)
@@ -4242,6 +4284,8 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (!STMT_VINFO_RELEVANT_P (stmt_info)
&& !STMT_VINFO_LIVE_P (stmt_info))
{
+ if (MAY_HAVE_DEBUG_STMTS)
+ vect_loop_kill_debug_uses (loop, stmt);
gsi_next (&si);
continue;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 3bfb527590e..76e23f7b74a 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4289,7 +4289,7 @@ need_assembler_name_p (tree decl)
return false;
/* Functions represented in the callgraph need an assembler name. */
- if (cgraph_node_for_decl (decl) != NULL)
+ if (cgraph_get_node (decl) != NULL)
return true;
/* Unused and not public functions don't need an assembler name. */
@@ -4921,6 +4921,10 @@ free_lang_data (void)
{
unsigned i;
+ /* If we are the LTO frontend we have freed lang-specific data already. */
+ if (in_lto_p)
+ return 0;
+
/* Allocate and assign alias sets to the standard integer types
while the slots are still in the way the frontends generated them. */
for (i = 0; i < itk_none; ++i)
@@ -4929,8 +4933,7 @@ free_lang_data (void)
/* FIXME. Remove after save_debug_info is working. */
if (!(flag_generate_lto
- || (!in_lto_p
- && !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE)))
+ || (!flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE)))
return 0;
/* Traverse the IL resetting language specific information for
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index c842e80c91d..af05ca31515 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-20 Arnaud Charlet <charlet@adacore.com>
+
+ * macro.c (enter_macro_context): Call cb.used callback if defined.
+ * directives.c (do_idef, do_ifndef): Ditto.
+ * include/cpplib.h (struct cpp_callbacks): Add used callback.
+
2009-11-11 Kai Tietz <kai.tietz@onevision.com>
* directives.c (do_pragma_push_macro): New pragma handler.
diff --git a/libcpp/directives.c b/libcpp/directives.c
index aed940e56e1..409d908b4e8 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1808,6 +1808,8 @@ do_ifdef (cpp_reader *pfile)
pfile->cb.used_undef (pfile, pfile->directive_line, node);
}
}
+ if (pfile->cb.used)
+ pfile->cb.used (pfile, pfile->directive_line, node);
check_eol (pfile, false);
}
}
@@ -1844,6 +1846,8 @@ do_ifndef (cpp_reader *pfile)
pfile->cb.used_undef (pfile, pfile->directive_line, node);
}
}
+ if (pfile->cb.used)
+ pfile->cb.used (pfile, pfile->directive_line, node);
check_eol (pfile, false);
}
}
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index e95f01a412a..6175bbcb092 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -508,6 +508,9 @@ struct cpp_callbacks
/* Called before #define and #undef or other macro definition
changes are processed. */
void (*before_define) (cpp_reader *);
+ /* Called whenever a macro is expanded or tested.
+ Second argument is the location of the start of the current expansion. */
+ void (*used) (cpp_reader *, source_location, cpp_hashnode *);
};
#ifdef VMS
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 1d284cf9f8a..6647db56714 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -885,6 +885,9 @@ enter_macro_context (cpp_reader *pfile, cpp_hashnode *node,
pfile->cb.used_define (pfile, pfile->directive_line, node);
}
+ if (pfile->cb.used)
+ pfile->cb.used (pfile, result->src_loc, node);
+
macro->used = 1;
if (macro->paramc == 0)
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 54c7fe53302..2a1c9ee71aa 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,4 +1,10 @@
-libgcc/
+2009-11-18 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR other/39888
+ * config/t-slibgcc-darwin: Fix embedded rpaths for
+ --enable-version-specific-runtime-libs, build extension stub
+ libs exposing features available from current libgcc_s.
+
2009-11-11 Jon Beniston <jon@beniston.com>
* config.host: Add lm32 targets.
diff --git a/libgcc/config/t-slibgcc-darwin b/libgcc/config/t-slibgcc-darwin
index 3dd172367f4..9154b3a72fe 100644
--- a/libgcc/config/t-slibgcc-darwin
+++ b/libgcc/config/t-slibgcc-darwin
@@ -2,9 +2,8 @@
SHLIB_SOVERSION = 1
SHLIB_VERSTRING = -compatibility_version $(SHLIB_SOVERSION) -current_version $(SHLIB_SOVERSION).0
SHLIB_EXT = .dylib
-SHLIB_SUFFIX = `if test @multilib_dir@ = ppc64 ; then echo _@multilib_dir@ ; fi`
-SHLIB_INSTALL_NAME = @shlib_base_name@$(SHLIB_SUFFIX).$(SHLIB_SOVERSION)$(SHLIB_EXT)
-SHLIB_SONAME = @shlib_base_name@.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+SHLIB_INSTALL_NAME = @shlib_base_name@.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+SHLIB_SONAME = @shlib_base_name@$(SHLIB_EXT)
SHLIB_SOLINK = @shlib_base_name@.so
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
@@ -15,9 +14,10 @@ SHLIB_LC = -lc
# so the libgcc variants have different names not different locations.
# Note that this version is used for the loader, not the linker; the linker
# uses the stub versions named by the versioned members of $(INSTALL_FILES).
+
SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
-install_name @shlib_slibdir@/$(SHLIB_INSTALL_NAME) \
- -single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \
+ -single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME) \
-Wl,-exported_symbols_list,$(SHLIB_MAP) \
$(SHLIB_VERSTRING) \
@multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC)
@@ -26,16 +26,26 @@ SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk
SHLIB_MKMAP_OPTS = -v leading_underscore=1
SHLIB_MAPFILES += $(gcc_srcdir)/libgcc-std.ver
-INSTALL_FILES=libgcc_s.10.4.dylib libgcc_s.10.5.dylib libgcc_s.1.dylib
+# we're only going to build the stubs if the target slib is /usr/lib
+# there is no other case in which they're useful in a live system.
+ifeq (/usr/lib,$(shlib_slibdir))
+LGCC_STUBS = libgcc_s.10.4.dylib libgcc_s.10.5.dylib
+else
+LGCC_STUBS =
+endif
+
+LGCC_FILES = libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+LGCC_FILES += $(LGCC_STUBS)
+LEXT_STUBS = libgcc_ext.10.4$(SHLIB_EXT) libgcc_ext.10.5$(SHLIB_EXT)
+LGCC_FILES += $(LEXT_STUBS)
+INSTALL_FILES=$(LGCC_FILES)
+
+# we do our own thing
+SHLIB_INSTALL =
# For the toplevel multilib, build a fat archive including all the multilibs.
ifeq ($(MULTIBUILDTOP),)
-SHLIB_INSTALL = \
- $(mkinstalldirs) $(DESTDIR)$(slibdir); \
- $(INSTALL_DATA) $(SHLIB_SONAME) \
- $(DESTDIR)$(slibdir)/$(SHLIB_SONAME)
-
ifeq ($(enable_shared),yes)
all: $(INSTALL_FILES)
install-leaf: install-darwin-libgcc-stubs
@@ -48,35 +58,37 @@ endif
# The actual use of the libraries is controlled by REAL_LIBGCC_SPEC.
#
# This assumes each multilib corresponds to a different architecture.
-libgcc_s.%.dylib : $(SHLIB_VERPFX).%.ver libgcc_s$(SHLIB_EXT) all-multi
- $(STRIP) -o $(@)_T \
- -s $(SHLIB_VERPFX).$(*).ver -c -u \
- ./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp
- MLIBS=`$(CC) --print-multi-lib \
- | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \
+libgcc_s.%.dylib : all-multi $(SHLIB_VERPFX).%.ver libgcc_s$(SHLIB_EXT)
+ MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \
for mlib in $$MLIBS ; do \
$(STRIP) -o $(@)_T$${mlib} \
-s $(SHLIB_VERPFX).$(*).ver -c -u \
- ../$${mlib}/libgcc/$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp || exit 1 ; \
+ ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT) || exit 1 ; \
done
$(LIPO) -output $@ -create $(@)_T*
rm $(@)_T*
-libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT): all-multi libgcc_s$(SHLIB_EXT) \
- libgcc_s.10.4.dylib libgcc_s.10.5.dylib
- cp libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp \
- ./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_ || exit 1 ; \
- MLIBS=`$(CC) --print-multi-lib \
- | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \
+libgcc_ext.%.dylib : all-multi $(SHLIB_VERPFX).%.ver libgcc_s$(SHLIB_EXT)
+ MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \
for mlib in $$MLIBS ; do \
- cp ../$${mlib}/libgcc/$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp \
+ $(STRIP) -o $(@)_T$${mlib} \
+ -R $(SHLIB_VERPFX).$(*).ver -c -urx \
+ ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT) || exit 1 ; \
+ done
+ $(LIPO) -output $@ -create $(@)_T*
+ rm $(@)_T*
+
+libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT): all-multi libgcc_s$(SHLIB_EXT)
+ MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \
+ for mlib in $$MLIBS ; do \
+ cp ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT) \
./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_$${mlib} || exit 1 ; \
done
$(LIPO) -output libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) \
-create libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T*
rm libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T*
-install-darwin-libgcc-stubs : $(INSTALL_FILES)
+install-darwin-libgcc-stubs :
$(mkinstalldirs) $(DESTDIR)$(slibdir)
for d in $(INSTALL_FILES) ; do \
$(INSTALL_DATA) $$d $(DESTDIR)$(slibdir)/$$d || exit 1 ; \
@@ -98,7 +110,6 @@ else
# we're putting them in the gcc directory during a build, for
# compatibility with the pre-top-level layout. In that case we
# need symlinks.
-SHLIB_INSTALL =
ifeq ($(enable_shared),yes)
all: install-darwin-libgcc-links
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 3ee00936037..a1cb0d09175 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-19 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * io/fbuf.h: Move includes after include guard.
+ * io/format.h: Likewise.
+ * io/unix.h: Likewise.
+
+2009-11-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/42090
+ * io/transfer.c (skip_record): Set bytes_left_subrecord to zero after
+ skipping the remaining bytes in the record.
+ (next_record_r): Call skip_record with the number of bytes_left to be
+ skipped.
+
2009-11-02 Janne Blomqvist <jb@gcc.gnu.org>
* Makefile.am (gfor_io_headers): Add fbuf.h, format.h, unix.h.
diff --git a/libgfortran/io/fbuf.h b/libgfortran/io/fbuf.h
index 368cec28b2c..c82d01b2b98 100644
--- a/libgfortran/io/fbuf.h
+++ b/libgfortran/io/fbuf.h
@@ -23,11 +23,11 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-#include "io.h"
-
#ifndef GFOR_FBUF_H
#define GFOR_FBUF_H
+#include "io.h"
+
/* Formatting buffer. This is a temporary scratch buffer used by
formatted read and writes. After every formatted I/O statement,
diff --git a/libgfortran/io/format.h b/libgfortran/io/format.h
index c338daa1950..4abbbea437e 100644
--- a/libgfortran/io/format.h
+++ b/libgfortran/io/format.h
@@ -23,11 +23,12 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-#include "io.h"
-
#ifndef GFOR_FORMAT_H
#define GFOR_FORMAT_H
+#include "io.h"
+
+
/* Format tokens. Only about half of these can be stored in the
format nodes. */
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index b5f52b1ccf3..a110c6529ff 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -2661,6 +2661,8 @@ skip_record (st_parameter_dt *dtp, ssize_t bytes)
if (sseek (dtp->u.p.current_unit->s,
dtp->u.p.current_unit->bytes_left_subrecord, SEEK_CUR) < 0)
generate_error (&dtp->common, LIBERROR_OS, NULL);
+
+ dtp->u.p.current_unit->bytes_left_subrecord = 0;
}
else
{ /* Seek by reading data. */
@@ -2741,7 +2743,7 @@ next_record_r (st_parameter_dt *dtp)
case FORMATTED_DIRECT:
case UNFORMATTED_DIRECT:
- skip_record (dtp, 0);
+ skip_record (dtp, dtp->u.p.current_unit->bytes_left);
break;
case FORMATTED_STREAM:
diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h
index 721c63c02e4..f0f0712457a 100644
--- a/libgfortran/io/unix.h
+++ b/libgfortran/io/unix.h
@@ -23,11 +23,12 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-#include "io.h"
-
#ifndef GFOR_UNIX_H
#define GFOR_UNIX_H
+#include "io.h"
+
+
struct stream
{
ssize_t (*read) (struct stream *, void *, ssize_t);
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 05e594e7cf0..fbc03fe83a9 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-20 Ben Elliston <bje@au.ibm.com>
+
+ * pex-unix.c (pex_child_error): Define writeerr macro to avoid
+ unused result warnings from write(3) calls. Undefine writeerr
+ after all uses.
+
2009-10-08 Daniel Gutson <dgutson@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index baf2bb4995b..3753812b314 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -368,7 +368,7 @@ static void
pex_child_error (struct pex_obj *obj, const char *executable,
const char *errmsg, int err)
{
-#define writeerr(s) (void) write (STDERR_FILE_NO, s, strlen (s))
+#define writeerr(s) if (write (STDERR_FILE_NO, s, strlen (s))) {}
writeerr (obj->pname);
writeerr (": error trying to exec '");
writeerr (executable);
@@ -377,6 +377,7 @@ pex_child_error (struct pex_obj *obj, const char *executable,
writeerr (": ");
writeerr (xstrerror (err));
writeerr ("\n");
+#undef writeerr
_exit (-1);
}
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 37153dabfc4..8d7ddc867b4 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,13 @@
+2009-11-17 Andrew Haley <aph@redhat.com>
+
+ * posix-threads.cc (park): Rewrite code to handle time.
+ Move mutex lock before the call to compare_and_swap to avoid a
+ race condition.
+ Add some assertions.
+ (unpark): Add an assertion.
+ (init): Move here from posix-threads.h.
+ * include/posix-threads.h (destroy): removed.
+
2009-11-13 Eric Botcazou <ebotcazou@adacore.com>
* exception.cc (PERSONALITY_FUNCTION): Fix oversight.
diff --git a/libjava/include/posix-threads.h b/libjava/include/posix-threads.h
index 806ee556011..59e65f74499 100644
--- a/libjava/include/posix-threads.h
+++ b/libjava/include/posix-threads.h
@@ -375,13 +375,6 @@ struct ParkHelper
};
inline void
-ParkHelper::init ()
-{
- pthread_mutex_init (&mutex, NULL);
- pthread_cond_init (&cond, NULL);
-}
-
-inline void
ParkHelper::destroy ()
{
pthread_mutex_destroy (&mutex);
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc
index 287d6b79a6f..a26c3bd336e 100644
--- a/libjava/posix-threads.cc
+++ b/libjava/posix-threads.cc
@@ -359,15 +359,16 @@ ParkHelper::unpark ()
if (compare_and_swap
(ptr, Thread::THREAD_PARK_RUNNING, Thread::THREAD_PARK_PERMIT))
return;
-
+
/* If this thread is parked, put it into state RUNNING and send it a
signal. */
- if (compare_and_swap
+ if (compare_and_swap
(ptr, Thread::THREAD_PARK_PARKED, Thread::THREAD_PARK_RUNNING))
{
pthread_mutex_lock (&mutex);
- pthread_cond_signal (&cond);
+ int result = pthread_cond_signal (&cond);
pthread_mutex_unlock (&mutex);
+ JvAssert (result == 0);
}
}
@@ -380,6 +381,14 @@ ParkHelper::deactivate ()
permit = ::java::lang::Thread::THREAD_PARK_DEAD;
}
+void
+ParkHelper::init ()
+{
+ pthread_mutex_init (&mutex, NULL);
+ pthread_cond_init (&cond, NULL);
+ permit = ::java::lang::Thread::THREAD_PARK_RUNNING;
+}
+
/**
* Blocks the thread until a matching _Jv_ThreadUnpark() occurs, the
* thread is interrupted or the optional timeout expires. If an
@@ -407,32 +416,44 @@ ParkHelper::park (jboolean isAbsolute, jlong time)
return;
struct timespec ts;
- jlong millis = 0, nanos = 0;
if (time)
{
+ unsigned long long seconds;
+ unsigned long usec;
+
if (isAbsolute)
{
- millis = time;
- nanos = 0;
+ ts.tv_sec = time / 1000;
+ ts.tv_nsec = (time % 1000) * 1000 * 1000;
}
else
{
- millis = java::lang::System::currentTimeMillis();
- nanos = time;
- }
-
- if (millis > 0 || nanos > 0)
- {
// Calculate the abstime corresponding to the timeout.
- // Everything is in milliseconds.
- //
- // We use `unsigned long long' rather than jlong because our
- // caller may pass up to Long.MAX_VALUE millis. This would
- // overflow the range of a timespec.
+ jlong nanos = time;
+ jlong millis = 0;
- unsigned long long m = (unsigned long long)millis;
- unsigned long long seconds = m / 1000;
+ // For better accuracy, should use pthread_condattr_setclock
+ // and clock_gettime.
+#ifdef HAVE_GETTIMEOFDAY
+ timeval tv;
+ gettimeofday (&tv, NULL);
+ usec = tv.tv_usec;
+ seconds = tv.tv_sec;
+#else
+ unsigned long long startTime
+ = java::lang::System::currentTimeMillis();
+ seconds = startTime / 1000;
+ /* Assume we're about half-way through this millisecond. */
+ usec = (startTime % 1000) * 1000 + 500;
+#endif
+ /* These next two statements cannot overflow. */
+ usec += nanos / 1000;
+ usec += (millis % 1000) * 1000;
+ /* These two statements could overflow only if tv.tv_sec was
+ insanely large. */
+ seconds += millis / 1000;
+ seconds += usec / 1000000;
ts.tv_sec = seconds;
if (ts.tv_sec < 0 || (unsigned long long)ts.tv_sec != seconds)
@@ -442,29 +463,30 @@ ParkHelper::park (jboolean isAbsolute, jlong time)
millis = nanos = 0;
}
else
- {
- m %= 1000;
- ts.tv_nsec = m * 1000000 + (unsigned long long)nanos;
- }
+ /* This next statement also cannot overflow. */
+ ts.tv_nsec = (usec % 1000000) * 1000 + (nanos % 1000);
}
}
-
+
+ pthread_mutex_lock (&mutex);
if (compare_and_swap
(ptr, Thread::THREAD_PARK_RUNNING, Thread::THREAD_PARK_PARKED))
{
- pthread_mutex_lock (&mutex);
- if (millis == 0 && nanos == 0)
- pthread_cond_wait (&cond, &mutex);
+ int result = 0;
+
+ if (! time)
+ result = pthread_cond_wait (&cond, &mutex);
else
- pthread_cond_timedwait (&cond, &mutex, &ts);
- pthread_mutex_unlock (&mutex);
-
+ result = pthread_cond_timedwait (&cond, &mutex, &ts);
+
+ JvAssert (result == 0 || result == ETIMEDOUT);
+
/* If we were unparked by some other thread, this will already
- be in state THREAD_PARK_RUNNING. If we timed out, we have to
- do it ourself. */
- compare_and_swap
- (ptr, Thread::THREAD_PARK_PARKED, Thread::THREAD_PARK_RUNNING);
+ be in state THREAD_PARK_RUNNING. If we timed out or were
+ interrupted, we have to do it ourself. */
+ permit = Thread::THREAD_PARK_RUNNING;
}
+ pthread_mutex_unlock (&mutex);
}
static void
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 2c93286d985..18fbe843db7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,118 @@
+2009-11-20 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/42019
+ * include/tr1/shared_ptr.h: Only use typeid when RTTI is enabled.
+ * include/bits/shared_ptr_base.h: Likewise.
+ * include/bits/shared_ptr.h: Likewise.
+ * testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc: New.
+ * testsuite/20_util/shared_ptr/misc/42019.cc: New.
+
+2009-11-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * src/compatibility-c++0x.cc (_Fnv_hash<4>, _Fnv_hash<8>): Add.
+
+2009-11-19 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/pool_allocator.cc: Adjust catch blocks.
+ * src/bitmap_allocator.cc: Same.
+ * src/localename.cc: Same.
+ * src/ios.cc: Same.
+
+ * libsupc++/cxxabi-forced.h: Adjust comments, markup.
+
+ * testsuite/util/testsuite_hooks.h (copy_constructor::copyCount):
+ Remove.
+ (copy_constructor::dtorCount): Remove.
+ * testsuite/23_containers/list/modifiers/1.h: Adjust.
+ * testsuite/23_containers/list/modifiers/2.h: Same.
+ * testsuite/23_containers/list/modifiers/3.h: Same.
+
+2009-11-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/41622
+ * include/bits/functional_hash.h: Implement inline the various
+ std::hash specializations, using, when appropriate, pass by
+ const ref too, per DR 1245.
+ * include/tr1_impl/functional_hash.h: Remove, move its contents...
+ * include/tr1/functional_hash.h: ... here.
+ * include/std/functional: Tweak includes.
+ * src/hash_c++0x: Rename to...
+ * src/compatibility-c++0x.cc: ... this, implementing compatibility
+ std::hash<>::operator() specializations.
+ * src/hash.cc: Do not mark specializations as throw().
+ * src/Makefile.am: Adjust.
+ * include/Makefile.am: Likewise.
+ * src/Makefile.in: Regenerate.
+ * include/Makefile.in: Likewise.
+ * testsuite/util/testsuite_api.h: Define a dummy hash for
+ NonDefaultConstructible.
+ * testsuite/23_containers/unordered_map/requirements/
+ explicit_instantiation/2.cc: Use it.
+ * testsuite/23_containers/unordered_multimap/requirements/
+ explicit_instantiation/2.cc: Likewise.
+ * testsuite/23_containers/unordered_set/requirements/
+ explicit_instantiation/2.cc: Likewise.
+ * testsuite/23_containers/unordered_multiset/requirements/
+ explicit_instantiation/2.cc: Likewise.
+
+2009-11-19 Johannes Singler <singler@kit.edu>
+
+ * include/parallel/partition.h (__parallel_partition): Correctly
+ initialize chunk size.
+ (__parallel_nth_element): Respect nth_element_minimal_n. Use
+ sequential nth_element as base case, instead of sequential sort.
+
+2009-11-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/profile/impl/profiler.h: Remove namespace markup.
+
+2009-11-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/profile/bitset: Tweak doxygen markup.
+ * include/profile/deque: Same.
+ * include/profile/list: Same.
+ * include/profile/map.h: Same.
+ * include/profile/multimap.h: Same.
+ * include/profile/multiset.h: Same.
+ * include/profile/set.h: Same.
+ * include/profile/unordered_map: Same.
+ * include/profile/vector: Same.
+
+ * include/profile/impl/profiler_container_size.h: Use namespace
+ __gnu_profile instead of __cxxprof_impl.
+ * include/profile/impl/profiler.h: Same.
+ (_GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD): To
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD.
+ Remove namespace __cxxprof_guard.
+ (__reentrance_guard): De-templatize.
+ (__reentrance_guard::__inside_cxxprof_impl): To
+ __reentrance_guard::_S_get_in.
+
+ * include/profile/impl/profiler_hash_func.h: Use namespace
+ __gnu_profile instead of __cxxprof_impl.
+ * include/profile/impl/profiler_hashtable_size.h: Same.
+ * include/profile/impl/profiler_map_to_unordered_map.h: Same.
+ * include/profile/impl/profiler_node.h: Same.
+ * include/profile/impl/profiler_state.h: Same.
+ * include/profile/impl/profiler_trace.h: Same.
+ * include/profile/impl/profiler_vector_size.h: Same.
+ * include/profile/impl/profiler_vector_to_list.h: Same.
+ * doc/xml/manual/profile_mode.xml: Update.
+
+2009-11-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/debug/bitset: Add doxygen markup.
+ * include/debug/deque: Same.
+ * include/debug/list: Same.
+ * include/debug/map.h: Same.
+ * include/debug/multimap.h: Same.
+ * include/debug/set.h: Same.
+ * include/debug/multiset.h: Same.
+ * include/debug/unordered_map: Same.
+ * include/debug/unordered_set: Same.
+ * include/debug/string: Same.
+ * include/debug/vector: Same.
+
2009-11-15 Steve Ward <planet36@gmail.com>
* libsupc++/cxxabi.h (__cxa_demangle): Fix typo in comment.
diff --git a/libstdc++-v3/doc/xml/manual/profile_mode.xml b/libstdc++-v3/doc/xml/manual/profile_mode.xml
index 5bf8eb13207..5e8e82e99c3 100644
--- a/libstdc++-v3/doc/xml/manual/profile_mode.xml
+++ b/libstdc++-v3/doc/xml/manual/profile_mode.xml
@@ -640,10 +640,10 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
Hook names must start with <code>__profcxx_</code>.
Make sure they transform
in no code with <code>-D_NO_GLBICXX_PROFILE_MAGIC</code>.
- Make sure all calls to any method in namespace <code>__cxxprof_impl</code>
+ Make sure all calls to any method in namespace <code>__gnu_profile</code>
is protected against reentrance using macro
- <code>_GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD</code>.
- All names of methods in namespace <code>__cxxprof_impl</code> called from
+ <code>_GLIBCXX_PROFILE_REENTRANCE_GUARD</code>.
+ All names of methods in namespace <code>__gnu_profile</code> called from
<code>profiler.h</code> must start with <code>__trace_magic_</code>.
</para>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 1cea8a24e94..47253e681c9 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -610,7 +610,6 @@ tr1_impl_headers = \
${tr1_impl_srcdir}/cwchar \
${tr1_impl_srcdir}/cwctype \
${tr1_impl_srcdir}/functional \
- ${tr1_impl_srcdir}/functional_hash.h \
${tr1_impl_srcdir}/hashtable \
${tr1_impl_srcdir}/hashtable_policy.h \
${tr1_impl_srcdir}/regex \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index a1fab9adfbe..71e7489be36 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -850,7 +850,6 @@ tr1_impl_headers = \
${tr1_impl_srcdir}/cwchar \
${tr1_impl_srcdir}/cwctype \
${tr1_impl_srcdir}/functional \
- ${tr1_impl_srcdir}/functional_hash.h \
${tr1_impl_srcdir}/hashtable \
${tr1_impl_srcdir}/hashtable_policy.h \
${tr1_impl_srcdir}/regex \
diff --git a/libstdc++-v3/include/bits/functional_hash.h b/libstdc++-v3/include/bits/functional_hash.h
index 78b0aa3cf66..c045ba08434 100644
--- a/libstdc++-v3/include/bits/functional_hash.h
+++ b/libstdc++-v3/include/bits/functional_hash.h
@@ -36,33 +36,232 @@
# include <c++0x_warning.h>
#endif
-#if defined(_GLIBCXX_INCLUDE_AS_TR1)
-# error C++0x header cannot be included from TR1 header
+#include <string>
+#include <system_error>
+
+namespace std
+{
+ /// Class template hash.
+ template<typename _Tp>
+ struct hash;
+
+ /// Partial specializations for pointer types.
+ template<typename _Tp>
+ struct hash<_Tp*> : public std::unary_function<_Tp*, size_t>
+ {
+ size_t
+ operator()(_Tp* __p) const
+ { return reinterpret_cast<size_t>(__p); }
+ };
+
+ /// Explicit specializations for integer types.
+#define _Cxx_hashtable_define_trivial_hash(_Tp) \
+ template<> \
+ struct hash<_Tp> : public std::unary_function<_Tp, size_t> \
+ { \
+ size_t \
+ operator()(_Tp __val) const \
+ { return static_cast<size_t>(__val); } \
+ };
+
+ _Cxx_hashtable_define_trivial_hash(bool);
+ _Cxx_hashtable_define_trivial_hash(char);
+ _Cxx_hashtable_define_trivial_hash(signed char);
+ _Cxx_hashtable_define_trivial_hash(unsigned char);
+ _Cxx_hashtable_define_trivial_hash(wchar_t);
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+ _Cxx_hashtable_define_trivial_hash(char16_t);
+ _Cxx_hashtable_define_trivial_hash(char32_t);
#endif
+ _Cxx_hashtable_define_trivial_hash(short);
+ _Cxx_hashtable_define_trivial_hash(int);
+ _Cxx_hashtable_define_trivial_hash(long);
+ _Cxx_hashtable_define_trivial_hash(long long);
+ _Cxx_hashtable_define_trivial_hash(unsigned short);
+ _Cxx_hashtable_define_trivial_hash(unsigned int);
+ _Cxx_hashtable_define_trivial_hash(unsigned long);
+ _Cxx_hashtable_define_trivial_hash(unsigned long long);
+
+#undef _Cxx_hashtable_define_trivial_hash
+
+ // Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
+ // (Used by the next specializations of std::tr1::hash.)
+
+ /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
+ template<size_t = sizeof(size_t)>
+ struct _Fnv_hash
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = 0;
+ for (; __length > 0; --__length)
+ __result = (__result * 131) + *__first++;
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<4>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = static_cast<size_t>(2166136261UL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(16777619UL);
+ }
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<8>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result =
+ static_cast<size_t>(14695981039346656037ULL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(1099511628211ULL);
+ }
+ return __result;
+ }
+ };
+
+ /// Explicit specializations for float.
+ template<>
+ struct hash<float>
+ : public std::unary_function<float, size_t>
+ {
+ size_t
+ operator()(float __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0f)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ }
+ };
+
+ /// Explicit specializations for double.
+ template<>
+ struct hash<double>
+ : public std::unary_function<double, size_t>
+ {
+ size_t
+ operator()(double __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ }
+ };
-#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
-# include <tr1_impl/functional_hash.h>
-#else
-# define _GLIBCXX_INCLUDE_AS_CXX0X
-# define _GLIBCXX_BEGIN_NAMESPACE_TR1
-# define _GLIBCXX_END_NAMESPACE_TR1
-# define _GLIBCXX_TR1
-# include <tr1_impl/functional_hash.h>
-# undef _GLIBCXX_TR1
-# undef _GLIBCXX_END_NAMESPACE_TR1
-# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
-# undef _GLIBCXX_INCLUDE_AS_CXX0X
+ /// Explicit specializations for long double.
+ template<>
+ struct hash<long double>
+ : public std::unary_function<long double, size_t>
+ {
+ size_t
+ operator()(long double __val) const
+ {
+ size_t __result = 0;
+
+ int __exponent;
+ __val = __builtin_frexpl(__val, &__exponent);
+ __val = __val < 0.0l ? -(__val + 0.5l) : __val;
+
+ const long double __mult =
+ __gnu_cxx::__numeric_traits<size_t>::__max + 1.0l;
+ __val *= __mult;
+
+ // Try to use all the bits of the mantissa (really necessary only
+ // on 32-bit targets, at least for 80-bit floating point formats).
+ const size_t __hibits = (size_t)__val;
+ __val = (__val - (long double)__hibits) * __mult;
+
+ const size_t __coeff =
+ __gnu_cxx::__numeric_traits<size_t>::__max / __LDBL_MAX_EXP__;
+
+ __result = __hibits + (size_t)__val + __coeff * __exponent;
+
+ return __result;
+ }
+ };
+
+ template<>
+ struct hash<string>
+ : public std::unary_function<string, size_t>
+ {
+ size_t
+ operator()(const string& __s) const
+ { return _Fnv_hash<>::hash(__s.data(), __s.length()); }
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ struct hash<wstring>
+ : public std::unary_function<wstring, size_t>
+ {
+ size_t
+ operator()(const wstring& __s) const
+ {
+ const char* __p = reinterpret_cast<const char*>(__s.data());
+ return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
+ }
+ };
#endif
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+ template<>
+ struct hash<u16string>
+ : public std::unary_function<u16string, size_t>
+ {
+ size_t
+ operator()(const u16string& __s) const
+ {
+ const char* __p = reinterpret_cast<const char*>(__s.data());
+ return _Fnv_hash<>::hash(__p, __s.length() * sizeof(char16_t));
+ }
+ };
-namespace std
-{
- struct error_code;
+ template<>
+ struct hash<u32string>
+ : public std::unary_function<u32string, size_t>
+ {
+ size_t
+ operator()(const u32string& __s) const
+ {
+ const char* __p = reinterpret_cast<const char*>(__s.data());
+ return _Fnv_hash<>::hash(__p, __s.length() * sizeof(char32_t));
+ }
+ };
+#endif
template<>
- _GLIBCXX_PURE size_t
- hash<error_code>::operator()(error_code) const;
+ struct hash<error_code>
+ : public std::unary_function<error_code, size_t>
+ {
+ size_t
+ operator()(const error_code& __e) const
+ {
+ const char* __p = reinterpret_cast<const char*>(&__e);
+ return _Fnv_hash<>::hash(__p, sizeof(__e));
+ }
+ };
}
#endif // _FUNCTIONAL_HASH_H
-
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index 796df14c2c4..60fdf2fcbb0 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -76,7 +76,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _Del, typename _Tp, _Lock_policy _Lp>
inline _Del*
get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
- { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
+ {
+#ifdef __GXX_RTTI
+ return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del)));
+#else
+ return 0;
+#endif
+ }
/**
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index b8083e405c8..ff1282d5620 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -151,7 +151,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
virtual void*
_M_get_deleter(const std::type_info& __ti)
- { return __ti == typeid(_Deleter) ? &_M_del._M_del : 0; }
+ {
+#ifdef __GXX_RTTI
+ return __ti == typeid(_Deleter) ? &_M_del._M_del : 0;
+#else
+ return 0;
+#endif
+ }
protected:
_My_Deleter _M_del; // copy constructor must not throw
@@ -209,9 +215,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
virtual void*
_M_get_deleter(const std::type_info& __ti)
{
+#ifdef __GXX_RTTI
return __ti == typeid(_Sp_make_shared_tag)
? static_cast<void*>(&_M_storage)
: _Base_type::_M_get_deleter(__ti);
+#else
+ return 0;
+#endif
}
private:
@@ -740,6 +750,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
{ return _M_refcount._M_less(__rhs._M_refcount); }
+#ifdef __GXX_RTTI
protected:
// This constructor is non-standard, it is used by allocate_shared.
template<typename _Alloc, typename... _Args>
@@ -753,6 +764,39 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_ptr = static_cast<_Tp*>(__p);
__enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
}
+#else
+ template<typename _Alloc>
+ struct _Deleter
+ {
+ void operator()(_Tp* __ptr)
+ {
+ _M_alloc.destroy(__ptr);
+ _M_alloc.deallocate(__ptr, 1);
+ }
+ _Alloc _M_alloc;
+ };
+
+ template<typename _Alloc, typename... _Args>
+ __shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : _M_ptr(), _M_refcount()
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other _Alloc2;
+ _Deleter<_Alloc2> __del = { _Alloc2(__a) };
+ _M_ptr = __del._M_alloc.allocate(1);
+ __try
+ {
+ __del._M_alloc.construct(_M_ptr, std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ __del._M_alloc.deallocate(_M_ptr, 1);
+ __throw_exception_again;
+ }
+ __shared_count<_Lp> __count(_M_ptr, __del, __del._M_alloc);
+ _M_refcount._M_swap(__count);
+ __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
+ }
+#endif
template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
typename... _Args>
diff --git a/libstdc++-v3/include/debug/bitset b/libstdc++-v3/include/debug/bitset
index b4934423b80..c6203d9a985 100644
--- a/libstdc++-v3/include/debug/bitset
+++ b/libstdc++-v3/include/debug/bitset
@@ -38,6 +38,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::bitset with additional safety/checking/debug instrumentation.
template<size_t _Nb>
class bitset
: public _GLIBCXX_STD_D::bitset<_Nb>,
@@ -363,6 +364,7 @@ namespace __debug
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const bitset<_Nb>& __x)
{ return __os << __x._M_base(); }
+
} // namespace __debug
} // namespace std
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 3a39dc46004..d6078f580e1 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -38,6 +38,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::deque with safety/checking/debug instrumentation.
template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
class deque
: public _GLIBCXX_STD_D::deque<_Tp, _Allocator>,
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index d4904893f22..72060e0dc9c 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -39,6 +39,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::list with safety/checking/debug instrumentation.
template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
class list
: public _GLIBCXX_STD_D::list<_Tp, _Allocator>,
diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h
index c8eec2c4c6f..2ac21dff5bc 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -38,6 +38,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::map with safety/checking/debug instrumentation.
template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
class map
diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h
index 16841ff8668..3c525b5fac6 100644
--- a/libstdc++-v3/include/debug/multimap.h
+++ b/libstdc++-v3/include/debug/multimap.h
@@ -38,6 +38,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::multimap with safety/checking/debug instrumentation.
template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
class multimap
diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h
index a952663ea31..1a15c207bc8 100644
--- a/libstdc++-v3/include/debug/multiset.h
+++ b/libstdc++-v3/include/debug/multiset.h
@@ -38,6 +38,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::multiset with safety/checking/debug instrumentation.
template<typename _Key, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<_Key> >
class multiset
diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h
index 131b817d5fa..b822ba9606e 100644
--- a/libstdc++-v3/include/debug/set.h
+++ b/libstdc++-v3/include/debug/set.h
@@ -38,6 +38,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::set with safety/checking/debug instrumentation.
template<typename _Key, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<_Key> >
class set
diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string
index d88989add67..942afaa8337 100644
--- a/libstdc++-v3/include/debug/string
+++ b/libstdc++-v3/include/debug/string
@@ -36,6 +36,7 @@
namespace __gnu_debug
{
+ /// Class std::basic_string with safety/checking/debug instrumentation.
template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT> >
class basic_string
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index 93a720653a3..999dcae58fc 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -44,6 +44,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::unordered_map with safety/checking/debug instrumentation.
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
@@ -315,6 +316,7 @@ namespace __debug
{ __x.swap(__y); }
+ /// Class std::unordered_multimap with safety/checking/debug instrumentation.
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index 96d0b0f3e35..4f27c3f375d 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -44,6 +44,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::unordered_set with safety/checking/debug instrumentation.
template<typename _Value,
typename _Hash = std::hash<_Value>,
typename _Pred = std::equal_to<_Value>,
@@ -314,6 +315,7 @@ namespace __debug
{ __x.swap(__y); }
+ /// Class std::unordered_multiset with safety/checking/debug instrumentation.
template<typename _Value,
typename _Hash = std::hash<_Value>,
typename _Pred = std::equal_to<_Value>,
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 708ee455fe9..2445b3d6890 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -39,6 +39,7 @@ namespace std
{
namespace __debug
{
+ /// Class std::vector with safety/checking/debug instrumentation.
template<typename _Tp,
typename _Allocator = std::allocator<_Tp> >
class vector
diff --git a/libstdc++-v3/include/parallel/partition.h b/libstdc++-v3/include/parallel/partition.h
index cfc2fd3737e..52993c86c95 100644
--- a/libstdc++-v3/include/parallel/partition.h
+++ b/libstdc++-v3/include/parallel/partition.h
@@ -73,7 +73,7 @@ namespace __gnu_parallel
bool* __reserved_left = NULL, * __reserved_right = NULL;
- _DifferenceType __chunk_size;
+ _DifferenceType __chunk_size = __s.partition_chunk_size;
omp_lock_t __result_lock;
omp_init_lock(&__result_lock);
@@ -345,15 +345,16 @@ namespace __gnu_parallel
_RAIter __split;
_RandomNumber __rng;
- _DifferenceType __minimum_length =
- std::max<_DifferenceType>(2, _Settings::get().partition_minimal_n);
+ const _Settings& __s = _Settings::get();
+ _DifferenceType __minimum_length = std::max<_DifferenceType>(2,
+ std::max(__s.nth_element_minimal_n, __s.partition_minimal_n));
// Break if input range to small.
while (static_cast<_SequenceIndex>(__end - __begin) >= __minimum_length)
{
_DifferenceType __n = __end - __begin;
- _RAIter __pivot_pos = __begin + __rng(__n);
+ _RAIter __pivot_pos = __begin + __rng(__n);
// Swap __pivot_pos value to end.
if (__pivot_pos != (__end - 1))
@@ -412,7 +413,7 @@ namespace __gnu_parallel
}
// Only at most _Settings::partition_minimal_n __elements __left.
- __gnu_sequential::sort(__begin, __end, __comp);
+ __gnu_sequential::nth_element(__begin, __nth, __end, __comp);
}
/** @brief Parallel implementation of std::partial_sort().
diff --git a/libstdc++-v3/include/profile/bitset b/libstdc++-v3/include/profile/bitset
index 96a59ea4ad9..e1be8b8d1ca 100644
--- a/libstdc++-v3/include/profile/bitset
+++ b/libstdc++-v3/include/profile/bitset
@@ -35,7 +35,7 @@ namespace std
{
namespace __profile
{
- /** @brief Bitset wrapper with performance instrumentation. */
+ /// Class std::bitset wrapper with performance instrumentation.
template<size_t _Nb>
class bitset
: public _GLIBCXX_STD_D::bitset<_Nb>
diff --git a/libstdc++-v3/include/profile/deque b/libstdc++-v3/include/profile/deque
index 6ba3679e0c6..33bf72bc784 100644
--- a/libstdc++-v3/include/profile/deque
+++ b/libstdc++-v3/include/profile/deque
@@ -35,7 +35,7 @@ namespace std
{
namespace __profile
{
- /** @brief Deque wrapper with performance instrumentation. */
+ /// Class std::deque wrapper with performance instrumentation.
template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
class deque
: public _GLIBCXX_STD_D::deque<_Tp, _Allocator>
diff --git a/libstdc++-v3/include/profile/impl/profiler.h b/libstdc++-v3/include/profile/impl/profiler.h
index f86920344fc..78e1d140440 100644
--- a/libstdc++-v3/include/profile/impl/profiler.h
+++ b/libstdc++-v3/include/profile/impl/profiler.h
@@ -43,91 +43,79 @@
#include <stddef.h>
#endif
-/**
- * @namespace std::__cxxprof_guard
- * @brief Mechanism to protect all __cxxprof_impl operations against
- * multithreaded and exception reentrance.
- */
-namespace __cxxprof_guard
+namespace __gnu_profile
{
+ /** @brief Reentrance guard.
+ *
+ * Mechanism to protect all __gnu_profile operations against recursion,
+ * multithreaded and exception reentrance.
+ */
+ struct __reentrance_guard
+ {
+ static bool
+ _S_set_in()
+ {
+ if (_S_get_in())
+ return false;
+ else
+ {
+ _S_get_in() = true;
+ return true;
+ }
+ }
-/** @brief Reentrance guard.
- *
- * Mechanism to protect all __cxxprof_impl operations against recursion,
- * multithreaded and exception reentrance.
- */
-template <int _Unused=0>
-class __reentrance_guard
-{
- public:
- static __thread bool __inside_cxxprof_impl;
- static bool __get_in();
- __reentrance_guard() {}
- ~__reentrance_guard() { __inside_cxxprof_impl = false; }
-};
+ static bool&
+ _S_get_in()
+ {
+ static __thread bool _S_inside(false);
+ return _S_inside;
+ }
-template <int _Unused>
-__thread bool __reentrance_guard<_Unused>::__inside_cxxprof_impl = false;
+ __reentrance_guard() { }
+ ~__reentrance_guard() { _S_get_in() = false; }
+ };
-template <int _Unused>
-bool __reentrance_guard<_Unused>::__get_in()
-{
- if (__inside_cxxprof_impl) {
- return false;
- } else {
- __inside_cxxprof_impl = true;
- return true;
+#define _GLIBCXX_PROFILE_REENTRANCE_GUARD(__x...) \
+ { \
+ if (__gnu_profile::__reentrance_guard::_S_get_in()) \
+ { \
+ __gnu_profile::__reentrance_guard __get_out; \
+ __x; \
+ } \
}
-}
-
-} // namespace __cxxprof_guard
-#define _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__x...) \
- { \
- if (__cxxprof_guard::__reentrance_guard<0>::__get_in()) \
- { \
- __cxxprof_guard::__reentrance_guard<0> __auto_get_out; \
- __x; \
- } \
- }
-/**
- * @namespace std::__cxxprof_impl
- * @brief Implementation of profile extension.
- */
-namespace __cxxprof_impl
-{
-// Forward declarations of implementation functions.
-// Don't use any __cxxprof_impl:: in user code.
-// Instead, use the __profcxx... macros, which offer guarded access.
-void __turn_on();
-void __turn_off();
-bool __is_invalid();
-bool __is_on();
-bool __is_off();
-void __report(void);
-void __trace_hashtable_size_resize(const void*, size_t, size_t);
-void __trace_hashtable_size_destruct(const void*, size_t, size_t);
-void __trace_hashtable_size_construct(const void*, size_t);
-void __trace_vector_size_resize(const void*, size_t, size_t);
-void __trace_vector_size_destruct(const void*, size_t, size_t);
-void __trace_vector_size_construct(const void*, size_t);
-void __trace_hash_func_destruct(const void*, size_t, size_t, size_t);
-void __trace_hash_func_construct(const void*);
-void __trace_vector_to_list_destruct(const void*);
-void __trace_vector_to_list_construct(const void*);
-void __trace_vector_to_list_insert(const void*, size_t, size_t);
-void __trace_vector_to_list_iterate(const void*, size_t);
-void __trace_vector_to_list_invalid_operator(const void*);
-void __trace_vector_to_list_resize(const void*, size_t, size_t);
-void __trace_map_to_unordered_map_construct(const void*);
-void __trace_map_to_unordered_map_invalidate(const void*);
-void __trace_map_to_unordered_map_insert(const void*, size_t, size_t);
-void __trace_map_to_unordered_map_erase(const void*, size_t, size_t);
-void __trace_map_to_unordered_map_iterate(const void*, size_t);
-void __trace_map_to_unordered_map_find(const void*, size_t);
-void __trace_map_to_unordered_map_destruct(const void*);
-} // namespace __cxxprof_impl
+ // Forward declarations of implementation functions.
+ // Don't use any __gnu_profile:: in user code.
+ // Instead, use the __profcxx... macros, which offer guarded access.
+ void __turn_on();
+ void __turn_off();
+ bool __is_invalid();
+ bool __is_on();
+ bool __is_off();
+ void __report(void);
+ void __trace_hashtable_size_resize(const void*, size_t, size_t);
+ void __trace_hashtable_size_destruct(const void*, size_t, size_t);
+ void __trace_hashtable_size_construct(const void*, size_t);
+ void __trace_vector_size_resize(const void*, size_t, size_t);
+ void __trace_vector_size_destruct(const void*, size_t, size_t);
+ void __trace_vector_size_construct(const void*, size_t);
+ void __trace_hash_func_destruct(const void*, size_t, size_t, size_t);
+ void __trace_hash_func_construct(const void*);
+ void __trace_vector_to_list_destruct(const void*);
+ void __trace_vector_to_list_construct(const void*);
+ void __trace_vector_to_list_insert(const void*, size_t, size_t);
+ void __trace_vector_to_list_iterate(const void*, size_t);
+ void __trace_vector_to_list_invalid_operator(const void*);
+ void __trace_vector_to_list_resize(const void*, size_t, size_t);
+ void __trace_map_to_unordered_map_construct(const void*);
+ void __trace_map_to_unordered_map_invalidate(const void*);
+ void __trace_map_to_unordered_map_insert(const void*, size_t, size_t);
+ void __trace_map_to_unordered_map_erase(const void*, size_t, size_t);
+ void __trace_map_to_unordered_map_iterate(const void*, size_t);
+ void __trace_map_to_unordered_map_find(const void*, size_t);
+ void __trace_map_to_unordered_map_destruct(const void*);
+} // namespace __gnu_profile
// Master switch turns on all diagnostics.
#ifdef _GLIBCXX_PROFILE
@@ -143,17 +131,17 @@ void __trace_map_to_unordered_map_destruct(const void*);
// Expose global management routines to user code.
#ifdef _GLIBCXX_PROFILE
#define __profcxx_report() \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__cxxprof_impl::__report())
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__report())
#define __profcxx_turn_on() \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__cxxprof_impl::__turn_on())
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__turn_on())
#define __profcxx_turn_off() \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__cxxprof_impl::__turn_off())
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__turn_off())
#define __profcxx_is_invalid() \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__cxxprof_impl::__is_invalid())
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__is_invalid())
#define __profcxx_is_on() \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__cxxprof_impl::__is_on())
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__is_on())
#define __profcxx__is_off() \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD(__cxxprof_impl::__is_off())
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__is_off())
#else
#define __profcxx_report()
#define __profcxx_turn_on()
@@ -167,77 +155,77 @@ void __trace_map_to_unordered_map_destruct(const void*);
#if ((defined(_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL) \
&& !defined(_NO_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL)) \
|| (defined(_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE) \
- && !defined(_NO_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE)))
+ && !defined(_NO_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE)))
#define __profcxx_hashtable_resize(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_hashtable_size_resize(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_hashtable_size_resize(__x))
#define __profcxx_hashtable_destruct(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_hashtable_size_destruct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_hashtable_size_destruct(__x))
#define __profcxx_hashtable_construct(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_hashtable_size_construct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_hashtable_size_construct(__x))
#else
-#define __profcxx_hashtable_resize(__x...)
-#define __profcxx_hashtable_destruct(__x...)
-#define __profcxx_hashtable_construct(__x...)
+#define __profcxx_hashtable_resize(__x...)
+#define __profcxx_hashtable_destruct(__x...)
+#define __profcxx_hashtable_construct(__x...)
#endif
// Turn on/off instrumentation for VECTOR_TOO_SMALL and VECTOR_TOO_LARGE.
#if ((defined(_GLIBCXX_PROFILE_VECTOR_TOO_SMALL) \
&& !defined(_NO_GLIBCXX_PROFILE_VECTOR_TOO_SMALL)) \
|| (defined(_GLIBCXX_PROFILE_VECTOR_TOO_LARGE) \
- && !defined(_NO_GLIBCXX_PROFILE_VECTOR_TOO_LARGE)))
+ && !defined(_NO_GLIBCXX_PROFILE_VECTOR_TOO_LARGE)))
#define __profcxx_vector_resize(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_size_resize(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_size_resize(__x))
#define __profcxx_vector_destruct(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_size_destruct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_size_destruct(__x))
#define __profcxx_vector_construct(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_size_construct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_size_construct(__x))
#else
-#define __profcxx_vector_resize(__x...)
-#define __profcxx_vector_destruct(__x...)
-#define __profcxx_vector_construct(__x...)
-#endif
+#define __profcxx_vector_resize(__x...)
+#define __profcxx_vector_destruct(__x...)
+#define __profcxx_vector_construct(__x...)
+#endif
// Turn on/off instrumentation for INEFFICIENT_HASH.
#if (defined(_GLIBCXX_PROFILE_INEFFICIENT_HASH) \
&& !defined(_NO_GLIBCXX_PROFILE_INEFFICIENT_HASH))
#define __profcxx_hashtable_construct2(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_hash_func_construct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_hash_func_construct(__x))
#define __profcxx_hashtable_destruct2(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_hash_func_destruct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_hash_func_destruct(__x))
#else
-#define __profcxx_hashtable_destruct2(__x...)
-#define __profcxx_hashtable_construct2(__x...)
+#define __profcxx_hashtable_destruct2(__x...)
+#define __profcxx_hashtable_construct2(__x...)
#endif
// Turn on/off instrumentation for VECTOR_TO_LIST.
#if (defined(_GLIBCXX_PROFILE_VECTOR_TO_LIST) \
&& !defined(_NO_GLIBCXX_PROFILE_VECTOR_TO_LIST))
#define __profcxx_vector_construct2(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_to_list_construct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_to_list_construct(__x))
#define __profcxx_vector_destruct2(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_to_list_destruct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_to_list_destruct(__x))
#define __profcxx_vector_insert(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_to_list_insert(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_to_list_insert(__x))
#define __profcxx_vector_iterate(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_to_list_iterate(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_to_list_iterate(__x))
#define __profcxx_vector_invalid_operator(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_to_list_invalid_operator(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_to_list_invalid_operator(__x))
#define __profcxx_vector_resize2(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_vector_to_list_resize(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_vector_to_list_resize(__x))
#else
#define __profcxx_vector_destruct2(__x...)
#define __profcxx_vector_construct2(__x...)
@@ -251,29 +239,29 @@ void __trace_map_to_unordered_map_destruct(const void*);
#if (defined(_GLIBCXX_PROFILE_MAP_TO_UNORDERED_MAP) \
&& !defined(_NO_GLIBCXX_PROFILE_MAP_TO_UNORDERED_MAP))
#define __profcxx_map_to_unordered_map_construct(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_construct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_construct(__x))
#define __profcxx_map_to_unordered_map_destruct(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_destruct(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_destruct(__x))
#define __profcxx_map_to_unordered_map_insert(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_insert(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_insert(__x))
#define __profcxx_map_to_unordered_map_erase(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_erase(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_erase(__x))
#define __profcxx_map_to_unordered_map_iterate(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_iterate(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_iterate(__x))
#define __profcxx_map_to_unordered_map_invalidate(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_invalidate(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_invalidate(__x))
#define __profcxx_map_to_unordered_map_find(__x...) \
- _GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD( \
- __cxxprof_impl::__trace_map_to_unordered_map_find(__x))
+ _GLIBCXX_PROFILE_REENTRANCE_GUARD( \
+ __gnu_profile::__trace_map_to_unordered_map_find(__x))
#else
#define __profcxx_map_to_unordered_map_construct(__x...) \
-
+
#define __profcxx_map_to_unordered_map_destruct(__x...)
#define __profcxx_map_to_unordered_map_insert(__x...)
#define __profcxx_map_to_unordered_map_erase(__x...)
diff --git a/libstdc++-v3/include/profile/impl/profiler_container_size.h b/libstdc++-v3/include/profile/impl/profiler_container_size.h
index 330afc5ba79..a7907197be0 100644
--- a/libstdc++-v3/include/profile/impl/profiler_container_size.h
+++ b/libstdc++-v3/include/profile/impl/profiler_container_size.h
@@ -51,7 +51,7 @@
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
/** @brief A container size instrumentation line in the object table. */
@@ -246,5 +246,5 @@ inline void __trace_container_size::__resize(const void* __obj, int __from,
__object_info->__resize(__from, __to);
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_CONTAINER_SIZE_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_hash_func.h b/libstdc++-v3/include/profile/impl/profiler_hash_func.h
index cf639545163..2cb36b0d9e9 100644
--- a/libstdc++-v3/include/profile/impl/profiler_hash_func.h
+++ b/libstdc++-v3/include/profile/impl/profiler_hash_func.h
@@ -50,7 +50,7 @@
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
/** @brief A hash performance instrumentation line in the object table. */
@@ -188,5 +188,5 @@ inline void __trace_hash_func_destruct(const void* __obj, size_t __chain,
__tables<0>::_S_hash_func->__destruct(__obj, __chain, __accesses, __hops);
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_HASH_FUNC_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h b/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h
index bfbafc14f90..4bdf6a40c61 100644
--- a/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h
+++ b/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h
@@ -52,7 +52,7 @@
#include "profile/impl/profiler_state.h"
#include "profile/impl/profiler_container_size.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
/** @brief Hashtable size instrumentation trace producer. */
@@ -110,6 +110,6 @@ inline void __trace_hashtable_size_resize(const void* __obj, size_t __from,
__tables<0>::_S_hashtable_size->__resize(__obj, __from, __to);
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_HASHTABLE_SIZE_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_map_to_unordered_map.h b/libstdc++-v3/include/profile/impl/profiler_map_to_unordered_map.h
index cdb88a86bcb..823d4c548b0 100644
--- a/libstdc++-v3/include/profile/impl/profiler_map_to_unordered_map.h
+++ b/libstdc++-v3/include/profile/impl/profiler_map_to_unordered_map.h
@@ -50,7 +50,7 @@
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
// Cost model. XXX: this must be taken from the machine model instead.
@@ -301,5 +301,5 @@ inline void __trace_map_to_unordered_map_invalidate(const void* __obj)
if (__info) __info->__record_invalidate();
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_MAP_TO_UNORDERED_MAP_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_node.h b/libstdc++-v3/include/profile/impl/profiler_node.h
index cd2b9ab2016..3dafff6508b 100644
--- a/libstdc++-v3/include/profile/impl/profiler_node.h
+++ b/libstdc++-v3/include/profile/impl/profiler_node.h
@@ -51,7 +51,7 @@
#include <execinfo.h>
#endif
-namespace __cxxprof_impl
+namespace __gnu_profile
{
typedef const void* __object_t;
typedef void* __instruction_address_t;
@@ -168,5 +168,5 @@ class __stack_info_base
virtual const char* __get_id() const = 0;
};
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_NODE_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_state.h b/libstdc++-v3/include/profile/impl/profiler_state.h
index 03065715463..76d72f54c92 100644
--- a/libstdc++-v3/include/profile/impl/profiler_state.h
+++ b/libstdc++-v3/include/profile/impl/profiler_state.h
@@ -43,7 +43,7 @@
#include <stdio.h>
#endif
-namespace __cxxprof_impl
+namespace __gnu_profile
{
/** @brief Profiling mode on/off state. */
@@ -103,5 +103,5 @@ inline void __turn_off()
__state<0>::_S_diag_state->__turn_off();
}
-} // end namespace __cxxprof_impl
+} // end namespace __gnu_profile
#endif /* PROFCXX_PROFILER_STATE_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_trace.h b/libstdc++-v3/include/profile/impl/profiler_trace.h
index 37bcb6436e5..97620f3f9ba 100644
--- a/libstdc++-v3/include/profile/impl/profiler_trace.h
+++ b/libstdc++-v3/include/profile/impl/profiler_trace.h
@@ -63,7 +63,7 @@
#include "profile/impl/profiler_state.h"
#include "profile/impl/profiler_node.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
#if defined _GLIBCXX_PROFILE_THREADS && defined HAVE_TLS
@@ -367,7 +367,7 @@ void __trace_base<__object_info, __stack_info>::__write(FILE* __f)
if (__it->second.__is_valid()) {
fprintf(__f, __id);
fprintf(__f, "|");
- __cxxprof_impl::__write(__f, __it->first);
+ __gnu_profile::__write(__f, __it->first);
fprintf(__f, "|");
__it->second.__write(__f);
}
@@ -428,7 +428,7 @@ struct __warn
fprintf(__file, __info.__warning_id);
fprintf(__file, ": improvement = %d", __log_magnitude(__info.__magnitude));
fprintf(__file, ": call stack = ");
- __cxxprof_impl::__write(__file, __info.__context);
+ __gnu_profile::__write(__file, __info.__context);
fprintf(__file, ": advice = %s\n", __info.__warning_message);
}
};
@@ -457,7 +457,7 @@ inline FILE* __open_output_file(const char* extension)
* This can also be called directly by user code, including signal handlers.
* It is protected against deadlocks by the reentrance guard in profiler.h.
* However, when called from a signal handler that triggers while within
- * __cxxprof_impl (under the guarded zone), no output will be produced.
+ * __gnu_profile (under the guarded zone), no output will be produced.
*/
inline void __report(void)
{
@@ -559,6 +559,6 @@ inline bool __profcxx_init(void)
return __is_on();
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_TRACE_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_vector_size.h b/libstdc++-v3/include/profile/impl/profiler_vector_size.h
index dd42959825f..4799e1d3531 100644
--- a/libstdc++-v3/include/profile/impl/profiler_vector_size.h
+++ b/libstdc++-v3/include/profile/impl/profiler_vector_size.h
@@ -52,7 +52,7 @@
#include "profile/impl/profiler_state.h"
#include "profile/impl/profiler_container_size.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
/** @brief Hashtable size instrumentation trace producer. */
@@ -107,6 +107,6 @@ inline void __trace_vector_size_resize(const void* __obj, size_t __from,
__tables<0>::_S_vector_size->__resize(__obj, __from, __to);
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_VECTOR_SIZE_H__ */
diff --git a/libstdc++-v3/include/profile/impl/profiler_vector_to_list.h b/libstdc++-v3/include/profile/impl/profiler_vector_to_list.h
index ec3dfbcfb86..661ea38e8f4 100644
--- a/libstdc++-v3/include/profile/impl/profiler_vector_to_list.h
+++ b/libstdc++-v3/include/profile/impl/profiler_vector_to_list.h
@@ -50,7 +50,7 @@
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
-namespace __cxxprof_impl
+namespace __gnu_profile
{
/** @brief A vector-to-list instrumentation line in the object table. */
@@ -314,5 +314,5 @@ inline void __trace_vector_to_list_resize(const void* __obj,
__tables<0>::_S_vector_to_list->__resize(__obj, __from, __to);
}
-} // namespace __cxxprof_impl
+} // namespace __gnu_profile
#endif /* PROFCXX_PROFILER_VECTOR_TO_LIST_H__ */
diff --git a/libstdc++-v3/include/profile/list b/libstdc++-v3/include/profile/list
index 061c5065826..5060293ab1c 100644
--- a/libstdc++-v3/include/profile/list
+++ b/libstdc++-v3/include/profile/list
@@ -35,7 +35,7 @@ namespace std
{
namespace __profile
{
- /** @brief List wrapper with performance instrumentation. */
+ /// Class std::list wrapper with performance instrumentation.
template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
class list
: public _GLIBCXX_STD_D::list<_Tp, _Allocator>
diff --git a/libstdc++-v3/include/profile/map.h b/libstdc++-v3/include/profile/map.h
index aa9e535a1e4..0197d458f5e 100644
--- a/libstdc++-v3/include/profile/map.h
+++ b/libstdc++-v3/include/profile/map.h
@@ -41,7 +41,7 @@ namespace std
{
namespace __profile
{
- /** @brief Map wrapper with performance instrumentation. */
+ /// Class std::map wrapper with performance instrumentation.
template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
class map
diff --git a/libstdc++-v3/include/profile/multimap.h b/libstdc++-v3/include/profile/multimap.h
index b1fc70b63b2..9a65a937f34 100644
--- a/libstdc++-v3/include/profile/multimap.h
+++ b/libstdc++-v3/include/profile/multimap.h
@@ -35,7 +35,7 @@ namespace std
{
namespace __profile
{
- /** @brief Multimap wrapper with performance instrumentation. */
+ /// Class std::multimap wrapper with performance instrumentation.
template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
class multimap
diff --git a/libstdc++-v3/include/profile/multiset.h b/libstdc++-v3/include/profile/multiset.h
index 759761bd52c..69a11f47574 100644
--- a/libstdc++-v3/include/profile/multiset.h
+++ b/libstdc++-v3/include/profile/multiset.h
@@ -35,7 +35,7 @@ namespace std
{
namespace __profile
{
- /** @brief Multiset wrapper with performance instrumentation. */
+ /// Class std::multiset wrapper with performance instrumentation.
template<typename _Key, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<_Key> >
class multiset
diff --git a/libstdc++-v3/include/profile/set.h b/libstdc++-v3/include/profile/set.h
index 50fb16faf37..af249a261c5 100644
--- a/libstdc++-v3/include/profile/set.h
+++ b/libstdc++-v3/include/profile/set.h
@@ -35,7 +35,7 @@ namespace std
{
namespace __profile
{
- /** @brief Set wrapper with performance instrumentation. */
+ /// Class std::set wrapper with performance instrumentation.
template<typename _Key, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<_Key> >
class set
diff --git a/libstdc++-v3/include/profile/unordered_map b/libstdc++-v3/include/profile/unordered_map
index d1cb9217d23..2f563a61b96 100644
--- a/libstdc++-v3/include/profile/unordered_map
+++ b/libstdc++-v3/include/profile/unordered_map
@@ -51,7 +51,7 @@ namespace std
{
namespace __profile
{
- /** @brief Unordered_map wrapper with performance instrumentation. */
+ /// Class std::unordered_map wrapper with performance instrumentation.
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
@@ -275,12 +275,13 @@ namespace __profile
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
+
#undef _GLIBCXX_BASE
#undef _GLIBCXX_STD_BASE
#define _GLIBCXX_BASE unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
#define _GLIBCXX_STD_BASE _GLIBCXX_STD_PR::_GLIBCXX_BASE
- /** @brief Unordered_multimap wrapper with performance instrumentation. */
+ /// Class std::unordered_multimap wrapper with performance instrumentation.
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
@@ -371,7 +372,8 @@ namespace __profile
~unordered_multimap()
{
- __profcxx_hashtable_destruct(this, _Base::bucket_count(), _Base::size());
+ __profcxx_hashtable_destruct(this, _Base::bucket_count(),
+ _Base::size());
_M_profile_destruct();
}
@@ -385,7 +387,8 @@ namespace __profile
void
clear()
{
- __profcxx_hashtable_destruct(this, _Base::bucket_count(), _Base::size());
+ __profcxx_hashtable_destruct(this, _Base::bucket_count(),
+ _Base::size());
_M_profile_destruct();
_Base::clear();
}
diff --git a/libstdc++-v3/include/profile/vector b/libstdc++-v3/include/profile/vector
index e6aeb686a7a..48a4eea4bbe 100644
--- a/libstdc++-v3/include/profile/vector
+++ b/libstdc++-v3/include/profile/vector
@@ -42,7 +42,7 @@ namespace std
{
namespace __profile
{
- /** @brief Vector wrapper with performance instrumentation. */
+ /// Class std::vector wrapper with performance instrumentation.
template<typename _Tp,
typename _Allocator = std::allocator<_Tp> >
class vector
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 8f4f42cebbc..e46a27df12a 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -57,7 +57,6 @@
# include <new>
# include <tuple>
# include <type_traits>
-# include <bits/stringfwd.h>
# include <bits/functional_hash.h>
# include <ext/type_traits.h>
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
diff --git a/libstdc++-v3/include/tr1/functional_hash.h b/libstdc++-v3/include/tr1/functional_hash.h
index 933ded9ac00..d6849300f4c 100644
--- a/libstdc++-v3/include/tr1/functional_hash.h
+++ b/libstdc++-v3/include/tr1/functional_hash.h
@@ -1,6 +1,6 @@
// TR1 functional_hash.h header -*- C++ -*-
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 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
@@ -32,22 +32,154 @@
#pragma GCC system_header
-#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
-# error TR1 header cannot be included from C++0x header
-#endif
+namespace std
+{
+namespace tr1
+{
+ /// Class template hash.
+ // Declaration of default hash functor std::tr1::hash. The types for
+ // which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR.
+ template<typename _Tp>
+ struct hash : public std::unary_function<_Tp, size_t>
+ {
+ size_t
+ operator()(_Tp __val) const;
+ };
+
+ /// Partial specializations for pointer types.
+ template<typename _Tp>
+ struct hash<_Tp*> : public std::unary_function<_Tp*, size_t>
+ {
+ size_t
+ operator()(_Tp* __p) const
+ { return reinterpret_cast<size_t>(__p); }
+ };
+
+ /// Explicit specializations for integer types.
+#define _TR1_hashtable_define_trivial_hash(_Tp) \
+ template<> \
+ inline size_t \
+ hash<_Tp>::operator()(_Tp __val) const \
+ { return static_cast<size_t>(__val); }
+
+ _TR1_hashtable_define_trivial_hash(bool);
+ _TR1_hashtable_define_trivial_hash(char);
+ _TR1_hashtable_define_trivial_hash(signed char);
+ _TR1_hashtable_define_trivial_hash(unsigned char);
+ _TR1_hashtable_define_trivial_hash(wchar_t);
+ _TR1_hashtable_define_trivial_hash(short);
+ _TR1_hashtable_define_trivial_hash(int);
+ _TR1_hashtable_define_trivial_hash(long);
+ _TR1_hashtable_define_trivial_hash(long long);
+ _TR1_hashtable_define_trivial_hash(unsigned short);
+ _TR1_hashtable_define_trivial_hash(unsigned int);
+ _TR1_hashtable_define_trivial_hash(unsigned long);
+ _TR1_hashtable_define_trivial_hash(unsigned long long);
+
+#undef _TR1_hashtable_define_trivial_hash
+
+ // Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
+ // (Used by the next specializations of std::tr1::hash.)
+
+ /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
+ template<size_t = sizeof(size_t)>
+ struct _Fnv_hash
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = 0;
+ for (; __length > 0; --__length)
+ __result = (__result * 131) + *__first++;
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<4>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = static_cast<size_t>(2166136261UL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(16777619UL);
+ }
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<8>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result =
+ static_cast<size_t>(14695981039346656037ULL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(1099511628211ULL);
+ }
+ return __result;
+ }
+ };
+
+ /// Explicit specializations for float.
+ template<>
+ inline size_t
+ hash<float>::operator()(float __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0f)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ };
+
+ /// Explicit specializations for double.
+ template<>
+ inline size_t
+ hash<double>::operator()(double __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ };
+
+ /// Explicit specializations for long double.
+ template<>
+ _GLIBCXX_PURE size_t
+ hash<long double>::operator()(long double __val) const;
+
+ /// Explicit specialization of member operator for non-builtin types.
+ template<>
+ _GLIBCXX_PURE size_t
+ hash<string>::operator()(string) const;
+
+ template<>
+ _GLIBCXX_PURE size_t
+ hash<const string&>::operator()(const string&) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ _GLIBCXX_PURE size_t
+ hash<wstring>::operator()(wstring) const;
-#if defined(_GLIBCXX_INCLUDE_AS_TR1)
-# include <tr1_impl/functional_hash.h>
-#else
-# define _GLIBCXX_INCLUDE_AS_TR1
-# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
-# define _GLIBCXX_END_NAMESPACE_TR1 }
-# define _GLIBCXX_TR1 tr1::
-# include <tr1_impl/functional_hash.h>
-# undef _GLIBCXX_TR1
-# undef _GLIBCXX_END_NAMESPACE_TR1
-# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
-# undef _GLIBCXX_INCLUDE_AS_TR1
+ template<>
+ _GLIBCXX_PURE size_t
+ hash<const wstring&>::operator()(const wstring&) const;
#endif
+}
+}
#endif // _GLIBCXX_TR1_FUNCTIONAL_HASH_H
diff --git a/libstdc++-v3/include/tr1/shared_ptr.h b/libstdc++-v3/include/tr1/shared_ptr.h
index ba2cacae4ed..6176b5e4814 100644
--- a/libstdc++-v3/include/tr1/shared_ptr.h
+++ b/libstdc++-v3/include/tr1/shared_ptr.h
@@ -72,7 +72,13 @@ namespace tr1
virtual void*
_M_get_deleter(const std::type_info& __ti)
- { return __ti == typeid(_Deleter) ? &_M_del : 0; }
+ {
+#ifdef __GXX_RTTI
+ return __ti == typeid(_Deleter) ? &_M_del : 0;
+#else
+ return 0;
+#endif
+ }
private:
_Sp_counted_base_impl(const _Sp_counted_base_impl&);
@@ -595,7 +601,13 @@ namespace tr1
template<typename _Del, typename _Tp, _Lock_policy _Lp>
inline _Del*
get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
- { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
+ {
+#ifdef __GXX_RTTI
+ return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del)));
+#else
+ return 0;
+#endif
+ }
template<typename _Tp, _Lock_policy _Lp>
diff --git a/libstdc++-v3/include/tr1_impl/functional_hash.h b/libstdc++-v3/include/tr1_impl/functional_hash.h
deleted file mode 100644
index 0b963e00f17..00000000000
--- a/libstdc++-v3/include/tr1_impl/functional_hash.h
+++ /dev/null
@@ -1,183 +0,0 @@
-// TR1 functional -*- C++ -*-
-
-// Copyright (C) 2007, 2008, 2009 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library 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.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file tr1_impl/functional_hash.h
- * This is an internal header file, included by other library headers.
- * You should not attempt to use it directly.
- */
-
-namespace std
-{
-_GLIBCXX_BEGIN_NAMESPACE_TR1
-
- /// Class template hash.
- // Declaration of default hash functor std::tr1::hash. The types for
- // which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR.
- template<typename _Tp>
- struct hash : public std::unary_function<_Tp, size_t>
- {
- size_t
- operator()(_Tp __val) const;
- };
-
- /// Partial specializations for pointer types.
- template<typename _Tp>
- struct hash<_Tp*> : public std::unary_function<_Tp*, size_t>
- {
- size_t
- operator()(_Tp* __p) const
- { return reinterpret_cast<size_t>(__p); }
- };
-
- /// Explicit specializations for integer types.
-#define _TR1_hashtable_define_trivial_hash(_Tp) \
- template<> \
- inline size_t \
- hash<_Tp>::operator()(_Tp __val) const \
- { return static_cast<size_t>(__val); }
-
- _TR1_hashtable_define_trivial_hash(bool);
- _TR1_hashtable_define_trivial_hash(char);
- _TR1_hashtable_define_trivial_hash(signed char);
- _TR1_hashtable_define_trivial_hash(unsigned char);
- _TR1_hashtable_define_trivial_hash(wchar_t);
-#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- _TR1_hashtable_define_trivial_hash(char16_t);
- _TR1_hashtable_define_trivial_hash(char32_t);
-#endif
- _TR1_hashtable_define_trivial_hash(short);
- _TR1_hashtable_define_trivial_hash(int);
- _TR1_hashtable_define_trivial_hash(long);
- _TR1_hashtable_define_trivial_hash(long long);
- _TR1_hashtable_define_trivial_hash(unsigned short);
- _TR1_hashtable_define_trivial_hash(unsigned int);
- _TR1_hashtable_define_trivial_hash(unsigned long);
- _TR1_hashtable_define_trivial_hash(unsigned long long);
-
-#undef _TR1_hashtable_define_trivial_hash
-
- // Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
- // (Used by the next specializations of std::tr1::hash.)
-
- /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
- template<size_t = sizeof(size_t)>
- struct _Fnv_hash
- {
- static size_t
- hash(const char* __first, size_t __length)
- {
- size_t __result = 0;
- for (; __length > 0; --__length)
- __result = (__result * 131) + *__first++;
- return __result;
- }
- };
-
- template<>
- struct _Fnv_hash<4>
- {
- static size_t
- hash(const char* __first, size_t __length)
- {
- size_t __result = static_cast<size_t>(2166136261UL);
- for (; __length > 0; --__length)
- {
- __result ^= static_cast<size_t>(*__first++);
- __result *= static_cast<size_t>(16777619UL);
- }
- return __result;
- }
- };
-
- template<>
- struct _Fnv_hash<8>
- {
- static size_t
- hash(const char* __first, size_t __length)
- {
- size_t __result =
- static_cast<size_t>(14695981039346656037ULL);
- for (; __length > 0; --__length)
- {
- __result ^= static_cast<size_t>(*__first++);
- __result *= static_cast<size_t>(1099511628211ULL);
- }
- return __result;
- }
- };
-
- /// Explicit specializations for float.
- template<>
- inline size_t
- hash<float>::operator()(float __val) const
- {
- size_t __result = 0;
-
- // 0 and -0 both hash to zero.
- if (__val != 0.0f)
- __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
- sizeof(__val));
- return __result;
- };
-
- /// Explicit specializations for double.
- template<>
- inline size_t
- hash<double>::operator()(double __val) const
- {
- size_t __result = 0;
-
- // 0 and -0 both hash to zero.
- if (__val != 0.0)
- __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
- sizeof(__val));
- return __result;
- };
-
- /// Explicit specializations for long double.
- template<>
- _GLIBCXX_PURE size_t
- hash<long double>::operator()(long double __val) const;
-
- /// Explicit specialization of member operator for non-builtin types.
- template<>
- _GLIBCXX_PURE size_t
- hash<string>::operator()(string) const;
-
- template<>
- _GLIBCXX_PURE size_t
- hash<const string&>::operator()(const string&) const;
-
-#ifdef _GLIBCXX_USE_WCHAR_T
- template<>
- _GLIBCXX_PURE size_t
- hash<wstring>::operator()(wstring) const;
-
- template<>
- _GLIBCXX_PURE size_t
- hash<const wstring&>::operator()(const wstring&) const;
-#endif
-
-_GLIBCXX_END_NAMESPACE_TR1
-}
diff --git a/libstdc++-v3/libsupc++/cxxabi-forced.h b/libstdc++-v3/libsupc++/cxxabi-forced.h
index e0cf1d05edd..845d8094da0 100644
--- a/libstdc++-v3/libsupc++/cxxabi-forced.h
+++ b/libstdc++-v3/libsupc++/cxxabi-forced.h
@@ -23,6 +23,10 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
+/** @file cxxabi-forced.h
+ * The header provides an interface to the C++ ABI.
+ */
+
#ifndef _CXXABI_FORCED_H
#define _CXXABI_FORCED_H 1
@@ -41,7 +45,9 @@ namespace __cxxabiv1
class __forced_unwind
{
virtual ~__forced_unwind() throw();
- virtual void __pure_dummy() = 0; // prevent catch by value
+
+ // Prevent catch by value.
+ virtual void __pure_dummy() = 0;
};
}
#endif // __cplusplus
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 9513bd52dbf..4306dd5c7c2 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -140,12 +140,12 @@ sources = \
mt_allocator.cc \
codecvt.cc \
compatibility.cc \
+ compatibility-c++0x.cc \
complex_io.cc \
ctype.cc \
debug.cc \
functexcept.cc \
hash_tr1.cc \
- hash_c++0x.cc \
globals_io.cc \
hashtable_tr1.cc \
hashtable_c++0x.cc \
@@ -260,9 +260,9 @@ condition_variable.lo: condition_variable.cc
condition_variable.o: condition_variable.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
-hash_c++0x.lo: hash_c++0x.cc
+compatibility-c++0x.lo: compatibility-c++0x.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
-hash_c++0x.o: hash_c++0x.cc
+compatibility-c++0x.o: compatibility-c++0x.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
hashtable_c++0x.lo: hashtable_c++0x.cc
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 9c03ac4dc78..8cc950f0c17 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -87,8 +87,8 @@ LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
am__DEPENDENCIES_1 =
am__libstdc___la_SOURCES_DIST = atomic.cc bitmap_allocator.cc \
pool_allocator.cc mt_allocator.cc codecvt.cc compatibility.cc \
- complex_io.cc ctype.cc debug.cc functexcept.cc hash_tr1.cc \
- hash_c++0x.cc globals_io.cc hashtable_tr1.cc \
+ compatibility-c++0x.cc complex_io.cc ctype.cc debug.cc \
+ functexcept.cc hash_tr1.cc globals_io.cc hashtable_tr1.cc \
hashtable_c++0x.cc ios.cc ios_failure.cc ios_init.cc \
ios_locale.cc limits.cc limits_c++0x.cc list.cc debug_list.cc \
locale.cc locale_init.cc locale_facets.cc localename.cc \
@@ -113,18 +113,18 @@ am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \
am__objects_4 = basic_file.lo c++locale.lo $(am__objects_2) \
$(am__objects_3)
am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
- mt_allocator.lo codecvt.lo compatibility.lo complex_io.lo \
- ctype.lo debug.lo functexcept.lo hash_tr1.lo hash_c++0x.lo \
- globals_io.lo hashtable_tr1.lo hashtable_c++0x.lo ios.lo \
- ios_failure.lo ios_init.lo ios_locale.lo limits.lo \
- limits_c++0x.lo list.lo debug_list.lo locale.lo locale_init.lo \
- locale_facets.lo localename.lo math_stubs_float.lo \
- math_stubs_long_double.lo stdexcept.lo strstream.lo \
- system_error.lo tree.lo allocator-inst.lo concept-inst.lo \
- fstream-inst.lo ext-inst.lo ios-inst.lo iostream-inst.lo \
- istream-inst.lo istream.lo locale-inst.lo misc-inst.lo \
- ostream-inst.lo sstream-inst.lo streambuf-inst.lo streambuf.lo \
- string-inst.lo valarray-inst.lo wlocale-inst.lo \
+ mt_allocator.lo codecvt.lo compatibility.lo \
+ compatibility-c++0x.lo complex_io.lo ctype.lo debug.lo \
+ functexcept.lo hash_tr1.lo globals_io.lo hashtable_tr1.lo \
+ hashtable_c++0x.lo ios.lo ios_failure.lo ios_init.lo \
+ ios_locale.lo limits.lo limits_c++0x.lo list.lo debug_list.lo \
+ locale.lo locale_init.lo locale_facets.lo localename.lo \
+ math_stubs_float.lo math_stubs_long_double.lo stdexcept.lo \
+ strstream.lo system_error.lo tree.lo allocator-inst.lo \
+ concept-inst.lo fstream-inst.lo ext-inst.lo ios-inst.lo \
+ iostream-inst.lo istream-inst.lo istream.lo locale-inst.lo \
+ misc-inst.lo ostream-inst.lo sstream-inst.lo streambuf-inst.lo \
+ streambuf.lo string-inst.lo valarray-inst.lo wlocale-inst.lo \
wstring-inst.lo mutex.lo condition_variable.lo chrono.lo \
thread.lo future.lo $(am__objects_1) $(am__objects_4)
am_libstdc___la_OBJECTS = $(am__objects_5)
@@ -382,12 +382,12 @@ sources = \
mt_allocator.cc \
codecvt.cc \
compatibility.cc \
+ compatibility-c++0x.cc \
complex_io.cc \
ctype.cc \
debug.cc \
functexcept.cc \
hash_tr1.cc \
- hash_c++0x.cc \
globals_io.cc \
hashtable_tr1.cc \
hashtable_c++0x.cc \
@@ -891,9 +891,9 @@ condition_variable.lo: condition_variable.cc
condition_variable.o: condition_variable.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
-hash_c++0x.lo: hash_c++0x.cc
+compatibility-c++0x.lo: compatibility-c++0x.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
-hash_c++0x.o: hash_c++0x.cc
+compatibility-c++0x.o: compatibility-c++0x.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
hashtable_c++0x.lo: hashtable_c++0x.cc
diff --git a/libstdc++-v3/src/bitmap_allocator.cc b/libstdc++-v3/src/bitmap_allocator.cc
index 686a5ef02d1..55b308de25b 100644
--- a/libstdc++-v3/src/bitmap_allocator.cc
+++ b/libstdc++-v3/src/bitmap_allocator.cc
@@ -76,7 +76,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__ret = reinterpret_cast<size_t*>
(::operator new(__sz + sizeof(size_t)));
}
- __catch(...)
+ __catch(const std::bad_alloc&)
{
this->_M_clear();
}
diff --git a/libstdc++-v3/src/compatibility-c++0x.cc b/libstdc++-v3/src/compatibility-c++0x.cc
new file mode 100644
index 00000000000..df28ecae358
--- /dev/null
+++ b/libstdc++-v3/src/compatibility-c++0x.cc
@@ -0,0 +1,102 @@
+// Compatibility symbols for previous versions, C++0x bits -*- C++ -*-
+
+// Copyright (C) 2009 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <cstddef>
+#include <string>
+#include <cmath>
+#include <system_error>
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# error "compatibility-c++0x.cc must be compiled with -std=gnu++0x"
+#endif
+
+namespace std
+{
+ // We need these due to the symbols exported since GLIBCXX_3.4.10.
+ // See libstdc++/41662 for details.
+
+ template<typename _Tp>
+ struct hash : public std::unary_function<_Tp, size_t>
+ {
+ size_t
+ operator()(_Tp __val) const;
+ };
+
+ /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
+ template<size_t = sizeof(size_t)>
+ struct _Fnv_hash
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = 0;
+ for (; __length > 0; --__length)
+ __result = (__result * 131) + *__first++;
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<4>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = static_cast<size_t>(2166136261UL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(16777619UL);
+ }
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<8>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result =
+ static_cast<size_t>(14695981039346656037ULL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(1099511628211ULL);
+ }
+ return __result;
+ }
+ };
+
+#include "hash.cc"
+
+ template<>
+ size_t
+ hash<error_code>::operator()(error_code __e) const
+ {
+ const char* __p = reinterpret_cast<const char*>(&__e);
+ return _Fnv_hash<>::hash(__p, sizeof(__e));
+ }
+}
diff --git a/libstdc++-v3/src/hash.cc b/libstdc++-v3/src/hash.cc
index c776ed57e1e..cc2385875eb 100644
--- a/libstdc++-v3/src/hash.cc
+++ b/libstdc++-v3/src/hash.cc
@@ -26,7 +26,7 @@
// 10 bytes -> 12 bytes) and resort to frexp.
template<>
size_t
- hash<long double>::operator()(long double __val) const throw ()
+ hash<long double>::operator()(long double __val) const
{
size_t __result = 0;
@@ -59,7 +59,7 @@
template<>
size_t
- hash<const string&>::operator()(const string& __s) const throw ()
+ hash<const string&>::operator()(const string& __s) const
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
#ifdef _GLIBCXX_USE_WCHAR_T
@@ -73,7 +73,7 @@
template<>
size_t
- hash<const wstring&>::operator()(const wstring& __s) const throw ()
+ hash<const wstring&>::operator()(const wstring& __s) const
{
const char* __p = reinterpret_cast<const char*>(__s.data());
return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
diff --git a/libstdc++-v3/src/hash_c++0x.cc b/libstdc++-v3/src/hash_c++0x.cc
deleted file mode 100644
index 5bdbf0c31ee..00000000000
--- a/libstdc++-v3/src/hash_c++0x.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// std::hash definitions -*- C++ -*-
-
-// Copyright (C) 2007, 2009 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library 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.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-// <http://www.gnu.org/licenses/>.
-
-#include <cstddef>
-#include <string>
-#include <cmath>
-#include <functional>
-#include <system_error>
-
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
-# error "hash_c++0x.cc must be compiled with -std=gnu++0x"
-#endif
-
-namespace std
-{
-#include "hash.cc"
-
- template<>
- size_t
- hash<error_code>::operator()(error_code __e) const
- {
- const char* __p = reinterpret_cast<const char*>(&__e);
- return _Fnv_hash<>::hash(__p, sizeof(__e));
- }
-}
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index 25184d04df9..9d2ff8eeb59 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -123,12 +123,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__newsize = __ix + 1;
__try
{ __words = new _Words[__newsize]; }
- __catch(...)
+ __catch(const std::bad_alloc&)
{
_M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
__throw_ios_failure(__N("ios_base::_M_grow_words "
- "allocation failed"));
+ "allocation failed"));
if (__iword)
_M_word_zero._M_iword = 0;
else
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index 98f6020533c..5ee8258ccb8 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -163,7 +163,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__try
{ _M_impl->_M_replace_categories(__add._M_impl, __cat); }
- __catch (...)
+ __catch(...)
{
_M_impl->_M_remove_reference();
__throw_exception_again;
diff --git a/libstdc++-v3/src/pool_allocator.cc b/libstdc++-v3/src/pool_allocator.cc
index ebaa394900b..80f07ba863b 100644
--- a/libstdc++-v3/src/pool_allocator.cc
+++ b/libstdc++-v3/src/pool_allocator.cc
@@ -94,7 +94,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
_S_start_free = static_cast<char*>(::operator new(__bytes_to_get));
}
- __catch (...)
+ __catch(const std::bad_alloc&)
{
// Try to make do with what we have. That can't hurt. We
// do not try smaller requests, since that tends to result
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/misc/42019.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/misc/42019.cc
new file mode 100644
index 00000000000..bea1771d258
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/misc/42019.cc
@@ -0,0 +1,56 @@
+// { dg-options "-std=gnu++0x -fno-rtti" }
+// Copyright (C) 2009 Free Software Foundation
+//
+// 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 20.8.15.2 Template class shared_ptr [util.smartptr.shared]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+// libstdc++/42019
+
+class A {};
+
+struct B {
+ explicit B(int i) : i(i) { }
+ int i;
+};
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::shared_ptr<A> spA = std::make_shared<A>();
+
+ VERIFY( spA.get() != 0 );
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::shared_ptr<B> spB = std::make_shared<B>(99);
+
+ VERIFY( spB->i == 99 );
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/1.h b/libstdc++-v3/testsuite/23_containers/list/modifiers/1.h
index f26fd885485..2d7e45bb1ed 100644
--- a/libstdc++-v3/testsuite/23_containers/list/modifiers/1.h
+++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/1.h
@@ -30,6 +30,9 @@ modifiers1()
typedef _Tp list_type;
typedef typename list_type::iterator iterator;
typedef typename list_type::value_type value_type;
+
+ using __gnu_test::copy_constructor;
+ using __gnu_test::destructor;
list_type list0301;
value_type::reset();
@@ -37,7 +40,7 @@ modifiers1()
// fill insert at beginning of list / empty list
list0301.insert(list0301.begin(), 3, value_type(11)); // should be [11 11 11]
VERIFY(list0301.size() == 3);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
// save iterators to verify post-insert validity
iterator b = list0301.begin();
@@ -48,7 +51,7 @@ modifiers1()
value_type::reset();
list0301.insert(list0301.end(), 3, value_type(13)); // should be [11 11 11 13 13 13]
VERIFY(list0301.size() == 6);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
VERIFY(b == list0301.begin() && b->id() == 11);
VERIFY(e == list0301.end());
VERIFY(m->id() == 11);
@@ -58,7 +61,7 @@ modifiers1()
value_type::reset();
list0301.insert(m, 3, value_type(12)); // should be [11 11 11 12 12 12 13 13 13]
VERIFY(list0301.size() == 9);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
VERIFY(b == list0301.begin() && b->id() == 11);
VERIFY(e == list0301.end());
VERIFY(m->id() == 13);
@@ -67,7 +70,7 @@ modifiers1()
value_type::reset();
m = list0301.erase(m); // should be [11 11 11 12 12 12 13 13]
VERIFY(list0301.size() == 8);
- VERIFY(value_type::dtorCount() == 1);
+ VERIFY(destructor::count() == 1);
VERIFY(b == list0301.begin() && b->id() == 11);
VERIFY(e == list0301.end());
VERIFY(m->id() == 13);
@@ -76,7 +79,7 @@ modifiers1()
value_type::reset();
m = list0301.erase(list0301.begin(), m); // should be [13 13]
VERIFY(list0301.size() == 2);
- VERIFY(value_type::dtorCount() == 6);
+ VERIFY(destructor::count() == 6);
VERIFY(m->id() == 13);
// range fill at beginning
@@ -86,14 +89,14 @@ modifiers1()
b = list0301.begin();
list0301.insert(b, A, A + N); // should be [321 322 333 13 13]
VERIFY(list0301.size() == 5);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
VERIFY(m->id() == 13);
// range fill at end
value_type::reset();
list0301.insert(e, A, A + N); // should be [321 322 333 13 13 321 322 333]
VERIFY(list0301.size() == 8);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
VERIFY(e == list0301.end());
VERIFY(m->id() == 13);
@@ -101,13 +104,13 @@ modifiers1()
value_type::reset();
list0301.insert(m, A, A + N);
VERIFY(list0301.size() == 11);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
VERIFY(e == list0301.end());
VERIFY(m->id() == 13);
value_type::reset();
list0301.clear();
VERIFY(list0301.size() == 0);
- VERIFY(value_type::dtorCount() == 11);
+ VERIFY(destructor::count() == 11);
VERIFY(e == list0301.end());
}
diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/2.h b/libstdc++-v3/testsuite/23_containers/list/modifiers/2.h
index 64a348769e2..e95f797cb51 100644
--- a/libstdc++-v3/testsuite/23_containers/list/modifiers/2.h
+++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/2.h
@@ -30,16 +30,19 @@ modifiers2()
typedef typename list_type::iterator iterator;
typedef typename list_type::const_iterator const_iterator;
+ using __gnu_test::copy_constructor;
+ using __gnu_test::destructor;
+
list_type list0201;
value_type::reset();
list0201.insert(list0201.begin(), value_type(1)); // list should be [1]
VERIFY(list0201.size() == 1);
- VERIFY(value_type::copyCount() == 1);
+ VERIFY(copy_constructor::count() == 1);
list0201.insert(list0201.end(), value_type(2)); // list should be [1 2]
VERIFY(list0201.size() == 2);
- VERIFY(value_type::copyCount() == 2);
+ VERIFY(copy_constructor::count() == 2);
iterator i = list0201.begin();
const_iterator j = i;
@@ -48,7 +51,7 @@ modifiers2()
list0201.insert(i, value_type(3)); // list should be [1 3 2]
VERIFY(list0201.size() == 3);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
const_iterator k = i;
VERIFY(i->id() == 2); --i;
@@ -60,27 +63,27 @@ modifiers2()
value_type::reset();
list0201.erase(i); // should be [1 2]
VERIFY(list0201.size() == 2);
- VERIFY(value_type::dtorCount() == 1);
+ VERIFY(destructor::count() == 1);
VERIFY(k->id() == 2);
VERIFY(j->id() == 1);
list_type list0202;
value_type::reset();
VERIFY(list0202.size() == 0);
- VERIFY(value_type::copyCount() == 0);
- VERIFY(value_type::dtorCount() == 0);
+ VERIFY(copy_constructor::count() == 0);
+ VERIFY(destructor::count() == 0);
// member swap
list0202.swap(list0201);
VERIFY(list0201.size() == 0);
VERIFY(list0202.size() == 2);
- VERIFY(value_type::copyCount() == 0);
- VERIFY(value_type::dtorCount() == 0);
+ VERIFY(copy_constructor::count() == 0);
+ VERIFY(destructor::count() == 0);
// specialized swap
swap(list0201, list0202);
VERIFY(list0201.size() == 2);
VERIFY(list0202.size() == 0);
- VERIFY(value_type::copyCount() == 0);
- VERIFY(value_type::dtorCount() == 0);
+ VERIFY(copy_constructor::count() == 0);
+ VERIFY(destructor::count() == 0);
}
diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/3.h b/libstdc++-v3/testsuite/23_containers/list/modifiers/3.h
index 43e5c58ec60..64602ac4c1b 100644
--- a/libstdc++-v3/testsuite/23_containers/list/modifiers/3.h
+++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/3.h
@@ -51,6 +51,9 @@ modifiers3()
typedef typename list_type::const_iterator const_iterator;
typedef typename list_type::const_reverse_iterator const_reverse_iterator;
+ using __gnu_test::copy_constructor;
+ using __gnu_test::destructor;
+
list_type list0101;
const_iterator i;
const_reverse_iterator j;
@@ -59,7 +62,7 @@ modifiers3()
list0101.push_back(value_type(1)); // list should be [1]
VERIFY(list0101.size() == 1);
- VERIFY(value_type::copyCount() == 1);
+ VERIFY(copy_constructor::count() == 1);
k = list0101.end();
--k;
@@ -69,12 +72,12 @@ modifiers3()
list0101.push_front(value_type(2)); // list should be [2 1]
VERIFY(list0101.size() == 2);
- VERIFY(value_type::copyCount() == 2);
+ VERIFY(copy_constructor::count() == 2);
VERIFY(k->id() == 1);
list0101.push_back(value_type(3)); // list should be [2 1 3]
VERIFY(list0101.size() == 3);
- VERIFY(value_type::copyCount() == 3);
+ VERIFY(copy_constructor::count() == 3);
VERIFY(k->id() == 1);
try
@@ -85,7 +88,7 @@ modifiers3()
catch (...)
{
VERIFY(list0101.size() == 3);
- VERIFY(value_type::copyCount() == 4);
+ VERIFY(copy_constructor::count() == 4);
}
i = list0101.begin();
@@ -106,13 +109,13 @@ modifiers3()
list0101.pop_back(); // list should be [2 1]
VERIFY(list0101.size() == 2);
- VERIFY(value_type::dtorCount() == 1);
+ VERIFY(destructor::count() == 1);
VERIFY(i->id() == 1);
VERIFY(k->id() == 1);
list0101.pop_front(); // list should be [1]
VERIFY(list0101.size() == 1);
- VERIFY(value_type::dtorCount() == 2);
+ VERIFY(destructor::count() == 2);
VERIFY(i->id() == 1);
VERIFY(k->id() == 1);
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc
index f6b5fe37274..851790824e8 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc
@@ -24,5 +24,6 @@
#include <testsuite_hooks.h>
#include <testsuite_api.h>
-typedef __gnu_test::NonDefaultConstructible inst_type;
-template class std::unordered_map<inst_type, inst_type>;
+typedef __gnu_test::NonDefaultConstructible inst_type;
+typedef __gnu_test::NonDefaultConstructible_hash hash_type;
+template class std::unordered_map<inst_type, inst_type, hash_type>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc
index e26428dd698..2eef3715df6 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc
@@ -24,5 +24,6 @@
#include <testsuite_hooks.h>
#include <testsuite_api.h>
-typedef __gnu_test::NonDefaultConstructible inst_type;
-template class std::unordered_multimap<inst_type, inst_type>;
+typedef __gnu_test::NonDefaultConstructible inst_type;
+typedef __gnu_test::NonDefaultConstructible_hash hash_type;
+template class std::unordered_multimap<inst_type, inst_type, hash_type>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc
index d2a120a533e..5764e924e39 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc
@@ -24,4 +24,6 @@
#include <testsuite_hooks.h>
#include <testsuite_api.h>
-template class std::unordered_multiset<__gnu_test::NonDefaultConstructible>;
+typedef __gnu_test::NonDefaultConstructible inst_type;
+typedef __gnu_test::NonDefaultConstructible_hash hash_type;
+template class std::unordered_multiset<inst_type, hash_type>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc
index 13e9e37c3dd..e2276046044 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc
@@ -24,4 +24,6 @@
#include <testsuite_hooks.h>
#include <testsuite_api.h>
-template class std::unordered_set<__gnu_test::NonDefaultConstructible>;
+typedef __gnu_test::NonDefaultConstructible inst_type;
+typedef __gnu_test::NonDefaultConstructible_hash hash_type;
+template class std::unordered_set<inst_type, hash_type>;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc
new file mode 100644
index 00000000000..c52aa8af65e
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc
@@ -0,0 +1,35 @@
+// { dg-options "-fno-rtti" }
+// Copyright (C) 2009 Free Software Foundation
+//
+// 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+
+// libstdc++/42019
+class A {};
+
+void test01()
+{
+ std::tr1::shared_ptr<A> spA;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/util/testsuite_api.h b/libstdc++-v3/testsuite/util/testsuite_api.h
index 772349b8b08..4dc4a6fb7bb 100644
--- a/libstdc++-v3/testsuite/util/testsuite_api.h
+++ b/libstdc++-v3/testsuite/util/testsuite_api.h
@@ -19,6 +19,7 @@
// <http://www.gnu.org/licenses/>.
//
+#include <cstddef>
#include <exception>
#include <testsuite_hooks.h>
@@ -103,6 +104,14 @@ namespace __gnu_test
operator<(const NonDefaultConstructible&, const NonDefaultConstructible&)
{ return false; }
+ // For 23 unordered_* requirements.
+ struct NonDefaultConstructible_hash
+ {
+ size_t
+ operator()(NonDefaultConstructible) const
+ { return 1; }
+ };
+
// For 26 numeric algorithms requirements, need addable,
// subtractable, multiplicable.
inline NonDefaultConstructible
@@ -141,6 +150,6 @@ namespace __gnu_test
operator()() const
{ return result_type(2); }
};
-
}
+
#endif
diff --git a/libstdc++-v3/testsuite/util/testsuite_hooks.h b/libstdc++-v3/testsuite/util/testsuite_hooks.h
index d28a986b853..da51d37ae62 100644
--- a/libstdc++-v3/testsuite/util/testsuite_hooks.h
+++ b/libstdc++-v3/testsuite/util/testsuite_hooks.h
@@ -270,11 +270,6 @@ namespace __gnu_test
int
id() const { return id_; }
- private:
- int id_;
- const bool throw_on_copy_;
-
- public:
static void
reset()
{
@@ -283,17 +278,9 @@ namespace __gnu_test
destructor::reset();
}
- // for backwards-compatibility
- static int
- copyCount()
- { return copy_constructor::count(); }
-
- // for backwards-compatibility
- static int
- dtorCount()
- { return destructor::count(); }
-
private:
+ int id_;
+ const bool throw_on_copy_;
static int next_id_;
};
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index d95cf05d9d0..d6e939419af 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-19 Rafael Avila de Espindola <espindola@google.com>
+
+ PR bootstrap/42096
+ * lto-plugin.c (claim_file_handler): Print offsets in hex.
+
2009-11-12 Rafael Avila de Espindola <espindola@google.com>
* lto-plugin.c (write_resolution): Assume resolution_file is set.
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 8cbafbc46cd..4a8a0ff5b7d 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -551,7 +551,7 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
Elf *archive;
off_t offset;
/* We pass the offset of the actual file, not the archive header. */
- int t = asprintf (&objname, "%s@%" PRId64, file->name,
+ int t = asprintf (&objname, "%s@0x%" PRIx64, file->name,
(int64_t) file->offset);
check (t >= 0, LDPL_FATAL, "asprintf failed");
lto_file.name = objname;