summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 19:37:05 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 19:37:05 +0000
commitb2009e332c150356085f0fb0e35a3a452b10c378 (patch)
treec188ce224e4d028d0ab5f3313b2bc6e749eb88e9
parent323d3e1d50a7a2022e587b786d010c22812a6d5a (diff)
downloadgcc-b2009e332c150356085f0fb0e35a3a452b10c378.tar.gz
2011-07-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 176576 using svnmerge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@176583 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog38
-rw-r--r--ChangeLog.MELT4
-rw-r--r--MAINTAINERS4
-rw-r--r--Makefile.in39
-rw-r--r--Makefile.tpl14
-rw-r--r--config/ChangeLog4
-rw-r--r--config/elf.m44
-rwxr-xr-xconfigure148
-rw-r--r--configure.ac128
-rw-r--r--contrib/ChangeLog7
-rw-r--r--contrib/config-list.mk13
-rw-r--r--gcc/ChangeLog725
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in5
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in4
-rw-r--r--gcc/alias.c88
-rw-r--r--gcc/bb-reorder.c73
-rw-r--r--gcc/builtins.c82
-rw-r--r--gcc/c-family/ChangeLog14
-rw-r--r--gcc/c-family/c-common.c4
-rw-r--r--gcc/c-family/c-common.h24
-rw-r--r--gcc/c-family/c-omp.c2
-rw-r--r--gcc/c-typeck.c5
-rw-r--r--gcc/calls.c4
-rw-r--r--gcc/cfg.c20
-rw-r--r--gcc/cfgcleanup.c32
-rw-r--r--gcc/cfgrtl.c50
-rw-r--r--gcc/cgraphunit.c27
-rw-r--r--gcc/cif-code.def37
-rw-r--r--gcc/config.gcc45
-rw-r--r--gcc/config/alpha/alpha.c9
-rw-r--r--gcc/config/alpha/alpha.h6
-rw-r--r--gcc/config/arm/arm.c15
-rw-r--r--gcc/config/avr/avr-protos.h4
-rw-r--r--gcc/config/avr/avr.c75
-rw-r--r--gcc/config/avr/avr.h2
-rw-r--r--gcc/config/avr/avr.md302
-rwxr-xr-xgcc/config/avr/predicates.md33
-rw-r--r--gcc/config/frv/frv.c28
-rw-r--r--gcc/config/h8300/h8300.c4
-rw-r--r--gcc/config/h8300/h8300.h8
-rw-r--r--gcc/config/i386/constraints.md7
-rw-r--r--gcc/config/i386/i386.c180
-rw-r--r--gcc/config/i386/i386.h16
-rw-r--r--gcc/config/i386/i386.md28
-rw-r--r--gcc/config/i386/netware-libgcc.c58
-rw-r--r--gcc/config/i386/netware-libgcc.def2
-rw-r--r--gcc/config/i386/netware-libgcc.exp83
-rw-r--r--gcc/config/i386/netware.c237
-rw-r--r--gcc/config/i386/netware.h175
-rw-r--r--gcc/config/i386/netware.opt33
-rw-r--r--gcc/config/i386/nwld.c73
-rw-r--r--gcc/config/i386/nwld.h69
-rw-r--r--gcc/config/i386/predicates.md11
-rw-r--r--gcc/config/i386/t-netware10
-rw-r--r--gcc/config/i386/t-nwld22
-rw-r--r--gcc/config/ia64/ia64.c7
-rw-r--r--gcc/config/iq2000/iq2000.h3
-rw-r--r--gcc/config/lm32/lm32.h3
-rw-r--r--gcc/config/m32r/m32r.h5
-rw-r--r--gcc/config/mep/mep.c15
-rw-r--r--gcc/config/mep/mep.h3
-rw-r--r--gcc/config/microblaze/microblaze.h3
-rw-r--r--gcc/config/mips/gnu-user.h140
-rw-r--r--gcc/config/mips/gnu-user64.h60
-rw-r--r--gcc/config/mips/linux.h121
-rw-r--r--gcc/config/mips/linux64.h43
-rw-r--r--gcc/config/mips/mips.c50
-rw-r--r--gcc/config/mn10300/mn10300.h6
-rw-r--r--gcc/config/moxie/moxie.h5
-rw-r--r--gcc/config/pa/pa.c7
-rw-r--r--gcc/config/rs6000/rs6000.c32
-rw-r--r--gcc/config/rs6000/rs6000.md8
-rw-r--r--gcc/config/rs6000/vsx.md188
-rw-r--r--gcc/config/s390/s390-protos.h2
-rw-r--r--gcc/config/s390/s390.c26
-rw-r--r--gcc/config/s390/s390.md6
-rw-r--r--gcc/config/score/score.h5
-rw-r--r--gcc/config/sh/sh.c17
-rw-r--r--gcc/config/sh/sh.md4
-rw-r--r--gcc/config/sparc/sparc.c9
-rw-r--r--gcc/config/spu/spu.c19
-rw-r--r--gcc/config/spu/spu.h3
-rw-r--r--gcc/config/stormy16/stormy16.c6
-rw-r--r--gcc/config/stormy16/stormy16.h3
-rw-r--r--gcc/config/v850/v850.h6
-rw-r--r--gcc/config/vax/vax.h11
-rw-r--r--gcc/config/xtensa/xtensa.c4
-rw-r--r--gcc/config/xtensa/xtensa.h9
-rwxr-xr-xgcc/configure2
-rw-r--r--gcc/configure.ac2
-rw-r--r--gcc/cp/ChangeLog48
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/cp/class.c21
-rw-r--r--gcc/cp/cp-gimplify.c8
-rw-r--r--gcc/cp/decl.c16
-rw-r--r--gcc/cp/except.c6
-rw-r--r--gcc/cp/init.c40
-rw-r--r--gcc/cp/parser.c187
-rw-r--r--gcc/cp/parser.h19
-rw-r--r--gcc/cp/pt.c22
-rw-r--r--gcc/cp/rtti.c7
-rw-r--r--gcc/cp/typeck.c11
-rw-r--r--gcc/cp/typeck2.c4
-rw-r--r--gcc/dce.c12
-rw-r--r--gcc/doc/extend.texi7
-rw-r--r--gcc/doc/install.texi18
-rw-r--r--gcc/doc/invoke.texi10
-rw-r--r--gcc/doc/rtl.texi18
-rw-r--r--gcc/doc/tm.texi17
-rw-r--r--gcc/doc/tm.texi.in17
-rw-r--r--gcc/dse.c11
-rw-r--r--gcc/dwarf2out.c8
-rw-r--r--gcc/emit-rtl.c483
-rw-r--r--gcc/emit-rtl.h10
-rw-r--r--gcc/expr.c91
-rw-r--r--gcc/fold-const.c12
-rw-r--r--gcc/fortran/ChangeLog42
-rw-r--r--gcc/fortran/check.c4
-rw-r--r--gcc/fortran/expr.c67
-rw-r--r--gcc/fortran/gfortran.h1
-rw-r--r--gcc/fortran/interface.c52
-rw-r--r--gcc/fortran/resolve.c2
-rw-r--r--gcc/fortran/trans-array.c7
-rw-r--r--gcc/fortran/trans-decl.c46
-rw-r--r--gcc/fortran/trans-expr.c88
-rw-r--r--gcc/fortran/trans-intrinsic.c5
-rw-r--r--gcc/fortran/trans-types.c17
-rw-r--r--gcc/fortran/trans.c4
-rw-r--r--gcc/fortran/trans.h2
-rw-r--r--gcc/function.c14
-rw-r--r--gcc/genoutput.c10
-rw-r--r--gcc/genrecog.c2
-rw-r--r--gcc/gimple-fold.c14
-rw-r--r--gcc/gimplify.c64
-rw-r--r--gcc/gthr-nks.h397
-rw-r--r--gcc/ipa-cp.c3048
-rw-r--r--gcc/ipa-inline.c2
-rw-r--r--gcc/ipa-prop.c225
-rw-r--r--gcc/ipa-prop.h178
-rw-r--r--gcc/ira-conflicts.c4
-rw-r--r--gcc/ira-costs.c6
-rw-r--r--gcc/ira.c2
-rw-r--r--gcc/ira.h4
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/builtins.c5
-rw-r--r--gcc/java/class.c19
-rw-r--r--gcc/java/except.c2
-rw-r--r--gcc/java/expr.c14
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.c5
-rw-r--r--gcc/omp-low.c39
-rw-r--r--gcc/params.def16
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/de.po1592
-rw-r--r--gcc/po/sv.po108
-rw-r--r--gcc/print-rtl.c10
-rw-r--r--gcc/recog.h2
-rw-r--r--gcc/regcprop.c7
-rw-r--r--gcc/reginfo.c3
-rw-r--r--gcc/reload.c22
-rw-r--r--gcc/rtl.h95
-rw-r--r--gcc/rtlanal.c2
-rw-r--r--gcc/simplify-rtx.c4
-rw-r--r--gcc/system.h6
-rw-r--r--gcc/target.def8
-rw-r--r--gcc/targhooks.c13
-rw-r--r--gcc/targhooks.h1
-rw-r--r--gcc/testsuite/ChangeLog138
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype21.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic114.C27
-rw-r--r--gcc/testsuite/g++.dg/ext/bitfield2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/bitfield3.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/bitfield4.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/bitfield5.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/desig2.C25
-rw-r--r--gcc/testsuite/g++.dg/other/PR23205.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr23205-2.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr49770.C86
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20001109-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20001109-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr49768.c12
-rw-r--r--gcc/testsuite/gcc.dg/20040813-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/binop-xor1.c5
-rw-r--r--gcc/testsuite/gcc.dg/binop-xor3.c5
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-15.c1
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-16.c1
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-17.c1
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-18.c1
-rw-r--r--gcc/testsuite/gcc.dg/builtins-config.h2
-rw-r--r--gcc/testsuite/gcc.dg/cdce1.c3
-rw-r--r--gcc/testsuite/gcc.dg/cdce2.c3
-rw-r--r--gcc/testsuite/gcc.dg/cpp/assert4.c8
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr35154.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-3.c7
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-5.c3
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-7.c4
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-8.c3
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipacost-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipacost-2.c25
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipcp-1.c52
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipcp-2.c99
-rw-r--r--gcc/testsuite/gcc.dg/pr32912-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr44674.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/20110718-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/torture/20110719-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/bool-10.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/bool-11.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr18908.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr30978.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr49038.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr49771.c26
-rw-r--r--gcc/testsuite/gcc.target/arm/combine-movs.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/unsigned-extend-2.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-3.c4
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_error_3.f909
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_args_1.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_args_2.f9050
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_lib_token_1.f9088
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f2
-rw-r--r--gcc/testsuite/gfortran.dg/pr49675.f906
-rw-r--r--gcc/testsuite/lib/target-supports.exp36
-rw-r--r--gcc/tree-affine.c6
-rw-r--r--gcc/tree-cfg.c21
-rw-r--r--gcc/tree-data-ref.c33
-rw-r--r--gcc/tree-loop-distribution.c5
-rw-r--r--gcc/tree-mudflap.c44
-rw-r--r--gcc/tree-predcom.c2
-rw-r--r--gcc/tree-ssa-address.c22
-rw-r--r--gcc/tree-ssa-forwprop.c260
-rw-r--r--gcc/tree-ssa-loop-ivopts.c4
-rw-r--r--gcc/tree-ssa-loop-niter.c17
-rw-r--r--gcc/tree-ssa-loop-prefetch.c6
-rw-r--r--gcc/tree-ssa-operands.c4
-rw-r--r--gcc/tree-ssa-phiopt.c8
-rw-r--r--gcc/tree-ssa-pre.c9
-rw-r--r--gcc/tree-ssa-propagate.c28
-rw-r--r--gcc/tree-ssa-sccvn.c61
-rw-r--r--gcc/tree-ssa-structalias.c30
-rw-r--r--gcc/tree-ssa-uninit.c16
-rw-r--r--gcc/tree-ssa.c8
-rw-r--r--gcc/tree-vect-data-refs.c7
-rw-r--r--gcc/tree-vect-loop-manip.c21
-rw-r--r--gcc/tree-vrp.c7
-rw-r--r--gcc/tree.c29
-rw-r--r--gcc/tree.h19
-rw-r--r--gcc/var-tracking.c6
-rw-r--r--gcc/varasm.c2
-rw-r--r--libgcc/ChangeLog6
-rw-r--r--libgcc/config.host8
-rw-r--r--libgcc/config/i386/netware-crt0.c79
-rw-r--r--libgcc/config/i386/t-nwld39
-rw-r--r--libgcc/config/i386/t-slibgcc-nwld31
-rw-r--r--libgomp/ChangeLog6
-rw-r--r--libgomp/testsuite/lib/libgomp.exp1
-rw-r--r--libstdc++-v3/ChangeLog122
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver8
-rwxr-xr-xlibstdc++-v3/configure149
-rw-r--r--libstdc++-v3/crossconfig.m48
-rw-r--r--libstdc++-v3/include/Makefile.am5
-rw-r--r--libstdc++-v3/include/Makefile.in5
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h2
-rw-r--r--libstdc++-v3/include/bits/unique_ptr.h2
-rw-r--r--libstdc++-v3/include/debug/formatter.h45
-rw-r--r--libstdc++-v3/include/debug/functions.h9
-rw-r--r--libstdc++-v3/include/debug/safe_iterator.h71
-rw-r--r--libstdc++-v3/include/debug/safe_iterator.tcc8
-rw-r--r--libstdc++-v3/include/debug/safe_local_iterator.h369
-rw-r--r--libstdc++-v3/include/debug/safe_local_iterator.tcc75
-rw-r--r--libstdc++-v3/include/debug/safe_unordered_base.h175
-rw-r--r--libstdc++-v3/include/debug/safe_unordered_sequence.h75
-rw-r--r--libstdc++-v3/include/debug/safe_unordered_sequence.tcc100
-rw-r--r--libstdc++-v3/include/debug/unordered_map300
-rw-r--r--libstdc++-v3/include/debug/unordered_set274
-rw-r--r--libstdc++-v3/include/precompiled/stdc++.h3
-rw-r--r--libstdc++-v3/include/std/array16
-rw-r--r--libstdc++-v3/include/std/bitset15
-rw-r--r--libstdc++-v3/include/std/chrono36
-rw-r--r--libstdc++-v3/include/std/mutex4
-rw-r--r--libstdc++-v3/include/std/system_error104
-rw-r--r--libstdc++-v3/src/chrono.cc8
-rw-r--r--libstdc++-v3/src/compatibility-c++0x.cc15
-rw-r--r--libstdc++-v3/src/debug.cc229
-rw-r--r--libstdc++-v3/src/system_error.cc23
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc4
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_code/modifiers/39882.cc4
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/39881.cc4
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/modifiers/39881.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/steady_clock/constexpr_data.cc (renamed from libstdc++-v3/testsuite/20_util/monotonic_clock/constexpr_data.cc)4
-rw-r--r--libstdc++-v3/testsuite/20_util/system_clock/1.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/system_clock/constexpr_data.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/time_point/1.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc45
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc31
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_compare_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_range_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_erased_local_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_local_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_compare_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_range_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_erased_local_iterator_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_iterator_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_local_iterator_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_compare_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_range_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_erased_local_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_local_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_compare_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_range_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_erased_local_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_local_iterator_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc6
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc6
-rw-r--r--libstdc++-v3/testsuite/util/debug/checks.h44
-rw-r--r--libstdc++-v3/testsuite/util/debug/unordered_checks.h190
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_error.h10
329 files changed, 10366 insertions, 6127 deletions
diff --git a/ChangeLog b/ChangeLog
index 700dca9f95b..6a27fb72e70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,43 @@
-2011-07-18 Richard Guenther <rguenther@suse.de>
+2011-07-21 Joseph Myers <joseph@codesourcery.com>
+
+ * MAINTAINERS (Global Reviewers): Add self.
+
+2011-07-20 David Edelsohn <dje.gcc@gmail.com>
+
+ * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): Add libsupc++ to
+ link directories.
+ * Makefile.in: Rebuild.
+
+2011-07-20 Ian Lance Taylor <iant@google.com>
+
+ PR bootstrap/49787
+ * configure.ac: Move --enable-bootstrap handling earlier in file.
+ If --enable-bootstrap and either --enable-build-with-cxx or
+ --enable-build-poststage1-with-cxx, enable C++ automatically.
+ * configure: Rebuild.
+
+2011-07-19 Ian Lance Taylor <iant@google.com>
+
+ * configure.ac: Add --enable-build-poststage1-with-cxx. If set,
+ make C++ a boot_language. Set and substitute
+ POSTSTAGE1_CONFIGURE_FLAGS.
+ * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable.
+ (STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS).
+ * configure, Makefile.in: Rebuild.
+
+2011-07-19 Vladimir Makarov <vmakarov@redhat.com>
+
+ * MAINTAINERS (Register Allocation): Move myself from reviewers to
+ maintainers.
+
+2011-07-18 Jakub Jelinek <jakub@redhat.com>
* MAINTAINERS (Global Reviewers): Add myself.
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure: Regenerate.
+
2011-07-16 Jason Merrill <jason@redhat.com>
* Makefile.def (language=c++): Add check-c++0x and
diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index 1a755ec13d7..6767c495d08 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,6 +1,10 @@
2011-07-21 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk rev 176576 using svnmerge.
+
+2011-07-21 Basile Starynkevitch <basile@starynkevitch.net>
+
* INSTALL/README-MELT-PLUGIN: Mention contrib/gcc_update before
contrib/make-melt-source-tar.sh
diff --git a/MAINTAINERS b/MAINTAINERS
index 244e3589e69..3c7e8a9df0c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -23,6 +23,7 @@ Maintainers
Richard Earnshaw richard.earnshaw@arm.com
Richard Guenther rguenther@suse.de
Richard Henderson rth@redhat.com
+Jakub Jelinek jakub@redhat.com
Geoffrey Keating geoffk@geoffk.org
Richard Kenner kenner@nyu.edu
Jeff Law law@redhat.com
@@ -30,6 +31,7 @@ Michael Meissner gnu@the-meissners.org
Jason Merrill jason@redhat.com
David S. Miller davem@redhat.com
Mark Mitchell mark@codesourcery.com
+Joseph Myers joseph@codesourcery.com
Diego Novillo dnovillo@google.com
Bernd Schmidt bernds@codesourcery.com
Ian Lance Taylor ian@airs.com
@@ -241,6 +243,7 @@ loop infrastructure Zdenek Dvorak ook@ucw.cz
OpenMP Jakub Jelinek jakub@redhat.com
testsuite Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
testsuite Mike Stump mikestump@comcast.net
+register allocation Vladimir Makarov vmakarov@redhat.com
Note that individuals who maintain parts of the compiler need approval to
check in changes outside of the parts of the compiler they maintain.
@@ -282,7 +285,6 @@ loop optimizer Zdenek Dvorak ook@ucw.cz
Plugin Diego Novillo dnovillo@google.com
Plugin Le-Chun Wu lcwu@google.com
register allocation Peter Bergner bergner@vnet.ibm.com
-register allocation Vladimir Makarov vmakarov@redhat.com
register allocation Kenneth Zadeck zadeck@naturalbridge.com
register allocation Seongbae Park seongbae.park@gmail.com
LTO Diego Novillo dnovillo@google.com
diff --git a/Makefile.in b/Makefile.in
index 3b8e6c74859..d1206bda659 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -237,10 +237,13 @@ POSTSTAGE1_CXX_EXPORT = \
CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
-B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-I$$s/libstdc++-v3/libsupc++ \
- -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \
+ -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
+ export CXX; \
CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD;
@endif target-libstdc++-v3-bootstrap
@@ -415,6 +418,7 @@ TFLAGS =
STAGE_CFLAGS = $(BOOT_CFLAGS)
STAGE_TFLAGS = $(TFLAGS)
STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
+POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@
# Defaults for stage 1; some are overridden below.
@@ -425,7 +429,10 @@ STAGE1_CXXFLAGS = $(CXXFLAGS)
STAGE1_CXXFLAGS = $(STAGE1_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGE1_TFLAGS = $(STAGE_TFLAGS)
-STAGE1_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE1_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
# Defaults for stage 2; some are overridden below.
STAGE2_CFLAGS = $(STAGE_CFLAGS)
@@ -435,7 +442,10 @@ STAGE2_CXXFLAGS = $(CXXFLAGS)
STAGE2_CXXFLAGS = $(STAGE2_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGE2_TFLAGS = $(STAGE_TFLAGS)
-STAGE2_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE2_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
# Defaults for stage 3; some are overridden below.
STAGE3_CFLAGS = $(STAGE_CFLAGS)
@@ -445,7 +455,10 @@ STAGE3_CXXFLAGS = $(CXXFLAGS)
STAGE3_CXXFLAGS = $(STAGE3_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGE3_TFLAGS = $(STAGE_TFLAGS)
-STAGE3_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE3_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
# Defaults for stage 4; some are overridden below.
STAGE4_CFLAGS = $(STAGE_CFLAGS)
@@ -455,7 +468,10 @@ STAGE4_CXXFLAGS = $(CXXFLAGS)
STAGE4_CXXFLAGS = $(STAGE4_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGE4_TFLAGS = $(STAGE_TFLAGS)
-STAGE4_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE4_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
# Defaults for stage profile; some are overridden below.
STAGEprofile_CFLAGS = $(STAGE_CFLAGS)
@@ -465,7 +481,10 @@ STAGEprofile_CXXFLAGS = $(CXXFLAGS)
STAGEprofile_CXXFLAGS = $(STAGEprofile_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGEprofile_TFLAGS = $(STAGE_TFLAGS)
-STAGEprofile_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGEprofile_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
# Defaults for stage feedback; some are overridden below.
STAGEfeedback_CFLAGS = $(STAGE_CFLAGS)
@@ -475,7 +494,10 @@ STAGEfeedback_CXXFLAGS = $(CXXFLAGS)
STAGEfeedback_CXXFLAGS = $(STAGEfeedback_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGEfeedback_TFLAGS = $(STAGE_TFLAGS)
-STAGEfeedback_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGEfeedback_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
# Only build the C compiler for stage1, because that is the only one that
@@ -493,6 +515,9 @@ STAGE1_LANGUAGES = @stage1_languages@
# the last argument when conflicting --enable arguments are passed.
# * Likewise, we force-disable coverage flags, since the installed
# compiler probably has never heard of them.
+# * Don't remove this, because above we added
+# POSTSTAGE1_CONFIGURE_FLAGS to STAGE_CONFIGURE_FLAGS, which
+# we don't want for STAGE1_CONFIGURE_FLAGS.
STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
diff --git a/Makefile.tpl b/Makefile.tpl
index 0d2a0bfff2d..4dd23915bed 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -240,10 +240,13 @@ POSTSTAGE1_CXX_EXPORT = \
CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
-B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-I$$s/libstdc++-v3/libsupc++ \
- -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \
+ -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
+ export CXX; \
CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD;
@endif target-libstdc++-v3-bootstrap
@@ -418,6 +421,7 @@ TFLAGS =
STAGE_CFLAGS = $(BOOT_CFLAGS)
STAGE_TFLAGS = $(TFLAGS)
STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
+POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@
[+ FOR bootstrap-stage +]
# Defaults for stage [+id+]; some are overridden below.
@@ -428,7 +432,10 @@ STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS)
@endif target-libstdc++-v3-bootstrap
STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
-STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE[+id+]_CONFIGURE_FLAGS = \
+ $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
[+ ENDFOR bootstrap-stage +]
# Only build the C compiler for stage1, because that is the only one that
@@ -446,6 +453,9 @@ STAGE1_LANGUAGES = @stage1_languages@
# the last argument when conflicting --enable arguments are passed.
# * Likewise, we force-disable coverage flags, since the installed
# compiler probably has never heard of them.
+# * Don't remove this, because above we added
+# POSTSTAGE1_CONFIGURE_FLAGS to STAGE[+id+]_CONFIGURE_FLAGS, which
+# we don't want for STAGE1_CONFIGURE_FLAGS.
STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
diff --git a/config/ChangeLog b/config/ChangeLog
index f25c43a17b6..90f5238ecbe 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * elf.m4 (target_elf): Remove *-netware*.
+
2011-07-06 Uros Bizjak <ubizjak@gmail.com>
* mt-alphaieee (GOCFLAGS_FOR_TARGET): Add -mieee.
diff --git a/config/elf.m4 b/config/elf.m4
index 007006eaea2..da051cbe61c 100644
--- a/config/elf.m4
+++ b/config/elf.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010, 2011 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
@@ -14,7 +14,7 @@ AC_REQUIRE([AC_CANONICAL_TARGET])
target_elf=no
case $target in
*-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \
- *-msdosdjgpp* | *-netware* | *-vms* | *-wince* | *-*-pe* | \
+ *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \
alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux*)
target_elf=no
;;
diff --git a/configure b/configure
index b0ce8f1ed91..6f512234882 100755
--- a/configure
+++ b/configure
@@ -556,6 +556,7 @@ enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
compare_exclusions
+POSTSTAGE1_CONFIGURE_FLAGS
stage2_werror_flag
stage1_checking
stage1_cflags
@@ -748,7 +749,9 @@ enable_libquadmath_support
enable_libada
enable_libssp
enable_static_libjava
+enable_bootstrap
enable_build_with_cxx
+enable_build_poststage1_with_cxx
with_mpc
with_mpc_include
with_mpc_lib
@@ -779,7 +782,6 @@ enable_stage1_languages
enable_objc_gc
with_build_sysroot
with_debug_prefix_map
-enable_bootstrap
with_build_config
enable_serial_configure
with_build_time_tools
@@ -1464,7 +1466,10 @@ Optional Features:
--enable-libssp build libssp directory
--enable-static-libjava[=ARG]
build static libjava [default=no]
+ --enable-bootstrap enable bootstrapping [yes if native build]
--enable-build-with-cxx build with C++ compiler instead of C compiler
+ --enable-build-poststage1-with-cxx
+ build stages 2 and 3 with C++, not C
--disable-ppl-version-check
disable check for PPL version
--enable-cloog-backend[=BACKEND]
@@ -1478,7 +1483,6 @@ Optional Features:
Mostly useful for compiler development
--enable-objc-gc enable use of Boehm's garbage collector with the GNU
Objective-C runtime
- --enable-bootstrap enable bootstrapping [yes if native build]
--enable-serial-[{host,target,build}-]configure
force sequential configuration of sub-packages for
the host, target or build machine, or all
@@ -4979,6 +4983,52 @@ do_compare="$gcc_cv_prog_cmp_skip"
+# Check whether --enable-bootstrap was given.
+if test "${enable_bootstrap+set}" = set; then :
+ enableval=$enable_bootstrap;
+else
+ enable_bootstrap=default
+fi
+
+
+# Issue errors and warnings for invalid/strange bootstrap combinations.
+case "$configdirs" in
+ *gcc*) have_compiler=yes ;;
+ *) have_compiler=no ;;
+esac
+
+case "$have_compiler:$host:$target:$enable_bootstrap" in
+ *:*:*:no) ;;
+
+ # Default behavior. Enable bootstrap if we have a compiler
+ # and we are in a native configuration.
+ yes:$build:$build:default)
+ enable_bootstrap=yes ;;
+
+ *:*:*:default)
+ enable_bootstrap=no ;;
+
+ # We have a compiler and we are in a native configuration, bootstrap is ok
+ yes:$build:$build:yes)
+ ;;
+
+ # Other configurations, but we have a compiler. Assume the user knows
+ # what he's doing.
+ yes:*:*:yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: trying to bootstrap a cross compiler" >&5
+$as_echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;}
+ ;;
+
+ # No compiler: if they passed --enable-bootstrap explicitly, fail
+ no:*:*:yes)
+ as_fn_error "cannot bootstrap without a compiler" "$LINENO" 5 ;;
+
+ # Fail if wrong command line
+ *)
+ as_fn_error "invalid option for --enable-bootstrap" "$LINENO" 5
+ ;;
+esac
+
# See if we are building gcc with C++.
# Check whether --enable-build-with-cxx was given.
if test "${enable_build_with_cxx+set}" = set; then :
@@ -4988,6 +5038,15 @@ else
fi
+# Build stage1 with C and build stages 2 and 3 with C++.
+# Check whether --enable-build-poststage1-with-cxx was given.
+if test "${enable_build_poststage1_with_cxx+set}" = set; then :
+ enableval=$enable_build_poststage1_with_cxx; ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval
+else
+ ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes
+fi
+
+
# Used for setting $lt_cv_objdir
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
$as_echo_n "checking for objdir... " >&6; }
@@ -6010,7 +6069,7 @@ fi
target_elf=no
case $target in
*-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \
- *-msdosdjgpp* | *-netware* | *-vms* | *-wince* | *-*-pe* | \
+ *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \
alpha*-dec-osf* | *-interix* | hppa[12]*-*-hpux*)
target_elf=no
;;
@@ -6093,6 +6152,19 @@ if test -d ${srcdir}/gcc; then
;;
esac
+ # If bootstrapping, then using --enable-build-with-cxx or
+ # --enable-build-poststage1-with-cxx requires enabling C++.
+ case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
+ *,c++,*:*:*) ;;
+ *:*,yes,*:yes)
+ if test -f ${srcdir}/gcc/cp/config-lang.in; then
+ enable_languages="${enable_languages},c++"
+ else
+ as_fn_error "bootstrapping with --enable-build-with-cxx or --enable-build-poststage1-with-cxx requires c++ sources" "$LINENO" 5
+ fi
+ ;;
+ esac
+
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
@@ -6182,9 +6254,11 @@ if test -d ${srcdir}/gcc; then
exit 1
fi
- if test "$language" = "c++" \
- && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
- boot_language=yes
+ if test "$language" = "c++"; then
+ if test "$ENABLE_BUILD_WITH_CXX" = "yes" \
+ || test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+ boot_language=yes
+ fi
fi
case ,${enable_languages}, in
@@ -6892,59 +6966,6 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
# 99 commands in a script, for HP-UX sed.
# Do not nest @if/@endif pairs, because configure will not warn you at all.
-# Check whether --enable-bootstrap was given.
-if test "${enable_bootstrap+set}" = set; then :
- enableval=$enable_bootstrap;
-else
- enable_bootstrap=default
-fi
-
-
-# Issue errors and warnings for invalid/strange bootstrap combinations.
-case "$configdirs" in
- *gcc*) have_compiler=yes ;;
- *) have_compiler=no ;;
-esac
-
-case "$have_compiler:$host:$target:$enable_bootstrap" in
- *:*:*:no) ;;
-
- # Default behavior. Enable bootstrap if we have a compiler
- # and we are in a native configuration.
- yes:$build:$build:default)
- enable_bootstrap=yes ;;
-
- *:*:*:default)
- enable_bootstrap=no ;;
-
- # We have a compiler and we are in a native configuration, bootstrap is ok
- yes:$build:$build:yes)
- ;;
-
- # Other configurations, but we have a compiler. Assume the user knows
- # what he's doing.
- yes:*:*:yes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: trying to bootstrap a cross compiler" >&5
-$as_echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;}
- ;;
-
- # No compiler: if they passed --enable-bootstrap explicitly, fail
- no:*:*:yes)
- as_fn_error "cannot bootstrap without a compiler" "$LINENO" 5 ;;
-
- # Fail if wrong command line
- *)
- as_fn_error "invalid option for --enable-bootstrap" "$LINENO" 5
- ;;
-esac
-
-case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
- *,c++,*:yes:yes) ;;
- *:yes:yes)
- as_fn_error "bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages" "$LINENO" 5
- ;;
-esac
-
case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
yes:yes:*\ gold\ *:*,c++,*) ;;
yes:yes:*\ gold\ *:*)
@@ -13991,6 +14012,15 @@ case ${enable_werror} in
esac
+# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass
+# --enable-build-with-cxx after stage1.
+if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+ POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx
+else
+ POSTSTAGE1_CONFIGURE_FLAGS=
+fi
+
+
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
diff --git a/configure.ac b/configure.ac
index 93d95c3a87e..afead23ee67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1133,6 +1133,48 @@ fi
ACX_PROG_GNAT
ACX_PROG_CMP_IGNORE_INITIAL
+AC_ARG_ENABLE([bootstrap],
+[AS_HELP_STRING([--enable-bootstrap],
+ [enable bootstrapping @<:@yes if native build@:>@])],,
+enable_bootstrap=default)
+
+# Issue errors and warnings for invalid/strange bootstrap combinations.
+case "$configdirs" in
+ *gcc*) have_compiler=yes ;;
+ *) have_compiler=no ;;
+esac
+
+case "$have_compiler:$host:$target:$enable_bootstrap" in
+ *:*:*:no) ;;
+
+ # Default behavior. Enable bootstrap if we have a compiler
+ # and we are in a native configuration.
+ yes:$build:$build:default)
+ enable_bootstrap=yes ;;
+
+ *:*:*:default)
+ enable_bootstrap=no ;;
+
+ # We have a compiler and we are in a native configuration, bootstrap is ok
+ yes:$build:$build:yes)
+ ;;
+
+ # Other configurations, but we have a compiler. Assume the user knows
+ # what he's doing.
+ yes:*:*:yes)
+ AC_MSG_WARN([trying to bootstrap a cross compiler])
+ ;;
+
+ # No compiler: if they passed --enable-bootstrap explicitly, fail
+ no:*:*:yes)
+ AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
+
+ # Fail if wrong command line
+ *)
+ AC_MSG_ERROR([invalid option for --enable-bootstrap])
+ ;;
+esac
+
# See if we are building gcc with C++.
AC_ARG_ENABLE(build-with-cxx,
[AS_HELP_STRING([--enable-build-with-cxx],
@@ -1140,6 +1182,13 @@ AC_ARG_ENABLE(build-with-cxx,
ENABLE_BUILD_WITH_CXX=$enableval,
ENABLE_BUILD_WITH_CXX=no)
+# Build stage1 with C and build stages 2 and 3 with C++.
+AC_ARG_ENABLE(build-poststage1-with-cxx,
+[AS_HELP_STRING([--enable-build-poststage1-with-cxx],
+ [build stages 2 and 3 with C++, not C])],
+ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval,
+ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes)
+
# Used for setting $lt_cv_objdir
_LT_CHECK_OBJDIR
@@ -1622,6 +1671,19 @@ if test -d ${srcdir}/gcc; then
;;
esac
+ # If bootstrapping, then using --enable-build-with-cxx or
+ # --enable-build-poststage1-with-cxx requires enabling C++.
+ case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
+ *,c++,*:*:*) ;;
+ *:*,yes,*:yes)
+ if test -f ${srcdir}/gcc/cp/config-lang.in; then
+ enable_languages="${enable_languages},c++"
+ else
+ AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx or --enable-build-poststage1-with-cxx requires c++ sources])
+ fi
+ ;;
+ esac
+
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
@@ -1711,9 +1773,11 @@ if test -d ${srcdir}/gcc; then
exit 1
fi
- if test "$language" = "c++" \
- && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
- boot_language=yes
+ if test "$language" = "c++"; then
+ if test "$ENABLE_BUILD_WITH_CXX" = "yes" \
+ || test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+ boot_language=yes
+ fi
fi
case ,${enable_languages}, in
@@ -2370,55 +2434,6 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
# 99 commands in a script, for HP-UX sed.
# Do not nest @if/@endif pairs, because configure will not warn you at all.
-AC_ARG_ENABLE([bootstrap],
-[AS_HELP_STRING([--enable-bootstrap],
- [enable bootstrapping @<:@yes if native build@:>@])],,
-enable_bootstrap=default)
-
-# Issue errors and warnings for invalid/strange bootstrap combinations.
-case "$configdirs" in
- *gcc*) have_compiler=yes ;;
- *) have_compiler=no ;;
-esac
-
-case "$have_compiler:$host:$target:$enable_bootstrap" in
- *:*:*:no) ;;
-
- # Default behavior. Enable bootstrap if we have a compiler
- # and we are in a native configuration.
- yes:$build:$build:default)
- enable_bootstrap=yes ;;
-
- *:*:*:default)
- enable_bootstrap=no ;;
-
- # We have a compiler and we are in a native configuration, bootstrap is ok
- yes:$build:$build:yes)
- ;;
-
- # Other configurations, but we have a compiler. Assume the user knows
- # what he's doing.
- yes:*:*:yes)
- AC_MSG_WARN([trying to bootstrap a cross compiler])
- ;;
-
- # No compiler: if they passed --enable-bootstrap explicitly, fail
- no:*:*:yes)
- AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
-
- # Fail if wrong command line
- *)
- AC_MSG_ERROR([invalid option for --enable-bootstrap])
- ;;
-esac
-
-case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
- *,c++,*:yes:yes) ;;
- *:yes:yes)
- AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages])
- ;;
-esac
-
case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
yes:yes:*\ gold\ *:*,c++,*) ;;
yes:yes:*\ gold\ *:*)
@@ -3203,6 +3218,15 @@ case ${enable_werror} in
esac
AC_SUBST(stage2_werror_flag)
+# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass
+# --enable-build-with-cxx after stage1.
+if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+ POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx
+else
+ POSTSTAGE1_CONFIGURE_FLAGS=
+fi
+AC_SUBST(POSTSTAGE1_CONFIGURE_FLAGS)
+
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index a69f810f022..e68679dd1ac 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config-list.mk (i586-netware): Remove.
+ (.PHONY): Remove make-script-dir dependency.
+ (make-script-dir): Remove.
+ ($(LIST)): Remove make-script-dir dependency.
+
2011-07-15 Bernd Schmidt <bernds@codesourcery.com>
* gcc_update: Add C6X generated files.
diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index b421ccca25f..23b37160136 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -27,7 +27,7 @@ LIST = alpha-linux-gnu alpha-freebsd6 alpha-netbsd alpha-openbsd \
i486-freebsd4 i686-freebsd6 i686-kfreebsd-gnu \
i686-netbsdelf9 i686-knetbsd-gnu i686-openbsd i686-openbsd3.0 \
i686-elf i686-kopensolaris-gnu i686-symbolics-gnu i686-pc-msdosdjgpp \
- i686-lynxos i586-netwareOPT-with-ld=SCRIPTSnwld i686-nto-qnx \
+ i686-lynxos i686-nto-qnx \
i686-rtems i686-solaris2.10 i686-wrs-vxworks \
i686-wrs-vxworksae \
i686-cygwinOPT-enable-threads=yes i686-mingw32crt ia64-elf \
@@ -72,7 +72,7 @@ LOGFILES = $(patsubst %,log/%-make.out,$(LIST))
all: $(LOGFILES)
config: $(LIST)
-.PHONY: make-log-dir make-script-dir all config
+.PHONY: make-log-dir all config
empty=
@@ -81,14 +81,7 @@ empty=
make-log-dir: ../gcc/MAINTAINERS
mkdir log
-# The 'ix86-netware --with-ld=nwld' configuration needs a nwld executable to
-# configure. See PR47104.
-make-script-dir:
- mkdir scripts
- echo ld $* > scripts/nwld
- chmod u+x scripts/nwld
-
-$(LIST): make-log-dir make-script-dir
+$(LIST): make-log-dir
-mkdir $@
(cd $@ && \
../../gcc/configure \
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c7a7c89f569..b9d95fa5b6e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,710 @@
+2011-07-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.
+
+2011-07-21 Jason Merrill <jason@redhat.com>
+
+ * system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New.
+ * recog.h (struct insn_data_d): Check it instead of
+ HAVE_DESIGNATED_INITIALIZERS.
+ * genoutput.c (output_insn_data): Likewise.
+
+2011-07-21 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49770
+ * tree-ssa-sccvn.c (valueize_refs_1): Return whether we
+ valueized any operand. Renamed from ...
+ (valueize_refs): ... this. New wrapper around valueize_refs_1.
+ (valueize_shared_reference_ops_from_ref): Return whether we
+ valueized any operand.
+ (vn_reference_lookup): Only when we valueized any operand
+ use the valueized reference for alias analysis. Do not preserve
+ the original reference tree in this case.
+
+2011-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_decompose_address): Reject all but
+ register operands and subregs of DImode hard registers in index.
+
+2011-07-21 Kai Tietz <ktietz@redhat.com>
+
+ * fold-const.c (fold_unary_loc): Preserve indirect
+ comparison cast to none-boolean type.
+ * tree-ssa.c (useless_type_conversion_p): Preserve cast
+ from/to boolean-type.
+ * gimplify.c (gimple_boolify): Handle boolification of comparisons.
+ (gimplify_expr): Boolifiy non aggregate-typed comparisons.
+ * tree-cfg.c (verify_gimple_comparison): Check result
+ type of comparison expression.
+ * tree-ssa-forwprop.c (forward_propagate_comparison): Adjust test
+ of condition result and disallow type-cast sinking into comparison.
+
+2011-07-21 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-forwprop.c (combine_conversions): Return whether
+ we have to run cfg-cleanup. Properly remove dead stmts.
+ (ssa_forward_propagate_and_combine): Adjust.
+
+2011-07-21 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * regcprop.c (maybe_mode_change): Check HARD_REGNO_MODE_OK.
+
+2011-07-21 Kai Tietz <ktietz@redhat.com>
+
+ * tree-ssa-propagate.c (substitute_and_fold): Use
+ do_dce flag to deside, if BB's statements are scanned
+ in last to first, or first to last order.
+
+2011-07-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.c (avr_rtx_costs): Set cost of CONST, LABEL_REF to 0.
+
+2011-07-20 H.J. Lu <hongjiu.lu@intel.com>
+ Uros Bizjak <ubizjak@gmail.com>
+ Richard Henderson <rth@redhat.com>
+
+ * config/i386/constraints.md (w): New.
+
+ * config/i386/i386.c (ix86_output_addr_vec_elt): Check
+ TARGET_LP64 instead of TARGET_64BIT for ASM_QUAD.
+
+ * config/i386/i386.h (CASE_VECTOR_MODE): Check TARGET_LP64
+ instead of TARGET_64BIT.
+
+ * config/i386/i386.md (indirect_jump): Replace
+ nonimmediate_operand with indirect_branch_operand.
+ (*indirect_jump): Likewise. Replace constraint "m" with "w".
+ (tablejump): Replace nonimmediate_operand with indirect_branch_operand.
+ Convert operand 0 to Pmode for x32 if not PIC.
+ (*tablejump_1): Replace nonimmediate_operand with
+ indirect_branch_operand. Replace constraint "m" with "w".
+ (*call_vzeroupper): Replace constraint "m" with "w".
+ (*call): Likewise.
+ (*call_rex64_ms_sysv_vzeroupper): Likewise.
+ (*call_rex64_ms_sysv): Likewise.
+ (*call_value_vzeroupper): Likewise.
+ (*call_value): Likewise.
+ (*call_value_rex64_ms_sysv_vzeroupper): Likewise.
+ (*call_value_rex64_ms_sysv): Likewise.
+ (set_got_offset_rex64): Check TARGET_LP64 instead of TARGET_64BIT.
+
+ * config/i386/predicates.md (indirect_branch_operand): New.
+ (call_insn_operand): Support x32.
+
+2011-07-20 Michael Eager <eager@eagercon.com>
+
+ * params.def (PARAM_MAX_VARTRACK_EXPR_DEPTH): Default to 12.
+
+2011-07-20 Richard Henderson <rth@redhat.com>
+
+ * cfg.c (dump_bb_info): Dump basic_block->flags.
+ * cfgrtl.c (print_rtl_with_bb): Use dump_bb_info.
+
+2011-07-20 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_decompose_address): Allow only subregs
+ of DImode hard registers in index.
+ (ix86_legitimate_address_p): Allow subregs of base and index to span
+ more than a word. Assert that subregs of base and index satisfy
+ register_no_elim_operand predicates. Reject addresses where
+ base and index have different modes.
+
+2011-07-20 Robert Millan <rmh@gnu.org>
+
+ * config.gcc (mips*-*-linux*): Remove redundant tm_file entry.
+
+2011-07-20 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * bb-reorder.c (fix_crossing_conditional_branches): Fix crash by
+ removing now-unnecessary assignment.
+
+2011-07-20 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Restore setting
+ memory address space to the type's address space.
+
+2011-07-20 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/36467
+ PR target/49687
+ * config/avr/avr.md (mulhi3): Use register_or_s9_operand for operand2
+ and expand appropriately if there is a CONST_INT in operand2.
+ (usmulqihi3): New insn.
+ (*sumulqihi3): New insn.
+ (*osmulqihi3): New insn.
+ (*oumulqihi3): New insn.
+ (*muluqihi3.uconst): New insn_and_split.
+ (*muluqihi3.sconst): New insn_and_split.
+ (*mulsqihi3.sconst): New insn_and_split.
+ (*mulsqihi3.uconst): New insn_and_split.
+ (*mulsqihi3.oconst): New insn_and_split.
+ (*ashifthi3.signx.const): New insn_and_split.
+ (*ashifthi3.signx.const7): New insn_and_split.
+ (*ashifthi3.zerox.const): New insn_and_split.
+ (mulsqihi3): New insn.
+ (muluqihi3): New insn.
+ (muloqihi3): New insn.
+ * config/avr/predicates.md (const_2_to_7_operand): New.
+ (const_2_to_6_operand): New.
+ (u8_operand): New.
+ (s8_operand): New.
+ (o8_operand): New.
+ (s9_operand): New.
+ (register_or_s9_operand): New.
+
+2011-07-20 Kai Tietz <ktietz@redhat.com>
+
+ * builtins.c (fold_builtin_expect): See through the cast
+ from truthvalue_type_node to long.
+
+2011-07-20 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * config/rs6000/vsx.md (vsx_fma*): Use 4 argument fma instructions
+ where we can use them from the standard and altivec instruction
+ sets, instead of always using the 3 operand VSX forms that require
+ the destination to overlap one of the inputs.
+ (vsx_fms*): Ditto.
+ (vsx_fnma*): Ditto.
+ (vsx_fnms*): Ditto.
+
+ * config/rs6000/rs6000.md (fmadf4_fpr): Set fp_type fp_maddsub_d
+ for DF types.
+ (fmsdf4_fpr): Ditto.
+ (nfmadf4_fpr): Ditto.
+ (nfmsdf4_fpr): Ditto.
+
+2011-07-20 Sandra Loosemore <sandra@codesourcery.com>
+
+ * genrecog.c (make_insn_sequence): Correct position numbering
+ when filtering out match_scratch and match_dup.
+
+2011-07-20 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-forwprop.c (remove_prop_source_from_use): Robustify
+ against already removed statements.
+ (forward_propagate_into_comparison): Remove dead defining stmts.
+ (forward_propagate_into_gimple_cond): Likewise.
+ (forward_propagate_into_cond): Simplify.
+ (ssa_forward_propagate_and_combine): Handle changed cfg from
+ forward_propagate_into_comparison.
+ * tree-ssa-phiopt.c (conditional_replacement): Use proper
+ locations for newly built statements.
+
+2011-07-20 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.c (avr_rtx_costs): Set cost of SYMBOL_REF to 0.
+
+2011-07-20 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_class_max_nregs): Fix return type.
+ * config/s390/s390-protos.h (s390_class_max_nregs): Likewise.
+
+2011-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/18908
+ * tree.c (integer_all_onesp): Use TYPE_PRECISION, not mode precision.
+ * tree-ssa-forwprop.c (simplify_bitwise_binary): Remove bogus
+ ADDR_EXPR folding. Canonicalize X ^ ~0 as ~X.
+
+2011-07-20 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/frv/frv.c (frv_register_move_cost): Define explicitly
+ costs for subclasses of GR_REGS.
+
+2011-07-20 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/49780
+ * config/i386/predicates.md (no_seg_addres_operand): No more special.
+ * config/i386/i386.c (ix86_decompose_address): Allow only subregs
+ of DImode hard registers in base.
+ (ix86_legitimate_address_p): Allow SImode and DImode base and index
+ registers.
+
+2011-07-20 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (new_var_info): Allocate oldsolution lazily.
+ (unify_nodes): Deal with that.
+ (solve_graph): Likewise.
+
+2011-07-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * config/arm/arm.c (arm_canonicalize_comparison): Add case to
+ canonicalize left operand from ZERO_EXTEND to AND.
+
+2011-07-20 Anatoly Sokolov <aesok@post.ru>
+
+ * target.def (class_max_nregs): New hook.
+ * doc/tm.texi.in (TARGET_CLASS_MAX_NREGS): Document.
+ * doc/tm.texi: Regenerate.
+ * targhooks.c (default_class_max_nregs): New function.
+ * targhooks.h (default_class_max_nregs): Declare.
+ * ira.h (target_ira): Change type x_ira_reg_class_max_nregs and
+ x_ira_reg_class_min_nregs arrays to unsigned char.
+ * ira.c (setup_reg_class_nregs): Use TARGET_CLASS_MAX_NREGS target
+ hook instead of CLASS_MAX_NREGS macro.
+ * reginfo.c (restore_register_info): Ditto.
+ * ira-conflicts.c (process_regs_for_copy): Use
+ ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro.
+ Change type rclass and aclass vars to reg_class_t.
+ * ira-costs.c (record_reg_classes): Use ira_reg_class_max_nregs
+ array instead of CLASS_MAX_NREGS macro. Change type rclass var to
+ reg_class_t.
+ * reload.c (combine_reloads, find_reloads, find_reloads_address_1):
+ Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro.
+
+ * config/i386/i386.h (CLASS_MAX_NREGS): Remove.
+ * config/i386/i386.c (ix86_class_max_nregs): New function.
+ (ix86_register_move_cost): Use TARGET_CLASS_MAX_NREGS target hook
+ instead of CLASS_MAX_NREGS macro.
+ (TARGET_CLASS_MAX_NREGS): Define.
+ * config/avr/avr.h (CLASS_MAX_NREGS): Remove.
+ * config/avr/avr-protos.h (class_max_nregs): Remove declaration.
+ * config/avr/avr.c (class_max_nregs): Remove function.
+ * config/alpha/alpha.h (CLASS_MAX_NREGS): Remove.
+ * config/spu/spu.h (CLASS_MAX_NREGS): Remove.
+ * config/mep/mep.h (CLASS_MAX_NREGS): Remove.
+ * config/m32r/m32r.h (CLASS_MAX_NREGS): Remove.
+ * config/microblaze/microblaze.h (CLASS_MAX_NREGS): Remove.
+ * config/xtensa/xtensa.h (CLASS_MAX_NREGS): Remove.
+ * config/stormy16/stormy16.h (CLASS_MAX_NREGS): Remove.
+ * config/lm32/lm32.h (CLASS_MAX_NREGS): Remove.
+ * config/moxie/moxie.h (CLASS_MAX_NREGS): Remove.
+ * config/iq2000/iq2000.h (CLASS_MAX_NREGS): Remove.
+ * config/mn10300/mn10300.h (CLASS_MAX_NREGS): Remove.
+ * config/score/score.h (CLASS_MAX_NREGS): Remove.
+ * config/vax/vax.h (CLASS_MAX_NREGS): Remove.
+ * config/h8300/h8300.h (CLASS_MAX_NREGS): Remove.
+ * config/v850/v850.h (CLASS_MAX_NREGS): Remove.
+
+2011-07-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * cif-code.def (OVERWRITABLE): Fix typo and move around.
+ (TARGET_OPTIMIZATION_MISMATCH): Delete.
+ (EH_PERSONALITY): Fix typo.
+ (NON_CALL_EXCEPTIONS): Fix message.
+ (OPTIMIZATION_MISMATCH): Adjust message.
+ * ipa-inline.c (can_inline_edge_p): Use CIF_OPTIMIZATION_MISMATCH.
+
+2011-07-19 Ian Lance Taylor <iant@google.com>
+
+ * doc/install.texi (Configuration): Document
+ --enable-build-poststage1-with-cxx.
+
+2011-07-19 Robert Millan <rmh@gnu.org>
+
+ * config/mips/gnu-user.h: Copy from linux.h. Update comments.
+ (GLIBC_DYNAMIC_LINKER): Remove.
+
+ * config/mips/gnu-user64.h: Copy from linux64.h. Update comments.
+ (GLIBC_DYNAMIC_LINKER32, GLIBC_DYNAMIC_LINKER64)
+ (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
+ (BIONIC_DYNAMIC_LINKERN32, GNU_USER_DYNAMIC_LINKERN32): Remove.
+ (LINK_SPEC): Use GNU_USER_DYNAMIC_LINKER32,
+ GNU_USER_DYNAMIC_LINKER64 and GNU_USER_LINK_EMULATIONN32.
+
+ * config/mips/linux.h: Remove everything except for ...
+ (GLIBC_DYNAMIC_LINKER): ... this macro.
+
+ * config/mips/linux64.h: Remove everything except for ...
+ (GLIBC_DYNAMIC_LINKER32, GLIBC_DYNAMIC_LINKER64)
+ (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
+ (BIONIC_DYNAMIC_LINKERN32): ... these macros.
+ (GNU_USER_LINK_EMULATION32, GNU_USER_LINK_EMULATION64)
+ (GNU_USER_LINK_EMULATIONN32): New macros.
+
+ * config.gcc (mips64*-*-linux* | mipsisa64*-*-linux* | mips-*-linux*):
+ Use the new headers.
+
+2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtl.h (mem_attrs): Turn offset and size fields into HOST_WIDE_INTs.
+ Add offset_known_p and size_known_p fields.
+ (MEM_OFFSET_KNOWN_P): Update accordingly.
+ (MEM_OFFSET, MEM_SIZE_KNOWN_P, MEM_SIZE): Likewise.
+ * emit-rtl.c (mem_attrs_htab_hash): Update after mem_attrs changes.
+ (mem_attrs_eq_p, set_mem_attributes_minus_bitpos, set_mem_offset)
+ (clear_mem_offset, set_mem_size, clear_mem_size, change_address)
+ (adjust_address_1, widen_memory_access, set_mem_attrs_for_spill)
+ (init_emit_regs): Likewise.
+
+2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * doc/rtl.texi (MEM_OFFSET_KNOWN_P): Document.
+ (MEM_OFFSET): Change from returning an rtx to returning a
+ HOST_WIDE_INT.
+ * rtl.h (MEM_OFFSET_KNOWN_P): New macro.
+ (MEM_OFFSET): Return a HOST_WIDE_INT rather than an rtx.
+ * emit-rtl.h (set_mem_offset): Take a HOST_WIDE_INT rather than an rtx.
+ (clear_mem_offset): Declare.
+ * alias.c (ao_ref_from_mem): Adjust uses of MEM_OFFSET, using
+ MEM_OFFSET_KNOWN_P to test whether the offset is known, and
+ MEM_OFFSET to get a HOST_WIDE_INT offset.
+ (nonoverlapping_memrefs_p): Likewise. Adjust calls to...
+ (adjust_offset_for_component_ref): Take a bool "known_p"
+ parameter and a HOST_WIDE_INT "offset" parameter.
+ * builtins.c (get_memory_rtx): As for ao_ref_from_mem.
+ Adjust calls to set_mem_offset, passing a HOST_WIDE_INT rather
+ than an rtx. Use clear_mem_offset to clear the offset.
+ * cfgcleanup.c (merge_memattrs): Likewise.
+ * dwarf2out.c (tls_mem_loc_descriptor): Likewise.
+ * function.c (assign_parm_find_stack_rtl): Likewise.
+ (assign_parm_setup_stack): Likewise.
+ * print-rtl.c (print_rtx): Likewise.
+ * reload.c (find_reloads_subreg_address): Likewise.
+ * simplify-rtx.c (delegitimize_mem_from_attrs): Likewise.
+ * var-tracking.c (INT_MEM_OFFSET): Likewise.
+ * emit-rtl.c (set_reg_attrs_from_value): Likewise.
+ (get_mem_align_offset): Likewise.
+ (set_mem_offset): Take a HOST_WIDE_INT rather than an rtx.
+ (clear_mem_offset): New function.
+ * config/mips/mips.c (r10k_safe_mem_expr_p): Take a HOST_WIDE_INT
+ offset rather than an rtx. Assume both the expressio and offset
+ are available.
+ (r10k_needs_protection_p_1): Update accordingly, checking the
+ expression and offset availability here instead.
+
+2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * doc/rtl.texi (MEM_SIZE_KNOWN_P): Document.
+ (MEM_SIZE): Change from returning an rtx to returning a HOST_WIDE_INT.
+ * rtl.h (MEM_SIZE_KNOWN_P): New macro.
+ (MEM_SIZE): Return a HOST_WIDE_INT rather than an rtx.
+ * emit-rtl.h (set_mem_size): Take a HOST_WIDE_INT rather than an rtx.
+ (clear_mem_size): Declare.
+ * emit-rtl.c (set_mem_size): Take a HOST_WIDE_INT rather than an rtx.
+ (clear_mem_size): New function.
+ * alias.c (ao_ref_from_mem): Adjust uses of MEM_SIZE, using
+ MEM_SIZE_KNOWN_P to test whether the size is known, and MEM_SIZE
+ to get a HOST_WIDE_INT size. Adjust calls to set_mem_size,
+ passing a HOST_WIDE_INT rather than an rtx. Use clear_mem_size
+ to clear the size.
+ (nonoverlapping_memrefs_p): Likewise.
+ * builtins.c (get_memory_rtx, expand_builtin_memcmp): Likewise.
+ (expand_builtin_init_trampoline): Likewise.
+ * calls.c (compute_argument_addresses): Likewise.
+ * cfgcleanup.c (merge_memattrs): Likewise.
+ * dce.c (find_call_stack_args): Likewise.
+ * dse.c (record_store, scan_insn): Likewise.
+ * dwarf2out.c (dw_sra_loc_expr): Likewise.
+ * expr.c (emit_block_move_hints): Likewise.
+ * function.c (assign_parm_find_stack_rtl): Likewise.
+ * print-rtl.c (print_rtx): Likewise.
+ * reload.c (find_reloads_subreg_address): Likewise.
+ * rtlanal.c (may_trap_p_1): Likewise.
+ * var-tracking.c (track_expr_p): Likewise.
+ * varasm.c (assemble_trampoline_template): Likewise.
+ * config/arm/arm.c (arm_print_operand): Likewise.
+ * config/h8300/h8300.c (h8sx_emit_movmd): Likewise.
+ * config/i386/i386.c (expand_movmem_via_rep_mov): Likewise.
+ (expand_setmem_via_rep_stos, expand_constant_movmem_prologue)
+ (expand_constant_setmem_prologue): Likewise.
+ * config/mips/mips.c (mips_get_unaligned_mem): Likewise.
+ * config/rs6000/rs6000.c (expand_block_move): Likewise.
+ (adjacent_mem_locations): Likewise.
+ * config/s390/s390.c (s390_expand_setmem): Likewise.
+ (s390_expand_insv): Likewise.
+ * config/s390/s390.md (*extzv<mode>, *extv<mode>): Likewise.
+ (*extendqi<mode>2_short_displ): Likewise.
+ * config/sh/sh.c (expand_block_move): Likewise.
+ * config/sh/sh.md (extv, extzv): Likewise.
+
+2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * emit-rtl.c (mem_attrs_eq_p): New function, split out from...
+ (mem_attrs_htab_eq): ...here.
+ (find_mem_attrs): Replace with...
+ (set_mem_attrs): ...this function. Take a mem_attrs structure
+ rather than individual fields.
+ (set_mem_attributes_minus_bitpos, set_mem_alias_set)
+ (set_mem_addr_space, set_mem_align, set_mem_expr, set_mem_offset)
+ (set_mem_size, change_address, adjust_address_1, offset_address)
+ (widen_memory_access, get_spill_slot_decl, set_mem_attrs_for_spill):
+ Update accordingly.
+
+2011-07-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtl.h (MEM_ALIAS_SET, MEM_EXPR, MEM_OFFSET, MEM_ADDR_SPACE)
+ (MEM_SIZE, MEM_ALIGN): Redefine in terms of get_mem_attrs.
+ Provide a dummy definition of MEM_ADDR_SPACE for generators.
+ (target_rtl): Add x_mode_mem_attrs.
+ (mode_mem_attrs): New macro.
+ (get_mem_attrs): New function.
+ * emit-rtl.c (get_mem_attrs): Rename to...
+ (find_mem_attrs): ...this.
+ (set_mem_attributes_minus_bitpos, set_mem_alias_set)
+ (set_mem_addr_space, set_mem_align, set_mem_expr, set_mem_offset)
+ (set_mem_size, change_address, adjust_address_1, offset_address)
+ (widen_memory_access, get_spill_slot_decl, set_mem_attrs_for_spill):
+ Update accordingly.
+ (init_emit_regs): Initialize mode_mem_attrs.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-forwprop.c (lookup_logical_inverted_value): Remove
+ TRUTH_*_EXPR handling.
+ * tree-ssa-operands.c (get_expr_operands): Likewise.
+ * tree-ssa-pre.c (fully_constant_expression): Likewise.
+ * tree-ssa-uninit.c (use_pred_not_overlap_with_undef_path_pre):
+ Likewise.
+ (is_and_or_or): Likewise.
+ (is_norm_cond_subset_of): Likewise.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * tree.h (fold_build_pointer_plus_loc): New helper function.
+ (fold_build_pointer_plus_hwi_loc): Likewise.
+ (fold_build_pointer_plus): Define.
+ (fold_build_pointer_plus_hwi): Likewise.
+ * builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus.
+ (fold_builtin_memory_op): Likewise.
+ (fold_builtin_stpcpy): Likewise.
+ (fold_builtin_memchr): Likewise.
+ (fold_builtin_strstr): Likewise.
+ (fold_builtin_strchr): Likewise.
+ (fold_builtin_strrchr): Likewise.
+ (fold_builtin_strpbrk): Likewise.
+ (fold_builtin_strcat): Likewise.
+ (expand_builtin_memory_chk): Likewise.
+ (fold_builtin_memory_chk): Likewise.
+ * c-typeck.c (build_unary_op): Likewise.
+ * cgraphunit.c (thunk_adjust): Likewise.
+ * fold-const.c (build_range_check): Likewise.
+ (fold_binary_loc): Likewise.
+ * omp-low.c (extract_omp_for_data): Likewise.
+ (expand_omp_for_generic): Likewise.
+ (expand_omp_for_static_nochunk): Likewise.
+ (expand_omp_for_static_chunk): Likewise.
+ * tree-affine.c (add_elt_to_tree): Likewise.
+ * tree-data-ref.c (split_constant_offset_1): Likewise.
+ * tree-loop-distribution.c (generate_memset_zero): Likewise.
+ * tree-mudflap.c (mf_xform_derefs_1): Likewise.
+ * tree-predcom.c (ref_at_iteration): Likewise.
+ * tree-ssa-address.c (tree_mem_ref_addr): Likewise.
+ (add_to_parts): Likewise.
+ (create_mem_ref): Likewise.
+ * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise.
+ * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise.
+ (number_of_iterations_le): Likewise.
+ * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise.
+ * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise.
+ (vect_create_addr_base_for_vector_ref): Likewise.
+ * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise.
+ (vect_create_cond_for_alias_checks): Likewise.
+ * tree-vrp.c (extract_range_from_assert): Likewise.
+ * config/alpha/alpha.c (alpha_va_start): Likewise.
+ (alpha_gimplify_va_arg_1): Likewise.
+ * config/i386/i386.c (ix86_va_start): Likewise.
+ (ix86_gimplify_va_arg): Likewise.
+ * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
+ * config/mep/mep.c (mep_expand_va_start): Likewise.
+ (mep_gimplify_va_arg_expr): Likewise.
+ * config/mips/mips.c (mips_va_start): Likewise.
+ (mips_gimplify_va_arg_expr): Likewise.
+ * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
+ * config/rs6000/rs6000.c (rs6000_va_start): Likewise.
+ (rs6000_gimplify_va_arg): Likewise.
+ * config/s390/s390.c (s390_va_start): Likewise.
+ (s390_gimplify_va_arg): Likewise.
+ * config/sh/sh.c (sh_va_start): Likewise.
+ (sh_gimplify_va_arg_expr): Likewise.
+ * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise.
+ * config/spu/spu.c (spu_va_start): Likewise.
+ (spu_gimplify_va_arg_expr): Likewise.
+ * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
+ Likewise.
+ (xstormy16_gimplify_va_arg_expr): Likewise.
+ * config/xtensa/xtensa.c (xtensa_va_start): Likewise.
+ (xtensa_gimplify_va_arg_expr): Likewise.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * expr.c (expand_expr_real_2): Remove TRUTH_*_EXPR handling.
+ (expand_expr_real_1): Remove TRUTH_*IF_EXPR and STATEMENT_LIST
+ handling.
+
+ PR middle-end/18908
+ * expr.c (expand_expr_real_2): Do not unnecessarily truncate the
+ result of BIT_*_EXPR to bitfield precision.
+
+2011-07-19 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/49742
+ * tree-data-ref.c (get_references_in_stmt): Treat the lhs of a call
+ as a potential write.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * Makefile.in (tree-ssa-forwprop.o): Depend on gimple-pretty-print.h.
+ * tree-ssa-forwprop.c: Include gimple-pretty-print.h.
+ (forward_propagate_comparison): Simplify, remove obsolete code.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * gimplify.c (gimplify_expr): Gimplify TRUTH_NOT_EXPR as
+ BIT_XOR_EXPR, same as the RTL expander does.
+ * tree-cfg.c (verify_expr): Disallow TRUTH_NOT_EXPR in the gimple IL.
+ (verify_gimple_assign_unary): Likewise.
+ * tree-ssa-propagate.c (valid_gimple_rhs_p): Disallow TRUTH_*_EXPR.
+ * tree-ssa-forwprop.c (forward_propagate_comparison): Handle
+ BIT_NOT_EXPR and BIT_XOR_EXPR instead of TRUTH_NOT_EXPR.
+
+2011-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/49768
+ * gimple-fold.c (fold_nonarray_ctor_reference): Return NULL
+ if offset is smaller than bitoffset, but offset+size is bigger
+ than bitoffset.
+
+2011-07-19 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/49771
+ * tree-vect-loop-manip.c (vect_vfa_segment_size): In case of
+ zero step, set segment length to the size of the data-ref's type.
+
+2011-07-18 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general
+ comments.
+ (ipcp_values_pool): Declare.
+ (ipcp_sources_pool): Likewise.
+ (ipcp_lattice): Changed to forward declaration.
+ (ipa_param_descriptor): Removed fields ipcp_lattice, types and
+ cannot_devirtualize.
+ (ipa_node_params): New fields descriptors, lattices, known_vals,
+ clone_for_all_contexts and node dead, removed fields params and
+ count_scale.
+ (ipa_set_param_count): Removed.
+ (ipa_get_param_count): Made to work with descriptors vector.
+ (ipa_get_param): Updated.
+ (ipa_param_cannot_devirtualize_p): Removed.
+ (ipa_param_types_vec_empty): Likewise.
+ (ipa_set_param_used): New function.
+ (ipa_get_param_used): Updated to use descriptors vector.
+ (ipa_func_list): Removed.
+ (ipa_init_func_list): Removed declaration.
+ (ipa_push_func_to_list_1): Likewise.
+ (ipa_pop_func_from_list): Likewise.
+ (ipa_push_func_to_list): Removed.
+ (ipa_lattice_from_jfunc): Remove declaration.
+ (ipa_get_jf_pass_through_result): Declare.
+ (ipa_get_jf_ancestor_result): Likewise.
+ (ipa_value_from_jfunc): Likewise.
+ (ipa_get_lattice): Update.
+ (ipa_lat_is_single_const): New function.
+ * ipa-prop.c (ipa_push_func_to_list_1): Removed.
+ (ipa_init_func_list): Likewise.
+ (ipa_pop_func_from_list): Likewise.
+ (ipa_get_param_decl_index): Fix coding style.
+ (count_formal_params): Removed.
+ (count_formal_params_1): Renamed to count_formal_params.
+ (ipa_populate_param_decls): Update to use descriptors vector.
+ (ipa_initialize_node_params): Likewise.
+ (visit_ref_for_mod_analysis): Use ipa_set_param_used.
+ (ipa_analyze_params_uses): Likewise.
+ (ipa_free_node_params_substructures): Likewise and free also lattices
+ and known values.
+ (duplicate_array): Removed.
+ (ipa_edge_duplication_hook): Add the new edge to the list of edge
+ clones.
+ (ipa_node_duplication_hook): Update to use new lattices.
+ (ipa_free_all_structures_after_ipa_cp): Free alloc pools.
+ (ipa_free_all_structures_after_iinln): Likewise.
+ (ipa_write_node_info): Update to use new lattices.
+ (ipa_read_node_info): Likewise.
+ (ipa_get_jf_pass_through_result): New function.
+ (ipa_get_jf_ancestor_result): Likewise.
+ (ipa_value_from_jfunc): Likewise.
+ (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc.
+ * ipa-cp.c: Reimplemented.
+ * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed.
+ (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter.
+ (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise.
+ * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies.
+ * doc/invoke.texi (devirt-type-list-size): Removed description.
+ (ipa-cp-value-list-size): Added description.
+
+2011-07-18 Richard Henderson <rth@redhat.com>
+
+ * bb-reorder.c (fix_crossing_conditional_branches): Emit all insns
+ before calling create_basic_block.
+
+2011-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49675
+ * tree.c (build_common_builtin_nodes): Register
+ __builtin_return_address, __cyg_profile_func_enter
+ and __cyg_profile_func_exit.
+
+2011-07-18 Richard Henderson <rth@redhat.com>
+
+ * bb-reorder.c (emit_barrier_after_bb): Split out of ...
+ (add_labels_and_missing_jumps): ... here.
+ (fix_up_fall_thru_edges, fix_crossing_conditional_branches): Use it.
+
+2011-07-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/47744
+ * config/i386/i386.c (ix86_decompose_address): Allow only subregs
+ of DImode hard registers in PLUS address chains.
+
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR bootstrap/49769
+ * config.gcc (alpha*-*-linux*): Add crtfastmath.o to extra_parts.
+ (alpha*-*-freebsd*): Likewise.
+ (i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu,
+ i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*,
+ i[34567]86-*-kopensolaris*-gnu): Add crtprec32.o, crtprec64.o,
+ crtprec80.o, crtfastmath.o to extra_parts for all targets.
+ (ia64*-*-elf*): Remove extra_parts.
+ (sparc-*-linux*): Add crtfastmath.o to extra_parts.
+ (sparc64-*-linux*): Likewise.
+ (sparc64-*-freebsd*): Likewise.
+
+ Revert:
+ * config.gcc (ia64*-*-freebsd*): Remove crtfastmath.o from extra_parts.
+ (ia64*-*-linux*): Likewise.
+ (mips64*-*-linux*): Likewise.
+ (mips*-*-linux*): Likewise.
+
+2011-07-18 David Edelsohn <dje.gcc@gmail.com>
+
+ * doc/install.texi (Specific, *-ibm-aix*): AIX assembler bug.
+
+2011-07-18 Richard Guenther <rguenther@suse.de>
+
+ * gimplify.c (gimplify_expr): Use input_location, not saved_location
+ when building new trees.
+
+2011-07-18 Richard Guenther <rguenther@suse.de>
+
+ * expr.c (expand_expr_real_2): Properly truncate the BIT_NOT_EXPR
+ expansion result to bitfield precision if required.
+
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.gcc (i[3456x]86-*-netware*): Remove.
+
+ * gthr-nks.h: Remove.
+ * configure.ac (enable_threads): Remove nks.
+ * configure: Regenerate.
+
+ * config/i386/i386.c (ix86_encode_section_info): Remove netware
+ reference.
+ * config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): Remove
+ <netware.h> reference.
+
+ * config/i386/netware-libgcc.c,
+ gcc/config/i386/netware-libgcc.def,
+ gcc/config/i386/netware-libgcc.exp, gcc/config/i386/netware.c,
+ gcc/config/i386/netware.h, gcc/config/i386/netware.opt,
+ gcc/config/i386/nwld.c, gcc/config/i386/nwld.h,
+ gcc/config/i386/t-netware, gcc/config/i386/t-nwld: Remove
+
+ * doc/extend.texi (Function Attributes,
+ callee_pop_aggregate_return): Remove i?86-netware reference.
+ * doc/install.texi (Configuration, --enable-threads): Remove nks.
+
2011-07-17 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/49746
@@ -223,15 +930,14 @@
(READONLY_DATA_SECTION_ASM_OP): Remove.
(TARGET_ASM_NAMED_SECTION): Move from here...
* config/avr/avr.c: ...to here.
- (avr_asm_init_sections): Set unnamed callback of
- readonly_data_section.
+ (avr_asm_init_sections): Set unnamed callback of readonly_data_section.
(avr_asm_named_section): Make static.
2011-07-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR bootstrap/49739
- * config.gcc (extra_parts): Add crtprec32.o crtprec64.o crtp
- rec80.o crtfastmath.o for Linux/x86.
+ * config.gcc (extra_parts): Add crtprec32.o crtprec64.o crtprec80.o
+ and crtfastmath.o for Linux/x86.
2011-07-14 Bernd Schmidt <bernds@codesourcery.com>
@@ -261,8 +967,7 @@
estimate_insn_tick, estimate_shadow_tick): New functions.
(prune_ready_list): New arg shadows_only_p. All callers changed.
If true, remove everything that isn't SHADOW_P. Look up delay
- pairs and estimate ticks to avoid scheduling the first insn too
- early.
+ pairs and estimate ticks to avoid scheduling the first insn too early.
(verify_shadows): New function.
(schedule_block): Add machinery to enable backtracking.
(sched_init): Take sched_no_dce into account when setting
@@ -327,8 +1032,7 @@
2011-07-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR target/49541
- * config/sol2.h (LIB_SPEC): Simplify.
- Move LIB_THREAD_LDFLAGS_SPEC ...
+ * config/sol2.h (LIB_SPEC): Simplify. Move LIB_THREAD_LDFLAGS_SPEC ...
(LINK_SPEC): ... here.
2011-07-13 Bernd Schmidt <bernds@codesourcery.com>
@@ -390,8 +1094,7 @@
2011-07-13 H.J. Lu <hongjiu.lu@intel.com>
- * config/i386/i386.c (x86_output_mi_thunk): Support ptr_mode
- != Pmode.
+ * config/i386/i386.c (x86_output_mi_thunk): Support ptr_mode != Pmode.
* config/i386/i386.md (*addsi_1_zext): Renamed to ...
(addsi_1_zext): This.
@@ -400,7 +1103,7 @@
* doc/tm.texi.in (TARGET_ASM_MERGEABLE_RODATA_PREFIX): Add hook.
* doc/tm.texi: Regenerate.
- * target.def (mergeable_rodata_prefix: New defhookpod.
+ * target.def (mergeable_rodata_prefix): New defhookpod.
* varasm.c (mergeable_string_section, mergeable_constant_section):
Use it. Allocate name with alloca.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index b2bbcdf3d5f..db6d0cbcd95 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20110718
+20110721
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 0c58b3806e9..e8bf826a02b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1009,7 +1009,7 @@ LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
$(CGRAPH_H) $(VEC_H) vecprim.h $(TREE_H) $(GIMPLE_H) \
$(GCOV_IO_H)
TREE_VECTORIZER_H = tree-vectorizer.h $(TREE_DATA_REF_H)
-IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H)
+IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) alloc-pool.h
GSTAB_H = gstab.h stab.def
BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h $(CONFIG_H) $(SYSTEM_H) \
@@ -2433,7 +2433,8 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) $(TREE_PASS_H) $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
- langhooks.h $(FLAGS_H) $(GIMPLE_H) tree-pretty-print.h $(EXPR_H)
+ langhooks.h $(FLAGS_H) $(GIMPLE_H) tree-pretty-print.h \
+ gimple-pretty-print.h $(EXPR_H)
tree-ssa-phiprop.o : tree-ssa-phiprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) $(TREE_PASS_H) $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a09a79aa0c0..1a616a5f208 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/Make-lang.in (GNAT1_ADA_OBJS): Move ada/b_gnat1.o to...
+ (GNAT1_OBJS): ...here.
+
2011-07-15 Eric Botcazou <ebotcazou@adacore.com>
PR ada/48711
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index c471508767c..d0eab2e8c02 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -336,9 +336,9 @@ GNAT_ADA_OBJS = \
ada/widechar.o
# Object files for gnat executables
-GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o ada/b_gnat1.o
+GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
-GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS)
+GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS) ada/b_gnat1.o
GNATBIND_OBJS = \
ada/adaint.o \
diff --git a/gcc/alias.c b/gcc/alias.c
index b32e6b37cac..ef624a1bfe4 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -162,7 +162,6 @@ static const_rtx fixed_scalar_and_varying_struct_p (const_rtx, const_rtx, rtx, r
static int aliases_everything_p (const_rtx);
static bool nonoverlapping_component_refs_p (const_tree, const_tree);
static tree decl_for_component_ref (tree);
-static rtx adjust_offset_for_component_ref (tree, rtx);
static int write_dependence_p (const_rtx, const_rtx, int);
static void memory_modified_1 (rtx, const_rtx, void *);
@@ -313,10 +312,10 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
ref->ref_alias_set = MEM_ALIAS_SET (mem);
- /* If MEM_OFFSET or MEM_SIZE are NULL we have to punt.
+ /* If MEM_OFFSET or MEM_SIZE are unknown we have to punt.
Keep points-to related information though. */
- if (!MEM_OFFSET (mem)
- || !MEM_SIZE (mem))
+ if (!MEM_OFFSET_KNOWN_P (mem)
+ || !MEM_SIZE_KNOWN_P (mem))
{
ref->ref = NULL_TREE;
ref->offset = 0;
@@ -328,13 +327,12 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
/* If the base decl is a parameter we can have negative MEM_OFFSET in
case of promoted subregs on bigendian targets. Trust the MEM_EXPR
here. */
- if (INTVAL (MEM_OFFSET (mem)) < 0
- && ((INTVAL (MEM_SIZE (mem)) + INTVAL (MEM_OFFSET (mem)))
- * BITS_PER_UNIT) == ref->size)
+ if (MEM_OFFSET (mem) < 0
+ && (MEM_SIZE (mem) + MEM_OFFSET (mem)) * BITS_PER_UNIT == ref->size)
return true;
- ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT;
- ref->size = INTVAL (MEM_SIZE (mem)) * BITS_PER_UNIT;
+ ref->offset += MEM_OFFSET (mem) * BITS_PER_UNIT;
+ ref->size = MEM_SIZE (mem) * BITS_PER_UNIT;
/* The MEM may extend into adjacent fields, so adjust max_size if
necessary. */
@@ -2201,34 +2199,33 @@ decl_for_component_ref (tree x)
return x && DECL_P (x) ? x : NULL_TREE;
}
-/* Walk up the COMPONENT_REF list and adjust OFFSET to compensate for the
- offset of the field reference. */
+/* Walk up the COMPONENT_REF list in X and adjust *OFFSET to compensate
+ for the offset of the field reference. *KNOWN_P says whether the
+ offset is known. */
-static rtx
-adjust_offset_for_component_ref (tree x, rtx offset)
+static void
+adjust_offset_for_component_ref (tree x, bool *known_p,
+ HOST_WIDE_INT *offset)
{
- HOST_WIDE_INT ioffset;
-
- if (! offset)
- return NULL_RTX;
-
- ioffset = INTVAL (offset);
+ if (!*known_p)
+ return;
do
{
- tree offset = component_ref_field_offset (x);
+ tree xoffset = component_ref_field_offset (x);
tree field = TREE_OPERAND (x, 1);
- if (! host_integerp (offset, 1))
- return NULL_RTX;
- ioffset += (tree_low_cst (offset, 1)
+ if (! host_integerp (xoffset, 1))
+ {
+ *known_p = false;
+ return;
+ }
+ *offset += (tree_low_cst (xoffset, 1)
+ (tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
/ BITS_PER_UNIT));
x = TREE_OPERAND (x, 0);
}
while (x && TREE_CODE (x) == COMPONENT_REF);
-
- return GEN_INT (ioffset);
}
/* Return nonzero if we can determine the exprs corresponding to memrefs
@@ -2241,7 +2238,8 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
tree exprx = MEM_EXPR (x), expry = MEM_EXPR (y);
rtx rtlx, rtly;
rtx basex, basey;
- rtx moffsetx, moffsety;
+ bool moffsetx_known_p, moffsety_known_p;
+ HOST_WIDE_INT moffsetx = 0, moffsety = 0;
HOST_WIDE_INT offsetx = 0, offsety = 0, sizex, sizey, tem;
/* Unless both have exprs, we can't tell anything. */
@@ -2250,9 +2248,9 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
/* For spill-slot accesses make sure we have valid offsets. */
if ((exprx == get_spill_slot_decl (false)
- && ! MEM_OFFSET (x))
+ && ! MEM_OFFSET_KNOWN_P (x))
|| (expry == get_spill_slot_decl (false)
- && ! MEM_OFFSET (y)))
+ && ! MEM_OFFSET_KNOWN_P (y)))
return 0;
/* If both are field references, we may be able to determine something. */
@@ -2263,23 +2261,27 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
/* If the field reference test failed, look at the DECLs involved. */
- moffsetx = MEM_OFFSET (x);
+ moffsetx_known_p = MEM_OFFSET_KNOWN_P (x);
+ if (moffsetx_known_p)
+ moffsetx = MEM_OFFSET (x);
if (TREE_CODE (exprx) == COMPONENT_REF)
{
tree t = decl_for_component_ref (exprx);
if (! t)
return 0;
- moffsetx = adjust_offset_for_component_ref (exprx, moffsetx);
+ adjust_offset_for_component_ref (exprx, &moffsetx_known_p, &moffsetx);
exprx = t;
}
- moffsety = MEM_OFFSET (y);
+ moffsety_known_p = MEM_OFFSET_KNOWN_P (y);
+ if (moffsety_known_p)
+ moffsety = MEM_OFFSET (y);
if (TREE_CODE (expry) == COMPONENT_REF)
{
tree t = decl_for_component_ref (expry);
if (! t)
return 0;
- moffsety = adjust_offset_for_component_ref (expry, moffsety);
+ adjust_offset_for_component_ref (expry, &moffsety_known_p, &moffsety);
expry = t;
}
@@ -2338,26 +2340,26 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
return 0;
sizex = (!MEM_P (rtlx) ? (int) GET_MODE_SIZE (GET_MODE (rtlx))
- : MEM_SIZE (rtlx) ? INTVAL (MEM_SIZE (rtlx))
+ : MEM_SIZE_KNOWN_P (rtlx) ? MEM_SIZE (rtlx)
: -1);
sizey = (!MEM_P (rtly) ? (int) GET_MODE_SIZE (GET_MODE (rtly))
- : MEM_SIZE (rtly) ? INTVAL (MEM_SIZE (rtly)) :
- -1);
+ : MEM_SIZE_KNOWN_P (rtly) ? MEM_SIZE (rtly)
+ : -1);
/* If we have an offset for either memref, it can update the values computed
above. */
- if (moffsetx)
- offsetx += INTVAL (moffsetx), sizex -= INTVAL (moffsetx);
- if (moffsety)
- offsety += INTVAL (moffsety), sizey -= INTVAL (moffsety);
+ if (moffsetx_known_p)
+ offsetx += moffsetx, sizex -= moffsetx;
+ if (moffsety_known_p)
+ offsety += moffsety, sizey -= moffsety;
/* If a memref has both a size and an offset, we can use the smaller size.
We can't do this if the offset isn't known because we must view this
memref as being anywhere inside the DECL's MEM. */
- if (MEM_SIZE (x) && moffsetx)
- sizex = INTVAL (MEM_SIZE (x));
- if (MEM_SIZE (y) && moffsety)
- sizey = INTVAL (MEM_SIZE (y));
+ if (MEM_SIZE_KNOWN_P (x) && moffsetx_known_p)
+ sizex = MEM_SIZE (x);
+ if (MEM_SIZE_KNOWN_P (y) && moffsety_known_p)
+ sizey = MEM_SIZE (y);
/* Put the values of the memref with the lower offset in X's values. */
if (offsetx > offsety)
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 81369eaf38e..fac5b296af2 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -1249,6 +1249,15 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void)
return crossing_edges;
}
+/* Emit a barrier into the footer of BB. */
+
+static void
+emit_barrier_after_bb (basic_block bb)
+{
+ rtx barrier = emit_barrier_after (BB_END (bb));
+ bb->il.rtl->footer = unlink_insn_chain (barrier, barrier);
+}
+
/* If any destination of a crossing edge does not have a label, add label;
Convert any easy fall-through crossing edges to unconditional jumps. */
@@ -1262,7 +1271,7 @@ add_labels_and_missing_jumps (VEC(edge, heap) *crossing_edges)
{
basic_block src = e->src;
basic_block dest = e->dest;
- rtx label, barrier, new_jump;
+ rtx label, new_jump;
if (dest == EXIT_BLOCK_PTR)
continue;
@@ -1288,10 +1297,10 @@ add_labels_and_missing_jumps (VEC(edge, heap) *crossing_edges)
new_jump = emit_jump_insn_after (gen_jump (label), BB_END (src));
BB_END (src) = new_jump;
- barrier = emit_barrier_after (new_jump);
JUMP_LABEL (new_jump) = label;
LABEL_NUSES (label) += 1;
- src->il.rtl->footer = unlink_insn_chain (barrier, barrier);
+
+ emit_barrier_after_bb (src);
/* Mark edge as non-fallthru. */
e->flags &= ~EDGE_FALLTHRU;
@@ -1321,7 +1330,6 @@ fix_up_fall_thru_edges (void)
int invert_worked;
rtx old_jump;
rtx fall_thru_label;
- rtx barrier;
FOR_EACH_BB (cur_bb)
{
@@ -1451,19 +1459,7 @@ fix_up_fall_thru_edges (void)
}
/* Add barrier after new jump */
-
- if (new_bb)
- {
- barrier = emit_barrier_after (BB_END (new_bb));
- new_bb->il.rtl->footer = unlink_insn_chain (barrier,
- barrier);
- }
- else
- {
- barrier = emit_barrier_after (BB_END (cur_bb));
- cur_bb->il.rtl->footer = unlink_insn_chain (barrier,
- barrier);
- }
+ emit_barrier_after_bb (new_bb ? new_bb : cur_bb);
}
}
}
@@ -1526,7 +1522,6 @@ fix_crossing_conditional_branches (void)
{
basic_block cur_bb;
basic_block new_bb;
- basic_block last_bb;
basic_block dest;
edge succ1;
edge succ2;
@@ -1536,10 +1531,6 @@ fix_crossing_conditional_branches (void)
rtx set_src;
rtx old_label = NULL_RTX;
rtx new_label;
- rtx new_jump;
- rtx barrier;
-
- last_bb = EXIT_BLOCK_PTR->prev_bb;
FOR_EACH_BB (cur_bb)
{
@@ -1602,38 +1593,28 @@ fix_crossing_conditional_branches (void)
new_label = block_label (new_bb);
else
{
+ basic_block last_bb;
+ rtx new_jump;
+
/* Create new basic block to be dest for
conditional jump. */
- new_bb = create_basic_block (NULL, NULL, last_bb);
- new_bb->aux = last_bb->aux;
- last_bb->aux = new_bb;
- last_bb = new_bb;
/* Put appropriate instructions in new bb. */
new_label = gen_label_rtx ();
- emit_label_before (new_label, BB_HEAD (new_bb));
- BB_HEAD (new_bb) = new_label;
+ emit_label (new_label);
- if (GET_CODE (old_label) == LABEL_REF)
- {
- old_label = JUMP_LABEL (old_jump);
- new_jump = emit_jump_insn_after (gen_jump
- (old_label),
- BB_END (new_bb));
- }
- else
- {
- gcc_assert (HAVE_return
- && GET_CODE (old_label) == RETURN);
- new_jump = emit_jump_insn_after (gen_return (),
- BB_END (new_bb));
- }
-
- barrier = emit_barrier_after (new_jump);
+ gcc_assert (GET_CODE (old_label) == LABEL_REF);
+ old_label = JUMP_LABEL (old_jump);
+ new_jump = emit_jump_insn (gen_jump (old_label));
JUMP_LABEL (new_jump) = old_label;
- new_bb->il.rtl->footer = unlink_insn_chain (barrier,
- barrier);
+
+ last_bb = EXIT_BLOCK_PTR->prev_bb;
+ new_bb = create_basic_block (new_label, new_jump, last_bb);
+ new_bb->aux = last_bb->aux;
+ last_bb->aux = new_bb;
+
+ emit_barrier_after_bb (new_bb);
/* Make sure new bb is in same partition as source
of conditional branch. */
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1ee8cf80001..79a6b09e928 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1238,9 +1238,8 @@ get_memory_rtx (tree exp, tree len)
gcc_assert (TREE_CODE (inner) == COMPONENT_REF);
- if (MEM_OFFSET (mem)
- && CONST_INT_P (MEM_OFFSET (mem)))
- offset = INTVAL (MEM_OFFSET (mem));
+ if (MEM_OFFSET_KNOWN_P (mem))
+ offset = MEM_OFFSET (mem);
if (offset >= 0 && len && host_integerp (len, 0))
length = tree_low_cst (len, 0);
@@ -1295,11 +1294,14 @@ get_memory_rtx (tree exp, tree len)
if (mem_expr != MEM_EXPR (mem))
{
set_mem_expr (mem, mem_expr);
- set_mem_offset (mem, offset >= 0 ? GEN_INT (offset) : NULL_RTX);
+ if (offset >= 0)
+ set_mem_offset (mem, offset);
+ else
+ clear_mem_offset (mem);
}
}
set_mem_alias_set (mem, 0);
- set_mem_size (mem, NULL_RTX);
+ clear_mem_size (mem);
}
return mem;
@@ -3691,8 +3693,8 @@ expand_builtin_memcmp (tree exp, ATTRIBUTE_UNUSED rtx target,
/* Set MEM_SIZE as appropriate. */
if (CONST_INT_P (arg3_rtx))
{
- set_mem_size (arg1_rtx, arg3_rtx);
- set_mem_size (arg2_rtx, arg3_rtx);
+ set_mem_size (arg1_rtx, INTVAL (arg3_rtx));
+ set_mem_size (arg2_rtx, INTVAL (arg3_rtx));
}
#ifdef HAVE_cmpmemsi
@@ -4236,9 +4238,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
&& !integer_zerop (TYPE_SIZE (type)))
{
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
- fold_build2 (POINTER_PLUS_EXPR,
- TREE_TYPE (valist),
- valist_tmp, size_int (boundary - 1)));
+ fold_build_pointer_plus_hwi (valist_tmp, boundary - 1));
gimplify_and_add (t, pre_p);
t = fold_convert (sizetype, valist_tmp);
@@ -4277,12 +4277,11 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
rounded_size, size_int (align));
t = fold_build3 (COND_EXPR, sizetype, t, size_zero_node,
size_binop (MINUS_EXPR, rounded_size, type_size));
- addr = fold_build2 (POINTER_PLUS_EXPR,
- TREE_TYPE (addr), addr, t);
+ addr = fold_build_pointer_plus (addr, t);
}
/* Compute new value for AP. */
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (valist), valist_tmp, rounded_size);
+ t = fold_build_pointer_plus (valist_tmp, rounded_size);
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
gimplify_and_add (t, pre_p);
@@ -4838,7 +4837,7 @@ expand_builtin_init_trampoline (tree exp)
{
m_tramp = change_address (m_tramp, BLKmode, tmp);
set_mem_align (m_tramp, TRAMPOLINE_ALIGNMENT);
- set_mem_size (m_tramp, GEN_INT (TRAMPOLINE_SIZE));
+ set_mem_size (m_tramp, TRAMPOLINE_SIZE);
}
/* The FUNC argument should be the address of the nested function.
@@ -6264,13 +6263,22 @@ build_builtin_expect_predicate (location_t loc, tree pred, tree expected)
static tree
fold_builtin_expect (location_t loc, tree arg0, tree arg1)
{
- tree inner, fndecl;
+ tree inner, fndecl, inner_arg0;
enum tree_code code;
+ /* Distribute the expected value over short-circuiting operators.
+ See through the cast from truthvalue_type_node to long. */
+ inner_arg0 = arg0;
+ while (TREE_CODE (inner_arg0) == NOP_EXPR
+ && INTEGRAL_TYPE_P (TREE_TYPE (inner_arg0))
+ && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (inner_arg0, 0))))
+ inner_arg0 = TREE_OPERAND (inner_arg0, 0);
+
/* If this is a builtin_expect within a builtin_expect keep the
inner one. See through a comparison against a constant. It
might have been added to create a thruthvalue. */
- inner = arg0;
+ inner = inner_arg0;
+
if (COMPARISON_CLASS_P (inner)
&& TREE_CODE (TREE_OPERAND (inner, 1)) == INTEGER_CST)
inner = TREE_OPERAND (inner, 0);
@@ -6281,14 +6289,7 @@ fold_builtin_expect (location_t loc, tree arg0, tree arg1)
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT)
return arg0;
- /* Distribute the expected value over short-circuiting operators.
- See through the cast from truthvalue_type_node to long. */
- inner = arg0;
- while (TREE_CODE (inner) == NOP_EXPR
- && INTEGRAL_TYPE_P (TREE_TYPE (inner))
- && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (inner, 0))))
- inner = TREE_OPERAND (inner, 0);
-
+ inner = inner_arg0;
code = TREE_CODE (inner);
if (code == TRUTH_ANDIF_EXPR || code == TRUTH_ORIF_EXPR)
{
@@ -6303,13 +6304,13 @@ fold_builtin_expect (location_t loc, tree arg0, tree arg1)
}
/* If the argument isn't invariant then there's nothing else we can do. */
- if (!TREE_CONSTANT (arg0))
+ if (!TREE_CONSTANT (inner_arg0))
return NULL_TREE;
/* If we expect that a comparison against the argument will fold to
a constant return the constant. In practice, this means a true
constant or the address of a non-weak symbol. */
- inner = arg0;
+ inner = inner_arg0;
STRIP_NOPS (inner);
if (TREE_CODE (inner) == ADDR_EXPR)
{
@@ -8222,8 +8223,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
len = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (len), len,
ssize_int (1));
- len = fold_convert_loc (loc, sizetype, len);
- dest = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
+ dest = fold_build_pointer_plus_loc (loc, dest, len);
dest = fold_convert_loc (loc, type, dest);
if (expr)
dest = omit_one_operand_loc (loc, type, dest, expr);
@@ -8299,8 +8299,7 @@ fold_builtin_stpcpy (location_t loc, tree fndecl, tree dest, tree src)
call = build_call_expr_loc (loc, fn, 3, dest, src, lenp1);
type = TREE_TYPE (TREE_TYPE (fndecl));
- len = fold_convert_loc (loc, sizetype, len);
- dest = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
+ dest = fold_build_pointer_plus_loc (loc, dest, len);
dest = fold_convert_loc (loc, type, dest);
dest = omit_one_operand_loc (loc, type, dest, call);
return dest;
@@ -8387,8 +8386,7 @@ fold_builtin_memchr (location_t loc, tree arg1, tree arg2, tree len, tree type)
if (r == NULL)
return build_int_cst (TREE_TYPE (arg1), 0);
- tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (arg1), arg1,
- size_int (r - p1));
+ tem = fold_build_pointer_plus_hwi_loc (loc, arg1, r - p1);
return fold_convert_loc (loc, type, tem);
}
return NULL_TREE;
@@ -10775,8 +10773,7 @@ fold_builtin_strstr (location_t loc, tree s1, tree s2, tree type)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
- s1, size_int (r - p1));
+ tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
return fold_convert_loc (loc, type, tem);
}
@@ -10846,8 +10843,7 @@ fold_builtin_strchr (location_t loc, tree s1, tree s2, tree type)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
- s1, size_int (r - p1));
+ tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
return fold_convert_loc (loc, type, tem);
}
return NULL_TREE;
@@ -10902,8 +10898,7 @@ fold_builtin_strrchr (location_t loc, tree s1, tree s2, tree type)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
- s1, size_int (r - p1));
+ tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
return fold_convert_loc (loc, type, tem);
}
@@ -10962,8 +10957,7 @@ fold_builtin_strpbrk (location_t loc, tree s1, tree s2, tree type)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
- s1, size_int (r - p1));
+ tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
return fold_convert_loc (loc, type, tem);
}
@@ -11047,8 +11041,7 @@ fold_builtin_strcat (location_t loc ATTRIBUTE_UNUSED, tree dst, tree src)
newdst = build_call_expr_loc (loc, strlen_fn, 1, dst);
/* Create (dst p+ strlen (dst)). */
- newdst = fold_build2_loc (loc, POINTER_PLUS_EXPR,
- TREE_TYPE (dst), dst, newdst);
+ newdst = fold_build_pointer_plus_loc (loc, dst, newdst);
newdst = builtin_save_expr (newdst);
call = build_call_expr_loc (loc, strcpy_fn, 2, newdst, src);
@@ -11721,7 +11714,7 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode,
return expand_expr (dest, target, mode, EXPAND_NORMAL);
}
- expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
+ expr = fold_build_pointer_plus (dest, len);
return expand_expr (expr, target, mode, EXPAND_NORMAL);
}
@@ -11981,8 +11974,7 @@ fold_builtin_memory_chk (location_t loc, tree fndecl,
dest, len);
else
{
- tree temp = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (dest),
- dest, len);
+ tree temp = fold_build_pointer_plus_loc (loc, dest, len);
return fold_convert_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), temp);
}
}
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 38149c8c6dd..c5f2306ca62 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,17 @@
+2011-07-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/6709 (DR 743)
+ PR c++/42603 (DR 950)
+ * c-common.h (CPP_KEYWORD, CPP_TEMPLATE_ID): Move from cp/parser.h.
+ (CPP_NESTED_NAME_SPECIFIER, N_CP_TTYPES): Likewise.
+ (CPP_DECLTYPE): New.
+ * c-common.c (c_parse_error): Handle CPP_DECLTYPE.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * c-common.c (pointer_int_sum): Use fold_build_pointer_plus.
+ * c-omp.c (c_finish_omp_for): Likewise.
+
2011-07-12 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (dump_nested_types): Put semi-colon after empty loop
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 3ffacd5b444..6078d948ae4 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -3760,7 +3760,7 @@ pointer_int_sum (location_t loc, enum tree_code resultcode,
if (resultcode == MINUS_EXPR)
intop = fold_build1_loc (loc, NEGATE_EXPR, sizetype, intop);
- ret = fold_build2_loc (loc, POINTER_PLUS_EXPR, result_type, ptrop, intop);
+ ret = fold_build_pointer_plus_loc (loc, ptrop, intop);
fold_undefer_and_ignore_overflow_warnings ();
@@ -8329,6 +8329,8 @@ c_parse_error (const char *gmsgid, enum cpp_ttype token_type,
message = catenate_messages (gmsgid, " before %<#pragma%>");
else if (token_type == CPP_PRAGMA_EOL)
message = catenate_messages (gmsgid, " before end of line");
+ else if (token_type == CPP_DECLTYPE)
+ message = catenate_messages (gmsgid, " before %<decltype%>");
else if (token_type < N_TTYPES)
{
message = catenate_messages (gmsgid, " before %qs token");
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index a80c0eaec40..13aae0f3ecc 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -320,6 +320,30 @@ struct c_common_resword
const unsigned int disable : 16;
};
+/* Extra cpp_ttype values for C++. */
+
+/* A token type for keywords, as opposed to ordinary identifiers. */
+#define CPP_KEYWORD ((enum cpp_ttype) (N_TTYPES + 1))
+
+/* A token type for template-ids. If a template-id is processed while
+ parsing tentatively, it is replaced with a CPP_TEMPLATE_ID token;
+ the value of the CPP_TEMPLATE_ID is whatever was returned by
+ cp_parser_template_id. */
+#define CPP_TEMPLATE_ID ((enum cpp_ttype) (CPP_KEYWORD + 1))
+
+/* A token type for nested-name-specifiers. If a
+ nested-name-specifier is processed while parsing tentatively, it is
+ replaced with a CPP_NESTED_NAME_SPECIFIER token; the value of the
+ CPP_NESTED_NAME_SPECIFIER is whatever was returned by
+ cp_parser_nested_name_specifier_opt. */
+#define CPP_NESTED_NAME_SPECIFIER ((enum cpp_ttype) (CPP_TEMPLATE_ID + 1))
+
+/* A token type for pre-parsed C++0x decltype. */
+#define CPP_DECLTYPE ((enum cpp_ttype) (CPP_NESTED_NAME_SPECIFIER + 1))
+
+/* The number of token types, including C++-specific ones. */
+#define N_CP_TTYPES ((int) (CPP_DECLTYPE + 1))
+
/* Disable mask. Keywords are disabled if (reswords[i].disable &
mask) is _true_. Thus for keywords which are present in all
languages the disable field is zero. */
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index d2256ffd376..340656fa14f 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -424,7 +424,7 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (TREE_CODE (incr) == POSTDECREMENT_EXPR
|| TREE_CODE (incr) == PREDECREMENT_EXPR)
t = fold_build1_loc (elocus, NEGATE_EXPR, sizetype, t);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (decl), decl, t);
+ t = fold_build_pointer_plus (decl, t);
incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
}
break;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index bd2d685f8bc..aeb6625a5ee 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3789,11 +3789,10 @@ build_unary_op (location_t location,
if (val && TREE_CODE (val) == INDIRECT_REF
&& TREE_CONSTANT (TREE_OPERAND (val, 0)))
{
- tree op0 = fold_convert_loc (location, sizetype,
- fold_offsetof (arg, val)), op1;
+ tree op0 = fold_offsetof (arg, val), op1;
op1 = fold_convert_loc (location, argtype, TREE_OPERAND (val, 0));
- ret = fold_build2_loc (location, POINTER_PLUS_EXPR, argtype, op1, op0);
+ ret = fold_build_pointer_plus_loc (location, op1, op0);
goto return_build_unary_op;
}
diff --git a/gcc/calls.c b/gcc/calls.c
index 0cd8cc9dbcb..87a1a70a28d 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1481,7 +1481,7 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals
partial_mode = mode_for_size (units_on_stack * BITS_PER_UNIT,
MODE_INT, 1);
args[i].stack = gen_rtx_MEM (partial_mode, addr);
- set_mem_size (args[i].stack, GEN_INT (units_on_stack));
+ set_mem_size (args[i].stack, units_on_stack);
}
else
{
@@ -1513,7 +1513,7 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals
Generate a simple memory reference of the correct size.
*/
args[i].stack_slot = gen_rtx_MEM (partial_mode, addr);
- set_mem_size (args[i].stack_slot, GEN_INT (units_on_stack));
+ set_mem_size (args[i].stack_slot, units_on_stack);
}
else
{
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 5b1dc2649f1..00d1d5cb7d8 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -549,6 +549,26 @@ dump_bb_info (basic_block bb, bool header, bool footer, int flags,
fputs (", maybe hot", file);
if (cfun && probably_never_executed_bb_p (bb))
fputs (", probably never executed", file);
+ if (bb->flags)
+ {
+ static const char * const bits[] = {
+ "new", "reachable", "irr_loop", "superblock", "disable_sched",
+ "hot_partition", "cold_partition", "duplicated",
+ "non_local_goto_target", "rtl", "forwarder", "nonthreadable",
+ "modified"
+ };
+ unsigned int flags;
+
+ fputs (", flags:", file);
+ for (flags = bb->flags; flags ; flags &= flags - 1)
+ {
+ unsigned i = ctz_hwi (flags);
+ if (i < ARRAY_SIZE (bits))
+ fprintf (file, " %s", bits[i]);
+ else
+ fprintf (file, " <%d>", i);
+ }
+ }
fputs (".\n", file);
fprintf (file, "%sPredecessors: ", prefix);
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index f51e57f5b70..7f72e683482 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -883,7 +883,7 @@ merge_memattrs (rtx x, rtx y)
MEM_ATTRS (x) = 0;
else
{
- rtx mem_size;
+ HOST_WIDE_INT mem_size;
if (MEM_ALIAS_SET (x) != MEM_ALIAS_SET (y))
{
@@ -895,24 +895,28 @@ merge_memattrs (rtx x, rtx y)
{
set_mem_expr (x, 0);
set_mem_expr (y, 0);
- set_mem_offset (x, 0);
- set_mem_offset (y, 0);
+ clear_mem_offset (x);
+ clear_mem_offset (y);
}
- else if (MEM_OFFSET (x) != MEM_OFFSET (y))
+ else if (MEM_OFFSET_KNOWN_P (x) != MEM_OFFSET_KNOWN_P (y)
+ || (MEM_OFFSET_KNOWN_P (x)
+ && MEM_OFFSET (x) != MEM_OFFSET (y)))
{
- set_mem_offset (x, 0);
- set_mem_offset (y, 0);
+ clear_mem_offset (x);
+ clear_mem_offset (y);
}
- if (!MEM_SIZE (x))
- mem_size = NULL_RTX;
- else if (!MEM_SIZE (y))
- mem_size = NULL_RTX;
+ if (MEM_SIZE_KNOWN_P (x) && MEM_SIZE_KNOWN_P (y))
+ {
+ mem_size = MAX (MEM_SIZE (x), MEM_SIZE (y));
+ set_mem_size (x, mem_size);
+ set_mem_size (y, mem_size);
+ }
else
- mem_size = GEN_INT (MAX (INTVAL (MEM_SIZE (x)),
- INTVAL (MEM_SIZE (y))));
- set_mem_size (x, mem_size);
- set_mem_size (y, mem_size);
+ {
+ clear_mem_size (x);
+ clear_mem_size (y);
+ }
set_mem_align (x, MIN (MEM_ALIGN (x), MEM_ALIGN (y)));
set_mem_align (y, MEM_ALIGN (x));
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 7eb4362341b..b8843cae579 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1664,28 +1664,10 @@ print_rtl_with_bb (FILE *outf, const_rtx rtx_first)
for (tmp_rtx = rtx_first; NULL != tmp_rtx; tmp_rtx = NEXT_INSN (tmp_rtx))
{
int did_output;
- if ((bb = start[INSN_UID (tmp_rtx)]) != NULL)
- {
- edge e;
- edge_iterator ei;
- fprintf (outf, ";; Start of basic block (");
- FOR_EACH_EDGE (e, ei, bb->preds)
- fprintf (outf, " %d", e->src->index);
- fprintf (outf, ") -> %d\n", bb->index);
-
- if (df)
- {
- df_dump_top (bb, outf);
- putc ('\n', outf);
- }
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- fputs (";; Pred edge ", outf);
- dump_edge_info (outf, e, 0);
- fputc ('\n', outf);
- }
- }
+ bb = start[INSN_UID (tmp_rtx)];
+ if (bb != NULL)
+ dump_bb_info (bb, true, false, dump_flags, ";; ", outf);
if (in_bb_p[INSN_UID (tmp_rtx)] == NOT_IN_BB
&& !NOTE_P (tmp_rtx)
@@ -1696,29 +1678,9 @@ print_rtl_with_bb (FILE *outf, const_rtx rtx_first)
did_output = print_rtl_single (outf, tmp_rtx);
- if ((bb = end[INSN_UID (tmp_rtx)]) != NULL)
- {
- edge e;
- edge_iterator ei;
-
- fprintf (outf, ";; End of basic block %d -> (", bb->index);
- FOR_EACH_EDGE (e, ei, bb->succs)
- fprintf (outf, " %d", e->dest->index);
- fprintf (outf, ")\n");
-
- if (df)
- {
- df_dump_bottom (bb, outf);
- putc ('\n', outf);
- }
- putc ('\n', outf);
- FOR_EACH_EDGE (e, ei, bb->succs)
- {
- fputs (";; Succ edge ", outf);
- dump_edge_info (outf, e, 1);
- fputc ('\n', outf);
- }
- }
+ bb = end[INSN_UID (tmp_rtx)];
+ if (bb != NULL)
+ dump_bb_info (bb, false, true, dump_flags, ";; ", outf);
if (did_output)
putc ('\n', outf);
}
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 2414d86695f..83ac720c797 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1458,11 +1458,10 @@ thunk_adjust (gimple_stmt_iterator * bsi,
if (this_adjusting
&& fixed_offset != 0)
{
- stmt = gimple_build_assign (ptr,
- fold_build2_loc (input_location,
- POINTER_PLUS_EXPR,
- TREE_TYPE (ptr), ptr,
- size_int (fixed_offset)));
+ stmt = gimple_build_assign
+ (ptr, fold_build_pointer_plus_hwi_loc (input_location,
+ ptr,
+ fixed_offset));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
}
@@ -1508,12 +1507,9 @@ thunk_adjust (gimple_stmt_iterator * bsi,
/* Find the entry with the vcall offset. */
stmt = gimple_build_assign (vtabletmp2,
- fold_build2_loc (input_location,
- POINTER_PLUS_EXPR,
- TREE_TYPE (vtabletmp2),
- vtabletmp2,
- fold_convert (sizetype,
- virtual_offset)));
+ fold_build_pointer_plus_loc (input_location,
+ vtabletmp2,
+ virtual_offset));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
/* Get the offset itself. */
@@ -1533,9 +1529,7 @@ thunk_adjust (gimple_stmt_iterator * bsi,
find_referenced_vars_in (stmt);
/* Adjust the `this' pointer. */
- ptr = fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
- offsettmp);
+ ptr = fold_build_pointer_plus_loc (input_location, ptr, offsettmp);
}
if (!this_adjusting
@@ -1554,9 +1548,8 @@ thunk_adjust (gimple_stmt_iterator * bsi,
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
}
- ptr = fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, TREE_TYPE (ptrtmp), ptrtmp,
- size_int (fixed_offset));
+ ptr = fold_build_pointer_plus_hwi_loc (input_location,
+ ptrtmp, fixed_offset);
}
/* Emit the statement and gimplify the adjustment expression. */
diff --git a/gcc/cif-code.def b/gcc/cif-code.def
index d10efdfeb98..f2d3551c378 100644
--- a/gcc/cif-code.def
+++ b/gcc/cif-code.def
@@ -1,7 +1,7 @@
/* This file contains the definitions of the cgraph_inline_failed_t
enums used in GCC.
- Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010, 2011 Free Software Foundation, Inc.
Contributed by Doug Kwan <dougkwan@google.com>
This file is part of GCC.
@@ -35,19 +35,22 @@ DEFCIFCODE(UNSPECIFIED , "")
/* Function has not be considered for inlining. This is the code for
functions that have not been rejected for inlining yet. */
-DEFCIFCODE(FUNCTION_NOT_CONSIDERED,
- N_("function not considered for inlining"))
+DEFCIFCODE(FUNCTION_NOT_CONSIDERED, N_("function not considered for inlining"))
/* Inlining failed owing to unavailable function body. */
DEFCIFCODE(BODY_NOT_AVAILABLE, N_("function body not available"))
+/* Extern inline function that has been redefined. */
DEFCIFCODE(REDEFINED_EXTERN_INLINE,
- N_("redefined extern inline functions are not considered for "
- "inlining"))
+ N_("redefined extern inline functions are not considered for "
+ "inlining"))
/* Function is not inlinable. */
DEFCIFCODE(FUNCTION_NOT_INLINABLE, N_("function not inlinable"))
+/* Function is not overwritable. */
+DEFCIFCODE(OVERWRITABLE, N_("function body can be overwritten at link time"))
+
/* Function is not an inlining candidate. */
DEFCIFCODE(FUNCTION_NOT_INLINE_CANDIDATE, N_("function not inline candidate"))
@@ -69,7 +72,7 @@ DEFCIFCODE(RECURSIVE_INLINING, N_("recursive inlining"))
/* Call is unlikely. */
DEFCIFCODE(UNLIKELY_CALL, N_("call is unlikely and code size would grow"))
-/* Function is not declared as an inline. */
+/* Function is not declared as inline. */
DEFCIFCODE(NOT_DECLARED_INLINED,
N_("function not declared inline and code size would grow"))
@@ -77,10 +80,7 @@ DEFCIFCODE(NOT_DECLARED_INLINED,
DEFCIFCODE(OPTIMIZING_FOR_SIZE,
N_("optimizing for size and code size would grow"))
-/* Inlining failed because of mismatched options or arguments. */
-DEFCIFCODE(TARGET_OPTION_MISMATCH, N_("target specific option mismatch"))
-DEFCIFCODE(TARGET_OPTIMIZATION_MISMATCH,
- N_("optimization level attribute mismatch"))
+/* Caller and callee disagree on the arguments. */
DEFCIFCODE(MISMATCHED_ARGUMENTS, N_("mismatched arguments"))
/* Call was originally indirect. */
@@ -92,17 +92,14 @@ DEFCIFCODE(INDIRECT_UNKNOWN_CALL,
N_("indirect function call with a yet undetermined callee"))
/* We can't inline different EH personalities together. */
-DEFCIFCODE(EH_PERSONALITY,
- N_("excepion handling personality mismatch"))
+DEFCIFCODE(EH_PERSONALITY, N_("exception handling personality mismatch"))
-/* Don't inline if the callee can throw non-call exceptions but the
+/* We can't inline if the callee can throw non-call exceptions but the
caller cannot. */
-DEFCIFCODE(NON_CALL_EXCEPTIONS,
- N_("excepion handling personality mismatch"))
+DEFCIFCODE(NON_CALL_EXCEPTIONS, N_("non-call exception handling mismatch"))
-/* Don't inline if the callee can throw non-call exceptions but the
- caller cannot. */
-DEFCIFCODE(OPTIMIZATION_MISMATCH,
- N_("optimization mode mismatch"))
+/* We can't inline because of mismatched target specific options. */
+DEFCIFCODE(TARGET_OPTION_MISMATCH, N_("target specific option mismatch"))
-DEFCIFCODE(OVERWRITABLE, N_("function body can be overwriten at linktime"))
+/* We can't inline because of mismatched optimization levels. */
+DEFCIFCODE(OPTIMIZATION_MISMATCH, N_("optimization level attribute mismatch"))
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 0ca4f788e9d..4a16ff836be 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -762,13 +762,14 @@ alpha*-*-linux*)
extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee alpha/t-linux"
+ extra_parts="${extra_parts} crtfastmath.o"
;;
alpha*-*-freebsd*)
tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtfastmath.o"
;;
alpha*-*-netbsd*)
tm_file="${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
@@ -1309,9 +1310,6 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
esac
else
tm_file="${tm_file} i386/gnu-user.h i386/linux.h"
- # This is a hack to avoid a configuration mismatch
- # until the toplevel libgcc move is complete.
- extra_parts="${extra_parts} crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
fi
;;
i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} i386/gnu-user.h knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
@@ -1320,6 +1318,9 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
i[34567]86-*-gnu*) tm_file="$tm_file i386/gnu-user.h gnu.h i386/gnu.h";;
esac
tmake_file="${tmake_file} i386/t-crtstuff"
+ # This is a hack to avoid a configuration mismatch
+ # until the toplevel libgcc move is complete.
+ extra_parts="${extra_parts} crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
@@ -1368,25 +1369,6 @@ i[34567]86-*-lynxos*)
gnu_ld=yes
gas=yes
;;
-i[3456x]86-*-netware*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h tm-dwarf2.h i386/netware.h"
- tmake_file="${tmake_file} i386/t-netware"
- extra_objs=netware.o
- extra_options="${extra_options} i386/netware.opt"
- case /${with_ld} in
- */nwld)
- extra_objs="$extra_objs nwld.o"
- tm_file="${tm_file} i386/nwld.h"
- tmake_file="${tmake_file} i386/t-nwld t-slibgcc-dummy"
- ;;
- esac
- case x${enable_threads} in
- x | xyes | xposix) thread_file='posix';;
- xnks) thread_file='nks';;
- xno) ;;
- *) echo 'Unknown thread configuration for NetWare' >&2; exit 1;;
- esac
- ;;
i[34567]86-*-nto-qnx*)
tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
extra_options="${extra_options} i386/nto.opt"
@@ -1599,13 +1581,13 @@ ia64*-*-elf*)
then
target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
fi
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
;;
ia64*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
tmake_file="${tmake_file} ia64/t-ia64"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
;;
ia64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
@@ -1614,7 +1596,7 @@ ia64*-*-linux*)
tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
fi
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
;;
ia64*-*-hpux*)
tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
@@ -1838,7 +1820,7 @@ mips*-*-netbsd*) # NetBSD/mips, either endian.
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
mips64*-*-linux* | mipsisa64*-*-linux*)
- tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h mips/linux64.h"
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h"
tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
case ${target} in
@@ -1854,15 +1836,16 @@ mips64*-*-linux* | mipsisa64*-*-linux*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
;;
esac
+ extra_parts="$extra_parts crtfastmath.o"
gnu_ld=yes
gas=yes
test x$with_llsc != x || with_llsc=yes
;;
mips*-*-linux*) # Linux MIPS, either endian.
- tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h"
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
tmake_file="${tmake_file} mips/t-libgcc-mips16"
if test x$enable_targets = xall; then
- tm_file="${tm_file} mips/linux64.h"
+ tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
tmake_file="${tmake_file} mips/t-linux64"
tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
fi
@@ -1873,6 +1856,7 @@ mips*-*-linux*) # Linux MIPS, either endian.
mipsisa32*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
esac
+ extra_parts="$extra_parts crtfastmath.o"
test x$with_llsc != x || with_llsc=yes
;;
mips*-*-openbsd*)
@@ -2498,6 +2482,7 @@ sparc-*-linux*)
else
tm_file="${tm_file} sparc/linux.h"
fi
+ extra_parts="${extra_parts} crtfastmath.o"
;;
sparc-*-netbsdelf*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
@@ -2533,6 +2518,7 @@ sparc64-*-linux*)
tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/linux64.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64"
+ extra_parts="${extra_parts} crtfastmath.o"
;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*)
tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
@@ -2542,6 +2528,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
x) with_cpu=ultrasparc ;;
*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
esac
+ extra_parts="${extra_parts} crtfastmath.o"
;;
sparc64-*-netbsd*)
tm_file="sparc/biarch64.h ${tm_file}"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 962f0203a9a..3d32de32e43 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5990,8 +5990,7 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
if (TARGET_ABI_OPEN_VMS)
{
t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
- size_int (offset + NUM_ARGS * UNITS_PER_WORD));
+ t = fold_build_pointer_plus_hwi (t, offset + NUM_ARGS * UNITS_PER_WORD);
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6007,8 +6006,7 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
valist, offset_field, NULL_TREE);
t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
- size_int (offset));
+ t = fold_build_pointer_plus_hwi (t, offset);
t = build2 (MODIFY_EXPR, TREE_TYPE (base_field), base_field, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6069,8 +6067,7 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset,
}
/* Build the final address and force that value into a temporary. */
- addr = build2 (POINTER_PLUS_EXPR, ptr_type, fold_convert (ptr_type, base),
- fold_convert (sizetype, addend));
+ addr = fold_build_pointer_plus (fold_convert (ptr_type, base), addend);
internal_post = NULL;
gimplify_expr (&addr, pre_p, &internal_post, is_gimple_val, fb_rvalue);
gimple_seq_add_seq (pre_p, internal_post);
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index cc16cfa974e..07ffa9fe8b1 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -549,12 +549,6 @@ enum reg_class {
: GET_MODE_SIZE (MODE) >= 4 ? (MODE) \
: mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0))
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Return the class of registers that cannot change mode from FROM to TO. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d9763d23509..6e2b799fe57 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3172,6 +3172,19 @@ arm_canonicalize_comparison (enum rtx_code code, rtx *op0, rtx *op1)
return code;
}
+ /* If *op0 is (zero_extend:SI (subreg:QI (reg:SI) 0)) and comparing
+ with const0_rtx, change it to (and:SI (reg:SI) (const_int 255)),
+ to facilitate possible combining with a cmp into 'ands'. */
+ if (mode == SImode
+ && GET_CODE (*op0) == ZERO_EXTEND
+ && GET_CODE (XEXP (*op0, 0)) == SUBREG
+ && GET_MODE (XEXP (*op0, 0)) == QImode
+ && GET_MODE (SUBREG_REG (XEXP (*op0, 0))) == SImode
+ && subreg_lowpart_p (XEXP (*op0, 0))
+ && *op1 == const0_rtx)
+ *op0 = gen_rtx_AND (SImode, SUBREG_REG (XEXP (*op0, 0)),
+ GEN_INT (255));
+
/* Comparisons smaller than DImode. Only adjust comparisons against
an out-of-range constant. */
if (GET_CODE (*op1) != CONST_INT
@@ -16713,7 +16726,7 @@ arm_print_operand (FILE *stream, rtx x, int code)
instruction (for some alignments) as an aid to the memory subsystem
of the target. */
align = MEM_ALIGN (x) >> 3;
- memsize = INTVAL (MEM_SIZE (x));
+ memsize = MEM_SIZE (x);
/* Only certain alignment specifiers are supported by the hardware. */
if (memsize == 16 && (align % 32) == 0)
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index 718aa420c74..9b95caa0111 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -110,10 +110,6 @@ extern void out_shift_with_cnt (const char *templ, rtx insn,
extern rtx avr_incoming_return_addr_rtx (void);
#endif /* RTX_CODE */
-#ifdef HAVE_MACHINE_MODES
-extern int class_max_nregs (enum reg_class rclass, enum machine_mode mode);
-#endif /* HAVE_MACHINE_MODES */
-
#ifdef REAL_VALUE_TYPE
extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
#endif
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 209a5b92a04..4951f56e092 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -1491,15 +1491,6 @@ notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
}
}
-/* Return maximum number of consecutive registers of
- class CLASS needed to hold a value of mode MODE. */
-
-int
-class_max_nregs (enum reg_class rclass ATTRIBUTE_UNUSED,enum machine_mode mode)
-{
- return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
-}
-
/* Choose mode for jump insn:
1 - relative jump in range -63 <= x <= 62 ;
2 - relative jump in range -2046 <= x <= 2045 ;
@@ -1638,12 +1629,18 @@ byte_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
void
final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
- int num_operands ATTRIBUTE_UNUSED)
+ int num_operands ATTRIBUTE_UNUSED)
{
if (TARGET_ALL_DEBUG)
{
- fprintf (asm_out_file, "/* DEBUG: cost = %d. */\n",
- rtx_cost (PATTERN (insn), INSN, !optimize_size));
+ rtx set = single_set (insn);
+
+ if (set)
+ fprintf (asm_out_file, "/* DEBUG: cost = %d. */\n",
+ rtx_cost (SET_SRC (set), SET, optimize_insn_for_speed_p()));
+ else
+ fprintf (asm_out_file, "/* DEBUG: pattern-cost = %d. */\n",
+ rtx_cost (PATTERN (insn), INSN, optimize_insn_for_speed_p()));
}
}
@@ -5341,14 +5338,14 @@ avr_rtx_costs (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED, int *total,
{
case CONST_INT:
case CONST_DOUBLE:
+ case SYMBOL_REF:
+ case CONST:
+ case LABEL_REF:
/* Immediate constants are as cheap as registers. */
*total = 0;
return true;
case MEM:
- case CONST:
- case LABEL_REF:
- case SYMBOL_REF:
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
return true;
@@ -5473,7 +5470,42 @@ avr_rtx_costs (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED, int *total,
case HImode:
if (AVR_HAVE_MUL)
- *total = COSTS_N_INSNS (!speed ? 7 : 10);
+ {
+ rtx op0 = XEXP (x, 0);
+ rtx op1 = XEXP (x, 1);
+ enum rtx_code code0 = GET_CODE (op0);
+ enum rtx_code code1 = GET_CODE (op1);
+ bool ex0 = SIGN_EXTEND == code0 || ZERO_EXTEND == code0;
+ bool ex1 = SIGN_EXTEND == code1 || ZERO_EXTEND == code1;
+
+ if (ex0
+ && (u8_operand (op1, HImode)
+ || s8_operand (op1, HImode)))
+ {
+ *total = COSTS_N_INSNS (!speed ? 4 : 6);
+ return true;
+ }
+ if (ex0
+ && register_operand (op1, HImode))
+ {
+ *total = COSTS_N_INSNS (!speed ? 5 : 8);
+ return true;
+ }
+ else if (ex0 || ex1)
+ {
+ *total = COSTS_N_INSNS (!speed ? 3 : 5);
+ return true;
+ }
+ else if (register_operand (op0, HImode)
+ && (u8_operand (op1, HImode)
+ || s8_operand (op1, HImode)))
+ {
+ *total = COSTS_N_INSNS (!speed ? 6 : 9);
+ return true;
+ }
+ else
+ *total = COSTS_N_INSNS (!speed ? 7 : 10);
+ }
else if (!speed)
*total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 2 : 1);
else
@@ -5556,6 +5588,17 @@ avr_rtx_costs (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED, int *total,
break;
case HImode:
+ if (AVR_HAVE_MUL)
+ {
+ if (const_2_to_7_operand (XEXP (x, 1), HImode)
+ && (SIGN_EXTEND == GET_CODE (XEXP (x, 0))
+ || ZERO_EXTEND == GET_CODE (XEXP (x, 0))))
+ {
+ *total = COSTS_N_INSNS (!speed ? 4 : 6);
+ return true;
+ }
+ }
+
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
{
*total = COSTS_N_INSNS (!speed ? 5 : 41);
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 9b27f703807..ddd30d6ee3a 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -312,8 +312,6 @@ enum reg_class {
#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
-#define CLASS_MAX_NREGS(CLASS, MODE) class_max_nregs (CLASS, MODE)
-
#define STACK_PUSH_CODE POST_DEC
#define STACK_GROWS_DOWNWARD
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index bbfcb10ffc0..250133e5ebb 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -1017,19 +1017,301 @@
[(set_attr "length" "3")
(set_attr "cc" "clobber")])
+(define_insn "usmulqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (sign_extend:HI (match_operand:QI 2 "register_operand" "a"))))]
+ "AVR_HAVE_MUL"
+ "mulsu %2,%1
+ movw %0,r0
+ clr __zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "clobber")])
+
+;; Above insn is not canonicalized by insn combine, so here is a version with
+;; operands swapped.
+
+(define_insn "*sumulqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (zero_extend:HI (match_operand:QI 2 "register_operand" "a"))))]
+ "AVR_HAVE_MUL"
+ "mulsu %1,%2
+ movw %0,r0
+ clr __zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "clobber")])
+
+;; One-extend operand 1
+
+(define_insn "*osmulqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=&r")
+ (mult:HI (not:HI (zero_extend:HI (not:QI (match_operand:QI 1 "register_operand" "a"))))
+ (sign_extend:HI (match_operand:QI 2 "register_operand" "a"))))]
+ "AVR_HAVE_MUL"
+ "mulsu %2,%1
+ movw %0,r0
+ sub %B0,%2
+ clr __zero_reg__"
+ [(set_attr "length" "4")
+ (set_attr "cc" "clobber")])
+
+(define_insn "*oumulqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=&r")
+ (mult:HI (not:HI (zero_extend:HI (not:QI (match_operand:QI 1 "register_operand" "r"))))
+ (zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))]
+ "AVR_HAVE_MUL"
+ "mul %2,%1
+ movw %0,r0
+ sub %B0,%2
+ clr __zero_reg__"
+ [(set_attr "length" "4")
+ (set_attr "cc" "clobber")])
+
+
+;******************************************************************************
+; mul HI: $1 = sign/zero-extend, $2 = small constant
+;******************************************************************************
+
+(define_insn_and_split "*muluqihi3.uconst"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r"))
+ (match_operand:HI 2 "u8_operand" "M")))
+ (clobber (match_scratch:QI 3 "=&d"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; umulqihi3
+ (set (match_dup 0)
+ (mult:HI (zero_extend:HI (match_dup 1))
+ (zero_extend:HI (match_dup 3))))]
+ {
+ operands[2] = gen_int_mode (INTVAL (operands[2]), QImode);
+ })
+
+(define_insn_and_split "*muluqihi3.sconst"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (match_operand:HI 2 "s8_operand" "n")))
+ (clobber (match_scratch:QI 3 "=&a"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; usmulqihi3
+ (set (match_dup 0)
+ (mult:HI (zero_extend:HI (match_dup 1))
+ (sign_extend:HI (match_dup 3))))]
+ {
+ operands[2] = gen_int_mode (INTVAL (operands[2]), QImode);
+ })
+
+(define_insn_and_split "*mulsqihi3.sconst"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "d"))
+ (match_operand:HI 2 "s8_operand" "n")))
+ (clobber (match_scratch:QI 3 "=&d"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; mulqihi3
+ (set (match_dup 0)
+ (mult:HI (sign_extend:HI (match_dup 1))
+ (sign_extend:HI (match_dup 3))))]
+ {
+ operands[2] = gen_int_mode (INTVAL (operands[2]), QImode);
+ })
+
+(define_insn_and_split "*mulsqihi3.uconst"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (match_operand:HI 2 "u8_operand" "M")))
+ (clobber (match_scratch:QI 3 "=&a"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; usmulqihi3
+ (set (match_dup 0)
+ (mult:HI (zero_extend:HI (match_dup 3))
+ (sign_extend:HI (match_dup 1))))]
+ {
+ operands[2] = gen_int_mode (INTVAL (operands[2]), QImode);
+ })
+
+(define_insn_and_split "*mulsqihi3.oconst"
+ [(set (match_operand:HI 0 "register_operand" "=&r")
+ (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (match_operand:HI 2 "o8_operand" "n")))
+ (clobber (match_scratch:QI 3 "=&a"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; *osmulqihi3
+ (set (match_dup 0)
+ (mult:HI (not:HI (zero_extend:HI (not:QI (match_dup 3))))
+ (sign_extend:HI (match_dup 1))))]
+ {
+ operands[2] = gen_int_mode (INTVAL (operands[2]), QImode);
+ })
+
+;; The EXTEND of $1 only appears in combine, we don't see it in expand so that
+;; expand decides to use ASHIFT instead of MUL because ASHIFT costs are cheaper
+;; at that time. Fix that.
+
+(define_insn_and_split "*ashifthi3.signx.const"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (ashift:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "d"))
+ (match_operand:HI 2 "const_2_to_6_operand" "I")))
+ (clobber (match_scratch:QI 3 "=&d"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; mulqihi3
+ (set (match_dup 0)
+ (mult:HI (sign_extend:HI (match_dup 1))
+ (sign_extend:HI (match_dup 3))))]
+ {
+ operands[2] = GEN_INT (1 << INTVAL (operands[2]));
+ })
+
+(define_insn_and_split "*ashifthi3.signx.const7"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (ashift:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (const_int 7)))
+ (clobber (match_scratch:QI 2 "=&a"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 2)
+ (match_dup 3))
+ ; usmulqihi3
+ (set (match_dup 0)
+ (mult:HI (zero_extend:HI (match_dup 2))
+ (sign_extend:HI (match_dup 1))))]
+ {
+ operands[3] = gen_int_mode (1 << 7, QImode);
+ })
+
+(define_insn_and_split "*ashifthi3.zerox.const"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (ashift:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r"))
+ (match_operand:HI 2 "const_2_to_7_operand" "I")))
+ (clobber (match_scratch:QI 3 "=&d"))]
+ "AVR_HAVE_MUL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3)
+ (match_dup 2))
+ ; umulqihi3
+ (set (match_dup 0)
+ (mult:HI (zero_extend:HI (match_dup 1))
+ (zero_extend:HI (match_dup 3))))]
+ {
+ operands[2] = gen_int_mode (1 << INTVAL (operands[2]), QImode);
+ })
+
+;******************************************************************************
+; mul HI: $1 = sign-/zero-/one-extend, $2 = reg
+;******************************************************************************
+
+(define_insn "mulsqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=&r")
+ (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "a"))
+ (match_operand:HI 2 "register_operand" "a")))]
+ "AVR_HAVE_MUL"
+ "mulsu %1,%A2
+ movw %0,r0
+ mul %1,%B2
+ add %B0,r0
+ clr __zero_reg__"
+ [(set_attr "length" "5")
+ (set_attr "cc" "clobber")])
+
+(define_insn "muluqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=&r")
+ (mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r"))
+ (match_operand:HI 2 "register_operand" "r")))]
+ "AVR_HAVE_MUL"
+ "mul %1,%A2
+ movw %0,r0
+ mul %1,%B2
+ add %B0,r0
+ clr __zero_reg__"
+ [(set_attr "length" "5")
+ (set_attr "cc" "clobber")])
+
+;; one-extend operand 1
+
+(define_insn "muloqihi3"
+ [(set (match_operand:HI 0 "register_operand" "=&r")
+ (mult:HI (not:HI (zero_extend:HI (not:QI (match_operand:QI 1 "register_operand" "r"))))
+ (match_operand:HI 2 "register_operand" "r")))]
+ "AVR_HAVE_MUL"
+ "mul %1,%A2
+ movw %0,r0
+ mul %1,%B2
+ add %B0,r0
+ sub %B0,%A2
+ clr __zero_reg__"
+ [(set_attr "length" "6")
+ (set_attr "cc" "clobber")])
+
+;******************************************************************************
+
(define_expand "mulhi3"
[(set (match_operand:HI 0 "register_operand" "")
- (mult:HI (match_operand:HI 1 "register_operand" "")
- (match_operand:HI 2 "register_operand" "")))]
+ (mult:HI (match_operand:HI 1 "register_operand" "")
+ (match_operand:HI 2 "register_or_s9_operand" "")))]
""
- "
-{
- if (!AVR_HAVE_MUL)
- {
- emit_insn (gen_mulhi3_call (operands[0], operands[1], operands[2]));
- DONE;
- }
-}")
+ {
+ if (!AVR_HAVE_MUL)
+ {
+ if (!register_operand (operands[2], HImode))
+ operands[2] = force_reg (HImode, operands[2]);
+
+ emit_insn (gen_mulhi3_call (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+
+ /* For small constants we can do better by extending them on the fly.
+ The constant can be loaded in one instruction and the widening
+ multiplication is shorter. First try the unsigned variant because it
+ allows constraint "d" instead of "a" for the signed version. */
+
+ if (s9_operand (operands[2], HImode))
+ {
+ rtx reg = force_reg (QImode, gen_int_mode (INTVAL (operands[2]), QImode));
+
+ if (u8_operand (operands[2], HImode))
+ {
+ emit_insn (gen_muluqihi3 (operands[0], reg, operands[1]));
+ }
+ else if (s8_operand (operands[2], HImode))
+ {
+ emit_insn (gen_mulsqihi3 (operands[0], reg, operands[1]));
+ }
+ else
+ {
+ emit_insn (gen_muloqihi3 (operands[0], reg, operands[1]));
+ }
+
+ DONE;
+ }
+
+ if (!register_operand (operands[2], HImode))
+ operands[2] = force_reg (HImode, operands[2]);
+ })
(define_insn "*mulhi3_enh"
[(set (match_operand:HI 0 "register_operand" "=&r")
diff --git a/gcc/config/avr/predicates.md b/gcc/config/avr/predicates.md
index 056a1650b79..6646cb54610 100755
--- a/gcc/config/avr/predicates.md
+++ b/gcc/config/avr/predicates.md
@@ -73,6 +73,16 @@
(and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), 0, 7)")))
+;; Return 1 if OP is constant integer 2..7 for MODE.
+(define_predicate "const_2_to_7_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 2, 7)")))
+
+;; Return 1 if OP is constant integer 2..6 for MODE.
+(define_predicate "const_2_to_6_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 2, 6)")))
+
;; Returns true if OP is either the constant zero or a register.
(define_predicate "reg_or_0_operand"
(ior (match_operand 0 "register_operand")
@@ -156,3 +166,26 @@
(and (match_code "const_int")
(match_test "8 == INTVAL(op) || 16 == INTVAL(op) || 24 == INTVAL(op)")))
+;; Unsigned CONST_INT that fits in 8 bits, i.e. 0..255.
+(define_predicate "u8_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 0, 255)")))
+
+;; Signed CONST_INT that fits in 8 bits, i.e. -128..127.
+(define_predicate "s8_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), -128, 127)")))
+
+;; One-extended CONST_INT that fits in 8 bits, i.e. -256..-1.
+(define_predicate "o8_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), -256, -1)")))
+
+;; Signed CONST_INT that fits in 9 bits, i.e. -256..255.
+(define_predicate "s9_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), -256, 255)")))
+
+(define_predicate "register_or_s9_operand"
+ (ior (match_operand 0 "register_operand")
+ (match_operand 0 "s9_operand")))
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index cbd04f1c6ff..01ed8e769e7 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -6818,6 +6818,13 @@ frv_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
case QUAD_REGS:
case GPR_REGS:
+ case GR8_REGS:
+ case GR9_REGS:
+ case GR89_REGS:
+ case FDPIC_REGS:
+ case FDPIC_FPTR_REGS:
+ case FDPIC_CALL_REGS:
+
switch (to)
{
default:
@@ -6825,6 +6832,13 @@ frv_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
case QUAD_REGS:
case GPR_REGS:
+ case GR8_REGS:
+ case GR9_REGS:
+ case GR89_REGS:
+ case FDPIC_REGS:
+ case FDPIC_FPTR_REGS:
+ case FDPIC_CALL_REGS:
+
return LOW_COST;
case FPR_REGS:
@@ -6844,6 +6858,13 @@ frv_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
case QUAD_REGS:
case GPR_REGS:
+ case GR8_REGS:
+ case GR9_REGS:
+ case GR89_REGS:
+ case FDPIC_REGS:
+ case FDPIC_FPTR_REGS:
+ case FDPIC_CALL_REGS:
+
case QUAD_ACC_REGS:
case ACCG_REGS:
return MEDIUM_COST;
@@ -6862,6 +6883,13 @@ frv_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
case QUAD_REGS:
case GPR_REGS:
+ case GR8_REGS:
+ case GR9_REGS:
+ case GR89_REGS:
+ case FDPIC_REGS:
+ case FDPIC_FPTR_REGS:
+ case FDPIC_CALL_REGS:
+
return MEDIUM_COST;
}
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index bf87417bc8b..62e9e85895e 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -2642,8 +2642,8 @@ h8sx_emit_movmd (rtx dest, rtx src, rtx length,
first_dest = replace_equiv_address (dest, dest_reg);
first_src = replace_equiv_address (src, src_reg);
- set_mem_size (first_dest, GEN_INT (n & -factor));
- set_mem_size (first_src, GEN_INT (n & -factor));
+ set_mem_size (first_dest, n & -factor);
+ set_mem_size (first_src, n & -factor);
length = copy_to_mode_reg (HImode, gen_int_mode (n / factor, HImode));
emit_insn (gen_movmd (first_dest, first_src, length, GEN_INT (factor)));
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 936aabfa229..82e55f6628b 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -357,14 +357,6 @@ enum reg_class {
#define INDEX_REG_CLASS (TARGET_H8300SX ? GENERAL_REGS : NO_REGS)
#define BASE_REG_CLASS GENERAL_REGS
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-
-/* On the H8, this is the size of MODE in words. */
-
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Stack layout; function entry, exit and calling. */
/* Define this if pushing a word on the stack
diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
index 099c2e15457..8d3e45af600 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -19,7 +19,7 @@
;;; Unused letters:
;;; B H T W
-;;; h jk vw
+;;; h jk v
;; Integer register constraints.
;; It is not necessary to define 'r' here.
@@ -127,6 +127,11 @@
"@internal Constant call address operand."
(match_operand 0 "constant_call_address_operand"))
+(define_constraint "w"
+ "@internal Call memory operand."
+ (and (match_test "!TARGET_X32")
+ (match_operand 0 "memory_operand")))
+
;; Integer constant constraints.
(define_constraint "I"
"Integer constant in the range 0 @dots{} 31, for 32-bit shifts."
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f643efcd58f..da6c888ed46 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -7645,8 +7645,7 @@ ix86_va_start (tree valist, rtx nextarg)
ovf_rtx = cfun->machine->split_stack_varargs_pointer;
t = make_tree (type, ovf_rtx);
if (words != 0)
- t = build2 (POINTER_PLUS_EXPR, type, t,
- size_int (words * UNITS_PER_WORD));
+ t = fold_build_pointer_plus_hwi (t, words * UNITS_PER_WORD);
t = build2 (MODIFY_EXPR, type, ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -7658,8 +7657,7 @@ ix86_va_start (tree valist, rtx nextarg)
type = TREE_TYPE (sav);
t = make_tree (type, frame_pointer_rtx);
if (!ix86_varargs_gpr_size)
- t = build2 (POINTER_PLUS_EXPR, type, t,
- size_int (-8 * X86_64_REGPARM_MAX));
+ t = fold_build_pointer_plus_hwi (t, -8 * X86_64_REGPARM_MAX);
t = build2 (MODIFY_EXPR, type, sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -7815,15 +7813,13 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
if (needed_intregs)
{
/* int_addr = gpr + sav; */
- t = fold_convert (sizetype, gpr);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, t);
+ t = fold_build_pointer_plus (sav, gpr);
gimplify_assign (int_addr, t, pre_p);
}
if (needed_sseregs)
{
/* sse_addr = fpr + sav; */
- t = fold_convert (sizetype, fpr);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, t);
+ t = fold_build_pointer_plus (sav, fpr);
gimplify_assign (sse_addr, t, pre_p);
}
if (need_temp)
@@ -7877,12 +7873,10 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
src_offset = REGNO (reg) * 8;
}
src_addr = fold_convert (addr_type, src_addr);
- src_addr = fold_build2 (POINTER_PLUS_EXPR, addr_type, src_addr,
- size_int (src_offset));
+ src_addr = fold_build_pointer_plus_hwi (src_addr, src_offset);
dest_addr = fold_convert (daddr_type, addr);
- dest_addr = fold_build2 (POINTER_PLUS_EXPR, daddr_type, dest_addr,
- size_int (prev_size));
+ dest_addr = fold_build_pointer_plus_hwi (dest_addr, prev_size);
if (cur_size == GET_MODE_SIZE (mode))
{
src = build_va_arg_indirect_ref (src_addr);
@@ -7937,19 +7931,15 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
else
{
HOST_WIDE_INT align = arg_boundary / 8;
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), ovf,
- size_int (align - 1));
- t = fold_convert (sizetype, t);
+ t = fold_build_pointer_plus_hwi (ovf, align - 1);
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
- size_int (-align));
- t = fold_convert (TREE_TYPE (ovf), t);
+ build_int_cst (TREE_TYPE (t), -align));
}
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
gimplify_assign (addr, t, pre_p);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t,
- size_int (rsize * UNITS_PER_WORD));
+ t = fold_build_pointer_plus_hwi (t, rsize * UNITS_PER_WORD);
gimplify_assign (unshare_expr (ovf), t, pre_p);
if (container)
@@ -11095,8 +11085,16 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
int retval = 1;
enum ix86_address_seg seg = SEG_DEFAULT;
- if (REG_P (addr) || GET_CODE (addr) == SUBREG)
+ if (REG_P (addr))
base = addr;
+ else if (GET_CODE (addr) == SUBREG)
+ {
+ /* Allow only subregs of DImode hard regs. */
+ if (register_no_elim_operand (SUBREG_REG (addr), DImode))
+ base = addr;
+ else
+ return 0;
+ }
else if (GET_CODE (addr) == PLUS)
{
rtx addends[4], op;
@@ -11149,8 +11147,13 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
return 0;
break;
- case REG:
case SUBREG:
+ /* Allow only subregs of DImode hard regs in PLUS chains. */
+ if (!register_no_elim_operand (SUBREG_REG (op), DImode))
+ return 0;
+ /* FALLTHRU */
+
+ case REG:
if (!base)
base = op;
else if (!index)
@@ -11194,6 +11197,18 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
else
disp = addr; /* displacement */
+ if (index)
+ {
+ if (REG_P (index))
+ ;
+ /* Allow only subregs of DImode hard regs. */
+ else if (GET_CODE (index) == SUBREG
+ && register_no_elim_operand (SUBREG_REG (index), DImode))
+ ;
+ else
+ return 0;
+ }
+
/* Extract the integral value of scale. */
if (scale_rtx)
{
@@ -11627,29 +11642,23 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
disp = parts.disp;
scale = parts.scale;
- /* Validate base register.
-
- Don't allow SUBREG's that span more than a word here. It can lead to spill
- failures when the base is one word out of a two word structure, which is
- represented internally as a DImode int. */
-
+ /* Validate base register. */
if (base)
{
rtx reg;
if (REG_P (base))
reg = base;
- else if (GET_CODE (base) == SUBREG
- && REG_P (SUBREG_REG (base))
- && GET_MODE_SIZE (GET_MODE (SUBREG_REG (base)))
- <= UNITS_PER_WORD)
- reg = SUBREG_REG (base);
+ else if (GET_CODE (base) == SUBREG && REG_P (SUBREG_REG (base)))
+ {
+ reg = SUBREG_REG (base);
+ gcc_assert (register_no_elim_operand (reg, DImode));
+ }
else
/* Base is not a register. */
return false;
- if (GET_MODE (base) != Pmode)
- /* Base is not in Pmode. */
+ if (GET_MODE (base) != SImode && GET_MODE (base) != DImode)
return false;
if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
@@ -11658,27 +11667,23 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
return false;
}
- /* Validate index register.
-
- Don't allow SUBREG's that span more than a word here -- same as above. */
-
+ /* Validate index register. */
if (index)
{
rtx reg;
if (REG_P (index))
reg = index;
- else if (GET_CODE (index) == SUBREG
- && REG_P (SUBREG_REG (index))
- && GET_MODE_SIZE (GET_MODE (SUBREG_REG (index)))
- <= UNITS_PER_WORD)
- reg = SUBREG_REG (index);
+ else if (GET_CODE (index) == SUBREG && REG_P (SUBREG_REG (index)))
+ {
+ reg = SUBREG_REG (index);
+ gcc_assert (register_no_elim_operand (reg, DImode));
+ }
else
/* Index is not a register. */
return false;
- if (GET_MODE (index) != Pmode)
- /* Index is not in Pmode. */
+ if (GET_MODE (index) != SImode && GET_MODE (index) != DImode)
return false;
if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg))
@@ -11687,6 +11692,11 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
return false;
}
+ /* Index and base should have the same mode. */
+ if (base && index
+ && GET_MODE (base) != GET_MODE (index))
+ return false;
+
/* Validate scale factor. */
if (scale != 1)
{
@@ -14857,7 +14867,7 @@ ix86_output_addr_vec_elt (FILE *file, int value)
const char *directive = ASM_LONG;
#ifdef ASM_QUAD
- if (TARGET_64BIT)
+ if (TARGET_LP64)
directive = ASM_QUAD;
#else
gcc_assert (!TARGET_64BIT);
@@ -19702,6 +19712,7 @@ expand_movmem_via_rep_mov (rtx destmem, rtx srcmem,
rtx destexp;
rtx srcexp;
rtx countreg;
+ HOST_WIDE_INT rounded_count;
/* If the size is known, it is shorter to use rep movs. */
if (mode == QImode && CONST_INT_P (count)
@@ -19729,19 +19740,19 @@ expand_movmem_via_rep_mov (rtx destmem, rtx srcmem,
}
if (CONST_INT_P (count))
{
- count = GEN_INT (INTVAL (count)
+ rounded_count = (INTVAL (count)
& ~((HOST_WIDE_INT) GET_MODE_SIZE (mode) - 1));
destmem = shallow_copy_rtx (destmem);
srcmem = shallow_copy_rtx (srcmem);
- set_mem_size (destmem, count);
- set_mem_size (srcmem, count);
+ set_mem_size (destmem, rounded_count);
+ set_mem_size (srcmem, rounded_count);
}
else
{
- if (MEM_SIZE (destmem))
- set_mem_size (destmem, NULL_RTX);
- if (MEM_SIZE (srcmem))
- set_mem_size (srcmem, NULL_RTX);
+ if (MEM_SIZE_KNOWN_P (destmem))
+ clear_mem_size (destmem);
+ if (MEM_SIZE_KNOWN_P (srcmem))
+ clear_mem_size (srcmem);
}
emit_insn (gen_rep_mov (destptr, destmem, srcptr, srcmem, countreg,
destexp, srcexp));
@@ -19756,6 +19767,7 @@ expand_setmem_via_rep_stos (rtx destmem, rtx destptr, rtx value,
{
rtx destexp;
rtx countreg;
+ HOST_WIDE_INT rounded_count;
if (destptr != XEXP (destmem, 0) || GET_MODE (destmem) != BLKmode)
destmem = adjust_automodify_address_nv (destmem, BLKmode, destptr, 0);
@@ -19771,13 +19783,13 @@ expand_setmem_via_rep_stos (rtx destmem, rtx destptr, rtx value,
destexp = gen_rtx_PLUS (Pmode, destptr, countreg);
if (orig_value == const0_rtx && CONST_INT_P (count))
{
- count = GEN_INT (INTVAL (count)
+ rounded_count = (INTVAL (count)
& ~((HOST_WIDE_INT) GET_MODE_SIZE (mode) - 1));
destmem = shallow_copy_rtx (destmem);
- set_mem_size (destmem, count);
+ set_mem_size (destmem, rounded_count);
}
- else if (MEM_SIZE (destmem))
- set_mem_size (destmem, NULL_RTX);
+ else if (MEM_SIZE_KNOWN_P (destmem))
+ clear_mem_size (destmem);
emit_insn (gen_rep_stos (destptr, countreg, destmem, value, destexp));
}
@@ -20118,13 +20130,12 @@ expand_constant_movmem_prologue (rtx dst, rtx *srcp, rtx destreg, rtx srcreg,
int desired_align, int align_bytes)
{
rtx src = *srcp;
- rtx src_size, dst_size;
+ rtx orig_dst = dst;
+ rtx orig_src = src;
int off = 0;
int src_align_bytes = get_mem_align_offset (src, desired_align * BITS_PER_UNIT);
if (src_align_bytes >= 0)
src_align_bytes = desired_align - src_align_bytes;
- src_size = MEM_SIZE (src);
- dst_size = MEM_SIZE (dst);
if (align_bytes & 1)
{
dst = adjust_automodify_address_nv (dst, QImode, destreg, 0);
@@ -20182,10 +20193,10 @@ expand_constant_movmem_prologue (rtx dst, rtx *srcp, rtx destreg, rtx srcreg,
if (MEM_ALIGN (src) < src_align * BITS_PER_UNIT)
set_mem_align (src, src_align * BITS_PER_UNIT);
}
- if (dst_size)
- set_mem_size (dst, GEN_INT (INTVAL (dst_size) - align_bytes));
- if (src_size)
- set_mem_size (dst, GEN_INT (INTVAL (src_size) - align_bytes));
+ if (MEM_SIZE_KNOWN_P (orig_dst))
+ set_mem_size (dst, MEM_SIZE (orig_dst) - align_bytes);
+ if (MEM_SIZE_KNOWN_P (orig_src))
+ set_mem_size (src, MEM_SIZE (orig_src) - align_bytes);
*srcp = src;
return dst;
}
@@ -20233,7 +20244,7 @@ expand_constant_setmem_prologue (rtx dst, rtx destreg, rtx value,
int desired_align, int align_bytes)
{
int off = 0;
- rtx dst_size = MEM_SIZE (dst);
+ rtx orig_dst = dst;
if (align_bytes & 1)
{
dst = adjust_automodify_address_nv (dst, QImode, destreg, 0);
@@ -20262,8 +20273,8 @@ expand_constant_setmem_prologue (rtx dst, rtx destreg, rtx value,
dst = adjust_automodify_address_nv (dst, BLKmode, destreg, off);
if (MEM_ALIGN (dst) < (unsigned int) desired_align * BITS_PER_UNIT)
set_mem_align (dst, desired_align * BITS_PER_UNIT);
- if (dst_size)
- set_mem_size (dst, GEN_INT (INTVAL (dst_size) - align_bytes));
+ if (MEM_SIZE_KNOWN_P (orig_dst))
+ set_mem_size (dst, MEM_SIZE (orig_dst) - align_bytes);
return dst;
}
@@ -28267,6 +28278,32 @@ ix86_secondary_memory_needed (enum reg_class class1, enum reg_class class2,
return inline_secondary_memory_needed (class1, class2, mode, strict);
}
+/* Implement the TARGET_CLASS_MAX_NREGS hook.
+
+ On the 80386, this is the size of MODE in words,
+ except in the FP regs, where a single reg is always enough. */
+
+static unsigned char
+ix86_class_max_nregs (reg_class_t rclass, enum machine_mode mode)
+{
+ if (MAYBE_INTEGER_CLASS_P (rclass))
+ {
+ if (mode == XFmode)
+ return (TARGET_64BIT ? 2 : 3);
+ else if (mode == XCmode)
+ return (TARGET_64BIT ? 4 : 6);
+ else
+ return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
+ }
+ else
+ {
+ if (COMPLEX_MODE_P (mode))
+ return 2;
+ else
+ return 1;
+ }
+}
+
/* Return true if the registers in CLASS cannot represent the change from
modes FROM to TO. */
@@ -28463,7 +28500,8 @@ ix86_register_move_cost (enum machine_mode mode, reg_class_t class1_i,
/* In case of copying from general_purpose_register we may emit multiple
stores followed by single load causing memory size mismatch stall.
Count this as arbitrarily high cost of 20. */
- if (CLASS_MAX_NREGS (class1, mode) > CLASS_MAX_NREGS (class2, mode))
+ if (targetm.class_max_nregs (class1, mode)
+ > targetm.class_max_nregs (class2, mode))
cost += 20;
/* In the case of FP/MMX moves, the registers actually overlap, and we
@@ -31431,8 +31469,7 @@ ix86_md_asm_clobbers (tree outputs ATTRIBUTE_UNUSED,
return clobbers;
}
-/* Implements target vector targetm.asm.encode_section_info. This
- is not used by netware. */
+/* Implements target vector targetm.asm.encode_section_info. */
static void ATTRIBUTE_UNUSED
ix86_encode_section_info (tree decl, rtx rtl, int first)
@@ -34936,6 +34973,9 @@ ix86_autovectorize_vector_sizes (void)
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD ix86_secondary_reload
+#undef TARGET_CLASS_MAX_NREGS
+#define TARGET_CLASS_MAX_NREGS ix86_class_max_nregs
+
#undef TARGET_PREFERRED_RELOAD_CLASS
#define TARGET_PREFERRED_RELOAD_CLASS ix86_preferred_reload_class
#undef TARGET_PREFERRED_OUTPUT_RELOAD_CLASS
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index f532bad486b..20c9a8fba9a 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1131,7 +1131,6 @@ enum target_cpu_default
/* This is overridden by <cygwin.h>. */
#define MS_AGGREGATE_RETURN 0
-/* This is overridden by <netware.h>. */
#define KEEP_AGGREGATE_RETURN_POINTER 0
/* Define the classes of registers for register constraints in the
@@ -1358,19 +1357,6 @@ enum reg_class
? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \
: MODE)
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-/* On the 80386, this is the size of MODE in words,
- except in the FP regs, where a single reg is always enough. */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- (MAYBE_INTEGER_CLASS_P (CLASS) \
- ? ((MODE) == XFmode \
- ? (TARGET_64BIT ? 2 : 3) \
- : (MODE) == XCmode \
- ? (TARGET_64BIT ? 4 : 6) \
- : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) \
- : (COMPLEX_MODE_P (MODE) ? 2 : 1))
-
/* Return a class of registers that cannot change FROM mode to TO mode. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
@@ -1688,7 +1674,7 @@ typedef struct ix86_args {
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE \
- (!TARGET_64BIT || (flag_pic && ix86_cmodel != CM_LARGE_PIC) ? SImode : DImode)
+ (!TARGET_LP64 || (flag_pic && ix86_cmodel != CM_LARGE_PIC) ? SImode : DImode)
/* Define this as 1 if `char' should by default be signed; else as 0. */
#define DEFAULT_SIGNED_CHAR 1
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index cf0fdf4fa21..b704fa7310e 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -10963,17 +10963,17 @@
(set_attr "modrm" "0")])
(define_expand "indirect_jump"
- [(set (pc) (match_operand 0 "nonimmediate_operand" ""))])
+ [(set (pc) (match_operand 0 "indirect_branch_operand" ""))])
(define_insn "*indirect_jump"
- [(set (pc) (match_operand:P 0 "nonimmediate_operand" "rm"))]
+ [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))]
""
"jmp\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
(define_expand "tablejump"
- [(parallel [(set (pc) (match_operand 0 "nonimmediate_operand" ""))
+ [(parallel [(set (pc) (match_operand 0 "indirect_branch_operand" ""))
(use (label_ref (match_operand 1 "" "")))])]
""
{
@@ -11008,10 +11008,12 @@
operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0,
OPTAB_DIRECT);
}
+ else if (TARGET_X32)
+ operands[0] = convert_memory_address (Pmode, operands[0]);
})
(define_insn "*tablejump_1"
- [(set (pc) (match_operand:P 0 "nonimmediate_operand" "rm"))
+ [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))
(use (label_ref (match_operand 1 "" "")))]
""
"jmp\t%A0"
@@ -11099,7 +11101,7 @@
})
(define_insn_and_split "*call_vzeroupper"
- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zm"))
+ [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw"))
(match_operand 1 "" ""))
(unspec [(match_operand 2 "const_int_operand" "")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
@@ -11111,7 +11113,7 @@
[(set_attr "type" "call")])
(define_insn "*call"
- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zm"))
+ [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw"))
(match_operand 1 "" ""))]
"!SIBLING_CALL_P (insn)"
"* return ix86_output_call_insn (insn, operands[0]);"
@@ -11119,7 +11121,7 @@
(define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"
[(parallel
- [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzm"))
+ [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzw"))
(match_operand 1 "" ""))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
(clobber (reg:TI XMM6_REG))
@@ -11144,7 +11146,7 @@
[(set_attr "type" "call")])
(define_insn "*call_rex64_ms_sysv"
- [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzm"))
+ [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzw"))
(match_operand 1 "" ""))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
(clobber (reg:TI XMM6_REG))
@@ -11275,7 +11277,7 @@
(define_insn_and_split "*call_value_vzeroupper"
[(set (match_operand 0 "" "")
- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zm"))
+ (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw"))
(match_operand 2 "" "")))
(unspec [(match_operand 3 "const_int_operand" "")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
@@ -11288,7 +11290,7 @@
(define_insn "*call_value"
[(set (match_operand 0 "" "")
- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zm"))
+ (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw"))
(match_operand 2 "" "")))]
"!SIBLING_CALL_P (insn)"
"* return ix86_output_call_insn (insn, operands[1]);"
@@ -11318,7 +11320,7 @@
(define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"
[(parallel
[(set (match_operand 0 "" "")
- (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzm"))
+ (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzw"))
(match_operand 2 "" "")))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
(clobber (reg:TI XMM6_REG))
@@ -11344,7 +11346,7 @@
(define_insn "*call_value_rex64_ms_sysv"
[(set (match_operand 0 "" "")
- (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzm"))
+ (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzw"))
(match_operand 2 "" "")))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
(clobber (reg:TI XMM6_REG))
@@ -11666,7 +11668,7 @@
(unspec:DI
[(label_ref (match_operand 1 "" ""))]
UNSPEC_SET_GOT_OFFSET))]
- "TARGET_64BIT"
+ "TARGET_LP64"
"movabs{q}\t{$_GLOBAL_OFFSET_TABLE_-%l1, %0|%0, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_-%l1}"
[(set_attr "type" "imov")
(set_attr "length_immediate" "0")
diff --git a/gcc/config/i386/netware-libgcc.c b/gcc/config/i386/netware-libgcc.c
deleted file mode 100644
index 0925d872aa5..00000000000
--- a/gcc/config/i386/netware-libgcc.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Startup code for libgcc_s.nlm, necessary because we can't allow
- libgcc_s to use libc's malloc & Co., which associate allocations
- with the NLM owning the current (application) thread.
- Contributed by Jan Beulich (jbeulich@novell.com)
- Copyright (C) 2004, 2007 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include <netware.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <windows.h>
-
-static rtag_t allocRTag;
-
-BOOL
-DllMain (HINSTANCE libraryId __attribute__ ((__unused__)),
- DWORD reason, void *hModule)
-{
- switch (reason)
- {
- case DLL_NLM_STARTUP:
- allocRTag = AllocateResourceTag (hModule,
- "libgcc memory", AllocSignature);
- return allocRTag != NULL;
- case DLL_NLM_SHUTDOWN:
- /* This does not recover resources associated with the tag...
- ReturnResourceTag (allocRTag, 0); */
- break;
- }
- return 1;
-}
-
-void *
-malloc (size_t size)
-{
- return AllocSleepOK (size, allocRTag, NULL);
-}
-
-void
-free (void *ptr)
-{
- Free (ptr);
-}
diff --git a/gcc/config/i386/netware-libgcc.def b/gcc/config/i386/netware-libgcc.def
deleted file mode 100644
index a545631b111..00000000000
--- a/gcc/config/i386/netware-libgcc.def
+++ /dev/null
@@ -1,2 +0,0 @@
-description "gcc runtime and intrinsics support"
-copyright "Copyright (C) 1989-2005 Free Software Foundation, Inc."
diff --git a/gcc/config/i386/netware-libgcc.exp b/gcc/config/i386/netware-libgcc.exp
deleted file mode 100644
index 309cf754943..00000000000
--- a/gcc/config/i386/netware-libgcc.exp
+++ /dev/null
@@ -1,83 +0,0 @@
-# libgcc_s.nlm exports
- (libgcc2),
- __absvdi2,
- __absvsi2,
- __addvdi3,
- __addvsi3,
-# __ashldi3,
-# __ashrdi3,
- __bswapdi2,
- __bswapsi2,
- __clzdi2,
- __clzsi2,
- __ctzdi2,
- __ctzsi2,
- __deregister_frame,
- __deregister_frame_info,
- __deregister_frame_info_bases,
- __divdc3,
-# __divdi3,
- __divsc3,
-# __divtc3,
- __divxc3,
- __emutls_get_address,
- __emutls_register_common,
- __ffsdi2,
- __ffssi2,
- __fixunsdfdi,
- __fixunssfdi,
-# __fixunstfdi,
- __fixunsxfdi,
- __floatundisf,
- __floatundidf,
-# __floatunditf,
- __floatundixf,
- __gcc_bcmp,
- __gcc_personality_v0,
-# __lshrdi3,
-# __moddi3,
- __muldc3,
-# __muldi3,
- __mulsc3,
-# __multc3,
- __mulvdi3,
- __mulvsi3,
- __mulxc3,
- __negvdi2,
- __negvsi2,
- __paritydi2,
- __paritysi2,
- __popcountdi2,
- __popcountsi2,
- __powidf2
- __powisf2
-# __powitf2
- __powixf2
- __register_frame,
- __register_frame_info,
- __register_frame_info_bases,
- __register_frame_info_table,
- __register_frame_info_table_bases,
- __register_frame_table,
- __subvdi3,
- __subvsi3,
-# __umoddi3,
-# __udivdi3,
- _Unwind_Backtrace,
- _Unwind_DeleteException,
- _Unwind_FindEnclosingFunction,
- _Unwind_Find_FDE,
- _Unwind_ForcedUnwind,
- _Unwind_GetCFA,
- _Unwind_GetDataRelBase,
- _Unwind_GetGR,
- _Unwind_GetIP,
- _Unwind_GetIPInfo,
- _Unwind_GetLanguageSpecificData,
- _Unwind_GetRegionStart,
- _Unwind_GetTextRelBase,
- _Unwind_RaiseException,
- _Unwind_Resume,
- _Unwind_Resume_or_Rethrow,
- _Unwind_SetGR,
- _Unwind_SetIP
diff --git a/gcc/config/i386/netware.c b/gcc/config/i386/netware.c
deleted file mode 100644
index 5a0f9d5de74..00000000000
--- a/gcc/config/i386/netware.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Subroutines for insn-output.c for NetWare.
- Contributed by Jan Beulich (jbeulich@novell.com)
- Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "rtl.h"
-#include "regs.h"
-#include "hard-reg-set.h"
-#include "output.h"
-#include "tree.h"
-#include "flags.h"
-#include "tm_p.h"
-#include "diagnostic-core.h"
-#include "langhooks.h"
-#include "ggc.h"
-
-/* Return string which is the function name, identified by ID, modified
- with PREFIX and a suffix consisting of an atsign (@) followed by the
- number of bytes of arguments. If ID is NULL use the DECL_NAME as base.
- Return NULL if no change required. */
-
-static tree
-gen_stdcall_or_fastcall_decoration (tree decl, tree id, char prefix)
-{
- unsigned HOST_WIDE_INT total = 0;
- const char *old_str = IDENTIFIER_POINTER (id != NULL_TREE ? id : DECL_NAME (decl));
- char *new_str;
- tree type = TREE_TYPE (decl);
-
- if (prototype_p (type))
- {
- tree arg;
- function_args_iterator args_iter;
-
- /* This attribute is ignored for variadic functions. */
- if (stdarg_p (type))
- return NULL_TREE;
-
- /* Quit if we hit an incomplete type. Error is reported
- by convert_arguments in c-typeck.c or cp/typeck.c. */
- FOREACH_FUNCTION_ARGS(type, arg, args_iter)
- {
- HOST_WIDE_INT parm_size;
- unsigned HOST_WIDE_INT parm_boundary_bytes;
-
- if (! COMPLETE_TYPE_P (arg))
- break;
-
- parm_size = int_size_in_bytes (arg);
- if (parm_size < 0)
- break;
-
- parm_boundary_bytes = PARM_BOUNDARY / BITS_PER_UNIT;
-
- /* Must round up to include padding. This is done the same
- way as in store_one_arg. */
- total += (parm_size + parm_boundary_bytes - 1)
- / parm_boundary_bytes * parm_boundary_bytes;
- }
- }
-
- new_str = XALLOCAVEC (char, 1 + strlen (old_str) + 1 + 10 + 1);
- sprintf (new_str, "%c%s@" HOST_WIDE_INT_PRINT_UNSIGNED,
- prefix, old_str, total);
-
- return get_identifier (new_str);
-}
-
-/* Return string which is the function name, identified by ID, modified
- with an _n@ prefix (where n represents the number of arguments passed in
- registers). If ID is NULL use the DECL_NAME as base.
- Return NULL if no change required. */
-
-static tree
-gen_regparm_prefix (tree decl, tree id, unsigned int nregs)
-{
- unsigned HOST_WIDE_INT total = 0;
- const char *old_str = IDENTIFIER_POINTER (id != NULL_TREE ? id : DECL_NAME (decl));
- char *new_str;
- tree type = TREE_TYPE (decl);
-
- if (prototype_p (type))
- {
- tree arg;
- function_args_iterator args_iter;
-
- /* This attribute is ignored for variadic functions. */
- if (stdarg_p (type))
- return NULL_TREE;
-
- /* Quit if we hit an incomplete type. Error is reported
- by convert_arguments in c-typeck.c or cp/typeck.c. */
- FOREACH_FUNCTION_ARGS(type, arg, args_iter)
- {
- HOST_WIDE_INT parm_size;
- unsigned HOST_WIDE_INT parm_boundary_bytes;
-
- if (! COMPLETE_TYPE_P (arg))
- break;
-
- parm_size = int_size_in_bytes (arg);
- if (parm_size < 0)
- break;
-
- parm_boundary_bytes = PARM_BOUNDARY / BITS_PER_UNIT;
-
- /* Must round up to include padding. This is done the same
- way as in store_one_arg. */
- total += (parm_size + parm_boundary_bytes - 1)
- / parm_boundary_bytes * parm_boundary_bytes;
- }
- }
-
- if (nregs > total / UNITS_PER_WORD)
- nregs = total / UNITS_PER_WORD;
- gcc_assert (nregs <= 9);
- new_str = XALLOCAVEC (char, 3 + strlen (old_str) + 1);
- sprintf (new_str, "_%u@%s", nregs, old_str);
-
- return get_identifier (new_str);
-}
-
-/* Maybe decorate and get a new identifier for the DECL of a stdcall or
- fastcall function. The original identifier is supplied in ID. */
-
-static tree
-i386_nlm_maybe_mangle_decl_assembler_name (tree decl, tree id)
-{
- tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl));
- tree new_id;
- unsigned int ccvt = ix86_get_callcvt (TREE_TYPE (decl));
-
- if ((ccvt & IX86_CALLCVT_STDCALL) != 0)
- {
- if (TARGET_RTD)
- /* If we are using -mrtd emit undecorated symbol and let linker
- do the proper resolving. */
- return NULL_TREE;
- new_id = gen_stdcall_or_fastcall_decoration (decl, id, '_');
- }
- else if ((ccvt & IX86_CALLCVT_FASTCALL) != 0)
- new_id = gen_stdcall_or_fastcall_decoration (decl, id, FASTCALL_PREFIX);
- else if ((ccvt & IX86_CALLCVT_REGPARM) != 0
- && (new_id = lookup_attribute ("regparm", type_attributes)))
- new_id = gen_regparm_prefix (decl, id,
- TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (new_id))));
- else
- new_id = NULL_TREE;
-
- return new_id;
-}
-
-/* This is used as a target hook to modify the DECL_ASSEMBLER_NAME
- in the language-independent default hook
- langhooks.c:lhd_set_decl_assembler_name ()
- and in cp/mangle.c:mangle_decl (). */
-tree
-i386_nlm_mangle_decl_assembler_name (tree decl, tree id)
-{
- tree new_id = TREE_CODE (decl) == FUNCTION_DECL
- ? i386_nlm_maybe_mangle_decl_assembler_name (decl, id)
- : NULL_TREE;
-
- return (new_id ? new_id : id);
-}
-
-void
-i386_nlm_encode_section_info (tree decl, rtx rtl, int first)
-{
- default_encode_section_info (decl, rtl, first);
-
- if (TREE_CODE (decl) == FUNCTION_DECL
- /* Do not change the identifier if a verbatim asmspec
- or if stdcall suffix already added. */
- && *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) != '*'
- && !strchr (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), '@')
- /* FIXME: Imported stdcall names are not modified by the Ada frontend.
- Check and decorate the RTL name now. */
- && strcmp (lang_hooks.name, "GNU Ada") == 0)
- {
- rtx symbol = XEXP (rtl, 0);
- tree new_id;
- tree old_id = DECL_ASSEMBLER_NAME (decl);
-
- gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
-
- if ((new_id = i386_nlm_maybe_mangle_decl_assembler_name (decl, old_id)))
- XSTR (symbol, 0) = IDENTIFIER_POINTER (new_id);
- }
-}
-
-/* Strip the stdcall/fastcall/regparm pre-/suffix. */
-
-const char *
-i386_nlm_strip_name_encoding (const char *str)
-{
- const char *name = default_strip_name_encoding (str);
-
- if (*str != '*' && (*name == '_' || *name == '@'))
- {
- const char *p = strchr (name + 1, '@');
-
- if (p)
- {
- ++name;
- if (ISDIGIT (p[1]))
- name = ggc_alloc_string (name, p - name);
- else
- {
- gcc_assert (ISDIGIT (*name));
- name++;
- gcc_assert (name == p);
- }
- }
- }
- return name;
-}
diff --git a/gcc/config/i386/netware.h b/gcc/config/i386/netware.h
deleted file mode 100644
index f377fb5dc94..00000000000
--- a/gcc/config/i386/netware.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Core target definitions for GCC for Intel 80x86 running Netware.
- and using dwarf for the debugging format.
- Copyright (C) 1993, 1994, 2004, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
-
- Written by David V. Henkel-Wallace (gumby@cygnus.com)
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
-
-#undef ASM_SPEC
-#define ASM_SPEC ""
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* Kinda useless, but what the hell */
-#undef LINK_SPEC
-#define LINK_SPEC "%{h*} %{v:-V}"
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC ""
-
-#undef RELATIVE_PREFIX_NOT_LINKDIR
-#undef LIBGCC_SPEC
-
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("IAPX386"); \
- builtin_define ("_M_IX86=300"); \
- builtin_define ("__netware__"); \
- builtin_assert ("system=netware"); \
- builtin_define ("__ELF__"); \
- builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
- builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
- builtin_define ("__fastcall=__attribute__((__fastcall__))"); \
- if (!flag_iso) \
- { \
- builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
- builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
- builtin_define ("_fastcall=__attribute__((__fastcall__))"); \
- } \
- } \
- while (0)
-
-#undef TARGET_CPU_DEFAULT
-#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_pentium4
-
-/* By default, target has a 80387, uses IEEE compatible arithmetic,
- returns float values in the 387, and uses MSVC bit field layout. */
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | \
- MASK_FLOAT_RETURNS | MASK_ALIGN_DOUBLE | MASK_MS_BITFIELD_LAYOUT)
-
-/* Don't allow flag_pic to propagate since invalid relocations will
- result otherwise. */
-#define SUBTARGET_OVERRIDE_OPTIONS \
-do { \
- if (flag_pic) \
- { \
- error ("-fPIC and -fpic are not supported for this target"); \
- flag_pic = 0; \
- } \
-} while (0)
-
-#undef MATH_LIBRARY
-#define MATH_LIBRARY ""
-
-/* Align doubles and long-longs in structures on qword boundaries. */
-#undef BIGGEST_FIELD_ALIGNMENT
-#define BIGGEST_FIELD_ALIGNMENT 64
-
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 0
-
-/* Implicit arguments pointing to aggregate return values are to be
- removed by the caller. */
-#undef KEEP_AGGREGATE_RETURN_POINTER
-#define KEEP_AGGREGATE_RETURN_POINTER 1
-
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
-
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) (svr4_dbx_register_map[n])
-
-/* Default structure packing is 1-byte. */
-#define TARGET_DEFAULT_PACK_STRUCT 1
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "short unsigned int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 16
-
-#undef WINT_TYPE
-#define WINT_TYPE "int"
-
-/* A C statement (sans semicolon) to output to the stdio stream
- FILE the assembler definition of uninitialized global DECL named
- NAME whose size is SIZE bytes and alignment is ALIGN bytes.
- Try to use asm_output_aligned_bss to implement this macro. */
-
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
- asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-
-/* Handle special EH pointer encodings. Absolute, pc-relative, and
- indirect are handled automatically. */
-#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
- do { \
- if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
- { \
- fputs (ASM_LONG, FILE); \
- assemble_name (FILE, XSTR (ADDR, 0)); \
- fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
- goto DONE; \
- } \
- } while (0)
-
-/* there is no TLS support in NLMs/on NetWare */
-#undef HAVE_AS_TLS
-
-#define HAS_INIT_SECTION
-#undef INIT_SECTION_ASM_OP
-
-#define CTOR_LISTS_DEFINED_EXTERNALLY
-
-#undef READONLY_DATA_SECTION_ASM_OP
-#define READONLY_DATA_SECTION_ASM_OP ".section\t.rodata"
-
-/* Define this macro if references to a symbol must be treated
- differently depending on something about the variable or
- function named by the symbol (such as what section it is in).
-
- On i386 running NetWare, modify the assembler name with an underscore (_)
- or atsign (@) prefix and a suffix consisting of an atsign (@) followed by
- a string of digits that represents the number of bytes of arguments passed
- to the function, if it has the attribute STDCALL. Alternatively, if it has
- the REGPARM attribute, prefix it with an underscore (_), a digit
- representing the number of registers used, and an atsign (@). */
-void i386_nlm_encode_section_info (tree, rtx, int);
-extern tree i386_nlm_mangle_decl_assembler_name (tree, tree);
-const char *i386_nlm_strip_name_encoding (const char *);
-#define SUBTARGET_ENCODE_SECTION_INFO i386_nlm_encode_section_info
-#define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_nlm_mangle_decl_assembler_name
-#undef TARGET_STRIP_NAME_ENCODING
-#define TARGET_STRIP_NAME_ENCODING i386_nlm_strip_name_encoding
-
-#define TARGET_POSIX_IO
diff --git a/gcc/config/i386/netware.opt b/gcc/config/i386/netware.opt
deleted file mode 100644
index e1d903a2f7f..00000000000
--- a/gcc/config/i386/netware.opt
+++ /dev/null
@@ -1,33 +0,0 @@
-; Netware options.
-
-; Copyright (C) 2011
-; Free Software Foundation, Inc.
-;
-; This file is part of GCC.
-;
-; GCC is free software; you can redistribute it and/or modify it under
-; the terms of the GNU General Public License as published by the Free
-; Software Foundation; either version 3, or (at your option) any later
-; version.
-;
-; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-; WARRANTY; without even the implied warranty of MERCHANTABILITY or
-; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-; for more details.
-;
-; You should have received a copy of the GNU General Public License
-; along with GCC; see the file COPYING3. If not see
-; <http://www.gnu.org/licenses/>.
-
-; See the GCC internals manual (options.texi) for a description of
-; this file's format.
-
-; Please try to keep this file in ASCII collating order.
-
-posix
-Driver
-
-pthread
-Driver
-
-; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/i386/nwld.c b/gcc/config/i386/nwld.c
deleted file mode 100644
index 05d1a92d1d7..00000000000
--- a/gcc/config/i386/nwld.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Subroutines for insn-output.c for NetWare.
- Contributed by Jan Beulich (jbeulich@novell.com)
- Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "rtl.h"
-#include "regs.h"
-#include "hard-reg-set.h"
-#include "output.h"
-#include "tree.h"
-#include "flags.h"
-#include "tm_p.h"
-#include "diagnostic-core.h"
-
-void
-nwld_named_section_asm_out_constructor (rtx symbol, int priority)
-{
-#if !SUPPORTS_INIT_PRIORITY
- const char section[] = ".ctors"TARGET_SUB_SECTION_SEPARATOR;
-#else
- char section[20];
-
- sprintf (section,
- ".ctors"TARGET_SUB_SECTION_SEPARATOR"%.5u",
- /* Invert the numbering so the linker puts us in the proper
- order; constructors are run from right to left, and the
- linker sorts in increasing order. */
- MAX_INIT_PRIORITY - priority);
-#endif
-
- switch_to_section (get_section (section, 0, NULL));
- assemble_align (POINTER_SIZE);
- assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
-}
-
-void
-nwld_named_section_asm_out_destructor (rtx symbol, int priority)
-{
-#if !SUPPORTS_INIT_PRIORITY
- const char section[] = ".dtors"TARGET_SUB_SECTION_SEPARATOR;
-#else
- char section[20];
-
- sprintf (section, ".dtors"TARGET_SUB_SECTION_SEPARATOR"%.5u",
- /* Invert the numbering so the linker puts us in the proper
- order; destructors are run from left to right, and the
- linker sorts in increasing order. */
- MAX_INIT_PRIORITY - priority);
-#endif
-
- switch_to_section (get_section (section, 0, NULL));
- assemble_align (POINTER_SIZE);
- assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
-}
diff --git a/gcc/config/i386/nwld.h b/gcc/config/i386/nwld.h
deleted file mode 100644
index 6d8e54ff990..00000000000
--- a/gcc/config/i386/nwld.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* nwld.h -- defines to be used when targeting GCC for some generic NetWare
- system while using the Novell linker.
- Copyright (C) 2004, 2007, 2010, 2011 Free Software Foundation, Inc.
-
- Written by Jan Beulich (jbeulich@novell.com)
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#undef LIB_SPEC
-#define LIB_SPEC "-lc --def-file libc.def%s"
-
-#undef LIBGCC_SPEC
-#define LIBGCC_SPEC "-lgcc %{!static-libgcc:--def-file libgcc.def%s}"
-
-#undef LINKER_NAME
-#define LINKER_NAME "nwld"
-
-#undef LINK_SPEC
-#define LINK_SPEC "--format:NLM --extensions:GNU" \
- " %{static:%{!nostdlib:%{!nodefaultlibs:%estatic linking is not supported\n}}}"
-
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "%L %G"
-
-/* In order to permit the linker to derive the output filename from the first
- input file, put the common startup code as the last object. */
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "crt0%O%s ../imports/%{!posix:libc}%{posix:posix}pre.gcc%O%s" \
- " --def-file %{!posix:libc}%{posix:posix}pre.def%s"
-
-#define DRIVER_SELF_SPECS "%{!static-libgcc:-shared-libgcc}"
-
-#define TARGET_SUB_SECTION_SEPARATOR "$"
-
-void nwld_named_section_asm_out_constructor (rtx, int);
-void nwld_named_section_asm_out_destructor (rtx, int);
-
-#define TARGET_ASM_CONSTRUCTOR nwld_named_section_asm_out_constructor
-#define TARGET_ASM_DESTRUCTOR nwld_named_section_asm_out_destructor
-
-#define SUBSUBTARGET_OVERRIDE_OPTIONS \
-do { \
- /* XXX This can be enabled once gas output meets nwld's needs. */ \
- /* if (!flag_unwind_tables && !flag_exceptions) */ \
- flag_dwarf2_cfi_asm = 0; \
-} while (0)
-
-#undef EH_FRAME_SECTION_NAME
-#define EH_FRAME_SECTION_NAME ".eh_frame"TARGET_SUB_SECTION_SEPARATOR
-
-/* nwld does not currently support stabs debug info */
-#undef DBX_DEBUGGING_INFO
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 2c75147474e..2ef9129156a 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -563,11 +563,18 @@
(ior (match_operand 0 "register_no_elim_operand")
(match_operand 0 "immediate_operand")))
+;; Test for a valid operand for indirect branch.
+(define_predicate "indirect_branch_operand"
+ (if_then_else (match_test "TARGET_X32")
+ (match_operand 0 "register_operand")
+ (match_operand 0 "nonimmediate_operand")))
+
;; Test for a valid operand for a call instruction.
(define_predicate "call_insn_operand"
(ior (match_operand 0 "constant_call_address_operand")
(match_operand 0 "call_register_no_elim_operand")
- (match_operand 0 "memory_operand")))
+ (and (match_test "!TARGET_X32")
+ (match_operand 0 "memory_operand"))))
;; Similarly, but for tail calls, in which we cannot allow memory references.
(define_predicate "sibcall_insn_operand"
@@ -796,7 +803,7 @@
;; Return true if op if a valid address, and does not contain
;; a segment override.
-(define_special_predicate "no_seg_address_operand"
+(define_predicate "no_seg_address_operand"
(match_operand 0 "address_operand")
{
struct ix86_address parts;
diff --git a/gcc/config/i386/t-netware b/gcc/config/i386/t-netware
deleted file mode 100644
index 405c98f6a8d..00000000000
--- a/gcc/config/i386/t-netware
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET_LIBGCC2_CFLAGS = -mpreferred-stack-boundary=2 -fomit-frame-pointer
-
-netware.o: $(srcdir)/config/i386/netware.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H)
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- $(srcdir)/config/i386/netware.c
-
-# We don't need some of GCC's own include files.
-USER_H = $(srcdir)/ginclude/stdarg.h \
- $(srcdir)/ginclude/varargs.h \
- $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
diff --git a/gcc/config/i386/t-nwld b/gcc/config/i386/t-nwld
deleted file mode 100644
index ecd1a3bfccc..00000000000
--- a/gcc/config/i386/t-nwld
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011
-# Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-nwld.o: $(srcdir)/config/i386/nwld.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H)
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- $(srcdir)/config/i386/nwld.c
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index c21eb9643ac..fa3b93fa6cc 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -4738,12 +4738,9 @@ ia64_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
if ((TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == INTEGER_TYPE)
? int_size_in_bytes (type) > 8 : TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
{
- tree t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (valist), valist,
- size_int (2 * UNITS_PER_WORD - 1));
- t = fold_convert (sizetype, t);
+ tree t = fold_build_pointer_plus_hwi (valist, 2 * UNITS_PER_WORD - 1);
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
- size_int (-2 * UNITS_PER_WORD));
- t = fold_convert (TREE_TYPE (valist), t);
+ build_int_cst (TREE_TYPE (t), -2 * UNITS_PER_WORD));
gimplify_assign (unshare_expr (valist), t, pre_p);
}
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index e909ef94b57..130acc9b384 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -228,9 +228,6 @@ enum reg_class
? (GR_REGS) \
: (CLASS))))
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Basic Stack Layout. */
diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h
index 75a24160fd9..5c516860bed 100644
--- a/gcc/config/lm32/lm32.h
+++ b/gcc/config/lm32/lm32.h
@@ -202,9 +202,6 @@ enum reg_class
#define REGNO_REG_CLASS(REGNO) \
(G_REG_P(REGNO) ? GENERAL_REGS : NO_REGS)
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
#define INDEX_REG_CLASS NO_REGS
#define BASE_REG_CLASS GENERAL_REGS
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 50b5b2aa1a3..0072b2f0da3 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -509,11 +509,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO)
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Return true if a value is inside a range. */
#define IN_RANGE_P(VALUE, LOW, HIGH) \
(((unsigned HOST_WIDE_INT)((VALUE) - (LOW))) \
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index a946c9350aa..c18e7b7f04c 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -3620,14 +3620,12 @@ mep_expand_va_start (tree valist, rtx nextarg)
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* va_list.next_gp_limit = va_list.next_gp + 4 * ns; */
- u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
- size_int (4 * ns));
+ u = fold_build_pointer_plus_hwi (u, 4 * ns);
t = build2 (MODIFY_EXPR, ptr_type_node, next_gp_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
- size_int (8 * ((ns+1)/2)));
+ u = fold_build_pointer_plus_hwi (u, 8 * ((ns+1)/2));
/* va_list.next_cop = ROUND_UP(va_list.next_gp_limit,8); */
t = build2 (MODIFY_EXPR, ptr_type_node, next_cop, u);
TREE_SIDE_EFFECTS (t) = 1;
@@ -3715,12 +3713,10 @@ mep_gimplify_va_arg_expr (tree valist, tree type,
gimplify_and_add (tmp, pre_p);
}
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
- unshare_expr (next_gp), size_int (4));
+ tmp = fold_build_pointer_plus_hwi (unshare_expr (next_gp), 4);
gimplify_assign (unshare_expr (next_gp), tmp, pre_p);
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
- unshare_expr (next_cop), size_int (8));
+ tmp = fold_build_pointer_plus_hwi (unshare_expr (next_cop), 8);
gimplify_assign (unshare_expr (next_cop), tmp, pre_p);
tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (label_sover));
@@ -3734,8 +3730,7 @@ mep_gimplify_va_arg_expr (tree valist, tree type,
tmp = build2 (MODIFY_EXPR, void_type_node, res_addr, unshare_expr (next_stack));
gimplify_and_add (tmp, pre_p);
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
- unshare_expr (next_stack), size_int (rsize));
+ tmp = fold_build_pointer_plus_hwi (unshare_expr (next_stack), rsize);
gimplify_assign (unshare_expr (next_stack), tmp, pre_p);
/* - - */
diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h
index f5de83f5d1d..dbb48143034 100644
--- a/gcc/config/mep/mep.h
+++ b/gcc/config/mep/mep.h
@@ -428,9 +428,6 @@ enum reg_class
#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
mep_secondary_memory_needed (CLASS1, CLASS2, MODE)
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
#if 0
#define CONST_OK_FOR_LETTER_P(VALUE, C) mep_const_ok_for_letter_p (VALUE, C)
diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
index a667acadaf8..92f0f60f1ff 100644
--- a/gcc/config/microblaze/microblaze.h
+++ b/gcc/config/microblaze/microblaze.h
@@ -388,9 +388,6 @@ extern enum reg_class microblaze_regno_to_class[];
#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
(GET_MODE_CLASS (MODE) == MODE_INT)
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + (UNITS_PER_WORD) - 1) / (UNITS_PER_WORD))
-
/* Stack layout; function entry, exit and calling. */
#define STACK_GROWS_DOWNWARD
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
new file mode 100644
index 00000000000..49c459bc743
--- /dev/null
+++ b/gcc/config/mips/gnu-user.h
@@ -0,0 +1,140 @@
+/* Definitions for MIPS systems using GNU userspace.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
+
+/* If we don't set MASK_ABICALLS, we can't default to PIC. */
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT MASK_ABICALLS
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
+ /* The GNU C++ standard library requires this. */ \
+ if (c_dialect_cxx ()) \
+ builtin_define ("_GNU_SOURCE"); \
+ } while (0)
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+/* A standard GNU/Linux mapping. On most targets, it is included in
+ CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
+ and provides this hook instead. */
+#undef SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC "%{profile:-p}"
+
+/* From iris5.h */
+/* -G is incompatible with -KPIC which is the default, so only allow objects
+ in the small data section if the user explicitly asks for it. */
+#undef MIPS_DEFAULT_GVALUE
+#define MIPS_DEFAULT_GVALUE 0
+
+/* Borrowed from sparc/linux.h */
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
+ %{static:-static}}"
+
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC \
+ "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
+
+/* The MIPS assembler has different syntax for .set. We set it to
+ .dummy to trap any errors. */
+#undef SET_ASM_OP
+#define SET_ASM_OP "\t.dummy\t"
+
+#undef ASM_OUTPUT_DEF
+#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
+ do { \
+ fputc ( '\t', FILE); \
+ assemble_name (FILE, LABEL1); \
+ fputs ( " = ", FILE); \
+ assemble_name (FILE, LABEL2); \
+ fputc ( '\n', FILE); \
+ } while (0)
+
+/* The glibc _mcount stub will save $v0 for us. Don't mess with saving
+ it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
+ presence of $gp-relative calls. */
+#undef ASM_OUTPUT_REG_PUSH
+#undef ASM_OUTPUT_REG_POP
+
+#undef LIB_SPEC
+#define LIB_SPEC "\
+%{pthread:-lpthread} \
+%{shared:-lc} \
+%{!shared: \
+ %{profile:-lc_p} %{!profile:-lc}}"
+
+#ifdef HAVE_AS_NO_SHARED
+/* Default to -mno-shared for non-PIC. */
+# define NO_SHARED_SPECS \
+ "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
+#else
+# define NO_SHARED_SPECS ""
+#endif
+
+/* -march=native handling only makes sense with compiler running on
+ a MIPS chip. */
+#if defined(__mips__)
+extern const char *host_detect_local_cpu (int argc, const char **argv);
+# define EXTRA_SPEC_FUNCTIONS \
+ { "local_cpu_detect", host_detect_local_cpu },
+
+# define MARCH_MTUNE_NATIVE_SPECS \
+ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
+ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MARCH_MTUNE_NATIVE_SPECS ""
+#endif
+
+#define LINUX_DRIVER_SELF_SPECS \
+ NO_SHARED_SPECS \
+ MARCH_MTUNE_NATIVE_SPECS, \
+ /* -mplt has no effect without -mno-shared. Simplify later \
+ specs handling by removing a redundant option. */ \
+ "%{!mno-shared:%<mplt}", \
+ /* -mplt likewise has no effect for -mabi=64 without -msym32. */ \
+ "%{mabi=64:%{!msym32:%<mplt}}"
+
+#undef DRIVER_SELF_SPECS
+#define DRIVER_SELF_SPECS \
+ BASE_DRIVER_SELF_SPECS, \
+ LINUX_DRIVER_SELF_SPECS
+
+/* Similar to standard Linux, but adding -ffast-math support. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+ %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
diff --git a/gcc/config/mips/gnu-user64.h b/gcc/config/mips/gnu-user64.h
new file mode 100644
index 00000000000..91b021d1ca8
--- /dev/null
+++ b/gcc/config/mips/gnu-user64.h
@@ -0,0 +1,60 @@
+/* Definitions for MIPS systems using GNU userspace and n32/64 abi.
+ Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Force the default endianness and ABI flags onto the command line
+ in order to make the other specs easier to write. */
+#undef DRIVER_SELF_SPECS
+#define DRIVER_SELF_SPECS \
+ BASE_DRIVER_SELF_SPECS, \
+ LINUX_DRIVER_SELF_SPECS \
+ " %{!EB:%{!EL:%(endian_spec)}}" \
+ " %{!mabi=*: -" MULTILIB_ABI_DEFAULT "}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "\
+%{pthread:-lpthread} \
+%{shared:-lc} \
+%{!shared: \
+ %{profile:-lc_p} %{!profile:-lc}}"
+
+#undef LINK_SPEC
+#define LINK_SPEC "\
+%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
+%{shared} \
+ %(endian_spec) \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{mabi=n32: -dynamic-linker " GNU_USER_DYNAMIC_LINKERN32 "} \
+ %{mabi=64: -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
+ %{mabi=32: -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
+ %{static:-static}} \
+%{mabi=n32:-m" GNU_USER_LINK_EMULATIONN32 "} \
+%{mabi=64:-m" GNU_USER_LINK_EMULATION64 "} \
+%{mabi=32:-m" GNU_USER_LINK_EMULATION32 "}"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")
+
+/* GNU/Linux doesn't use the same floating-point format that IRIX uses
+ for long double. There's no need to override this here, since
+ ieee_quad_format is the default, but let's put this here to make
+ sure nobody thinks we just forgot to set it to something else. */
+#define MIPS_TFMODE_FORMAT mips_quad_format
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 544a99f2d0b..bce9c1793f2 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -18,125 +18,4 @@ 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/>. */
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 32
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
-
-/* If we don't set MASK_ABICALLS, we can't default to PIC. */
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT MASK_ABICALLS
-
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- GNU_USER_TARGET_OS_CPP_BUILTINS(); \
- /* The GNU C++ standard library requires this. */ \
- if (c_dialect_cxx ()) \
- builtin_define ("_GNU_SOURCE"); \
- } while (0)
-
-#undef SUBTARGET_CPP_SPEC
-#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
-
-/* A standard GNU/Linux mapping. On most targets, it is included in
- CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
- and provides this hook instead. */
-#undef SUBTARGET_CC1_SPEC
-#define SUBTARGET_CC1_SPEC "%{profile:-p}"
-
-/* From iris5.h */
-/* -G is incompatible with -KPIC which is the default, so only allow objects
- in the small data section if the user explicitly asks for it. */
-#undef MIPS_DEFAULT_GVALUE
-#define MIPS_DEFAULT_GVALUE 0
-
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-
-/* Borrowed from sparc/linux.h */
-#undef LINK_SPEC
-#define LINK_SPEC \
- "%(endian_spec) \
- %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
- %{static:-static}}"
-
-#undef SUBTARGET_ASM_SPEC
-#define SUBTARGET_ASM_SPEC \
- "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
-
-/* The MIPS assembler has different syntax for .set. We set it to
- .dummy to trap any errors. */
-#undef SET_ASM_OP
-#define SET_ASM_OP "\t.dummy\t"
-
-#undef ASM_OUTPUT_DEF
-#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
- do { \
- fputc ( '\t', FILE); \
- assemble_name (FILE, LABEL1); \
- fputs ( " = ", FILE); \
- assemble_name (FILE, LABEL2); \
- fputc ( '\n', FILE); \
- } while (0)
-
-/* The glibc _mcount stub will save $v0 for us. Don't mess with saving
- it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
- presence of $gp-relative calls. */
-#undef ASM_OUTPUT_REG_PUSH
-#undef ASM_OUTPUT_REG_POP
-
-#undef LIB_SPEC
-#define LIB_SPEC "\
-%{pthread:-lpthread} \
-%{shared:-lc} \
-%{!shared: \
- %{profile:-lc_p} %{!profile:-lc}}"
-
-#ifdef HAVE_AS_NO_SHARED
-/* Default to -mno-shared for non-PIC. */
-# define NO_SHARED_SPECS \
- "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
-#else
-# define NO_SHARED_SPECS ""
-#endif
-
-/* -march=native handling only makes sense with compiler running on
- a MIPS chip. */
-#if defined(__mips__)
-extern const char *host_detect_local_cpu (int argc, const char **argv);
-# define EXTRA_SPEC_FUNCTIONS \
- { "local_cpu_detect", host_detect_local_cpu },
-
-# define MARCH_MTUNE_NATIVE_SPECS \
- " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
- " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
-#else
-# define MARCH_MTUNE_NATIVE_SPECS ""
-#endif
-
-#define LINUX_DRIVER_SELF_SPECS \
- NO_SHARED_SPECS \
- MARCH_MTUNE_NATIVE_SPECS, \
- /* -mplt has no effect without -mno-shared. Simplify later \
- specs handling by removing a redundant option. */ \
- "%{!mno-shared:%<mplt}", \
- /* -mplt likewise has no effect for -mabi=64 without -msym32. */ \
- "%{mabi=64:%{!msym32:%<mplt}}"
-
-#undef DRIVER_SELF_SPECS
-#define DRIVER_SELF_SPECS \
- BASE_DRIVER_SELF_SPECS, \
- LINUX_DRIVER_SELF_SPECS
-
-/* Similar to standard Linux, but adding -ffast-math support. */
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
- %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h
index cfdae5a1e61..6e92719881b 100644
--- a/gcc/config/mips/linux64.h
+++ b/gcc/config/mips/linux64.h
@@ -19,21 +19,9 @@ 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/>. */
-/* Force the default endianness and ABI flags onto the command line
- in order to make the other specs easier to write. */
-#undef DRIVER_SELF_SPECS
-#define DRIVER_SELF_SPECS \
- BASE_DRIVER_SELF_SPECS, \
- LINUX_DRIVER_SELF_SPECS \
- " %{!EB:%{!EL:%(endian_spec)}}" \
- " %{!mabi=*: -" MULTILIB_ABI_DEFAULT "}"
-
-#undef LIB_SPEC
-#define LIB_SPEC "\
-%{pthread:-lpthread} \
-%{shared:-lc} \
-%{!shared: \
- %{profile:-lc_p} %{!profile:-lc}}"
+#define GNU_USER_LINK_EMULATION32 "elf32%{EB:b}%{EL:l}tsmip"
+#define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
+#define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
@@ -43,28 +31,3 @@ along with GCC; see the file COPYING3. If not see
#define GNU_USER_DYNAMIC_LINKERN32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
BIONIC_DYNAMIC_LINKERN32)
-
-#undef LINK_SPEC
-#define LINK_SPEC "\
-%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
-%{shared} \
- %(endian_spec) \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{mabi=n32: -dynamic-linker " GNU_USER_DYNAMIC_LINKERN32 "} \
- %{mabi=64: -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
- %{mabi=32: -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
- %{static:-static}} \
-%{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
-%{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
-%{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
-
-#undef LOCAL_LABEL_PREFIX
-#define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")
-
-/* GNU/Linux doesn't use the same floating-point format that IRIX uses
- for long double. There's no need to override this here, since
- ieee_quad_format is the default, but let's put this here to make
- sure nobody thinks we just forgot to set it to something else. */
-#define MIPS_TFMODE_FORMAT mips_quad_format
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ee71c4040c7..89371734d4e 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -5452,8 +5452,7 @@ mips_va_start (tree valist, rtx nextarg)
words used by named arguments. */
t = make_tree (TREE_TYPE (ovfl), virtual_incoming_args_rtx);
if (cum->stack_words > 0)
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl), t,
- size_int (cum->stack_words * UNITS_PER_WORD));
+ t = fold_build_pointer_plus_hwi (t, cum->stack_words * UNITS_PER_WORD);
t = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -5469,8 +5468,7 @@ mips_va_start (tree valist, rtx nextarg)
fpr_offset = gpr_save_area_size + UNITS_PER_FPVALUE - 1;
fpr_offset &= -UNITS_PER_FPVALUE;
if (fpr_offset)
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ftop), t,
- size_int (-fpr_offset));
+ t = fold_build_pointer_plus_hwi (t, -fpr_offset);
t = build2 (MODIFY_EXPR, TREE_TYPE (ftop), ftop, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -5615,24 +5613,17 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
addr_rtx = top - off + (BYTES_BIG_ENDIAN ? RSIZE - SIZE : 0). */
t = fold_convert (sizetype, t);
t = fold_build1 (NEGATE_EXPR, sizetype, t);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (top), top, t);
+ t = fold_build_pointer_plus (top, t);
if (BYTES_BIG_ENDIAN && rsize > size)
- {
- u = size_int (rsize - size);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, u);
- }
+ t = fold_build_pointer_plus_hwi (t, rsize - size);
COND_EXPR_THEN (addr) = t;
if (osize > UNITS_PER_WORD)
{
/* [9] Emit: ovfl = ((intptr_t) ovfl + osize - 1) & -osize. */
- u = size_int (osize - 1);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl),
- unshare_expr (ovfl), u);
- t = fold_convert (sizetype, t);
- u = size_int (-osize);
+ t = fold_build_pointer_plus_hwi (unshare_expr (ovfl), osize - 1);
+ u = build_int_cst (TREE_TYPE (t), -osize);
t = build2 (BIT_AND_EXPR, sizetype, t, u);
- t = fold_convert (TREE_TYPE (ovfl), t);
align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl),
unshare_expr (ovfl), t);
}
@@ -5645,10 +5636,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
u = fold_convert (TREE_TYPE (ovfl), build_int_cst (NULL_TREE, osize));
t = build2 (POSTINCREMENT_EXPR, TREE_TYPE (ovfl), ovfl, u);
if (BYTES_BIG_ENDIAN && osize > size)
- {
- u = size_int (osize - size);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, u);
- }
+ t = fold_build_pointer_plus_hwi (t, osize - size);
/* String [9] and [10, 11] together. */
if (align)
@@ -6862,7 +6850,7 @@ mips_get_unaligned_mem (rtx *op, HOST_WIDE_INT width, HOST_WIDE_INT bitpos,
/* Adjust *OP to refer to the whole field. This also has the effect
of legitimizing *OP's address for BLKmode, possibly simplifying it. */
*op = adjust_address (*op, BLKmode, 0);
- set_mem_size (*op, GEN_INT (width / BITS_PER_UNIT));
+ set_mem_size (*op, width / BITS_PER_UNIT);
/* Get references to both ends of the field. We deliberately don't
use the original QImode *OP for FIRST since the new BLKmode one
@@ -6962,13 +6950,9 @@ mips_expand_ins_as_unaligned_store (rtx dest, rtx src, HOST_WIDE_INT width,
bool
mips_mem_fits_mode_p (enum machine_mode mode, rtx x)
{
- rtx size;
-
- if (!MEM_P (x))
- return false;
-
- size = MEM_SIZE (x);
- return size && INTVAL (size) == GET_MODE_SIZE (mode);
+ return (MEM_P (x)
+ && MEM_SIZE_KNOWN_P (x)
+ && MEM_SIZE (x) == GET_MODE_SIZE (mode));
}
/* Return true if (zero_extract OP WIDTH BITPOS) can be used as the
@@ -13781,13 +13765,9 @@ r10k_safe_address_p (rtx x, rtx insn)
a link-time-constant address. */
static bool
-r10k_safe_mem_expr_p (tree expr, rtx offset)
+r10k_safe_mem_expr_p (tree expr, HOST_WIDE_INT offset)
{
- if (expr == NULL_TREE
- || offset == NULL_RTX
- || !CONST_INT_P (offset)
- || INTVAL (offset) < 0
- || INTVAL (offset) >= int_size_in_bytes (TREE_TYPE (expr)))
+ if (offset < 0 || offset >= int_size_in_bytes (TREE_TYPE (expr)))
return false;
while (TREE_CODE (expr) == COMPONENT_REF)
@@ -13813,7 +13793,9 @@ r10k_needs_protection_p_1 (rtx *loc, void *data)
if (!MEM_P (mem))
return 0;
- if (r10k_safe_mem_expr_p (MEM_EXPR (mem), MEM_OFFSET (mem)))
+ if (MEM_EXPR (mem)
+ && MEM_OFFSET_KNOWN_P (mem)
+ && r10k_safe_mem_expr_p (MEM_EXPR (mem), MEM_OFFSET (mem)))
return -1;
if (r10k_safe_address_p (XEXP (mem, 0), (rtx) data))
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 7f70d5b25d2..79b20f5a4d8 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -388,12 +388,6 @@ enum reg_class
#define LIMIT_RELOAD_CLASS(MODE, CLASS) \
(!TARGET_AM33 && (MODE == QImode || MODE == HImode) ? DATA_REGS : CLASS)
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* A class that contains registers which the compiler must always
access in a mode that is the same size as the mode in which it
loaded the register. */
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index 86c66631441..d2a455b289c 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -189,11 +189,6 @@ enum reg_class
accessible in mode MODE2 without copying. */
#define MODES_TIEABLE_P(MODE1, MODE2) 1
-/* A C expression for the maximum number of consecutive registers of
- class CLASS needed to hold a value of mode MODE. */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* The Overall Framework of an Assembler File */
#undef ASM_SPEC
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 2a54bdde266..b208215d36e 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -6112,7 +6112,7 @@ hppa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
u = fold_convert (sizetype, size_in_bytes (type));
u = fold_build1 (NEGATE_EXPR, sizetype, u);
- t = build2 (POINTER_PLUS_EXPR, valist_type, valist, u);
+ t = fold_build_pointer_plus (valist, u);
/* Align to 4 or 8 byte boundary depending on argument size. */
@@ -6124,10 +6124,7 @@ hppa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
ofs = (8 - size) % 4;
if (ofs != 0)
- {
- u = size_int (ofs);
- t = build2 (POINTER_PLUS_EXPR, valist_type, t, u);
- }
+ t = fold_build_pointer_plus_hwi (t, ofs);
t = fold_convert (ptr, t);
t = build_va_arg_indirect_ref (t);
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 79dd1403c91..20b3cb8fea6 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -9131,8 +9131,7 @@ rs6000_va_start (tree valist, rtx nextarg)
/* Find the overflow area. */
t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx);
if (words != 0)
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t,
- size_int (words * UNITS_PER_WORD));
+ t = fold_build_pointer_plus_hwi (t, words * UNITS_PER_WORD);
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -9148,8 +9147,7 @@ rs6000_va_start (tree valist, rtx nextarg)
/* Find the register save area. */
t = make_tree (TREE_TYPE (sav), virtual_stack_vars_rtx);
if (cfun->machine->varargs_save_offset)
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
- size_int (cfun->machine->varargs_save_offset));
+ t = fold_build_pointer_plus_hwi (t, cfun->machine->varargs_save_offset);
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -9202,9 +9200,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
/* This updates arg ptr by the amount that would be necessary
to align the zero-sized (but not zero-alignment) item. */
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
- fold_build2 (POINTER_PLUS_EXPR,
- TREE_TYPE (valist),
- valist_tmp, size_int (boundary - 1)));
+ fold_build_pointer_plus_hwi (valist_tmp, boundary - 1));
gimplify_and_add (t, pre_p);
t = fold_convert (sizetype, valist_tmp);
@@ -9339,20 +9335,20 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
t = sav;
if (sav_ofs)
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
+ t = fold_build_pointer_plus_hwi (sav, sav_ofs);
u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), unshare_expr (reg),
build_int_cst (TREE_TYPE (reg), n_reg));
u = fold_convert (sizetype, u);
u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, u);
+ t = fold_build_pointer_plus (t, u);
/* _Decimal32 varargs are located in the second word of the 64-bit
FP register for 32-bit binaries. */
if (!TARGET_POWERPC64
&& TARGET_HARD_FLOAT && TARGET_FPRS
&& TYPE_MODE (type) == SDmode)
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
+ t = fold_build_pointer_plus_hwi (t, size);
gimplify_assign (addr, t, pre_p);
@@ -9375,17 +9371,15 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
t = ovf;
if (align != 1)
{
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (align - 1));
- t = fold_convert (sizetype, t);
+ t = fold_build_pointer_plus_hwi (t, align - 1);
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
- size_int (-align));
- t = fold_convert (TREE_TYPE (ovf), t);
+ build_int_cst (TREE_TYPE (t), -align));
}
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
gimplify_assign (unshare_expr (addr), t, pre_p);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
+ t = fold_build_pointer_plus_hwi (t, size);
gimplify_assign (unshare_expr (ovf), t, pre_p);
if (lab_over)
@@ -13685,14 +13679,14 @@ expand_block_move (rtx operands[])
rtx src_reg = copy_addr_to_reg (XEXP (src, 0));
src = replace_equiv_address (src, src_reg);
}
- set_mem_size (src, GEN_INT (move_bytes));
+ set_mem_size (src, move_bytes);
if (!REG_P (XEXP (dest, 0)))
{
rtx dest_reg = copy_addr_to_reg (XEXP (dest, 0));
dest = replace_equiv_address (dest, dest_reg);
}
- set_mem_size (dest, GEN_INT (move_bytes));
+ set_mem_size (dest, move_bytes);
emit_insn ((*gen_func.movmemsi) (dest, src,
GEN_INT (move_bytes & 31),
@@ -23063,8 +23057,8 @@ adjacent_mem_locations (rtx insn1, rtx insn2)
val_diff = val1 - val0;
return ((REGNO (reg0) == REGNO (reg1))
- && ((MEM_SIZE (a) && val_diff == INTVAL (MEM_SIZE (a)))
- || (MEM_SIZE (b) && val_diff == -INTVAL (MEM_SIZE (b)))));
+ && ((MEM_SIZE_KNOWN_P (a) && val_diff == MEM_SIZE (a))
+ || (MEM_SIZE_KNOWN_P (b) && val_diff == -MEM_SIZE (b))));
}
return false;
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index b34b70a27f4..288f291162b 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -6288,7 +6288,7 @@
&& VECTOR_UNIT_NONE_P (DFmode)"
"{fma|fmadd} %0,%1,%2,%3"
[(set_attr "type" "fp")
- (set_attr "fp_type" "fp_maddsub_s")])
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn "*fmsdf4_fpr"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -6299,7 +6299,7 @@
&& VECTOR_UNIT_NONE_P (DFmode)"
"{fms|fmsub} %0,%1,%2,%3"
[(set_attr "type" "fp")
- (set_attr "fp_type" "fp_maddsub_s")])
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn "*nfmadf4_fpr"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -6310,7 +6310,7 @@
&& VECTOR_UNIT_NONE_P (DFmode)"
"{fnma|fnmadd} %0,%1,%2,%3"
[(set_attr "type" "fp")
- (set_attr "fp_type" "fp_maddsub_s")])
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn "*nfmsdf4_fpr"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -6321,7 +6321,7 @@
&& VECTOR_UNIT_NONE_P (DFmode)"
"{fnms|fnmsub} %0,%1,%2,%3"
[(set_attr "type" "fp")
- (set_attr "fp_type" "fp_maddsub_s")])
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_expand "sqrtdf2"
[(set (match_operand:DF 0 "gpc_reg_operand" "")
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index b4d1e8b7509..e859af36e11 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -524,46 +524,112 @@
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
-;; Fused vector multiply/add instructions
-
-(define_insn "*vsx_fma<mode>4"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
- (fma:VSX_B
- (match_operand:VSX_B 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,0,wa,0")
- (match_operand:VSX_B 3 "vsx_register_operand" "0,<VSr>,0,wa")))]
- "VECTOR_UNIT_VSX_P (<MODE>mode)"
+;; Fused vector multiply/add instructions Support the classical DF versions of
+;; fma, which allows the target to be a separate register from the 3 inputs.
+;; Under VSX, the target must be either the addend or the first multiply.
+;; Where we can, also do the same for the Altivec V4SF fmas.
+
+(define_insn "*vsx_fmadf4"
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,d")
+ (fma:DF
+ (match_operand:DF 1 "vsx_register_operand" "%ws,ws,wa,wa,d")
+ (match_operand:DF 2 "vsx_register_operand" "ws,0,wa,0,d")
+ (match_operand:DF 3 "vsx_register_operand" "0,ws,0,wa,d")))]
+ "VECTOR_UNIT_VSX_P (DFmode)"
"@
- x<VSv>madda<VSs> %x0,%x1,%x2
- x<VSv>maddm<VSs> %x0,%x1,%x3
- x<VSv>madda<VSs> %x0,%x1,%x2
- x<VSv>maddm<VSs> %x0,%x1,%x3"
- [(set_attr "type" "<VStype_mul>")
- (set_attr "fp_type" "<VSfptype_mul>")])
+ xsmaddadp %x0,%x1,%x2
+ xsmaddmdp %x0,%x1,%x3
+ xsmaddadp %x0,%x1,%x2
+ xsmaddmdp %x0,%x1,%x3
+ {fma|fmadd} %0,%1,%2,%3"
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_d")])
+
+(define_insn "*vsx_fmav4sf4"
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,v")
+ (fma:V4SF
+ (match_operand:V4SF 1 "vsx_register_operand" "%ws,ws,wa,wa,v")
+ (match_operand:V4SF 2 "vsx_register_operand" "ws,0,wa,0,v")
+ (match_operand:V4SF 3 "vsx_register_operand" "0,ws,0,wa,v")))]
+ "VECTOR_UNIT_VSX_P (V4SFmode)"
+ "@
+ xvmaddasp %x0,%x1,%x2
+ xvmaddmsp %x0,%x1,%x3
+ xvmaddasp %x0,%x1,%x2
+ xvmaddmsp %x0,%x1,%x3
+ vmaddfp %0,%1,%2,%3"
+ [(set_attr "type" "vecfloat")])
+
+(define_insn "*vsx_fmav2df4"
+ [(set (match_operand:V2DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa")
+ (fma:V2DF
+ (match_operand:V2DF 1 "vsx_register_operand" "%ws,ws,wa,wa")
+ (match_operand:V2DF 2 "vsx_register_operand" "ws,0,wa,0")
+ (match_operand:V2DF 3 "vsx_register_operand" "0,ws,0,wa")))]
+ "VECTOR_UNIT_VSX_P (V2DFmode)"
+ "@
+ xvmaddadp %x0,%x1,%x2
+ xvmaddmdp %x0,%x1,%x3
+ xvmaddadp %x0,%x1,%x2
+ xvmaddmdp %x0,%x1,%x3"
+ [(set_attr "type" "vecfloat")])
+
+(define_insn "*vsx_fmsdf4"
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,d")
+ (fma:DF
+ (match_operand:DF 1 "vsx_register_operand" "%ws,ws,wa,wa,d")
+ (match_operand:DF 2 "vsx_register_operand" "ws,0,wa,0,d")
+ (neg:DF
+ (match_operand:DF 3 "vsx_register_operand" "0,ws,0,wa,d"))))]
+ "VECTOR_UNIT_VSX_P (DFmode)"
+ "@
+ xsmsubadp %x0,%x1,%x2
+ xsmsubmdp %x0,%x1,%x3
+ xsmsubadp %x0,%x1,%x2
+ xsmsubmdp %x0,%x1,%x3
+ {fms|fmsub} %0,%1,%2,%3"
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn "*vsx_fms<mode>4"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
- (fma:VSX_B
- (match_operand:VSX_B 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,0,wa,0")
- (neg:VSX_B
- (match_operand:VSX_B 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
+ (fma:VSX_F
+ (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
+ (neg:VSX_F
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"@
x<VSv>msuba<VSs> %x0,%x1,%x2
x<VSv>msubm<VSs> %x0,%x1,%x3
x<VSv>msuba<VSs> %x0,%x1,%x2
x<VSv>msubm<VSs> %x0,%x1,%x3"
- [(set_attr "type" "<VStype_mul>")
- (set_attr "fp_type" "<VSfptype_mul>")])
+ [(set_attr "type" "vecfloat")])
+
+(define_insn "*vsx_nfmadf4"
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,d")
+ (neg:DF
+ (fma:DF
+ (match_operand:DF 1 "vsx_register_operand" "ws,ws,wa,wa,d")
+ (match_operand:DF 2 "vsx_register_operand" "ws,0,wa,0,d")
+ (match_operand:DF 3 "vsx_register_operand" "0,ws,0,wa,d"))))]
+ "VECTOR_UNIT_VSX_P (DFmode)"
+ "@
+ xsnmaddadp %x0,%x1,%x2
+ xsnmaddmdp %x0,%x1,%x3
+ xsnmaddadp %x0,%x1,%x2
+ xsnmaddmdp %x0,%x1,%x3
+ {fnma|fnmadd} %0,%1,%2,%3"
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn "*vsx_nfma<mode>4"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
- (neg:VSX_B
- (fma:VSX_B
- (match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,0,wa,0")
- (match_operand:VSX_B 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
+ (neg:VSX_F
+ (fma:VSX_F
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"@
x<VSv>nmadda<VSs> %x0,%x1,%x2
@@ -573,22 +639,56 @@
[(set_attr "type" "<VStype_mul>")
(set_attr "fp_type" "<VSfptype_mul>")])
-(define_insn "*vsx_nfms<mode>4"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
- (neg:VSX_B
- (fma:VSX_B
- (match_operand:VSX_B 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,0,wa,0")
- (neg:VSX_B
- (match_operand:VSX_B 3 "vsx_register_operand" "0,<VSr>,0,wa")))))]
- "VECTOR_UNIT_VSX_P (<MODE>mode)"
+(define_insn "*vsx_nfmsdf4"
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,d")
+ (neg:DF
+ (fma:DF
+ (match_operand:DF 1 "vsx_register_operand" "%ws,ws,wa,wa,d")
+ (match_operand:DF 2 "vsx_register_operand" "ws,0,wa,0,d")
+ (neg:DF
+ (match_operand:DF 3 "vsx_register_operand" "0,ws,0,wa,d")))))]
+ "VECTOR_UNIT_VSX_P (DFmode)"
"@
- x<VSv>nmsuba<VSs> %x0,%x1,%x2
- x<VSv>nmsubm<VSs> %x0,%x1,%x3
- x<VSv>nmsuba<VSs> %x0,%x1,%x2
- x<VSv>nmsubm<VSs> %x0,%x1,%x3"
- [(set_attr "type" "<VStype_mul>")
- (set_attr "fp_type" "<VSfptype_mul>")])
+ xsnmsubadp %x0,%x1,%x2
+ xsnmsubmdp %x0,%x1,%x3
+ xsnmsubadp %x0,%x1,%x2
+ xsnmsubmdp %x0,%x1,%x3
+ {fnms|fnmsub} %0,%1,%2,%3"
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_d")])
+
+(define_insn "*vsx_nfmsv4sf4"
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,wf,?wa,?wa,v")
+ (neg:V4SF
+ (fma:V4SF
+ (match_operand:V4SF 1 "vsx_register_operand" "%wf,wf,wa,wa,v")
+ (match_operand:V4SF 2 "vsx_register_operand" "wf,0,wa,0,v")
+ (neg:V4SF
+ (match_operand:V4SF 3 "vsx_register_operand" "0,wf,0,wa,v")))))]
+ "VECTOR_UNIT_VSX_P (V4SFmode)"
+ "@
+ xvnmsubasp %x0,%x1,%x2
+ xvnmsubmsp %x0,%x1,%x3
+ xvnmsubasp %x0,%x1,%x2
+ xvnmsubmsp %x0,%x1,%x3
+ vnmsubfp %0,%1,%2,%3"
+ [(set_attr "type" "vecfloat")])
+
+(define_insn "*vsx_nfmsv2df4"
+ [(set (match_operand:V2DF 0 "vsx_register_operand" "=wd,wd,?wa,?wa")
+ (neg:V2DF
+ (fma:V2DF
+ (match_operand:V2DF 1 "vsx_register_operand" "%wd,wd,wa,wa")
+ (match_operand:V2DF 2 "vsx_register_operand" "wd,0,wa,0")
+ (neg:V2DF
+ (match_operand:V2DF 3 "vsx_register_operand" "0,wd,0,wa")))))]
+ "VECTOR_UNIT_VSX_P (V2DFmode)"
+ "@
+ xvnmsubadp %x0,%x1,%x2
+ xvnmsubmdp %x0,%x1,%x3
+ xvnmsubadp %x0,%x1,%x2
+ xvnmsubmdp %x0,%x1,%x3"
+ [(set_attr "type" "vecfloat")])
;; Vector conditional expressions (no scalar version for these instructions)
(define_insn "vsx_eq<mode>"
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index 79fce849a16..01a3584fe86 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -41,7 +41,7 @@ extern void s390_function_profiler (FILE *, int);
extern void s390_set_has_landing_pad_p (bool);
extern bool s390_hard_regno_mode_ok (unsigned int, enum machine_mode);
extern bool s390_hard_regno_rename_ok (unsigned int, unsigned int);
-extern bool s390_class_max_nregs (enum reg_class, enum machine_mode);
+extern int s390_class_max_nregs (enum reg_class, enum machine_mode);
#ifdef RTX_CODE
extern int s390_extra_constraint_str (rtx, int, const char *);
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index a91f4c1107c..d52765eb035 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -4099,7 +4099,7 @@ s390_expand_setmem (rtx dst, rtx len, rtx val)
DST is set to size 1 so the rest of the memory location
does not count as source operand. */
rtx dstp1 = adjust_address (dst, VOIDmode, 1);
- set_mem_size (dst, const1_rtx);
+ set_mem_size (dst, 1);
emit_insn (gen_movmem_short (dstp1, dst,
GEN_INT (INTVAL (len) - 2)));
@@ -4142,7 +4142,7 @@ s390_expand_setmem (rtx dst, rtx len, rtx val)
else
{
dstp1 = adjust_address (dst, VOIDmode, 1);
- set_mem_size (dst, const1_rtx);
+ set_mem_size (dst, 1);
/* Initialize memory by storing the first byte. */
emit_move_insn (adjust_address (dst, QImode, 0), val);
@@ -4551,7 +4551,7 @@ s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src)
GET_MODE_SIZE (word_mode) - size);
dest = adjust_address (dest, BLKmode, 0);
- set_mem_size (dest, GEN_INT (size));
+ set_mem_size (dest, size);
s390_expand_movmem (dest, src_mem, GEN_INT (size));
}
@@ -4569,7 +4569,7 @@ s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src)
emit_move_insn (adjust_address (dest, SImode, size),
gen_lowpart (SImode, src));
- set_mem_size (dest, GEN_INT (size));
+ set_mem_size (dest, size);
emit_move_insn (gen_rtx_ZERO_EXTRACT (word_mode, dest, GEN_INT
(stcmh_width), const0_rtx),
gen_rtx_LSHIFTRT (word_mode, src, GEN_INT
@@ -7572,7 +7572,7 @@ s390_hard_regno_rename_ok (unsigned int old_reg, unsigned int new_reg)
/* Maximum number of registers to represent a value of mode MODE
in a register of class RCLASS. */
-bool
+int
s390_class_max_nregs (enum reg_class rclass, enum machine_mode mode)
{
switch (rclass)
@@ -8868,7 +8868,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n",
(int)n_gpr, (int)n_fpr, off);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t, size_int (off));
+ t = fold_build_pointer_plus_hwi (t, off);
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
@@ -8880,8 +8880,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|| (cfun->va_list_fpr_size && n_fpr < FP_ARG_NUM_REG))
{
t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
- size_int (-RETURN_REGNUM * UNITS_PER_LONG));
+ t = fold_build_pointer_plus_hwi (t, -RETURN_REGNUM * UNITS_PER_LONG);
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
TREE_SIDE_EFFECTS (t) = 1;
@@ -9013,11 +9012,10 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
t = build3 (COND_EXPR, void_type_node, t, u, NULL_TREE);
gimplify_and_add (t, pre_p);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav,
- size_int (sav_ofs));
+ t = fold_build_pointer_plus_hwi (sav, sav_ofs);
u = build2 (MULT_EXPR, TREE_TYPE (reg), reg,
fold_convert (TREE_TYPE (reg), size_int (sav_scale)));
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, fold_convert (sizetype, u));
+ t = fold_build_pointer_plus (t, u);
gimplify_assign (addr, t, pre_p);
@@ -9030,15 +9028,13 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
t = ovf;
if (size < UNITS_PER_LONG)
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
- size_int (UNITS_PER_LONG - size));
+ t = fold_build_pointer_plus_hwi (t, UNITS_PER_LONG - size);
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
gimplify_assign (addr, t, pre_p);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
- size_int (size));
+ t = fold_build_pointer_plus_hwi (t, size);
gimplify_assign (ovf, t, pre_p);
gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 2779ec625c1..c04e0245b0d 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -3295,7 +3295,7 @@
int mask = ((1ul << size) - 1) << (GET_MODE_SIZE (SImode) - size);
operands[1] = adjust_address (operands[1], BLKmode, 0);
- set_mem_size (operands[1], GEN_INT (size));
+ set_mem_size (operands[1], size);
operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - bitsize);
operands[3] = GEN_INT (mask);
})
@@ -3322,7 +3322,7 @@
int mask = ((1ul << size) - 1) << (GET_MODE_SIZE (SImode) - size);
operands[1] = adjust_address (operands[1], BLKmode, 0);
- set_mem_size (operands[1], GEN_INT (size));
+ set_mem_size (operands[1], size);
operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - bitsize);
operands[3] = GEN_INT (mask);
})
@@ -3656,7 +3656,7 @@
(clobber (reg:CC CC_REGNUM))])]
{
operands[1] = adjust_address (operands[1], BLKmode, 0);
- set_mem_size (operands[1], GEN_INT (GET_MODE_SIZE (QImode)));
+ set_mem_size (operands[1], GET_MODE_SIZE (QImode));
operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode)
- GET_MODE_BITSIZE (QImode));
})
diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h
index 1f9975600fe..3c8851a602f 100644
--- a/gcc/config/score/score.h
+++ b/gcc/config/score/score.h
@@ -418,11 +418,6 @@ extern enum reg_class score_char_to_class[256];
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
score_secondary_reload_class (CLASS, MODE, X)
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
(GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
? reg_classes_intersect_p (HI_REG, (CLASS)) : 0)
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index d945156ee86..70fbf884bce 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1456,7 +1456,7 @@ expand_block_move (rtx *operands)
rtx from = adjust_automodify_address (src, BLKmode,
src_addr, copied);
- set_mem_size (from, GEN_INT (4));
+ set_mem_size (from, 4);
emit_insn (gen_movua (temp, from));
emit_move_insn (src_addr, plus_constant (src_addr, 4));
emit_move_insn (to, temp);
@@ -7831,8 +7831,7 @@ sh_va_start (tree valist, rtx nextarg)
nfp = 8 - nfp;
else
nfp = 0;
- u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
- size_int (UNITS_PER_WORD * nfp));
+ u = fold_build_pointer_plus_hwi (u, UNITS_PER_WORD * nfp);
t = build2 (MODIFY_EXPR, ptr_type_node, next_fp_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -7846,8 +7845,7 @@ sh_va_start (tree valist, rtx nextarg)
nint = 4 - nint;
else
nint = 0;
- u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
- size_int (UNITS_PER_WORD * nint));
+ u = fold_build_pointer_plus_hwi (u, UNITS_PER_WORD * nint);
t = build2 (MODIFY_EXPR, ptr_type_node, next_o_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -7983,8 +7981,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
gimplify_assign (unshare_expr (next_fp_tmp), valist, pre_p);
tmp = next_fp_limit;
if (size > 4 && !is_double)
- tmp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (tmp),
- unshare_expr (tmp), size_int (4 - size));
+ tmp = fold_build_pointer_plus_hwi (unshare_expr (tmp), 4 - size);
tmp = build2 (GE_EXPR, boolean_type_node,
unshare_expr (next_fp_tmp), unshare_expr (tmp));
cmp = build3 (COND_EXPR, void_type_node, tmp,
@@ -7999,8 +7996,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
tmp = fold_convert (sizetype, next_fp_tmp);
tmp = build2 (BIT_AND_EXPR, sizetype, tmp,
size_int (UNITS_PER_WORD));
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
- unshare_expr (next_fp_tmp), tmp);
+ tmp = fold_build_pointer_plus (unshare_expr (next_fp_tmp), tmp);
gimplify_assign (unshare_expr (next_fp_tmp), tmp, pre_p);
}
if (is_double)
@@ -8045,8 +8041,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
}
else
{
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
- unshare_expr (next_o), size_int (rsize));
+ tmp = fold_build_pointer_plus_hwi (unshare_expr (next_o), rsize);
tmp = build2 (GT_EXPR, boolean_type_node, tmp,
unshare_expr (next_o_limit));
tmp = build3 (COND_EXPR, void_type_node, tmp,
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index e261d333964..0f7c8a77629 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -11070,7 +11070,7 @@ mov.l\\t1f,r0\\n\\
&& MEM_P (operands[1]) && MEM_ALIGN (operands[1]) < 32)
{
rtx src = adjust_address (operands[1], BLKmode, 0);
- set_mem_size (src, GEN_INT (4));
+ set_mem_size (src, 4);
emit_insn (gen_movua (operands[0], src));
DONE;
}
@@ -11102,7 +11102,7 @@ mov.l\\t1f,r0\\n\\
&& MEM_P (operands[1]) && MEM_ALIGN (operands[1]) < 32)
{
rtx src = adjust_address (operands[1], BLKmode, 0);
- set_mem_size (src, GEN_INT (4));
+ set_mem_size (src, 4);
emit_insn (gen_movua (operands[0], src));
DONE;
}
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index a65b8366506..05cc3a4ea6b 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -6677,8 +6677,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
incr = valist;
if (align)
{
- incr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr,
- size_int (align - 1));
+ incr = fold_build_pointer_plus_hwi (incr, align - 1);
incr = fold_convert (sizetype, incr);
incr = fold_build2 (BIT_AND_EXPR, sizetype, incr,
size_int (-align));
@@ -6689,8 +6688,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
addr = incr;
if (BYTES_BIG_ENDIAN && size < rsize)
- addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr,
- size_int (rsize - size));
+ addr = fold_build_pointer_plus_hwi (incr, rsize - size);
if (indirect)
{
@@ -6714,8 +6712,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
else
addr = fold_convert (ptrtype, addr);
- incr
- = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr, size_int (rsize));
+ incr = fold_build_pointer_plus_hwi (incr, rsize);
gimplify_assign (valist, incr, post_p);
return build_va_arg_indirect_ref (addr);
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 7d9be5e3236..c6db6c3b3b0 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -4181,17 +4181,15 @@ spu_va_start (tree valist, rtx nextarg)
/* Find the __args area. */
t = make_tree (TREE_TYPE (args), nextarg);
if (crtl->args.pretend_args_size > 0)
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (args), t,
- size_int (-STACK_POINTER_OFFSET));
+ t = fold_build_pointer_plus_hwi (t, -STACK_POINTER_OFFSET);
t = build2 (MODIFY_EXPR, TREE_TYPE (args), args, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Find the __skip area. */
t = make_tree (TREE_TYPE (skip), virtual_incoming_args_rtx);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (skip), t,
- size_int (crtl->args.pretend_args_size
- - STACK_POINTER_OFFSET));
+ t = fold_build_pointer_plus_hwi (t, (crtl->args.pretend_args_size
+ - STACK_POINTER_OFFSET));
t = build2 (MODIFY_EXPR, TREE_TYPE (skip), skip, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -4221,7 +4219,7 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p,
tree f_args, f_skip;
tree args, skip;
HOST_WIDE_INT size, rsize;
- tree paddedsize, addr, tmp;
+ tree addr, tmp;
bool pass_by_reference_p;
f_args = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
@@ -4246,21 +4244,20 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p,
/* build conditional expression to calculate addr. The expression
will be gimplified later. */
- paddedsize = size_int (rsize);
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (args), paddedsize);
+ tmp = fold_build_pointer_plus_hwi (unshare_expr (args), rsize);
tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
build2 (GT_EXPR, boolean_type_node, tmp, unshare_expr (skip)),
build2 (LE_EXPR, boolean_type_node, unshare_expr (args),
unshare_expr (skip)));
tmp = build3 (COND_EXPR, ptr_type_node, tmp,
- build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (skip),
- size_int (32)), unshare_expr (args));
+ fold_build_pointer_plus_hwi (unshare_expr (skip), 32),
+ unshare_expr (args));
gimplify_assign (addr, tmp, pre_p);
/* update VALIST.__args */
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, paddedsize);
+ tmp = fold_build_pointer_plus_hwi (addr, rsize);
gimplify_assign (unshare_expr (args), tmp, pre_p);
addr = fold_convert (build_pointer_type_for_mode (type, ptr_mode, true),
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 16258911ef3..c69cf7efc4e 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -225,9 +225,6 @@ enum reg_class {
#define INT_REG_OK_FOR_BASE_P(X,STRICT) \
((!(STRICT) || REGNO_OK_FOR_BASE_P (REGNO (X))))
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* GCC assumes that modes are in the lowpart of a register, which is
only true for SPU. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 97965280cb9..910dc2e302f 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1292,7 +1292,7 @@ xstormy16_expand_builtin_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
t = make_tree (TREE_TYPE (base), virtual_incoming_args_rtx);
u = build_int_cst (NULL_TREE, - INCOMING_FRAME_SP_OFFSET);
u = fold_convert (TREE_TYPE (count), u);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), t, u);
+ t = fold_build_pointer_plus (t, u);
t = build2 (MODIFY_EXPR, TREE_TYPE (base), base, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -1350,7 +1350,7 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
NULL_TREE);
gimplify_and_add (t, pre_p);
- t = build2 (POINTER_PLUS_EXPR, ptr_type_node, base, count_tmp);
+ t = fold_build_pointer_plus (base, count_tmp);
gimplify_assign (addr, t, pre_p);
t = build1 (GOTO_EXPR, void_type_node, lab_gotaddr);
@@ -1385,7 +1385,7 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
fold_convert (TREE_TYPE (count), size_tree));
t = fold_convert (TREE_TYPE (t), fold (t));
t = fold_build1 (NEGATE_EXPR, TREE_TYPE (t), t);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), base, t);
+ t = fold_build_pointer_plus (base, t);
gimplify_assign (addr, t, pre_p);
t = build1 (LABEL_EXPR, void_type_node, lab_gotaddr);
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 871e523a67b..43833625608 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -227,9 +227,6 @@ enum reg_class
#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
xstormy16_secondary_reload_class (CLASS, MODE, X)
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Basic Stack Layout. */
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 0784d89bf67..f5b64deab2b 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -341,12 +341,6 @@ enum reg_class
#define REGNO_OK_FOR_INDEX_P(regno) 0
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Convenience wrappers around insn_const_int_ok_for_constraint. */
#define CONST_OK_FOR_I(VALUE) \
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index a3e9d83e8f8..0c835637ae1 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -219,11 +219,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define REG_CLASS_NAMES \
{ "NO_REGS", "ALL_REGS" }
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
/* Define which registers fit in which classes.
This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */
@@ -242,12 +237,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define INDEX_REG_CLASS ALL_REGS
#define BASE_REG_CLASS ALL_REGS
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-/* On the VAX, this is always the size of MODE in words,
- since all registers are the same size. */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
/* Stack layout; function entry, exit and calling. */
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index ef246a0aeec..5ba468131e0 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -2853,7 +2853,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
/* Set the __va_stk member to ($arg_ptr - 32). */
u = make_tree (ptr_type_node, virtual_incoming_args_rtx);
- u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u, size_int (-32));
+ u = fold_build_pointer_plus_hwi (u, -32);
t = build2 (MODIFY_EXPR, ptr_type_node, stk, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -3042,7 +3042,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
t = fold_convert (sizetype, unshare_expr (ndx));
t = build2 (MINUS_EXPR, sizetype, t, size);
- addr = build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (array), t);
+ addr = fold_build_pointer_plus (unshare_expr (array), t);
addr = fold_convert (build_pointer_type (type), addr);
if (indirect)
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index d3ce1479443..b1a24c6d86d 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -450,15 +450,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
the RTL, as either incoming or outgoing arguments. */
#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
-/* Return the maximum number of consecutive registers
- needed to represent mode MODE in a register of class CLASS. */
-#define CLASS_UNITS(mode, size) \
- ((GET_MODE_SIZE (mode) + (size) - 1) / (size))
-
-#define CLASS_MAX_NREGS(CLASS, MODE) \
- (CLASS_UNITS (MODE, UNITS_PER_WORD))
-
-
/* Stack layout; function entry, exit and calling. */
#define STACK_GROWS_DOWNWARD
diff --git a/gcc/configure b/gcc/configure
index 0d6b7108d08..0295fc67dfe 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -10899,7 +10899,7 @@ case ${enable_threads} in
# default
target_thread_file='single'
;;
- aix | dce | lynx | mipssde | nks | posix | posix95 | rtems | \
+ aix | dce | lynx | mipssde | posix | posix95 | rtems | \
single | tpf | vxworks | win32)
target_thread_file=${enable_threads}
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index c2163bf70d5..54b6c9d88cd 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1340,7 +1340,7 @@ case ${enable_threads} in
# default
target_thread_file='single'
;;
- aix | dce | lynx | mipssde | nks | posix | posix95 | rtems | \
+ aix | dce | lynx | mipssde | posix | posix95 | rtems | \
single | tpf | vxworks | win32)
target_thread_file=${enable_threads}
;;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d27ba873d6e..e314ae2a614 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,51 @@
+2011-07-20 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_initializer_list): Handle C99 .id= and [N]=
+ designated initializer syntax.
+ * decl.c (check_array_designated_initializer): Add index parm.
+ (maybe_deduce_size_from_array_init): Pass it.
+ (reshape_init_array_1): Likewise.
+
+ PR c++/6709 (DR 743)
+ PR c++/42603 (DR 950)
+ * parser.c (token_is_decltype, cp_lexer_next_token_is_decltype): New.
+ (cp_parser_nested_name_specifier_opt): Allow decltype.
+ (cp_parser_qualifying_entity): Likewise.
+ (cp_parser_decltype): Replace source tokens with CPP_DECLTYPE.
+ (cp_parser_simple_type_specifier): Handle decltype as scope.
+ (cp_parser_base_specifier): Allow decltype.
+ (cp_parser_base_clause): Don't crash on null base.
+ * parser.h (CPP_KEYWORD, CPP_TEMPLATE_ID): Move to c-common.h.
+ (CPP_NESTED_NAME_SPECIFIER, N_CP_TTYPES): Likewise.
+
+2011-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/49785
+ * pt.c (coerce_template_parms): Handle non-pack after pack.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * call.c (build_special_member_call): Use fold_build_pointer_plus.
+ * class.c (build_base_path): Likewise.
+ (convert_to_base_statically): Likewise.
+ (dfs_accumulate_vtbl_inits): Likewise.
+ * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
+ * except.c (expand_start_catch_block): Likewise.
+ * init.c (expand_virtual_init): Likewise.
+ (build_new_1): Likewise.
+ (build_vec_delete_1): Likewise.
+ (build_vec_delete): Likewise.
+ * rtti.c (build_headof): Likewise.
+ (tinfo_base_init): Likewise.
+ * typeck.c (get_member_function_from_ptrfunc): Likewise.
+ (cp_build_addr_expr_1): Likewise.
+ * typeck2.c (build_m_component_ref): Likewise.
+
+2011-07-18 Martin Jambor <mjambor@suse.cz>
+
+ * parser.c (cp_parser_parameter_declaration_list): Initialize
+ parenthesized_p.
+
2011-07-16 Jason Merrill <jason@redhat.com>
* pt.c (tinst_level_tick, last_template_error_tick): Replace with
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 99f9cc3d25a..2eab78266f8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7062,8 +7062,7 @@ build_special_member_call (tree instance, tree name, VEC(tree,gc) **args,
current_vtt_parm,
vtt);
gcc_assert (BINFO_SUBVTT_INDEX (binfo));
- sub_vtt = build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtt), vtt,
- BINFO_SUBVTT_INDEX (binfo));
+ sub_vtt = fold_build_pointer_plus (vtt, BINFO_SUBVTT_INDEX (binfo));
if (args == NULL)
{
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 61c1380d7b2..26b7abe903d 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -374,8 +374,7 @@ build_base_path (enum tree_code code,
tf_warning_or_error),
TREE_TYPE (TREE_TYPE (expr)));
- v_offset = build2 (POINTER_PLUS_EXPR, TREE_TYPE (v_offset),
- v_offset, fold_convert (sizetype, BINFO_VPTR_FIELD (v_binfo)));
+ v_offset = fold_build_pointer_plus (v_offset, BINFO_VPTR_FIELD (v_binfo));
v_offset = build1 (NOP_EXPR,
build_pointer_type (ptrdiff_type_node),
v_offset);
@@ -413,7 +412,7 @@ build_base_path (enum tree_code code,
offset = fold_convert (sizetype, offset);
if (code == MINUS_EXPR)
offset = fold_build1_loc (input_location, NEGATE_EXPR, sizetype, offset);
- expr = build2 (POINTER_PLUS_EXPR, ptr_target_type, expr, offset);
+ expr = fold_build_pointer_plus (expr, offset);
}
else
null_test = NULL;
@@ -540,10 +539,6 @@ convert_to_base_statically (tree expr, tree base)
expr_type = TREE_TYPE (expr);
if (!SAME_BINFO_TYPE_P (BINFO_TYPE (base), expr_type))
{
- tree pointer_type;
-
- pointer_type = build_pointer_type (expr_type);
-
/* We use fold_build2 and fold_convert below to simplify the trees
provided to the optimizers. It is not safe to call these functions
when processing a template because they do not handle C++-specific
@@ -551,9 +546,8 @@ convert_to_base_statically (tree expr, tree base)
gcc_assert (!processing_template_decl);
expr = cp_build_addr_expr (expr, tf_warning_or_error);
if (!integer_zerop (BINFO_OFFSET (base)))
- expr = fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, pointer_type, expr,
- fold_convert (sizetype, BINFO_OFFSET (base)));
+ expr = fold_build_pointer_plus_loc (input_location,
+ expr, BINFO_OFFSET (base));
expr = fold_convert (build_pointer_type (BINFO_TYPE (base)), expr);
expr = build_fold_indirect_ref_loc (input_location, expr);
}
@@ -7833,13 +7827,10 @@ dfs_accumulate_vtbl_inits (tree binfo,
/* Figure out the position to which the VPTR should point. */
vtbl = build1 (ADDR_EXPR, vtbl_ptr_type_node, orig_vtbl);
- index = size_binop (PLUS_EXPR,
- size_int (non_fn_entries),
- size_int (n_inits));
index = size_binop (MULT_EXPR,
TYPE_SIZE_UNIT (vtable_entry_type),
- index);
- vtbl = build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index);
+ size_int (non_fn_entries + n_inits));
+ vtbl = fold_build_pointer_plus (vtbl, index);
}
if (ctor_vtbl_p)
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index d26c0e0ca51..2b4e70a75ef 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1230,7 +1230,7 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
start2 = build_fold_addr_expr_loc (input_location, start2);
end1 = TYPE_SIZE_UNIT (TREE_TYPE (arg1));
- end1 = build2 (POINTER_PLUS_EXPR, TREE_TYPE (start1), start1, end1);
+ end1 = fold_build_pointer_plus (start1, end1);
p1 = create_tmp_var (TREE_TYPE (start1), NULL);
t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, start1);
@@ -1260,15 +1260,13 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
append_to_statement_list (t, &ret);
- t = TYPE_SIZE_UNIT (inner_type);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p1), p1, t);
+ t = fold_build_pointer_plus (p1, TYPE_SIZE_UNIT (inner_type));
t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, t);
append_to_statement_list (t, &ret);
if (arg2)
{
- t = TYPE_SIZE_UNIT (inner_type);
- t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p2), p2, t);
+ t = fold_build_pointer_plus (p2, TYPE_SIZE_UNIT (inner_type));
t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, t);
append_to_statement_list (t, &ret);
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2742af5c2bb..067930375a8 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4648,7 +4648,8 @@ build_init_list_var_init (tree decl, tree type, tree init, tree *array_init,
is valid, i.e., does not have a designated initializer. */
static bool
-check_array_designated_initializer (const constructor_elt *ce)
+check_array_designated_initializer (const constructor_elt *ce,
+ unsigned HOST_WIDE_INT index)
{
/* Designated initializers for array elements are not supported. */
if (ce->index)
@@ -4659,8 +4660,13 @@ check_array_designated_initializer (const constructor_elt *ce)
error ("name used in a GNU-style designated "
"initializer for an array");
else if (TREE_CODE (ce->index) == INTEGER_CST)
- /* An index added by reshape_init. */
- return true;
+ {
+ /* A C99 designator is OK if it matches the current index. */
+ if (TREE_INT_CST_LOW (ce->index) == index)
+ return true;
+ else
+ sorry ("non-trivial designated initializers not supported");
+ }
else
{
gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE);
@@ -4702,7 +4708,7 @@ maybe_deduce_size_from_array_init (tree decl, tree init)
constructor_elt *ce;
HOST_WIDE_INT i;
FOR_EACH_VEC_ELT (constructor_elt, v, i, ce)
- if (!check_array_designated_initializer (ce))
+ if (!check_array_designated_initializer (ce, i))
failure = 1;
}
@@ -4961,7 +4967,7 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d,
{
tree elt_init;
- check_array_designated_initializer (d->cur);
+ check_array_designated_initializer (d->cur, index);
elt_init = reshape_init_r (elt_type, d, /*first_initializer_p=*/false,
complain);
if (elt_init == error_mark_node)
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index c37815d242d..129d2f43441 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -452,10 +452,10 @@ expand_start_catch_block (tree decl)
generic exception header. */
exp = build_exc_ptr ();
exp = build1 (NOP_EXPR, build_pointer_type (type), exp);
- exp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (exp), exp,
+ exp = fold_build_pointer_plus (exp,
fold_build1_loc (input_location,
- NEGATE_EXPR, sizetype,
- TYPE_SIZE_UNIT (TREE_TYPE (exp))));
+ NEGATE_EXPR, sizetype,
+ TYPE_SIZE_UNIT (TREE_TYPE (exp))));
exp = cp_build_indirect_ref (exp, RO_NULL, tf_warning_or_error);
initialize_handler_parm (decl, exp);
return type;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 7970b9ac476..52b948441f2 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1063,10 +1063,7 @@ expand_virtual_init (tree binfo, tree decl)
/* Compute the value to use, when there's a VTT. */
vtt_parm = current_vtt_parm;
- vtbl2 = build2 (POINTER_PLUS_EXPR,
- TREE_TYPE (vtt_parm),
- vtt_parm,
- vtt_index);
+ vtbl2 = fold_build_pointer_plus (vtt_parm, vtt_index);
vtbl2 = cp_build_indirect_ref (vtbl2, RO_NULL, tf_warning_or_error);
vtbl2 = convert (TREE_TYPE (vtbl), vtbl2);
@@ -2310,16 +2307,14 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
tree size_ptr_type;
/* Adjust so we're pointing to the start of the object. */
- data_addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (alloc_node),
- alloc_node, cookie_size);
+ data_addr = fold_build_pointer_plus (alloc_node, cookie_size);
/* Store the number of bytes allocated so that we can know how
many elements to destroy later. We use the last sizeof
(size_t) bytes to store the number of elements. */
cookie_ptr = size_binop (MINUS_EXPR, cookie_size, size_in_bytes (sizetype));
- cookie_ptr = fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, TREE_TYPE (alloc_node),
- alloc_node, cookie_ptr);
+ cookie_ptr = fold_build_pointer_plus_loc (input_location,
+ alloc_node, cookie_ptr);
size_ptr_type = build_pointer_type (sizetype);
cookie_ptr = fold_convert (size_ptr_type, cookie_ptr);
cookie = cp_build_indirect_ref (cookie_ptr, RO_NULL, complain);
@@ -2329,10 +2324,10 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
if (targetm.cxx.cookie_has_size ())
{
/* Also store the element size. */
- cookie_ptr = build2 (POINTER_PLUS_EXPR, size_ptr_type, cookie_ptr,
+ cookie_ptr = fold_build_pointer_plus (cookie_ptr,
fold_build1_loc (input_location,
- NEGATE_EXPR, sizetype,
- size_in_bytes (sizetype)));
+ NEGATE_EXPR, sizetype,
+ size_in_bytes (sizetype)));
cookie = cp_build_indirect_ref (cookie_ptr, RO_NULL, complain);
cookie = build2 (MODIFY_EXPR, sizetype, cookie,
@@ -2801,12 +2796,13 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
convert (sizetype, maxindex));
tbase = create_temporary_var (ptype);
- tbase_init = cp_build_modify_expr (tbase, NOP_EXPR,
- fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, ptype,
- fold_convert (ptype, base),
- virtual_size),
- complain);
+ tbase_init
+ = cp_build_modify_expr (tbase, NOP_EXPR,
+ fold_build_pointer_plus_loc (input_location,
+ fold_convert (ptype,
+ base),
+ virtual_size),
+ complain);
if (tbase_init == error_mark_node)
return error_mark_node;
controller = build3 (BIND_EXPR, void_type_node, tbase,
@@ -2817,7 +2813,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
build2 (EQ_EXPR, boolean_type_node, tbase,
fold_convert (ptype, base)));
tmp = fold_build1_loc (input_location, NEGATE_EXPR, sizetype, size_exp);
- tmp = build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp);
+ tmp = fold_build_pointer_plus (tbase, tmp);
tmp = cp_build_modify_expr (tbase, NOP_EXPR, tmp, complain);
if (tmp == error_mark_node)
return error_mark_node;
@@ -3751,10 +3747,8 @@ build_vec_delete (tree base, tree maxindex,
type = strip_array_types (TREE_TYPE (type));
cookie_addr = fold_build1_loc (input_location, NEGATE_EXPR,
sizetype, TYPE_SIZE_UNIT (sizetype));
- cookie_addr = build2 (POINTER_PLUS_EXPR,
- size_ptr_type,
- fold_convert (size_ptr_type, base),
- cookie_addr);
+ cookie_addr = fold_build_pointer_plus (fold_convert (size_ptr_type, base),
+ cookie_addr);
maxindex = cp_build_indirect_ref (cookie_addr, RO_NULL, complain);
}
else if (TREE_CODE (type) == ARRAY_TYPE)
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 5fcedcd2e56..285180152e3 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -663,6 +663,24 @@ cp_lexer_next_token_is_decl_specifier_keyword (cp_lexer *lexer)
}
}
+/* Returns TRUE iff the token T begins a decltype type. */
+
+static bool
+token_is_decltype (cp_token *t)
+{
+ return (t->keyword == RID_DECLTYPE
+ || t->type == CPP_DECLTYPE);
+}
+
+/* Returns TRUE iff the next token begins a decltype type. */
+
+static bool
+cp_lexer_next_token_is_decltype (cp_lexer *lexer)
+{
+ cp_token *t = cp_lexer_peek_token (lexer);
+ return token_is_decltype (t);
+}
+
/* Return a pointer to the Nth token in the token stream. If N is 1,
then this is precisely equivalent to cp_lexer_peek_token (except
that it is not inline). One would like to disallow that case, but
@@ -4313,6 +4331,9 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
/* A template-id can start a nested-name-specifier. */
else if (token->type == CPP_TEMPLATE_ID)
;
+ /* DR 743: decltype can be used in a nested-name-specifier. */
+ else if (token_is_decltype (token))
+ ;
else
{
/* If the next token is not an identifier, then it is
@@ -4386,6 +4407,28 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
class-or-namespace-name. */
parser->scope = old_scope;
parser->qualifying_scope = saved_qualifying_scope;
+
+ /* If the next token is a decltype, and the one after that is a
+ `::', then the decltype has failed to resolve to a class or
+ enumeration type. Give this error even when parsing
+ tentatively since it can't possibly be valid--and we're going
+ to replace it with a CPP_NESTED_NAME_SPECIFIER below, so we
+ won't get another chance.*/
+ if (cp_lexer_next_token_is (parser->lexer, CPP_DECLTYPE)
+ && (cp_lexer_peek_nth_token (parser->lexer, 2)->type
+ == CPP_SCOPE))
+ {
+ token = cp_lexer_consume_token (parser->lexer);
+ error_at (token->location, "decltype evaluates to %qT, "
+ "which is not a class or enumeration type",
+ token->u.value);
+ parser->scope = error_mark_node;
+ error_p = true;
+ /* As below. */
+ success = true;
+ cp_lexer_consume_token (parser->lexer);
+ }
+
if (cp_parser_uncommitted_to_tentative_parse_p (parser))
break;
/* If the next token is an identifier, and the one after
@@ -4585,6 +4628,19 @@ cp_parser_qualifying_entity (cp_parser *parser,
bool only_class_p;
bool successful_parse_p;
+ /* DR 743: decltype can appear in a nested-name-specifier. */
+ if (cp_lexer_next_token_is_decltype (parser->lexer))
+ {
+ scope = cp_parser_decltype (parser);
+ if (TREE_CODE (scope) != ENUMERAL_TYPE
+ && !MAYBE_CLASS_TYPE_P (scope))
+ {
+ cp_parser_simulate_error (parser);
+ return error_mark_node;
+ }
+ return TYPE_NAME (scope);
+ }
+
/* Before we try to parse the class-name, we must save away the
current PARSER->SCOPE since cp_parser_class_name will destroy
it. */
@@ -10197,6 +10253,14 @@ cp_parser_decltype (cp_parser *parser)
bool saved_integral_constant_expression_p;
bool saved_non_integral_constant_expression_p;
cp_token *id_expr_start_token;
+ cp_token *start_token = cp_lexer_peek_token (parser->lexer);
+
+ if (start_token->type == CPP_DECLTYPE)
+ {
+ /* Already parsed. */
+ cp_lexer_consume_token (parser->lexer);
+ return start_token->u.value;
+ }
/* Look for the `decltype' token. */
if (!cp_parser_require_keyword (parser, RID_DECLTYPE, RT_DECLTYPE))
@@ -10350,14 +10414,6 @@ cp_parser_decltype (cp_parser *parser)
parser->non_integral_constant_expression_p
= saved_non_integral_constant_expression_p;
- if (expr == error_mark_node)
- {
- /* Skip everything up to the closing `)'. */
- cp_parser_skip_to_closing_parenthesis (parser, true, false,
- /*consume_paren=*/true);
- return error_mark_node;
- }
-
/* Parse to the closing `)'. */
if (!cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN))
{
@@ -10366,8 +10422,17 @@ cp_parser_decltype (cp_parser *parser)
return error_mark_node;
}
- return finish_decltype_type (expr, id_expression_or_member_access_p,
+ expr = finish_decltype_type (expr, id_expression_or_member_access_p,
tf_warning_or_error);
+
+ /* Replace the decltype with a CPP_DECLTYPE so we don't need to parse
+ it again. */
+ start_token->type = CPP_DECLTYPE;
+ start_token->u.value = expr;
+ start_token->keyword = RID_MAX;
+ cp_lexer_purge_tokens_after (parser->lexer, start_token);
+
+ return expr;
}
/* Special member functions [gram.special] */
@@ -12679,15 +12744,13 @@ cp_parser_simple_type_specifier (cp_parser* parser,
break;
case RID_DECLTYPE:
- /* Parse the `decltype' type. */
- type = cp_parser_decltype (parser);
-
- if (decl_specs)
- cp_parser_set_decl_spec_type (decl_specs, type,
- token->location,
- /*user_defined_p=*/true);
-
- return type;
+ /* Since DR 743, decltype can either be a simple-type-specifier by
+ itself or begin a nested-name-specifier. Parsing it will replace
+ it with a CPP_DECLTYPE, so just rewind and let the CPP_DECLTYPE
+ handling below decide what to do. */
+ cp_parser_decltype (parser);
+ cp_lexer_set_token_position (parser->lexer, token);
+ break;
case RID_TYPEOF:
/* Consume the `typeof' token. */
@@ -12719,6 +12782,20 @@ cp_parser_simple_type_specifier (cp_parser* parser,
break;
}
+ /* If token is an already-parsed decltype not followed by ::,
+ it's a simple-type-specifier. */
+ if (token->type == CPP_DECLTYPE
+ && cp_lexer_peek_nth_token (parser->lexer, 2)->type != CPP_SCOPE)
+ {
+ type = token->u.value;
+ if (decl_specs)
+ cp_parser_set_decl_spec_type (decl_specs, type,
+ token->location,
+ /*user_defined_p=*/true);
+ cp_lexer_consume_token (parser->lexer);
+ return type;
+ }
+
/* If the type-specifier was for a built-in type, we're done. */
if (type)
{
@@ -15921,7 +15998,7 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
{
cp_parameter_declarator *parameter;
tree decl = error_mark_node;
- bool parenthesized_p;
+ bool parenthesized_p = false;
/* Parse the parameter. */
parameter
= cp_parser_parameter_declaration (parser,
@@ -16616,8 +16693,13 @@ cp_parser_braced_list (cp_parser* parser, bool* non_constant_p)
GNU Extension:
initializer-list:
- identifier : initializer-clause
- initializer-list, identifier : initializer-clause
+ designation initializer-clause ...[opt]
+ initializer-list , designation initializer-clause ...[opt]
+
+ designation:
+ . identifier =
+ identifier :
+ [ constant-expression ] =
Returns a VEC of constructor_elt. The VALUE of each elt is an expression
for the initializer. If the INDEX of the elt is non-NULL, it is the
@@ -16636,7 +16718,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
while (true)
{
cp_token *token;
- tree identifier;
+ tree designator;
tree initializer;
bool clause_non_constant_p;
@@ -16651,12 +16733,38 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
pedwarn (input_location, OPT_pedantic,
"ISO C++ does not allow designated initializers");
/* Consume the identifier. */
- identifier = cp_lexer_consume_token (parser->lexer)->u.value;
+ designator = cp_lexer_consume_token (parser->lexer)->u.value;
/* Consume the `:'. */
cp_lexer_consume_token (parser->lexer);
}
+ /* Also handle the C99 syntax, '. id ='. */
+ else if (cp_parser_allow_gnu_extensions_p (parser)
+ && cp_lexer_next_token_is (parser->lexer, CPP_DOT)
+ && cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME
+ && cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_EQ)
+ {
+ /* Warn the user that they are using an extension. */
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ does not allow C99 designated initializers");
+ /* Consume the `.'. */
+ cp_lexer_consume_token (parser->lexer);
+ /* Consume the identifier. */
+ designator = cp_lexer_consume_token (parser->lexer)->u.value;
+ /* Consume the `='. */
+ cp_lexer_consume_token (parser->lexer);
+ }
+ /* Also handle C99 array designators, '[ const ] ='. */
+ else if (cp_parser_allow_gnu_extensions_p (parser)
+ && !c_dialect_objc ()
+ && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ designator = cp_parser_constant_expression (parser, false, NULL);
+ cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
+ cp_parser_require (parser, CPP_EQ, RT_EQ);
+ }
else
- identifier = NULL_TREE;
+ designator = NULL_TREE;
/* Parse the initializer. */
initializer = cp_parser_initializer_clause (parser,
@@ -16677,7 +16785,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
}
/* Add it to the vector. */
- CONSTRUCTOR_APPEND_ELT(v, identifier, initializer);
+ CONSTRUCTOR_APPEND_ELT (v, designator, initializer);
/* If the next token is not a comma, we have reached the end of
the list. */
@@ -18232,12 +18340,11 @@ cp_parser_base_clause (cp_parser* parser)
}
/* Add BASE to the front of the list. */
- if (base != error_mark_node)
+ if (base && base != error_mark_node)
{
if (pack_expansion_p)
/* Make this a pack expansion type. */
TREE_VALUE (base) = make_pack_expansion (TREE_VALUE (base));
-
if (!check_for_bare_parameter_packs (TREE_VALUE (base)))
{
@@ -18379,19 +18486,27 @@ cp_parser_base_specifier (cp_parser* parser)
class_scope_p = (parser->scope && TYPE_P (parser->scope));
template_p = class_scope_p && cp_parser_optional_template_keyword (parser);
- /* Finally, look for the class-name. */
- type = cp_parser_class_name (parser,
- class_scope_p,
- template_p,
- typename_type,
- /*check_dependency_p=*/true,
- /*class_head_p=*/false,
- /*is_declaration=*/true);
+ if (!parser->scope
+ && cp_lexer_next_token_is_decltype (parser->lexer))
+ /* DR 950 allows decltype as a base-specifier. */
+ type = cp_parser_decltype (parser);
+ else
+ {
+ /* Otherwise, look for the class-name. */
+ type = cp_parser_class_name (parser,
+ class_scope_p,
+ template_p,
+ typename_type,
+ /*check_dependency_p=*/true,
+ /*class_head_p=*/false,
+ /*is_declaration=*/true);
+ type = TREE_TYPE (type);
+ }
if (type == error_mark_node)
return error_mark_node;
- return finish_base_specifier (TREE_TYPE (type), access, virtual_p);
+ return finish_base_specifier (type, access, virtual_p);
}
/* Exception handling [gram.exception] */
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h
index 31ff0d9f2b9..33582fbc0f1 100644
--- a/gcc/cp/parser.h
+++ b/gcc/cp/parser.h
@@ -23,25 +23,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "c-family/c-pragma.h"
-/* A token type for keywords, as opposed to ordinary identifiers. */
-#define CPP_KEYWORD ((enum cpp_ttype) (N_TTYPES + 1))
-
-/* A token type for template-ids. If a template-id is processed while
- parsing tentatively, it is replaced with a CPP_TEMPLATE_ID token;
- the value of the CPP_TEMPLATE_ID is whatever was returned by
- cp_parser_template_id. */
-#define CPP_TEMPLATE_ID ((enum cpp_ttype) (CPP_KEYWORD + 1))
-
-/* A token type for nested-name-specifiers. If a
- nested-name-specifier is processed while parsing tentatively, it is
- replaced with a CPP_NESTED_NAME_SPECIFIER token; the value of the
- CPP_NESTED_NAME_SPECIFIER is whatever was returned by
- cp_parser_nested_name_specifier_opt. */
-#define CPP_NESTED_NAME_SPECIFIER ((enum cpp_ttype) (CPP_TEMPLATE_ID + 1))
-
-/* The number of token types, including C++-specific ones. */
-#define N_CP_TTYPES ((int) (CPP_NESTED_NAME_SPECIFIER + 1))
-
/* A token's value and its associated deferred access checks and
qualifying scope. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f34e1df818b..178685c40d4 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6537,6 +6537,7 @@ coerce_template_parms (tree parms,
subtract it from nparms to get the number of non-variadic
parameters. */
int variadic_p = 0;
+ int post_variadic_parms = 0;
if (args == error_mark_node)
return error_mark_node;
@@ -6547,19 +6548,22 @@ coerce_template_parms (tree parms,
for (parm_idx = 0; parm_idx < nparms; ++parm_idx)
{
tree tparm = TREE_VALUE (TREE_VEC_ELT (parms, parm_idx));
+ if (variadic_p)
+ ++post_variadic_parms;
if (template_parameter_pack_p (tparm))
++variadic_p;
}
inner_args = INNERMOST_TEMPLATE_ARGS (args);
- /* If there are 0 or 1 parameter packs, we need to expand any argument
- packs so that we can deduce a parameter pack from some non-packed args
- followed by an argument pack, as in variadic85.C. If there are more
- than that, we need to leave argument packs intact so the arguments are
- assigned to the right parameter packs. This should only happen when
- dealing with a nested class inside a partial specialization of a class
- template, as in variadic92.C. */
- if (variadic_p <= 1)
+ /* If there are no parameters that follow a parameter pack, we need to
+ expand any argument packs so that we can deduce a parameter pack from
+ some non-packed args followed by an argument pack, as in variadic85.C.
+ If there are such parameters, we need to leave argument packs intact
+ so the arguments are assigned properly. This can happen when dealing
+ with a nested class inside a partial specialization of a class
+ template, as in variadic92.C, or when deducing a template parameter pack
+ from a sub-declarator, as in variadic114.C. */
+ if (!post_variadic_parms)
inner_args = expand_template_argument_pack (inner_args);
nargs = inner_args ? NUM_TMPL_ARGS (inner_args) : 0;
@@ -6574,7 +6578,7 @@ coerce_template_parms (tree parms,
{
if (variadic_p)
{
- --nparms;
+ nparms -= variadic_p;
error ("wrong number of template arguments "
"(%d, should be %d or more)", nargs, nparms);
}
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 53404b4a62d..434b7725ba8 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -192,8 +192,7 @@ build_headof (tree exp)
type = cp_build_qualified_type (ptr_type_node,
cp_type_quals (TREE_TYPE (exp)));
- return build2 (POINTER_PLUS_EXPR, type, exp,
- convert_to_integer (sizetype, offset));
+ return fold_build_pointer_plus (exp, offset);
}
/* Get a bad_cast node for the program to throw...
@@ -918,8 +917,8 @@ tinfo_base_init (tinfo_s *ti, tree target)
vtable_ptr = cp_build_addr_expr (vtable_ptr, tf_warning_or_error);
/* We need to point into the middle of the vtable. */
- vtable_ptr = build2
- (POINTER_PLUS_EXPR, TREE_TYPE (vtable_ptr), vtable_ptr,
+ vtable_ptr = fold_build_pointer_plus
+ (vtable_ptr,
size_binop (MULT_EXPR,
size_int (2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE),
TYPE_SIZE_UNIT (vtable_entry_type)));
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index d87c107ab76..52084e6ae40 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3078,8 +3078,7 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
return error_mark_node;
}
/* ...and then the delta in the PMF. */
- instance_ptr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (instance_ptr),
- instance_ptr, fold_convert (sizetype, delta));
+ instance_ptr = fold_build_pointer_plus (instance_ptr, delta);
/* Hand back the adjusted 'this' argument to our caller. */
*instance_ptrptr = instance_ptr;
@@ -3094,9 +3093,7 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
TREE_NO_WARNING (vtbl) = 1;
/* Finally, extract the function pointer from the vtable. */
- e2 = fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, TREE_TYPE (vtbl), vtbl,
- fold_convert (sizetype, idx));
+ e2 = fold_build_pointer_plus_loc (input_location, vtbl, idx);
e2 = cp_build_indirect_ref (e2, RO_NULL, tf_warning_or_error);
TREE_CONSTANT (e2) = 1;
@@ -4841,8 +4838,8 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
{
tree type = build_pointer_type (argtype);
tree op0 = fold_convert (type, TREE_OPERAND (val, 0));
- tree op1 = fold_convert (sizetype, fold_offsetof (arg, val));
- return fold_build2 (POINTER_PLUS_EXPR, type, op0, op1);
+ tree op1 = fold_offsetof (arg, val);
+ return fold_build_pointer_plus (op0, op1);
}
/* Handle complex lvalues (when permitted)
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index ac4f383ce80..bdd2452ffe1 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1560,9 +1560,7 @@ build_m_component_ref (tree datum, tree component)
/* Build an expression for "object + offset" where offset is the
value stored in the pointer-to-data-member. */
ptype = build_pointer_type (type);
- datum = build2 (POINTER_PLUS_EXPR, ptype,
- fold_convert (ptype, datum),
- build_nop (sizetype, component));
+ datum = fold_build_pointer_plus (fold_convert (ptype, datum), component);
datum = cp_build_indirect_ref (datum, RO_NULL, tf_warning_or_error);
/* If the object expression was an rvalue, return an rvalue. */
if (!is_lval)
diff --git a/gcc/dce.c b/gcc/dce.c
index ae2ff478597..a36ac61dea8 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -275,11 +275,11 @@ find_call_stack_args (rtx call_insn, bool do_mark, bool fast,
if (GET_CODE (XEXP (p, 0)) == USE
&& MEM_P (XEXP (XEXP (p, 0), 0)))
{
- rtx mem = XEXP (XEXP (p, 0), 0), addr, size;
- HOST_WIDE_INT off = 0;
- size = MEM_SIZE (mem);
- if (size == NULL_RTX)
+ rtx mem = XEXP (XEXP (p, 0), 0), addr;
+ HOST_WIDE_INT off = 0, size;
+ if (!MEM_SIZE_KNOWN_P (mem))
return false;
+ size = MEM_SIZE (mem);
addr = XEXP (mem, 0);
if (GET_CODE (addr) == PLUS
&& REG_P (XEXP (addr, 0))
@@ -329,7 +329,7 @@ find_call_stack_args (rtx call_insn, bool do_mark, bool fast,
return false;
}
min_sp_off = MIN (min_sp_off, off);
- max_sp_off = MAX (max_sp_off, off + INTVAL (size));
+ max_sp_off = MAX (max_sp_off, off + size);
}
if (min_sp_off >= max_sp_off)
@@ -370,7 +370,7 @@ find_call_stack_args (rtx call_insn, bool do_mark, bool fast,
set = single_set (DF_REF_INSN (defs->ref));
off += INTVAL (XEXP (SET_SRC (set), 1));
}
- for (byte = off; byte < off + INTVAL (MEM_SIZE (mem)); byte++)
+ for (byte = off; byte < off + MEM_SIZE (mem); byte++)
{
if (!bitmap_set_bit (sp_bytes, byte - min_sp_off))
gcc_unreachable ();
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7cbd68ea906..dcbf29f7870 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2836,11 +2836,8 @@ On 32-bit i?86-*-* targets, you can control by those attribute for
aggregate return in memory, if the caller is responsible to pop the hidden
pointer together with the rest of the arguments - @var{number} equal to
zero -, or if the callee is responsible to pop hidden pointer - @var{number}
-equal to one.
-
-For i?86-netware, the caller pops the stack for the hidden arguments pointing
-to aggregate return value. This differs from the default i386 ABI which assumes
-that the callee pops the stack for hidden pointer.
+equal to one. The default i386 ABI assumes that the callee pops the
+stack for hidden pointer.
@item ms_hook_prologue
@cindex @code{ms_hook_prologue} attribute
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 811bf3d7ccd..9b1b037c02a 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1141,8 +1141,6 @@ DCE thread support.
LynxOS thread support.
@item mipssde
MIPS SDE thread support.
-@item nks
-Novell Kernel Services thread support.
@item no
This is an alias for @samp{single}.
@item posix
@@ -1286,6 +1284,13 @@ will try to guess whether the @code{.init_array} and
Build GCC using a C++ compiler rather than a C compiler. This is an
experimental option which may become the default in a later release.
+@item --enable-build-poststage1-with-cxx
+When bootstrapping, build stages 2 and 3 of GCC using a C++ compiler
+rather than a C compiler. Stage 1 is still built with a C compiler.
+This is an experimental option which may become the default in a later
+release. This is enabled by default and may be disabled using
+@option{--disable-build-poststage1-with-cxx}.
+
@item --enable-maintainer-mode
The build rules that regenerate the Autoconf and Automake output files as
well as the GCC master message catalog @file{gcc.pot} are normally
@@ -3684,6 +3689,15 @@ on AIX@. The GNU Assembler, GNU Linker, and GNU Binutils version 2.20
is required to bootstrap on AIX 5@. The native AIX tools do
interoperate with GCC@.
+AIX 5.3 TL10, AIX 6.1 TL05 and AIX 7.1 TL00 introduced an AIX
+assembler change that sometimes produces corrupt assembly files
+causing AIX linker errors. The bug breaks GCC bootstrap on AIX and
+can cause compilation failures with existing GCC installations. An
+AIX iFix for AIX 5.3 is available (APAR IZ98385 for AIX 5.3 TL10, APAR
+IZ98477 for AIX 5.3 TL11 and IZ98134 for AIX 5.3 TL12). Fixes for AIX
+6.1 (APAR IZ98732 for AIX 6.1 TL05 and APAR IZ98861 for AIX 6.1 TL06)
+and AIX 7.1 are in verification and packaging phases.
+
Building @file{libstdc++.a} requires a fix for an AIX Assembler bug
APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a
fix for another AIX Assembler bug and a co-dependent AIX Archiver fix
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index c2d624ddfa0..c0d458588f0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9012,11 +9012,11 @@ loop in the loop nest by a given number of iterations. The strip
length can be changed using the @option{loop-block-tile-size}
parameter. The default value is 51 iterations.
-@item devirt-type-list-size
-IPA-CP attempts to track all possible types passed to a function's
-parameter in order to perform devirtualization.
-@option{devirt-type-list-size} is the maximum number of types it
-stores per a single formal parameter of a function.
+@item ipa-cp-value-list-size
+IPA-CP attempts to track all possible values and types passed to a function's
+parameter in order to propagate them and perform devirtualization.
+@option{ipa-cp-value-list-size} is the maximum number of values and types it
+stores per one formal parameter of a function.
@item lto-partitions
Specify desired number of partitions produced during WHOPR compilation.
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index ea30e38032e..0d60594e38e 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -409,15 +409,27 @@ and @code{TREE_OPERAND (@var{x}, 0)} contains the declaration,
or another @code{COMPONENT_REF}, or null if there is no compile-time
object associated with the reference.
+@findex MEM_OFFSET_KNOWN_P
+@item MEM_OFFSET_KNOWN_P (@var{x})
+True if the offset of the memory reference from @code{MEM_EXPR} is known.
+@samp{MEM_OFFSET (@var{x})} provides the offset if so.
+
@findex MEM_OFFSET
@item MEM_OFFSET (@var{x})
-The offset from the start of @code{MEM_EXPR} as a @code{CONST_INT} rtx.
+The offset from the start of @code{MEM_EXPR}. The value is only valid if
+@samp{MEM_OFFSET_KNOWN_P (@var{x})} is true.
+
+@findex MEM_SIZE_KNOWN_P
+@item MEM_SIZE_KNOWN_P (@var{x})
+True if the size of the memory reference is known.
+@samp{MEM_SIZE (@var{x})} provides its size if so.
@findex MEM_SIZE
@item MEM_SIZE (@var{x})
-The size in bytes of the memory reference as a @code{CONST_INT} rtx.
+The size in bytes of the memory reference.
This is mostly relevant for @code{BLKmode} references as otherwise
-the size is implied by the mode.
+the size is implied by the mode. The value is only valid if
+@samp{MEM_SIZE_KNOWN_P (@var{x})} is true.
@findex MEM_ALIGN
@item MEM_ALIGN (@var{x})
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 08acb351ba3..097531f7f6b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -2846,6 +2846,23 @@ the only effect of such implementation would be to slow down register
allocation.
@end deftypefn
+@deftypefn {Target Hook} {unsigned char} TARGET_CLASS_MAX_NREGS (reg_class_t @var{rclass}, enum machine_mode @var{mode})
+A target hook returns the maximum number of consecutive registers
+of class @var{rclass} needed to hold a value of mode @var{mode}.
+
+This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact,
+the value returned by @code{TERGET_CLASS_MAX_NREGS (@var{rclass},
+@var{mode})} target hook should be the maximum value of
+@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}
+values in the class @var{rclass}.
+
+This target hook helps control the handling of multiple-word values
+in the reload pass.
+
+The default version of this target hook returns the size of @var{mode}
+in words.
+@end deftypefn
+
@defmac CLASS_MAX_NREGS (@var{class}, @var{mode})
A C expression for the maximum number of consecutive registers
of class @var{class} needed to hold a value of mode @var{mode}.
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 7990c763a73..01beeb47920 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -2832,6 +2832,23 @@ the only effect of such implementation would be to slow down register
allocation.
@end deftypefn
+@hook TARGET_CLASS_MAX_NREGS
+A target hook returns the maximum number of consecutive registers
+of class @var{rclass} needed to hold a value of mode @var{mode}.
+
+This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact,
+the value returned by @code{TERGET_CLASS_MAX_NREGS (@var{rclass},
+@var{mode})} target hook should be the maximum value of
+@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}
+values in the class @var{rclass}.
+
+This target hook helps control the handling of multiple-word values
+in the reload pass.
+
+The default version of this target hook returns the size of @var{mode}
+in words.
+@end deftypefn
+
@defmac CLASS_MAX_NREGS (@var{class}, @var{mode})
A C expression for the maximum number of consecutive registers
of class @var{class} needed to hold a value of mode @var{mode}.
diff --git a/gcc/dse.c b/gcc/dse.c
index 18926b28273..8bad4ef04ac 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1355,11 +1355,10 @@ record_store (rtx body, bb_info_t bb_info)
}
/* Handle (set (mem:BLK (addr) [... S36 ...]) (const_int 0))
as memset (addr, 0, 36); */
- else if (!MEM_SIZE (mem)
- || !CONST_INT_P (MEM_SIZE (mem))
+ else if (!MEM_SIZE_KNOWN_P (mem)
+ || MEM_SIZE (mem) <= 0
+ || MEM_SIZE (mem) > MAX_OFFSET
|| GET_CODE (body) != SET
- || INTVAL (MEM_SIZE (mem)) <= 0
- || INTVAL (MEM_SIZE (mem)) > MAX_OFFSET
|| !CONST_INT_P (SET_SRC (body)))
{
if (!store_is_unused)
@@ -1384,7 +1383,7 @@ record_store (rtx body, bb_info_t bb_info)
}
if (GET_MODE (mem) == BLKmode)
- width = INTVAL (MEM_SIZE (mem));
+ width = MEM_SIZE (mem);
else
{
width = GET_MODE_SIZE (GET_MODE (mem));
@@ -2517,7 +2516,7 @@ scan_insn (bb_info_t bb_info, rtx insn)
&& INTVAL (args[2]) > 0)
{
rtx mem = gen_rtx_MEM (BLKmode, args[0]);
- set_mem_size (mem, args[2]);
+ set_mem_size (mem, INTVAL (args[2]));
body = gen_rtx_SET (VOIDmode, mem, args[1]);
mems_found += record_store (body, bb_info);
if (dump_file)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8fdebc6b885..6046ba9c6ab 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10453,7 +10453,7 @@ tls_mem_loc_descriptor (rtx mem)
tree base;
dw_loc_descr_ref loc_result;
- if (MEM_EXPR (mem) == NULL_TREE || MEM_OFFSET (mem) == NULL_RTX)
+ if (MEM_EXPR (mem) == NULL_TREE || !MEM_OFFSET_KNOWN_P (mem))
return NULL;
base = get_base_address (MEM_EXPR (mem));
@@ -10466,8 +10466,8 @@ tls_mem_loc_descriptor (rtx mem)
if (loc_result == NULL)
return NULL;
- if (INTVAL (MEM_OFFSET (mem)))
- loc_descr_plus_const (&loc_result, INTVAL (MEM_OFFSET (mem)));
+ if (MEM_OFFSET (mem))
+ loc_descr_plus_const (&loc_result, MEM_OFFSET (mem));
return loc_result;
}
@@ -12876,7 +12876,7 @@ dw_sra_loc_expr (tree decl, rtx loc)
if (MEM_P (varloc))
{
unsigned HOST_WIDE_INT memsize
- = INTVAL (MEM_SIZE (varloc)) * BITS_PER_UNIT;
+ = MEM_SIZE (varloc) * BITS_PER_UNIT;
if (memsize != bitsize)
{
if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index e4049b99184..f1b8eb93daf 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -157,8 +157,6 @@ static int const_fixed_htab_eq (const void *, const void *);
static rtx lookup_const_fixed (rtx);
static hashval_t mem_attrs_htab_hash (const void *);
static int mem_attrs_htab_eq (const void *, const void *);
-static mem_attrs *get_mem_attrs (alias_set_type, tree, rtx, rtx, unsigned int,
- addr_space_t, enum machine_mode);
static hashval_t reg_attrs_htab_hash (const void *);
static int reg_attrs_htab_eq (const void *, const void *);
static reg_attrs *get_reg_attrs (tree, int);
@@ -258,11 +256,28 @@ mem_attrs_htab_hash (const void *x)
return (p->alias ^ (p->align * 1000)
^ (p->addrspace * 4000)
- ^ ((p->offset ? INTVAL (p->offset) : 0) * 50000)
- ^ ((p->size ? INTVAL (p->size) : 0) * 2500000)
+ ^ ((p->offset_known_p ? p->offset : 0) * 50000)
+ ^ ((p->size_known_p ? p->size : 0) * 2500000)
^ (size_t) iterative_hash_expr (p->expr, 0));
}
+/* Return true if the given memory attributes are equal. */
+
+static bool
+mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
+{
+ return (p->alias == q->alias
+ && p->offset_known_p == q->offset_known_p
+ && (!p->offset_known_p || p->offset == q->offset)
+ && p->size_known_p == q->size_known_p
+ && (!p->size_known_p || p->size == q->size)
+ && p->align == q->align
+ && p->addrspace == q->addrspace
+ && (p->expr == q->expr
+ || (p->expr != NULL_TREE && q->expr != NULL_TREE
+ && operand_equal_p (p->expr, q->expr, 0))));
+}
+
/* Returns nonzero if the value represented by X (which is really a
mem_attrs *) is the same as that given by Y (which is also really a
mem_attrs *). */
@@ -270,53 +285,31 @@ mem_attrs_htab_hash (const void *x)
static int
mem_attrs_htab_eq (const void *x, const void *y)
{
- const mem_attrs *const p = (const mem_attrs *) x;
- const mem_attrs *const q = (const mem_attrs *) y;
-
- return (p->alias == q->alias && p->offset == q->offset
- && p->size == q->size && p->align == q->align
- && p->addrspace == q->addrspace
- && (p->expr == q->expr
- || (p->expr != NULL_TREE && q->expr != NULL_TREE
- && operand_equal_p (p->expr, q->expr, 0))));
+ return mem_attrs_eq_p ((const mem_attrs *) x, (const mem_attrs *) y);
}
-/* Allocate a new mem_attrs structure and insert it into the hash table if
- one identical to it is not already in the table. We are doing this for
- MEM of mode MODE. */
+/* Set MEM's memory attributes so that they are the same as ATTRS. */
-static mem_attrs *
-get_mem_attrs (alias_set_type alias, tree expr, rtx offset, rtx size,
- unsigned int align, addr_space_t addrspace, enum machine_mode mode)
+static void
+set_mem_attrs (rtx mem, mem_attrs *attrs)
{
- mem_attrs attrs;
void **slot;
- /* If everything is the default, we can just return zero.
- This must match what the corresponding MEM_* macros return when the
- field is not present. */
- if (alias == 0 && expr == 0 && offset == 0 && addrspace == 0
- && (size == 0
- || (mode != BLKmode && GET_MODE_SIZE (mode) == INTVAL (size)))
- && (STRICT_ALIGNMENT && mode != BLKmode
- ? align == GET_MODE_ALIGNMENT (mode) : align == BITS_PER_UNIT))
- return 0;
-
- attrs.alias = alias;
- attrs.expr = expr;
- attrs.offset = offset;
- attrs.size = size;
- attrs.align = align;
- attrs.addrspace = addrspace;
+ /* If everything is the default, we can just clear the attributes. */
+ if (mem_attrs_eq_p (attrs, mode_mem_attrs[(int) GET_MODE (mem)]))
+ {
+ MEM_ATTRS (mem) = 0;
+ return;
+ }
- slot = htab_find_slot (mem_attrs_htab, &attrs, INSERT);
+ slot = htab_find_slot (mem_attrs_htab, attrs, INSERT);
if (*slot == 0)
{
*slot = ggc_alloc_mem_attrs ();
- memcpy (*slot, &attrs, sizeof (mem_attrs));
+ memcpy (*slot, attrs, sizeof (mem_attrs));
}
- return (mem_attrs *) *slot;
+ MEM_ATTRS (mem) = (mem_attrs *) *slot;
}
/* Returns a hash code for X (which is a really a reg_attrs *). */
@@ -980,9 +973,9 @@ set_reg_attrs_from_value (rtx reg, rtx x)
offset = byte_lowpart_offset (GET_MODE (reg), GET_MODE (x));
if (MEM_P (x))
{
- if (MEM_OFFSET (x) && CONST_INT_P (MEM_OFFSET (x)))
- REG_ATTRS (reg)
- = get_reg_attrs (MEM_EXPR (x), INTVAL (MEM_OFFSET (x)) + offset);
+ if (MEM_OFFSET_KNOWN_P (x))
+ REG_ATTRS (reg) = get_reg_attrs (MEM_EXPR (x),
+ MEM_OFFSET (x) + offset);
if (MEM_POINTER (x))
mark_reg_pointer (reg, 0);
}
@@ -1471,14 +1464,13 @@ get_mem_align_offset (rtx mem, unsigned int align)
unsigned HOST_WIDE_INT offset;
/* This function can't use
- if (!MEM_EXPR (mem) || !MEM_OFFSET (mem)
- || !CONST_INT_P (MEM_OFFSET (mem))
+ if (!MEM_EXPR (mem) || !MEM_OFFSET_KNOWN_P (mem)
|| (MAX (MEM_ALIGN (mem),
get_object_alignment (MEM_EXPR (mem), align))
< align))
return -1;
else
- return (- INTVAL (MEM_OFFSET (mem))) & (align / BITS_PER_UNIT - 1);
+ return (- MEM_OFFSET (mem)) & (align / BITS_PER_UNIT - 1);
for two reasons:
- COMPONENT_REFs in MEM_EXPR can have NULL first operand,
for <variable>. get_inner_reference doesn't handle it and
@@ -1488,12 +1480,10 @@ get_mem_align_offset (rtx mem, unsigned int align)
isn't sufficiently aligned, the object it is in might be. */
gcc_assert (MEM_P (mem));
expr = MEM_EXPR (mem);
- if (expr == NULL_TREE
- || MEM_OFFSET (mem) == NULL_RTX
- || !CONST_INT_P (MEM_OFFSET (mem)))
+ if (expr == NULL_TREE || !MEM_OFFSET_KNOWN_P (mem))
return -1;
- offset = INTVAL (MEM_OFFSET (mem));
+ offset = MEM_OFFSET (mem);
if (DECL_P (expr))
{
if (DECL_ALIGN (expr) < align)
@@ -1554,13 +1544,9 @@ void
set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
HOST_WIDE_INT bitpos)
{
- alias_set_type alias;
- tree expr = NULL;
- rtx offset = NULL_RTX;
- rtx size = NULL_RTX;
- unsigned int align = BITS_PER_UNIT;
HOST_WIDE_INT apply_bitpos = 0;
tree type;
+ struct mem_attrs attrs, *defattrs, *refattrs;
/* It can happen that type_for_mode was given a mode for which there
is no language-level type. In which case it returns NULL, which
@@ -1578,9 +1564,11 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
set_mem_attributes. */
gcc_assert (!DECL_P (t) || ref != DECL_RTL_IF_SET (t));
+ memset (&attrs, 0, sizeof (attrs));
+
/* Get the alias set from the expression or type (perhaps using a
front-end routine) and use it. */
- alias = get_alias_set (t);
+ attrs.alias = get_alias_set (t);
MEM_VOLATILE_P (ref) |= TYPE_VOLATILE (type);
MEM_IN_STRUCT_P (ref)
@@ -1595,28 +1583,38 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
MEM_SCALAR_P (ref) = 1;
/* Default values from pre-existing memory attributes if present. */
- if (MEM_ATTRS (ref))
+ refattrs = MEM_ATTRS (ref);
+ if (refattrs)
{
/* ??? Can this ever happen? Calling this routine on a MEM that
already carries memory attributes should probably be invalid. */
- expr = MEM_EXPR (ref);
- offset = MEM_OFFSET (ref);
- size = MEM_SIZE (ref);
- align = MEM_ALIGN (ref);
+ attrs.expr = refattrs->expr;
+ attrs.offset_known_p = refattrs->offset_known_p;
+ attrs.offset = refattrs->offset;
+ attrs.size_known_p = refattrs->size_known_p;
+ attrs.size = refattrs->size;
+ attrs.align = refattrs->align;
}
/* Otherwise, default values from the mode of the MEM reference. */
- else if (GET_MODE (ref) != BLKmode)
+ else
{
+ defattrs = mode_mem_attrs[(int) GET_MODE (ref)];
+ gcc_assert (!defattrs->expr);
+ gcc_assert (!defattrs->offset_known_p);
+
/* Respect mode size. */
- size = GEN_INT (GET_MODE_SIZE (GET_MODE (ref)));
+ attrs.size_known_p = defattrs->size_known_p;
+ attrs.size = defattrs->size;
/* ??? Is this really necessary? We probably should always get
the size from the type below. */
/* Respect mode alignment for STRICT_ALIGNMENT targets if T is a type;
if T is an object, always compute the object alignment below. */
- if (STRICT_ALIGNMENT && TYPE_P (t))
- align = GET_MODE_ALIGNMENT (GET_MODE (ref));
+ if (TYPE_P (t))
+ attrs.align = defattrs->align;
+ else
+ attrs.align = BITS_PER_UNIT;
/* ??? If T is a type, respecting mode alignment may *also* be wrong
e.g. if the type carries an alignment attribute. Should we be
able to simply always use TYPE_ALIGN? */
@@ -1625,7 +1623,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* We can set the alignment from the type if we are making an object,
this is an INDIRECT_REF, or if TYPE_ALIGN_OK. */
if (objectp || TREE_CODE (t) == INDIRECT_REF || TYPE_ALIGN_OK (type))
- align = MAX (align, TYPE_ALIGN (type));
+ attrs.align = MAX (attrs.align, TYPE_ALIGN (type));
else if (TREE_CODE (t) == MEM_REF)
{
@@ -1635,12 +1633,13 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
|| CONSTANT_CLASS_P (TREE_OPERAND (op0, 0))))
{
if (DECL_P (TREE_OPERAND (op0, 0)))
- align = DECL_ALIGN (TREE_OPERAND (op0, 0));
+ attrs.align = DECL_ALIGN (TREE_OPERAND (op0, 0));
else if (CONSTANT_CLASS_P (TREE_OPERAND (op0, 0)))
{
- align = TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (op0, 0)));
+ attrs.align = TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (op0, 0)));
#ifdef CONSTANT_ALIGNMENT
- align = CONSTANT_ALIGNMENT (TREE_OPERAND (op0, 0), align);
+ attrs.align = CONSTANT_ALIGNMENT (TREE_OPERAND (op0, 0),
+ attrs.align);
#endif
}
if (TREE_INT_CST_LOW (TREE_OPERAND (t, 1)) != 0)
@@ -1648,23 +1647,26 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
unsigned HOST_WIDE_INT ioff
= TREE_INT_CST_LOW (TREE_OPERAND (t, 1));
unsigned HOST_WIDE_INT aoff = (ioff & -ioff) * BITS_PER_UNIT;
- align = MIN (aoff, align);
+ attrs.align = MIN (aoff, attrs.align);
}
}
else
/* ??? This isn't fully correct, we can't set the alignment from the
type in all cases. */
- align = MAX (align, TYPE_ALIGN (type));
+ attrs.align = MAX (attrs.align, TYPE_ALIGN (type));
}
else if (TREE_CODE (t) == TARGET_MEM_REF)
/* ??? This isn't fully correct, we can't set the alignment from the
type in all cases. */
- align = MAX (align, TYPE_ALIGN (type));
+ attrs.align = MAX (attrs.align, TYPE_ALIGN (type));
/* If the size is known, we can set that. */
if (TYPE_SIZE_UNIT (type) && host_integerp (TYPE_SIZE_UNIT (type), 1))
- size = GEN_INT (tree_low_cst (TYPE_SIZE_UNIT (type), 1));
+ {
+ attrs.size_known_p = true;
+ attrs.size = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
+ }
/* If T is not a type, we may be able to deduce some more information about
the expression. */
@@ -1701,22 +1703,27 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* If this is a decl, set the attributes of the MEM from it. */
if (DECL_P (t))
{
- expr = t;
- offset = const0_rtx;
+ attrs.expr = t;
+ attrs.offset_known_p = true;
+ attrs.offset = 0;
apply_bitpos = bitpos;
- size = (DECL_SIZE_UNIT (t)
- && host_integerp (DECL_SIZE_UNIT (t), 1)
- ? GEN_INT (tree_low_cst (DECL_SIZE_UNIT (t), 1)) : 0);
- align = DECL_ALIGN (t);
+ if (DECL_SIZE_UNIT (t) && host_integerp (DECL_SIZE_UNIT (t), 1))
+ {
+ attrs.size_known_p = true;
+ attrs.size = tree_low_cst (DECL_SIZE_UNIT (t), 1);
+ }
+ else
+ attrs.size_known_p = false;
+ attrs.align = DECL_ALIGN (t);
align_computed = true;
}
/* If this is a constant, we know the alignment. */
else if (CONSTANT_CLASS_P (t))
{
- align = TYPE_ALIGN (type);
+ attrs.align = TYPE_ALIGN (type);
#ifdef CONSTANT_ALIGNMENT
- align = CONSTANT_ALIGNMENT (t, align);
+ attrs.align = CONSTANT_ALIGNMENT (t, attrs.align);
#endif
align_computed = true;
}
@@ -1728,8 +1735,9 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
else if (TREE_CODE (t) == COMPONENT_REF
&& ! DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
{
- expr = t;
- offset = const0_rtx;
+ attrs.expr = t;
+ attrs.offset_known_p = true;
+ attrs.offset = 0;
apply_bitpos = bitpos;
/* ??? Any reason the field size would be different than
the size we got from the type? */
@@ -1769,27 +1777,29 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
if (DECL_P (t2))
{
- expr = t2;
- offset = NULL;
+ attrs.expr = t2;
+ attrs.offset_known_p = false;
if (host_integerp (off_tree, 1))
{
HOST_WIDE_INT ioff = tree_low_cst (off_tree, 1);
HOST_WIDE_INT aoff = (ioff & -ioff) * BITS_PER_UNIT;
- align = DECL_ALIGN (t2);
- if (aoff && (unsigned HOST_WIDE_INT) aoff < align)
- align = aoff;
+ attrs.align = DECL_ALIGN (t2);
+ if (aoff && (unsigned HOST_WIDE_INT) aoff < attrs.align)
+ attrs.align = aoff;
align_computed = true;
- offset = GEN_INT (ioff);
+ attrs.offset_known_p = true;
+ attrs.offset = ioff;
apply_bitpos = bitpos;
}
}
else if (TREE_CODE (t2) == COMPONENT_REF)
{
- expr = t2;
- offset = NULL;
+ attrs.expr = t2;
+ attrs.offset_known_p = false;
if (host_integerp (off_tree, 1))
{
- offset = GEN_INT (tree_low_cst (off_tree, 1));
+ attrs.offset_known_p = true;
+ attrs.offset = tree_low_cst (off_tree, 1);
apply_bitpos = bitpos;
}
/* ??? Any reason the field size would be different than
@@ -1799,8 +1809,9 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* If this is an indirect reference, record it. */
else if (TREE_CODE (t) == MEM_REF)
{
- expr = t;
- offset = const0_rtx;
+ attrs.expr = t;
+ attrs.offset_known_p = true;
+ attrs.offset = 0;
apply_bitpos = bitpos;
}
}
@@ -1809,15 +1820,16 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
else if (TREE_CODE (t) == MEM_REF
|| TREE_CODE (t) == TARGET_MEM_REF)
{
- expr = t;
- offset = const0_rtx;
+ attrs.expr = t;
+ attrs.offset_known_p = true;
+ attrs.offset = 0;
apply_bitpos = bitpos;
}
if (!align_computed && !INDIRECT_REF_P (t))
{
unsigned int obj_align = get_object_alignment (t, BIGGEST_ALIGNMENT);
- align = MAX (align, obj_align);
+ attrs.align = MAX (attrs.align, obj_align);
}
}
@@ -1826,15 +1838,15 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
object to contain the negative offset. */
if (apply_bitpos)
{
- offset = plus_constant (offset, -(apply_bitpos / BITS_PER_UNIT));
- if (size)
- size = plus_constant (size, apply_bitpos / BITS_PER_UNIT);
+ gcc_assert (attrs.offset_known_p);
+ attrs.offset -= apply_bitpos / BITS_PER_UNIT;
+ if (attrs.size_known_p)
+ attrs.size += apply_bitpos / BITS_PER_UNIT;
}
/* Now set the attributes we computed above. */
- MEM_ATTRS (ref)
- = get_mem_attrs (alias, expr, offset, size, align,
- TYPE_ADDR_SPACE (type), GET_MODE (ref));
+ attrs.addrspace = TYPE_ADDR_SPACE (type);
+ set_mem_attrs (ref, &attrs);
/* If this is already known to be a scalar or aggregate, we are done. */
if (MEM_IN_STRUCT_P (ref) || MEM_SCALAR_P (ref))
@@ -1859,12 +1871,13 @@ set_mem_attributes (rtx ref, tree t, int objectp)
void
set_mem_alias_set (rtx mem, alias_set_type set)
{
+ struct mem_attrs attrs;
+
/* If the new and old alias sets don't conflict, something is wrong. */
gcc_checking_assert (alias_sets_conflict_p (set, MEM_ALIAS_SET (mem)));
-
- MEM_ATTRS (mem) = get_mem_attrs (set, MEM_EXPR (mem), MEM_OFFSET (mem),
- MEM_SIZE (mem), MEM_ALIGN (mem),
- MEM_ADDR_SPACE (mem), GET_MODE (mem));
+ attrs = *get_mem_attrs (mem);
+ attrs.alias = set;
+ set_mem_attrs (mem, &attrs);
}
/* Set the address space of MEM to ADDRSPACE (target-defined). */
@@ -1872,9 +1885,11 @@ set_mem_alias_set (rtx mem, alias_set_type set)
void
set_mem_addr_space (rtx mem, addr_space_t addrspace)
{
- MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
- MEM_OFFSET (mem), MEM_SIZE (mem),
- MEM_ALIGN (mem), addrspace, GET_MODE (mem));
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.addrspace = addrspace;
+ set_mem_attrs (mem, &attrs);
}
/* Set the alignment of MEM to ALIGN bits. */
@@ -1882,9 +1897,11 @@ set_mem_addr_space (rtx mem, addr_space_t addrspace)
void
set_mem_align (rtx mem, unsigned int align)
{
- MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
- MEM_OFFSET (mem), MEM_SIZE (mem), align,
- MEM_ADDR_SPACE (mem), GET_MODE (mem));
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.align = align;
+ set_mem_attrs (mem, &attrs);
}
/* Set the expr for MEM to EXPR. */
@@ -1892,30 +1909,61 @@ set_mem_align (rtx mem, unsigned int align)
void
set_mem_expr (rtx mem, tree expr)
{
- MEM_ATTRS (mem)
- = get_mem_attrs (MEM_ALIAS_SET (mem), expr, MEM_OFFSET (mem),
- MEM_SIZE (mem), MEM_ALIGN (mem),
- MEM_ADDR_SPACE (mem), GET_MODE (mem));
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.expr = expr;
+ set_mem_attrs (mem, &attrs);
}
/* Set the offset of MEM to OFFSET. */
void
-set_mem_offset (rtx mem, rtx offset)
+set_mem_offset (rtx mem, HOST_WIDE_INT offset)
+{
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.offset_known_p = true;
+ attrs.offset = offset;
+ set_mem_attrs (mem, &attrs);
+}
+
+/* Clear the offset of MEM. */
+
+void
+clear_mem_offset (rtx mem)
{
- MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
- offset, MEM_SIZE (mem), MEM_ALIGN (mem),
- MEM_ADDR_SPACE (mem), GET_MODE (mem));
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.offset_known_p = false;
+ set_mem_attrs (mem, &attrs);
}
/* Set the size of MEM to SIZE. */
void
-set_mem_size (rtx mem, rtx size)
+set_mem_size (rtx mem, HOST_WIDE_INT size)
+{
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.size_known_p = true;
+ attrs.size = size;
+ set_mem_attrs (mem, &attrs);
+}
+
+/* Clear the size of MEM. */
+
+void
+clear_mem_size (rtx mem)
{
- MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
- MEM_OFFSET (mem), size, MEM_ALIGN (mem),
- MEM_ADDR_SPACE (mem), GET_MODE (mem));
+ struct mem_attrs attrs;
+
+ attrs = *get_mem_attrs (mem);
+ attrs.size_known_p = false;
+ set_mem_attrs (mem, &attrs);
}
/* Return a memory reference like MEMREF, but with its mode changed to MODE
@@ -1962,31 +2010,29 @@ change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate)
rtx
change_address (rtx memref, enum machine_mode mode, rtx addr)
{
- rtx new_rtx = change_address_1 (memref, mode, addr, 1), size;
+ rtx new_rtx = change_address_1 (memref, mode, addr, 1);
enum machine_mode mmode = GET_MODE (new_rtx);
- unsigned int align;
+ struct mem_attrs attrs, *defattrs;
- size = mmode == BLKmode ? 0 : GEN_INT (GET_MODE_SIZE (mmode));
- align = mmode == BLKmode ? BITS_PER_UNIT : GET_MODE_ALIGNMENT (mmode);
+ attrs = *get_mem_attrs (memref);
+ defattrs = mode_mem_attrs[(int) mmode];
+ attrs.expr = NULL_TREE;
+ attrs.offset_known_p = false;
+ attrs.size_known_p = defattrs->size_known_p;
+ attrs.size = defattrs->size;
+ attrs.align = defattrs->align;
/* If there are no changes, just return the original memory reference. */
if (new_rtx == memref)
{
- if (MEM_ATTRS (memref) == 0
- || (MEM_EXPR (memref) == NULL
- && MEM_OFFSET (memref) == NULL
- && MEM_SIZE (memref) == size
- && MEM_ALIGN (memref) == align))
+ if (mem_attrs_eq_p (get_mem_attrs (memref), &attrs))
return new_rtx;
new_rtx = gen_rtx_MEM (mmode, XEXP (memref, 0));
MEM_COPY_ATTRIBUTES (new_rtx, memref);
}
- MEM_ATTRS (new_rtx)
- = get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, size, align,
- MEM_ADDR_SPACE (memref), mmode);
-
+ set_mem_attrs (new_rtx, &attrs);
return new_rtx;
}
@@ -2002,16 +2048,17 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
{
rtx addr = XEXP (memref, 0);
rtx new_rtx;
- rtx memoffset = MEM_OFFSET (memref);
- rtx size = 0;
- unsigned int memalign = MEM_ALIGN (memref);
- addr_space_t as = MEM_ADDR_SPACE (memref);
- enum machine_mode address_mode = targetm.addr_space.address_mode (as);
+ enum machine_mode address_mode;
int pbits;
+ struct mem_attrs attrs, *defattrs;
+ unsigned HOST_WIDE_INT max_align;
+
+ attrs = *get_mem_attrs (memref);
/* If there are no changes, just return the original memory reference. */
if (mode == GET_MODE (memref) && !offset
- && (!validate || memory_address_addr_space_p (mode, addr, as)))
+ && (!validate || memory_address_addr_space_p (mode, addr,
+ attrs.addrspace)))
return memref;
/* ??? Prefer to create garbage instead of creating shared rtl.
@@ -2021,6 +2068,7 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
/* Convert a possibly large offset to a signed value within the
range of the target address space. */
+ address_mode = targetm.addr_space.address_mode (attrs.addrspace);
pbits = GET_MODE_BITSIZE (address_mode);
if (HOST_BITS_PER_WIDE_INT > pbits)
{
@@ -2052,26 +2100,29 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
/* Compute the new values of the memory attributes due to this adjustment.
We add the offsets and update the alignment. */
- if (memoffset)
- memoffset = GEN_INT (offset + INTVAL (memoffset));
+ if (attrs.offset_known_p)
+ attrs.offset += offset;
/* Compute the new alignment by taking the MIN of the alignment and the
lowest-order set bit in OFFSET, but don't change the alignment if OFFSET
if zero. */
if (offset != 0)
- memalign
- = MIN (memalign,
- (unsigned HOST_WIDE_INT) (offset & -offset) * BITS_PER_UNIT);
+ {
+ max_align = (offset & -offset) * BITS_PER_UNIT;
+ attrs.align = MIN (attrs.align, max_align);
+ }
/* We can compute the size in a number of ways. */
- if (GET_MODE (new_rtx) != BLKmode)
- size = GEN_INT (GET_MODE_SIZE (GET_MODE (new_rtx)));
- else if (MEM_SIZE (memref))
- size = plus_constant (MEM_SIZE (memref), -offset);
+ defattrs = mode_mem_attrs[(int) GET_MODE (new_rtx)];
+ if (defattrs->size_known_p)
+ {
+ attrs.size_known_p = true;
+ attrs.size = defattrs->size;
+ }
+ else if (attrs.size_known_p)
+ attrs.size -= offset;
- MEM_ATTRS (new_rtx) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref),
- memoffset, size, memalign, as,
- GET_MODE (new_rtx));
+ set_mem_attrs (new_rtx, &attrs);
/* At some point, we should validate that this offset is within the object,
if all the appropriate values are known. */
@@ -2099,9 +2150,11 @@ rtx
offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
{
rtx new_rtx, addr = XEXP (memref, 0);
- addr_space_t as = MEM_ADDR_SPACE (memref);
- enum machine_mode address_mode = targetm.addr_space.address_mode (as);
+ enum machine_mode address_mode;
+ struct mem_attrs attrs, *defattrs;
+ attrs = *get_mem_attrs (memref);
+ address_mode = targetm.addr_space.address_mode (attrs.addrspace);
new_rtx = simplify_gen_binary (PLUS, address_mode, addr, offset);
/* At this point we don't know _why_ the address is invalid. It
@@ -2111,7 +2164,8 @@ offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
being able to recognize the magic around pic_offset_table_rtx.
This stuff is fragile, and is yet another example of why it is
bad to expose PIC machinery too early. */
- if (! memory_address_addr_space_p (GET_MODE (memref), new_rtx, as)
+ if (! memory_address_addr_space_p (GET_MODE (memref), new_rtx,
+ attrs.addrspace)
&& GET_CODE (addr) == PLUS
&& XEXP (addr, 0) == pic_offset_table_rtx)
{
@@ -2128,10 +2182,12 @@ offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
/* Update the alignment to reflect the offset. Reset the offset, which
we don't know. */
- MEM_ATTRS (new_rtx)
- = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), 0, 0,
- MIN (MEM_ALIGN (memref), pow2 * BITS_PER_UNIT),
- as, GET_MODE (new_rtx));
+ defattrs = mode_mem_attrs[(int) GET_MODE (new_rtx)];
+ attrs.offset_known_p = false;
+ attrs.size_known_p = defattrs->size_known_p;
+ attrs.size = defattrs->size;
+ attrs.align = MIN (attrs.align, pow2 * BITS_PER_UNIT);
+ set_mem_attrs (new_rtx, &attrs);
return new_rtx;
}
@@ -2166,29 +2222,30 @@ rtx
widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
{
rtx new_rtx = adjust_address_1 (memref, mode, offset, 1, 1);
- tree expr = MEM_EXPR (new_rtx);
- rtx memoffset = MEM_OFFSET (new_rtx);
+ struct mem_attrs attrs;
unsigned int size = GET_MODE_SIZE (mode);
/* If there are no changes, just return the original memory reference. */
if (new_rtx == memref)
return new_rtx;
+ attrs = *get_mem_attrs (new_rtx);
+
/* If we don't know what offset we were at within the expression, then
we can't know if we've overstepped the bounds. */
- if (! memoffset)
- expr = NULL_TREE;
+ if (! attrs.offset_known_p)
+ attrs.expr = NULL_TREE;
- while (expr)
+ while (attrs.expr)
{
- if (TREE_CODE (expr) == COMPONENT_REF)
+ if (TREE_CODE (attrs.expr) == COMPONENT_REF)
{
- tree field = TREE_OPERAND (expr, 1);
- tree offset = component_ref_field_offset (expr);
+ tree field = TREE_OPERAND (attrs.expr, 1);
+ tree offset = component_ref_field_offset (attrs.expr);
if (! DECL_SIZE_UNIT (field))
{
- expr = NULL_TREE;
+ attrs.expr = NULL_TREE;
break;
}
@@ -2196,48 +2253,45 @@ widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
otherwise strip back to the containing structure. */
if (TREE_CODE (DECL_SIZE_UNIT (field)) == INTEGER_CST
&& compare_tree_int (DECL_SIZE_UNIT (field), size) >= 0
- && INTVAL (memoffset) >= 0)
+ && attrs.offset >= 0)
break;
if (! host_integerp (offset, 1))
{
- expr = NULL_TREE;
+ attrs.expr = NULL_TREE;
break;
}
- expr = TREE_OPERAND (expr, 0);
- memoffset
- = (GEN_INT (INTVAL (memoffset)
- + tree_low_cst (offset, 1)
- + (tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
- / BITS_PER_UNIT)));
+ attrs.expr = TREE_OPERAND (attrs.expr, 0);
+ attrs.offset += tree_low_cst (offset, 1);
+ attrs.offset += (tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
+ / BITS_PER_UNIT);
}
/* Similarly for the decl. */
- else if (DECL_P (expr)
- && DECL_SIZE_UNIT (expr)
- && TREE_CODE (DECL_SIZE_UNIT (expr)) == INTEGER_CST
- && compare_tree_int (DECL_SIZE_UNIT (expr), size) >= 0
- && (! memoffset || INTVAL (memoffset) >= 0))
+ else if (DECL_P (attrs.expr)
+ && DECL_SIZE_UNIT (attrs.expr)
+ && TREE_CODE (DECL_SIZE_UNIT (attrs.expr)) == INTEGER_CST
+ && compare_tree_int (DECL_SIZE_UNIT (attrs.expr), size) >= 0
+ && (! attrs.offset_known_p || attrs.offset >= 0))
break;
else
{
/* The widened memory access overflows the expression, which means
that it could alias another expression. Zap it. */
- expr = NULL_TREE;
+ attrs.expr = NULL_TREE;
break;
}
}
- if (! expr)
- memoffset = NULL_RTX;
+ if (! attrs.expr)
+ attrs.offset_known_p = false;
/* The widened memory may alias other stuff, so zap the alias set. */
/* ??? Maybe use get_alias_set on any remaining expression. */
-
- MEM_ATTRS (new_rtx) = get_mem_attrs (0, expr, memoffset, GEN_INT (size),
- MEM_ALIGN (new_rtx),
- MEM_ADDR_SPACE (new_rtx), mode);
-
+ attrs.alias = 0;
+ attrs.size_known_p = true;
+ attrs.size = size;
+ set_mem_attrs (new_rtx, &attrs);
return new_rtx;
}
@@ -2249,6 +2303,7 @@ get_spill_slot_decl (bool force_build_p)
{
tree d = spill_slot_decl;
rtx rd;
+ struct mem_attrs attrs;
if (d || !force_build_p)
return d;
@@ -2262,8 +2317,10 @@ get_spill_slot_decl (bool force_build_p)
rd = gen_rtx_MEM (BLKmode, frame_pointer_rtx);
MEM_NOTRAP_P (rd) = 1;
- MEM_ATTRS (rd) = get_mem_attrs (new_alias_set (), d, const0_rtx,
- NULL_RTX, 0, ADDR_SPACE_GENERIC, BLKmode);
+ attrs = *mode_mem_attrs[(int) BLKmode];
+ attrs.alias = new_alias_set ();
+ attrs.expr = d;
+ set_mem_attrs (rd, &attrs);
SET_DECL_RTL (d, rd);
return d;
@@ -2278,25 +2335,25 @@ get_spill_slot_decl (bool force_build_p)
void
set_mem_attrs_for_spill (rtx mem)
{
- alias_set_type alias;
- rtx addr, offset;
- tree expr;
+ struct mem_attrs attrs;
+ rtx addr;
- expr = get_spill_slot_decl (true);
- alias = MEM_ALIAS_SET (DECL_RTL (expr));
+ attrs = *get_mem_attrs (mem);
+ attrs.expr = get_spill_slot_decl (true);
+ attrs.alias = MEM_ALIAS_SET (DECL_RTL (attrs.expr));
+ attrs.addrspace = ADDR_SPACE_GENERIC;
/* We expect the incoming memory to be of the form:
(mem:MODE (plus (reg sfp) (const_int offset)))
with perhaps the plus missing for offset = 0. */
addr = XEXP (mem, 0);
- offset = const0_rtx;
+ attrs.offset_known_p = true;
+ attrs.offset = 0;
if (GET_CODE (addr) == PLUS
&& CONST_INT_P (XEXP (addr, 1)))
- offset = XEXP (addr, 1);
+ attrs.offset = INTVAL (XEXP (addr, 1));
- MEM_ATTRS (mem) = get_mem_attrs (alias, expr, offset,
- MEM_SIZE (mem), MEM_ALIGN (mem),
- ADDR_SPACE_GENERIC, GET_MODE (mem));
+ set_mem_attrs (mem, &attrs);
MEM_NOTRAP_P (mem) = 1;
}
@@ -5442,6 +5499,8 @@ void
init_emit_regs (void)
{
int i;
+ enum machine_mode mode;
+ mem_attrs *attrs;
/* Reset register attributes */
htab_empty (reg_attrs_htab);
@@ -5483,6 +5542,22 @@ init_emit_regs (void)
pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
else
pic_offset_table_rtx = NULL_RTX;
+
+ for (i = 0; i < (int) MAX_MACHINE_MODE; i++)
+ {
+ mode = (enum machine_mode) i;
+ attrs = ggc_alloc_cleared_mem_attrs ();
+ attrs->align = BITS_PER_UNIT;
+ attrs->addrspace = ADDR_SPACE_GENERIC;
+ if (mode != BLKmode)
+ {
+ attrs->size_known_p = true;
+ attrs->size = GET_MODE_SIZE (mode);
+ if (STRICT_ALIGNMENT)
+ attrs->align = GET_MODE_ALIGNMENT (mode);
+ }
+ mode_mem_attrs[i] = attrs;
+ }
}
/* Create some permanent unique rtl objects shared between all functions. */
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index 31f1da01d1f..bc91193fb62 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -33,10 +33,16 @@ extern void set_mem_addr_space (rtx, addr_space_t);
extern void set_mem_expr (rtx, tree);
/* Set the offset for MEM to OFFSET. */
-extern void set_mem_offset (rtx, rtx);
+extern void set_mem_offset (rtx, HOST_WIDE_INT);
+
+/* Clear the offset recorded for MEM. */
+extern void clear_mem_offset (rtx);
/* Set the size for MEM to SIZE. */
-extern void set_mem_size (rtx, rtx);
+extern void set_mem_size (rtx, HOST_WIDE_INT);
+
+/* Clear the size recorded for MEM. */
+extern void clear_mem_size (rtx);
/* Set the attributes for MEM appropriate for a spill slot. */
extern void set_mem_attrs_for_spill (rtx);
diff --git a/gcc/expr.c b/gcc/expr.c
index ee1114218ca..27bca174114 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1166,8 +1166,8 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
{
x = shallow_copy_rtx (x);
y = shallow_copy_rtx (y);
- set_mem_size (x, size);
- set_mem_size (y, size);
+ set_mem_size (x, INTVAL (size));
+ set_mem_size (y, INTVAL (size));
}
if (CONST_INT_P (size) && MOVE_BY_PIECES_P (INTVAL (size), align))
@@ -8037,7 +8037,15 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM)
target = 0;
- temp = expand_unop (mode, one_cmpl_optab, op0, target, 1);
+ /* In case we have to reduce the result to bitfield precision
+ expand this as XOR with a proper constant instead. */
+ if (reduce_bit_field)
+ temp = expand_binop (mode, xor_optab, op0,
+ immed_double_int_const
+ (double_int_mask (TYPE_PRECISION (type)), mode),
+ target, 1, OPTAB_LIB_WIDEN);
+ else
+ temp = expand_unop (mode, one_cmpl_optab, op0, target, 1);
gcc_assert (temp);
return temp;
@@ -8046,26 +8054,8 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
and (a bitwise1 b) bitwise2 b (etc)
but that is probably not worth while. */
- /* BIT_AND_EXPR is for bitwise anding. TRUTH_AND_EXPR is for anding two
- boolean values when we want in all cases to compute both of them. In
- general it is fastest to do TRUTH_AND_EXPR by computing both operands
- as actual zero-or-1 values and then bitwise anding. In cases where
- there cannot be any side effects, better code would be made by
- treating TRUTH_AND_EXPR like TRUTH_ANDIF_EXPR; but the question is
- how to recognize those cases. */
-
- case TRUTH_AND_EXPR:
- code = BIT_AND_EXPR;
case BIT_AND_EXPR:
- goto binop;
-
- case TRUTH_OR_EXPR:
- code = BIT_IOR_EXPR;
case BIT_IOR_EXPR:
- goto binop;
-
- case TRUTH_XOR_EXPR:
- code = BIT_XOR_EXPR;
case BIT_XOR_EXPR:
goto binop;
@@ -8144,18 +8134,6 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
emit_label (op1);
return target;
- case TRUTH_NOT_EXPR:
- if (modifier == EXPAND_STACK_PARM)
- target = 0;
- op0 = expand_expr (treeop0, target,
- VOIDmode, EXPAND_NORMAL);
- /* The parser is careful to generate TRUTH_NOT_EXPR
- only with operands that are always zero or one. */
- temp = expand_binop (mode, xor_optab, op0, const1_rtx,
- target, 1, OPTAB_LIB_WIDEN);
- gcc_assert (temp);
- return temp;
-
case COMPLEX_EXPR:
/* Get the rtx code of the operands. */
op0 = expand_normal (treeop0);
@@ -8311,6 +8289,12 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
temp = expand_binop (mode, this_optab, op0, op1, target,
unsignedp, OPTAB_LIB_WIDEN);
gcc_assert (temp);
+ /* Bitwise operations do not need bitfield reduction as we expect their
+ operands being properly truncated. */
+ if (code == BIT_XOR_EXPR
+ || code == BIT_AND_EXPR
+ || code == BIT_IOR_EXPR)
+ return temp;
return REDUCE_BIT_FIELD (temp);
}
#undef REDUCE_BIT_FIELD
@@ -9533,47 +9517,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return op0;
- /* Use a compare and a jump for BLKmode comparisons, or for function
- type comparisons is HAVE_canonicalize_funcptr_for_compare. */
-
- /* Although TRUTH_{AND,OR}IF_EXPR aren't present in GIMPLE, they
- are occassionally created by folding during expansion. */
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- if (! ignore
- && (target == 0
- || modifier == EXPAND_STACK_PARM
- || ! safe_from_p (target, treeop0, 1)
- || ! safe_from_p (target, treeop1, 1)
- /* Make sure we don't have a hard reg (such as function's return
- value) live across basic blocks, if not optimizing. */
- || (!optimize && REG_P (target)
- && REGNO (target) < FIRST_PSEUDO_REGISTER)))
- target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode);
-
- if (target)
- emit_move_insn (target, const0_rtx);
-
- op1 = gen_label_rtx ();
- jumpifnot_1 (code, treeop0, treeop1, op1, -1);
-
- if (target)
- emit_move_insn (target, const1_rtx);
-
- emit_label (op1);
- return ignore ? const0_rtx : target;
-
- case STATEMENT_LIST:
- {
- tree_stmt_iterator iter;
-
- gcc_assert (ignore);
-
- for (iter = tsi_start (exp); !tsi_end_p (iter); tsi_next (&iter))
- expand_expr (tsi_stmt (iter), const0_rtx, VOIDmode, modifier);
- }
- return const0_rtx;
-
case COND_EXPR:
/* A COND_EXPR with its type being VOID_TYPE represents a
conditional jump and is handled in
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 94c8926b03d..889a92c71f8 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4221,8 +4221,7 @@ build_range_check (location_t loc, tree type, tree exp, int in_p,
low = fold_convert_loc (loc, sizetype, low);
low = fold_build1_loc (loc, NEGATE_EXPR, sizetype, low);
return build_range_check (loc, type,
- fold_build2_loc (loc, POINTER_PLUS_EXPR,
- etype, exp, low),
+ fold_build_pointer_plus_loc (loc, exp, low),
1, build_int_cst (etype, 0), value);
}
return 0;
@@ -7665,11 +7664,11 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
non-integral type.
Do not fold the result as that would not simplify further, also
folding again results in recursions. */
- if (INTEGRAL_TYPE_P (type))
+ if (TREE_CODE (type) == BOOLEAN_TYPE)
return build2_loc (loc, TREE_CODE (op0), type,
TREE_OPERAND (op0, 0),
TREE_OPERAND (op0, 1));
- else
+ else if (!INTEGRAL_TYPE_P (type))
return build3_loc (loc, COND_EXPR, type, op0,
fold_convert (type, boolean_true_node),
fold_convert (type, boolean_false_node));
@@ -9584,9 +9583,8 @@ fold_binary_loc (location_t loc,
inner = fold_build2_loc (loc, PLUS_EXPR, sizetype,
arg01, fold_convert_loc (loc, sizetype, arg1));
return fold_convert_loc (loc, type,
- fold_build2_loc (loc, POINTER_PLUS_EXPR,
- TREE_TYPE (arg00),
- arg00, inner));
+ fold_build_pointer_plus_loc (loc,
+ arg00, inner));
}
/* PTR_CST +p CST -> CST1 */
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 215c3215397..1e9bb56b4d6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,41 @@
+2011-07-21 Tobias Burnus <burnus@net-b.de>
+
+ * check.c (gfc_check_present): Allow coarrays.
+ * trans-array.c (gfc_conv_array_ref): Avoid casting
+ when a pointer is wanted.
+ * trans-decl.c (create_function_arglist): For -fcoarray=lib,
+ handle hidden token and offset arguments for nondescriptor
+ coarrays.
+ * trans-expr.c (get_tree_for_caf_expr): New function.
+ (gfc_conv_procedure_call): For -fcoarray=lib pass the
+ token and offset for nondescriptor coarray dummies.
+ * trans.h (lang_type): Add caf_offset tree.
+ (GFC_TYPE_ARRAY_CAF_OFFSET): New macro.
+
+2011-07-19 Tobias Burnus <burnus@net-b.de>
+
+ * expr.c (gfc_is_coarray): New function.
+ * gfortran.h (gfc_is_coarray): New prototype.
+ * interface.c (compare_parameter): Use it.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus.
+ (gfc_trans_string_copy): Likewise.
+ * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise.
+ * trans-types.c (gfc_get_array_descr_info): Likewise.
+ * trans.c (gfc_build_array_ref): Likewise.
+
+2011-07-19 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/49708
+ * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
+
+2011-07-18 Tobias Burnus <burnus@net-b.de>
+
+ * trans-decl.c (gfc_build_qualified_array): Make coarray's
+ token TYPE_QUAL_RESTRICT.
+
2011-07-18 Tobias Burnus <burnus@net-b.de>
* resolve.c (resolve_transfer): Mention defined I/O
@@ -1075,7 +1113,7 @@
* f95-lang.c (build_builtin_fntypes): Swap frexp parameter types.
-2010-04-04 Thomas Koenig <tkoenig@gcc.gnu.org>
+2011-04-04 Thomas Koenig <tkoenig@gcc.gnu.org>
* frontend-passes: (optimize_lexical_comparison): New function.
(optimize_expr): Call it.
@@ -1211,7 +1249,7 @@
* trans-types.c (gfc_get_function_type): Don't use varargs if the
procedure is known to have no arguments.
-2010-03-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+2011-03-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/22572
* gfortran.h (gfc_option_t) : Add
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 79e1c95b9e1..a95865b9bc6 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2895,7 +2895,9 @@ gfc_check_present (gfc_expr *a)
if (a->ref != NULL
&& !(a->ref->next == NULL && a->ref->type == REF_ARRAY
- && a->ref->u.ar.type == AR_FULL))
+ && (a->ref->u.ar.type == AR_FULL
+ || (a->ref->u.ar.type == AR_ELEMENT
+ && a->ref->u.ar.as->rank == 0))))
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must not be a "
"subobject of '%s'", gfc_current_intrinsic_arg[0]->name,
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index b8eb5552a40..e5394b876df 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4154,6 +4154,73 @@ gfc_is_coindexed (gfc_expr *e)
}
+/* Coarrays are variables with a corank but not being coindexed. However, also
+ the following is a coarray: A subobject of a coarray is a coarray if it does
+ not have any cosubscripts, vector subscripts, allocatable component
+ selection, or pointer component selection. (F2008, 2.4.7) */
+
+bool
+gfc_is_coarray (gfc_expr *e)
+{
+ gfc_ref *ref;
+ gfc_symbol *sym;
+ gfc_component *comp;
+ bool coindexed;
+ bool coarray;
+ int i;
+
+ if (e->expr_type != EXPR_VARIABLE)
+ return false;
+
+ coindexed = false;
+ sym = e->symtree->n.sym;
+
+ if (sym->ts.type == BT_CLASS && sym->attr.class_ok)
+ coarray = CLASS_DATA (sym)->attr.codimension;
+ else
+ coarray = sym->attr.codimension;
+
+ for (ref = e->ref; ref; ref = ref->next)
+ switch (ref->type)
+ {
+ case REF_COMPONENT:
+ comp = ref->u.c.component;
+ if (comp->attr.pointer || comp->attr.allocatable)
+ {
+ coindexed = false;
+ if (comp->ts.type == BT_CLASS && comp->attr.class_ok)
+ coarray = CLASS_DATA (comp)->attr.codimension;
+ else
+ coarray = comp->attr.codimension;
+ }
+ break;
+
+ case REF_ARRAY:
+ if (!coarray)
+ break;
+
+ if (ref->u.ar.codimen > 0 && !gfc_ref_this_image (ref))
+ {
+ coindexed = true;
+ break;
+ }
+
+ for (i = 0; i < ref->u.ar.dimen; i++)
+ if (ref->u.ar.dimen_type[i] == DIMEN_VECTOR)
+ {
+ coarray = false;
+ break;
+ }
+ break;
+
+ case REF_SUBSTRING:
+ break;
+ }
+
+ return coarray && !coindexed;
+}
+
+
int
gfc_get_corank (gfc_expr *e)
{
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index eb01b0e3d47..acb54004e9d 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2735,6 +2735,7 @@ bool gfc_is_proc_ptr_comp (gfc_expr *, gfc_component **);
bool gfc_ref_this_image (gfc_ref *ref);
bool gfc_is_coindexed (gfc_expr *);
+bool gfc_is_coarray (gfc_expr *);
int gfc_get_corank (gfc_expr *);
bool gfc_has_ultimate_allocatable (gfc_expr *);
bool gfc_has_ultimate_pointer (gfc_expr *);
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index dcf6c4e9bd1..482a75e6fe0 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1557,47 +1557,26 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
}
}
- if (formal->attr.codimension)
+ if (formal->attr.codimension && !gfc_is_coarray (actual))
{
- gfc_ref *last = NULL;
-
- if (actual->expr_type != EXPR_VARIABLE
- || !gfc_expr_attr (actual).codimension)
- {
- if (where)
- gfc_error ("Actual argument to '%s' at %L must be a coarray",
+ if (where)
+ gfc_error ("Actual argument to '%s' at %L must be a coarray",
formal->name, &actual->where);
- return 0;
- }
+ return 0;
+ }
- if (gfc_is_coindexed (actual))
- {
- if (where)
- gfc_error ("Actual argument to '%s' at %L must be a coarray "
- "and not coindexed", formal->name, &actual->where);
- return 0;
- }
+ if (formal->attr.codimension && formal->attr.allocatable)
+ {
+ gfc_ref *last = NULL;
for (ref = actual->ref; ref; ref = ref->next)
- {
- if (ref->type == REF_ARRAY && ref->u.ar.as->corank
- && ref->u.ar.type != AR_FULL && ref->u.ar.dimen != 0)
- {
- if (where)
- gfc_error ("Actual argument to '%s' at %L must be a coarray "
- "and thus shall not have an array designator",
- formal->name, &ref->u.ar.where);
- return 0;
- }
- if (ref->type == REF_COMPONENT)
- last = ref;
- }
+ if (ref->type == REF_COMPONENT)
+ last = ref;
/* F2008, 12.5.2.6. */
- if (formal->attr.allocatable &&
- ((last && last->u.c.component->as->corank != formal->as->corank)
- || (!last
- && actual->symtree->n.sym->as->corank != formal->as->corank)))
+ if ((last && last->u.c.component->as->corank != formal->as->corank)
+ || (!last
+ && actual->symtree->n.sym->as->corank != formal->as->corank))
{
if (where)
gfc_error ("Corank mismatch in argument '%s' at %L (%d and %d)",
@@ -1606,7 +1585,10 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
: actual->symtree->n.sym->as->corank);
return 0;
}
+ }
+ if (formal->attr.codimension)
+ {
/* F2008, 12.5.2.8. */
if (formal->attr.dimension
&& (formal->attr.contiguous || formal->as->type != AS_ASSUMED_SHAPE)
@@ -1633,7 +1615,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
formal->name, &actual->where);
return 0;
}
- }
+ }
/* F2008, C1239/C1240. */
if (actual->expr_type == EXPR_VARIABLE
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 53f45e85b8d..71e0ba062f5 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -6886,7 +6886,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
gfc_find_derived_vtab (ts.u.derived);
}
- if (pointer || (dimension == 0 && codimension == 0))
+ if (dimension == 0 && codimension == 0)
goto success;
/* Make sure the last reference node is an array specifiction. */
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 4ec892b74c7..9caa17fad04 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2631,10 +2631,11 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym,
if (GFC_ARRAY_TYPE_P (TREE_TYPE (se->expr))
&& TREE_CODE (TREE_TYPE (se->expr)) == POINTER_TYPE)
se->expr = build_fold_indirect_ref_loc (input_location, se->expr);
-
+
/* Use the actual tree type and not the wrapped coarray. */
- se->expr = fold_convert (TYPE_MAIN_VARIANT (TREE_TYPE (se->expr)),
- se->expr);
+ if (!se->want_pointer)
+ se->expr = fold_convert (TYPE_MAIN_VARIANT (TREE_TYPE (se->expr)),
+ se->expr);
}
return;
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 96aefa33c4d..12c5262218d 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -759,7 +759,9 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
{
tree token;
- token = gfc_create_var_np (pvoid_type_node, "caf_token");
+ token = gfc_create_var_np (build_qualified_type (pvoid_type_node,
+ TYPE_QUAL_RESTRICT),
+ "caf_token");
GFC_TYPE_ARRAY_CAF_TOKEN (type) = token;
DECL_ARTIFICIAL (token) = 1;
TREE_STATIC (token) = 1;
@@ -2102,6 +2104,48 @@ create_function_arglist (gfc_symbol * sym)
f->sym->backend_decl = parm;
+ /* Coarrays which do not use a descriptor pass with -fcoarray=lib the
+ token and the offset as hidden arguments. */
+ if (f->sym->attr.codimension
+ && gfc_option.coarray == GFC_FCOARRAY_LIB
+ && !f->sym->attr.allocatable
+ && f->sym->as->type != AS_ASSUMED_SHAPE)
+ {
+ tree caf_type;
+ tree token;
+ tree offset;
+
+ gcc_assert (f->sym->backend_decl != NULL_TREE
+ && !sym->attr.is_bind_c);
+ caf_type = TREE_TYPE (f->sym->backend_decl);
+
+ gcc_assert (GFC_TYPE_ARRAY_CAF_TOKEN (caf_type) == NULL_TREE);
+ token = build_decl (input_location, PARM_DECL,
+ create_tmp_var_name ("caf_token"),
+ build_qualified_type (pvoid_type_node,
+ TYPE_QUAL_RESTRICT));
+ GFC_TYPE_ARRAY_CAF_TOKEN (caf_type) = token;
+ DECL_CONTEXT (token) = fndecl;
+ DECL_ARTIFICIAL (token) = 1;
+ DECL_ARG_TYPE (token) = TREE_VALUE (typelist);
+ TREE_READONLY (token) = 1;
+ hidden_arglist = chainon (hidden_arglist, token);
+ gfc_finish_decl (token);
+
+ gcc_assert (GFC_TYPE_ARRAY_CAF_OFFSET (caf_type) == NULL_TREE);
+ offset = build_decl (input_location, PARM_DECL,
+ create_tmp_var_name ("caf_offset"),
+ gfc_array_index_type);
+
+ GFC_TYPE_ARRAY_CAF_OFFSET (caf_type) = offset;
+ DECL_CONTEXT (offset) = fndecl;
+ DECL_ARTIFICIAL (offset) = 1;
+ DECL_ARG_TYPE (offset) = TREE_VALUE (typelist);
+ TREE_READONLY (offset) = 1;
+ hidden_arglist = chainon (hidden_arglist, offset);
+ gfc_finish_decl (offset);
+ }
+
arglist = chainon (arglist, parm);
typelist = TREE_CHAIN (typelist);
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 55a0fc499df..76229102436 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -261,6 +261,33 @@ gfc_get_expr_charlen (gfc_expr *e)
}
+/* Return for an expression the backend decl of the coarray. */
+
+static tree
+get_tree_for_caf_expr (gfc_expr *expr)
+{
+ tree caf_decl = NULL_TREE;
+ gfc_ref *ref;
+
+ gcc_assert (expr && expr->expr_type == EXPR_VARIABLE);
+ if (expr->symtree->n.sym->attr.codimension)
+ caf_decl = expr->symtree->n.sym->backend_decl;
+
+ for (ref = expr->ref; ref; ref = ref->next)
+ if (ref->type == REF_COMPONENT)
+ {
+ gfc_component *comp = ref->u.c.component;
+ if (comp->attr.pointer || comp->attr.allocatable)
+ caf_decl = NULL_TREE;
+ if (comp->attr.codimension)
+ caf_decl = comp->backend_decl;
+ }
+
+ gcc_assert (caf_decl != NULL_TREE);
+ return caf_decl;
+}
+
+
/* For each character array constructor subexpression without a ts.u.cl->length,
replace it by its first element (if there aren't any elements, the length
should already be set to zero). */
@@ -2814,6 +2841,7 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
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.
@@ -3362,6 +3390,59 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
if (parmse.string_length != NULL_TREE && !sym->attr.is_bind_c)
VEC_safe_push (tree, gc, stringargs, parmse.string_length);
+ /* For descriptorless coarrays, we pass the token and the offset
+ as additional arguments. */
+ if (fsym && fsym->attr.codimension
+ && gfc_option.coarray == GFC_FCOARRAY_LIB
+ && !fsym->attr.allocatable && fsym->as->type != AS_ASSUMED_SHAPE
+ && (e == NULL
+ || GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (get_tree_for_caf_expr (e)))))
+ /* FIXME: Remove the "||" condition when coarray descriptors have a
+ "token" component. This condition occurs when passing an alloc
+ coarray or assumed-shape dummy to an explict-shape dummy. */
+ {
+ /* Token and offset. */
+ VEC_safe_push (tree, gc, stringargs, null_pointer_node);
+ VEC_safe_push (tree, gc, stringargs,
+ build_int_cst (gfc_array_index_type, 0));
+ gcc_assert (fsym->attr.optional || e != NULL); /* FIXME: "||" cond. */
+ }
+ else if (fsym && fsym->attr.codimension
+ && !fsym->attr.allocatable && fsym->as->type != AS_ASSUMED_SHAPE
+ && gfc_option.coarray == GFC_FCOARRAY_LIB)
+ {
+ tree caf_decl, caf_type;
+ tree offset;
+
+ caf_decl = get_tree_for_caf_expr (e);
+ caf_type = TREE_TYPE (caf_decl);
+
+ gcc_assert (GFC_ARRAY_TYPE_P (caf_type)
+ && GFC_TYPE_ARRAY_CAF_TOKEN (caf_type) != NULL_TREE);
+
+ VEC_safe_push (tree, gc, stringargs,
+ GFC_TYPE_ARRAY_CAF_TOKEN (caf_type));
+
+ if (GFC_TYPE_ARRAY_CAF_OFFSET (caf_type) != NULL_TREE)
+ offset = GFC_TYPE_ARRAY_CAF_OFFSET (caf_type);
+ else
+ offset = build_int_cst (gfc_array_index_type, 0);
+
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (caf_decl))
+ && POINTER_TYPE_P (TREE_TYPE (parmse.expr)));
+
+ tmp = fold_build2_loc (input_location, MINUS_EXPR,
+ gfc_array_index_type,
+ fold_convert (gfc_array_index_type,
+ parmse.expr),
+ fold_convert (gfc_array_index_type,
+ caf_decl));
+ offset = fold_build2_loc (input_location, PLUS_EXPR,
+ gfc_array_index_type, offset, tmp);
+
+ VEC_safe_push (tree, gc, stringargs, offset);
+ }
+
VEC_safe_push (tree, gc, arglist, parmse.expr);
}
gfc_finish_interface_mapping (&mapping, &se->pre, &se->post);
@@ -3790,8 +3871,8 @@ fill_with_spaces (tree start, tree type, tree size)
fold_build2_loc (input_location, MINUS_EXPR, sizetype, i,
TYPE_SIZE_UNIT (type)));
gfc_add_modify (&loop, el,
- fold_build2_loc (input_location, POINTER_PLUS_EXPR,
- TREE_TYPE (el), el, TYPE_SIZE_UNIT (type)));
+ fold_build_pointer_plus_loc (input_location,
+ el, TYPE_SIZE_UNIT (type)));
/* Making the loop... actually loop! */
tmp = gfc_finish_block (&loop);
@@ -3917,8 +3998,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
built_in_decls[BUILT_IN_MEMMOVE],
3, dest, src, slen);
- tmp4 = fold_build2_loc (input_location, POINTER_PLUS_EXPR, TREE_TYPE (dest),
- dest, fold_convert (sizetype, slen));
+ tmp4 = fold_build_pointer_plus_loc (input_location, dest, slen);
tmp4 = fill_with_spaces (tmp4, chartype,
fold_build2_loc (input_location, MINUS_EXPR,
TREE_TYPE(dlen), dlen, slen));
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index db2bbc14770..0c8abc6ca0d 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -5998,9 +5998,8 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
fold_convert (gfc_charlen_type_node, count));
tmp = fold_build2_loc (input_location, MULT_EXPR, gfc_charlen_type_node,
tmp, fold_convert (gfc_charlen_type_node, size));
- tmp = fold_build2_loc (input_location, POINTER_PLUS_EXPR, pvoid_type_node,
- fold_convert (pvoid_type_node, dest),
- fold_convert (sizetype, tmp));
+ tmp = fold_build_pointer_plus_loc (input_location,
+ fold_convert (pvoid_type_node, dest), tmp);
tmp = build_call_expr_loc (input_location,
built_in_decls[BUILT_IN_MEMMOVE], 3, tmp, src,
fold_build2_loc (input_location, MULT_EXPR,
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index d7f1dd51683..01587eb5f2b 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2899,7 +2899,7 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
t = base_decl;
if (!integer_zerop (data_off))
- t = build2 (POINTER_PLUS_EXPR, ptype, t, data_off);
+ t = fold_build_pointer_plus (t, data_off);
t = build1 (NOP_EXPR, build_pointer_type (ptr_type_node), t);
info->data_location = build1 (INDIRECT_REF, ptr_type_node, t);
if (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
@@ -2912,12 +2912,14 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
for (dim = 0; dim < rank; dim++)
{
- t = build2 (POINTER_PLUS_EXPR, ptype, base_decl,
- size_binop (PLUS_EXPR, dim_off, lower_suboff));
+ t = fold_build_pointer_plus (base_decl,
+ size_binop (PLUS_EXPR,
+ dim_off, lower_suboff));
t = build1 (INDIRECT_REF, gfc_array_index_type, t);
info->dimen[dim].lower_bound = t;
- t = build2 (POINTER_PLUS_EXPR, ptype, base_decl,
- size_binop (PLUS_EXPR, dim_off, upper_suboff));
+ t = fold_build_pointer_plus (base_decl,
+ size_binop (PLUS_EXPR,
+ dim_off, upper_suboff));
t = build1 (INDIRECT_REF, gfc_array_index_type, t);
info->dimen[dim].upper_bound = t;
if (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ASSUMED_SHAPE
@@ -2936,8 +2938,9 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
info->dimen[dim].lower_bound,
info->dimen[dim].upper_bound);
}
- t = build2 (POINTER_PLUS_EXPR, ptype, base_decl,
- size_binop (PLUS_EXPR, dim_off, stride_suboff));
+ t = fold_build_pointer_plus (base_decl,
+ size_binop (PLUS_EXPR,
+ dim_off, stride_suboff));
t = build1 (INDIRECT_REF, gfc_array_index_type, t);
t = build2 (MULT_EXPR, gfc_array_index_type, t, elem_size);
info->dimen[dim].stride = t;
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 4043df287f1..578f2258247 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -345,9 +345,7 @@ gfc_build_array_ref (tree base, tree offset, tree decl)
gfc_array_index_type,
offset, GFC_DECL_SPAN(decl));
tmp = gfc_build_addr_expr (pvoid_type_node, base);
- tmp = fold_build2_loc (input_location, POINTER_PLUS_EXPR,
- pvoid_type_node, tmp,
- fold_convert (sizetype, offset));
+ tmp = fold_build_pointer_plus_loc (input_location, tmp, offset);
tmp = fold_convert (build_pointer_type (type), tmp);
if (!TYPE_STRING_FLAG (type))
tmp = build_fold_indirect_ref_loc (input_location, tmp);
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index c56aff8ddd0..48e054f2342 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -736,6 +736,7 @@ struct GTY((variable_size)) lang_type {
tree base_decl[2];
tree nonrestricted_type;
tree caf_token;
+ tree caf_offset;
};
struct GTY((variable_size)) lang_decl {
@@ -781,6 +782,7 @@ struct GTY((variable_size)) lang_decl {
#define GFC_TYPE_ARRAY_RANK(node) (TYPE_LANG_SPECIFIC(node)->rank)
#define GFC_TYPE_ARRAY_CORANK(node) (TYPE_LANG_SPECIFIC(node)->corank)
#define GFC_TYPE_ARRAY_CAF_TOKEN(node) (TYPE_LANG_SPECIFIC(node)->caf_token)
+#define GFC_TYPE_ARRAY_CAF_OFFSET(node) (TYPE_LANG_SPECIFIC(node)->caf_offset)
#define GFC_TYPE_ARRAY_SIZE(node) (TYPE_LANG_SPECIFIC(node)->size)
#define GFC_TYPE_ARRAY_OFFSET(node) (TYPE_LANG_SPECIFIC(node)->offset)
#define GFC_TYPE_ARRAY_AKIND(node) (TYPE_LANG_SPECIFIC(node)->akind)
diff --git a/gcc/function.c b/gcc/function.c
index 894930f75bb..361a8dce197 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2576,16 +2576,13 @@ assign_parm_find_stack_rtl (tree parm, struct assign_parm_data_one *data)
if (data->promoted_mode != BLKmode
&& data->promoted_mode != DECL_MODE (parm))
{
- set_mem_size (stack_parm,
- GEN_INT (GET_MODE_SIZE (data->promoted_mode)));
- if (MEM_EXPR (stack_parm) && MEM_OFFSET (stack_parm))
+ set_mem_size (stack_parm, GET_MODE_SIZE (data->promoted_mode));
+ if (MEM_EXPR (stack_parm) && MEM_OFFSET_KNOWN_P (stack_parm))
{
int offset = subreg_lowpart_offset (DECL_MODE (parm),
data->promoted_mode);
if (offset)
- set_mem_offset (stack_parm,
- plus_constant (MEM_OFFSET (stack_parm),
- -offset));
+ set_mem_offset (stack_parm, MEM_OFFSET (stack_parm) - offset);
}
}
}
@@ -3199,10 +3196,9 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm,
/* ??? This may need a big-endian conversion on sparc64. */
data->stack_parm
= adjust_address (data->stack_parm, data->nominal_mode, 0);
- if (offset && MEM_OFFSET (data->stack_parm))
+ if (offset && MEM_OFFSET_KNOWN_P (data->stack_parm))
set_mem_offset (data->stack_parm,
- plus_constant (MEM_OFFSET (data->stack_parm),
- offset));
+ MEM_OFFSET (data->stack_parm) + offset);
}
}
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 621439f479a..bc41b7bc7f5 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -340,7 +340,7 @@ output_insn_data (void)
switch (d->output_format)
{
case INSN_OUTPUT_FORMAT_NONE:
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { 0 },\n");
printf ("#else\n");
printf (" { 0, 0, 0 },\n");
@@ -351,7 +351,7 @@ output_insn_data (void)
const char *p = d->template_code;
char prev = 0;
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .single =\n");
printf ("#else\n");
printf (" {\n");
@@ -372,7 +372,7 @@ output_insn_data (void)
++p;
}
printf ("\",\n");
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" },\n");
printf ("#else\n");
printf (" 0, 0 },\n");
@@ -380,14 +380,14 @@ output_insn_data (void)
}
break;
case INSN_OUTPUT_FORMAT_MULTI:
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .multi = output_%d },\n", d->code_number);
printf ("#else\n");
printf (" { 0, output_%d, 0 },\n", d->code_number);
printf ("#endif\n");
break;
case INSN_OUTPUT_FORMAT_FUNCTION:
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .function = output_%d },\n", d->code_number);
printf ("#else\n");
printf (" { 0, 0, output_%d },\n", d->code_number);
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 7c9298dfc60..0d8be8f7607 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -2345,7 +2345,7 @@ make_insn_sequence (rtx insn, enum routine_type type)
if (GET_CODE (tmp) != MATCH_SCRATCH && GET_CODE (tmp) != MATCH_DUP)
{
c_test_pos = next_position (pos_ptr, &root_pos,
- POS_PEEP2_INSN, i);
+ POS_PEEP2_INSN, j);
XVECEXP (x, 0, j) = tmp;
j++;
pos_ptr = &c_test_pos->next;
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index bf00a0f0460..d1c5c89546f 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -3231,7 +3231,7 @@ fold_nonarray_ctor_reference (tree type, tree ctor,
double_int bitoffset;
double_int byte_offset_cst = tree_to_double_int (byte_offset);
double_int bits_per_unit_cst = uhwi_to_double_int (BITS_PER_UNIT);
- double_int bitoffset_end;
+ double_int bitoffset_end, access_end;
/* Variable sized objects in static constructors makes no sense,
but field_size can be NULL for flexible array members. */
@@ -3252,14 +3252,16 @@ fold_nonarray_ctor_reference (tree type, tree ctor,
else
bitoffset_end = double_int_zero;
- /* Is OFFSET in the range (BITOFFSET, BITOFFSET_END)? */
- if (double_int_cmp (uhwi_to_double_int (offset), bitoffset, 0) >= 0
+ access_end = double_int_add (uhwi_to_double_int (offset),
+ uhwi_to_double_int (size));
+
+ /* Is there any overlap between [OFFSET, OFFSET+SIZE) and
+ [BITOFFSET, BITOFFSET_END)? */
+ if (double_int_cmp (access_end, bitoffset, 0) > 0
&& (field_size == NULL_TREE
|| double_int_cmp (uhwi_to_double_int (offset),
bitoffset_end, 0) < 0))
{
- double_int access_end = double_int_add (uhwi_to_double_int (offset),
- uhwi_to_double_int (size));
double_int inner_offset = double_int_sub (uhwi_to_double_int (offset),
bitoffset);
/* We do have overlap. Now see if field is large enough to
@@ -3267,6 +3269,8 @@ fold_nonarray_ctor_reference (tree type, tree ctor,
fields. */
if (double_int_cmp (access_end, bitoffset_end, 0) > 0)
return NULL_TREE;
+ if (double_int_cmp (uhwi_to_double_int (offset), bitoffset, 0) < 0)
+ return NULL_TREE;
return fold_ctor_reference (type, cval,
double_int_to_uhwi (inner_offset), size);
}
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index f313352e8a2..af9cdd7c848 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2860,18 +2860,23 @@ gimple_boolify (tree expr)
case TRUTH_NOT_EXPR:
TREE_OPERAND (expr, 0) = gimple_boolify (TREE_OPERAND (expr, 0));
- /* FALLTHRU */
- case EQ_EXPR: case NE_EXPR:
- case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR:
/* These expressions always produce boolean results. */
- TREE_TYPE (expr) = boolean_type_node;
+ if (TREE_CODE (type) != BOOLEAN_TYPE)
+ TREE_TYPE (expr) = boolean_type_node;
return expr;
default:
+ if (COMPARISON_CLASS_P (expr))
+ {
+ /* There expressions always prduce boolean results. */
+ if (TREE_CODE (type) != BOOLEAN_TYPE)
+ TREE_TYPE (expr) = boolean_type_node;
+ return expr;
+ }
/* Other expressions that get here must have boolean values, but
might need to be converted to the appropriate mode. */
- if (type == boolean_type_node)
+ if (TREE_CODE (type) == BOOLEAN_TYPE)
return expr;
return fold_convert_loc (loc, boolean_type_node, expr);
}
@@ -6773,13 +6778,13 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
source location of the outer expression. */
tree org_type = TREE_TYPE (*expr_p);
*expr_p = gimple_boolify (*expr_p);
- *expr_p = build3_loc (saved_location, COND_EXPR,
+ *expr_p = build3_loc (input_location, COND_EXPR,
org_type, *expr_p,
fold_convert_loc
- (saved_location,
+ (input_location,
org_type, boolean_true_node),
fold_convert_loc
- (saved_location,
+ (input_location,
org_type, boolean_false_node));
ret = GS_OK;
break;
@@ -6787,17 +6792,24 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
case TRUTH_NOT_EXPR:
{
- tree orig_type = TREE_TYPE (*expr_p);
+ tree type = TREE_TYPE (*expr_p);
+ /* The parsers are careful to generate TRUTH_NOT_EXPR
+ only with operands that are always zero or one.
+ We do not fold here but handle the only interesting case
+ manually, as fold may re-introduce the TRUTH_NOT_EXPR. */
*expr_p = gimple_boolify (*expr_p);
- if (!useless_type_conversion_p (orig_type, TREE_TYPE (*expr_p)))
- {
- *expr_p = fold_convert_loc (saved_location, orig_type, *expr_p);
- ret = GS_OK;
- break;
- }
- ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
- is_gimple_val, fb_rvalue);
- recalculate_side_effects (*expr_p);
+ if (TYPE_PRECISION (TREE_TYPE (*expr_p)) == 1)
+ *expr_p = build1_loc (input_location, BIT_NOT_EXPR,
+ TREE_TYPE (*expr_p),
+ TREE_OPERAND (*expr_p, 0));
+ else
+ *expr_p = build2_loc (input_location, BIT_XOR_EXPR,
+ TREE_TYPE (*expr_p),
+ TREE_OPERAND (*expr_p, 0),
+ build_int_cst (TREE_TYPE (*expr_p), 1));
+ if (!useless_type_conversion_p (type, TREE_TYPE (*expr_p)))
+ *expr_p = fold_convert_loc (input_location, type, *expr_p);
+ ret = GS_OK;
break;
}
@@ -7229,7 +7241,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
*expr_p = gimple_boolify (*expr_p);
if (!useless_type_conversion_p (orig_type, TREE_TYPE (*expr_p)))
{
- *expr_p = fold_convert_loc (saved_location, orig_type, *expr_p);
+ *expr_p = fold_convert_loc (input_location, orig_type, *expr_p);
ret = GS_OK;
break;
}
@@ -7309,7 +7321,19 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 1));
if (!AGGREGATE_TYPE_P (type))
- goto expr_2;
+ {
+ tree org_type = TREE_TYPE (*expr_p);
+ *expr_p = gimple_boolify (*expr_p);
+ if (!useless_type_conversion_p (org_type,
+ TREE_TYPE (*expr_p)))
+ {
+ *expr_p = fold_convert_loc (input_location,
+ org_type, *expr_p);
+ ret = GS_OK;
+ }
+ else
+ goto expr_2;
+ }
else if (TYPE_MODE (type) != BLKmode)
ret = gimplify_scalar_mode_aggregate_compare (expr_p);
else
diff --git a/gcc/gthr-nks.h b/gcc/gthr-nks.h
deleted file mode 100644
index 311c6904b1a..00000000000
--- a/gcc/gthr-nks.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/* Threads compatibility routines for libgcc2 and libobjc. */
-/* Compile this one with gcc. */
-/* Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-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/>. */
-
-#ifndef GCC_GTHR_NKS_H
-#define GCC_GTHR_NKS_H
-
-/* NKS threads specific definitions.
- Easy, since the interface is mostly one-to-one mapping. */
-
-#define __GTHREADS 1
-
-#define NKS_NO_INLINE_FUNCS
-#include <nksapi.h>
-#include <string.h>
-
-typedef NXKey_t __gthread_key_t;
-typedef NXMutex_t *__gthread_mutex_t;
-typedef NXMutex_t *__gthread_recursive_mutex_t;
-
-#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
-#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
-
-static inline int
-__gthread_active_p (void)
-{
- return 1;
-}
-
-#ifdef _LIBOBJC
-
-/* This is the config.h file in libobjc/ */
-#include <config.h>
-
-#ifdef HAVE_SCHED_H
-# include <sched.h>
-#endif
-
-/* Key structure for maintaining thread specific storage */
-static NXKey_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-static inline int
-__gthread_objc_init_thread_system (void)
-{
- /* Initialize the thread storage key. */
- if (NXKeyCreate (NULL, NULL, &_objc_thread_storage) == 0)
- return 0;
- return -1;
-}
-
-/* Close the threads subsystem. */
-static inline int
-__gthread_objc_close_thread_system (void)
-{
- if (NXKeyDelete (_objc_thread_storage) == 0)
- return 0;
- return -1;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-static inline objc_thread_t
-__gthread_objc_thread_detach (void (*func)(void *), void *arg)
-{
- objc_thread_t thread_id;
- NXContext_t context;
- NXThreadId_t new_thread_handle;
- int err;
-
- if ((context = NXContextAlloc (func, arg, NX_PRIO_MED, 0, 0, 0, &err)) == NULL)
- thread_id = NULL;
- else if (NXThreadCreate (context, NX_THR_DETACHED, &new_thread_handle) == 0)
- thread_id = (objc_thread_t) new_thread_handle;
- else {
- NXContextFree (context);
- thread_id = NULL;
- }
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-static inline int
-__gthread_objc_thread_set_priority (int priority)
-{
- if (NXThreadSetPriority (NXThreadGetId (), priority) == 0)
- return 0;
- return -1;
-}
-
-/* Return the current thread's priority. */
-static inline int
-__gthread_objc_thread_get_priority (void)
-{
- int priority;
-
- if (NXThreadGetPriority (NXThreadGetId (), &priority) == 0)
- return priority;
- return -1;
-}
-
-/* Yield our process time to another thread. */
-static inline void
-__gthread_objc_thread_yield (void)
-{
- NXThreadYield ();
-}
-
-/* Terminate the current thread. */
-static inline int
-__gthread_objc_thread_exit (void)
-{
- /* exit the thread */
- NXThreadExit (&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-static inline objc_thread_t
-__gthread_objc_thread_id (void)
-{
- (objc_thread_t) NXThreadGetId ();
-}
-
-/* Sets the thread's local storage pointer. */
-static inline int
-__gthread_objc_thread_set_data (void *value)
-{
- return NXKeySetValue (_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-static inline void *
-__gthread_objc_thread_get_data (void)
-{
- void *value;
-
- if (NXKeyGetValue (_objc_thread_storage, &value) == 0)
- return value;
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-static inline int
-__gthread_objc_mutex_allocate (objc_mutex_t mutex)
-{
- static const NX_LOCK_INFO_ALLOC (info, "GNU ObjC", 0);
-
- if ((mutex->backend = NXMutexAlloc (0, 0, &info)) == NULL)
- return 0;
- return -1;
-}
-
-/* Deallocate a mutex. */
-static inline int
-__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
-{
- while (NXMutexIsOwned ((NXMutex_t *)mutex->backend))
- NXUnlock ((NXMutex_t *)mutex->backend);
- if (NXMutexFree ((NXMutex_t *)mutex->backend) != 0)
- return -1;
- mutex->backend = NULL;
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-static inline int
-__gthread_objc_mutex_lock (objc_mutex_t mutex)
-{
- return NXLock ((NXMutex_t *)mutex->backend);
-}
-
-/* Try to grab a lock on a mutex. */
-static inline int
-__gthread_objc_mutex_trylock (objc_mutex_t mutex)
-{
- if (!NXTryLock ((NXMutex_t *)mutex->backend))
- return -1;
- return 0;
-}
-
-/* Unlock the mutex */
-static inline int
-__gthread_objc_mutex_unlock (objc_mutex_t mutex)
-{
- return NXUnlock ((NXMutex_t *)mutex->backend);
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-static inline int
-__gthread_objc_condition_allocate (objc_condition_t condition)
-{
- condition->backend = NXCondAlloc (NULL);
- if (condition->backend == NULL)
- return -1;
-
- return 0;
-}
-
-/* Deallocate a condition. */
-static inline int
-__gthread_objc_condition_deallocate (objc_condition_t condition)
-{
- if (NXCondFree ((NXCond_t *)condition->backend) != 0)
- return -1;
- condition->backend = NULL;
- return 0;
-}
-
-/* Wait on the condition */
-static inline int
-__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
-{
- return NXCondWait ((NXCond_t *)condition->backend, (NXMutex_t *)mutex->backend);
-}
-
-/* Wake up all threads waiting on this condition. */
-static inline int
-__gthread_objc_condition_broadcast (objc_condition_t condition)
-{
- return NXCondBroadcast ((NXCond_t *)condition->backend);
-}
-
-/* Wake up one thread waiting on this condition. */
-static inline int
-__gthread_objc_condition_signal (objc_condition_t condition)
-{
- return NXCondSignal ((NXCond_t *)condition->backend);
-}
-
-#else /* _LIBOBJC */
-
-#if defined(__cplusplus)
-# include <bits/atomicity.h>
-/* The remaining conditions here are temporary until there is
- an application accessible atomic operations API set... */
-#elif defined(_M_IA64) || defined(__ia64__)
-# include <../libstdc++-v3/config/cpu/ia64/bits/atomicity.h>
-#elif defined(_M_IX86) || defined(__i486__)
-# include <../libstdc++-v3/config/cpu/i486/bits/atomicity.h>
-#elif defined(_M_AMD64) || defined(__x86_64__)
-# include <../libstdc++-v3/config/cpu/x86-64/bits/atomicity.h>
-#endif
-
-typedef volatile long __gthread_once_t;
-
-#define __GTHREAD_ONCE_INIT 0
-
-static inline int
-__gthread_once (__gthread_once_t *__once, void (*__func) (void))
-{
- if (__compare_and_swap (__once, 0, 1))
- {
- __func ();
- *__once |= 2;
- }
- else
- {
- while (!(*__once & 2))
- NXThreadYield ();
- }
- return 0;
-}
-
-static inline int
-__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
-{
- return NXKeyCreate (__dtor, NULL, __key);
-}
-
-static inline int
-__gthread_key_dtor (__gthread_key_t __key, void *__ptr)
-{
- /* Just reset the key value to zero. */
- if (__ptr)
- return NXKeySetValue (__key, NULL);
- return 0;
-}
-
-static inline int
-__gthread_key_delete (__gthread_key_t __key)
-{
- return NXKeyDelete (__key);
-}
-
-static inline void *
-__gthread_getspecific (__gthread_key_t __key)
-{
- void *__value;
-
- if (NXKeyGetValue (__key, &__value) == 0)
- return __value;
- return NULL;
-}
-
-static inline int
-__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
-{
- return NXKeySetValue (__key, (void *)__ptr);
-}
-
-static inline void
-__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
-{
- static const NX_LOCK_INFO_ALLOC (__info, "GTHREADS", 0);
-
- *__mutex = NXMutexAlloc (0, 0, &__info);
-}
-
-static inline int
-__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(__mutex))
-{
- return 0;
-}
-
-static inline int
-__gthread_mutex_lock (__gthread_mutex_t *__mutex)
-{
- return NXLock (*__mutex);
-}
-
-static inline int
-__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
-{
- if (NXTryLock (*__mutex))
- return 0;
- return -1;
-}
-
-static inline int
-__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
-{
- return NXUnlock (*__mutex);
-}
-
-static inline void
-__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
-{
- static const NX_LOCK_INFO_ALLOC (__info, "GTHREADS", 0);
-
- *__mutex = NXMutexAlloc (NX_MUTEX_RECURSIVE, 0, &__info);
-}
-
-static inline int
-__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
-{
- return NXLock (*__mutex);
-}
-
-static inline int
-__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
-{
- if (NXTryLock (*__mutex))
- return 0;
- return -1;
-}
-
-static inline int
-__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
-{
- return NXUnlock (*__mutex);
-}
-
-#endif /* _LIBOBJC */
-
-#endif /* not GCC_GTHR_NKS_H */
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index a7fecf26fbf..dc8cf095f6e 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1,7 +1,9 @@
/* Interprocedural constant propagation
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
- Contributed by Razya Ladelsky <RAZYA@il.ibm.com>
+
+ Contributed by Razya Ladelsky <RAZYA@il.ibm.com> and Martin Jambor
+ <mjambor@suse.cz>
This file is part of GCC.
@@ -19,116 +21,85 @@ 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/>. */
-/* Interprocedural constant propagation. The aim of interprocedural constant
- propagation (IPCP) is to find which function's argument has the same
- constant value in each invocation throughout the whole program. For example,
- consider the following program:
-
- int g (int y)
- {
- printf ("value is %d",y);
- }
+/* Interprocedural constant propagation (IPA-CP).
- int f (int x)
- {
- g (x);
- }
+ The goal of this transformation is to
- int h (int y)
- {
- g (y);
- }
+ 1) discover functions which are always invoked with some arguments with the
+ same known constant values and modify the functions so that the
+ subsequent optimizations can take advantage of the knowledge, and
- void main (void)
- {
- f (3);
- h (3);
- }
+ 2) partial specialization - create specialized versions of functions
+ transformed in this way if some parameters are known constants only in
+ certain contexts but the estimated tradeoff between speedup and cost size
+ is deemed good.
+ The algorithm also propagates types and attempts to perform type based
+ devirtualization. Types are propagated much like constants.
- The IPCP algorithm will find that g's formal argument y is always called
- with the value 3.
+ The algorithm basically consists of three stages. In the first, functions
+ are analyzed one at a time and jump functions are constructed for all known
+ call-sites. In the second phase, the pass propagates information from the
+ jump functions across the call to reveal what values are available at what
+ call sites, performs estimations of effects of known values on functions and
+ their callees, and finally decides what specialized extra versions should be
+ created. In the third, the special versions materialize and appropriate
+ calls are redirected.
- The algorithm used is based on "Interprocedural Constant Propagation", by
- David Callahan, Keith D Cooper, Ken Kennedy, Linda Torczon, Comp86, pg
- 152-161
+ The algorithm used is to a certain extent based on "Interprocedural Constant
+ Propagation", by David Callahan, Keith D Cooper, Ken Kennedy, Linda Torczon,
+ Comp86, pg 152-161 and "A Methodology for Procedure Cloning" by Keith D
+ Cooper, Mary W. Hall, and Ken Kennedy.
- The optimization is divided into three stages:
First stage - intraprocedural analysis
=======================================
+
This phase computes jump_function and modification flags.
- A jump function for a callsite represents the values passed as an actual
- arguments of a given callsite. There are three types of values:
- Pass through - the caller's formal parameter is passed as an actual argument.
+ A jump function for a call-site represents the values passed as an actual
+ arguments of a given call-site. In principle, there are three types of
+ values:
+
+ Pass through - the caller's formal parameter is passed as an actual
+ argument, plus an operation on it can be performed.
Constant - a constant is passed as an actual argument.
Unknown - neither of the above.
- The jump function info, ipa_jump_func, is stored in ipa_edge_args
- structure (defined in ipa_prop.h and pointed to by cgraph_node->aux)
- modified_flags are defined in ipa_node_params structure
- (defined in ipa_prop.h and pointed to by cgraph_edge->aux).
+ All jump function types are described in detail in ipa-prop.h, together with
+ the data structures that represent them and methods of accessing them.
- -ipcp_generate_summary() is the first stage driver.
+ ipcp_generate_summary() is the main function of the first stage.
Second stage - interprocedural analysis
========================================
- This phase does the interprocedural constant propagation.
- It computes lattices for all formal parameters in the program
- and their value that may be:
- TOP - unknown.
- BOTTOM - non constant.
- CONSTANT - constant value.
- Lattice describing a formal parameter p will have a constant value if all
- callsites invoking this function have the same constant value passed to p.
+ This stage is itself divided into two phases. In the first, we propagate
+ known values over the call graph, in the second, we make cloning decisions.
+ It uses a different algorithm than the original Callahan's paper.
- The lattices are stored in ipcp_lattice which is itself in ipa_node_params
- structure (defined in ipa_prop.h and pointed to by cgraph_edge->aux).
+ First, we traverse the functions topologically from callers to callees and,
+ for each strongly connected component (SCC), we propagate constants
+ according to previously computed jump functions. We also record what known
+ values depend on other known values and estimate local effects. Finally, we
+ propagate cumulative information about these effects from dependant values
+ to those on which they depend.
- -ipcp_iterate_stage() is the second stage driver.
+ Second, we again traverse the call graph in the same topological order and
+ make clones for functions which we know are called with the same values in
+ all contexts and decide about extra specialized clones of functions just for
+ some contexts - these decisions are based on both local estimates and
+ cumulative estimates propagated from callees.
- Third phase - transformation of function code
+ ipcp_propagate_stage() and ipcp_decision_stage() together constitute the
+ third stage.
+
+ Third phase - materialization of clones, call statement updates.
============================================
- Propagates the constant-valued formals into the function.
- For each function whose parameters are constants, we create its clone.
-
- Then we process the clone in two ways:
- 1. We insert an assignment statement 'parameter = const' at the beginning
- of the cloned function.
- 2. For read-only parameters that do not live in memory, we replace all their
- uses with the constant.
-
- We also need to modify some callsites to call the cloned functions instead
- of the original ones. For a callsite passing an argument found to be a
- constant by IPCP, there are two different cases to handle:
- 1. A constant is passed as an argument. In this case the callsite in the
- should be redirected to call the cloned callee.
- 2. A parameter (of the caller) passed as an argument (pass through
- argument). In such cases both the caller and the callee have clones and
- only the callsite in the cloned caller is redirected to call to the
- cloned callee.
-
- This update is done in two steps: First all cloned functions are created
- during a traversal of the call graph, during which all callsites are
- redirected to call the cloned function. Then the callsites are traversed
- and many calls redirected back to fit the description above.
-
- -ipcp_insert_stage() is the third phase driver.
-
-
- This pass also performs devirtualization - turns virtual calls into direct
- ones if it can prove that all invocations of the function call the same
- callee. This is achieved by building a list of all base types (actually,
- their BINFOs) that individual parameters can have in an iterative matter
- just like propagating scalar constants and then examining whether virtual
- calls which take a parameter as their object fold to the same target for all
- these types. If we cannot enumerate all types or there is a type which does
- not have any BINFO associated with it, cannot_devirtualize of the associated
- parameter descriptor is set which is an equivalent of BOTTOM lattice value
- in standard IPA constant propagation.
-*/
+
+ This stage is currently performed by call graph code (mainly in cgraphunit.c
+ and tree-inline.c) according to instructions inserted to the call graph by
+ the second stage. */
#include "config.h"
#include "system.h"
@@ -149,317 +120,372 @@ along with GCC; see the file COPYING3. If not see
#include "fibheap.h"
#include "params.h"
#include "ipa-inline.h"
+#include "ipa-utils.h"
-/* Number of functions identified as candidates for cloning. When not cloning
- we can simplify iterate stage not forcing it to go through the decision
- on what is profitable and what not. */
-static int n_cloning_candidates;
+struct ipcp_value;
-/* Maximal count found in program. */
-static gcov_type max_count;
+/* Describes a particular source for an IPA-CP value. */
-/* Cgraph nodes that has been completely replaced by cloning during iterate
- * stage and will be removed after ipcp is finished. */
-static bitmap dead_nodes;
+struct ipcp_value_source
+{
+ /* The incoming edge that brought the value. */
+ struct cgraph_edge *cs;
+ /* If the jump function that resulted into his value was a pass-through or an
+ ancestor, this is the ipcp_value of the caller from which the described
+ value has been derived. Otherwise it is NULL. */
+ struct ipcp_value *val;
+ /* Next pointer in a linked list of sources of a value. */
+ struct ipcp_value_source *next;
+ /* If the jump function that resulted into his value was a pass-through or an
+ ancestor, this is the index of the parameter of the caller the jump
+ function references. */
+ int index;
+};
-static void ipcp_print_profile_data (FILE *);
-static void ipcp_function_scale_print (FILE *);
+/* Describes one particular value stored in struct ipcp_lattice. */
-/* Get the original node field of ipa_node_params associated with node NODE. */
-static inline struct cgraph_node *
-ipcp_get_orig_node (struct cgraph_node *node)
+struct ipcp_value
{
- return IPA_NODE_REF (node)->ipcp_orig_node;
-}
+ /* The actual value for the given parameter. This is either an IPA invariant
+ or a TREE_BINFO describing a type that can be used for
+ devirtualization. */
+ tree value;
+ /* The list of sources from which this value originates. */
+ struct ipcp_value_source *sources;
+ /* Next pointers in a linked list of all values in a lattice. */
+ struct ipcp_value *next;
+ /* Next pointers in a linked list of values in a strongly connected component
+ of values. */
+ struct ipcp_value *scc_next;
+ /* Next pointers in a linked list of SCCs of values sorted topologically
+ according their sources. */
+ struct ipcp_value *topo_next;
+ /* A specialized node created for this value, NULL if none has been (so far)
+ created. */
+ struct cgraph_node *spec_node;
+ /* Depth first search number and low link for topological sorting of
+ values. */
+ int dfs, low_link;
+ /* Time benefit and size cost that specializing the function for this value
+ would bring about in this function alone. */
+ int local_time_benefit, local_size_cost;
+ /* Time benefit and size cost that specializing the function for this value
+ can bring about in it's callees (transitively). */
+ int prop_time_benefit, prop_size_cost;
+ /* True if this valye is currently on the topo-sort stack. */
+ bool on_stack;
+};
-/* Return true if NODE describes a cloned/versioned function. */
-static inline bool
-ipcp_node_is_clone (struct cgraph_node *node)
-{
- return (ipcp_get_orig_node (node) != NULL);
-}
+/* Allocation pools for values and their sources in ipa-cp. */
-/* Create ipa_node_params and its data structures for NEW_NODE. Set ORIG_NODE
- as the ipcp_orig_node field in ipa_node_params. */
-static void
-ipcp_init_cloned_node (struct cgraph_node *orig_node,
- struct cgraph_node *new_node)
-{
- gcc_checking_assert (ipa_node_params_vector
- && (VEC_length (ipa_node_params_t,
- ipa_node_params_vector)
- > (unsigned) cgraph_max_uid));
- gcc_checking_assert (IPA_NODE_REF (new_node)->params);
- IPA_NODE_REF (new_node)->ipcp_orig_node = orig_node;
-}
+alloc_pool ipcp_values_pool;
+alloc_pool ipcp_sources_pool;
-/* Return scale for NODE. */
-static inline gcov_type
-ipcp_get_node_scale (struct cgraph_node *node)
+/* Lattice describing potential values of a formal parameter of a function and
+ some of their other properties. TOP is represented by a lattice with zero
+ values and with contains_variable and bottom flags cleared. BOTTOM is
+ represented by a lattice with the bottom flag set. In that case, values and
+ contains_variable flag should be disregarded. */
+
+struct ipcp_lattice
{
- return IPA_NODE_REF (node)->count_scale;
-}
+ /* The list of known values and types in this lattice. Note that values are
+ not deallocated if a lattice is set to bottom because there may be value
+ sources referencing them. */
+ struct ipcp_value *values;
+ /* Number of known values and types in this lattice. */
+ int values_count;
+ /* The lattice contains a variable component (in addition to values). */
+ bool contains_variable;
+ /* The value of the lattice is bottom (i.e. variable and unusable for any
+ propagation). */
+ bool bottom;
+ /* There is a virtual call based on this parameter. */
+ bool virt_call;
+};
-/* Set COUNT as scale for NODE. */
-static inline void
-ipcp_set_node_scale (struct cgraph_node *node, gcov_type count)
+/* Maximal count found in program. */
+
+static gcov_type max_count;
+
+/* Original overall size of the program. */
+
+static long overall_size, max_new_size;
+
+/* Head of the linked list of topologically sorted values. */
+
+static struct ipcp_value *values_topo;
+
+/* Return the lattice corresponding to the Ith formal parameter of the function
+ described by INFO. */
+static inline struct ipcp_lattice *
+ipa_get_lattice (struct ipa_node_params *info, int i)
{
- IPA_NODE_REF (node)->count_scale = count;
+ gcc_assert (i >= 0 && i <= ipa_get_param_count (info));
+ gcc_checking_assert (!info->ipcp_orig_node);
+ gcc_checking_assert (info->lattices);
+ return &(info->lattices[i]);
}
-/* Return whether LAT is a constant lattice. */
+/* Return whether LAT is a lattice with a single constant and without an
+ undefined value. */
+
static inline bool
-ipcp_lat_is_const (struct ipcp_lattice *lat)
+ipa_lat_is_single_const (struct ipcp_lattice *lat)
{
- if (lat->type == IPA_CONST_VALUE)
- return true;
- else
+ if (lat->bottom
+ || lat->contains_variable
+ || lat->values_count != 1)
return false;
+ else
+ return true;
}
-/* Return whether LAT is a constant lattice that ipa-cp can actually insert
- into the code (i.e. constants excluding member pointers and pointers). */
-static inline bool
-ipcp_lat_is_insertable (struct ipcp_lattice *lat)
-{
- return lat->type == IPA_CONST_VALUE;
-}
+/* Return true iff the CS is an edge within a strongly connected component as
+ computed by ipa_reduced_postorder. */
-/* Return true if LAT1 and LAT2 are equal. */
static inline bool
-ipcp_lats_are_equal (struct ipcp_lattice *lat1, struct ipcp_lattice *lat2)
+edge_within_scc (struct cgraph_edge *cs)
{
- gcc_assert (ipcp_lat_is_const (lat1) && ipcp_lat_is_const (lat2));
- if (lat1->type != lat2->type)
- return false;
-
- if (TREE_CODE (lat1->constant) == ADDR_EXPR
- && TREE_CODE (lat2->constant) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (lat1->constant, 0)) == CONST_DECL
- && TREE_CODE (TREE_OPERAND (lat2->constant, 0)) == CONST_DECL)
- return operand_equal_p (DECL_INITIAL (TREE_OPERAND (lat1->constant, 0)),
- DECL_INITIAL (TREE_OPERAND (lat2->constant, 0)), 0);
- else
- return operand_equal_p (lat1->constant, lat2->constant, 0);
+ struct ipa_dfs_info *caller_dfs = (struct ipa_dfs_info *) cs->caller->aux;
+ struct ipa_dfs_info *callee_dfs;
+ struct cgraph_node *callee = cgraph_function_node (cs->callee, NULL);
+
+ callee_dfs = (struct ipa_dfs_info *) callee->aux;
+ return (caller_dfs
+ && callee_dfs
+ && caller_dfs->scc_no == callee_dfs->scc_no);
}
-/* Compute Meet arithmetics:
- Meet (IPA_BOTTOM, x) = IPA_BOTTOM
- Meet (IPA_TOP,x) = x
- Meet (const_a,const_b) = IPA_BOTTOM, if const_a != const_b.
- MEET (const_a,const_b) = const_a, if const_a == const_b.*/
+/* Print V which is extracted from a value in a lattice to F. */
+
static void
-ipa_lattice_meet (struct ipcp_lattice *res, struct ipcp_lattice *lat1,
- struct ipcp_lattice *lat2)
+print_ipcp_constant_value (FILE * f, tree v)
{
- if (lat1->type == IPA_BOTTOM || lat2->type == IPA_BOTTOM)
- {
- res->type = IPA_BOTTOM;
- return;
- }
- if (lat1->type == IPA_TOP)
- {
- res->type = lat2->type;
- res->constant = lat2->constant;
- return;
- }
- if (lat2->type == IPA_TOP)
- {
- res->type = lat1->type;
- res->constant = lat1->constant;
- return;
- }
- if (!ipcp_lats_are_equal (lat1, lat2))
+ if (TREE_CODE (v) == TREE_BINFO)
{
- res->type = IPA_BOTTOM;
- return;
+ fprintf (f, "BINFO ");
+ print_generic_expr (f, BINFO_TYPE (v), 0);
}
- res->type = lat1->type;
- res->constant = lat1->constant;
-}
-
-/* True when OLD_LAT and NEW_LAT values are not the same. */
-
-static bool
-ipcp_lattice_changed (struct ipcp_lattice *old_lat,
- struct ipcp_lattice *new_lat)
-{
- if (old_lat->type == new_lat->type)
+ else if (TREE_CODE (v) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (v, 0)) == CONST_DECL)
{
- if (!ipcp_lat_is_const (old_lat))
- return false;
- if (ipcp_lats_are_equal (old_lat, new_lat))
- return false;
+ fprintf (f, "& ");
+ print_generic_expr (f, DECL_INITIAL (TREE_OPERAND (v, 0)), 0);
}
- return true;
+ else
+ print_generic_expr (f, v, 0);
}
/* Print all ipcp_lattices of all functions to F. */
+
static void
-ipcp_print_all_lattices (FILE * f)
+print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits)
{
struct cgraph_node *node;
int i, count;
- fprintf (f, "\nLattice:\n");
- for (node = cgraph_nodes; node; node = node->next)
+ fprintf (f, "\nLattices:\n");
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
{
struct ipa_node_params *info;
- if (!node->analyzed)
- continue;
info = IPA_NODE_REF (node);
- fprintf (f, " Node: %s:\n", cgraph_node_name (node));
+ fprintf (f, " Node: %s/%i:\n", cgraph_node_name (node), node->uid);
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+ struct ipcp_value *val;
+ bool prev = false;
fprintf (f, " param [%d]: ", i);
- if (lat->type == IPA_CONST_VALUE)
+ if (lat->bottom)
{
- tree cst = lat->constant;
- fprintf (f, "type is CONST ");
- print_generic_expr (f, cst, 0);
- if (TREE_CODE (cst) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (cst, 0)) == CONST_DECL)
+ fprintf (f, "BOTTOM\n");
+ continue;
+ }
+
+ if (!lat->values_count && !lat->contains_variable)
+ {
+ fprintf (f, "TOP\n");
+ continue;
+ }
+
+ if (lat->contains_variable)
+ {
+ fprintf (f, "VARIABLE");
+ prev = true;
+ if (dump_benefits)
+ fprintf (f, "\n");
+ }
+
+ for (val = lat->values; val; val = val->next)
+ {
+ if (dump_benefits && prev)
+ fprintf (f, " ");
+ else if (!dump_benefits && prev)
+ fprintf (f, ", ");
+ else
+ prev = true;
+
+ print_ipcp_constant_value (f, val->value);
+
+ if (dump_sources)
{
- fprintf (f, " -> ");
- print_generic_expr (f, DECL_INITIAL (TREE_OPERAND (cst, 0)),
- 0);
+ struct ipcp_value_source *s;
+
+ fprintf (f, " [from:");
+ for (s = val->sources; s; s = s->next)
+ fprintf (f, " %i(%i)", s->cs->caller->uid,s->cs->frequency);
+ fprintf (f, "]");
}
+
+ if (dump_benefits)
+ fprintf (f, " [loc_time: %i, loc_size: %i, "
+ "prop_time: %i, prop_size: %i]\n",
+ val->local_time_benefit, val->local_size_cost,
+ val->prop_time_benefit, val->prop_size_cost);
}
- else if (lat->type == IPA_TOP)
- fprintf (f, "type is TOP");
- else
- fprintf (f, "type is BOTTOM");
- if (ipa_param_cannot_devirtualize_p (info, i))
- fprintf (f, " - cannot_devirtualize set\n");
- else if (ipa_param_types_vec_empty (info, i))
- fprintf (f, " - type list empty\n");
- else
+ if (!dump_benefits)
fprintf (f, "\n");
}
}
}
-/* Return true if ipcp algorithms would allow cloning NODE. */
+/* Determine whether it is at all technically possible to create clones of NODE
+ and store this information in the ipa_node_params structure associated
+ with NODE. */
-static bool
-ipcp_versionable_function_p (struct cgraph_node *node)
+static void
+determine_versionability (struct cgraph_node *node)
{
struct cgraph_edge *edge;
-
- /* We always version the actual function and redirect through the aliases. */
- if (node->alias)
- return false;
-
- /* We don't know how to clone thunks. */
- if (node->thunk.thunk_p)
- return false;
+ const char *reason = NULL;
/* There are a number of generic reasons functions cannot be versioned. We
also cannot remove parameters if there are type attributes such as fnspec
present. */
- if (!inline_summary (node)->versionable
- || TYPE_ATTRIBUTES (TREE_TYPE (node->decl)))
- return false;
+ if (node->alias || node->thunk.thunk_p)
+ reason = "alias or thunk";
+ else if (!inline_summary (node)->versionable)
+ reason = "inliner claims it is so";
+ else if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl)))
+ reason = "there are type attributes";
+ else if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
+ reason = "insufficient body availability";
+ else
+ /* Removing arguments doesn't work if the function takes varargs
+ or use __builtin_apply_args.
+ FIXME: handle this together with can_change_signature flag. */
+ for (edge = node->callees; edge; edge = edge->next_callee)
+ {
+ tree t = edge->callee->decl;
+ if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
+ && (DECL_FUNCTION_CODE (t) == BUILT_IN_APPLY_ARGS
+ || DECL_FUNCTION_CODE (t) == BUILT_IN_VA_START))
+ {
+ reason = "prohibitive builtins called";
+ break;
+ };
+ }
- /* Removing arguments doesn't work if the function takes varargs
- or use __builtin_apply_args.
- FIXME: handle this together with can_change_signature flag. */
- for (edge = node->callees; edge; edge = edge->next_callee)
- {
- tree t = edge->callee->decl;
- if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
- && (DECL_FUNCTION_CODE (t) == BUILT_IN_APPLY_ARGS
- || DECL_FUNCTION_CODE (t) == BUILT_IN_VA_START))
- return false;
- }
+ if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
+ fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
+ cgraph_node_name (node), node->uid, reason);
- return true;
+ IPA_NODE_REF (node)->node_versionable = (reason == NULL);
}
-/* Return true if this NODE is viable candidate for cloning. */
+/* Return true if it is at all technically possible to create clones of a
+ NODE. */
+
static bool
-ipcp_cloning_candidate_p (struct cgraph_node *node)
+ipcp_versionable_function_p (struct cgraph_node *node)
{
- int n_calls = 0;
- int n_hot_calls = 0;
- gcov_type direct_call_sum = 0;
- struct cgraph_edge *e;
+ return IPA_NODE_REF (node)->node_versionable;
+}
- /* We look through aliases, so we clone the aliased function instead. */
- if (node->alias)
- return false;
+/* Structure holding accumulated information about callers of a node. */
- /* We never clone functions that are not visible from outside.
- FIXME: in future we should clone such functions when they are called with
- different constants, but current ipcp implementation is not good on this.
- */
- if (cgraph_only_called_directly_p (node) || !node->analyzed)
- return false;
+struct caller_statistics
+{
+ gcov_type count_sum;
+ int n_calls, n_hot_calls, freq_sum;
+};
- /* When function address is taken, we are pretty sure it will be called in hidden way. */
- if (node->address_taken)
- {
- if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; address is taken.\n",
- cgraph_node_name (node));
- return false;
- }
+/* Initialize fields of STAT to zeroes. */
- if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
- {
- if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; body is overwritable.\n",
- cgraph_node_name (node));
- return false;
- }
- if (!ipcp_versionable_function_p (node))
- {
- if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; body is not versionable.\n",
- cgraph_node_name (node));
- return false;
- }
- for (e = node->callers; e; e = e->next_caller)
- {
- direct_call_sum += e->count;
- n_calls ++;
- if (cgraph_maybe_hot_edge_p (e))
- n_hot_calls ++;
- }
+static inline void
+init_caller_stats (struct caller_statistics *stats)
+{
+ stats->count_sum = 0;
+ stats->n_calls = 0;
+ stats->n_hot_calls = 0;
+ stats->freq_sum = 0;
+}
+
+/* Worker callback of cgraph_for_node_and_aliases accumulating statistics of
+ non-thunk incoming edges to NODE. */
+
+static bool
+gather_caller_stats (struct cgraph_node *node, void *data)
+{
+ struct caller_statistics *stats = (struct caller_statistics *) data;
+ struct cgraph_edge *cs;
+
+ for (cs = node->callers; cs; cs = cs->next_caller)
+ if (cs->caller->thunk.thunk_p)
+ cgraph_for_node_and_aliases (cs->caller, gather_caller_stats,
+ stats, false);
+ else
+ {
+ stats->count_sum += cs->count;
+ stats->freq_sum += cs->frequency;
+ stats->n_calls++;
+ if (cgraph_maybe_hot_edge_p (cs))
+ stats->n_hot_calls ++;
+ }
+ return false;
+
+}
+
+/* Return true if this NODE is viable candidate for cloning. */
- if (!n_calls)
+static bool
+ipcp_cloning_candidate_p (struct cgraph_node *node)
+{
+ struct caller_statistics stats;
+
+ gcc_checking_assert (cgraph_function_with_gimple_body_p (node));
+
+ if (!flag_ipa_cp_clone)
{
if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; no direct calls.\n",
+ fprintf (dump_file, "Not considering %s for cloning; "
+ "-fipa-cp-clone disabled.\n",
cgraph_node_name (node));
return false;
}
- if (inline_summary (node)->self_size < n_calls)
- {
- if (dump_file)
- fprintf (dump_file, "Considering %s for cloning; code would shrink.\n",
- cgraph_node_name (node));
- return true;
- }
- if (!flag_ipa_cp_clone)
+ if (!optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->decl)))
{
if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; -fipa-cp-clone disabled.\n",
+ fprintf (dump_file, "Not considering %s for cloning; "
+ "optimizing it for size.\n",
cgraph_node_name (node));
return false;
}
- if (!optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->decl)))
+ init_caller_stats (&stats);
+ cgraph_for_node_and_aliases (node, gather_caller_stats, &stats, false);
+
+ if (inline_summary (node)->self_size < stats.n_calls)
{
if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; optimizing it for size.\n",
+ fprintf (dump_file, "Considering %s for cloning; code might shrink.\n",
cgraph_node_name (node));
- return false;
+ return true;
}
/* When profile is available and function is hot, propagate into it even if
@@ -467,15 +493,16 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
significantly. */
if (max_count)
{
- if (direct_call_sum > node->count * 90 / 100)
+ if (stats.count_sum > node->count * 90 / 100)
{
if (dump_file)
- fprintf (dump_file, "Considering %s for cloning; usually called directly.\n",
+ fprintf (dump_file, "Considering %s for cloning; "
+ "usually called directly.\n",
cgraph_node_name (node));
return true;
}
}
- if (!n_hot_calls)
+ if (!stats.n_hot_calls)
{
if (dump_file)
fprintf (dump_file, "Not considering %s for cloning; no hot calls.\n",
@@ -488,1012 +515,1918 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
return true;
}
-/* Mark parameter with index I of function described by INFO as unsuitable for
- devirtualization. Return true if it has already been marked so. */
+/* Arrays representing a topological ordering of call graph nodes and a stack
+ of noes used during constant propagation. */
-static bool
-ipa_set_param_cannot_devirtualize (struct ipa_node_params *info, int i)
+struct topo_info
{
- bool ret = info->params[i].cannot_devirtualize;
- info->params[i].cannot_devirtualize = true;
- if (info->params[i].types)
- VEC_free (tree, heap, info->params[i].types);
+ struct cgraph_node **order;
+ struct cgraph_node **stack;
+ int nnodes, stack_top;
+};
+
+/* Allocate the arrays in TOPO and topologically sort the nodes into order. */
+
+static void
+build_toporder_info (struct topo_info *topo)
+{
+ topo->order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ topo->stack = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ topo->stack_top = 0;
+ topo->nnodes = ipa_reduced_postorder (topo->order, true, true, NULL);
+}
+
+/* Free information about strongly connected components and the arrays in
+ TOPO. */
+
+static void
+free_toporder_info (struct topo_info *topo)
+{
+ ipa_free_postorder_info ();
+ free (topo->order);
+ free (topo->stack);
+}
+
+/* Add NODE to the stack in TOPO, unless it is already there. */
+
+static inline void
+push_node_to_stack (struct topo_info *topo, struct cgraph_node *node)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ if (info->node_enqueued)
+ return;
+ info->node_enqueued = 1;
+ topo->stack[topo->stack_top++] = node;
+}
+
+/* Pop a node from the stack in TOPO and return it or return NULL if the stack
+ is empty. */
+
+static struct cgraph_node *
+pop_node_from_stack (struct topo_info *topo)
+{
+ if (topo->stack_top)
+ {
+ struct cgraph_node *node;
+ topo->stack_top--;
+ node = topo->stack[topo->stack_top];
+ IPA_NODE_REF (node)->node_enqueued = 0;
+ return node;
+ }
+ else
+ return NULL;
+}
+
+/* Set lattice LAT to bottom and return true if it previously was not set as
+ such. */
+
+static inline bool
+set_lattice_to_bottom (struct ipcp_lattice *lat)
+{
+ bool ret = !lat->bottom;
+ lat->bottom = true;
return ret;
}
-/* Initialize ipcp_lattices array. The lattices corresponding to supported
- types (integers, real types and Fortran constants defined as const_decls)
- are initialized to IPA_TOP, the rest of them to IPA_BOTTOM. */
+/* Mark lattice as containing an unknown value and return true if it previously
+ was not marked as such. */
+
+static inline bool
+set_lattice_contains_variable (struct ipcp_lattice *lat)
+{
+ bool ret = !lat->contains_variable;
+ lat->contains_variable = true;
+ return ret;
+}
+
+/* Initialize ipcp_lattices. */
+
static void
-ipcp_initialize_node_lattices (struct cgraph_node *node)
+initialize_node_lattices (struct cgraph_node *node)
{
- int i;
struct ipa_node_params *info = IPA_NODE_REF (node);
- enum ipa_lattice_type type;
+ struct cgraph_edge *ie;
+ bool disable = false, variable = false;
+ int i;
+ gcc_checking_assert (cgraph_function_with_gimple_body_p (node));
if (ipa_is_called_with_var_arguments (info))
- type = IPA_BOTTOM;
- /* We don't know how to clone thunks even when they are local. */
- else if (node->local.local
- && !node->thunk.thunk_p)
- type = IPA_TOP;
- /* When cloning is allowed, we can assume that externally visible functions
- are not called. We will compensate this by cloning later. */
- else if (ipcp_cloning_candidate_p (node))
- type = IPA_TOP, n_cloning_candidates ++;
- else
- type = IPA_BOTTOM;
+ disable = true;
+ else if (!node->local.local)
+ {
+ /* When cloning is allowed, we can assume that externally visible
+ functions are not called. We will compensate this by cloning
+ later. */
+ if (ipcp_versionable_function_p (node)
+ && ipcp_cloning_candidate_p (node))
+ variable = true;
+ else
+ disable = true;
+ }
- for (i = 0; i < ipa_get_param_count (info) ; i++)
+ if (disable || variable)
{
- ipa_get_lattice (info, i)->type = type;
- if (type == IPA_BOTTOM)
- ipa_set_param_cannot_devirtualize (info, i);
+ for (i = 0; i < ipa_get_param_count (info) ; i++)
+ {
+ struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+ if (disable)
+ set_lattice_to_bottom (lat);
+ else
+ set_lattice_contains_variable (lat);
+ }
+ if (dump_file && (dump_flags & TDF_DETAILS)
+ && node->alias && node->thunk.thunk_p)
+ fprintf (dump_file, "Marking all lattices of %s/%i as %s\n",
+ cgraph_node_name (node), node->uid,
+ disable ? "BOTTOM" : "VARIABLE");
}
+
+ for (ie = node->indirect_calls; ie; ie = ie->next_callee)
+ if (ie->indirect_info->polymorphic)
+ {
+ gcc_checking_assert (ie->indirect_info->param_index >= 0);
+ ipa_get_lattice (info, ie->indirect_info->param_index)->virt_call = 1;
+ }
+}
+
+/* Return the result of a (possibly arithmetic) pass through jump function
+ JFUNC on the constant value INPUT. Return NULL_TREE if that cannot be
+ determined or itself is considered an interprocedural invariant. */
+
+static tree
+ipa_get_jf_pass_through_result (struct ipa_jump_func *jfunc, tree input)
+{
+ tree restype, res;
+
+ gcc_checking_assert (is_gimple_ip_invariant (input));
+ if (jfunc->value.pass_through.operation == NOP_EXPR)
+ return input;
+
+ if (TREE_CODE_CLASS (jfunc->value.pass_through.operation)
+ == tcc_comparison)
+ restype = boolean_type_node;
+ else
+ restype = TREE_TYPE (input);
+ res = fold_binary (jfunc->value.pass_through.operation, restype,
+ input, jfunc->value.pass_through.operand);
+
+ if (res && !is_gimple_ip_invariant (res))
+ return NULL_TREE;
+
+ return res;
}
-/* Build a constant tree with type TREE_TYPE and value according to LAT.
- Return the tree, or, if it is not possible to convert such value
- to TREE_TYPE, NULL. */
+/* Return the result of an ancestor jump function JFUNC on the constant value
+ INPUT. Return NULL_TREE if that cannot be determined. */
+
static tree
-build_const_val (struct ipcp_lattice *lat, tree tree_type)
+ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input)
{
- tree val;
+ if (TREE_CODE (input) == ADDR_EXPR)
+ {
+ tree t = TREE_OPERAND (input, 0);
+ t = build_ref_for_offset (EXPR_LOCATION (t), t,
+ jfunc->value.ancestor.offset,
+ jfunc->value.ancestor.type, NULL, false);
+ return build_fold_addr_expr (t);
+ }
+ else
+ return NULL_TREE;
+}
- gcc_assert (ipcp_lat_is_const (lat));
- val = lat->constant;
+/* Determine whether JFUNC evaluates to a known value (that is either a
+ constant or a binfo) and if so, return it. Otherwise return NULL. INFO
+ describes the caller node so that pass-through jump functions can be
+ evaluated. */
- if (!useless_type_conversion_p (tree_type, TREE_TYPE (val)))
+static tree
+ipa_value_from_jfunc (struct ipa_node_params *info, struct ipa_jump_func *jfunc)
+{
+ if (jfunc->type == IPA_JF_CONST)
+ return jfunc->value.constant;
+ else if (jfunc->type == IPA_JF_KNOWN_TYPE)
+ return jfunc->value.base_binfo;
+ else if (jfunc->type == IPA_JF_PASS_THROUGH
+ || jfunc->type == IPA_JF_ANCESTOR)
{
- if (fold_convertible_p (tree_type, val))
- return fold_build1 (NOP_EXPR, tree_type, val);
- else if (TYPE_SIZE (tree_type) == TYPE_SIZE (TREE_TYPE (val)))
- return fold_build1 (VIEW_CONVERT_EXPR, tree_type, val);
+ tree input;
+ int idx;
+
+ if (jfunc->type == IPA_JF_PASS_THROUGH)
+ idx = jfunc->value.pass_through.formal_id;
else
- return NULL;
+ idx = jfunc->value.ancestor.formal_id;
+
+ if (info->ipcp_orig_node)
+ input = VEC_index (tree, info->known_vals, idx);
+ else
+ {
+ struct ipcp_lattice *lat;
+
+ if (!info->lattices)
+ {
+ gcc_checking_assert (!flag_ipa_cp);
+ return NULL_TREE;
+ }
+ lat = ipa_get_lattice (info, idx);
+ if (!ipa_lat_is_single_const (lat))
+ return NULL_TREE;
+ input = lat->values->value;
+ }
+
+ if (!input)
+ return NULL_TREE;
+
+ if (jfunc->type == IPA_JF_PASS_THROUGH)
+ {
+ if (jfunc->value.pass_through.operation == NOP_EXPR)
+ return input;
+ else if (TREE_CODE (input) == TREE_BINFO)
+ return NULL_TREE;
+ else
+ return ipa_get_jf_pass_through_result (jfunc, input);
+ }
+ else
+ {
+ if (TREE_CODE (input) == TREE_BINFO)
+ return get_binfo_at_offset (input, jfunc->value.ancestor.offset,
+ jfunc->value.ancestor.type);
+ else
+ return ipa_get_jf_ancestor_result (jfunc, input);
+ }
}
- return val;
+ else
+ return NULL_TREE;
}
-/* Compute the proper scale for NODE. It is the ratio between the number of
- direct calls (represented on the incoming cgraph_edges) and sum of all
- invocations of NODE (represented as count in cgraph_node).
+/* Determine whether JFUNC evaluates to a constant and if so, return it.
+ Otherwise return NULL. INFO describes the caller node so that pass-through
+ jump functions can be evaluated. */
- FIXME: This code is wrong. Since the callers can be also clones and
- the clones are not scaled yet, the sums gets unrealistically high.
- To properly compute the counts, we would need to do propagation across
- callgraph (as external call to A might imply call to non-cloned B
- if A's clone calls cloned B). */
-static void
-ipcp_compute_node_scale (struct cgraph_node *node)
+tree
+ipa_cst_from_jfunc (struct ipa_node_params *info, struct ipa_jump_func *jfunc)
{
- gcov_type sum;
- struct cgraph_edge *cs;
+ tree res = ipa_value_from_jfunc (info, jfunc);
- sum = 0;
- /* Compute sum of all counts of callers. */
- for (cs = node->callers; cs != NULL; cs = cs->next_caller)
- sum += cs->count;
- /* Work around the unrealistically high sum problem. We just don't want
- the non-cloned body to have negative or very low frequency. Since
- majority of execution time will be spent in clones anyway, this should
- give good enough profile. */
- if (sum > node->count * 9 / 10)
- sum = node->count * 9 / 10;
- if (node->count == 0)
- ipcp_set_node_scale (node, 0);
+ if (res && TREE_CODE (res) == TREE_BINFO)
+ return NULL_TREE;
else
- ipcp_set_node_scale (node, sum * REG_BR_PROB_BASE / node->count);
+ return res;
}
-/* Return true if there are some formal parameters whose value is IPA_TOP (in
- the whole compilation unit). Change their values to IPA_BOTTOM, since they
- most probably get their values from outside of this compilation unit. */
-static bool
-ipcp_change_tops_to_bottom (void)
+
+/* If checking is enabled, verify that no lattice is in the TOP state, i.e. not
+ bottom, not containing a variable component and without any known value at
+ the same time. */
+
+DEBUG_FUNCTION void
+ipcp_verify_propagated_values (void)
{
- int i, count;
struct cgraph_node *node;
- bool prop_again;
- prop_again = false;
- for (node = cgraph_nodes; node; node = node->next)
- if (!node->alias)
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
+ {
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int i, count = ipa_get_param_count (info);
+
+ for (i = 0; i < count; i++)
+ {
+ struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+
+ if (!lat->bottom
+ && !lat->contains_variable
+ && lat->values_count == 0)
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nIPA lattices after constant "
+ "propagation:\n");
+ print_all_lattices (dump_file, true, false);
+ }
+
+ gcc_unreachable ();
+ }
+ }
+ }
+}
+
+/* Return true iff X and Y should be considered equal values by IPA-CP. */
+
+static bool
+values_equal_for_ipcp_p (tree x, tree y)
+{
+ gcc_checking_assert (x != NULL_TREE && y != NULL_TREE);
+
+ if (x == y)
+ return true;
+
+ if (TREE_CODE (x) == TREE_BINFO || TREE_CODE (y) == TREE_BINFO)
+ return false;
+
+ if (TREE_CODE (x) == ADDR_EXPR
+ && TREE_CODE (y) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (x, 0)) == CONST_DECL
+ && TREE_CODE (TREE_OPERAND (y, 0)) == CONST_DECL)
+ return operand_equal_p (DECL_INITIAL (TREE_OPERAND (x, 0)),
+ DECL_INITIAL (TREE_OPERAND (y, 0)), 0);
+ else
+ return operand_equal_p (x, y, 0);
+}
+
+/* Add a new value source to VAL, marking that a value comes from edge CS and
+ (if the underlying jump function is a pass-through or an ancestor one) from
+ a caller value SRC_VAL of a caller parameter described by SRC_INDEX. */
+
+static void
+add_value_source (struct ipcp_value *val, struct cgraph_edge *cs,
+ struct ipcp_value *src_val, int src_idx)
+{
+ struct ipcp_value_source *src;
+
+ src = (struct ipcp_value_source *) pool_alloc (ipcp_sources_pool);
+ src->cs = cs;
+ src->val = src_val;
+ src->index = src_idx;
+
+ src->next = val->sources;
+ val->sources = src;
+}
+
+
+/* Try to add NEWVAL to LAT, potentially creating a new struct ipcp_value for
+ it. CS, SRC_VAL and SRC_INDEX are meant for add_value_source and have the
+ same meaning. */
+
+static bool
+add_value_to_lattice (struct ipcp_lattice *lat, tree newval,
+ struct cgraph_edge *cs, struct ipcp_value *src_val,
+ int src_idx)
+{
+ struct ipcp_value *val;
+
+ if (lat->bottom)
+ return false;
+
+
+ for (val = lat->values; val; val = val->next)
+ if (values_equal_for_ipcp_p (val->value, newval))
+ {
+ if (edge_within_scc (cs))
+ {
+ struct ipcp_value_source *s;
+ for (s = val->sources; s ; s = s->next)
+ if (s->cs == cs)
+ break;
+ if (s)
+ return false;
+ }
+
+ add_value_source (val, cs, src_val, src_idx);
+ return false;
+ }
+
+ if (lat->values_count == PARAM_VALUE (PARAM_IPA_CP_VALUE_LIST_SIZE))
+ {
+ /* We can only free sources, not the values themselves, because sources
+ of other values in this this SCC might point to them. */
+ for (val = lat->values; val; val = val->next)
+ {
+ while (val->sources)
+ {
+ struct ipcp_value_source *src = val->sources;
+ val->sources = src->next;
+ pool_free (ipcp_sources_pool, src);
+ }
+ }
+
+ lat->values = NULL;
+ return set_lattice_to_bottom (lat);
+ }
+
+ lat->values_count++;
+ val = (struct ipcp_value *) pool_alloc (ipcp_values_pool);
+ memset (val, 0, sizeof (*val));
+
+ add_value_source (val, cs, src_val, src_idx);
+ val->value = newval;
+ val->next = lat->values;
+ lat->values = val;
+ return true;
+}
+
+/* Propagate values through a pass-through jump function JFUNC associated with
+ edge CS, taking values from SRC_LAT and putting them into DEST_LAT. SRC_IDX
+ is the index of the source parameter. */
+
+static bool
+propagate_vals_accross_pass_through (struct cgraph_edge *cs,
+ struct ipa_jump_func *jfunc,
+ struct ipcp_lattice *src_lat,
+ struct ipcp_lattice *dest_lat,
+ int src_idx)
+{
+ struct ipcp_value *src_val;
+ bool ret = false;
+
+ if (jfunc->value.pass_through.operation == NOP_EXPR)
+ for (src_val = src_lat->values; src_val; src_val = src_val->next)
+ ret |= add_value_to_lattice (dest_lat, src_val->value, cs,
+ src_val, src_idx);
+ /* Do not create new values when propagating within an SCC because if there
+ arithmetic functions with circular dependencies, there is infinite number
+ of them and we would just make lattices bottom. */
+ else if (edge_within_scc (cs))
+ ret = set_lattice_contains_variable (dest_lat);
+ else
+ for (src_val = src_lat->values; src_val; src_val = src_val->next)
{
- struct ipa_node_params *info = IPA_NODE_REF (node);
- count = ipa_get_param_count (info);
- for (i = 0; i < count; i++)
+ tree cstval = src_val->value;
+
+ if (TREE_CODE (cstval) == TREE_BINFO)
{
- struct ipcp_lattice *lat = ipa_get_lattice (info, i);
- if (lat->type == IPA_TOP)
- {
- prop_again = true;
- if (dump_file)
- {
- fprintf (dump_file, "Forcing param ");
- print_generic_expr (dump_file, ipa_get_param (info, i), 0);
- fprintf (dump_file, " of node %s to bottom.\n",
- cgraph_node_name (node));
- }
- lat->type = IPA_BOTTOM;
- }
- if (!ipa_param_cannot_devirtualize_p (info, i)
- && ipa_param_types_vec_empty (info, i))
- {
- prop_again = true;
- ipa_set_param_cannot_devirtualize (info, i);
- if (dump_file)
- {
- fprintf (dump_file, "Marking param ");
- print_generic_expr (dump_file, ipa_get_param (info, i), 0);
- fprintf (dump_file, " of node %s as unusable for "
- "devirtualization.\n",
- cgraph_node_name (node));
- }
- }
+ ret |= set_lattice_contains_variable (dest_lat);
+ continue;
}
+ cstval = ipa_get_jf_pass_through_result (jfunc, cstval);
+
+ if (cstval)
+ ret |= add_value_to_lattice (dest_lat, cstval, cs, src_val, src_idx);
+ else
+ ret |= set_lattice_contains_variable (dest_lat);
}
- return prop_again;
+
+ return ret;
}
-/* Insert BINFO to the list of known types of parameter number I of the
- function described by CALLEE_INFO. Return true iff the type information
- associated with the callee parameter changed in any way. */
+/* Propagate values through an ancestor jump function JFUNC associated with
+ edge CS, taking values from SRC_LAT and putting them into DEST_LAT. SRC_IDX
+ is the index of the source parameter. */
static bool
-ipcp_add_param_type (struct ipa_node_params *callee_info, int i, tree binfo)
+propagate_vals_accross_ancestor (struct cgraph_edge *cs,
+ struct ipa_jump_func *jfunc,
+ struct ipcp_lattice *src_lat,
+ struct ipcp_lattice *dest_lat,
+ int src_idx)
{
- int j, count;
+ struct ipcp_value *src_val;
+ bool ret = false;
- if (ipa_param_cannot_devirtualize_p (callee_info, i))
+ if (edge_within_scc (cs))
+ return set_lattice_contains_variable (dest_lat);
+
+ for (src_val = src_lat->values; src_val; src_val = src_val->next)
+ {
+ tree t = src_val->value;
+
+ if (TREE_CODE (t) == TREE_BINFO)
+ t = get_binfo_at_offset (t, jfunc->value.ancestor.offset,
+ jfunc->value.ancestor.type);
+ else
+ t = ipa_get_jf_ancestor_result (jfunc, t);
+
+ if (t)
+ ret |= add_value_to_lattice (dest_lat, t, cs, src_val, src_idx);
+ else
+ ret |= set_lattice_contains_variable (dest_lat);
+ }
+
+ return ret;
+}
+
+/* Propagate values across jump function JFUNC that is associated with edge CS
+ and put the values into DEST_LAT. */
+
+static bool
+propagate_accross_jump_function (struct cgraph_edge *cs,
+ struct ipa_jump_func *jfunc,
+ struct ipcp_lattice *dest_lat)
+{
+ if (dest_lat->bottom)
return false;
- if (callee_info->params[i].types)
+ if (jfunc->type == IPA_JF_CONST
+ || jfunc->type == IPA_JF_KNOWN_TYPE)
{
- count = VEC_length (tree, callee_info->params[i].types);
- for (j = 0; j < count; j++)
- if (VEC_index (tree, callee_info->params[i].types, j) == binfo)
- return false;
+ tree val;
+
+ if (jfunc->type == IPA_JF_KNOWN_TYPE)
+ val = jfunc->value.base_binfo;
+ else
+ val = jfunc->value.constant;
+ return add_value_to_lattice (dest_lat, val, cs, NULL, 0);
}
+ else if (jfunc->type == IPA_JF_PASS_THROUGH
+ || jfunc->type == IPA_JF_ANCESTOR)
+ {
+ struct ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+ struct ipcp_lattice *src_lat;
+ int src_idx;
+ bool ret;
- if (VEC_length (tree, callee_info->params[i].types)
- == (unsigned) PARAM_VALUE (PARAM_DEVIRT_TYPE_LIST_SIZE))
- return !ipa_set_param_cannot_devirtualize (callee_info, i);
+ if (jfunc->type == IPA_JF_PASS_THROUGH)
+ src_idx = jfunc->value.pass_through.formal_id;
+ else
+ src_idx = jfunc->value.ancestor.formal_id;
- VEC_safe_push (tree, heap, callee_info->params[i].types, binfo);
- return true;
+ src_lat = ipa_get_lattice (caller_info, src_idx);
+ if (src_lat->bottom)
+ return set_lattice_contains_variable (dest_lat);
+
+ /* If we would need to clone the caller and cannot, do not propagate. */
+ if (!ipcp_versionable_function_p (cs->caller)
+ && (src_lat->contains_variable
+ || (src_lat->values_count > 1)))
+ return set_lattice_contains_variable (dest_lat);
+
+ if (jfunc->type == IPA_JF_PASS_THROUGH)
+ ret = propagate_vals_accross_pass_through (cs, jfunc, src_lat,
+ dest_lat, src_idx);
+ else
+ ret = propagate_vals_accross_ancestor (cs, jfunc, src_lat, dest_lat,
+ src_idx);
+
+ if (src_lat->contains_variable)
+ ret |= set_lattice_contains_variable (dest_lat);
+
+ return ret;
+ }
+
+ /* TODO: We currently do not handle member method pointers in IPA-CP (we only
+ use it for indirect inlining), we should propagate them too. */
+ return set_lattice_contains_variable (dest_lat);
}
-/* Copy known types information for parameter number CALLEE_IDX of CALLEE_INFO
- from a parameter of CALLER_INFO as described by JF. Return true iff the
- type information changed in any way. JF must be a pass-through or an
- ancestor jump function. */
+/* Propagate constants from the caller to the callee of CS. INFO describes the
+ caller. */
static bool
-ipcp_copy_types (struct ipa_node_params *caller_info,
- struct ipa_node_params *callee_info,
- int callee_idx, struct ipa_jump_func *jf)
+propagate_constants_accross_call (struct cgraph_edge *cs)
{
- int caller_idx, j, count;
- bool res;
+ struct ipa_node_params *callee_info;
+ enum availability availability;
+ struct cgraph_node *callee, *alias_or_thunk;
+ struct ipa_edge_args *args;
+ bool ret = false;
+ int i, count;
- if (ipa_param_cannot_devirtualize_p (callee_info, callee_idx))
+ callee = cgraph_function_node (cs->callee, &availability);
+ if (!callee->analyzed)
return false;
+ gcc_checking_assert (cgraph_function_with_gimple_body_p (callee));
+ callee_info = IPA_NODE_REF (callee);
+ if (ipa_is_called_with_var_arguments (callee_info))
+ return false;
+
+ args = IPA_EDGE_REF (cs);
+ count = ipa_get_cs_argument_count (args);
- if (jf->type == IPA_JF_PASS_THROUGH)
+ /* If this call goes through a thunk we must not propagate to the first (0th)
+ parameter. However, we might need to uncover a thunk from below a series
+ of aliases first. */
+ alias_or_thunk = cs->callee;
+ while (alias_or_thunk->alias)
+ alias_or_thunk = cgraph_alias_aliased_node (alias_or_thunk);
+ if (alias_or_thunk->thunk.thunk_p)
{
- if (jf->value.pass_through.operation != NOP_EXPR)
- {
- ipa_set_param_cannot_devirtualize (callee_info, callee_idx);
- return true;
- }
- caller_idx = jf->value.pass_through.formal_id;
+ ret |= set_lattice_contains_variable (ipa_get_lattice (callee_info, 0));
+ i = 1;
}
else
- caller_idx = jf->value.ancestor.formal_id;
+ i = 0;
- if (ipa_param_cannot_devirtualize_p (caller_info, caller_idx))
+ for (; i < count; i++)
{
- ipa_set_param_cannot_devirtualize (callee_info, callee_idx);
- return true;
+ struct ipa_jump_func *jump_func = ipa_get_ith_jump_func (args, i);
+ struct ipcp_lattice *dest_lat = ipa_get_lattice (callee_info, i);
+
+ if (availability == AVAIL_OVERWRITABLE)
+ ret |= set_lattice_contains_variable (dest_lat);
+ else
+ ret |= propagate_accross_jump_function (cs, jump_func, dest_lat);
}
+ return ret;
+}
- if (!caller_info->params[caller_idx].types)
- return false;
+/* If an indirect edge IE can be turned into a direct one based on KNOWN_VALS
+ (which can contain both constants and binfos) or KNOWN_BINFOS (which can be
+ NULL) return the destination. If simple thunk delta must be applied too,
+ store it to DELTA. */
+
+static tree
+get_indirect_edge_target (struct cgraph_edge *ie, tree *delta,
+ VEC (tree, heap) *known_vals,
+ VEC (tree, heap) *known_binfos)
+{
+ int param_index = ie->indirect_info->param_index;
+ HOST_WIDE_INT token, anc_offset;
+ tree otr_type;
+ tree t;
- res = false;
- count = VEC_length (tree, caller_info->params[caller_idx].types);
- for (j = 0; j < count; j++)
+ if (param_index == -1)
+ return NULL_TREE;
+
+ if (!ie->indirect_info->polymorphic)
{
- tree binfo = VEC_index (tree, caller_info->params[caller_idx].types, j);
- if (jf->type == IPA_JF_ANCESTOR)
+ tree t = VEC_index (tree, known_vals, param_index);
+ if (t &&
+ TREE_CODE (t) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL)
{
- binfo = get_binfo_at_offset (binfo, jf->value.ancestor.offset,
- jf->value.ancestor.type);
- if (!binfo)
- {
- ipa_set_param_cannot_devirtualize (callee_info, callee_idx);
- return true;
- }
+ *delta = NULL_TREE;
+ return TREE_OPERAND (t, 0);
}
- res |= ipcp_add_param_type (callee_info, callee_idx, binfo);
+ else
+ return NULL_TREE;
+ }
+
+ token = ie->indirect_info->otr_token;
+ anc_offset = ie->indirect_info->anc_offset;
+ otr_type = ie->indirect_info->otr_type;
+
+ t = VEC_index (tree, known_vals, param_index);
+ if (!t && known_binfos)
+ t = VEC_index (tree, known_binfos, param_index);
+ if (!t)
+ return NULL_TREE;
+
+ if (TREE_CODE (t) != TREE_BINFO)
+ {
+ tree binfo;
+ binfo = gimple_extract_devirt_binfo_from_cst (t);
+ if (!binfo)
+ return NULL_TREE;
+ binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
+ if (!binfo)
+ return NULL_TREE;
+ return gimple_get_virt_method_for_binfo (token, binfo, delta);
+ }
+ else
+ {
+ tree binfo;
+
+ binfo = get_binfo_at_offset (t, anc_offset, otr_type);
+ if (!binfo)
+ return NULL_TREE;
+ return gimple_get_virt_method_for_binfo (token, binfo, delta);
}
+}
+
+/* Calculate devirtualization time bonus for NODE, assuming we know KNOWN_CSTS
+ and KNOWN_BINFOS. */
+
+static int
+devirtualization_time_bonus (struct cgraph_node *node,
+ VEC (tree, heap) *known_csts,
+ VEC (tree, heap) *known_binfos)
+{
+ struct cgraph_edge *ie;
+ int res = 0;
+
+ for (ie = node->indirect_calls; ie; ie = ie->next_callee)
+ {
+ struct cgraph_node *callee;
+ struct inline_summary *isummary;
+ tree delta, target;
+
+ target = get_indirect_edge_target (ie, &delta, known_csts, known_binfos);
+ if (!target)
+ continue;
+
+ /* Only bare minimum benefit for clearly un-inlineable targets. */
+ res += 1;
+ callee = cgraph_get_node (target);
+ if (!callee || !callee->analyzed)
+ continue;
+ isummary = inline_summary (callee);
+ if (!isummary->inlinable)
+ continue;
+
+ /* FIXME: The values below need re-considering and perhaps also
+ integrating into the cost metrics, at lest in some very basic way. */
+ if (isummary->size <= MAX_INLINE_INSNS_AUTO / 4)
+ res += 31;
+ else if (isummary->size <= MAX_INLINE_INSNS_AUTO / 2)
+ res += 15;
+ else if (isummary->size <= MAX_INLINE_INSNS_AUTO
+ || DECL_DECLARED_INLINE_P (callee->decl))
+ res += 7;
+ }
+
return res;
}
-/* Propagate type information for parameter of CALLEE_INFO number I as
- described by JF. CALLER_INFO describes the caller. Return true iff the
- type information changed in any way. */
+/* Return true if cloning NODE is a good idea, given the estimated TIME_BENEFIT
+ and SIZE_COST and with the sum of frequencies of incoming edges to the
+ potential new clone in FREQUENCIES. */
static bool
-ipcp_propagate_types (struct ipa_node_params *caller_info,
- struct ipa_node_params *callee_info,
- struct ipa_jump_func *jf, int i)
+good_cloning_opportunity_p (struct cgraph_node *node, int time_benefit,
+ int freq_sum, gcov_type count_sum, int size_cost)
{
- switch (jf->type)
+ if (time_benefit == 0
+ || !flag_ipa_cp_clone
+ || !optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->decl)))
+ return false;
+
+ gcc_checking_assert (size_cost >= 0);
+
+ /* FIXME: These decisions need tuning. */
+ if (max_count)
{
- case IPA_JF_UNKNOWN:
- case IPA_JF_CONST_MEMBER_PTR:
- case IPA_JF_CONST:
- break;
+ int evaluation, factor = (count_sum * 1000) / max_count;
+
+ evaluation = (time_benefit * factor) / size_cost;
- case IPA_JF_KNOWN_TYPE:
- return ipcp_add_param_type (callee_info, i, jf->value.base_binfo);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " good_cloning_opportunity_p (time: %i, "
+ "size: %i, count_sum: " HOST_WIDE_INT_PRINT_DEC
+ ") -> evaluation: %i, threshold: %i\n",
+ time_benefit, size_cost, (HOST_WIDE_INT) count_sum,
+ evaluation, 500);
- case IPA_JF_PASS_THROUGH:
- case IPA_JF_ANCESTOR:
- return ipcp_copy_types (caller_info, callee_info, i, jf);
+ return evaluation >= PARAM_VALUE (PARAM_IPA_CP_EVAL_THRESHOLD);
}
+ else
+ {
+ int evaluation = (time_benefit * freq_sum) / size_cost;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " good_cloning_opportunity_p (time: %i, "
+ "size: %i, freq_sum: %i) -> evaluation: %i, threshold: %i\n",
+ time_benefit, size_cost, freq_sum, evaluation,
+ CGRAPH_FREQ_BASE /2);
- /* If we reach this we cannot use this parameter for devirtualization. */
- return !ipa_set_param_cannot_devirtualize (callee_info, i);
+ return evaluation >= PARAM_VALUE (PARAM_IPA_CP_EVAL_THRESHOLD);
+ }
}
-/* Interprocedural analysis. The algorithm propagates constants from the
- caller's parameters to the callee's arguments. */
+
+/* Allocate KNOWN_CSTS and KNOWN_BINFOS and populate them with values of
+ parameters that are known independent of the context. INFO describes the
+ function. If REMOVABLE_PARAMS_COST is non-NULL, the movement cost of all
+ removable parameters will be stored in it. */
+
+static bool
+gather_context_independent_values (struct ipa_node_params *info,
+ VEC (tree, heap) **known_csts,
+ VEC (tree, heap) **known_binfos,
+ int *removable_params_cost)
+{
+ int i, count = ipa_get_param_count (info);
+ bool ret = false;
+
+ *known_csts = NULL;
+ *known_binfos = NULL;
+ VEC_safe_grow_cleared (tree, heap, *known_csts, count);
+ VEC_safe_grow_cleared (tree, heap, *known_binfos, count);
+
+ if (removable_params_cost)
+ *removable_params_cost = 0;
+
+ for (i = 0; i < count ; i++)
+ {
+ struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+
+ if (ipa_lat_is_single_const (lat))
+ {
+ struct ipcp_value *val = lat->values;
+ if (TREE_CODE (val->value) != TREE_BINFO)
+ {
+ VEC_replace (tree, *known_csts, i, val->value);
+ if (removable_params_cost)
+ *removable_params_cost
+ += estimate_move_cost (TREE_TYPE (val->value));
+ ret = true;
+ }
+ else if (lat->virt_call)
+ {
+ VEC_replace (tree, *known_binfos, i, val->value);
+ ret = true;
+ }
+ else if (removable_params_cost
+ && !ipa_is_param_used (info, i))
+ *removable_params_cost
+ += estimate_move_cost (TREE_TYPE (ipa_get_param (info, i)));
+ }
+ else if (removable_params_cost
+ && !ipa_is_param_used (info, i))
+ *removable_params_cost
+ += estimate_move_cost (TREE_TYPE (ipa_get_param (info, i)));
+ }
+
+ return ret;
+}
+
+/* Iterate over known values of parameters of NODE and estimate the local
+ effects in terms of time and size they have. */
+
static void
-ipcp_propagate_stage (void)
+estimate_local_effects (struct cgraph_node *node)
{
- int i;
- struct ipcp_lattice inc_lat = { IPA_BOTTOM, NULL };
- struct ipcp_lattice new_lat = { IPA_BOTTOM, NULL };
- struct ipcp_lattice *dest_lat;
- struct cgraph_edge *cs;
- struct ipa_jump_func *jump_func;
- struct ipa_func_list *wl;
- int count;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int i, count = ipa_get_param_count (info);
+ VEC (tree, heap) *known_csts, *known_binfos;
+ bool always_const;
+ int base_time = inline_summary (node)->time;
+ int removable_params_cost;
- ipa_check_create_node_params ();
- ipa_check_create_edge_args ();
+ if (!count || !ipcp_versionable_function_p (node))
+ return;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\nEstimating effects for %s/%i, base_time: %i.\n",
+ cgraph_node_name (node), node->uid, base_time);
- /* Initialize worklist to contain all functions. */
- wl = ipa_init_func_list ();
- while (wl)
+ always_const = gather_context_independent_values (info, &known_csts,
+ &known_binfos,
+ &removable_params_cost);
+ if (always_const)
{
- struct cgraph_node *node = ipa_pop_func_from_list (&wl);
- struct ipa_node_params *info = IPA_NODE_REF (node);
+ struct caller_statistics stats;
+ int time, size;
+
+ init_caller_stats (&stats);
+ cgraph_for_node_and_aliases (node, gather_caller_stats, &stats, false);
+ estimate_ipcp_clone_size_and_time (node, known_csts, &size, &time);
+ time -= devirtualization_time_bonus (node, known_csts, known_binfos);
+ time -= removable_params_cost;
+ size -= stats.n_calls * removable_params_cost;
+
+ if (dump_file)
+ fprintf (dump_file, " - context independent values, size: %i, "
+ "time_benefit: %i\n", size, base_time - time);
- for (cs = node->callees; cs; cs = cs->next_callee)
+ if (size <= 0
+ || cgraph_will_be_removed_from_program_if_no_direct_calls (node))
{
- struct cgraph_node *callee = cgraph_function_or_thunk_node (cs->callee, NULL);
- struct ipa_node_params *callee_info = IPA_NODE_REF (callee);
- struct ipa_edge_args *args = IPA_EDGE_REF (cs);
+ info->clone_for_all_contexts = true;
+ base_time = time;
- if (ipa_is_called_with_var_arguments (callee_info)
- || !cs->callee->analyzed
- || ipa_is_called_with_var_arguments (callee_info))
- continue;
+ if (dump_file)
+ fprintf (dump_file, " Decided to specialize for all "
+ "known contexts, code not going to grow.\n");
+ }
+ else if (good_cloning_opportunity_p (node, base_time - time,
+ stats.freq_sum, stats.count_sum,
+ size))
+ {
+ if (size + overall_size <= max_new_size)
+ {
+ info->clone_for_all_contexts = true;
+ base_time = time;
+ overall_size += size;
- count = ipa_get_cs_argument_count (args);
- for (i = 0; i < count; i++)
+ if (dump_file)
+ fprintf (dump_file, " Decided to specialize for all "
+ "known contexts, growth deemed beneficial.\n");
+ }
+ else if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Not cloning for all contexts because "
+ "max_new_size would be reached with %li.\n",
+ size + overall_size);
+ }
+ }
+
+ for (i = 0; i < count ; i++)
+ {
+ struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+ struct ipcp_value *val;
+ int emc;
+
+ if (lat->bottom
+ || !lat->values
+ || VEC_index (tree, known_csts, i)
+ || VEC_index (tree, known_binfos, i))
+ continue;
+
+ for (val = lat->values; val; val = val->next)
+ {
+ int time, size, time_benefit;
+
+ if (TREE_CODE (val->value) != TREE_BINFO)
{
- jump_func = ipa_get_ith_jump_func (args, i);
- ipa_lattice_from_jfunc (info, &inc_lat, jump_func);
- dest_lat = ipa_get_lattice (callee_info, i);
- ipa_lattice_meet (&new_lat, &inc_lat, dest_lat);
- if (ipcp_lattice_changed (&new_lat, dest_lat))
- {
- dest_lat->type = new_lat.type;
- dest_lat->constant = new_lat.constant;
- ipa_push_func_to_list (&wl, callee);
- }
+ VEC_replace (tree, known_csts, i, val->value);
+ VEC_replace (tree, known_binfos, i, NULL_TREE);
+ emc = estimate_move_cost (TREE_TYPE (val->value));
+ }
+ else if (lat->virt_call)
+ {
+ VEC_replace (tree, known_csts, i, NULL_TREE);
+ VEC_replace (tree, known_binfos, i, val->value);
+ emc = 0;
+ }
+ else
+ continue;
- if (ipcp_propagate_types (info, callee_info, jump_func, i))
- ipa_push_func_to_list (&wl, callee);
+ estimate_ipcp_clone_size_and_time (node, known_csts, &size, &time);
+ time_benefit = base_time - time
+ + devirtualization_time_bonus (node, known_csts, known_binfos)
+ + removable_params_cost + emc;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " - estimates for value ");
+ print_ipcp_constant_value (dump_file, val->value);
+ fprintf (dump_file, " for parameter ");
+ print_generic_expr (dump_file, ipa_get_param (info, i), 0);
+ fprintf (dump_file, ": time_benefit: %i, size: %i\n",
+ time_benefit, size);
}
+
+ val->local_time_benefit = time_benefit;
+ val->local_size_cost = size;
}
}
+
+ VEC_free (tree, heap, known_csts);
+ VEC_free (tree, heap, known_binfos);
}
-/* Call the constant propagation algorithm and re-call it if necessary
- (if there are undetermined values left). */
+
+/* Add value CUR_VAL and all yet-unsorted values it is dependent on to the
+ topological sort of values. */
+
static void
-ipcp_iterate_stage (void)
+add_val_to_toposort (struct ipcp_value *cur_val)
{
- struct cgraph_node *node;
- n_cloning_candidates = 0;
+ static int dfs_counter = 0;
+ static struct ipcp_value *stack;
+ struct ipcp_value_source *src;
- if (dump_file)
- fprintf (dump_file, "\nIPA iterate stage:\n\n");
+ if (cur_val->dfs)
+ return;
- if (in_lto_p)
- ipa_update_after_lto_read ();
+ dfs_counter++;
+ cur_val->dfs = dfs_counter;
+ cur_val->low_link = dfs_counter;
+
+ cur_val->topo_next = stack;
+ stack = cur_val;
+ cur_val->on_stack = true;
- for (node = cgraph_nodes; node; node = node->next)
- if (!node->alias)
+ for (src = cur_val->sources; src; src = src->next)
+ if (src->val)
{
- ipcp_initialize_node_lattices (node);
- ipcp_compute_node_scale (node);
+ if (src->val->dfs == 0)
+ {
+ add_val_to_toposort (src->val);
+ if (src->val->low_link < cur_val->low_link)
+ cur_val->low_link = src->val->low_link;
+ }
+ else if (src->val->on_stack
+ && src->val->dfs < cur_val->low_link)
+ cur_val->low_link = src->val->dfs;
}
- if (dump_file && (dump_flags & TDF_DETAILS))
+
+ if (cur_val->dfs == cur_val->low_link)
{
- ipcp_print_all_lattices (dump_file);
- ipcp_function_scale_print (dump_file);
+ struct ipcp_value *v, *scc_list = NULL;
+
+ do
+ {
+ v = stack;
+ stack = v->topo_next;
+ v->on_stack = false;
+
+ v->scc_next = scc_list;
+ scc_list = v;
+ }
+ while (v != cur_val);
+
+ cur_val->topo_next = values_topo;
+ values_topo = cur_val;
}
+}
- ipcp_propagate_stage ();
- if (ipcp_change_tops_to_bottom ())
- /* Some lattices have changed from IPA_TOP to IPA_BOTTOM.
- This change should be propagated. */
+/* Add all values in lattices associated with NODE to the topological sort if
+ they are not there yet. */
+
+static void
+add_all_node_vals_to_toposort (struct cgraph_node *node)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int i, count = ipa_get_param_count (info);
+
+ for (i = 0; i < count ; i++)
{
- gcc_assert (n_cloning_candidates);
- ipcp_propagate_stage ();
+ struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+ struct ipcp_value *val;
+
+ if (lat->bottom || !lat->values)
+ continue;
+ for (val = lat->values; val; val = val->next)
+ add_val_to_toposort (val);
}
- if (dump_file)
+}
+
+/* One pass of constants propagation along the call graph edges, from callers
+ to callees (requires topological ordering in TOPO), iterate over strongly
+ connected components. */
+
+static void
+propagate_constants_topo (struct topo_info *topo)
+{
+ int i;
+
+ for (i = topo->nnodes - 1; i >= 0; i--)
{
- fprintf (dump_file, "\nIPA lattices after propagation:\n");
- ipcp_print_all_lattices (dump_file);
- if (dump_flags & TDF_DETAILS)
- ipcp_print_profile_data (dump_file);
+ struct cgraph_node *v, *node = topo->order[i];
+ struct ipa_dfs_info *node_dfs_info;
+
+ if (!cgraph_function_with_gimple_body_p (node))
+ continue;
+
+ node_dfs_info = (struct ipa_dfs_info *) node->aux;
+ /* First, iteratively propagate within the strongly connected component
+ until all lattices stabilize. */
+ v = node_dfs_info->next_cycle;
+ while (v)
+ {
+ push_node_to_stack (topo, v);
+ v = ((struct ipa_dfs_info *) v->aux)->next_cycle;
+ }
+
+ v = node;
+ while (v)
+ {
+ struct cgraph_edge *cs;
+
+ for (cs = v->callees; cs; cs = cs->next_callee)
+ if (edge_within_scc (cs)
+ && propagate_constants_accross_call (cs))
+ push_node_to_stack (topo, cs->callee);
+ v = pop_node_from_stack (topo);
+ }
+
+ /* Afterwards, propagate along edges leading out of the SCC, calculates
+ the local effects of the discovered constants and all valid values to
+ their topological sort. */
+ v = node;
+ while (v)
+ {
+ struct cgraph_edge *cs;
+
+ estimate_local_effects (v);
+ add_all_node_vals_to_toposort (v);
+ for (cs = v->callees; cs; cs = cs->next_callee)
+ if (!edge_within_scc (cs))
+ propagate_constants_accross_call (cs);
+
+ v = ((struct ipa_dfs_info *) v->aux)->next_cycle;
+ }
}
}
-/* Check conditions to forbid constant insertion to function described by
- NODE. */
-static inline bool
-ipcp_node_modifiable_p (struct cgraph_node *node)
+/* Propagate the estimated effects of individual values along the topological
+ from the dependant values to those they depend on. */
+
+static void
+propagate_effects (void)
{
- /* Once we will be able to do in-place replacement, we can be more
- lax here. */
- return ipcp_versionable_function_p (node);
+ struct ipcp_value *base;
+
+ for (base = values_topo; base; base = base->topo_next)
+ {
+ struct ipcp_value_source *src;
+ struct ipcp_value *val;
+ int time = 0, size = 0;
+
+ for (val = base; val; val = val->scc_next)
+ {
+ time += val->local_time_benefit + val->prop_time_benefit;
+ size += val->local_size_cost + val->prop_size_cost;
+ }
+
+ for (val = base; val; val = val->scc_next)
+ for (src = val->sources; src; src = src->next)
+ if (src->val
+ && cgraph_maybe_hot_edge_p (src->cs))
+ {
+ src->val->prop_time_benefit += time;
+ src->val->prop_size_cost += size;
+ }
+ }
}
-/* Print count scale data structures. */
+
+/* Propagate constants, binfos and their effects from the summaries
+ interprocedurally. */
+
static void
-ipcp_function_scale_print (FILE * f)
+ipcp_propagate_stage (struct topo_info *topo)
{
struct cgraph_node *node;
- for (node = cgraph_nodes; node; node = node->next)
+ if (dump_file)
+ fprintf (dump_file, "\n Propagating constants:\n\n");
+
+ if (in_lto_p)
+ ipa_update_after_lto_read ();
+
+
+ FOR_EACH_DEFINED_FUNCTION (node)
+ {
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+
+ determine_versionability (node);
+ if (cgraph_function_with_gimple_body_p (node))
+ {
+ info->lattices = XCNEWVEC (struct ipcp_lattice,
+ ipa_get_param_count (info));
+ initialize_node_lattices (node);
+ }
+ if (node->count > max_count)
+ max_count = node->count;
+ overall_size += inline_summary (node)->self_size;
+ }
+
+ max_new_size = overall_size;
+ if (max_new_size < PARAM_VALUE (PARAM_LARGE_UNIT_INSNS))
+ max_new_size = PARAM_VALUE (PARAM_LARGE_UNIT_INSNS);
+ max_new_size += max_new_size * PARAM_VALUE (PARAM_IPCP_UNIT_GROWTH) / 100 + 1;
+
+ if (dump_file)
+ fprintf (dump_file, "\noverall_size: %li, max_new_size: %li\n",
+ overall_size, max_new_size);
+
+ propagate_constants_topo (topo);
+#ifdef ENABLE_CHECKING
+ ipcp_verify_propagated_values ();
+#endif
+ propagate_effects ();
+
+ if (dump_file)
{
- if (!node->analyzed)
- continue;
- fprintf (f, "printing scale for %s: ", cgraph_node_name (node));
- fprintf (f, "value is " HOST_WIDE_INT_PRINT_DEC
- " \n", (HOST_WIDE_INT) ipcp_get_node_scale (node));
+ fprintf (dump_file, "\nIPA lattices after all propagation:\n");
+ print_all_lattices (dump_file, (dump_flags & TDF_DETAILS), true);
}
}
-/* Print counts of all cgraph nodes. */
+/* Discover newly direct outgoing edges from NODE which is a new clone with
+ known KNOWN_VALS and make them direct. */
+
static void
-ipcp_print_func_profile_counts (FILE * f)
+ipcp_discover_new_direct_edges (struct cgraph_node *node,
+ VEC (tree, heap) *known_vals)
{
- struct cgraph_node *node;
+ struct cgraph_edge *ie, *next_ie;
- for (node = cgraph_nodes; node; node = node->next)
+ for (ie = node->indirect_calls; ie; ie = next_ie)
{
- fprintf (f, "function %s: ", cgraph_node_name (node));
- fprintf (f, "count is " HOST_WIDE_INT_PRINT_DEC
- " \n", (HOST_WIDE_INT) node->count);
+ tree delta, target;
+
+ next_ie = ie->next_callee;
+ target = get_indirect_edge_target (ie, &delta, known_vals, NULL);
+ if (target)
+ ipa_make_edge_direct_to_target (ie, target, delta);
}
}
-/* Print counts of all cgraph edges. */
+/* Vector of pointers which for linked lists of clones of an original crgaph
+ edge. */
+
+static VEC (cgraph_edge_p, heap) *next_edge_clone;
+
+static inline void
+grow_next_edge_clone_vector (void)
+{
+ if (VEC_length (cgraph_edge_p, next_edge_clone)
+ <= (unsigned) cgraph_edge_max_uid)
+ VEC_safe_grow_cleared (cgraph_edge_p, heap, next_edge_clone,
+ cgraph_edge_max_uid + 1);
+}
+
+/* Edge duplication hook to grow the appropriate linked list in
+ next_edge_clone. */
+
static void
-ipcp_print_call_profile_counts (FILE * f)
+ipcp_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
+ __attribute__((unused)) void *data)
{
- struct cgraph_node *node;
- struct cgraph_edge *cs;
+ grow_next_edge_clone_vector ();
+ VEC_replace (cgraph_edge_p, next_edge_clone, dst->uid,
+ VEC_index (cgraph_edge_p, next_edge_clone, src->uid));
+ VEC_replace (cgraph_edge_p, next_edge_clone, src->uid, dst);
+}
+
+/* Get the next clone in the linked list of clones of an edge. */
+
+static inline struct cgraph_edge *
+get_next_cgraph_edge_clone (struct cgraph_edge *cs)
+{
+ return VEC_index (cgraph_edge_p, next_edge_clone, cs->uid);
+}
- for (node = cgraph_nodes; node; node = node->next)
+/* Return true if edge CS does bring about the value described by SRC. */
+
+static bool
+cgraph_edge_brings_value_p (struct cgraph_edge *cs,
+ struct ipcp_value_source *src)
+{
+ struct ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
+
+ if (IPA_NODE_REF (cs->callee)->ipcp_orig_node
+ || caller_info->node_dead)
+ return false;
+ if (!src->val)
+ return true;
+
+ if (caller_info->ipcp_orig_node)
{
- for (cs = node->callees; cs; cs = cs->next_callee)
+ tree t = VEC_index (tree, caller_info->known_vals, src->index);
+ return (t != NULL_TREE
+ && values_equal_for_ipcp_p (src->val->value, t));
+ }
+ else
+ {
+ struct ipcp_lattice *lat = ipa_get_lattice (caller_info, src->index);
+ if (ipa_lat_is_single_const (lat)
+ && values_equal_for_ipcp_p (src->val->value, lat->values->value))
+ return true;
+ else
+ return false;
+ }
+}
+
+/* Given VAL, iterate over all its sources and if they still hold, add their
+ edge frequency and their number into *FREQUENCY and *CALLER_COUNT
+ respectively. */
+
+static bool
+get_info_about_necessary_edges (struct ipcp_value *val, int *freq_sum,
+ gcov_type *count_sum, int *caller_count)
+{
+ struct ipcp_value_source *src;
+ int freq = 0, count = 0;
+ gcov_type cnt = 0;
+ bool hot = false;
+
+ for (src = val->sources; src; src = src->next)
+ {
+ struct cgraph_edge *cs = src->cs;
+ while (cs)
{
- fprintf (f, "%s -> %s ", cgraph_node_name (cs->caller),
- cgraph_node_name (cs->callee));
- fprintf (f, "count is " HOST_WIDE_INT_PRINT_DEC " \n",
- (HOST_WIDE_INT) cs->count);
+ if (cgraph_edge_brings_value_p (cs, src))
+ {
+ count++;
+ freq += cs->frequency;
+ cnt += cs->count;
+ hot |= cgraph_maybe_hot_edge_p (cs);
+ }
+ cs = get_next_cgraph_edge_clone (cs);
}
}
+
+ *freq_sum = freq;
+ *count_sum = cnt;
+ *caller_count = count;
+ return hot;
}
-/* Print profile info for all functions. */
-static void
-ipcp_print_profile_data (FILE * f)
+/* Return a vector of incoming edges that do bring value VAL. It is assumed
+ their number is known and equal to CALLER_COUNT. */
+
+static VEC (cgraph_edge_p,heap) *
+gather_edges_for_value (struct ipcp_value *val, int caller_count)
{
- fprintf (f, "\nNODE COUNTS :\n");
- ipcp_print_func_profile_counts (f);
- fprintf (f, "\nCS COUNTS stage:\n");
- ipcp_print_call_profile_counts (f);
+ struct ipcp_value_source *src;
+ VEC (cgraph_edge_p,heap) *ret;
+
+ ret = VEC_alloc (cgraph_edge_p, heap, caller_count);
+ for (src = val->sources; src; src = src->next)
+ {
+ struct cgraph_edge *cs = src->cs;
+ while (cs)
+ {
+ if (cgraph_edge_brings_value_p (cs, src))
+ VEC_quick_push (cgraph_edge_p, ret, cs);
+ cs = get_next_cgraph_edge_clone (cs);
+ }
+ }
+
+ return ret;
}
-/* Build and initialize ipa_replace_map struct according to LAT. This struct is
- processed by versioning, which operates according to the flags set.
- PARM_TREE is the formal parameter found to be constant. LAT represents the
- constant. */
+/* Construct a replacement map for a know VALUE for a formal parameter PARAM.
+ Return it or NULL if for some reason it cannot be created. */
+
static struct ipa_replace_map *
-ipcp_create_replace_map (tree parm_tree, struct ipcp_lattice *lat)
+get_replacement_map (tree value, tree parm)
{
+ tree req_type = TREE_TYPE (parm);
struct ipa_replace_map *replace_map;
- tree const_val;
- const_val = build_const_val (lat, TREE_TYPE (parm_tree));
- if (const_val == NULL_TREE)
+ if (!useless_type_conversion_p (req_type, TREE_TYPE (value)))
{
- if (dump_file)
+ if (fold_convertible_p (req_type, value))
+ value = fold_build1 (NOP_EXPR, req_type, value);
+ else if (TYPE_SIZE (req_type) == TYPE_SIZE (TREE_TYPE (value)))
+ value = fold_build1 (VIEW_CONVERT_EXPR, req_type, value);
+ else
{
- fprintf (dump_file, " const ");
- print_generic_expr (dump_file, lat->constant, 0);
- fprintf (dump_file, " can't be converted to param ");
- print_generic_expr (dump_file, parm_tree, 0);
- fprintf (dump_file, "\n");
+ if (dump_file)
+ {
+ fprintf (dump_file, " const ");
+ print_generic_expr (dump_file, value, 0);
+ fprintf (dump_file, " can't be converted to param ");
+ print_generic_expr (dump_file, parm, 0);
+ fprintf (dump_file, "\n");
+ }
+ return NULL;
}
- return NULL;
}
+
replace_map = ggc_alloc_ipa_replace_map ();
if (dump_file)
{
- fprintf (dump_file, " replacing param ");
- print_generic_expr (dump_file, parm_tree, 0);
+ fprintf (dump_file, " replacing param ");
+ print_generic_expr (dump_file, parm, 0);
fprintf (dump_file, " with const ");
- print_generic_expr (dump_file, const_val, 0);
+ print_generic_expr (dump_file, value, 0);
fprintf (dump_file, "\n");
}
- replace_map->old_tree = parm_tree;
- replace_map->new_tree = const_val;
+ replace_map->old_tree = parm;
+ replace_map->new_tree = value;
replace_map->replace_p = true;
replace_map->ref_p = false;
return replace_map;
}
-/* Return true if this callsite should be redirected to the original callee
- (instead of the cloned one). */
-static bool
-ipcp_need_redirect_p (struct cgraph_edge *cs)
-{
- struct ipa_node_params *orig_callee_info;
- int i, count;
- struct cgraph_node *node = cgraph_function_or_thunk_node (cs->callee, NULL);
- struct cgraph_node *orig;
-
- if (!n_cloning_candidates)
- return false;
+/* Dump new profiling counts */
- /* We can't redirect anything in thunks, yet. */
- if (cs->caller->thunk.thunk_p)
- return true;
-
- if ((orig = ipcp_get_orig_node (node)) != NULL)
- node = orig;
- if (ipcp_get_orig_node (cs->caller))
- return false;
-
- orig_callee_info = IPA_NODE_REF (node);
- count = ipa_get_param_count (orig_callee_info);
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipa_get_lattice (orig_callee_info, i);
- struct ipa_jump_func *jump_func;
-
- jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
- if ((ipcp_lat_is_const (lat)
- && jump_func->type != IPA_JF_CONST)
- || (!ipa_param_cannot_devirtualize_p (orig_callee_info, i)
- && !ipa_param_types_vec_empty (orig_callee_info, i)
- && jump_func->type != IPA_JF_CONST
- && jump_func->type != IPA_JF_KNOWN_TYPE))
- return true;
- }
-
- return false;
-}
-
-/* Fix the callsites and the call graph after function cloning was done. */
static void
-ipcp_update_callgraph (void)
+dump_profile_updates (struct cgraph_node *orig_node,
+ struct cgraph_node *new_node)
{
- struct cgraph_node *node;
+ struct cgraph_edge *cs;
- for (node = cgraph_nodes; node; node = node->next)
- if (node->analyzed && ipcp_node_is_clone (node))
- {
- bitmap args_to_skip = NULL;
- struct cgraph_node *orig_node = ipcp_get_orig_node (node);
- struct ipa_node_params *info = IPA_NODE_REF (orig_node);
- int i, count = ipa_get_param_count (info);
- struct cgraph_edge *cs, *next;
+ fprintf (dump_file, " setting count of the specialized node to "
+ HOST_WIDE_INT_PRINT_DEC "\n", (HOST_WIDE_INT) new_node->count);
+ for (cs = new_node->callees; cs ; cs = cs->next_callee)
+ fprintf (dump_file, " edge to %s has count "
+ HOST_WIDE_INT_PRINT_DEC "\n",
+ cgraph_node_name (cs->callee), (HOST_WIDE_INT) cs->count);
+
+ fprintf (dump_file, " setting count of the original node to "
+ HOST_WIDE_INT_PRINT_DEC "\n", (HOST_WIDE_INT) orig_node->count);
+ for (cs = orig_node->callees; cs ; cs = cs->next_callee)
+ fprintf (dump_file, " edge to %s is left with "
+ HOST_WIDE_INT_PRINT_DEC "\n",
+ cgraph_node_name (cs->callee), (HOST_WIDE_INT) cs->count);
+}
- if (node->local.can_change_signature)
- {
- args_to_skip = BITMAP_ALLOC (NULL);
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipa_get_lattice (info, i);
-
- /* We can proactively remove obviously unused arguments. */
- if (!ipa_is_param_used (info, i))
- {
- bitmap_set_bit (args_to_skip, i);
- continue;
- }
- if (lat->type == IPA_CONST_VALUE)
- bitmap_set_bit (args_to_skip, i);
- }
- }
- for (cs = node->callers; cs; cs = next)
- {
- next = cs->next_caller;
- if (!ipcp_node_is_clone (cs->caller) && ipcp_need_redirect_p (cs))
- {
- if (dump_file)
- fprintf (dump_file, "Redirecting edge %s/%i -> %s/%i "
- "back to %s/%i.",
- cgraph_node_name (cs->caller), cs->caller->uid,
- cgraph_node_name (cs->callee), cs->callee->uid,
- cgraph_node_name (orig_node), orig_node->uid);
- cgraph_redirect_edge_callee (cs, orig_node);
- }
- }
- }
-}
+/* After a specialized NEW_NODE version of ORIG_NODE has been created, update
+ their profile information to reflect this. */
-/* Update profiling info for versioned functions and the functions they were
- versioned from. */
static void
-ipcp_update_profiling (void)
+update_profiling_info (struct cgraph_node *orig_node,
+ struct cgraph_node *new_node)
{
- struct cgraph_node *node, *orig_node;
- gcov_type scale, scale_complement;
struct cgraph_edge *cs;
+ struct caller_statistics stats;
+ gcov_type new_sum, orig_sum;
+ gcov_type remainder, orig_node_count = orig_node->count;
+
+ if (orig_node_count == 0)
+ return;
- for (node = cgraph_nodes; node; node = node->next)
+ init_caller_stats (&stats);
+ cgraph_for_node_and_aliases (orig_node, gather_caller_stats, &stats, false);
+ orig_sum = stats.count_sum;
+ init_caller_stats (&stats);
+ cgraph_for_node_and_aliases (new_node, gather_caller_stats, &stats, false);
+ new_sum = stats.count_sum;
+
+ if (orig_node_count < orig_sum + new_sum)
{
- if (ipcp_node_is_clone (node))
- {
- orig_node = ipcp_get_orig_node (node);
- scale = ipcp_get_node_scale (orig_node);
- node->count = orig_node->count * scale / REG_BR_PROB_BASE;
- scale_complement = REG_BR_PROB_BASE - scale;
-
- gcc_assert (scale_complement >= 0);
- orig_node->count =
- orig_node->count * scale_complement / REG_BR_PROB_BASE;
- for (cs = node->callees; cs; cs = cs->next_callee)
- cs->count = cs->count * scale / REG_BR_PROB_BASE;
- for (cs = orig_node->callees; cs; cs = cs->next_callee)
- cs->count = cs->count * scale_complement / REG_BR_PROB_BASE;
- }
+ if (dump_file)
+ fprintf (dump_file, " Problem: node %s/%i has too low count "
+ HOST_WIDE_INT_PRINT_DEC " while the sum of incoming "
+ "counts is " HOST_WIDE_INT_PRINT_DEC "\n",
+ cgraph_node_name (orig_node), orig_node->uid,
+ (HOST_WIDE_INT) orig_node_count,
+ (HOST_WIDE_INT) (orig_sum + new_sum));
+
+ orig_node_count = (orig_sum + new_sum) * 12 / 10;
+ if (dump_file)
+ fprintf (dump_file, " proceeding by pretending it was "
+ HOST_WIDE_INT_PRINT_DEC "\n",
+ (HOST_WIDE_INT) orig_node_count);
}
+
+ new_node->count = new_sum;
+ remainder = orig_node_count - new_sum;
+ orig_node->count = remainder;
+
+ for (cs = new_node->callees; cs ; cs = cs->next_callee)
+ if (cs->frequency)
+ cs->count = cs->count * new_sum / orig_node_count;
+ else
+ cs->count = 0;
+
+ for (cs = orig_node->callees; cs ; cs = cs->next_callee)
+ cs->count = cs->count * remainder / orig_node_count;
+
+ if (dump_file)
+ dump_profile_updates (orig_node, new_node);
}
-/* If NODE was cloned, how much would program grow? */
-static long
-ipcp_estimate_growth (struct cgraph_node *node)
+/* Update the respective profile of specialized NEW_NODE and the original
+ ORIG_NODE after additional edges with cumulative count sum REDIRECTED_SUM
+ have been redirected to the specialized version. */
+
+static void
+update_specialized_profile (struct cgraph_node *new_node,
+ struct cgraph_node *orig_node,
+ gcov_type redirected_sum)
{
struct cgraph_edge *cs;
- int redirectable_node_callers = 0;
- int removable_args = 0;
- bool need_original
- = !cgraph_will_be_removed_from_program_if_no_direct_calls (node);
- VEC (tree, heap) *known_vals = NULL;
- struct ipa_node_params *info;
- int i, count;
- int growth;
+ gcov_type new_node_count, orig_node_count = orig_node->count;
- for (cs = node->callers; cs != NULL; cs = cs->next_caller)
- if (cs->caller == node || !ipcp_need_redirect_p (cs))
- redirectable_node_callers++;
- else
- need_original = true;
+ if (dump_file)
+ fprintf (dump_file, " the sum of counts of redirected edges is "
+ HOST_WIDE_INT_PRINT_DEC "\n", (HOST_WIDE_INT) redirected_sum);
+ if (orig_node_count == 0)
+ return;
- /* If we will be able to fully replace original node, we never increase
- program size. */
- if (!need_original)
- return 0;
+ gcc_assert (orig_node_count >= redirected_sum);
- info = IPA_NODE_REF (node);
- count = ipa_get_param_count (info);
- VEC_safe_grow_cleared (tree, heap, known_vals, count);
- if (node->local.can_change_signature)
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+ new_node_count = new_node->count;
+ new_node->count += redirected_sum;
+ orig_node->count -= redirected_sum;
- /* We can proactively remove obviously unused arguments. */
- if (!ipa_is_param_used (info, i))
- removable_args++;
+ for (cs = new_node->callees; cs ; cs = cs->next_callee)
+ if (cs->frequency)
+ cs->count += cs->count * redirected_sum / new_node_count;
+ else
+ cs->count = 0;
- if (lat->type == IPA_CONST_VALUE)
- {
- removable_args++;
- VEC_replace (tree, known_vals, i, lat->constant);
- }
- }
+ for (cs = orig_node->callees; cs ; cs = cs->next_callee)
+ {
+ gcov_type dec = cs->count * redirected_sum / orig_node_count;
+ if (dec < cs->count)
+ cs->count -= dec;
+ else
+ cs->count = 0;
+ }
- /* We make just very simple estimate of savings for removal of operand from
- call site. Precise cost is difficult to get, as our size metric counts
- constants and moves as free. Generally we are looking for cases that
- small function is called very many times. */
- estimate_ipcp_clone_size_and_time (node, known_vals, &growth, NULL);
- VEC_free (tree, heap, known_vals);
- growth = growth
- - removable_args * redirectable_node_callers;
- if (growth < 0)
- return 0;
- return growth;
+ if (dump_file)
+ dump_profile_updates (orig_node, new_node);
}
+/* Create a specialized version of NODE with known constants and types of
+ parameters in KNOWN_VALS and redirect all edges in CALLERS to it. */
-/* Estimate cost of cloning NODE. */
-static long
-ipcp_estimate_cloning_cost (struct cgraph_node *node)
+static struct cgraph_node *
+create_specialized_node (struct cgraph_node *node,
+ VEC (tree, heap) *known_vals,
+ VEC (cgraph_edge_p,heap) *callers)
{
- int freq_sum = 1;
- gcov_type count_sum = 1;
- struct cgraph_edge *e;
- int cost;
+ struct ipa_node_params *new_info, *info = IPA_NODE_REF (node);
+ VEC (ipa_replace_map_p,gc)* replace_trees = NULL;
+ struct cgraph_node *new_node;
+ int i, count = ipa_get_param_count (info);
+ bitmap args_to_skip;
+
+ gcc_assert (!info->ipcp_orig_node);
- cost = ipcp_estimate_growth (node) * 1000;
- if (!cost)
+ if (node->local.can_change_signature)
{
- if (dump_file)
- fprintf (dump_file, "Versioning of %s will save code size\n",
- cgraph_node_name (node));
- return 0;
+ args_to_skip = BITMAP_GGC_ALLOC ();
+ for (i = 0; i < count; i++)
+ {
+ tree t = VEC_index (tree, known_vals, i);
+
+ if ((t && TREE_CODE (t) != TREE_BINFO)
+ || !ipa_is_param_used (info, i))
+ bitmap_set_bit (args_to_skip, i);
+ }
}
+ else
+ args_to_skip = NULL;
- for (e = node->callers; e; e = e->next_caller)
- if (!bitmap_bit_p (dead_nodes, e->caller->uid)
- && !ipcp_need_redirect_p (e))
- {
- count_sum += e->count;
- freq_sum += e->frequency + 1;
- }
+ for (i = 0; i < count ; i++)
+ {
+ tree t = VEC_index (tree, known_vals, i);
+ if (t && TREE_CODE (t) != TREE_BINFO)
+ {
+ struct ipa_replace_map *replace_map;
- if (max_count)
- cost /= count_sum * 1000 / max_count + 1;
- else
- cost /= freq_sum * 1000 / REG_BR_PROB_BASE + 1;
- if (dump_file)
- fprintf (dump_file, "Cost of versioning %s is %i, (size: %i, freq: %i)\n",
- cgraph_node_name (node), cost, inline_summary (node)->self_size,
- freq_sum);
- return cost + 1;
+ replace_map = get_replacement_map (t, ipa_get_param (info, i));
+ if (replace_map)
+ VEC_safe_push (ipa_replace_map_p, gc, replace_trees, replace_map);
+ }
+ }
+
+ new_node = cgraph_create_virtual_clone (node, callers, replace_trees,
+ args_to_skip, "constprop");
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " the new node is %s/%i.\n",
+ cgraph_node_name (new_node), new_node->uid);
+ gcc_checking_assert (ipa_node_params_vector
+ && (VEC_length (ipa_node_params_t,
+ ipa_node_params_vector)
+ > (unsigned) cgraph_max_uid));
+ update_profiling_info (node, new_node);
+ new_info = IPA_NODE_REF (new_node);
+ new_info->ipcp_orig_node = node;
+ new_info->known_vals = known_vals;
+
+ ipcp_discover_new_direct_edges (new_node, known_vals);
+
+ VEC_free (cgraph_edge_p, heap, callers);
+ return new_node;
}
-/* Walk indirect calls of NODE and if any polymorphic can be turned into a
- direct one now, do so. */
+/* Given a NODE, and a subset of its CALLERS, try to populate blanks slots in
+ KNOWN_VALS with constants and types that are also known for all of the
+ CALLERS. */
static void
-ipcp_process_devirtualization_opportunities (struct cgraph_node *node)
+find_more_values_for_callers_subset (struct cgraph_node *node,
+ VEC (tree, heap) *known_vals,
+ VEC (cgraph_edge_p,heap) *callers)
{
struct ipa_node_params *info = IPA_NODE_REF (node);
- struct cgraph_edge *ie, *next_ie;
+ int i, count = ipa_get_param_count (info);
- for (ie = node->indirect_calls; ie; ie = next_ie)
+ for (i = 0; i < count ; i++)
{
- int param_index;
- HOST_WIDE_INT token, anc_offset;
- tree target, delta, otr_type;
- struct ipcp_lattice *lat;
+ struct cgraph_edge *cs;
+ tree newval = NULL_TREE;
+ int j;
- next_ie = ie->next_callee;
- if (!ie->indirect_info->polymorphic)
- continue;
- param_index = ie->indirect_info->param_index;
- if (param_index == -1)
+ if (ipa_get_lattice (info, i)->bottom
+ || VEC_index (tree, known_vals, i))
continue;
- lat = ipa_get_lattice (info, param_index);
- token = ie->indirect_info->otr_token;
- anc_offset = ie->indirect_info->anc_offset;
- otr_type = ie->indirect_info->otr_type;
- target = NULL_TREE;
- if (lat->type == IPA_CONST_VALUE)
+ FOR_EACH_VEC_ELT (cgraph_edge_p, callers, j, cs)
{
- tree binfo = gimple_extract_devirt_binfo_from_cst (lat->constant);
- if (!binfo)
- continue;
- binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
- if (!binfo)
- continue;
- target = gimple_get_virt_method_for_binfo (token, binfo, &delta);
- }
- else
- {
- int types_count, j;
+ struct ipa_jump_func *jump_func;
+ tree t;
- if (ipa_param_cannot_devirtualize_p (info, param_index)
- || ipa_param_types_vec_empty (info, param_index))
- continue;
+ jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
- types_count = VEC_length (tree, info->params[param_index].types);
- for (j = 0; j < types_count; j++)
+ t = ipa_value_from_jfunc (IPA_NODE_REF (cs->caller), jump_func);
+ if (!t
+ || (newval
+ && !values_equal_for_ipcp_p (t, newval)))
{
- tree binfo = VEC_index (tree, info->params[param_index].types, j);
- tree d, t;
-
- binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
- if (!binfo)
- {
- target = NULL_TREE;
- break;
- }
-
- t = gimple_get_virt_method_for_binfo (token, binfo, &d);
- if (!t)
- {
- target = NULL_TREE;
- break;
- }
- else if (!target)
- {
- target = t;
- delta = d;
- }
- else if (target != t || !tree_int_cst_equal (delta, d))
- {
- target = NULL_TREE;
- break;
- }
+ newval = NULL_TREE;
+ break;
}
+ else
+ newval = t;
}
- if (target)
- ipa_make_edge_direct_to_target (ie, target, delta);
- }
-}
-
-/* Return number of live constant parameters. */
-static int
-ipcp_const_param_count (struct cgraph_node *node)
-{
- int const_param = 0;
- struct ipa_node_params *info = IPA_NODE_REF (node);
- int count = ipa_get_param_count (info);
- int i;
+ if (newval)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " adding an extra known value ");
+ print_ipcp_constant_value (dump_file, newval);
+ fprintf (dump_file, " for parameter ");
+ print_generic_expr (dump_file, ipa_get_param (info, i), 0);
+ fprintf (dump_file, "\n");
+ }
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipa_get_lattice (info, i);
- if ((ipcp_lat_is_insertable (lat)
- /* Do not count obviously unused arguments. */
- && ipa_is_param_used (info, i))
- || (!ipa_param_cannot_devirtualize_p (info, i)
- && !ipa_param_types_vec_empty (info, i)))
- const_param++;
+ VEC_replace (tree, known_vals, i, newval);
+ }
}
- return const_param;
}
-/* Given that a formal parameter of NODE given by INDEX is known to be constant
- CST, try to find any indirect edges that can be made direct and make them
- so. Note that INDEX is the number the parameter at the time of analyzing
- parameter uses and parameter removals should not be considered for it. (In
- fact, the parameter itself has just been removed.) */
+/* Given an original NODE and a VAL for which we have already created a
+ specialized clone, look whether there are incoming edges that still lead
+ into the old node but now also bring the requested value and also conform to
+ all other criteria such that they can be redirected the the special node.
+ This function can therefore redirect the final edge in a SCC. */
static void
-ipcp_discover_new_direct_edges (struct cgraph_node *node, int index, tree cst)
+perhaps_add_new_callers (struct cgraph_node *node, struct ipcp_value *val)
{
- struct cgraph_edge *ie, *next_ie;
+ struct ipa_node_params *dest_info = IPA_NODE_REF (val->spec_node);
+ struct ipcp_value_source *src;
+ int count = ipa_get_param_count (dest_info);
+ gcov_type redirected_sum = 0;
- for (ie = node->indirect_calls; ie; ie = next_ie)
+ for (src = val->sources; src; src = src->next)
{
- struct cgraph_indirect_call_info *ici = ie->indirect_info;
+ struct cgraph_edge *cs = src->cs;
+ while (cs)
+ {
+ enum availability availability;
+ bool insufficient = false;
- next_ie = ie->next_callee;
- if (ici->param_index != index
- || ici->polymorphic)
- continue;
+ if (cgraph_function_node (cs->callee, &availability) == node
+ && availability > AVAIL_OVERWRITABLE
+ && cgraph_edge_brings_value_p (cs, src))
+ {
+ struct ipa_node_params *caller_info;
+ struct ipa_edge_args *args;
+ int i;
+
+ caller_info = IPA_NODE_REF (cs->caller);
+ args = IPA_EDGE_REF (cs);
+ for (i = 0; i < count; i++)
+ {
+ struct ipa_jump_func *jump_func;
+ tree val, t;
+
+ val = VEC_index (tree, dest_info->known_vals, i);
+ if (!val)
+ continue;
+
+ jump_func = ipa_get_ith_jump_func (args, i);
+ t = ipa_value_from_jfunc (caller_info, jump_func);
+ if (!t || !values_equal_for_ipcp_p (val, t))
+ {
+ insufficient = true;
+ break;
+ }
+ }
- ipa_make_edge_direct_to_target (ie, cst, NULL_TREE);
+ if (!insufficient)
+ {
+ if (dump_file)
+ fprintf (dump_file, " - adding an extra caller %s/%i"
+ " of %s/%i\n",
+ cgraph_node_name (cs->caller), cs->caller->uid,
+ cgraph_node_name (val->spec_node),
+ val->spec_node->uid);
+
+ cgraph_redirect_edge_callee (cs, val->spec_node);
+ redirected_sum += cs->count;
+ }
+ }
+ cs = get_next_cgraph_edge_clone (cs);
+ }
}
+
+ if (redirected_sum)
+ update_specialized_profile (val->spec_node, node, redirected_sum);
}
-/* Propagate the constant parameters found by ipcp_iterate_stage()
- to the function's code. */
+/* Copy KNOWN_BINFOS to KNOWN_VALS. */
+
static void
-ipcp_insert_stage (void)
+move_binfos_to_values (VEC (tree, heap) *known_vals,
+ VEC (tree, heap) *known_binfos)
{
- struct cgraph_node *node, *node1 = NULL;
+ tree t;
int i;
- VEC (cgraph_edge_p, heap) * redirect_callers;
- VEC (ipa_replace_map_p,gc)* replace_trees;
- int count;
- tree parm_tree;
- struct ipa_replace_map *replace_param;
- fibheap_t heap;
- long overall_size = 0, new_size = 0;
- long max_new_size;
- ipa_check_create_node_params ();
- ipa_check_create_edge_args ();
- if (dump_file)
- fprintf (dump_file, "\nIPA insert stage:\n\n");
+ for (i = 0; VEC_iterate (tree, known_binfos, i, t); i++)
+ if (t)
+ VEC_replace (tree, known_vals, i, t);
+}
- dead_nodes = BITMAP_ALLOC (NULL);
- FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
- {
- if (node->count > max_count)
- max_count = node->count;
- overall_size += inline_summary (node)->self_size;
- }
+/* Decide whether and what specialized clones of NODE should be created. */
- max_new_size = overall_size;
- if (max_new_size < PARAM_VALUE (PARAM_LARGE_UNIT_INSNS))
- max_new_size = PARAM_VALUE (PARAM_LARGE_UNIT_INSNS);
- max_new_size = max_new_size * PARAM_VALUE (PARAM_IPCP_UNIT_GROWTH) / 100 + 1;
-
- /* First collect all functions we proved to have constant arguments to
- heap. */
- heap = fibheap_new ();
- for (node = cgraph_nodes; node; node = node->next)
- {
- struct ipa_node_params *info;
- /* Propagation of the constant is forbidden in certain conditions. */
- if (!node->analyzed || !ipcp_node_modifiable_p (node))
- continue;
- info = IPA_NODE_REF (node);
- if (ipa_is_called_with_var_arguments (info))
- continue;
- if (ipcp_const_param_count (node))
- node->aux = fibheap_insert (heap, ipcp_estimate_cloning_cost (node),
- node);
- }
-
- /* Now clone in priority order until code size growth limits are met or
- heap is emptied. */
- while (!fibheap_empty (heap))
- {
- struct ipa_node_params *info;
- int growth = 0;
- bitmap args_to_skip;
- struct cgraph_edge *cs;
+static bool
+decide_whether_version_node (struct cgraph_node *node)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int i, count = ipa_get_param_count (info);
+ VEC (tree, heap) *known_csts, *known_binfos;
+ bool ret = false;
- node = (struct cgraph_node *)fibheap_extract_min (heap);
- node->aux = NULL;
- if (dump_file)
- fprintf (dump_file, "considering function %s\n",
- cgraph_node_name (node));
+ if (count == 0)
+ return false;
- growth = ipcp_estimate_growth (node);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\nEvaluating opportunities for %s/%i.\n",
+ cgraph_node_name (node), node->uid);
- if (new_size + growth > max_new_size)
- break;
- if (growth
- && cgraph_optimize_for_size_p (node))
- {
- if (dump_file)
- fprintf (dump_file, "Not versioning, cold code would grow");
- continue;
- }
+ gather_context_independent_values (info, &known_csts, &known_binfos,
+ NULL);
- info = IPA_NODE_REF (node);
- count = ipa_get_param_count (info);
+ for (i = 0; i < count ; i++)
+ {
+ struct ipcp_lattice *lat = ipa_get_lattice (info, i);
+ struct ipcp_value *val;
- replace_trees = VEC_alloc (ipa_replace_map_p, gc, 1);
+ if (lat->bottom
+ || VEC_index (tree, known_csts, i)
+ || VEC_index (tree, known_binfos, i))
+ continue;
- if (node->local.can_change_signature)
- args_to_skip = BITMAP_GGC_ALLOC ();
- else
- args_to_skip = NULL;
- for (i = 0; i < count; i++)
+ for (val = lat->values; val; val = val->next)
{
- struct ipcp_lattice *lat = ipa_get_lattice (info, i);
- parm_tree = ipa_get_param (info, i);
+ int freq_sum, caller_count;
+ gcov_type count_sum;
+ VEC (cgraph_edge_p, heap) *callers;
+ VEC (tree, heap) *kv;
- /* We can proactively remove obviously unused arguments. */
- if (!ipa_is_param_used (info, i))
+ if (val->spec_node)
+ {
+ perhaps_add_new_callers (node, val);
+ continue;
+ }
+ else if (val->local_size_cost + overall_size > max_new_size)
{
- if (args_to_skip)
- bitmap_set_bit (args_to_skip, i);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Ignoring candidate value because "
+ "max_new_size would be reached with %li.\n",
+ val->local_size_cost + overall_size);
continue;
}
+ else if (!get_info_about_necessary_edges (val, &freq_sum, &count_sum,
+ &caller_count))
+ continue;
- if (lat->type == IPA_CONST_VALUE)
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
- replace_param =
- ipcp_create_replace_map (parm_tree, lat);
- if (replace_param == NULL)
- break;
- VEC_safe_push (ipa_replace_map_p, gc, replace_trees, replace_param);
- if (args_to_skip)
- bitmap_set_bit (args_to_skip, i);
+ fprintf (dump_file, " - considering value ");
+ print_ipcp_constant_value (dump_file, val->value);
+ fprintf (dump_file, " for parameter ");
+ print_generic_expr (dump_file, ipa_get_param (info, i), 0);
+ fprintf (dump_file, " (caller_count: %i)\n", caller_count);
}
- }
- if (i < count)
- {
+
+
+ if (!good_cloning_opportunity_p (node, val->local_time_benefit,
+ freq_sum, count_sum,
+ val->local_size_cost)
+ && !good_cloning_opportunity_p (node,
+ val->local_time_benefit
+ + val->prop_time_benefit,
+ freq_sum, count_sum,
+ val->local_size_cost
+ + val->prop_size_cost))
+ continue;
+
if (dump_file)
- fprintf (dump_file, "Not versioning, some parameters couldn't be replaced");
- continue;
+ fprintf (dump_file, " Creating a specialized node of %s/%i.\n",
+ cgraph_node_name (node), node->uid);
+
+ callers = gather_edges_for_value (val, caller_count);
+ kv = VEC_copy (tree, heap, known_csts);
+ move_binfos_to_values (kv, known_binfos);
+ VEC_replace (tree, kv, i, val->value);
+ find_more_values_for_callers_subset (node, kv, callers);
+ val->spec_node = create_specialized_node (node, kv, callers);
+ overall_size += val->local_size_cost;
+ info = IPA_NODE_REF (node);
+
+ /* TODO: If for some lattice there is only one other known value
+ left, make a special node for it too. */
+ ret = true;
+
+ VEC_replace (tree, kv, i, val->value);
}
+ }
- new_size += growth;
+ if (info->clone_for_all_contexts)
+ {
+ VEC (cgraph_edge_p, heap) *callers;
- /* Look if original function becomes dead after cloning. */
- for (cs = node->callers; cs != NULL; cs = cs->next_caller)
- if (cs->caller == node || ipcp_need_redirect_p (cs))
- break;
- if (!cs && cgraph_will_be_removed_from_program_if_no_direct_calls (node))
- bitmap_set_bit (dead_nodes, node->uid);
+ if (dump_file)
+ fprintf (dump_file, " - Creating a specialized node of %s/%i "
+ "for all known contexts.\n", cgraph_node_name (node),
+ node->uid);
- redirect_callers = collect_callers_of_node (node);
+ callers = collect_callers_of_node (node);
+ move_binfos_to_values (known_csts, known_binfos);
+ create_specialized_node (node, known_csts, callers);
+ info = IPA_NODE_REF (node);
+ info->clone_for_all_contexts = false;
+ ret = true;
+ }
+ else
+ VEC_free (tree, heap, known_csts);
- /* Redirecting all the callers of the node to the
- new versioned node. */
- node1 =
- cgraph_create_virtual_clone (node, redirect_callers, replace_trees,
- args_to_skip, "constprop");
- args_to_skip = NULL;
- VEC_free (cgraph_edge_p, heap, redirect_callers);
- replace_trees = NULL;
+ VEC_free (tree, heap, known_binfos);
+ return ret;
+}
- if (node1 == NULL)
- continue;
- ipcp_process_devirtualization_opportunities (node1);
+/* Transitively mark all callees of NODE within the same SCC as not dead. */
- if (dump_file)
- fprintf (dump_file, "versioned function %s with growth %i, overall %i\n",
- cgraph_node_name (node), (int)growth, (int)new_size);
- ipcp_init_cloned_node (node, node1);
+static void
+spread_undeadness (struct cgraph_node *node)
+{
+ struct cgraph_edge *cs;
- info = IPA_NODE_REF (node);
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipa_get_lattice (info, i);
- if (lat->type == IPA_CONST_VALUE)
- ipcp_discover_new_direct_edges (node1, i, lat->constant);
- }
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ if (edge_within_scc (cs))
+ {
+ struct cgraph_node *callee;
+ struct ipa_node_params *info;
- if (dump_file)
- dump_function_to_file (node1->decl, dump_file, dump_flags);
+ callee = cgraph_function_node (cs->callee, NULL);
+ info = IPA_NODE_REF (callee);
- for (cs = node->callees; cs; cs = cs->next_callee)
- {
- struct cgraph_node *callee = cgraph_function_or_thunk_node (cs->callee, NULL);
- if (callee->aux)
- {
- fibheap_delete_node (heap, (fibnode_t) callee->aux);
- callee->aux = fibheap_insert (heap,
- ipcp_estimate_cloning_cost (callee),
- callee);
- }
- }
+ if (info->node_dead)
+ {
+ info->node_dead = 0;
+ spread_undeadness (callee);
+ }
+ }
+}
+
+/* Return true if NODE has a caller from outside of its SCC that is not
+ dead. Worker callback for cgraph_for_node_and_aliases. */
+
+static bool
+has_undead_caller_from_outside_scc_p (struct cgraph_node *node,
+ void *data ATTRIBUTE_UNUSED)
+{
+ struct cgraph_edge *cs;
+
+ for (cs = node->callers; cs; cs = cs->next_caller)
+ if (cs->caller->thunk.thunk_p
+ && cgraph_for_node_and_aliases (cs->caller,
+ has_undead_caller_from_outside_scc_p,
+ NULL, true))
+ return true;
+ else if (!edge_within_scc (cs)
+ && !IPA_NODE_REF (cs->caller)->node_dead)
+ return true;
+ return false;
+}
+
+
+/* Identify nodes within the same SCC as NODE which are no longer needed
+ because of new clones and will be removed as unreachable. */
+
+static void
+identify_dead_nodes (struct cgraph_node *node)
+{
+ struct cgraph_node *v;
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
+ if (cgraph_will_be_removed_from_program_if_no_direct_calls (v)
+ && !cgraph_for_node_and_aliases (v,
+ has_undead_caller_from_outside_scc_p,
+ NULL, true))
+ IPA_NODE_REF (v)->node_dead = 1;
+
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
+ if (!IPA_NODE_REF (v)->node_dead)
+ spread_undeadness (v);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
+ if (IPA_NODE_REF (v)->node_dead)
+ fprintf (dump_file, " Marking node as dead: %s/%i.\n",
+ cgraph_node_name (v), v->uid);
}
+}
- while (!fibheap_empty (heap))
+/* The decision stage. Iterate over the topological order of call graph nodes
+ TOPO and make specialized clones if deemed beneficial. */
+
+static void
+ipcp_decision_stage (struct topo_info *topo)
+{
+ int i;
+
+ if (dump_file)
+ fprintf (dump_file, "\nIPA decision stage:\n\n");
+
+ for (i = topo->nnodes - 1; i >= 0; i--)
{
- if (dump_file)
- fprintf (dump_file, "skipping function %s\n",
- cgraph_node_name (node));
- node = (struct cgraph_node *) fibheap_extract_min (heap);
- node->aux = NULL;
+ struct cgraph_node *node = topo->order[i];
+ bool change = false, iterate = true;
+
+ while (iterate)
+ {
+ struct cgraph_node *v;
+ iterate = false;
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
+ if (cgraph_function_with_gimple_body_p (v)
+ && ipcp_versionable_function_p (v))
+ iterate |= decide_whether_version_node (v);
+
+ change |= iterate;
+ }
+ if (change)
+ identify_dead_nodes (node);
}
- fibheap_delete (heap);
- BITMAP_FREE (dead_nodes);
- ipcp_update_callgraph ();
- ipcp_update_profiling ();
}
/* The IPCP driver. */
+
static unsigned int
ipcp_driver (void)
{
+ struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
+ struct topo_info topo;
+
cgraph_remove_unreachable_nodes (true,dump_file);
+ ipa_check_create_node_params ();
+ ipa_check_create_edge_args ();
+ grow_next_edge_clone_vector ();
+ edge_duplication_hook_holder =
+ cgraph_add_edge_duplication_hook (&ipcp_edge_duplication_hook, NULL);
+ ipcp_values_pool = create_alloc_pool ("IPA-CP values",
+ sizeof (struct ipcp_value), 32);
+ ipcp_sources_pool = create_alloc_pool ("IPA-CP value sources",
+ sizeof (struct ipcp_value_source), 64);
if (dump_file)
{
fprintf (dump_file, "\nIPA structures before propagation:\n");
@@ -1501,18 +2434,18 @@ ipcp_driver (void)
ipa_print_all_params (dump_file);
ipa_print_all_jump_functions (dump_file);
}
- ipa_check_create_node_params ();
- ipa_check_create_edge_args ();
- /* 2. Do the interprocedural propagation. */
- ipcp_iterate_stage ();
- /* 3. Insert the constants found to the functions. */
- ipcp_insert_stage ();
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nProfiling info after insert stage:\n");
- ipcp_print_profile_data (dump_file);
- }
+
+ /* Topological sort. */
+ build_toporder_info (&topo);
+ /* Do the interprocedural propagation. */
+ ipcp_propagate_stage (&topo);
+ /* Decide what constant propagation and cloning should be performed. */
+ ipcp_decision_stage (&topo);
+
/* Free all IPCP structures. */
+ free_toporder_info (&topo);
+ VEC_free (cgraph_edge_p, heap, next_edge_clone);
+ cgraph_remove_edge_duplication_hook (edge_duplication_hook_holder);
ipa_free_all_structures_after_ipa_cp ();
if (dump_file)
fprintf (dump_file, "\nIPA constant propagation end\n");
@@ -1545,6 +2478,7 @@ ipcp_generate_summary (void)
}
/* Write ipcp summary for nodes in SET. */
+
static void
ipcp_write_summary (cgraph_node_set set,
varpool_node_set vset ATTRIBUTE_UNUSED)
@@ -1553,6 +2487,7 @@ ipcp_write_summary (cgraph_node_set set,
}
/* Read ipcp summary. */
+
static void
ipcp_read_summary (void)
{
@@ -1560,6 +2495,7 @@ ipcp_read_summary (void)
}
/* Gate for IPCP optimization. */
+
static bool
cgraph_gate_cp (void)
{
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 2f57e2d9f14..e0cb632613f 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -323,7 +323,7 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
/* gcc.dg/pr43564.c. Look at forced inline even in -O0. */
&& !DECL_DISREGARD_INLINE_LIMITS (e->callee->decl))
{
- e->inline_failed = CIF_TARGET_OPTIMIZATION_MISMATCH;
+ e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
inlinable = false;
}
}
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index aec1920c62e..def34c3e6a1 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -65,65 +65,6 @@ static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
static struct cgraph_2node_hook_list *node_duplication_hook_holder;
static struct cgraph_node_hook_list *function_insertion_hook_holder;
-/* Add cgraph NODE described by INFO to the worklist WL regardless of whether
- it is in one or not. It should almost never be used directly, as opposed to
- ipa_push_func_to_list. */
-
-void
-ipa_push_func_to_list_1 (struct ipa_func_list **wl,
- struct cgraph_node *node,
- struct ipa_node_params *info)
-{
- struct ipa_func_list *temp;
-
- info->node_enqueued = 1;
- temp = XCNEW (struct ipa_func_list);
- temp->node = node;
- temp->next = *wl;
- *wl = temp;
-}
-
-/* Initialize worklist to contain all functions. */
-
-struct ipa_func_list *
-ipa_init_func_list (void)
-{
- struct cgraph_node *node;
- struct ipa_func_list * wl;
-
- wl = NULL;
- for (node = cgraph_nodes; node; node = node->next)
- if (node->analyzed && !node->alias)
- {
- struct ipa_node_params *info = IPA_NODE_REF (node);
- /* Unreachable nodes should have been eliminated before ipcp and
- inlining. */
- gcc_assert (node->needed || node->reachable);
- ipa_push_func_to_list_1 (&wl, node, info);
- }
-
- return wl;
-}
-
-/* Remove a function from the worklist WL and return it. */
-
-struct cgraph_node *
-ipa_pop_func_from_list (struct ipa_func_list **wl)
-{
- struct ipa_node_params *info;
- struct ipa_func_list *first;
- struct cgraph_node *node;
-
- first = *wl;
- *wl = (*wl)->next;
- node = first->node;
- free (first);
-
- info = IPA_NODE_REF (node);
- info->node_enqueued = 0;
- return node;
-}
-
/* Return index of the formal whose tree is PTREE in function which corresponds
to INFO. */
@@ -134,7 +75,7 @@ ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
- if (ipa_get_param(info, i) == ptree)
+ if (ipa_get_param (info, i) == ptree)
return i;
return -1;
@@ -157,7 +98,8 @@ ipa_populate_param_decls (struct cgraph_node *node,
param_num = 0;
for (parm = fnargs; parm; parm = DECL_CHAIN (parm))
{
- info->params[param_num].decl = parm;
+ VEC_index (ipa_param_descriptor_t,
+ info->descriptors, param_num)->decl = parm;
param_num++;
}
}
@@ -165,7 +107,7 @@ ipa_populate_param_decls (struct cgraph_node *node,
/* Return how many formal parameters FNDECL has. */
static inline int
-count_formal_params_1 (tree fndecl)
+count_formal_params (tree fndecl)
{
tree parm;
int count = 0;
@@ -176,19 +118,6 @@ count_formal_params_1 (tree fndecl)
return count;
}
-/* Count number of formal parameters in NOTE. Store the result to the
- appropriate field of INFO. */
-
-static void
-ipa_count_formal_params (struct cgraph_node *node,
- struct ipa_node_params *info)
-{
- int param_num;
-
- param_num = count_formal_params_1 (node->decl);
- ipa_set_param_count (info, param_num);
-}
-
/* Initialize the ipa_node_params structure associated with NODE by counting
the function parameters, creating the descriptors and populating their
param_decls. */
@@ -198,12 +127,17 @@ ipa_initialize_node_params (struct cgraph_node *node)
{
struct ipa_node_params *info = IPA_NODE_REF (node);
- if (!info->params)
+ if (!info->descriptors)
{
- ipa_count_formal_params (node, info);
- info->params = XCNEWVEC (struct ipa_param_descriptor,
- ipa_get_param_count (info));
- ipa_populate_param_decls (node, info);
+ int param_count;
+
+ param_count = count_formal_params (node->decl);
+ if (param_count)
+ {
+ VEC_safe_grow_cleared (ipa_param_descriptor_t, heap,
+ info->descriptors, param_count);
+ ipa_populate_param_decls (node, info);
+ }
}
}
@@ -1497,7 +1431,7 @@ visit_ref_for_mod_analysis (gimple stmt ATTRIBUTE_UNUSED,
{
int index = ipa_get_param_decl_index (info, op);
gcc_assert (index >= 0);
- info->params[index].used = true;
+ ipa_set_param_used (info, index, true);
}
return false;
@@ -1529,7 +1463,7 @@ ipa_analyze_params_uses (struct cgraph_node *node,
the flag during modification analysis. */
if (is_gimple_reg (parm)
&& gimple_default_def (DECL_STRUCT_FUNCTION (node->decl), parm))
- info->params[i].used = true;
+ ipa_set_param_used (info, i, true);
}
func = DECL_STRUCT_FUNCTION (decl);
@@ -1936,8 +1870,11 @@ ipa_free_all_edge_args (void)
void
ipa_free_node_params_substructures (struct ipa_node_params *info)
{
- free (info->params);
-
+ VEC_free (ipa_param_descriptor_t, heap, info->descriptors);
+ free (info->lattices);
+ /* Lattice values and their sources are deallocated with their alocation
+ pool. */
+ VEC_free (tree, heap, info->known_vals);
memset (info, 0, sizeof (*info));
}
@@ -1980,22 +1917,6 @@ ipa_node_removal_hook (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
ipa_free_node_params_substructures (IPA_NODE_REF (node));
}
-/* Helper function to duplicate an array of size N that is at SRC and store a
- pointer to it to DST. Nothing is done if SRC is NULL. */
-
-static void *
-duplicate_array (void *src, size_t n)
-{
- void *p;
-
- if (!src)
- return NULL;
-
- p = xmalloc (n);
- memcpy (p, src, n);
- return p;
-}
-
static struct ipa_jump_func *
duplicate_ipa_jump_func_array (const struct ipa_jump_func * src, size_t n)
{
@@ -2040,22 +1961,15 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
ATTRIBUTE_UNUSED void *data)
{
struct ipa_node_params *old_info, *new_info;
- int param_count, i;
ipa_check_create_node_params ();
old_info = IPA_NODE_REF (src);
new_info = IPA_NODE_REF (dst);
- param_count = ipa_get_param_count (old_info);
- ipa_set_param_count (new_info, param_count);
- new_info->params = (struct ipa_param_descriptor *)
- duplicate_array (old_info->params,
- sizeof (struct ipa_param_descriptor) * param_count);
- for (i = 0; i < param_count; i++)
- new_info->params[i].types = VEC_copy (tree, heap,
- old_info->params[i].types);
+ new_info->descriptors = VEC_copy (ipa_param_descriptor_t, heap,
+ old_info->descriptors);
+ new_info->lattices = NULL;
new_info->ipcp_orig_node = old_info->ipcp_orig_node;
- new_info->count_scale = old_info->count_scale;
new_info->called_with_var_arguments = old_info->called_with_var_arguments;
new_info->uses_analysis_done = old_info->uses_analysis_done;
@@ -2127,6 +2041,8 @@ ipa_free_all_structures_after_ipa_cp (void)
{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
+ free_alloc_pool (ipcp_sources_pool);
+ free_alloc_pool (ipcp_values_pool);
ipa_unregister_cgraph_hooks ();
}
}
@@ -2142,6 +2058,10 @@ ipa_free_all_structures_after_iinln (void)
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipa_unregister_cgraph_hooks ();
+ if (ipcp_sources_pool)
+ free_alloc_pool (ipcp_sources_pool);
+ if (ipcp_values_pool)
+ free_alloc_pool (ipcp_values_pool);
}
/* Print ipa_tree_map data structures of all functions in the
@@ -2196,7 +2116,7 @@ ipa_get_vector_of_formal_parms (tree fndecl)
int count;
tree parm;
- count = count_formal_params_1 (fndecl);
+ count = count_formal_params (fndecl);
args = VEC_alloc (tree, heap, count);
for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
VEC_quick_push (tree, args, parm);
@@ -2859,7 +2779,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node)
gcc_assert (!info->node_enqueued);
gcc_assert (!info->ipcp_orig_node);
for (j = 0; j < ipa_get_param_count (info); j++)
- bp_pack_value (&bp, info->params[j].used, 1);
+ bp_pack_value (&bp, ipa_is_param_used (info, j), 1);
lto_output_bitpack (&bp);
for (e = node->callees; e; e = e->next_callee)
{
@@ -2900,7 +2820,7 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
info->uses_analysis_done = true;
info->node_enqueued = false;
for (k = 0; k < ipa_get_param_count (info); k++)
- info->params[k].used = bp_unpack_value (&bp, 1);
+ ipa_set_param_used (info, k, bp_unpack_value (&bp, 1));
for (e = node->callees; e; e = e->next_callee)
{
struct ipa_edge_args *args = IPA_EDGE_REF (e);
@@ -3064,82 +2984,3 @@ ipa_update_after_lto_read (void)
}
}
-/* Given the jump function JFUNC, compute the lattice LAT that describes the
- value coming down the callsite. INFO describes the caller node so that
- pass-through jump functions can be evaluated. */
-
-void
-ipa_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
- struct ipa_jump_func *jfunc)
-{
- if (jfunc->type == IPA_JF_CONST)
- {
- lat->type = IPA_CONST_VALUE;
- lat->constant = jfunc->value.constant;
- }
- else if (jfunc->type == IPA_JF_PASS_THROUGH)
- {
- struct ipcp_lattice *caller_lat;
- tree cst;
-
- caller_lat = ipa_get_lattice (info, jfunc->value.pass_through.formal_id);
- lat->type = caller_lat->type;
- if (caller_lat->type != IPA_CONST_VALUE)
- return;
- cst = caller_lat->constant;
-
- if (jfunc->value.pass_through.operation != NOP_EXPR)
- {
- tree restype;
- if (TREE_CODE_CLASS (jfunc->value.pass_through.operation)
- == tcc_comparison)
- restype = boolean_type_node;
- else
- restype = TREE_TYPE (cst);
- cst = fold_binary (jfunc->value.pass_through.operation,
- restype, cst, jfunc->value.pass_through.operand);
- }
- if (!cst || !is_gimple_ip_invariant (cst))
- lat->type = IPA_BOTTOM;
- lat->constant = cst;
- }
- else if (jfunc->type == IPA_JF_ANCESTOR)
- {
- struct ipcp_lattice *caller_lat;
- tree t;
-
- caller_lat = ipa_get_lattice (info, jfunc->value.ancestor.formal_id);
- lat->type = caller_lat->type;
- if (caller_lat->type != IPA_CONST_VALUE)
- return;
- if (TREE_CODE (caller_lat->constant) != ADDR_EXPR)
- {
- /* This can happen when the constant is a NULL pointer. */
- lat->type = IPA_BOTTOM;
- return;
- }
- t = TREE_OPERAND (caller_lat->constant, 0);
- t = build_ref_for_offset (EXPR_LOCATION (t), t,
- jfunc->value.ancestor.offset,
- jfunc->value.ancestor.type, NULL, false);
- lat->constant = build_fold_addr_expr (t);
- }
- else
- lat->type = IPA_BOTTOM;
-}
-
-/* Determine whether JFUNC evaluates to a constant and if so, return it.
- Otherwise return NULL. INFO describes the caller node so that pass-through
- jump functions can be evaluated. */
-
-tree
-ipa_cst_from_jfunc (struct ipa_node_params *info, struct ipa_jump_func *jfunc)
-{
- struct ipcp_lattice lat;
-
- ipa_lattice_from_jfunc (info, &lat, jfunc);
- if (lat.type == IPA_CONST_VALUE)
- return lat.constant;
- else
- return NULL_TREE;
-}
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 89a17f4b9d0..994e4ac146d 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "vec.h"
#include "cgraph.h"
#include "gimple.h"
+#include "alloc-pool.h"
/* The following definitions and interfaces are used by
interprocedural analyses or parameters. */
@@ -32,7 +33,10 @@ along with GCC; see the file COPYING3. If not see
/* ipa-prop.c stuff (ipa-cp, indirect inlining): */
/* A jump function for a callsite represents the values passed as actual
- arguments of the callsite. There are three main types of values :
+ arguments of the callsite. They were originally proposed in a paper called
+ "Interprocedural Constant Propagation", by David Callahan, Keith D Cooper,
+ Ken Kennedy, Linda Torczon in Comp86, pg 152-161. There are three main
+ types of values :
Pass-through - the caller's formal parameter is passed as an actual
argument, possibly one simple operation performed on it.
@@ -41,7 +45,8 @@ along with GCC; see the file COPYING3. If not see
Unknown - neither of the above.
IPA_JF_CONST_MEMBER_PTR stands for C++ member pointers, it is a special
- constant in this regard. Other constants are represented with IPA_JF_CONST.
+ constant in this regard because it is in fact a structure consisting of two
+ values. Other constants are represented with IPA_JF_CONST.
IPA_JF_ANCESTOR is a special pass-through jump function, which means that
the result is an address of a part of the object pointed to by the formal
@@ -130,95 +135,65 @@ struct GTY (()) ipa_jump_func
} GTY ((desc ("%1.type"))) value;
};
-/* All formal parameters in the program have a lattice associated with it
- computed by the interprocedural stage of IPCP.
- There are three main values of the lattice:
- IPA_TOP - unknown,
- IPA_BOTTOM - variable,
- IPA_CONST_VALUE - simple scalar constant,
-
- We also use this type to propagate types accross the call graph for the
- purpose of devirtualization. In that case, IPA_CONST_VALUE denotes a known
- type, rather than a constant. */
-enum ipa_lattice_type
-{
- IPA_BOTTOM,
- IPA_CONST_VALUE,
- IPA_TOP
-};
+/* Summary describing a single formal parameter. */
-/* All formal parameters in the program have a cval computed by
- the interprocedural stage of IPCP. See enum ipa_lattice_type for
- the various types of lattices supported */
-struct ipcp_lattice
-{
- enum ipa_lattice_type type;
- tree constant;
-};
-
-/* Structure describing a single formal parameter. */
struct ipa_param_descriptor
{
- /* IPA-CP lattice. */
- struct ipcp_lattice ipcp_lattice;
/* PARAM_DECL of this parameter. */
tree decl;
- /* Vector of BINFOs of types that this argument might encounter. NULL
- basically means a top value, bottom is marked by the cannot_devirtualize
- flag below.*/
- VEC (tree, heap) *types;
/* The parameter is used. */
unsigned used : 1;
- /* Set when parameter type cannot be used for devirtualization. */
- unsigned cannot_devirtualize : 1;
};
+typedef struct ipa_param_descriptor ipa_param_descriptor_t;
+DEF_VEC_O (ipa_param_descriptor_t);
+DEF_VEC_ALLOC_O (ipa_param_descriptor_t, heap);
+struct ipcp_lattice;
+
/* ipa_node_params stores information related to formal parameters of functions
and some other information for interprocedural passes that operate on
parameters (such as ipa-cp). */
+
struct ipa_node_params
{
- /* Number of formal parameters of this function. When set to 0, this
- function's parameters would not be analyzed by IPA CP. */
- int param_count;
+ /* Information about individual formal parameters that are gathered when
+ summaries are generated. */
+ VEC (ipa_param_descriptor_t, heap) *descriptors;
+ /* Pointer to an array of structures describing individual formal
+ parameters. */
+ struct ipcp_lattice *lattices;
+ /* Only for versioned nodes this field would not be NULL,
+ it points to the node that IPA cp cloned from. */
+ struct cgraph_node *ipcp_orig_node;
+ /* If this node is an ipa-cp clone, these are the known values that describe
+ what it has been specialized for. */
+ VEC (tree, heap) *known_vals;
/* Whether this function is called with variable number of actual
arguments. */
unsigned called_with_var_arguments : 1;
+ /* Set when it is possible to create specialized versions of this node. */
+ unsigned node_versionable : 1;
/* Whether the param uses analysis has already been performed. */
unsigned uses_analysis_done : 1;
- /* Whether the function is enqueued in an ipa_func_list. */
+ /* Whether the function is enqueued in ipa-cp propagation stack. */
unsigned node_enqueued : 1;
- /* Pointer to an array of structures describing individual formal
- parameters. */
- struct ipa_param_descriptor *params;
- /* Only for versioned nodes this field would not be NULL,
- it points to the node that IPA cp cloned from. */
- struct cgraph_node *ipcp_orig_node;
- /* Meaningful only for original functions. Expresses the
- ratio between the direct calls and sum of all invocations of
- this function (given by profiling info). It is used to calculate
- the profiling information of the original function and the versioned
- one. */
- gcov_type count_scale;
+ /* Whether we should create a specialized version based on values that are
+ known to be constant in all contexts. */
+ unsigned clone_for_all_contexts : 1;
+ /* Node has been completely replaced by clones and will be removed after
+ ipa-cp is finished. */
+ unsigned node_dead : 1;
};
/* ipa_node_params access functions. Please use these to access fields that
are or will be shared among various passes. */
-/* Set the number of formal parameters. */
-
-static inline void
-ipa_set_param_count (struct ipa_node_params *info, int count)
-{
- info->param_count = count;
-}
-
/* Return the number of formal parameters. */
static inline int
ipa_get_param_count (struct ipa_node_params *info)
{
- return info->param_count;
+ return VEC_length (ipa_param_descriptor_t, info->descriptors);
}
/* Return the declaration of Ith formal parameter of the function corresponding
@@ -228,39 +203,25 @@ ipa_get_param_count (struct ipa_node_params *info)
static inline tree
ipa_get_param (struct ipa_node_params *info, int i)
{
- gcc_assert (i >= 0 && i <= info->param_count);
- return info->params[i].decl;
-}
-
-/* Return the used flag corresponding to the Ith formal parameter of
- the function associated with INFO. */
-
-static inline bool
-ipa_is_param_used (struct ipa_node_params *info, int i)
-{
- gcc_assert (i >= 0 && i <= info->param_count);
- return info->params[i].used;
+ return VEC_index (ipa_param_descriptor_t, info->descriptors, i)->decl;
}
-/* Return the cannot_devirtualize flag corresponding to the Ith formal
- parameter of the function associated with INFO. The corresponding function
- to set the flag is ipa_set_param_cannot_devirtualize. */
+/* Set the used flag corresponding to the Ith formal parameter of the function
+ associated with INFO to VAL. */
-static inline bool
-ipa_param_cannot_devirtualize_p (struct ipa_node_params *info, int i)
+static inline void
+ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
{
- gcc_assert (i >= 0 && i <= info->param_count);
- return info->params[i].cannot_devirtualize;
+ VEC_index (ipa_param_descriptor_t, info->descriptors, i)->used = val;
}
-/* Return true iff the vector of possible types of the Ith formal parameter of
- the function associated with INFO is empty. */
+/* Return the used flag corresponding to the Ith formal parameter of the
+ function associated with INFO. */
static inline bool
-ipa_param_types_vec_empty (struct ipa_node_params *info, int i)
+ipa_is_param_used (struct ipa_node_params *info, int i)
{
- gcc_assert (i >= 0 && i <= info->param_count);
- return info->params[i].types == NULL;
+ return VEC_index (ipa_param_descriptor_t, info->descriptors, i)->used;
}
/* Flag this node as having callers with variable number of arguments. */
@@ -279,8 +240,6 @@ ipa_is_called_with_var_arguments (struct ipa_node_params *info)
return info->called_with_var_arguments;
}
-
-
/* ipa_edge_args stores information related to a callsite and particularly its
arguments. It can be accessed by the IPA_EDGE_REF macro. */
typedef struct GTY(()) ipa_edge_args
@@ -402,33 +361,6 @@ ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge)
ipa_edge_args_vector));
}
-/* A function list element. It is used to create a temporary worklist used in
- the propagation stage of IPCP. (can be used for more IPA optimizations) */
-struct ipa_func_list
-{
- struct cgraph_node *node;
- struct ipa_func_list *next;
-};
-
-/* ipa_func_list interface. */
-struct ipa_func_list *ipa_init_func_list (void);
-void ipa_push_func_to_list_1 (struct ipa_func_list **, struct cgraph_node *,
- struct ipa_node_params *);
-struct cgraph_node *ipa_pop_func_from_list (struct ipa_func_list **);
-
-/* Add cgraph NODE to the worklist WL if it is not already in one. */
-
-static inline void
-ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *node)
-{
- struct ipa_node_params *info = IPA_NODE_REF (node);
-
- if (!info->node_enqueued)
- ipa_push_func_to_list_1 (wl, node, info);
-}
-
-void ipa_analyze_node (struct cgraph_node *);
-
/* Function formal parameters related computations. */
void ipa_initialize_node_params (struct cgraph_node *node);
bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
@@ -438,12 +370,18 @@ bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree,
tree);
+/* Functions related to both. */
+void ipa_analyze_node (struct cgraph_node *);
/* Debugging interface. */
void ipa_print_node_params (FILE *, struct cgraph_node *node);
void ipa_print_all_params (FILE *);
void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
void ipa_print_all_jump_functions (FILE * f);
+void ipcp_verify_propagated_values (void);
+
+extern alloc_pool ipcp_values_pool;
+extern alloc_pool ipcp_sources_pool;
/* Structure to describe transformations of formal parameters and actual
arguments. Each instance describes one new parameter and they are meant to
@@ -521,9 +459,6 @@ void ipa_prop_write_jump_functions (cgraph_node_set set);
void ipa_prop_read_jump_functions (void);
void ipa_update_after_lto_read (void);
int ipa_get_param_decl_index (struct ipa_node_params *, tree);
-void ipa_lattice_from_jfunc (struct ipa_node_params *info,
- struct ipcp_lattice *lat,
- struct ipa_jump_func *jfunc);
tree ipa_cst_from_jfunc (struct ipa_node_params *info,
struct ipa_jump_func *jfunc);
@@ -532,13 +467,4 @@ tree ipa_cst_from_jfunc (struct ipa_node_params *info,
tree build_ref_for_offset (location_t, tree, HOST_WIDE_INT, tree,
gimple_stmt_iterator *, bool);
-/* Return the lattice corresponding to the Ith formal parameter of the function
- described by INFO. */
-static inline struct ipcp_lattice *
-ipa_get_lattice (struct ipa_node_params *info, int i)
-{
- gcc_assert (i >= 0 && i <= info->param_count);
- return &(info->params[i].ipcp_lattice);
-}
-
#endif /* IPA_PROP_H */
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index be002839fa2..3df65709f6f 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -393,7 +393,7 @@ process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p,
int allocno_preferenced_hard_regno, cost, index, offset1, offset2;
bool only_regs_p;
ira_allocno_t a;
- enum reg_class rclass, aclass;
+ reg_class_t rclass, aclass;
enum machine_mode mode;
ira_copy_t cp;
@@ -438,7 +438,7 @@ process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p,
mode = ALLOCNO_MODE (a);
aclass = ALLOCNO_CLASS (a);
if (only_regs_p && insn != NULL_RTX
- && reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode))
+ && reg_class_size[rclass] <= ira_reg_class_max_nregs [rclass][mode])
/* It is already taken into account in ira-costs.c. */
return false;
index = ira_class_hard_reg_index[aclass][allocno_preferenced_hard_regno];
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index da14089f913..39ef33a541c 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -930,15 +930,15 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
enum machine_mode mode = GET_MODE (ops[!i]);
cost_classes_t cost_classes_ptr = regno_cost_classes[regno];
enum reg_class *cost_classes = cost_classes_ptr->classes;
- enum reg_class rclass;
+ reg_class_t rclass;
int nr;
for (k = cost_classes_ptr->num - 1; k >= 0; k--)
{
rclass = cost_classes[k];
if (TEST_HARD_REG_BIT (reg_class_contents[rclass], other_regno)
- && (reg_class_size[rclass]
- == (unsigned) CLASS_MAX_NREGS (rclass, mode)))
+ && (reg_class_size[(int) rclass]
+ == ira_reg_class_max_nregs [(int) rclass][(int) mode]))
{
if (reg_class_size[rclass] == 1)
op_costs[i]->cost[k] = -frequency;
diff --git a/gcc/ira.c b/gcc/ira.c
index 6cca90807df..b54762e8962 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1403,7 +1403,7 @@ setup_reg_class_nregs (void)
for (cl = 0; cl < N_REG_CLASSES; cl++)
ira_reg_class_max_nregs[cl][m]
= ira_reg_class_min_nregs[cl][m]
- = CLASS_MAX_NREGS ((enum reg_class) cl, (enum machine_mode) m);
+ = targetm.class_max_nregs ((reg_class_t) cl, (enum machine_mode) m);
for (cl = 0; cl < N_REG_CLASSES; cl++)
for (i = 0;
(cl2 = alloc_reg_class_subclasses[cl][i]) != LIM_REG_CLASSES;
diff --git a/gcc/ira.h b/gcc/ira.h
index a31a03ca21b..60518ecb313 100644
--- a/gcc/ira.h
+++ b/gcc/ira.h
@@ -68,8 +68,8 @@ struct target_ira {
/* Maps: register class x machine mode -> maximal/minimal number of
hard registers of given class needed to store value of given
mode. */
- int x_ira_reg_class_max_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
- int x_ira_reg_class_min_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
+ unsigned char x_ira_reg_class_max_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
+ unsigned char x_ira_reg_class_min_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
/* Array analogous to target hook TARGET_MEMORY_MOVE_COST. */
short x_ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b3e3ec66c83..6f3aee6ee68 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * builtins.c (static): Use fold_build_pointer_plus.
+ * class.c (make_class_data): Likewise.
+ (build_symbol_entry): Likewise.
+ * except.c (build_exception_object_ref): Likewise.
+ * expr.c (build_java_arrayaccess): Likewise.
+ (build_field_ref): Likewise.
+ (build_known_method_ref): Likewise.
+ (build_invokevirtual): Likewise.
+
2011-07-06 Richard Guenther <rguenther@suse.de>
* decl.c (java_init_decl_processing):
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 817f8628c77..1e94bcab4d2 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -283,10 +283,7 @@ static tree
build_addr_sum (tree type, tree addr, tree offset)
{
tree ptr_type = build_pointer_type (type);
- return fold_build2 (POINTER_PLUS_EXPR,
- ptr_type,
- fold_convert (ptr_type, addr),
- fold_convert (sizetype, offset));
+ return fold_build_pointer_plus (fold_convert (ptr_type, addr), offset);
}
/* Make sure that this-arg is non-NULL. This is a security check. */
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 92091f9e9cf..3bb5ff44f6e 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -2085,10 +2085,10 @@ make_class_data (tree type)
PUSH_FIELD_VALUE (v1, "vtable",
(flag_indirect_classes
? null_pointer_node
- : build2 (POINTER_PLUS_EXPR, dtable_ptr_type,
- build1 (ADDR_EXPR, dtable_ptr_type,
- class_dtable_decl),
- dtable_start_offset)));
+ : fold_build_pointer_plus
+ (build1 (ADDR_EXPR, dtable_ptr_type,
+ class_dtable_decl),
+ dtable_start_offset)));
if (! flag_hash_synchronization)
PUSH_FIELD_VALUE (v1, "sync_info", null_pointer_node);
FINISH_RECORD_CONSTRUCTOR (temp, v1, object_type_node);
@@ -2131,10 +2131,10 @@ make_class_data (tree type)
PUSH_FIELD_VALUE (v2, "vtable",
(flag_indirect_dispatch || dtable_decl == NULL_TREE
? null_pointer_node
- : build2 (POINTER_PLUS_EXPR, dtable_ptr_type,
- build1 (ADDR_EXPR, dtable_ptr_type,
- dtable_decl),
- dtable_start_offset)));
+ : fold_build_pointer_plus
+ (build1 (ADDR_EXPR, dtable_ptr_type,
+ dtable_decl),
+ dtable_start_offset)));
add_table_and_syms (&v2, TYPE_OTABLE_METHODS (type),
"otable", TYPE_OTABLE_DECL (type), otable_ptr_type,
"otable_syms", TYPE_OTABLE_SYMS_DECL (type));
@@ -2896,8 +2896,7 @@ build_symbol_entry (tree decl, tree special)
system that this is a "special" symbol, i.e. one that should
bypass access controls. */
if (special != NULL_TREE)
- signature = build2 (POINTER_PLUS_EXPR, TREE_TYPE (signature), signature,
- fold_convert (sizetype, special));
+ signature = fold_build_pointer_plus (signature, special);
return build_symbol_table_entry (clname, name, signature);
}
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 1705106c4d9..f5e5bb9e664 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -488,7 +488,7 @@ build_exception_object_ref (tree type)
The java object is immediately before the generic exception header. */
obj = build_exception_object_var ();
obj = fold_convert (build_pointer_type (type), obj);
- obj = build2 (POINTER_PLUS_EXPR, TREE_TYPE (obj), obj,
+ obj = fold_build_pointer_plus (obj,
fold_build1 (NEGATE_EXPR, sizetype,
TYPE_SIZE_UNIT (TREE_TYPE (obj))));
obj = build1 (INDIRECT_REF, type, obj);
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 3bf983a2bca..4686f30309b 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -936,7 +936,7 @@ build_java_arrayaccess (tree array, tree type, tree index)
size_exp);
/* Sum the byte offset and the address of the data field. */
- node = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (node), node, index);
+ node = fold_build_pointer_plus (node, index);
/* Finally, return
@@ -1743,12 +1743,8 @@ build_field_ref (tree self_value, tree self_class, tree name)
1, otable_index),
field_offset);
- field_offset = fold (convert (sizetype, field_offset));
self_value = java_check_reference (self_value, check);
- address
- = fold_build2 (POINTER_PLUS_EXPR,
- TREE_TYPE (self_value),
- self_value, field_offset);
+ address = fold_build_pointer_plus (self_value, field_offset);
address = fold_convert (build_pointer_type (TREE_TYPE (field_decl)),
address);
return fold_build1 (INDIRECT_REF, TREE_TYPE (field_decl), address);
@@ -2255,8 +2251,7 @@ build_known_method_ref (tree method, tree method_type ATTRIBUTE_UNUSED,
method_index++;
}
method_index *= int_size_in_bytes (method_type_node);
- ref = fold_build2 (POINTER_PLUS_EXPR, method_ptr_type_node,
- ref, size_int (method_index));
+ ref = fold_build_pointer_plus_hwi (ref, method_index);
ref = build1 (INDIRECT_REF, method_type_node, ref);
func = build3 (COMPONENT_REF, nativecode_ptr_type_node,
ref, lookup_field (&method_type_node, ncode_ident),
@@ -2349,8 +2344,7 @@ build_invokevirtual (tree dtable, tree method, tree special)
size_int (TARGET_VTABLE_USES_DESCRIPTORS));
}
- func = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dtable), dtable,
- convert (sizetype, method_index));
+ func = fold_build_pointer_plus (dtable, method_index);
if (TARGET_VTABLE_USES_DESCRIPTORS)
func = build1 (NOP_EXPR, nativecode_ptr_type_node, func);
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index b5cae8e0de5..c31ba7fb6a6 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref):
+ Use fold_build_pointer_plus.
+ (objc2_build_ehtype_initializer): Likewise.
+
2011-07-11 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-encoding.h (obstack.h): Do not include.
diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
index 8bdd7f1c190..9ef08f01576 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -1381,8 +1381,7 @@ objc_v2_build_ivar_ref (tree datum, tree component)
string_type_node, build_fold_addr_expr (datum));
/* (char*)datum + offset */
- expr = fold_build2_loc (input_location,
- POINTER_PLUS_EXPR, string_type_node, expr, offset);
+ expr = fold_build_pointer_plus_loc (input_location, expr, offset);
/* (ftype*)((char*)datum + offset) */
expr = build_c_cast (input_location, build_pointer_type (ftype), expr);
@@ -3486,7 +3485,7 @@ objc2_build_ehtype_initializer (tree name, tree cls)
}
addr = build_fold_addr_expr_with_type (next_v2_ehvtable_decl, ptr_type_node);
offs = size_int (2 * int_cst_value (TYPE_SIZE_UNIT (ptr_type_node)));
- addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, offs);
+ addr = fold_build_pointer_plus (addr, offs);
CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, addr);
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 05646bf8833..ccd248c9fe8 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -310,9 +310,7 @@ extract_omp_for_data (gimple for_stmt, struct omp_for_data *fd,
break;
case LE_EXPR:
if (POINTER_TYPE_P (TREE_TYPE (loop->n2)))
- loop->n2 = fold_build2_loc (loc,
- POINTER_PLUS_EXPR, TREE_TYPE (loop->n2),
- loop->n2, size_one_node);
+ loop->n2 = fold_build_pointer_plus_hwi_loc (loc, loop->n2, 1);
else
loop->n2 = fold_build2_loc (loc,
PLUS_EXPR, TREE_TYPE (loop->n2), loop->n2,
@@ -321,9 +319,7 @@ extract_omp_for_data (gimple for_stmt, struct omp_for_data *fd,
break;
case GE_EXPR:
if (POINTER_TYPE_P (TREE_TYPE (loop->n2)))
- loop->n2 = fold_build2_loc (loc,
- POINTER_PLUS_EXPR, TREE_TYPE (loop->n2),
- loop->n2, size_int (-1));
+ loop->n2 = fold_build_pointer_plus_hwi_loc (loc, loop->n2, -1);
else
loop->n2 = fold_build2_loc (loc,
MINUS_EXPR, TREE_TYPE (loop->n2), loop->n2,
@@ -3914,8 +3910,7 @@ expand_omp_for_generic (struct omp_region *region,
t = fold_build2 (MULT_EXPR, itype, t,
fold_convert (itype, fd->loops[i].step));
if (POINTER_TYPE_P (vtype))
- t = fold_build2 (POINTER_PLUS_EXPR, vtype,
- fd->loops[i].n1, fold_convert (sizetype, t));
+ t = fold_build_pointer_plus (fd->loops[i].n1, t);
else
t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
@@ -3944,8 +3939,7 @@ expand_omp_for_generic (struct omp_region *region,
vback = gimple_omp_continue_control_def (stmt);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, vmain,
- fold_convert (sizetype, fd->loop.step));
+ t = fold_build_pointer_plus (vmain, fd->loop.step);
else
t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
@@ -3989,9 +3983,7 @@ expand_omp_for_generic (struct omp_region *region,
set_immediate_dominator (CDI_DOMINATORS, bb, last_bb);
if (POINTER_TYPE_P (vtype))
- t = fold_build2 (POINTER_PLUS_EXPR, vtype,
- fd->loops[i].v,
- fold_convert (sizetype, fd->loops[i].step));
+ t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step);
else
t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v,
fd->loops[i].step);
@@ -4239,8 +4231,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_convert (itype, s0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
- fold_convert (sizetype, t));
+ t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
@@ -4251,8 +4242,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_convert (itype, e0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
- fold_convert (sizetype, t));
+ t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
e = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
@@ -4267,8 +4257,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
vback = gimple_omp_continue_control_def (stmt);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, vmain,
- fold_convert (sizetype, fd->loop.step));
+ t = fold_build_pointer_plus (vmain, fd->loop.step);
else
t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
@@ -4442,8 +4431,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_build2 (MULT_EXPR, itype, threadid, fd->chunk_size);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
- fold_convert (sizetype, t));
+ t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
v_extra = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
@@ -4475,8 +4463,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_convert (itype, s0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
- fold_convert (sizetype, t));
+ t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
t = force_gimple_operand_gsi (&si, t, false, NULL_TREE,
@@ -4487,8 +4474,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_convert (itype, e0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
- fold_convert (sizetype, t));
+ t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
e = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
@@ -4503,8 +4489,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
v_back = gimple_omp_continue_control_def (stmt);
if (POINTER_TYPE_P (type))
- t = fold_build2 (POINTER_PLUS_EXPR, type, v_main,
- fold_convert (sizetype, fd->loop.step));
+ t = fold_build_pointer_plus (v_main, fd->loop.step);
else
t = fold_build2 (PLUS_EXPR, type, v_main, fd->loop.step);
stmt = gimple_build_assign (v_back, t);
diff --git a/gcc/params.def b/gcc/params.def
index 7c20b92ef1b..e8065da4662 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -869,7 +869,7 @@ DEFPARAM (PARAM_MAX_VARTRACK_SIZE,
DEFPARAM (PARAM_MAX_VARTRACK_EXPR_DEPTH,
"max-vartrack-expr-depth",
"Max. recursion depth for expanding var tracking expressions",
- 20, 0, 0)
+ 12, 0, 0)
/* Set minimum insn uid for non-debug insns. */
@@ -884,12 +884,18 @@ DEFPARAM (PARAM_IPA_SRA_PTR_GROWTH_FACTOR,
"a pointer to an aggregate with",
2, 0, 0)
-DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
- "devirt-type-list-size",
- "Maximum size of a type list associated with each parameter for "
- "devirtualization",
+DEFPARAM (PARAM_IPA_CP_VALUE_LIST_SIZE,
+ "ipa-cp-value-list-size",
+ "Maximum size of a list of values associated with each parameter for "
+ "interprocedural constant propagation",
8, 0, 0)
+DEFPARAM (PARAM_IPA_CP_EVAL_THRESHOLD,
+ "ipa-cp-eval-threshold",
+ "Threshold ipa-cp opportunity evaluation that is still considered "
+ "beneficial to clone.",
+ 500, 0, 0)
+
/* WHOPR partitioning configuration. */
DEFPARAM (PARAM_LTO_PARTITIONS,
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index ff45aa8d857..0fbeb66f2fe 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-21 Joseph Myers <joseph@codesourcery.com>
+
+ * de.po, sv.po: Update.
+
2011-07-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* EXCLUDES (config/darwin-crt2.c): Remove.
diff --git a/gcc/po/de.po b/gcc/po/de.po
index b16f2880007..5f192294078 100644
--- a/gcc/po/de.po
+++ b/gcc/po/de.po
@@ -6,10 +6,10 @@
# Roland Stigge <stigge@antcom.de>, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011.
msgid ""
msgstr ""
-"Project-Id-Version: gcc 4.6.0\n"
+"Project-Id-Version: gcc 4.6.1\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2011-06-21 10:27+0000\n"
-"PO-Revision-Date: 2011-06-30 12:55+0100\n"
+"PO-Revision-Date: 2011-07-12 21:15+0100\n"
"Last-Translator: Roland Stigge <stigge@antcom.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"Language: de\n"
@@ -9314,10 +9314,8 @@ msgid "-fconst-string-class=<name>\tUse class <name> for constant strings"
msgstr "-fconst-string-class=<Name>\tKlasse <Name> für konstante Zeichenketten verwenden"
#: c-family/c.opt:724
-#, fuzzy
-#| msgid "-ftemplate-depth=<number>\tSpecify maximum template instantiation depth"
msgid "-fconstexpr-depth=<number>\tSpecify maximum constexpr recursion depth"
-msgstr "-ftemplate-depth=<Zahl>\tGrößte Template-Instantiierungstiefe angeben"
+msgstr "-fconstexpr-depth=<Zahl>\tGrößte Rekursionstiefe für konstante Ausdrücke angeben"
#: c-family/c.opt:728
msgid "-fno-deduce-init-list\tdisable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list"
@@ -9646,10 +9644,8 @@ msgid "Remap file names when including files"
msgstr "Dateinamen beim Einfügen von Dateien neu abbilden"
#: c-family/c.opt:1140 c-family/c.opt:1144
-#, fuzzy
-#| msgid "Conform to the ISO 1998 C++ standard with GNU extensions"
msgid "Conform to the ISO 1998 C++ standard revised by the 2003 technical corrigendum"
-msgstr "Mit dem Standard ISO 1998 C++ mit GNU-Erweiterungen übereinstimmen"
+msgstr "Mit dem Standard ISO 1998 C++ (mit technischen Korrekturen 2003 überarbeitet) übereinstimmen"
#: c-family/c.opt:1148
msgid "Conform to the ISO 1998 C++ standard, with extensions that are likely to"
@@ -22278,16 +22274,14 @@ msgid "the last argument must be a 2-bit immediate"
msgstr "Das letzte Argument muss ein 2-Bit-Immediate sein"
#: config/i386/i386.c:26380
-#, fuzzy, gcc-internal-format
-#| msgid "the fifth argument must be a 8-bit immediate"
+#, gcc-internal-format
msgid "the fifth argument must be an 8-bit immediate"
-msgstr "Argument 5 muss ein 8-Bit-Immediate sein"
+msgstr "fünftes Argument muss ein 8-Bit-Immediate sein"
#: config/i386/i386.c:26475
-#, fuzzy, gcc-internal-format
-#| msgid "the third argument must be a 8-bit immediate"
+#, gcc-internal-format
msgid "the third argument must be an 8-bit immediate"
-msgstr "Argument 3 muss ein 8-Bit-Immediate sein"
+msgstr "drittes Argument muss ein 8-Bit-Immediate sein"
#: config/i386/i386.c:26832
#, gcc-internal-format
@@ -24666,10 +24660,9 @@ msgid "cannot bind rvalue %qE to %qT"
msgstr "der R-Wert %qE kann nicht mit %qT verbunden werden"
#: cp/call.c:5730 cp/cvt.c:1625
-#, fuzzy, gcc-internal-format
-#| msgid "class %qT will be considered nearly empty in a future version of GCC"
+#, gcc-internal-format
msgid "scoped enum %qT will not promote to an integral type in a future version of GCC"
-msgstr "Klasse %qT wird in zukünftigen GCC-Versionen als annähernd leer betrachtet werden"
+msgstr "enum %qT mit Gültigkeitsbereich wird in zukünftigen GCC-Versionen nicht auf Ganzzahltyp erweitert"
#: cp/call.c:5760
#, gcc-internal-format
@@ -24808,10 +24801,9 @@ msgid "ISO C++ says that these are ambiguous, even though the worst conversion f
msgstr "ISO C++ besagt, dass diese mehrdeutig sind, auch wenn die schlechteste Umwandlung für das erste besser ist als die schlechteste Umwandlung für das zweite:"
#: cp/call.c:8070
-#, fuzzy, gcc-internal-format
-#| msgid "could not convert %qE to %qT"
+#, gcc-internal-format
msgid "could not convert %qE from %qT to %qT"
-msgstr "%qE konnte nicht nach %qT konvertiert werden"
+msgstr "%qE konnte nicht von %qT nach %qT umgewandelt werden"
#: cp/call.c:8313
#, gcc-internal-format
@@ -25070,10 +25062,9 @@ msgid "initializer specified for non-virtual method %q+D"
msgstr "Initialisierung für nicht-virtuelle Methode %q+D angegeben"
#: cp/class.c:4563 cp/semantics.c:5455
-#, fuzzy, gcc-internal-format
-#| msgid "enclosing class of %q+D is not a literal type"
+#, gcc-internal-format
msgid "enclosing class of %q+#D is not a literal type"
-msgstr "umschließende Klasse von %q+D ist kein Literaltyp"
+msgstr "umschließende Klasse von %q+#D ist kein Literaltyp"
#: cp/class.c:4670
#, gcc-internal-format
@@ -25090,12 +25081,12 @@ msgstr "nicht-statisches const-Element %q+#D in Klasse ohne einen Konstruktor"
#: cp/class.c:4701
#, gcc-internal-format
msgid "%q+D declared to take const reference, but implicit declaration would take non-const"
-msgstr ""
+msgstr "%q+D mit Eingabe einer konstanten Referenz deklariert, aber implizite Deklaration würde nicht-Konstante annehmen"
#: cp/class.c:4704
#, gcc-internal-format
msgid "%q+D declared to take non-const reference cannot be defaulted in the class body"
-msgstr ""
+msgstr "mit Eingabe einer nicht konstanten Referenz deklariertes %q+D kann im Klassenkörper nicht vorbelegt werden"
#: cp/class.c:4928
#, gcc-internal-format
@@ -27018,10 +27009,9 @@ msgid "reference %qs cannot be declared %<mutable%>"
msgstr "Referenz %qs kann nicht als %<mutable%> deklariert sein"
#: cp/decl.c:9308
-#, fuzzy, gcc-internal-format
-#| msgid "parameter declared %<auto%>"
+#, gcc-internal-format
msgid "typedef declared %<auto%>"
-msgstr "Parameter als %<auto%> deklariert"
+msgstr "»typedef« als %<auto%> deklariert"
#: cp/decl.c:9318
#, gcc-internal-format
@@ -28526,10 +28516,9 @@ msgid "%qD cannot be declared as constexpr"
msgstr "%qD kann nicht als »constexpr« deklariert werden"
#: cp/method.c:1599
-#, fuzzy, gcc-internal-format
-#| msgid "%qD cannot be defaulted"
+#, gcc-internal-format
msgid "a template cannot be defaulted"
-msgstr "%qD kann nicht vorgegeben werden"
+msgstr "ein Template kann nicht vorbelegt werden"
#: cp/method.c:1627
#, gcc-internal-format
@@ -29069,10 +29058,9 @@ msgid "need %<typename%> before %<%T::%E%> because %qT is a dependent scope"
msgstr "vor %<%T::%E%> ist %<typename%> erforderlich, da %qT ein abhängiger Gültigkeitsbereich ist"
#: cp/parser.c:2791
-#, fuzzy, gcc-internal-format
-#| msgid "%qE in class %qT does not name a type"
+#, gcc-internal-format
msgid "%qE in %q#T does not name a type"
-msgstr "%qE in Klasse %qT bezeichnet keinen Typen"
+msgstr "%qE in %q#T benennt keinen Typen"
#: cp/parser.c:3340
#, gcc-internal-format
@@ -29302,9 +29290,9 @@ msgid "expected iteration-statement"
msgstr "Iterationsanweisung erwartet"
#: cp/parser.c:9098
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "range-based-for loops are not allowed in C++98 mode"
-msgstr "Standardumwandlungen sind in diesem Kontext nicht erlaubt"
+msgstr "bereichsbasierte for-Schleifen sind im C++98-Modus nicht erlaubt"
#. Issue a warning about this use of a GNU extension.
#: cp/parser.c:9220
@@ -29313,9 +29301,9 @@ msgid "ISO C++ forbids computed gotos"
msgstr "ISO-C++ verbietet berechnete Gotos"
#: cp/parser.c:9233 cp/parser.c:20987
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected jump-statement"
-msgstr "Anweisung erwartet"
+msgstr "Sprunganweisung erwartet"
#: cp/parser.c:9365 cp/parser.c:17798
#, gcc-internal-format
@@ -29345,9 +29333,9 @@ msgid "%<auto%> will change meaning in C++0x; please remove it"
msgstr ""
#: cp/parser.c:9981
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "decl-specifier invalid in condition"
-msgstr "reiner Spezifizierer bei Funktionsdefinition"
+msgstr "decl-Spezifizierung in Bedingung ungültig"
#: cp/parser.c:10072
#, gcc-internal-format
@@ -29360,24 +29348,24 @@ msgid "templates may not be %<virtual%>"
msgstr "Templates dürfen nicht %<virtual%> sein"
#: cp/parser.c:10182
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid linkage-specification"
-msgstr "ungültige Spezifizierung der Basisklasse"
+msgstr "ungültige Bindungsspezifikation"
#: cp/parser.c:10309
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "types may not be defined in %<decltype%> expressions"
-msgstr "neue Typen dürfen nicht in einem Rückgabetyp definiert werden"
+msgstr "Typen dürfen nicht in %<decltype%>-Ausdrücken definiert werden"
#: cp/parser.c:10565
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of %<auto%> in conversion operator"
-msgstr "ungültige Verwendung von %<this%> in Nicht-Element-Funktion"
+msgstr "ungültige Verwendung von %<auto%> in Umwandlungsoperator"
#: cp/parser.c:10650
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "only constructors take member initializers"
-msgstr "nur Konstruktoren nehmen Basisinitialisierungen"
+msgstr "nur Konstruktoren nehmen Elementinitialisierungen"
#: cp/parser.c:10672
#, gcc-internal-format
@@ -29395,9 +29383,9 @@ msgid "keyword %<typename%> not allowed in this context (a qualified member init
msgstr "Schlüsselwort %<typename%> in diesem Kontext nicht erlaubt (eine qualifizierte Elementinitialisierung ist implizit ein Typ)"
#: cp/parser.c:11103
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected operator"
-msgstr "unerwarteter Operand"
+msgstr "Operator erwartet"
#. Warn that we do not support `export'.
#: cp/parser.c:11140
@@ -29421,14 +29409,14 @@ msgid "template parameter packs cannot have default arguments"
msgstr "Template-Parameterpacks können keine Standardargumente haben"
#: cp/parser.c:11624
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected template-id"
-msgstr "Anweisung erwartet"
+msgstr "Template-ID erwartet"
#: cp/parser.c:11671 cp/parser.c:20945
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<<%>"
-msgstr "%<{%> erwartet"
+msgstr "%<%> erwartet"
#: cp/parser.c:11678
#, gcc-internal-format
@@ -29447,9 +29435,9 @@ msgstr "Syntaxfehler in Templateargumentliste"
#. The name does not name a template.
#: cp/parser.c:11828 cp/parser.c:11943 cp/parser.c:12153
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected template-name"
-msgstr "Anweisung erwartet"
+msgstr "Templatename erwartet"
#. Explain what went wrong.
#: cp/parser.c:11874
@@ -29463,29 +29451,29 @@ msgid "use %<%T::template %D%> to indicate that it is a template"
msgstr "%<%T::template %D%> verwenden, um dies als Template zu kennzeichnen"
#: cp/parser.c:12009
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected parameter pack before %<...%>"
-msgstr "Deklarationsspezifizierer oder %<...%> erwartet"
+msgstr "Parameterbündel vor %<...%> erwartet"
#: cp/parser.c:12118 cp/parser.c:12136 cp/parser.c:12277
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected template-argument"
-msgstr "Anweisung erwartet"
+msgstr "Templateargument erwartet"
#: cp/parser.c:12260
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid non-type template argument"
-msgstr "ungültige Verwendung von »%D« als ein Nicht-Typ-Templateargument"
+msgstr "ungültiges Templateargument ohne Typ"
#: cp/parser.c:12374
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "explicit instantiation shall not use %<inline%> specifier"
-msgstr "explizite Instanziierung des Nicht-Templatetyps %qT"
+msgstr "explizite Instanziierung sollte nicht %<inline%> verwenden"
#: cp/parser.c:12377
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "explicit instantiation shall not use %<constexpr%> specifier"
-msgstr "explizite Instanziierung des Nicht-Templatetyps %qT"
+msgstr "explizite Instanziierung sollte nicht %<constexpr%> verwenden"
#: cp/parser.c:12434
#, gcc-internal-format
@@ -29493,24 +29481,24 @@ msgid "template specialization with C linkage"
msgstr "Templatespezialisierung mit C-Bindung angegeben"
#: cp/parser.c:12654
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected type specifier"
-msgstr "Deklarationsspezifizierer erwartet"
+msgstr "Typspezifizierer erwartet"
#: cp/parser.c:12871
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected template-id for type"
-msgstr "Ausdruckstyp erwartet"
+msgstr "Template-ID für Typ erwartet"
#: cp/parser.c:12898
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected type-name"
-msgstr "Name erwartet"
+msgstr "Typ-Name erwartet"
#: cp/parser.c:13085
#, gcc-internal-format
msgid "elaborated-type-specifier for a scoped enum must not use the %<%D%> keyword"
-msgstr ""
+msgstr "ausführliche Typ-Spezifikation für einen enum mit Gültigkeitsbereich darf nicht das Schlüsselwort %<%D%> verwenden"
#: cp/parser.c:13269
#, gcc-internal-format
@@ -29533,24 +29521,24 @@ msgid "attributes ignored on elaborated-type-specifier that is not a forward dec
msgstr "Attribute an Spezifizierer ausführlichen Typs ignoriert, der keine Vorwärtsdeklaration ist"
#: cp/parser.c:13488
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is an enumeration template"
-msgstr "%qD ist kein Funktionstemplate"
+msgstr "%qD ist ein Aufzählungstemplate"
#: cp/parser.c:13496
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is not an enumerator-name"
-msgstr "%qD ist kein Namensbereichs-Name"
+msgstr "%qD ist kein Aufzählungsname"
#: cp/parser.c:13559
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<;%> or %<{%>"
-msgstr "%<,%> oder %<;%> erwartet"
+msgstr "%<;%> oder %<{%> erwartet"
#: cp/parser.c:13606
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot add an enumerator list to a template instantiation"
-msgstr "Automatische Template-Instantiierung einschalten"
+msgstr "Aufzählungsliste kann nicht zu Template-Instantiierung hinzugefügt werden"
#: cp/parser.c:13615 cp/parser.c:17396
#, gcc-internal-format
@@ -29570,12 +29558,12 @@ msgstr "mehrfache Definition von %q#T"
#: cp/parser.c:13669
#, gcc-internal-format
msgid "opaque-enum-specifier without name"
-msgstr ""
+msgstr "intransparente Enum-Spezifikation ohne Namen"
#: cp/parser.c:13672
#, gcc-internal-format
msgid "opaque-enum-specifier must use a simple identifier"
-msgstr ""
+msgstr "intransparente Enum-Spezifikation muss einfachen Bezeichner verwenden"
#: cp/parser.c:13847
#, gcc-internal-format
@@ -29583,9 +29571,9 @@ msgid "%qD is not a namespace-name"
msgstr "%qD ist kein Namensbereichs-Name"
#: cp/parser.c:13848
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected namespace-name"
-msgstr "Klassenname erwartet"
+msgstr "Namensraumname erwartet"
#: cp/parser.c:13973
#, gcc-internal-format
@@ -29598,9 +29586,9 @@ msgid "a template-id may not appear in a using-declaration"
msgstr "eine Template-ID darf nicht in »using«-Deklaration auftreten"
#: cp/parser.c:14536
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "a function-definition is not allowed here"
-msgstr "%<namespace%>-Definition ist hier nicht erlaubt"
+msgstr "eine Funktionsdefinition ist hier nicht erlaubt"
#: cp/parser.c:14548
#, gcc-internal-format
@@ -29615,18 +29603,18 @@ msgstr "bei einer Funktionsdefinition sind keine Attribute erlaubt"
#: cp/parser.c:14589
#, gcc-internal-format
msgid "expected constructor, destructor, or type conversion"
-msgstr ""
+msgstr "Konstruktor, Destruktor oder Typumwandlung erwartet"
#. Anything else is an error.
#: cp/parser.c:14624 cp/parser.c:16539
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected initializer"
-msgstr "Bezeichner erwartet"
+msgstr "Initialisierung erwartet"
#: cp/parser.c:14644
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type in declaration"
-msgstr "ungültige Funktionsdeklaration"
+msgstr "ungültiger Typ in Deklaration"
#: cp/parser.c:14720
#, gcc-internal-format
@@ -29644,9 +29632,9 @@ msgid "array bound is not an integer constant"
msgstr "Feldgrenze ist keine Ganzzahlkonstante"
#: cp/parser.c:15272
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot define member of dependent typedef %qT"
-msgstr "Zeiger auf Elementreferenztyp %qT wird erzeugt"
+msgstr "Element des abhängigen Typedef %qT kann nicht definiert werden"
#: cp/parser.c:15276
#, gcc-internal-format
@@ -29668,14 +29656,14 @@ msgstr "%<%T::%D%> statt %<%T::%D%> verwenden, um den Konstruktor mit qualifizie
#. information about its original syntactic
#. form.
#: cp/parser.c:15323
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid declarator"
-msgstr "Ungültige Deklaration"
+msgstr "ungültiger Deklarator"
#: cp/parser.c:15389
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected declarator"
-msgstr "Deklarationsspezifizierer erwartet"
+msgstr "Deklarator erwartet"
#: cp/parser.c:15484
#, gcc-internal-format
@@ -29683,9 +29671,9 @@ msgid "%qD is a namespace"
msgstr "%qD ist ein Namensbereich"
#: cp/parser.c:15500
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected ptr-operator"
-msgstr "unerwarteter Operand"
+msgstr "Ptr-Operator erwartet"
#: cp/parser.c:15559
#, gcc-internal-format
@@ -29693,29 +29681,29 @@ msgid "duplicate cv-qualifier"
msgstr "doppelter CV-Qualifizierer"
#: cp/parser.c:15681 cp/typeck2.c:427
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of %<auto%>"
-msgstr "ungültige Verwendung von %<::%>"
+msgstr "ungültige Verwendung von %<auto%>"
#: cp/parser.c:15700
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "types may not be defined in template arguments"
-msgstr "neue Typen dürfen nicht in einem Rückgabetyp definiert werden"
+msgstr "in Template-Argumenten dürfen keine Typen definiert werden"
#: cp/parser.c:15781
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected type-specifier"
-msgstr "Bezeichner erwartet"
+msgstr "Typspezifikation erwartet"
#: cp/parser.c:16025
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<,%> or %<...%>"
-msgstr "%<:%> oder %<...%> erwartet"
+msgstr "%<,%> oder %<...%> erwartet"
#: cp/parser.c:16082
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "types may not be defined in parameter types"
-msgstr "neue Typen dürfen nicht in einem Rückgabetyp definiert werden"
+msgstr "Typen dürfen nicht in Parametertypen definiert werden"
#: cp/parser.c:16306
#, gcc-internal-format
@@ -29738,39 +29726,39 @@ msgid "ISO C++ does not allow designated initializers"
msgstr "ISO-C++ erlaubt keine benannten Initialisierungen"
#: cp/parser.c:16760 cp/parser.c:16882
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected class-name"
msgstr "Klassenname erwartet"
#: cp/parser.c:17063
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<;%> after class definition"
-msgstr "%<(%> oder Zeilenende erwartet"
+msgstr "%<;%> hinter Klassendefinition erwartet"
#: cp/parser.c:17065
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<;%> after struct definition"
-msgstr "%<(%> oder Zeilenende erwartet"
+msgstr "%<;%> hinter Strukturdefinition erwartet"
#: cp/parser.c:17067
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<;%> after union definition"
-msgstr "%<(%> oder Zeilenende erwartet"
+msgstr "%<;%> hinter Uniondefinition erwartet"
#: cp/parser.c:17351
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<{%> or %<:%>"
-msgstr "%<,%> oder %<;%> erwartet"
+msgstr "%<{%> oder %<:%> erwartet"
#: cp/parser.c:17363
#, gcc-internal-format
msgid "global qualification of class name is invalid"
-msgstr ""
+msgstr "globale Qualifizierung von Klassenname ist ungültig"
#: cp/parser.c:17370
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "qualified name does not name a class"
-msgstr "»friend«-Deklaration benennt keine Klasse oder Funktion"
+msgstr "qualifizierter Name benennt keine Klasse"
#: cp/parser.c:17382
#, gcc-internal-format
@@ -29778,9 +29766,9 @@ msgid "invalid class name in declaration of %qD"
msgstr "ungültiger Klassenname in Deklaration von %qD"
#: cp/parser.c:17415
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "extra qualification not allowed"
-msgstr "zusätzliche Qualifizierung ignoriert"
+msgstr "zusätzliche Qualifizierung nicht erlaubt"
#: cp/parser.c:17427
#, gcc-internal-format
@@ -29795,7 +29783,7 @@ msgstr "Funktions-Template %qD als Klassentemplate redeklariert"
#: cp/parser.c:17488
#, gcc-internal-format
msgid "could not resolve typename type"
-msgstr ""
+msgstr "Typnamen-Typ kann nicht aufgelöst werden"
#: cp/parser.c:17540
#, gcc-internal-format
@@ -29803,9 +29791,9 @@ msgid "previous definition of %q+#T"
msgstr "vorherige Definition von %q+#T"
#: cp/parser.c:17604 cp/parser.c:20990
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected class-key"
-msgstr "Klassenname erwartet"
+msgstr "Klassenschlüssel erwartet"
#: cp/parser.c:17817
#, gcc-internal-format
@@ -29823,29 +29811,29 @@ msgid "pure-specifier on function-definition"
msgstr "reiner Spezifizierer bei Funktionsdefinition"
#: cp/parser.c:18064
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<;%> at end of member declaration"
-msgstr "%<(%> oder Zeilenende erwartet"
+msgstr "%<;%> am Ende von Elementdeklaration erwartet"
#: cp/parser.c:18130
#, gcc-internal-format
msgid "invalid pure specifier (only %<= 0%> is allowed)"
-msgstr ""
+msgstr "ungültige reine Spezifikation (nur %<= 0%> ist erlaubt)"
#: cp/parser.c:18165
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "a brace-enclosed initializer is not allowed here"
-msgstr "geklammerter Initialisierer zur Initialisierung von %qT verwendet"
+msgstr "eine geschweift geklammerte Initialisierung ist hier nicht erlaubt"
#: cp/parser.c:18297
#, gcc-internal-format
msgid "%<virtual%> specified more than once in base-specified"
-msgstr ""
+msgstr "%<virtual%> mehr als einmal in Basisspezifikation angegeben"
#: cp/parser.c:18317
#, gcc-internal-format
msgid "more than one access specifier in base-specified"
-msgstr ""
+msgstr "mehr als ein Zugriff in Basisspezifikation angegeben"
#: cp/parser.c:18341
#, gcc-internal-format
@@ -29858,29 +29846,29 @@ msgid "keyword %<typename%> not allowed in this context (the base class is impli
msgstr "Schlüsselwort %<typename%> nicht erlaubt in diesem Kontext (die Basisklasse ist implizit ein Typ)"
#: cp/parser.c:18421 cp/parser.c:18461
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "types may not be defined in an exception-specification"
-msgstr "neue Typen dürfen nicht in einem Rückgabetyp definiert werden"
+msgstr "Typen dürfen nicht in einer Ausnahmespezifikation definiert werden"
#: cp/parser.c:18443
#, gcc-internal-format
msgid "dynamic exception specifications are deprecated in C++0x; use %<noexcept%> instead"
-msgstr ""
+msgstr "dynamische Ausnahmespezifikationen sind in C++0x veraltet; stattdessen %<noexcept%> verwenden"
#: cp/parser.c:18642
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "types may not be defined in exception-declarations"
-msgstr "neue Typen dürfen nicht in einem Rückgabetyp definiert werden"
+msgstr "Typen dürfen nicht in Ausnahmedeklarationen definiert werden"
#: cp/parser.c:19539
#, gcc-internal-format
msgid "specializing member %<%T::%E%> requires %<template<>%> syntax"
-msgstr ""
+msgstr "spezialisierendes Element %<%T::%E%> erfordert Syntax %<template<>%>"
#: cp/parser.c:19544
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid declaration of %<%T::%E%>"
-msgstr "ungültige Redeklaration von %q+D"
+msgstr "ungültige Deklaration von %<%T::%E%>"
#: cp/parser.c:19548
#, gcc-internal-format
@@ -29912,14 +29900,14 @@ msgid "template with C linkage"
msgstr "Template mit C-Bindung"
#: cp/parser.c:19951
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid explicit specialization"
-msgstr "ungültige Spezifizierung der Basisklasse"
+msgstr "ungültige explizite Spezialisierung"
#: cp/parser.c:20081
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "template declaration of %<typedef%>"
-msgstr "Templatedeklaration von %qs"
+msgstr "Templatedeklaration von %<typedef%>"
#: cp/parser.c:20158
#, gcc-internal-format
@@ -29927,9 +29915,9 @@ msgid "explicit template specialization cannot have a storage class"
msgstr "explizite Template-Spezialisierung kann keine Speicherklasse haben"
#: cp/parser.c:20383
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<>>%> should be %<> >%> within a nested template argument list"
-msgstr "%H%<>>%> sollte innerhalb einer geschachtelten Templateargumentliste %<> >%> sein"
+msgstr "%<>>%> sollte innerhalb einer geschachtelten Templateargumentliste %<> >%> sein"
#: cp/parser.c:20396
#, gcc-internal-format
@@ -29947,134 +29935,134 @@ msgid "%<__thread%> before %qD"
msgstr "%<__thread%> vor %qD"
#: cp/parser.c:20854
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<new%>"
-msgstr "%<{%> erwartet"
+msgstr "%<new%> erwartet"
#: cp/parser.c:20857
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<delete%>"
-msgstr "%<{%> erwartet"
+msgstr "%<delete%> erwartet"
#: cp/parser.c:20860
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<return%>"
-msgstr "%<{%> erwartet"
+msgstr "%<return%> erwartet"
#: cp/parser.c:20866
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<extern%>"
-msgstr "%<{%> erwartet"
+msgstr "%<extern%> erwartet"
#: cp/parser.c:20869
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<static_assert%>"
-msgstr "Anweisung erwartet"
+msgstr "%<static_assert%> erwartet"
#: cp/parser.c:20872
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<decltype%>"
-msgstr "%<{%> erwartet"
+msgstr "%<decltype%> erwartet"
#: cp/parser.c:20875
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<operator%>"
-msgstr "%<{%> erwartet"
+msgstr "%<operator%> erwartet"
#: cp/parser.c:20878
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<class%>"
-msgstr "%<{%> erwartet"
+msgstr "%<class%> erwartet"
#: cp/parser.c:20881
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<template%>"
-msgstr "%<{%> erwartet"
+msgstr "%<template%> erwartet"
#: cp/parser.c:20884
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<namespace%>"
-msgstr "%<{%> erwartet"
+msgstr "%<namespace%> erwartet"
#: cp/parser.c:20887
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<using%>"
-msgstr "%<{%> erwartet"
+msgstr "%<using%> erwartet"
#: cp/parser.c:20890
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<asm%>"
-msgstr "%<{%> erwartet"
+msgstr "%<asm%> erwartet"
#: cp/parser.c:20893
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<try%>"
-msgstr "%<{%> erwartet"
+msgstr "%<try%> erwartet"
#: cp/parser.c:20896
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<catch%>"
-msgstr "%<{%> erwartet"
+msgstr "%<catch%> erwartet"
#: cp/parser.c:20899
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<throw%>"
-msgstr "%<{%> erwartet"
+msgstr "%<throw%> erwartet"
#: cp/parser.c:20902
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<__label__%>"
-msgstr "%<{%> erwartet"
+msgstr "%<__label__%> erwartet"
#: cp/parser.c:20905
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<@try%>"
-msgstr "%<{%> erwartet"
+msgstr "%<@try%> erwartet"
#: cp/parser.c:20908
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<@synchronized%>"
-msgstr "%<{%> erwartet"
+msgstr "%<@synchronized%> erwartet"
#: cp/parser.c:20911
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<@throw%>"
-msgstr "%<{%> erwartet"
+msgstr "%<@throw%> erwartet"
#: cp/parser.c:20936
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<[%>"
-msgstr "%<{%> erwartet"
+msgstr "%<[%> erwartet"
#: cp/parser.c:20942
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<::%>"
-msgstr "%<{%> erwartet"
+msgstr "%<::%> erwartet"
#: cp/parser.c:20954
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<...%>"
-msgstr "%<{%> erwartet"
+msgstr "%<...%> erwartet"
#: cp/parser.c:20957
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<*%>"
-msgstr "%<{%> erwartet"
+msgstr "%<*%> erwartet"
#: cp/parser.c:20960
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<~%>"
-msgstr "%<{%> erwartet"
+msgstr "%<~%> erwartet"
#: cp/parser.c:20966
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<:%> or %<::%>"
-msgstr "%<:%> oder %<...%> erwartet"
+msgstr "%<:%> oder %<::%> erwartet"
#: cp/parser.c:20994
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected %<class%>, %<typename%>, or %<template%>"
-msgstr "%<,%>, %<;%> oder %<}%> erwartet"
+msgstr "%<class%>, %<typename%> oder %<template%> erwartet"
#: cp/parser.c:21225
#, gcc-internal-format
@@ -30099,7 +30087,7 @@ msgstr "unpassendes Objective-C++-Konstrukt %<@%D%>"
#: cp/parser.c:21650
#, gcc-internal-format
msgid "objective-c++ message argument(s) are expected"
-msgstr ""
+msgstr "Objective-C++ Nachrichtenargument(e) erwartet"
#: cp/parser.c:21679
#, gcc-internal-format
@@ -30112,24 +30100,24 @@ msgid "invalid Objective-C++ selector name"
msgstr "Ungültiger Objective-C++-Selektorname"
#: cp/parser.c:22116 cp/parser.c:22134
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "objective-c++ method declaration is expected"
-msgstr "Klassen- oder Schnittstellendeklaration erwartet"
+msgstr "Objective-C++ Methodendeklaration erwartet"
#: cp/parser.c:22128 cp/parser.c:22193
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "method attributes must be specified at the end"
-msgstr "%JAbschnitts-Attribut kann nicht für lokale Variablen angegeben werden"
+msgstr "Methodenattribute müssen am Ende angegeben werden"
#: cp/parser.c:22235
#, gcc-internal-format
msgid "stray %qs between Objective-C++ methods"
-msgstr ""
+msgstr "überflüssiges %qs zwischen Objective-C++ Methoden"
#: cp/parser.c:22440 cp/parser.c:22447 cp/parser.c:22454
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type for instance variable"
-msgstr "%Hungültiger Typ für Schleifenvariable %qE"
+msgstr "ungültiger Typ für Instanzvariable"
#: cp/parser.c:22567
#, gcc-internal-format
@@ -30139,32 +30127,32 @@ msgstr "Bezeichner nach %<@protocol%> erwartet"
#: cp/parser.c:22725
#, gcc-internal-format
msgid "attributes may not be specified before the %<@%D%> Objective-C++ keyword"
-msgstr ""
+msgstr "Attribute dürfen nicht vor dem Objective-C++-Schlüsselwort %<@%D%> angegeben werden"
#: cp/parser.c:22732
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "prefix attributes are ignored before %<@%D%>"
-msgstr "Attribut %qE ignoriert für %qE"
+msgstr "Präfix-Attribute vor %<@%D%> werden ignoriert"
#: cp/parser.c:23005 cp/parser.c:23012 cp/parser.c:23019
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type for property"
-msgstr "ungültiges Typargument"
+msgstr "ungültiger Typ für Eigenschaft"
#: cp/parser.c:24450
#, gcc-internal-format
msgid "parenthesized initialization is not allowed in OpenMP %<for%> loop"
-msgstr ""
+msgstr "geklammerte Initialisierung ist in OpenMP-%<for%>-Schleife nicht erlaubt"
#: cp/parser.c:24617 cp/pt.c:11905
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "iteration variable %qD should not be reduction"
-msgstr "Schleifenvariable %qs sollte nicht in Reduktion sein"
+msgstr "Schleifenvariable %qD sollte nicht Reduktion sein"
#: cp/parser.c:24685
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "not enough collapsed for loops"
-msgstr "zu wenig Typinformationen"
+msgstr "zu wenig zusammengefallen für Schleifen"
#: cp/parser.c:25145
#, gcc-internal-format
@@ -30197,9 +30185,9 @@ msgid "enclosing class templates are not explicitly specialized"
msgstr "einschließende Klassentemplates werden nicht explizit spezialisiert"
#: cp/pt.c:753
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "specialization of %qD must appear at namespace scope"
-msgstr "Spezialisierung von %qD in anderem Namensbereich"
+msgstr "Spezialisierung von %qD muss im Gültigkeitsbereich des Namensbereiches auftreten"
#: cp/pt.c:761
#, gcc-internal-format
@@ -30239,9 +30227,9 @@ msgid "specialization %qT after instantiation %qT"
msgstr "Spezialisierung %qT hinter Instanziierung %qT"
#: cp/pt.c:918
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "template specialization of %qD not allowed by ISO C++"
-msgstr "Teilspezialisierung %qD des Funktionstemplates ist nicht erlaubt"
+msgstr "Templatespezialisierung von %qD durch ISO C++ nicht erlaubt"
#: cp/pt.c:922
#, gcc-internal-format
@@ -30271,7 +30259,7 @@ msgstr "Template-ID %qD für %q+D passt zu keiner Templatedeklaration"
#: cp/pt.c:2023
#, gcc-internal-format
msgid "saw %d %<template<>%>, need %d for specializing a member function template"
-msgstr ""
+msgstr "%d %<template<>%> gefunden, %d werden für Spezialisierung eines Elementfunktionstemplates benötigt"
#: cp/pt.c:2032
#, gcc-internal-format
@@ -30364,9 +30352,9 @@ msgid "expansion pattern %<%E%> contains no argument packs"
msgstr "Auflösungsmuster %<%E%> enthält keine Argumentpacks"
#: cp/pt.c:3218
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "parameter packs not expanded with %<...%>:"
-msgstr "Parameterpacks nicht mit »...« aufgelöst:"
+msgstr "Parameterbündel nicht mit %<...%> aufgelöst:"
#: cp/pt.c:3233 cp/pt.c:4253
#, gcc-internal-format
@@ -30414,16 +30402,16 @@ msgid "template argument %qE involves template parameter(s)"
msgstr "Templateargument %qE betrifft Templateparameter"
#: cp/pt.c:4380
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qT of template argument %qE depends on a template parameter"
msgid_plural "type %qT of template argument %qE depends on template parameters"
-msgstr[0] "Typ %qT des Templatearguments %qE hängt von Templateparameter(n) ab"
-msgstr[1] "Typ %qT des Templatearguments %qE hängt von Templateparameter(n) ab"
+msgstr[0] "Typ %qT des Templatearguments %qE hängt von Templateparameter ab"
+msgstr[1] "Typ %qT des Templatearguments %qE hängt von Templateparametern ab"
#: cp/pt.c:4410
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "partial specialization of %qT after instantiation of %qT"
-msgstr "Spezialisierung %qT hinter Instanziierung %qT"
+msgstr "teilweise Spezialisierung von %qT hinter Instanziierung von %qT"
#: cp/pt.c:4503
#, gcc-internal-format
@@ -30441,29 +30429,29 @@ msgid "parameter pack %qT must be at the end of the template parameter list"
msgstr "Parameterpack %qT muss am Ende der Templateparameterliste sein"
#: cp/pt.c:4564
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "default template arguments may not be used in function template friend re-declaration"
-msgstr "Standardargumente sind nicht in Deklaration der friend-Template-Spezialisierung %qD erlaubt"
+msgstr "Standardtemplateargumente dürfen in friend-Redeklaration eines Funktionstemplates nicht verwendet werden"
#: cp/pt.c:4567
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "default template arguments may not be used in function template friend declarations"
-msgstr "Standardargumente sind nicht in Deklaration der friend-Template-Spezialisierung %qD erlaubt"
+msgstr "Standardtemplateargumente dürfen in friend-Deklaration eines Funktionstemplates nicht verwendet werden"
#: cp/pt.c:4570
#, gcc-internal-format
msgid "default template arguments may not be used in function templates without -std=c++0x or -std=gnu++0x"
-msgstr ""
+msgstr "Standardtemplateargumente dürfen in Funktionstemplates ohne -std=c++0x und -std=gnu++0x nicht verwendet werden"
#: cp/pt.c:4573
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "default template arguments may not be used in partial specializations"
-msgstr "nicht in partieller Spezialisierung verwendete Templateparameter:"
+msgstr "Standardtemplateargumente dürfen in teilweiser Spezialisierung nicht verwendet werden"
#: cp/pt.c:4576 cp/pt.c:4627
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "default argument for template parameter for class enclosing %qD"
-msgstr "Standardargument für Parameter des Typs %qT hat Typ %qT"
+msgstr "Standardargument für Template-Parameter für %qD umschließende Klasse"
#: cp/pt.c:4720
#, gcc-internal-format
@@ -30534,14 +30522,14 @@ msgid "template specifiers not specified in declaration of %qD"
msgstr "keine Templatespezifizierer in Deklaration von %qD angegeben"
#: cp/pt.c:5067
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "redeclared with %d template parameter"
msgid_plural "redeclared with %d template parameters"
-msgstr[0] "mit %d Template-Parameter(n) redeklariert"
-msgstr[1] "mit %d Template-Parameter(n) redeklariert"
+msgstr[0] "mit %d Template-Parameter redeklariert"
+msgstr[1] "mit %d Template-Parametern redeklariert"
#: cp/pt.c:5071
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration %q+D used %d template parameter"
msgid_plural "previous declaration %q+D used %d template parameters"
msgstr[0] "vorherige Deklaration %q+D verwendete %d Template-Parameter"
@@ -30567,9 +30555,9 @@ msgid "redefinition of default argument for %q#D"
msgstr "Redefinition des Standardarguments für %q#D"
#: cp/pt.c:5121
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "original definition appeared here"
-msgstr "%Jursprüngliche Definition trat hier auf"
+msgstr "ursprüngliche Definition trat hier auf"
#: cp/pt.c:5209
#, gcc-internal-format
@@ -30577,14 +30565,14 @@ msgid "%qE is not a valid template argument for type %qT because function %qD ha
msgstr "%qE ist kein gültiges Templateargument für Typ %qT, da die Funktion %qD keine externe Bindung hat"
#: cp/pt.c:5231 cp/pt.c:5571
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not a valid template argument for type %qT"
-msgstr "%qE ist kein gültiges Templateargument für Typ %qT, weil es ein Zeiger ist"
+msgstr "%qE ist kein gültiges Templateargument für Typ %qT"
#: cp/pt.c:5233
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "it must be a pointer-to-member of the form %<&X::Y%>"
-msgstr "es muss ein Zeiger auf ein Element der Form »&X::Y« sein"
+msgstr "es muss ein Zeiger auf ein Element der Form %<&X::Y%> sein"
#: cp/pt.c:5302
#, gcc-internal-format
@@ -30592,9 +30580,9 @@ msgid "%qE is not a valid template argument for type %qT because string literals
msgstr "%qE ist kein gültiges Templateargument für Typ %qT, da Zeichenkettensymbole in diesem Zusammenhang nicht verwendet werden können"
#: cp/pt.c:5403
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "in template argument for type %qT "
-msgstr "%qE ist kein gültiges Templateargument für Typ %qT, weil es ein Zeiger ist"
+msgstr "in Templateargument für Typ %qT"
#: cp/pt.c:5443
#, gcc-internal-format
@@ -30622,14 +30610,14 @@ msgid "%qE is not a valid template argument for type %qT because it is not an lv
msgstr "%qE ist kein gültiges Templateargument für Typ %qT, weil es kein L-Wert ist"
#: cp/pt.c:5522
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#D is not a valid template argument for type %qT because a reference variable does not have a constant address"
-msgstr "%qE ist kein gültiges Templateargument für Typ %qT, weil es kein konstanter Zeiger ist"
+msgstr "%q#D ist kein gültiges Templateargument für Typ %qT, weil eine Referenzvariable keine konstante Adresse hat"
#: cp/pt.c:5531
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not a valid template argument for type %qT because it is not an object with external linkage"
-msgstr "%qE ist kein gültiges Templateargument für Typ %qT, weil Objekt %qD keine externe Bindung hat"
+msgstr "%qE ist kein gültiges Templateargument für Typ %qT, weil es kein Objekt mit externer Bindung ist"
#: cp/pt.c:5539
#, gcc-internal-format
@@ -30662,9 +30650,9 @@ msgid "standard conversions are not allowed in this context"
msgstr "Standardumwandlungen sind in diesem Kontext nicht erlaubt"
#: cp/pt.c:5966
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "injected-class-name %qD used as template template argument"
-msgstr "Name der Klasse verdeckt Template-Templateparameter %qD"
+msgstr "eingegebener Klassenname %qD als Template-Templateargument verwendet"
#: cp/pt.c:5991
#, gcc-internal-format
@@ -30702,16 +30690,16 @@ msgid " expected a class template, got %qT"
msgstr " Klassentemplate erwartet, %qT erhalten"
#: cp/pt.c:6075
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " expected a template of type %qD, got %qT"
-msgstr " ein Template des Typs %qD erwartet, %qD erhalten"
+msgstr " ein Template des Typs %qD erwartet, %qT erhalten"
#. Not sure if this is reachable, but it doesn't hurt
#. to be robust.
#: cp/pt.c:6108
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type mismatch in nontype parameter pack"
-msgstr "Typ passt nicht in Komponentenreferenz"
+msgstr "Typ passt nicht in Nichttypen-Parameterbündel"
#: cp/pt.c:6130
#, gcc-internal-format
@@ -30724,9 +30712,9 @@ msgid "wrong number of template arguments (%d, should be %d)"
msgstr "falsche Anzahl der Templateargumente (%d, sollte %d sein)"
#: cp/pt.c:6336
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "wrong number of template arguments (%d, should be %d or more)"
-msgstr "falsche Anzahl der Templateargumente (%d, sollte %d sein)"
+msgstr "falsche Anzahl der Templateargumente (%d, sollte %d oder mehr sein)"
#: cp/pt.c:6344
#, gcc-internal-format
@@ -30759,9 +30747,9 @@ msgid "for template declaration %q+D"
msgstr "Für Template-Deklaration %q+D"
#: cp/pt.c:7486
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "template instantiation depth exceeds maximum of %d (use -ftemplate-depth= to increase the maximum) instantiating %qD"
-msgstr "Instanziierungstiefe für Templates überschreitet Höchstwert %d (-ftemplate-depth-NN verwenden, um dies zu erhöhen) bei Instanziierung von %qD"
+msgstr "Instanziierungstiefe für Templates überschreitet Höchstwert %d (-ftemplate-depth= verwenden, um dies zu erhöhen) bei Instanziierung von %qD"
#: cp/pt.c:8796
#, gcc-internal-format
@@ -30827,14 +30815,14 @@ msgid "forming reference to void"
msgstr "Referenz auf »void« wird gebildet"
#: cp/pt.c:10766
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "forming pointer to reference type %qT"
-msgstr "%s wird in Referenztyp %qT umgeformt"
+msgstr "Zeiger auf Referenztyp %qT wird geformt"
#: cp/pt.c:10768
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "forming reference to reference type %qT"
-msgstr "%s wird in Referenztyp %qT umgeformt"
+msgstr "Referenz auf Referenztyp %qT wird geformt"
#: cp/pt.c:10817
#, gcc-internal-format
@@ -30882,9 +30870,9 @@ msgid "use of %qs in template"
msgstr "Verwendung von %qs in Template"
#: cp/pt.c:11213
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "qualifying type %qT does not match destructor name ~%qT"
-msgstr "qualifizierter Typ %qT passt nicht zum Destruktornamen ~%qT"
+msgstr "qualifizierender Typ %qT passt nicht zum Destruktornamen ~%qT"
#: cp/pt.c:11228
#, gcc-internal-format
@@ -30987,9 +30975,9 @@ msgid "duplicate explicit instantiation of %q#D"
msgstr "doppelte explizite Instanziierung von %q#D"
#: cp/pt.c:16735 cp/pt.c:16827
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ISO C++ 1998 forbids the use of %<extern%> on explicit instantiations"
-msgstr "ISO-C++ verbietet die Verwendung von %<extern%> bei expliziten Instanziierungen"
+msgstr "ISO-C++ 1998 verbietet die Verwendung von %<extern%> bei expliziten Instanziierungen"
#: cp/pt.c:16740 cp/pt.c:16844
#, gcc-internal-format
@@ -31029,9 +31017,9 @@ msgid "explicit instantiation of %qD but no definition available"
msgstr "explizite Instanziierung von %qD, aber keine Definition verfügbar"
#: cp/pt.c:17537
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "template instantiation depth exceeds maximum of %d instantiating %q+D, possibly from virtual table generation (use -ftemplate-depth= to increase the maximum)"
-msgstr "Instanziierungstiefe für Templates überschreitet Höchstwert %d (-ftemplate-depth-NN verwenden, um dies zu erhöhen) bei Instanziierung von %q+D, möglicherweise von Erzeugung der virtuellen Tabelle"
+msgstr "Instanziierungstiefe für Templates überschreitet Höchstwert %d (-ftemplate-depth= verwenden, um dies zu erhöhen) bei Instanziierung von %q+D, möglicherweise von Erzeugung der virtuellen Tabelle"
#: cp/pt.c:17904
#, gcc-internal-format
@@ -31039,27 +31027,27 @@ msgid "%q#T is not a valid type for a template constant parameter"
msgstr "%q#T ist kein gültiger Typ für einen Templatekonstanten-Parameter"
#: cp/pt.c:18967
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "deducing from brace-enclosed initializer list requires #include <initializer_list>"
-msgstr "geklammerter Initialisierer zur Initialisierung von %qT verwendet"
+msgstr "Ermittlung aus geschweift geklammerter Initialisierungsliste erfordert #include <initializer_list>"
#: cp/pt.c:19020
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "variable %q#D with %<auto%> type used in its own initializer"
-msgstr "Variable %qD kann nicht initialisiert worden sein"
+msgstr "Variable %q#D mit %<auto%>-Typ in ihrer eigenen Initialisierung verwendet"
#. If type is error_mark_node a diagnostic must have been
#. emitted by now. Also, having a mention to '<type error>'
#. in the diagnostic is not really useful to the user.
#: cp/pt.c:19048
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unable to deduce %qT from %qE"
-msgstr "%qs kann nicht emuliert werden"
+msgstr "%qT kann nicht aus %qE hergeleitet werden"
#: cp/pt.c:19059
#, gcc-internal-format
msgid "inconsistent deduction for %qT: %qT and then %qT"
-msgstr ""
+msgstr "widersprüchliche Herleitung für %qT: %qT und dann %qT"
#: cp/repo.c:119
#, gcc-internal-format
@@ -31072,7 +31060,7 @@ msgid "mysterious repository information in %s"
msgstr "rätselhafte Repository-Information in %s"
#: cp/repo.c:227
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can%'t create repository information file %qs"
msgstr "Repository-Informationsdatei %qs kann nicht erzeugt werden"
@@ -31152,24 +31140,24 @@ msgid "conflicting type attributes specified for %q+#D"
msgstr "in Konflikt stehenden Typattribute für %q+#D angegeben"
#: cp/search.c:1912
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "deleted function %q+D"
-msgstr "Wiederholte using-Deklaration %q+D"
+msgstr "Funktion %q+D gelöscht"
#: cp/search.c:1913
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "overriding non-deleted function %q+D"
-msgstr "virtuelle Nicht-Klassen-Funktion %qs"
+msgstr "nicht gelöschte Funktion %q+D aufgehoben"
#: cp/search.c:1918
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-deleted function %q+D"
-msgstr "Aufruf der Nicht-Funktion %qD"
+msgstr "nicht gelöschte Funktion %q+D"
#: cp/search.c:1919
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "overriding deleted function %q+D"
-msgstr "überschatten der %s Funktion %q#D"
+msgstr "gelöschte Funktion %q+D aufgehoben"
#. A static member function cannot match an inherited
#. virtual member function.
@@ -31289,9 +31277,9 @@ msgid "base class %qT has cv qualifiers"
msgstr "Basisklasse %qT hat CV-Kennzeichner"
#: cp/semantics.c:2947 cp/semantics.c:8197
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is not captured"
-msgstr "%qD ist kein Typ"
+msgstr "%qD ist nicht aufgefangen"
#: cp/semantics.c:2953
#, gcc-internal-format
@@ -31304,9 +31292,9 @@ msgid " %q+#D declared here"
msgstr " %q+#D hier deklariert"
#: cp/semantics.c:2966
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of parameter %qD outside function body"
-msgstr "Verwendung eines Parameters aus enthaltender Funktion"
+msgstr "Verwendung des Parameters %qD außerhalb des Funktionskörpers"
#: cp/semantics.c:3003
#, gcc-internal-format
@@ -31360,14 +31348,14 @@ msgid "%qD appears more than once in data clauses"
msgstr "%qD tritt in Datenklausel mehrfach auf"
#: cp/semantics.c:3762
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is not a variable in clause %<firstprivate%>"
-msgstr "%qE ist in Klausel %<firstprivate%> keine Variable"
+msgstr "%qD ist in Klausel %<firstprivate%> keine Variable"
#: cp/semantics.c:3784
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is not a variable in clause %<lastprivate%>"
-msgstr "%qE ist in Klausel %<lastprivate%> keine Variable"
+msgstr "%qD ist in Klausel %<lastprivate%> keine Variable"
#: cp/semantics.c:3814
#, gcc-internal-format
@@ -31385,19 +31373,19 @@ msgid "%qE has reference type for %qs"
msgstr "%qE hat Referenztyp für %qs"
#: cp/semantics.c:4033
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<threadprivate%> %qD is not file, namespace or block scope variable"
-msgstr "%<threadprivate%> %qE ist nicht Datei-, Namens- oder Blockbereichsvariable"
+msgstr "%<threadprivate%> %qD ist nicht Datei-, Namens- oder Blockbereichsvariable"
#: cp/semantics.c:4047
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<threadprivate%> %qE directive not in %qT definition"
-msgstr "%<threadprivate%> %qE hat unvollständigen Typen"
+msgstr "Direktive %<threadprivate%> %qE nicht in Definition von %qT"
#: cp/semantics.c:4192
#, gcc-internal-format
msgid "difference between %qE and %qD does not have integer type"
-msgstr ""
+msgstr "Unterschied zwischen %qE und %qD hat keinen Ganzzahltyp"
#: cp/semantics.c:4722
#, gcc-internal-format
@@ -31417,7 +31405,7 @@ msgstr "%qE verweist auf eine Menge überladener Funktionen"
#: cp/semantics.c:4971
#, gcc-internal-format
msgid "unable to determine the declared type of expression %<%E%>"
-msgstr ""
+msgstr "deklarierter Typ des Ausdrucks %<%E%> kann nicht ermittelt werden"
#: cp/semantics.c:5238
#, gcc-internal-format
@@ -31432,217 +31420,217 @@ msgstr "unvollständiger Typ %qT nicht erlaubt"
#: cp/semantics.c:5355
#, gcc-internal-format
msgid "the type %qT of constexpr variable %qD is not literal"
-msgstr ""
+msgstr "der Typ %qT der Variable %qD als konstanter Ausdruck ist kein Literal"
#: cp/semantics.c:5434
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type for parameter %d of constexpr function %q+#D"
-msgstr "ungültige Verwendung des Elementes %q+D in statischer Elementfunktion"
+msgstr "ungültiger Typ für Parameter %d der Funktion %q+#D als konstantem Ausdruck"
#: cp/semantics.c:5445
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid return type %qT of constexpr function %q+D"
-msgstr "ungültiger abstrakter Rückgabetyp für Funktion %q+#D"
+msgstr "ungültiger Rückgabetyp %qT der Funktion %q+D als konstantem Ausdruck"
#: cp/semantics.c:5610
#, gcc-internal-format
msgid "constexpr constructor does not have empty body"
-msgstr ""
+msgstr "Konstruktor mit konstantem Ausdruck hat keinen leeren Körper"
#: cp/semantics.c:5690
#, gcc-internal-format
msgid "body of constexpr function %qD not a return-statement"
-msgstr ""
+msgstr "Körper der Funktion %qD mit konstantem Ausdruck ist keine Rückgabeanweisung"
#: cp/semantics.c:6029
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expression %qE does not designate a constexpr function"
-msgstr "»friend«-Deklaration benennt keine Klasse oder Funktion"
+msgstr "Ausdruck %qE bezeichnet keine Funktion mit konstantem Ausdruck"
#: cp/semantics.c:6043
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is not a constexpr function"
-msgstr "%qD ist keine Templatefunktion"
+msgstr "%qD ist keine Funktion mit konstantem Audruck"
#: cp/semantics.c:6070
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD used before its definition"
-msgstr "%q+D wurde vor seiner Definition ohne Prototyp verwendet"
+msgstr "%qD vor seiner Definition verwendet"
#: cp/semantics.c:6103
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "call has circular dependency"
-msgstr "Protokoll %qs hat ringförmige Abhängigkeit"
+msgstr "Aufruf hat ringförmige Abhängigkeit"
#: cp/semantics.c:6111
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "constexpr evaluation depth exceeds maximum of %d (use -fconstexpr-depth= to increase the maximum)"
-msgstr "Instanziierungstiefe für Templates überschreitet Höchstwert %d (-ftemplate-depth-NN verwenden, um dies zu erhöhen) bei Instanziierung von %qD"
+msgstr "Auswertungstiefe des konstanten Ausdrucks überschreitet Höchstwert %d (-fconstexpr-depth= verwenden, um dies zu erhöhen)"
#: cp/semantics.c:6189
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+E is not a constant expression"
-msgstr "Fehlender oder ungültiger Konstantenausdruck"
+msgstr "%q+E ist kein Konstantenausdruck"
#: cp/semantics.c:6322
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "array subscript out of bound"
-msgstr "%HFeldindex ist außerhalb der Feldgrenzen"
+msgstr "Feldindex ist außerhalb der Feldgrenzen"
#: cp/semantics.c:6368 cp/semantics.c:6417 cp/semantics.c:6923
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not a constant expression"
-msgstr "Fehlender oder ungültiger Konstantenausdruck"
+msgstr "%qE ist kein Konstantenausdruck"
#: cp/semantics.c:6382
#, gcc-internal-format
msgid "accessing %qD member instead of initialized %qD member in constant expression"
-msgstr ""
+msgstr "Zugriff auf Element %qD statt auf initialisiertes Element %qD in Konstantenausdruck"
#: cp/semantics.c:6801
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "accessing value of %qE through a %qT glvalue in a constant expression"
-msgstr "Fehlender oder ungültiger Konstantenausdruck"
+msgstr "auf Wert von %qE wird über ein %qT GL-Wert in Konstantenausdruck zugegriffen"
#: cp/semantics.c:6831
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the value of %qD is not usable in a constant expression"
-msgstr "Größe des Feldes %qD ist kein konstanter Ganzzahlausdruck"
+msgstr "der Wert von %qD ist in konstantem Ausdruck nicht verwendbar"
#: cp/semantics.c:6838
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD used in its own initializer"
-msgstr "Variable %qD kann nicht initialisiert worden sein"
+msgstr "%qD in seiner eigenen Initialisierung verwendet"
#: cp/semantics.c:6843
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#D is not const"
-msgstr "%q#T ist keine Klasse"
+msgstr "%q#D ist nicht konstant"
#: cp/semantics.c:6846
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#D is volatile"
-msgstr "%q+#D ist privat"
+msgstr "%q#D ist volatile"
#: cp/semantics.c:6849
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD was not initialized with a constant expression"
-msgstr "%qD kann nicht in Konstanten-Ausdruck auftreten"
+msgstr "%qD wurde nicht mit konstantem Ausdruck initialisiert"
#: cp/semantics.c:6858
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD was not declared %<constexpr%>"
-msgstr "%qD wurde in diesem Gültigkeitsbereich nicht definiert"
+msgstr "%qD wurde nicht als %<constexpr%> definiert"
#: cp/semantics.c:6861
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD does not have integral or enumeration type"
-msgstr "Ausdruck in new-Deklarator muss Ganzzahl- oder Aufzählungstyp haben"
+msgstr "%qD hat keinen Ganzzahl- oder Aufzählungstyp"
#: cp/semantics.c:7134 cp/semantics.c:7567
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conversion of expression %qE of pointer type cannot yield a constant expression"
-msgstr "Ausdruck %qE von abstraktem Klassentyp %qT kann nicht in throw-Ausdruck verwendet werden"
+msgstr "Umwandlung des Ausdrucks %qE mit Zeigertyp kann keinen konstanten Ausdruck ergeben"
#: cp/semantics.c:7188 cp/semantics.c:7658 cp/semantics.c:7889
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expression %qE is not a constant-expression"
-msgstr "Ganzzahlausdruck %qE ist nicht konstant"
+msgstr "Ausdruck %qE ist kein konstanter Ausdruck"
#: cp/semantics.c:7193
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unexpected expression %qE of kind %s"
-msgstr "Ausdruck erwartet"
+msgstr "unerwarteter Ausdruck %qE der Art %s"
#: cp/semantics.c:7400
#, gcc-internal-format
msgid "expression %qE has side-effects"
-msgstr ""
+msgstr "Ausdruck %qE hat Seiteneffekte"
#: cp/semantics.c:7449
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not a potential constant expression"
-msgstr "%s kann nicht in einem Konstanten-Ausdruck auftreten"
+msgstr "%qE ist kein potentieller konstanter Ausdruck"
#: cp/semantics.c:7473
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD is not %<constexpr%>"
-msgstr "%qD ist kein Typ"
+msgstr "%qD ist nicht %<constexpr%>"
#: cp/semantics.c:7489
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "object argument is not a potential constant expression"
-msgstr "Größe des Feldes ist kein konstanter Ganzzahlausdruck"
+msgstr "Objektargument ist kein potentieller konstanter Ausdruck"
#: cp/semantics.c:7510
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not a function name"
-msgstr "%qD ist kein Funktionstemplate"
+msgstr "%qE ist kein Funktionsname"
#: cp/semantics.c:7520
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument in position %qP is not a potential constant expression"
-msgstr "Größe des Feldes %qD ist kein konstanter Ganzzahlausdruck"
+msgstr "Argument in Position %qP ist kein potentieller konstanter Ausdruck"
#: cp/semantics.c:7590
#, gcc-internal-format
msgid "address-of an object %qE with thread local or automatic storage is not a constant expression"
-msgstr ""
+msgstr "Adresse eines Objektes %qE mit thread-lokalem oder automatischem Speicher ist kein konstanter Ausdruck"
#: cp/semantics.c:7621
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of the value of the object being constructed in a constant expression"
-msgstr "Größe des Feldes %qD ist kein konstanter Ganzzahlausdruck"
+msgstr "Verwendung des Wertes des konstruierten Objektes in konstantem Ausdruck"
#: cp/semantics.c:7670
#, gcc-internal-format
msgid "typeid-expression is not a constant expression because %qE is of polymorphic type"
-msgstr ""
+msgstr "Typeid-Ausdruck ist kein konstanter Ausdruck, da %qE polymorphen Typ hat"
#: cp/semantics.c:7683
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "difference of two pointer expressions is not a constant expression"
-msgstr "Größe des Feldes ist kein konstanter Ganzzahlausdruck"
+msgstr "Unterschied zweier Zeigerausdrücke ist kein konstanter Ausdruck"
#: cp/semantics.c:7702
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "pointer comparison expression is not a constant expression"
-msgstr "Ganzzahlausdruck %qE ist nicht konstant"
+msgstr "Zeigervergleichsausdruck ist kein konstanter Ausdruck"
#: cp/semantics.c:7792
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "division by zero is not a constant-expression"
-msgstr "Ganzzahlausdruck %qE ist nicht konstant"
+msgstr "Division durch Null ist kein konstanter Ausdruck"
#: cp/semantics.c:7897
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-constant array initialization"
-msgstr "nichtkonstanter Feldindex in Initialisierung"
+msgstr "nicht konstante Feldinitialisierung"
#: cp/semantics.c:7903
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "unexpected ast of kind %s"
-msgstr "nicht erwarteter Typ für »id« (%s)"
+msgstr "unerwarteter AST der Art %s"
#: cp/semantics.c:8073
#, gcc-internal-format
msgid "cannot deduce lambda return type from a braced-init-list"
-msgstr ""
+msgstr "Lambda-Rückgabetyp kann nicht aus Initialisierungsliste mit geschweiften Klammern hergeleitet werden"
#: cp/semantics.c:8243
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot capture %qE by reference"
-msgstr "Referenz auf %q#T kann nicht deklariert werden"
+msgstr "%qE kann nicht per Referenz aufgefangen werden"
#: cp/semantics.c:8266
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "already captured %<this%> in lambda expression"
-msgstr "ungültige Operanden in binärem Ausdruck"
+msgstr "%<this%> bereits in Lambda-Ausdruck aufgefangen"
#: cp/semantics.c:8397
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<this%> was not captured for this lambda function"
-msgstr "%<this%> ist für statische Elementfunktionen nicht verfügbar"
+msgstr "%<this%> wurde für diese Lambda-Funktion nicht aufgefangen"
#: cp/tree.c:988
#, gcc-internal-format
@@ -31695,49 +31683,49 @@ msgid "lang_* check: failed in %s, at %s:%d"
msgstr "Überprüfung von lang_*: in %s, bei %s:%d gescheitert"
#: cp/typeck.c:454
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "comparison between distinct pointer types %qT and %qT lacks a cast"
-msgstr "%s zwischen den verschiedenen Zeigertypen %qT und %qT benötigt Umwandlung"
+msgstr "Vergleich zwischen den unterschiedlichen Zeigertypen %qT und %qT benötigt Umwandlung"
#: cp/typeck.c:460
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conversion between distinct pointer types %qT and %qT lacks a cast"
-msgstr "%s zwischen den verschiedenen Zeigertypen %qT und %qT benötigt Umwandlung"
+msgstr "Umwandlung zwischen den unterschiedlichen Zeigertypen %qT und %qT benötigt Umwandlung"
#: cp/typeck.c:466
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conditional expression between distinct pointer types %qT and %qT lacks a cast"
-msgstr "%s zwischen den verschiedenen Zeigertypen %qT und %qT benötigt Umwandlung"
+msgstr "Bedingungsausdruck mit den unterschiedlichen Zeigertypen %qT und %qT benötigt Umwandlung"
#: cp/typeck.c:604
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ISO C++ forbids comparison between pointer of type %<void *%> and pointer-to-function"
-msgstr "ISO-C++ verbietet %s zwischen Zeiger des Typs %<void *%> und Zeiger auf Funktion"
+msgstr "ISO-C++ verbietet Vergleich zwischen Zeiger des Typs %<void *%> und Zeiger auf Funktion"
#: cp/typeck.c:609
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ISO C++ forbids conversion between pointer of type %<void *%> and pointer-to-function"
-msgstr "ISO-C++ verbietet %s zwischen Zeiger des Typs %<void *%> und Zeiger auf Funktion"
+msgstr "ISO-C++ verbietet Umwandlung zwischen Zeiger des Typs %<void *%> und Zeiger auf Funktion"
#: cp/typeck.c:614
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ISO C++ forbids conditional expression between pointer of type %<void *%> and pointer-to-function"
-msgstr "ISO-C++ verbietet %s zwischen Zeiger des Typs %<void *%> und Zeiger auf Funktion"
+msgstr "ISO-C++ verbietet Bedingungsausdruck mit Zeiger des Typs %<void *%> und Zeiger auf Funktion"
#: cp/typeck.c:681
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "comparison between distinct pointer-to-member types %qT and %qT lacks a cast"
-msgstr "%s zwischen verschiedenen Zeiger-auf-Element-Typen %qT und %qT fehlt eine Typkonvertierung"
+msgstr "beim Vergleich zwischen unterschiedlichen Zeiger-auf-Element-Typen %qT und %qT fehlt eine Typkonvertierung"
#: cp/typeck.c:686
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conversion between distinct pointer-to-member types %qT and %qT lacks a cast"
-msgstr "%s zwischen verschiedenen Zeiger-auf-Element-Typen %qT und %qT fehlt eine Typkonvertierung"
+msgstr "bei Umwandlung zwischen unterschiedlichen Zeiger-auf-Element-Typen %qT und %qT fehlt eine Typkonvertierung"
#: cp/typeck.c:691
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conditional expression between distinct pointer-to-member types %qT and %qT lacks a cast"
-msgstr "%s zwischen verschiedenen Zeiger-auf-Element-Typen %qT und %qT fehlt eine Typkonvertierung"
+msgstr "im Bedingungsausdruck mit unterschiedlichen Zeiger-auf-Element-Typen %qT und %qT fehlt eine Typkonvertierung"
#: cp/typeck.c:1378
#, gcc-internal-format
@@ -31805,14 +31793,14 @@ msgid "(perhaps the %<offsetof%> macro was used incorrectly)"
msgstr "(vielleicht wurde das Makro %<offsetof%> falsch verwendet)"
#: cp/typeck.c:2236
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid access to non-static data member %qD of NULL object"
msgstr "ungültiger Zugriff auf nicht-statisches Datenelement %qD des NULL-Objektes"
#: cp/typeck.c:2364
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "object type %qT does not match destructor name ~%qT"
-msgstr "qualifizierter Typ %qT passt nicht zum Destruktornamen ~%qT"
+msgstr "Objekttyp %qT passt nicht zum Destruktornamen ~%qT"
#: cp/typeck.c:2372
#, gcc-internal-format
@@ -31850,19 +31838,19 @@ msgid "%qT is not a pointer-to-object type"
msgstr "%qT ist kein Zeiger auf Objekt"
#: cp/typeck.c:2775
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of array indexing on pointer to member"
-msgstr "ungültige Verwendung von %qs bei Zeiger auf Element"
+msgstr "ungültige Verwendung von Feldindizierung bei Zeiger auf Element"
#: cp/typeck.c:2778
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of unary %<*%> on pointer to member"
-msgstr "ungültige Verwendung von %qs bei Zeiger auf Element"
+msgstr "ungültige Verwendung des unären %<*%> bei Zeiger auf Element"
#: cp/typeck.c:2781
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of implicit conversion on pointer to member"
-msgstr "ungültige Verwendung von %qs bei Zeiger auf Element"
+msgstr "ungültige Verwendung impliziter Umwandlung bei Zeiger auf Element"
#: cp/typeck.c:2816
#, gcc-internal-format
@@ -31895,9 +31883,9 @@ msgid "ISO C++ forbids calling %<::main%> from within program"
msgstr "ISO-C++ verbietet den Aufruf von %<::main%> vom Programm aus"
#: cp/typeck.c:3232
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "must use %<.*%> or %<->*%> to call pointer-to-member function in %<%E (...)%>, e.g. %<(... ->* %E) (...)%>"
-msgstr "%<.*%> oder %<->*%> muss verwendet werden, um Zeiger auf Element in %<%E (...)%> aufzurufen"
+msgstr "%<.*%> oder %<->*%> muss verwendet werden, um Zeiger auf Element als Funktion in %<%E (...)%> aufzurufen, z.B. %<(... ->* %E) (...)%>"
#: cp/typeck.c:3247
#, gcc-internal-format
@@ -31905,44 +31893,44 @@ msgid "%qE cannot be used as a function"
msgstr "%qE kann nicht als Funktion verwendet werden"
#: cp/typeck.c:3295
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many arguments to constructor %q#D"
-msgstr "zu viele Argumente für %s %q+#D"
+msgstr "zu viele Argumente für Konstruktor %q#D"
#: cp/typeck.c:3296
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too few arguments to constructor %q#D"
-msgstr "zu wenige Argumente für %s %q+#D"
+msgstr "zu wenige Argumente für Konstruktor %q#D"
#: cp/typeck.c:3301
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many arguments to member function %q#D"
-msgstr "zu viele Argumente für Funktion %qs"
+msgstr "zu viele Argumente für Elementfunktion %q#D"
#: cp/typeck.c:3302
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too few arguments to member function %q#D"
-msgstr "Zu wenige Argumente für Funktion %qs"
+msgstr "Zu wenige Argumente für Elementfunktion %q#D"
#: cp/typeck.c:3308
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many arguments to function %q#D"
-msgstr "zu viele Argumente für Funktion %qs"
+msgstr "zu viele Argumente für Funktion %q#D"
#: cp/typeck.c:3309
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too few arguments to function %q#D"
-msgstr "Zu wenige Argumente für Funktion %qs"
+msgstr "zu wenige Argumente für Funktion %q#D"
#: cp/typeck.c:3319
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many arguments to method %q#D"
-msgstr "zu viele Argumente für %s %q+#D"
+msgstr "zu viele Argumente für Methode %q#D"
#: cp/typeck.c:3320
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too few arguments to method %q#D"
-msgstr "zu wenige Argumente für %s %q+#D"
+msgstr "zu wenige Argumente für Methode %q#D"
#: cp/typeck.c:3323
#, gcc-internal-format
@@ -32042,14 +32030,14 @@ msgid "invalid use of a pointer to an incomplete type in pointer arithmetic"
msgstr "ungültige Verwendung eines Zeigers auf einen unvollständigen Typen in Zeigerarithmetik"
#: cp/typeck.c:4564
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "taking address of constructor %qE"
-msgstr "Adresse des Destruktors wird ermittelt"
+msgstr "Adresse des Konstruktors %qE wird genommen"
#: cp/typeck.c:4565
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "taking address of destructor %qE"
-msgstr "Adresse des Destruktors wird ermittelt"
+msgstr "Adresse des Destruktors %qE wird genommen"
#: cp/typeck.c:4579
#, gcc-internal-format
@@ -32084,9 +32072,9 @@ msgid "taking address of temporary"
msgstr "Adresse eines temporären Wertes wird ermittelt"
#: cp/typeck.c:4782
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "taking address of xvalue (rvalue reference)"
-msgstr "Adresse eines temporären Wertes wird ermittelt"
+msgstr "Adresse eines X-Wertes (R-Wert-Referenz) wird genommen"
#: cp/typeck.c:4799
#, gcc-internal-format
@@ -32154,19 +32142,19 @@ msgid "address requested for %qD, which is declared %<register%>"
msgstr "Adresse für %qD angefordert, was als %<register%> deklariert ist"
#: cp/typeck.c:5470
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expression list treated as compound expression in initializer"
-msgstr "%s Ausdrucksliste als zusammengesetzten Ausdruck behandelt"
+msgstr "Ausdrucksliste als zusammengesetzten Ausdruck in Initialisierung behandelt"
#: cp/typeck.c:5474
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expression list treated as compound expression in mem-initializer"
-msgstr "%s Ausdrucksliste als zusammengesetzten Ausdruck behandelt"
+msgstr "Ausdrucksliste als zusammengesetzten Ausdruck in Speicherinitialisierung behandelt"
#: cp/typeck.c:5478
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expression list treated as compound expression in functional cast"
-msgstr "%s Ausdrucksliste als zusammengesetzten Ausdruck behandelt"
+msgstr "Ausdrucksliste als zusammengesetzten Ausdruck in funktionaler Umwandlung behandelt"
#: cp/typeck.c:5512
#, gcc-internal-format, gfc-internal-format
@@ -32176,22 +32164,22 @@ msgstr "%s Ausdrucksliste als zusammengesetzten Ausdruck behandelt"
#: cp/typeck.c:5585
#, gcc-internal-format
msgid "no context to resolve type of %qE"
-msgstr ""
+msgstr "kein Kontext, um Typ von %qE aufzulösen"
#: cp/typeck.c:5616
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cast from type %qT to type %qT casts away qualifiers"
-msgstr "%s vom Typ %qT in Typ %qT entfernt Konstantheit"
+msgstr "Umwandlung des Typs %qT in Typ %qT entfernt Qualifizierer"
#: cp/typeck.c:5621
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "static_cast from type %qT to type %qT casts away qualifiers"
-msgstr "%s vom Typ %qT in Typ %qT entfernt Konstantheit"
+msgstr "static_cast des Typs %qT in Typ %qT entfernt Qualifizierer"
#: cp/typeck.c:5626
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "reinterpret_cast from type %qT to type %qT casts away qualifiers"
-msgstr "%s vom Typ %qT in Typ %qT entfernt Konstantheit"
+msgstr "reinterpret_cast des Typs %qT in Typ %qT entfernt Qualifizierer"
#: cp/typeck.c:5940
#, gcc-internal-format
@@ -32268,9 +32256,9 @@ msgid " in evaluation of %<%Q(%#T, %#T)%>"
msgstr " in Auswertung von %<%Q(%#T, %#T)%>"
#: cp/typeck.c:6714
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "assigning to an array from an initializer list"
-msgstr "nichtkonstanter Feldindex in Initialisierung"
+msgstr "Zuweisung an Feld von Initialisierungsliste"
#: cp/typeck.c:6726
#, gcc-internal-format
@@ -32313,59 +32301,59 @@ msgid "cannot convert %qT to %qT for argument %qP to %qD"
msgstr "%qT kann nicht nach %qT für Argument %qP nach %qD umgewandelt werden"
#: cp/typeck.c:7301
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qT to %qT in default argument"
-msgstr "%qT kann nicht nach %qT für Argument %qP nach %qD umgewandelt werden"
+msgstr "%qT kann nicht nach %qT im Standardargument umgewandelt werden"
#: cp/typeck.c:7305
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qT to %qT in argument passing"
-msgstr "%qT kann nicht nach %qT in %s umgewandelt werden"
+msgstr "%qT kann nicht nach %qT bei Argumentübergabe umgewandelt werden"
#: cp/typeck.c:7309
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qT to %qT"
-msgstr "%qT kann nicht nach %qT in %s umgewandelt werden"
+msgstr "%qT kann nicht nach %qT umgewandelt werden"
#: cp/typeck.c:7313
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qT to %qT in initialization"
-msgstr "%qT kann nicht nach %qT in %s umgewandelt werden"
+msgstr "%qT kann nicht nach %qT in Initialisierung umgewandelt werden"
#: cp/typeck.c:7317
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qT to %qT in return"
-msgstr "%qT kann nicht nach %qT in %s umgewandelt werden"
+msgstr "%qT kann nicht nach %qT in Rückgabe umgewandelt werden"
#: cp/typeck.c:7321
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qT to %qT in assignment"
-msgstr "%qT kann nicht nach %qT in %s umgewandelt werden"
+msgstr "%qT kann nicht nach %qT in Zuweisung umgewandelt werden"
#: cp/typeck.c:7344
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "parameter %qP of %qD might be a candidate for a format attribute"
-msgstr "Argument %d von %qE könnte Kandidat für Formatattribut sein"
+msgstr "Parameter %qP von %qD könnte Kandidat für Formatattribut sein"
#: cp/typeck.c:7348
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "parameter might be a candidate for a format attribute"
-msgstr "Rückgabetyp könnte Kandidat für Formatattribut sein"
+msgstr "Parameter könnte ein Kandidat für ein Formatattribut sein"
#: cp/typeck.c:7353
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "target of conversion might be a candidate for a format attribute"
-msgstr "Argument des Funktionsaufrufs könnte Kandidat für Formatattribut sein"
+msgstr "Ziel der Umwandlung könnte Kandidat ein für ein Formatattribut sein"
#: cp/typeck.c:7358
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "target of initialization might be a candidate for a format attribute"
-msgstr "Argument des Funktionsaufrufs könnte Kandidat für Formatattribut sein"
+msgstr "Ziel der Initialisierung könnte ein Kandidat für Formatattribut sein"
#: cp/typeck.c:7368
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "left-hand side of assignment might be a candidate for a format attribute"
-msgstr "Links-Zuweisung könnte Kandidat für Formatattribut sein"
+msgstr "linke Seite der Zuweisung könnte ein Kandidat für ein Formatattribut sein"
#: cp/typeck.c:7464 cp/typeck.c:7466
#, gcc-internal-format
@@ -32413,12 +32401,12 @@ msgstr "Rückgabe eines Wertes von einem Konstruktor"
#: cp/typeck.c:7611
#, gcc-internal-format
msgid "lambda return type can only be deduced when the return statement is the only statement in the function body"
-msgstr ""
+msgstr "Lambda-Rückgabetyp kann nur abgeleitet werden, wenn die Rückgabeanweisung die einzige Anweisung im Funktionskörper ist"
#: cp/typeck.c:7617
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "inconsistent types %qT and %qT deduced for lambda return type"
-msgstr "neue Typen dürfen nicht in einem Rückgabetyp definiert werden"
+msgstr "widersprüchliche Typen %qT und %qT für Lambda-Rückgabetypen hergeleitet"
#: cp/typeck.c:7643
#, gcc-internal-format
@@ -32439,12 +32427,12 @@ msgstr "%<operator new%> darf nicht NULL zurückgeben, außer es ist mit %<throw
#: cp/typeck.c:8267
#, gcc-internal-format
msgid "using temporary as lvalue"
-msgstr ""
+msgstr "temporärer Wert wird als L-Wert verwendet"
#: cp/typeck.c:8269
#, gcc-internal-format
msgid "using xvalue (rvalue reference) as lvalue"
-msgstr ""
+msgstr "X-Wert (R-Wert-Referenz) wird als L-Wert verwendet"
#: cp/typeck2.c:53
#, gcc-internal-format
@@ -32452,44 +32440,44 @@ msgid "type %qT is not a base type for type %qT"
msgstr "Typ %qT ist kein Basistyp für Typ %qT"
#: cp/typeck2.c:107
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "assignment of constant field %qD"
-msgstr "Zuweisung der schreibgeschützten Variable %qD"
+msgstr "Zuweisung des konstanten Feldes %qD"
#: cp/typeck2.c:109
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "constant field %qD used as %<asm%> output"
-msgstr "schreibgeschützte Variable %qD als %<asm%>-Ausgabe verwendet"
+msgstr "konstantes Feld %qD als %<asm%>-Ausgabe verwendet"
#: cp/typeck2.c:111
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "increment of constant field %qD"
-msgstr "Erhöhung der schreibgeschützten Variable %qD"
+msgstr "Erhöhung des konstanten Feldes %qD"
#: cp/typeck2.c:113
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "decrement of constant field %qD"
-msgstr "Verringerung der schreibgeschützten Variable %qD"
+msgstr "Verringerung des konstanten Feldes %qD"
#: cp/typeck2.c:120
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "assignment of read-only reference %qD"
-msgstr "Zuweisung des schreibgeschützten Elementes %qD"
+msgstr "Zuweisung der schreibgeschützten Referenz %qD"
#: cp/typeck2.c:122
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "read-only reference %qD used as %<asm%> output"
-msgstr "schreibgeschütztes Element %qD als %<asm%>-Ausgabe verwendet"
+msgstr "schreibgeschützte Referenz %qD als %<asm%>-Ausgabe verwendet"
#: cp/typeck2.c:124
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "increment of read-only reference %qD"
-msgstr "Erhöhung des schreibgeschützten Elementes %qD"
+msgstr "Erhöhung der schreibgeschützten Referenz %qD"
#: cp/typeck2.c:126
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "decrement of read-only reference %qD"
-msgstr "Verringerung des schreibgeschützten Elementes %qD"
+msgstr "Verringerung der schreibgeschützten Referenz %qD"
#: cp/typeck2.c:310
#, gcc-internal-format
@@ -32533,9 +32521,9 @@ msgid "cannot allocate an object of abstract type %qT"
msgstr "es kann kein Objekt des abstrakten Typs %qT belegt werden"
#: cp/typeck2.c:339
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " because the following virtual functions are pure within %qT:"
-msgstr "%J denn die folgenden virtuellen Funktionen sind rein innerhalb %qT:"
+msgstr " denn die folgenden virtuellen Funktionen sind rein innerhalb %qT:"
#: cp/typeck2.c:343
#, gcc-internal-format
@@ -32543,69 +32531,69 @@ msgid "\t%+#D"
msgstr "\t%+#D"
#: cp/typeck2.c:351
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " since type %qT has pure virtual functions"
-msgstr "%J denn der Typ %qT hat rein virtuelle Funktionen"
+msgstr " denn der Typ %qT hat rein virtuelle Funktionen"
#: cp/typeck2.c:381
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+D has incomplete type"
-msgstr "%qD hat unvollständigen Typen"
+msgstr "%q+D hat unvollständigen Typen"
#: cp/typeck2.c:394
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of incomplete type %q#T"
-msgstr "falsche Benutzung des unvollständigen typedef %qD"
+msgstr "falsche Benutzung des unvollständigen Typs %q#T"
#: cp/typeck2.c:397
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "forward declaration of %q+#T"
-msgstr "Deklaration von %q+#D"
+msgstr "Vorwärtsdeklaration von %q+#T"
#: cp/typeck2.c:400
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "declaration of %q+#T"
-msgstr "Deklaration von %q+#D"
+msgstr "Deklaration von %q+#T"
#: cp/typeck2.c:405
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of %qT"
-msgstr "ungültige Verwendung von %qD"
+msgstr "ungültige Verwendung von %qT"
#: cp/typeck2.c:421
#, gcc-internal-format
msgid "invalid use of member (did you forget the %<&%> ?)"
-msgstr ""
+msgstr "ungültige Verwendung eines Elements (%<&%> vergessen?)"
#: cp/typeck2.c:430
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of template type parameter %qT"
-msgstr "falsche Benutzung des unvollständigen typedef %qD"
+msgstr "ungültige Verwendung des Parameters %qT für Templatetyp"
#: cp/typeck2.c:435
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of template template parameter %qT"
-msgstr "ungültiges Standardargument für einen Template-Templateparameter"
+msgstr "ungültige Verwendung des Parameters %qT für Template-Templateparameter"
#: cp/typeck2.c:441
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of dependent type %qT"
-msgstr "falsche Benutzung des unvollständigen typedef %qD"
+msgstr "ungültige Verwendung des abhängigen Typen %qT"
#: cp/typeck2.c:450
#, gcc-internal-format
msgid "address of overloaded function with no contextual type information"
-msgstr ""
+msgstr "Adresse einer überladenen Funktion ohne Typinformationen aus Kontext"
#: cp/typeck2.c:454
#, gcc-internal-format
msgid "overloaded function with no contextual type information"
-msgstr ""
+msgstr "überladene Funktion ohne Typinformationen aus Kontext"
#: cp/typeck2.c:457
#, gcc-internal-format
msgid "insufficient contextual information to determine type"
-msgstr ""
+msgstr "unzureichende Informationen für Typbestimmung aus Kontext"
#: cp/typeck2.c:646
#, gcc-internal-format
@@ -32618,9 +32606,9 @@ msgid "cannot initialize arrays using this syntax"
msgstr "mit dieser Syntax können keine Felder initialisiert werden"
#: cp/typeck2.c:768
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "narrowing conversion of %qE from %qT to %qT inside { }"
-msgstr "Umwandlung von %qE von %qT nach %qT ist mehrdeutig"
+msgstr "verengende Umwandlung von %qE von %qT nach %qT in { }"
#: cp/typeck2.c:826
#, gcc-internal-format
@@ -32628,9 +32616,9 @@ msgid "int-array initialized from non-wide string"
msgstr "int-Feld mit Nicht-wide-Zeichenkette initialisiert"
#: cp/typeck2.c:831
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "int-array initialized from incompatible wide string"
-msgstr "int-Feld mit Nicht-wide-Zeichenkette initialisiert"
+msgstr "Ganzzahlfeld mit unverträglicher wide-Zeichenkette initialisiert"
#: cp/typeck2.c:846
#, gcc-internal-format
@@ -32718,9 +32706,9 @@ msgid "pointer to member type %qT incompatible with object type %qT"
msgstr "Zeiger auf Elementtyp %qT mit Objekttyp %qT inkompatibel"
#: cp/typeck2.c:1530
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid value-initialization of reference type"
-msgstr "Wert-Initialisierung von Referenz"
+msgstr "ungültige Wert-Initialisierung von Referenztyp"
#: cp/typeck2.c:1732
#, gcc-internal-format
@@ -32735,7 +32723,7 @@ msgstr "Aufruf einer Funktion, die unvollständigen Typen %q#T wirft"
#: fortran/arith.c:46
#, gcc-internal-format, gfc-internal-format
msgid "Conversion of an Infinity or Not-a-Number at %L to INTEGER"
-msgstr ""
+msgstr "Umwandlung einer Unendlichkeit oder NaN bei %L in INTEGER"
#: fortran/arith.c:905 fortran/arith.c:927
#, gcc-internal-format, gfc-internal-format
@@ -32745,7 +32733,7 @@ msgstr "Fortran 2003: Nichtganzzahliger Exponent in einem Initialisierungsausdru
#: fortran/arith.c:913
#, gcc-internal-format, gfc-internal-format
msgid "Raising a negative REAL at %L to a REAL power is prohibited"
-msgstr ""
+msgstr "Erhöhung eines negativen REAL bei %L zu einer REAL-Potenz ist verboten"
#: fortran/arith.c:1909
#, gcc-internal-format, gfc-internal-format
@@ -32758,14 +32746,14 @@ msgid "Arithmetic overflow converting %s to %s at %L. This check can be disabled
msgstr "Arithmetischer Überlauf bei Umwandlung von %s in %s bei %L. Diese Überprüfung kann mit der Option -fno-range-check ausgeschaltet werden"
#: fortran/arith.c:1918
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Arithmetic underflow converting %s to %s at %L. This check can be disabled with the option -fno-range-check"
-msgstr "Arithmetischer Überlauf bei Umwandlung von %s in %s bei %L. Diese Überprüfung kann mit der Option -fno-range-check ausgeschaltet werden"
+msgstr "Arithmetischer Unterlauf bei Umwandlung von %s in %s bei %L. Diese Überprüfung kann mit der Option -fno-range-check ausgeschaltet werden"
#: fortran/arith.c:1923
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Arithmetic NaN converting %s to %s at %L. This check can be disabled with the option -fno-range-check"
-msgstr "Arithmetischer Überlauf bei Umwandlung von %s in %s bei %L. Diese Überprüfung kann mit der Option -fno-range-check ausgeschaltet werden"
+msgstr "Arithmetisches NaN bei Umwandlung von %s in %s bei %L. Diese Überprüfung kann mit der Option -fno-range-check ausgeschaltet werden"
#: fortran/arith.c:1928
#, gcc-internal-format, gfc-internal-format
@@ -32793,14 +32781,14 @@ msgid "Expected array subscript at %C"
msgstr "Feldindex erwartet bei %C"
#: fortran/array.c:106
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Unexpected '*' in coarray subscript at %C"
-msgstr "Feldindex erwartet bei %C"
+msgstr "Unerwartetes '*' in Coarray-Index bei %C"
#: fortran/array.c:130
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Strides not allowed in coarray subscript at %C"
-msgstr "Feldindex erwartet bei %C"
+msgstr "Schrittweiten in Coarray-Index bei %C nicht erlaubt"
#: fortran/array.c:138
#, gcc-internal-format, gfc-internal-format
@@ -32822,32 +32810,32 @@ msgstr "Feldreferenz bei %C kann nicht mehr als %d Dimensionen haben"
#: fortran/match.c:1758 fortran/match.c:2339 fortran/simplify.c:4590
#, gcc-internal-format, gfc-internal-format
msgid "Coarrays disabled at %C, use -fcoarray= to enable"
-msgstr ""
+msgstr "Coarray bei %C ausgeschaltet, -fcoarray= zum Einschalten verwenden"
#: fortran/array.c:221
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Unexpected coarray designator at %C"
-msgstr "Feldindex erwartet bei %C"
+msgstr "Unerwarteter Coarray-Bezeichner bei %C"
#: fortran/array.c:236
#, gcc-internal-format, gfc-internal-format
msgid "Too few codimensions at %C, expected %d not %d"
-msgstr ""
+msgstr "Zu wenige Codimensionen bei %C, %d statt %d erwartet"
#: fortran/array.c:246
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Unexpected '*' for codimension %d of %d at %C"
-msgstr "Andere Dimension in Felddeklaration bei %C erwartet"
+msgstr "Unerwartetes '*' für Codimension %d von %d bei %C"
#: fortran/array.c:249
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Invalid form of coarray reference at %C"
-msgstr "Ungültige Form der Feldreferenz bei %C"
+msgstr "Ungültige Form der Coarray-Referenz bei %C"
#: fortran/array.c:254
#, gcc-internal-format, gfc-internal-format
msgid "Invalid codimension %d at %C, only %d codimensions exist"
-msgstr ""
+msgstr "Ungültige Codimension %d bei %C, nur %d Codimensionen existieren"
#: fortran/array.c:306
#, gcc-internal-format, gfc-internal-format
@@ -32855,9 +32843,9 @@ msgid "Variable '%s' at %L in this context must be constant"
msgstr "Variable »%s« bei %L muss in diesem Kontext eine Konstante sein"
#: fortran/array.c:309
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Expression at %L in this context must be constant"
-msgstr "Variable »%s« bei %L muss in diesem Kontext eine Konstante sein"
+msgstr "Ausdruck bei %L muss in diesem Kontext eine Konstante sein"
#: fortran/array.c:400
#, gcc-internal-format, gfc-internal-format
@@ -32865,7 +32853,7 @@ msgid "Expected expression in array specification at %C"
msgstr "Erwarteter Ausdruck in Feldspezifikation bei %C"
#: fortran/array.c:479
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Bad array specification for implied-shape array at %C"
msgstr "Falsche Feldangabe für Feld mit implizit gebildeter Form bei %C"
@@ -32877,7 +32865,7 @@ msgstr "Falsche Feldangabe für Feld mit explizit gebildeter Form bei %C"
#: fortran/array.c:505 fortran/array.c:610
#, gcc-internal-format, gfc-internal-format
msgid "Bad array specification for assumed shape array at %C"
-msgstr "Falsche Feldangabe für Feld mit implizit gebildeter Form bei %C"
+msgstr "Falsche Feldangabe für Feld mit durch Vermutung gebildeter Form bei %C"
#: fortran/array.c:519 fortran/array.c:624
#, gcc-internal-format, gfc-internal-format
@@ -32900,19 +32888,19 @@ msgid "Array specification at %C has more than %d dimensions"
msgstr "Feldspezifikation bei %C hat mehr als %d Dimensionen"
#: fortran/array.c:550
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2008: Array specification at %C with more than 7 dimensions"
-msgstr "Feldspezifikation bei %C hat mehr als %d Dimensionen"
+msgstr "Fortran 2008: Feldspezifikation bei %C mit mehr als 7 Dimensionen"
#: fortran/array.c:563
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2008: Coarray declaration at %C"
-msgstr "Fortran 2003: Feldkonstruktoren im [...]-Stil bei %C"
+msgstr "Fortran 2008: Coarray-Deklaration bei %C"
#: fortran/array.c:651
#, gcc-internal-format, gfc-internal-format
msgid "Upper bound of last coarray dimension must be '*' at %C"
-msgstr ""
+msgstr "Obere Grenze der letzten Coarray-Dimension muss '*' bei %C sein"
#: fortran/array.c:871
#, gcc-internal-format, gfc-internal-format
@@ -32930,14 +32918,14 @@ msgid "Fortran 2003: [...] style array constructors at %C"
msgstr "Fortran 2003: Feldkonstruktoren im [...]-Stil bei %C"
#: fortran/array.c:1035
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2003: Array constructor including type specification at %C"
-msgstr "Fortran 2003: Feldkonstruktoren im [...]-Stil bei %C"
+msgstr "Fortran 2003: Feldkonstruktor mit Typspezifikation bei %C"
#: fortran/array.c:1041 fortran/match.c:2895
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Type-spec at %L cannot contain a deferred type parameter"
-msgstr "Feld »%s« bei %L kann keine aufgeschobene Form haben"
+msgstr "Typspezifikation bei %L kann keine Parameter mit aufgeschobenem Typ haben"
#: fortran/array.c:1057
#, gcc-internal-format, gfc-internal-format
@@ -32962,9 +32950,9 @@ msgid "The number of elements in the array constructor at %L requires an increas
msgstr ""
#: fortran/array.c:1802
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Different CHARACTER lengths (%d/%d) in array constructor at %L"
-msgstr "Element in Feldkonstruktor %s bei %L ist %s"
+msgstr "Unterschiedliche CHARACTER-Längen (%d, %d) in Feldkonstruktor bei %L"
#: fortran/check.c:45
#, gcc-internal-format, gfc-internal-format
@@ -33012,9 +33000,9 @@ msgid "'%s' argument of '%s' intrinsic at %L must be double precision"
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss doppelte Genauigkeit haben"
#: fortran/check.c:236
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Expected coarray variable as '%s' argument to the %s intrinsic at %L"
-msgstr "Fehlende Argumente für intrinsisches %s bei %L"
+msgstr "Coarray-Variable als Argument '%s' für intrinsisches %s bei %L erwartet"
#: fortran/check.c:253
#, gcc-internal-format, gfc-internal-format
@@ -33027,29 +33015,29 @@ msgid "'%s' argument of '%s' intrinsic at %L must be an array"
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss ein Feld sein"
#: fortran/check.c:292
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' at %L must be nonnegative"
-msgstr "Markierung %s bei %L muss vom Typ %s sein"
+msgstr "'%s' bei %L muss nichtnegativ sein"
#: fortran/check.c:318
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' at %L must be less than or equal to BIT_SIZE('%s')"
-msgstr "Argument von LOG bei %L kann nicht kleiner oder gleich Null sein"
+msgstr "'%s' bei %L muss kleiner oder gleich BIT_SIZE('%s') sein"
#: fortran/check.c:328
#, gcc-internal-format, gfc-internal-format
msgid "'%s' at %L must be less than BIT_SIZE('%s')"
-msgstr ""
+msgstr "'%s' bei %L muss kleiner als BIT_SIZE('%s') sein"
#: fortran/check.c:355
#, gcc-internal-format, gfc-internal-format
msgid "'%s' at %L must be less than or equal to the BIT_SIZE of INTEGER(KIND=%d)"
-msgstr ""
+msgstr "'%s' bei %L muss kleiner oder gleich der BIT_SIZE von INTEGER(KIND=%d) sein"
#: fortran/check.c:381
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s + %s' at %L must be less than or equal to BIT_SIZE('%s')"
-msgstr "Argument von LOG bei %L kann nicht kleiner oder gleich Null sein"
+msgstr "'%s + %s' bei %L muss kleiner oder gleich BIT_SIZE('%s') sein"
#: fortran/check.c:399
#, gcc-internal-format, gfc-internal-format
@@ -33087,9 +33075,9 @@ msgid "'%s' argument of '%s' intrinsic at %L must be a variable"
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss eine Variable sein"
#: fortran/check.c:553
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'dim' argument of '%s' intrinsic at %L is not a valid codimension index"
-msgstr "Argument »dim« des intrinsischen »%s« bei %L ist kein gültiger Dimensionsindex"
+msgstr "Argument »dim« des intrinsischen »%s« bei %L ist kein gültiger Codimensionsindex"
#: fortran/check.c:599
#, gcc-internal-format, gfc-internal-format
@@ -33097,9 +33085,9 @@ msgid "'dim' argument of '%s' intrinsic at %L is not a valid dimension index"
msgstr "Argument »dim« des intrinsischen »%s« bei %L ist kein gültiger Dimensionsindex"
#: fortran/check.c:697
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Unequal character lengths (%ld/%ld) in %s at %L"
-msgstr "Ungleiche Zeichenlängen (%ld und %ld) in intrinsischem %s bei %L"
+msgstr "Ungleiche Zeichenlängen (%ld, %ld) in %s bei %L"
#: fortran/check.c:819 fortran/check.c:4830
#, gcc-internal-format, gfc-internal-format
@@ -33138,9 +33126,9 @@ msgid "NULL pointer at %L is not permitted as actual argument of '%s' intrinsic
msgstr "NULL-Zeiger bei %L ist nicht als effektives Argument der intrinsischen Funktion »%s« erlaubt"
#: fortran/check.c:963
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Extension: Negative argument N at %L"
-msgstr "Erweiterung: Argumentlistenfunktion bei %C"
+msgstr "Erweiterung: Negatives Argument N bei %L"
#: fortran/check.c:1135 fortran/check.c:1294
#, gcc-internal-format, gfc-internal-format
@@ -33148,9 +33136,9 @@ msgid "'%s' argument of '%s' intrinsic at %L must not be present if 'x' is COMPL
msgstr "Argument »%s« des intrinsischen »%s« bei %L darf nicht vorhanden sein, wenn »x« COMPLEX ist"
#: fortran/check.c:1144 fortran/check.c:1303
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' argument of '%s' intrinsic at %L must have a type of either REAL or INTEGER"
-msgstr "Argument »%s« des intrinsischen »%s« bei %L muss vom Typ REAL oder COMPLEX sein"
+msgstr "»%s« Argument des intrinsischen »%s« bei %L muss vom Typ REAL oder INTEGER sein"
#: fortran/check.c:1188 fortran/check.c:1702 fortran/check.c:1805
#: fortran/check.c:1961 fortran/check.c:2006 fortran/check.c:3146
@@ -33161,14 +33149,14 @@ msgid "Fortran 2003: '%s' intrinsic with KIND argument at %L"
msgstr "Fortran 2003: intrinsisches »%s« mit KIND-Argument bei %L"
#: fortran/check.c:1235 fortran/check.c:1468
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' argument of '%s' intrinsic at %L has invalid shape in dimension %d (%ld/%ld)"
-msgstr "Argument »dim« des intrinsischen »%s« bei %L ist kein gültiger Dimensionsindex"
+msgstr "Argument »%s« des intrinsischen »%s« bei %L hat ungültige Form in Dimension %d (%ld/%ld)"
#: fortran/check.c:1250 fortran/check.c:1483 fortran/check.c:1511
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' argument of intrinsic '%s' at %L of must have rank %d or be a scalar"
-msgstr "Argument »%s« des intrinsischen »%s« bei %L muss ein Skalar sein"
+msgstr "Argument »%s« des intrinsischen »%s« bei %L muss Rang %d haben oder ein Skalar sein"
#: fortran/check.c:1353 fortran/check.c:2265 fortran/check.c:2273
#, gcc-internal-format, gfc-internal-format
@@ -33186,14 +33174,14 @@ msgid "'%s' argument of '%s' intrinsic at %L must be default real"
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss ein Standard-Real sein"
#: fortran/check.c:1529
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "GNU extension: non-default INTEGER kind argument to %s intrinsic at %L"
-msgstr "Fehlende Argumente für intrinsisches %s bei %L"
+msgstr "GNU-Erweiterung: Nicht-Standard Argument der Art INTEGER für intrinsisches »%s« bei %L"
#: fortran/check.c:1589
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2008: COMPLEX argument '%s' argument of '%s' intrinsic at %L"
-msgstr "Argument »%s« des intrinsischen »%s« bei %L muss %s sein"
+msgstr "Fortran 2008: COMPLEX-Argument »%s« des intrinsischen »%s« bei %L"
#: fortran/check.c:1753
#, gcc-internal-format, gfc-internal-format
@@ -34468,7 +34456,6 @@ msgstr "MODULE PROCEDURE bei %C muss in einer generischen Modulschnittstelle sei
#: fortran/decl.c:7042
#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Fortran 2003: PROCEDURE statement at %C"
msgid "Fortran 2008: double colon in MODULE PROCEDURE statement at %L"
msgstr "Fortran 2003: PROCEDURE-Anweisung bei %C"
@@ -35389,7 +35376,6 @@ msgstr ""
#: fortran/interface.c:1133
#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Extension: Conversion from %s to %s at %L"
msgid "Extension: Internal procedure '%s' in %s at %L"
msgstr "Erweiterung: Umwandlung von %s in %s bei %L"
@@ -37894,7 +37880,6 @@ msgstr "Fortran 2003: BOZ außerhalb einer DATA-Anweisung bei %C verwendet"
#: fortran/primary.c:547 fortran/primary.c:551
#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Extension: Hollerith constant at %C"
msgid "Extension: exponent-letter 'q' in real-literal-constant at %C"
msgstr "Erweiterung: Hollerithkonstante bei %C"
@@ -37915,7 +37900,6 @@ msgstr "Realzahl bei %C hat einen »q«-Exponenten und eine explizite Art"
#: fortran/primary.c:647
#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Invalid initializer %s in Data statement at %C"
msgid "Invalid exponent-letter 'q' in real-literal-constant at %C"
msgstr "Ungültige Initialisierung %s in Data-Anweisung bei %C"
@@ -39947,46 +39931,46 @@ msgid "The pointer component '%s' of '%s' at %L is a type that has not been decl
msgstr "Die Zeigerkomponente »%s« bei »%s« bei %L hat nicht deklarierten Typ"
#: fortran/resolve.c:11724
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Component '%s' with CLASS at %L must be allocatable or pointer"
-msgstr "Komponente »%s« von »%s« bei %L muss konstante Feldgrenzen haben"
+msgstr "Komponente »%s« mit CLASS bei %L muss allozierbar oder Zeiger sein"
#: fortran/resolve.c:11779
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Assumed size array '%s' in namelist '%s' at %L is not allowed"
-msgstr "Feld »%s« mit vermuteter Größe in Namensliste »%s« bei %C ist nicht erlaubt"
+msgstr "Feld »%s« mit vermuteter Größe in Namensliste »%s« bei %L ist nicht erlaubt"
#: fortran/resolve.c:11785
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2003: NAMELIST array object '%s' with assumed shape in namelist '%s' at %L"
-msgstr "NAMELIST-Feldobjekt »%s« darf in Namensliste »%s« bei %L keine vermutete Form haben"
+msgstr "Fortran 2003: NAMELIST-Feldobjekt »%s« mit vermuteter Form in Namensliste »%s« bei %L"
#: fortran/resolve.c:11792
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2003: NAMELIST array object '%s' with nonconstant shape in namelist '%s' at %L"
-msgstr "NAMELIST-Feldobjekt »%s« muss konstante Form in Namensliste »%s« bei %L haben"
+msgstr "Fortran 2003: NAMELIST-Feldobjekt »%s« ohne konstante Form in Namensliste »%s« bei %L"
#: fortran/resolve.c:11801
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2003: NAMELIST object '%s' with nonconstant character length in namelist '%s' at %L"
-msgstr "NAMELIST-Feldobjekt »%s« muss konstante Form in Namensliste »%s« bei %L haben"
+msgstr "Fortran 2003: NAMELIST-Objekt »%s« ohne konstante Zeichenlänge in Namensliste »%s« bei %L"
#: fortran/resolve.c:11811
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "NAMELIST object '%s' in namelist '%s' at %L is polymorphic and requires a defined input/output procedure"
-msgstr "Namenslistenobjekt »%s« in Namensliste »%s« bei %L kann keine POINTER-Komponenten haben"
+msgstr "NAMELIST-Objekt »%s« in Namensliste »%s« bei %L ist polymorph und erfordert eine definierte Ein-/Ausgabeprozedur"
#: fortran/resolve.c:11821
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2003: NAMELIST object '%s' in namelist '%s' at %L with ALLOCATABLE or POINTER components"
-msgstr "NAMELIST-Objekt »%s« in Namensliste »%s« bei %L kann nicht ALLOCATABLE-Komponenten haben"
+msgstr "Fortran 2003: NAMELIST-Objekt »%s« in Namensliste »%s« bei %L mit ALLOCATABLE- oder POINTER-Komponenten"
#. FIXME: Once UDDTIO is implemented, the following can be
#. removed.
#: fortran/resolve.c:11829
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "NAMELIST object '%s' in namelist '%s' at %L has ALLOCATABLE or POINTER components and thus requires a defined input/output procedure"
-msgstr "NAMELIST-Objekt »%s« in Namensliste »%s« bei %L kann nicht ALLOCATABLE-Komponenten haben"
+msgstr "NAMELIST-Objekt »%s« in Namensliste »%s« bei %L hat ALLOCATABLE- oder POINTER-Komponenten und erfordert daher eine definierte Ein-/Ausgabeprozedur"
#: fortran/resolve.c:11846
#, gcc-internal-format, gfc-internal-format
@@ -40024,19 +40008,19 @@ msgid "Incompatible derived type in PARAMETER at %L"
msgstr "Unverträglicher abgeleiteter Typ in PARAMETER bei %L"
#: fortran/resolve.c:12003
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PROTECTED attribute conflicts with EXTERNAL attribute at %L"
-msgstr "Attribut PROCEDURE steht mit Attribut NAMELIST in »%s« bei %L in Konflikt"
+msgstr "Attribut PROTECTED steht mit Attribut EXTERNAL bei %L in Konflikt"
#: fortran/resolve.c:12006
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PROCEDURE attribute conflicts with PROTECTED attribute at %L"
-msgstr "Attribut PROCEDURE steht mit Attribut NAMELIST in »%s« bei %L in Konflikt"
+msgstr "Attribut PROCEDURE steht mit Attribut PROTECTED bei %L in Konflikt"
#: fortran/resolve.c:12018
#, gcc-internal-format, gfc-internal-format
msgid "'%s' at %L has the CONTIGUOUS attribute but is not an array pointer or an assumed-shape array"
-msgstr ""
+msgstr "»%s« bei %L hat Attribut CONTIGUOUS, aber ist kein Feldzeiger oder Feld vermuteter Größe"
#: fortran/resolve.c:12092
#, gcc-internal-format, gfc-internal-format
@@ -40089,34 +40073,34 @@ msgid "The INTENT(OUT) dummy argument '%s' at %L is ASSUMED SIZE and so cannot h
msgstr "Das INTENT(OUT)-Scheinargument »%s« bei %L hat vermutete Größe und kann damit keine Standardinitialisierung haben"
#: fortran/resolve.c:12282
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Function result '%s' at %L shall not be a coarray or have a coarray component"
-msgstr "Funktionsergebnis »%s« bei %L kann keine Initialisierung haben"
+msgstr "Funktionsergebnis »%s« bei %L sollte kein Koarray sein oder Koarray-Komponente haben"
#: fortran/resolve.c:12288
#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L of TYPE(C_PTR) or TYPE(C_FUNPTR) shall not be a coarray"
-msgstr ""
+msgstr "Variable »%s« bei %L mit TYPE(C_PTR) oder TYPE(C_FUNPTR) sollte kein Koarray sein"
#: fortran/resolve.c:12295
#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L with coarray component shall be a nonpointer, nonallocatable scalar"
-msgstr ""
+msgstr "Variable »%s« bei %L mit Koarraykomponente sollte ein Nichtzeiger, nichtallozierbares Skalar sein"
#: fortran/resolve.c:12306
#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L is a coarray or has a coarray component and is not ALLOCATABLE, SAVE nor a dummy argument"
-msgstr ""
+msgstr "Variable »%s« bei %L ist ein Koarray oder hat eine Koarraykomponente und ist weder ALLOCATABLE, SAVE, noch ein Scheinargument"
#: fortran/resolve.c:12312
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Coarray variable '%s' at %L shall not have codimensions with deferred shape"
-msgstr "Feld »%s« bei %L kann keine aufgeschobene Form haben"
+msgstr "Koarray-Variable »%s« bei %L sollte keine Kodimensionen mit aufgeschobener Form haben"
#: fortran/resolve.c:12316
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Allocatable coarray variable '%s' at %L must have deferred shape"
-msgstr "Zuordnungsfähiges Feld »%s« bei %L muss aufgeschobene Form haben"
+msgstr "Zuordnungsfähige Koarray-Variable »%s« bei %L muss aufgeschobene Form haben"
#: fortran/resolve.c:12324
#, gcc-internal-format, gfc-internal-format
@@ -41820,43 +41804,43 @@ msgid "'readonly' attribute of property %qD conflicts with previous declaration"
msgstr "Datenabschnitt von %q+D in Konflikt mit vorheriger Deklaration"
#: objc/objc-act.c:1192
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type of property %qD conflicts with previous declaration"
-msgstr "Datenabschnitt von %q+D in Konflikt mit vorheriger Deklaration"
+msgstr "Typ der Eigenschaft %qD in Konflikt mit vorheriger Deklaration"
#: objc/objc-act.c:1665
#, gcc-internal-format
msgid "the dot syntax is not available in Objective-C 1.0"
-msgstr ""
+msgstr "in Objective-C 1.0 gibt es keine Dot-Syntax"
#. We know that 'class_name' is an Objective-C class name as the
#. parser won't call this function if it is not. This is only a
#. double-check for safety.
#: objc/objc-act.c:1681
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "could not find class %qE"
-msgstr "Klasse »%s« kann nicht gefunden werden"
+msgstr "Klasse %qE kann nicht gefunden werden"
#. Again, this should never happen, but we do check.
#: objc/objc-act.c:1689
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "could not find interface for class %qE"
-msgstr "Datei für Klasse %s kann nicht gefunden werden"
+msgstr "Schnittstelle für Klasse %qE kann nicht gefunden werden"
#: objc/objc-act.c:1695 objc/objc-act.c:6583 objc/objc-act.c:6714
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "class %qE is deprecated"
-msgstr "%qs ist veraltet"
+msgstr "Klasse %qE ist veraltet"
#: objc/objc-act.c:1724
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "could not find setter/getter for %qE in class %qE"
-msgstr "Referenzmarke für Klasse %qs kann nicht gefunden werden"
+msgstr "Setter/Getter für %qE in Klasse %qE kann nicht gefunden werden"
#: objc/objc-act.c:1760
#, gcc-internal-format
msgid "readonly property can not be set"
-msgstr ""
+msgstr "schreibgeschützte Eigenschaft kann nicht gesetzt werden"
#. PS: At the moment, due to how the parser works, it should be
#. impossible to get here. But it's good to have the check in
@@ -41870,7 +41854,7 @@ msgstr "Methodendeklaration nicht im @interface-Kontext"
#: objc/objc-act.c:2034
#, gcc-internal-format
msgid "method attributes are not available in Objective-C 1.0"
-msgstr ""
+msgstr "in Objective-C 1.0 gibt es keine Methodenattribute"
#: objc/objc-act.c:2051
#, gcc-internal-format
@@ -41878,19 +41862,19 @@ msgid "method definition not in @implementation context"
msgstr "Methodendefinition nicht im @implementation-Kontext"
#: objc/objc-act.c:2066
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "method attributes can not be specified in @implementation context"
-msgstr "Methodendefinition nicht im @implementation-Kontext"
+msgstr "Methodenattribute können nicht im @implementation-Kontext angegeben werden"
#: objc/objc-act.c:2295
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "class %qs does not implement the %qE protocol"
-msgstr "Klasse %qs implementiert nicht das Protokoll %qs"
+msgstr "Klasse %qs implementiert nicht das Protokoll %qE"
#: objc/objc-act.c:2298
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qs does not conform to the %qE protocol"
-msgstr "Objekt entspricht nicht dem Protokoll %qs"
+msgstr "Typ %qs entspricht nicht dem Protokoll %qE"
#: objc/objc-act.c:2562
#, gcc-internal-format
@@ -41918,14 +41902,14 @@ msgid "passing argument %d of %qE from distinct Objective-C type"
msgstr "Ãœbergabe des Arguments %d von %qE von anderem Objective-C-Typ"
#: objc/objc-act.c:2716
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "statically allocated instance of Objective-C class %qE"
-msgstr "statisch reservierte Instanz der Objective-C-Klasse %qs"
+msgstr "statisch reservierte Instanz der Objective-C-Klasse %qE"
#: objc/objc-act.c:2725
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "redeclaration of Objective-C class %qs"
-msgstr "statisch reservierte Instanz der Objective-C-Klasse %qs"
+msgstr "Redeklaration der Objective-C-Klasse %qs"
#. This case happens when we are given an 'interface' which
#. is not a valid class name. For example if a typedef was
@@ -41937,38 +41921,38 @@ msgstr "statisch reservierte Instanz der Objective-C-Klasse %qs"
#: objc/objc-act.c:2767
#, gcc-internal-format
msgid "only Objective-C object types can be qualified with a protocol"
-msgstr ""
+msgstr "nur Objective-C-Objekttypen können mit Protokoll qualifiziert werden"
#: objc/objc-act.c:2831
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "protocol %qE has circular dependency"
-msgstr "Protokoll %qs hat ringförmige Abhängigkeit"
+msgstr "Protokoll %qE hat ringförmige Abhängigkeit"
#: objc/objc-act.c:2864 objc/objc-act.c:5382
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot find protocol declaration for %qE"
-msgstr "Protokolldeklaration für %qs kann nicht gefunden werden"
+msgstr "Protokolldeklaration für %qE kann nicht gefunden werden"
#: objc/objc-act.c:3167 objc/objc-act.c:3826 objc/objc-act.c:6159
#: objc/objc-act.c:6634 objc/objc-act.c:6707 objc/objc-act.c:6760
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot find interface declaration for %qE"
-msgstr "Schnittstellendeklaration für %qs kann nicht gefunden werden"
+msgstr "Schnittstellendeklaration für %qE kann nicht gefunden werden"
#: objc/objc-act.c:3171
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "interface %qE does not have valid constant string layout"
-msgstr "die Schnittstelle %qs hat keine gültige Form einer konstanten Zeichenkette"
+msgstr "die Schnittstelle %qE hat keine gültige Form einer konstanten Zeichenkette"
#: objc/objc-act.c:3176
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot find reference tag for class %qE"
-msgstr "Referenzmarke für Klasse %qs kann nicht gefunden werden"
+msgstr "Referenzmarke für Klasse %qE kann nicht gefunden werden"
#: objc/objc-act.c:3321
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not an Objective-C class name or alias"
-msgstr "%qs ist kein Klassenname oder Alias in Objective-C"
+msgstr "%qE ist kein Klassenname oder Alias in Objective-C"
#: objc/objc-act.c:3336 objc/objc-act.c:3369 objc/objc-act.c:6540
#: objc/objc-act.c:7862 objc/objc-act.c:7917
@@ -41977,19 +41961,19 @@ msgid "Objective-C declarations may only appear in global scope"
msgstr "Objective-C-Deklarationen dürfen nur im globalen Gültigkeitsbereich erscheinen"
#: objc/objc-act.c:3341
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot find class %qE"
-msgstr "Klasse %qs kann nicht gefunden werden"
+msgstr "Klasse %qE kann nicht gefunden werden"
#: objc/objc-act.c:3343
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "class %qE already exists"
-msgstr "Klasse %qs existiert bereits"
+msgstr "Klasse %qE existiert bereits"
#: objc/objc-act.c:3391 objc/objc-act.c:6599
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE redeclared as different kind of symbol"
-msgstr "%qs als andere Symbolart redeklariert"
+msgstr "%qE als andere Symbolart redeklariert"
#: objc/objc-act.c:3680
#, gcc-internal-format
@@ -42017,7 +42001,7 @@ msgid "global/static variable assignment has been intercepted"
msgstr "Globale/statische Variablenzuweisung wurde abgefangen"
#: objc/objc-act.c:3892
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<-fobjc-exceptions%> is required to enable Objective-C exception syntax"
msgstr "%<-fobjc-exceptions%> verwenden, um Syntax für Objective-C-Ausnahmen einzuschalten"
@@ -42027,9 +42011,9 @@ msgid "@catch parameter is not a known Objective-C class type"
msgstr "»@catch«-Parameter ist kein bekannter Objective-C-Klassentyp"
#: objc/objc-act.c:3982
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "@catch parameter can not be protocol-qualified"
-msgstr "Template-Parameter können keine »friends« sein"
+msgstr "@catch-Parameter kann nicht Protokoll-qualifiziert sein"
#: objc/objc-act.c:4027
#, gcc-internal-format
@@ -42037,9 +42021,9 @@ msgid "exception of type %<%T%> will be caught"
msgstr "Ausnahme des Typs %<%T%> wird gefangen werden"
#: objc/objc-act.c:4029
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " by earlier handler for %<%T%>"
-msgstr "%H von früherem Behandler für %<%T%>"
+msgstr " von früherem Behandler für %<%T%>"
#: objc/objc-act.c:4076
#, gcc-internal-format
@@ -42052,24 +42036,24 @@ msgid "%<@throw%> (rethrow) used outside of a @catch block"
msgstr "%<@throw%> (rethrow) außerhalb von »@catch«-Block verwendet"
#: objc/objc-act.c:4117
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<@throw%> argument is not an object"
-msgstr "Argument %qd ist keine Konstante"
+msgstr "%<@throw%>-Argument ist kein Objekt"
#: objc/objc-act.c:4138
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<@synchronized%> argument is not an object"
-msgstr "Argument %qd ist keine Konstante"
+msgstr "%<@synchronized%>-Argument ist kein Objekt"
#: objc/objc-act.c:4273
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qT does not have a known size"
-msgstr "Typ %q+D hat keine bekannte Größe"
+msgstr "Typ %qT hat keine bekannte Größe"
#: objc/objc-act.c:4450
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s %qs"
-msgstr "%J%s: %qs"
+msgstr "%s %qs"
#: objc/objc-act.c:4473 objc/objc-act.c:4492
#, gcc-internal-format
@@ -42084,42 +42068,42 @@ msgstr "ein Objekt kann nicht als Parameter für eine Methode verwendet werden"
#: objc/objc-act.c:4591
#, gcc-internal-format
msgid "method argument attributes are not available in Objective-C 1.0"
-msgstr ""
+msgstr "in Objective-C 1.0 gibt es keine Attribute für Methodenargumente"
#: objc/objc-act.c:4920
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "multiple methods named %<%c%E%> found"
-msgstr "mehrere %s namens %<%c%s%> gefunden"
+msgstr "mehrere Methoden namens %<%c%E%> gefunden"
#: objc/objc-act.c:4923
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "using %<%c%s%>"
-msgstr "%J%s %<%c%s%>"
+msgstr "%<%c%s%> wird verwendet"
#: objc/objc-act.c:4932
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "multiple selectors named %<%c%E%> found"
-msgstr "mehrere %s namens %<%c%s%> gefunden"
+msgstr "mehrere Selektoren namens %<%c%E%> gefunden"
#: objc/objc-act.c:4935
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "found %<%c%s%>"
-msgstr "%J%s %<%c%s%>"
+msgstr "%<%c%s%> gefunden"
#: objc/objc-act.c:4944
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "also found %<%c%s%>"
-msgstr "%J%s %<%c%s%>"
+msgstr "auch %<%c%s%> gefunden"
#: objc/objc-act.c:5172
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no super class declared in @interface for %qE"
-msgstr "keine Basisklasse im @interface für %qs deklariert"
+msgstr "keine Basisklasse im @interface für %qE deklariert"
#: objc/objc-act.c:5210
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "found %<-%E%> instead of %<+%E%> in protocol(s)"
-msgstr "%<-%s%> statt %<+%s%> in Protokoll(en) gefunden"
+msgstr "%<-%E%> statt %<+%E%> in Protokoll(en) gefunden"
#: objc/objc-act.c:5274
#, gcc-internal-format
@@ -42127,19 +42111,19 @@ msgid "invalid receiver type %qs"
msgstr "ungültiger Empfängertyp %qs"
#: objc/objc-act.c:5289
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<%c%E%> not found in protocol(s)"
-msgstr "%<%c%s%> nicht in Protokoll(en) gefunden"
+msgstr "%<%c%E%> nicht in Protokoll(en) gefunden"
#: objc/objc-act.c:5303
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE may not respond to %<%c%E%>"
-msgstr "%qs antwortet möglicherweise nicht auf %<%c%s%>"
+msgstr "%qE antwortet möglicherweise nicht auf %<%c%E%>"
#: objc/objc-act.c:5311
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no %<%c%E%> method found"
-msgstr "keine Methode %<%c%s%> gefunden"
+msgstr "keine Methode %<%c%E%> gefunden"
#: objc/objc-act.c:5318
#, gcc-internal-format
@@ -42157,9 +42141,9 @@ msgid "%<...%> as arguments.)"
msgstr "%<...%> als Argumente.)"
#: objc/objc-act.c:5433
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "undeclared selector %qE"
-msgstr "nicht deklarierter Selektor %qs"
+msgstr "nicht deklarierter Selektor %qE"
#. Historically, a class method that produced objects (factory
#. method) would assign `self' to the instance that it
@@ -42171,39 +42155,39 @@ msgstr "nicht deklarierter Selektor %qs"
#. where this is done unknowingly than to support the above
#. paradigm.
#: objc/objc-act.c:5476
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "instance variable %qE accessed in class method"
-msgstr "in Klassenmethode wird auf Instanzvariable %qs zugegriffen"
+msgstr "in Klassenmethode wird auf Instanzvariable %qE zugegriffen"
#: objc/objc-act.c:5764 objc/objc-act.c:5784
#, gcc-internal-format
msgid "method %<%c%E%> declared %<@optional%> and %<@required%> at the same time"
-msgstr ""
+msgstr "Methode %<%c%E%> gleichzeitig als %<@optional%> und %<@required%> deklariert"
#: objc/objc-act.c:5768
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %<%c%E%> as %<@required%>"
-msgstr "vorherige Deklaration von %qs"
+msgstr "vorherige Deklaration von %<%c%E%> als %<@required%>"
#: objc/objc-act.c:5788
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %<%c%E%> as %<@optional%>"
-msgstr "vorherige Deklaration von %qs"
+msgstr "vorherige Deklaration von %<%c%E%> als %<@optional%>"
#: objc/objc-act.c:5848
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "duplicate declaration of method %<%c%E%> with conflicting types"
-msgstr "doppelte Deklaration der Methode %<%c%s%>"
+msgstr "doppelte Deklaration der Methode %<%c%E%> mit in Konflikt stehenden Typen"
#: objc/objc-act.c:5852
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %<%c%E%>"
-msgstr "vorherige Deklaration von %qs"
+msgstr "vorherige Deklaration von %<%c%E%>"
#: objc/objc-act.c:5914
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "duplicate interface declaration for category %<%E(%E)%>"
-msgstr "doppelte Schnittstellendeklaration für Kategorie %<%s(%s)%>"
+msgstr "doppelte Schnittstellendeklaration für Kategorie %<%E(%E)%>"
#: objc/objc-act.c:5994
#, gcc-internal-format
@@ -42216,41 +42200,41 @@ msgid "instance variable %qs has unknown size"
msgstr "Instanzvariable %qs hat unbekannte Größe"
#: objc/objc-act.c:6025
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "instance variable %qs uses flexible array member"
-msgstr "falsche Benutzung eines flexiblen Feldelements"
+msgstr "Instanzvariable %qs verwendet flexibles Feldelement"
#: objc/objc-act.c:6051
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qE has no default constructor to call"
-msgstr "Typ %qs hat keinen Standard-Konstruktor"
+msgstr "Typ %qE hat keinen aufrufbaren Standard-Konstruktor"
#: objc/objc-act.c:6057
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "destructor for %qE shall not be run either"
-msgstr "Destruktor für %qs sollte auch nicht abgearbeitet werden"
+msgstr "Destruktor für %qE sollte auch nicht abgearbeitet werden"
#. Vtable pointers are Real Bad(tm), since Obj-C cannot
#. initialize them.
#: objc/objc-act.c:6069
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qE has virtual member functions"
-msgstr "der Typ %qs hat virtuelle Elementfunktionen"
+msgstr "Typ %qE hat virtuelle Elementfunktionen"
#: objc/objc-act.c:6070
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "illegal aggregate type %qE specified for instance variable %qs"
-msgstr "unzulässiger Aggregattyp %qs für Instanzvariable %qs angegeben"
+msgstr "unzulässiger Aggregattyp %qE für Instanzvariable %qs angegeben"
#: objc/objc-act.c:6080
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qE has a user-defined constructor"
-msgstr "Typ %qs hat einen benutzerdefinierten Konstruktor"
+msgstr "Typ %qE hat einen benutzerdefinierten Konstruktor"
#: objc/objc-act.c:6082
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "type %qE has a user-defined destructor"
-msgstr "Typ %qs hat einen benutzerdefinierten Destruktor"
+msgstr "Typ %qE hat einen benutzerdefinierten Destruktor"
#: objc/objc-act.c:6086
#, gcc-internal-format
@@ -42258,196 +42242,196 @@ msgid "C++ constructors and destructors will not be invoked for Objective-C fiel
msgstr "C++-Konstruktoren und -Destruktoren werden für Objective-C-Felder nicht aufgerufen"
#: objc/objc-act.c:6188
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "instance variable %qE is declared private"
-msgstr "Instanzvariable %qs ist als »private« deklariert"
+msgstr "Instanzvariable %qE ist als »private« deklariert"
#: objc/objc-act.c:6199
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "instance variable %qE is %s; this will be a hard error in the future"
-msgstr "Instanzvariable %qs ist %s; dies wird zukünftig ein schwerer Fehler sein"
+msgstr "Instanzvariable %qE ist %s; dies wird zukünftig ein schwerer Fehler sein"
#: objc/objc-act.c:6206
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "instance variable %qE is declared %s"
-msgstr "Instanzvariable %qs ist als »%s« deklariert"
+msgstr "Instanzvariable %qE ist als »%s« deklariert"
#: objc/objc-act.c:6317 objc/objc-act.c:6432
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "incomplete implementation of class %qE"
-msgstr "unvollständige Implementierung der Klasse %qs"
+msgstr "unvollständige Implementierung der Klasse %qE"
#: objc/objc-act.c:6321 objc/objc-act.c:6436
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "incomplete implementation of category %qE"
-msgstr "unvollständige Implementierung der Kategorie %qs"
+msgstr "unvollständige Implementierung der Kategorie %qE"
#: objc/objc-act.c:6330 objc/objc-act.c:6444
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "method definition for %<%c%E%> not found"
-msgstr "Methodendefinition für %<%c%s%> nicht gefunden"
+msgstr "Methodendefinition für %<%c%E%> nicht gefunden"
#: objc/objc-act.c:6485
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s %qE does not fully implement the %qE protocol"
-msgstr "%s %qs implementiert das %qs-Protokoll nicht vollständig"
+msgstr "%s %qE implementiert das %qE-Protokoll nicht vollständig"
#: objc/objc-act.c:6575
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot find interface declaration for %qE, superclass of %qE"
-msgstr "Schnittstellendeklaration für %qs, Basisklasse von %qs, kann nicht gefunden werden"
+msgstr "Schnittstellendeklaration für %qE, Basisklasse von %qE, kann nicht gefunden werden"
#: objc/objc-act.c:6614
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "reimplementation of class %qE"
-msgstr "Reimplementation der Klasse %qs"
+msgstr "Reimplementation der Klasse %qE"
#: objc/objc-act.c:6647
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicting super class name %qE"
-msgstr "in Konflikt stehender Basisklassenname %qs"
+msgstr "in Konflikt stehender Basisklassenname %qE"
#: objc/objc-act.c:6650
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %qE"
-msgstr "vorherige Deklaration von %qs"
+msgstr "vorherige Deklaration von %qE"
#: objc/objc-act.c:6652
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration"
-msgstr "vorherige Deklaration %q+D"
+msgstr "vorherige Deklaration"
#: objc/objc-act.c:6665 objc/objc-act.c:6667
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "duplicate interface declaration for class %qE"
-msgstr "doppelte Schnittstellendeklaration für Klasse %qs"
+msgstr "doppelte Schnittstellendeklaration für Klasse %qE"
#: objc/objc-act.c:6985 objc/objc-act.c:7179
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can not find instance variable associated with property"
-msgstr "widersprüchliche Spezifikation von Instanzvariable"
+msgstr "mit Eigenschaft verbundene Instanzvariable nicht gefunden"
#. TODO: This should be caught much earlier than this.
#: objc/objc-act.c:7145
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid setter, it must have one argument"
-msgstr "Schnittstelle des Zuweisungsoperators bei %L muss zwei Argumente haben"
+msgstr "ungültiger Setter, muss ein Argument haben"
#: objc/objc-act.c:7308 objc/objc-act.c:7523
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "property %qs already specified in %<@dynamic%>"
-msgstr "%s %qs ist bereits in %s:%d definiert"
+msgstr "Eigenschaft %qs ist bereits in %<@dynamic%> festgelegt"
#: objc/objc-act.c:7311 objc/objc-act.c:7526
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "property %qs already specified in %<@synthesize%>"
-msgstr "%s %qs ist bereits in %s:%d definiert"
+msgstr "Eigenschaft %qs ist bereits in %<@synthesize%> festgelegt"
#: objc/objc-act.c:7325 objc/objc-act.c:7540
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no declaration of property %qs found in the interface"
-msgstr "lokale Deklaration von %qs verdeckt Instanzvariable"
+msgstr "keine Deklaration der in der Schnittstelle gefundenen Eigenschaft %qs"
#: objc/objc-act.c:7352
#, gcc-internal-format
msgid "ivar %qs used by %<@synthesize%> declaration must be an existing ivar"
-msgstr ""
+msgstr "von %<@synthesize%>-Deklaration verwendete ivar %qs muss eine existierende ivar sein"
#: objc/objc-act.c:7373
#, gcc-internal-format
msgid "property %qs is using instance variable %qs of incompatible type"
-msgstr ""
+msgstr "Eigenschaft %qs verwendet Instanzvariable %qs unverträglichen Typs"
#: objc/objc-act.c:7395
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "'assign' property %qs is using bit-field instance variable %qs"
-msgstr "unzulässiger Aggregattyp %qs für Instanzvariable %qs angegeben"
+msgstr "»assign«-Eigenschaft %qs verwendet Bitfeld-Instanzvariable %qs"
#: objc/objc-act.c:7408
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "'atomic' property %qs is using bit-field instance variable %qs"
-msgstr "unzulässiger Aggregattyp %qs für Instanzvariable %qs angegeben"
+msgstr "»atomic«-Eigenschaft %qs verwendet Bitfeld-Instanzvariable %qs"
#: objc/objc-act.c:7426
#, gcc-internal-format
msgid "property %qs is using the same instance variable as property %qs"
-msgstr ""
+msgstr "Eigenschaft %qs verwendet die selbe Instanzvariable wie die Eigenschaft %qs"
#: objc/objc-act.c:7467
#, gcc-internal-format
msgid "%<@synthesize%> is not available in Objective-C 1.0"
-msgstr ""
+msgstr "in Objective-C 1.0 gibt es kein %<@synthesize%>"
#. We can get here only in Objective-C; the Objective-C++ parser
#. detects the problem while parsing, outputs the error
#. "misplaced '@synthesize' Objective-C++ construct" and skips
#. the declaration.
#: objc/objc-act.c:7478
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<@synthesize%> not in @implementation context"
-msgstr "%<@end%> fehlt in Implementationskontext"
+msgstr "%<@synthesize%> nicht in @implementation-Kontext"
#: objc/objc-act.c:7484
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<@synthesize%> can not be used in categories"
-msgstr "%s kann nicht hier in »asm« verwendet werden"
+msgstr "%<@synthesize%> kann nicht in Kategorien verwendet werden"
#: objc/objc-act.c:7493
#, gcc-internal-format
msgid "%<@synthesize%> requires the @interface of the class to be available"
-msgstr ""
+msgstr "%<@synthesize%> erfordert Verfügbarkeit des @interface der Klasse"
#: objc/objc-act.c:7576
#, gcc-internal-format
msgid "%<@dynamic%> is not available in Objective-C 1.0"
-msgstr ""
+msgstr "in Objective-C 1.0 gibt es kein %<@dynamic%>"
#. We can get here only in Objective-C; the Objective-C++ parser
#. detects the problem while parsing, outputs the error
#. "misplaced '@dynamic' Objective-C++ construct" and skips the
#. declaration.
#: objc/objc-act.c:7587
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<@dynamic%> not in @implementation context"
-msgstr "%<@end%> fehlt in Implementationskontext"
+msgstr "%<@dynamic%> nicht in @implementation-Kontext"
#: objc/objc-act.c:7609
#, gcc-internal-format
msgid "%<@dynamic%> requires the @interface of the class to be available"
-msgstr ""
+msgstr "%<@dynamic%> erfordert Verfügbarkeit des @interface der Klasse"
#: objc/objc-act.c:7807
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "definition of protocol %qE not found"
-msgstr "Methodendefinition für %<%c%s%> nicht gefunden"
+msgstr "Definition des Protokolls %qE nicht gefunden"
#. It would be nice to use warn_deprecated_use() here, but
#. we are using TREE_CHAIN (which is supposed to be the
#. TYPE_STUB_DECL for a TYPE) for something different.
#: objc/objc-act.c:7838
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "protocol %qE is deprecated"
-msgstr "%qs ist veraltet"
+msgstr "Protokoll %qE ist veraltet"
#: objc/objc-act.c:7962
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "duplicate declaration for protocol %qE"
-msgstr "doppelte Deklaration für Protokoll %qs"
+msgstr "doppelte Deklaration für Protokoll %qE"
#: objc/objc-act.c:8448
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicting types for %<%c%s%>"
-msgstr "In Konflikt stehende Typen für %q+D"
+msgstr "in Konflikt stehende Typen für %<%c%s%>"
#: objc/objc-act.c:8452
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %<%c%s%>"
-msgstr "vorherige Deklaration von %qs"
+msgstr "vorherige Deklaration von %<%c%s%>"
#: objc/objc-act.c:8552
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no super class declared in interface for %qE"
-msgstr "keine Basisklasse in Schnittstelle für %qs deklariert"
+msgstr "keine Basisklasse in Schnittstelle für %qE deklariert"
#: objc/objc-act.c:8579
#, gcc-internal-format
@@ -42465,74 +42449,74 @@ msgid "instance variable %qs is declared private"
msgstr "Instanzvariable %qs ist als »private« deklariert"
#: objc/objc-act.c:9128
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "local declaration of %qE hides instance variable"
-msgstr "lokale Deklaration von %qs verdeckt Instanzvariable"
+msgstr "lokale Deklaration von %qE verdeckt Instanzvariable"
#. This can happen if DECL_ARTIFICIAL (*expr_p), but
#. should be impossible for real properties, which always
#. have a getter.
#: objc/objc-act.c:9173
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no %qs getter found"
-msgstr "keine Methode %<%c%s%> gefunden"
+msgstr "kein %qs-Getter gefunden"
#: objc/objc-act.c:9413
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "fast enumeration is not available in Objective-C 1.0"
-msgstr "diese Medienfunktion ist nur auf dem fr500 verfügbar"
+msgstr "in Objective-C 1.0 gibt es keine schnelle Aufzählung"
#: objc/objc-act.c:9423
#, gcc-internal-format
msgid "iterating variable in fast enumeration is not an object"
-msgstr ""
+msgstr "Zählvariable in schneller Aufzählung ist kein Objekt"
#: objc/objc-act.c:9429
#, gcc-internal-format
msgid "collection in fast enumeration is not an object"
-msgstr ""
+msgstr "Sammlung in schneller Aufzählung ist kein Objekt"
#: objc/objc-act.c:10362
#, gcc-internal-format, gfc-internal-format
msgid "unknown type %s found during Objective-C encoding"
-msgstr ""
+msgstr "unbekannter Typ %s bei Objective-C-Kodierung gefunden"
#. Do not do any encoding, produce an error and keep going.
#: objc/objc-act.c:10445
#, gcc-internal-format
msgid "trying to encode non-integer type as a bitfield"
-msgstr ""
+msgstr "es wird versucht, einen Nicht-Ganzzahltyp als Bitfeld zu kodieren"
#: objc/objc-gnu-runtime-abi-01.c:129
#, gcc-internal-format
msgid "%<-fobjc-gc%> is ignored for %<-fgnu-runtime%>"
-msgstr ""
+msgstr "%<-fobjc-gc%> wird für %<-fgnu-runtime%> ignoriert"
#: objc/objc-gnu-runtime-abi-01.c:137
#, gcc-internal-format
msgid "%<-fobjc-sjlj-exceptions%> is ignored for %<-fgnu-runtime%>"
-msgstr ""
+msgstr "%<-fobjc-sjlj-exceptions%> wird für %<-fgnu-runtime%> ignoriert"
#: objc/objc-gnu-runtime-abi-01.c:2168 objc/objc-next-runtime-abi-01.c:2848
#: objc/objc-next-runtime-abi-02.c:3636
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-objective-c type '%T' cannot be caught"
-msgstr "Nicht-Objekt-Element %qs kann nicht als %<mutable%> deklariert sein"
+msgstr "Nicht-Objective-C-Typ »%T« kann nicht aufgefangen werden"
#: objc/objc-next-runtime-abi-01.c:150
#, gcc-internal-format
msgid "%<-fobjc-sjlj-exceptions%> is the only supported exceptions system for %<-fnext-runtime%> with %<-fobjc-abi-version%> < 2"
-msgstr ""
+msgstr "%<-fobjc-sjlj-exceptions%> ist das einzige unterstützte Ausnahmesystem für %<-fnext-runtime%> mit %<-fobjc-abi-version%> < 2"
#: objc/objc-next-runtime-abi-02.c:247
#, gcc-internal-format
msgid "%<-fobjc-sjlj-exceptions%> is ignored for %<-fnext-runtime%> when %<-fobjc-abi-version%> >= 2"
-msgstr ""
+msgstr "%<-fobjc-sjlj-exceptions%> wird für %<-fnext-runtime%> ignoriert, wenn %<-fobjc-abi-version%> >= 2"
#: objc/objc-runtime-shared-support.c:431
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "creating selector for nonexistent method %qE"
-msgstr "%Hfür nicht existierende Methode %qE wird Selektor erzeugt"
+msgstr "für nicht existierende Methode %qE wird Selektor erzeugt"
#~ msgid "Conform to the ISO 1998 C++ standard"
#~ msgstr "Mit dem Standard ISO 1998 C++ übereinstimmen"
diff --git a/gcc/po/sv.po b/gcc/po/sv.po
index 0a61b60812e..1e9443049ba 100644
--- a/gcc/po/sv.po
+++ b/gcc/po/sv.po
@@ -8,10 +8,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: gcc 4.6.0\n"
+"Project-Id-Version: gcc 4.6.1\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2011-06-21 10:27+0000\n"
-"PO-Revision-Date: 2011-04-13 22:28+0200\n"
+"PO-Revision-Date: 2011-07-15 17:29+0200\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
@@ -2114,7 +2114,7 @@ msgstr "Det maximala antalet instruktioner redo att matas ut för att övervägas u
#: params.def:704
msgid "Maximum number of active local stores in RTL dead store elimination"
-msgstr ""
+msgstr "Maximalt antal aktiva lokala lagringar i RTL vid eliminering av döda lagringar"
#: params.def:714
msgid "The number of insns executed before prefetch is completed"
@@ -4975,7 +4975,7 @@ msgstr "Inbyggd för inbyggda om inte är med i den valda standarden"
#: fortran/lang.opt:243
msgid "Warn about real-literal-constants with 'q' exponent-letter"
-msgstr ""
+msgstr "Varna för reella literala konstanter med exponentbokstav \"q\""
#: fortran/lang.opt:251
msgid "Warn about \"suspicious\" constructs"
@@ -9330,10 +9330,8 @@ msgid "-fconst-string-class=<name>\tUse class <name> for constant strings"
msgstr "-fconst-string-class=<namn>\tAnvänd klassen <namn> för konstanta strängar"
#: c-family/c.opt:724
-#, fuzzy
-#| msgid "-ftemplate-depth=<number>\tSpecify maximum template instantiation depth"
msgid "-fconstexpr-depth=<number>\tSpecify maximum constexpr recursion depth"
-msgstr "-ftemplate-depth=<antal>\tAnge maximalt instansieringsdjup för mallar"
+msgstr "-fconstexpr-depth=<antal>\tAnge maximalt rekursionsdjup för konstantuttryck"
#: c-family/c.opt:728
msgid "-fno-deduce-init-list\tdisable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list"
@@ -9662,10 +9660,8 @@ msgid "Remap file names when including files"
msgstr "Översätt filnamn när filer inkluderas"
#: c-family/c.opt:1140 c-family/c.opt:1144
-#, fuzzy
-#| msgid "Conform to the ISO 1998 C++ standard with GNU extensions"
msgid "Conform to the ISO 1998 C++ standard revised by the 2003 technical corrigendum"
-msgstr "Följ standarden ISO 1998 C++ med GNU-utökningar"
+msgstr "Följ standarden ISO 1998 C++ reviderad av 2003 års tekniska rättelser"
#: c-family/c.opt:1148
msgid "Conform to the ISO 1998 C++ standard, with extensions that are likely to"
@@ -21614,7 +21610,7 @@ msgstr "bara initierade variabler kan placeras i programminnesområdet"
#: config/avr/avr.c:5065
#, gcc-internal-format
msgid "variable %q+D must be const in order to be put into read-only section by means of %<__attribute__((progmem))%>"
-msgstr ""
+msgstr "variabeln %q+D måste vara const för att kunna läggas i en endast läsbar sektion med hjälp av %<__attribute__((progmem))%>"
#: config/avr/avr.c:5106
#, gcc-internal-format
@@ -22305,14 +22301,12 @@ msgid "the last argument must be a 2-bit immediate"
msgstr "det sista argumentet måste vara en 2-bitars omedelbar"
#: config/i386/i386.c:26380
-#, fuzzy, gcc-internal-format
-#| msgid "the fifth argument must be a 8-bit immediate"
+#, gcc-internal-format
msgid "the fifth argument must be an 8-bit immediate"
msgstr "det femte argumentet måste vara en 8-bitars omedelbar"
#: config/i386/i386.c:26475
-#, fuzzy, gcc-internal-format
-#| msgid "the third argument must be a 8-bit immediate"
+#, gcc-internal-format
msgid "the third argument must be an 8-bit immediate"
msgstr "det tredje argumentet måste vara en 8-bitars omedelbar"
@@ -24698,10 +24692,9 @@ msgid "cannot bind rvalue %qE to %qT"
msgstr "det går inte att binda rvalue %qE till %qT"
#: cp/call.c:5730 cp/cvt.c:1625
-#, fuzzy, gcc-internal-format
-#| msgid "class %qT will be considered nearly empty in a future version of GCC"
+#, gcc-internal-format
msgid "scoped enum %qT will not promote to an integral type in a future version of GCC"
-msgstr "klass %qT kommer betraktas som nästan tom i en framtida version av GCC"
+msgstr "enum %qT med räckvidd kommer inte befordras till en heltalstyp i en framtida version av GCC"
#: cp/call.c:5760
#, gcc-internal-format
@@ -24840,10 +24833,9 @@ msgid "ISO C++ says that these are ambiguous, even though the worst conversion f
msgstr "ISO C++ säger att dessa är tvetydiga, trots att den sämsta konverteringen för den första är bättre än den sämsta konverteringen för den andra:"
#: cp/call.c:8070
-#, fuzzy, gcc-internal-format
-#| msgid "could not convert %qE to %qT"
+#, gcc-internal-format
msgid "could not convert %qE from %qT to %qT"
-msgstr "kunde inte konvertera %qE till %qT"
+msgstr "kunde inte konvertera %qE från %qT till %qT"
#: cp/call.c:8313
#, gcc-internal-format
@@ -25102,10 +25094,9 @@ msgid "initializer specified for non-virtual method %q+D"
msgstr "initierare angiven för icke-virtuell metod %q+D"
#: cp/class.c:4563 cp/semantics.c:5455
-#, fuzzy, gcc-internal-format
-#| msgid "enclosing class of %q+D is not a literal type"
+#, gcc-internal-format
msgid "enclosing class of %q+#D is not a literal type"
-msgstr "omslutande klass till %q+D är inte en literal typ"
+msgstr "omslutande klass till %q+#D är inte en literal typ"
#: cp/class.c:4670
#, gcc-internal-format
@@ -27050,10 +27041,9 @@ msgid "reference %qs cannot be declared %<mutable%>"
msgstr "referensen %qs kan inte deklareras %<mutable%>"
#: cp/decl.c:9308
-#, fuzzy, gcc-internal-format
-#| msgid "parameter declared %<auto%>"
+#, gcc-internal-format
msgid "typedef declared %<auto%>"
-msgstr "parametern deklarerad %<auto%>"
+msgstr "typedef deklarerad %<auto%>"
#: cp/decl.c:9318
#, gcc-internal-format
@@ -28558,10 +28548,9 @@ msgid "%qD cannot be declared as constexpr"
msgstr "%qD får inte deklareras som constexpr"
#: cp/method.c:1599
-#, fuzzy, gcc-internal-format
-#| msgid "%qD cannot be defaulted"
+#, gcc-internal-format
msgid "a template cannot be defaulted"
-msgstr "%qD kan inte ha standardvärde"
+msgstr "en mall kan inte ha standardvärde"
#: cp/method.c:1627
#, gcc-internal-format
@@ -29102,10 +29091,9 @@ msgid "need %<typename%> before %<%T::%E%> because %qT is a dependent scope"
msgstr "%<typename%> behövs före %<%T::%E%> för att %qT är en beroende räckvidd"
#: cp/parser.c:2791
-#, fuzzy, gcc-internal-format
-#| msgid "%qE in class %qT does not name a type"
+#, gcc-internal-format
msgid "%qE in %q#T does not name a type"
-msgstr "%qE i klassen %qT är inte namnet på en typ"
+msgstr "%qE i %q#T är inte namnet på en typ"
#: cp/parser.c:3340
#, gcc-internal-format
@@ -31469,16 +31457,14 @@ msgid "the type %qT of constexpr variable %qD is not literal"
msgstr "typen %qT för constexpr-variabeln %qD är inte en literal"
#: cp/semantics.c:5434
-#, fuzzy, gcc-internal-format
-#| msgid "invalid type for parameter %q#D of constexpr function"
+#, gcc-internal-format
msgid "invalid type for parameter %d of constexpr function %q+#D"
-msgstr "ogiltig typ för parameter %q#D till constexpr-funktion"
+msgstr "ogiltig typ för parameter %d till constexpr-funktion %q+#D"
#: cp/semantics.c:5445
-#, fuzzy, gcc-internal-format
-#| msgid "invalid return type %qT of constexpr function %qD"
+#, gcc-internal-format
msgid "invalid return type %qT of constexpr function %q+D"
-msgstr "ogiltig returtyp %qT för constexpr-funktionen %qD"
+msgstr "ogiltig returtyp %qT för constexpr-funktionen %q+D"
#: cp/semantics.c:5610
#, gcc-internal-format
@@ -31511,10 +31497,9 @@ msgid "call has circular dependency"
msgstr "anrop har cirkulärt beroende"
#: cp/semantics.c:6111
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "template instantiation depth exceeds maximum of %d (use -ftemplate-depth= to increase the maximum) instantiating %qD"
+#, gcc-internal-format, gfc-internal-format
msgid "constexpr evaluation depth exceeds maximum of %d (use -fconstexpr-depth= to increase the maximum)"
-msgstr "mallinstansieringsdjupet överskrider maxvärdet på %d (använd -ftemplate-depth= för att öka maxvärdet) vid instansiering av %qD"
+msgstr "beräkning av constexpr överskrider maxvärdet på %d (använd -fconstexpr-depth= för att öka maxvärdet)"
#: cp/semantics.c:6189
#, gcc-internal-format
@@ -31627,10 +31612,9 @@ msgid "address-of an object %qE with thread local or automatic storage is not a
msgstr "adress-av på ett objekt %qE med trådlokal eller automatisk lagring är inte ett konstant uttryck"
#: cp/semantics.c:7621
-#, fuzzy, gcc-internal-format
-#| msgid "the value of %qD is not usable in a constant expression"
+#, gcc-internal-format
msgid "use of the value of the object being constructed in a constant expression"
-msgstr "värdet på %qD är inte användbart i ett konstant uttryck"
+msgstr "användning av värdet på objektet som konstrueras i ett konstant uttryck"
#: cp/semantics.c:7670
#, gcc-internal-format
@@ -34506,10 +34490,9 @@ msgid "MODULE PROCEDURE at %C must be in a generic module interface"
msgstr "MODULE PROCEDURE vid %C måste vara i ett generiskt modulgränssnitt"
#: fortran/decl.c:7042
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Fortran 2003: PROCEDURE statement at %C"
+#, gcc-internal-format, gfc-internal-format
msgid "Fortran 2008: double colon in MODULE PROCEDURE statement at %L"
-msgstr "Fortran 2003: PROCEDURE-sats vid %C"
+msgstr "Fortran 2008: dubbelkolon i MODULE PROCEDURE-sats vid %L"
#: fortran/decl.c:7076
#, gcc-internal-format, gfc-internal-format
@@ -35427,10 +35410,9 @@ msgid "In %s at %L procedures must be either all SUBROUTINEs or all FUNCTIONs"
msgstr "I %s vid %L måste procedurerna antingen alla vara SUBROUTINE eller alla vara FUNCTION"
#: fortran/interface.c:1133
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Extension: Conversion from %s to %s at %L"
+#, gcc-internal-format, gfc-internal-format
msgid "Extension: Internal procedure '%s' in %s at %L"
-msgstr "Utökning: Konvertering från %s till %s vid %L"
+msgstr "Utökning: Intern procedur \"%s\" i %s vid %L"
#: fortran/interface.c:1188 fortran/interface.c:1192
#, gcc-internal-format, gfc-internal-format
@@ -37932,10 +37914,9 @@ msgid "Fortran 2003: BOZ used outside a DATA statement at %C"
msgstr "Fortran 2003: BOZ använd utanför en DATA-sats vid %C"
#: fortran/primary.c:547 fortran/primary.c:551
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Extension: Hollerith constant at %C"
+#, gcc-internal-format, gfc-internal-format
msgid "Extension: exponent-letter 'q' in real-literal-constant at %C"
-msgstr "Utökning: Hollerithkonstant vid %C"
+msgstr "Utökning: exponentbokstav \"q\" i reeel literal konstant vid %C"
#: fortran/primary.c:567
#, gcc-internal-format, gfc-internal-format
@@ -37948,16 +37929,14 @@ msgid "Real number at %C has a 'd' exponent and an explicit kind"
msgstr "Reellt tal vid %C har en \"d\"-exponent och en explicit sort"
#: fortran/primary.c:633
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Real number at %C has a 'd' exponent and an explicit kind"
+#, gcc-internal-format, gfc-internal-format
msgid "Real number at %C has a 'q' exponent and an explicit kind"
-msgstr "Reellt tal vid %C har en \"d\"-exponent och en explicit sort"
+msgstr "Reellt tal vid %C har en \"q\"-exponent och en explicit sort"
#: fortran/primary.c:647
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "Invalid initializer %s in Data statement at %C"
+#, gcc-internal-format, gfc-internal-format
msgid "Invalid exponent-letter 'q' in real-literal-constant at %C"
-msgstr "Ogiltig initierare %s på DATA-sats vid %C"
+msgstr "Ogiltig exponentbokstav \"q\" i reell literal konstant vid %C"
#: fortran/primary.c:660
#, gcc-internal-format, gfc-internal-format
@@ -42574,12 +42553,3 @@ msgstr "%<-fobjc-sjlj-exceptions%> ignoreras för %<-fnext-runtime%> när %<-fobj-
#, gcc-internal-format
msgid "creating selector for nonexistent method %qE"
msgstr "skapar selektor för icke existerande metod %qE"
-
-#~ msgid "Conform to the ISO 1998 C++ standard"
-#~ msgstr "Följ standarden ISO 1998 C++"
-
-#~ msgid "parameter packs must be at the end of the parameter list"
-#~ msgstr "parameterpaket måste vara vid slutet av parameterlistan"
-
-#~ msgid "enclosing class of %q#D is not a literal type"
-#~ msgstr "omslutande klass till %q#D är inte en literal typ"
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index d7fd73bb90c..8e80630fbb3 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -597,13 +597,11 @@ print_rtx (const_rtx in_rtx)
if (MEM_EXPR (in_rtx))
print_mem_expr (outfile, MEM_EXPR (in_rtx));
- if (MEM_OFFSET (in_rtx))
- fprintf (outfile, "+" HOST_WIDE_INT_PRINT_DEC,
- INTVAL (MEM_OFFSET (in_rtx)));
+ if (MEM_OFFSET_KNOWN_P (in_rtx))
+ fprintf (outfile, "+" HOST_WIDE_INT_PRINT_DEC, MEM_OFFSET (in_rtx));
- if (MEM_SIZE (in_rtx))
- fprintf (outfile, " S" HOST_WIDE_INT_PRINT_DEC,
- INTVAL (MEM_SIZE (in_rtx)));
+ if (MEM_SIZE_KNOWN_P (in_rtx))
+ fprintf (outfile, " S" HOST_WIDE_INT_PRINT_DEC, MEM_SIZE (in_rtx));
if (MEM_ALIGN (in_rtx) != 1)
fprintf (outfile, " A%u", MEM_ALIGN (in_rtx));
diff --git a/gcc/recog.h b/gcc/recog.h
index cce1321ad09..71dfe2a68a9 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -286,7 +286,7 @@ struct insn_operand_data
struct insn_data_d
{
const char *const name;
-#if HAVE_DESIGNATED_INITIALIZERS
+#if HAVE_DESIGNATED_UNION_INITIALIZERS
union {
const char *single;
const char *const *multi;
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 911f59eb083..aca005d7afd 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -418,10 +418,9 @@ maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode,
offset = ((WORDS_BIG_ENDIAN ? wordoffset : 0)
+ (BYTES_BIG_ENDIAN ? byteoffset : 0));
- return gen_rtx_raw_REG (new_mode,
- regno + subreg_regno_offset (regno, orig_mode,
- offset,
- new_mode));
+ regno += subreg_regno_offset (regno, orig_mode, offset, new_mode);
+ if (HARD_REGNO_MODE_OK (regno, new_mode))
+ return gen_rtx_raw_REG (new_mode, regno);
}
return NULL_RTX;
}
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 1da4cb8f40a..537364192da 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -529,8 +529,7 @@ init_reg_sets_1 (void)
SET_HARD_REG_BIT (ok_regs, j);
for (i = 0; i < N_REG_CLASSES; i++)
- if (((unsigned) CLASS_MAX_NREGS ((enum reg_class) i,
- (enum machine_mode) m)
+ if ((targetm.class_max_nregs ((reg_class_t) i, (enum machine_mode) m)
<= reg_class_size[i])
&& hard_reg_set_intersect_p (ok_regs, reg_class_contents[i]))
{
diff --git a/gcc/reload.c b/gcc/reload.c
index c86f69b78c0..c671765ba93 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1767,9 +1767,9 @@ combine_reloads (void)
&& rld[i].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
&& rld[i].when_needed != RELOAD_FOR_OUTADDR_ADDRESS
&& rld[i].when_needed != RELOAD_OTHER
- && (CLASS_MAX_NREGS (rld[i].rclass, rld[i].inmode)
- == CLASS_MAX_NREGS (rld[output_reload].rclass,
- rld[output_reload].outmode))
+ && (ira_reg_class_max_nregs [(int)rld[i].rclass][(int) rld[i].inmode]
+ == ira_reg_class_max_nregs [(int) rld[output_reload].rclass]
+ [(int) rld[output_reload].outmode])
&& rld[i].inc == 0
&& rld[i].reg_rtx == 0
#ifdef SECONDARY_MEMORY_NEEDED
@@ -4542,7 +4542,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
> GET_MODE_SIZE (rld[i].inmode)))
? rld[i].outmode : rld[i].inmode;
- rld[i].nregs = CLASS_MAX_NREGS (rld[i].rclass, rld[i].mode);
+ rld[i].nregs = ira_reg_class_max_nregs [rld[i].rclass][rld[i].mode];
}
/* Special case a simple move with an input reload and a
@@ -5992,8 +5992,8 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
else
{
enum reg_class rclass = context_reg_class;
- if ((unsigned) CLASS_MAX_NREGS (rclass, GET_MODE (SUBREG_REG (x)))
- > reg_class_size[rclass])
+ if (ira_reg_class_max_nregs [rclass][GET_MODE (SUBREG_REG (x))]
+ > reg_class_size[(int) rclass])
{
x = find_reloads_subreg_address (x, 0, opnum,
ADDR_TYPE (type),
@@ -6137,11 +6137,11 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum,
XEXP (tem, 0) = plus_constant (XEXP (tem, 0), offset);
PUT_MODE (tem, GET_MODE (x));
- if (MEM_OFFSET (tem))
- set_mem_offset (tem, plus_constant (MEM_OFFSET (tem), offset));
- if (MEM_SIZE (tem)
- && INTVAL (MEM_SIZE (tem)) != (HOST_WIDE_INT) outer_size)
- set_mem_size (tem, GEN_INT (outer_size));
+ if (MEM_OFFSET_KNOWN_P (tem))
+ set_mem_offset (tem, MEM_OFFSET (tem) + offset);
+ if (MEM_SIZE_KNOWN_P (tem)
+ && MEM_SIZE (tem) != (HOST_WIDE_INT) outer_size)
+ set_mem_size (tem, outer_size);
/* If this was a paradoxical subreg that we replaced, the
resulting memory must be sufficiently aligned to allow
diff --git a/gcc/rtl.h b/gcc/rtl.h
index e3ceecddc2f..1490bfe432c 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -136,19 +136,38 @@ typedef struct
/* Structure used to describe the attributes of a MEM. These are hashed
so MEMs that the same attributes share a data structure. This means
- they cannot be modified in place. If any element is nonzero, it means
- the value of the corresponding attribute is unknown. */
-/* ALIGN and SIZE are the alignment and size of the MEM itself,
- while EXPR can describe a larger underlying object, which might have a
- stricter alignment; OFFSET is the offset of the MEM within that object. */
+ they cannot be modified in place. */
typedef struct GTY(()) mem_attrs
{
- tree expr; /* expr corresponding to MEM. */
- rtx offset; /* Offset from start of DECL, as CONST_INT. */
- rtx size; /* Size in bytes, as a CONST_INT. */
- alias_set_type alias; /* Memory alias set. */
- unsigned int align; /* Alignment of MEM in bits. */
- unsigned char addrspace; /* Address space (0 for generic). */
+ /* The expression that the MEM accesses, or null if not known.
+ This expression might be larger than the memory reference itself.
+ (In other words, the MEM might access only part of the object.) */
+ tree expr;
+
+ /* The offset of the memory reference from the start of EXPR.
+ Only valid if OFFSET_KNOWN_P. */
+ HOST_WIDE_INT offset;
+
+ /* The size of the memory reference in bytes. Only valid if
+ SIZE_KNOWN_P. */
+ HOST_WIDE_INT size;
+
+ /* The alias set of the memory reference. */
+ alias_set_type alias;
+
+ /* The alignment of the reference in bits. Always a multiple of
+ BITS_PER_UNIT. Note that EXPR may have a stricter alignment
+ than the memory reference itself. */
+ unsigned int align;
+
+ /* The address space that the memory reference uses. */
+ unsigned char addrspace;
+
+ /* True if OFFSET is known. */
+ bool offset_known_p;
+
+ /* True if SIZE is known. */
+ bool size_known_p;
} mem_attrs;
/* Structure used to describe the attributes of a REG in similar way as
@@ -1289,39 +1308,40 @@ do { \
in the block and provide defaults if none specified. */
#define REG_ATTRS(RTX) X0REGATTR (RTX, 2)
+#ifndef GENERATOR_FILE
/* For a MEM rtx, the alias set. If 0, this MEM is not in any alias
set, and may alias anything. Otherwise, the MEM can only alias
MEMs in a conflicting alias set. This value is set in a
language-dependent manner in the front-end, and should not be
altered in the back-end. These set numbers are tested with
alias_sets_conflict_p. */
-#define MEM_ALIAS_SET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->alias)
+#define MEM_ALIAS_SET(RTX) (get_mem_attrs (RTX)->alias)
/* For a MEM rtx, the decl it is known to refer to, if it is known to
refer to part of a DECL. It may also be a COMPONENT_REF. */
-#define MEM_EXPR(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->expr)
+#define MEM_EXPR(RTX) (get_mem_attrs (RTX)->expr)
+
+/* For a MEM rtx, true if its MEM_OFFSET is known. */
+#define MEM_OFFSET_KNOWN_P(RTX) (get_mem_attrs (RTX)->offset_known_p)
-/* For a MEM rtx, the offset from the start of MEM_EXPR, if known, as a
- RTX that is always a CONST_INT. */
-#define MEM_OFFSET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->offset)
+/* For a MEM rtx, the offset from the start of MEM_EXPR. */
+#define MEM_OFFSET(RTX) (get_mem_attrs (RTX)->offset)
/* For a MEM rtx, the address space. */
-#define MEM_ADDR_SPACE(RTX) (MEM_ATTRS (RTX) == 0 ? ADDR_SPACE_GENERIC \
- : MEM_ATTRS (RTX)->addrspace)
+#define MEM_ADDR_SPACE(RTX) (get_mem_attrs (RTX)->addrspace)
-/* For a MEM rtx, the size in bytes of the MEM, if known, as an RTX that
- is always a CONST_INT. */
-#define MEM_SIZE(RTX) \
-(MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->size \
- : GET_MODE (RTX) != BLKmode ? GEN_INT (GET_MODE_SIZE (GET_MODE (RTX))) \
- : 0)
+/* For a MEM rtx, true if its MEM_SIZE is known. */
+#define MEM_SIZE_KNOWN_P(RTX) (get_mem_attrs (RTX)->size_known_p)
+
+/* For a MEM rtx, the size in bytes of the MEM. */
+#define MEM_SIZE(RTX) (get_mem_attrs (RTX)->size)
/* For a MEM rtx, the alignment in bits. We can use the alignment of the
mode as a default when STRICT_ALIGNMENT, but not if not. */
-#define MEM_ALIGN(RTX) \
-(MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->align \
- : (STRICT_ALIGNMENT && GET_MODE (RTX) != BLKmode \
- ? GET_MODE_ALIGNMENT (GET_MODE (RTX)) : BITS_PER_UNIT))
+#define MEM_ALIGN(RTX) (get_mem_attrs (RTX)->align)
+#else
+#define MEM_ADDR_SPACE(RTX) ADDR_SPACE_GENERIC
+#endif
/* For a REG rtx, the decl it is known to refer to, if it is known to
refer to part of a DECL. */
@@ -2120,6 +2140,9 @@ struct GTY(()) target_rtl {
/* Static hunks of RTL used by the aliasing code; these are treated
as persistent to avoid unnecessary RTL allocations. */
rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER];
+
+ /* The default memory attributes for each mode. */
+ struct mem_attrs *x_mode_mem_attrs[(int) MAX_MACHINE_MODE];
};
extern GTY(()) struct target_rtl default_target_rtl;
@@ -2137,6 +2160,8 @@ extern struct target_rtl *this_target_rtl;
(this_target_rtl->x_return_address_pointer_rtx)
#define top_of_stack \
(this_target_rtl->x_top_of_stack)
+#define mode_mem_attrs \
+ (this_target_rtl->x_mode_mem_attrs)
/* Standard pieces of rtx, to be substituted directly into things. */
#define pc_rtx (global_rtl[GR_PC])
@@ -2151,6 +2176,20 @@ extern struct target_rtl *this_target_rtl;
#define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
+#ifndef GENERATOR_FILE
+/* Return the attributes of a MEM rtx. */
+static inline struct mem_attrs *
+get_mem_attrs (const_rtx x)
+{
+ struct mem_attrs *attrs;
+
+ attrs = MEM_ATTRS (x);
+ if (!attrs)
+ attrs = mode_mem_attrs[(int) GET_MODE (x)];
+ return attrs;
+}
+#endif
+
/* Include the RTL generation functions. */
#ifndef GENERATOR_FILE
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c3cdd31b6d0..3692c16004b 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2279,7 +2279,7 @@ may_trap_p_1 (const_rtx x, unsigned flags)
code_changed
|| !MEM_NOTRAP_P (x))
{
- HOST_WIDE_INT size = MEM_SIZE (x) ? INTVAL (MEM_SIZE (x)) : 0;
+ HOST_WIDE_INT size = MEM_SIZE_KNOWN_P (x) ? MEM_SIZE (x) : 0;
return rtx_addr_can_trap_p_1 (XEXP (x, 0), 0, size,
GET_MODE (x), code_changed);
}
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 82b818b02f1..2d7d8dd03f9 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -268,7 +268,7 @@ delegitimize_mem_from_attrs (rtx x)
use their base addresses as equivalent. */
if (MEM_P (x)
&& MEM_EXPR (x)
- && MEM_OFFSET (x))
+ && MEM_OFFSET_KNOWN_P (x))
{
tree decl = MEM_EXPR (x);
enum machine_mode mode = GET_MODE (x);
@@ -321,7 +321,7 @@ delegitimize_mem_from_attrs (rtx x)
{
rtx newx;
- offset += INTVAL (MEM_OFFSET (x));
+ offset += MEM_OFFSET (x);
newx = DECL_RTL (decl);
diff --git a/gcc/system.h b/gcc/system.h
index e02cbcd012c..ce027b2ea1e 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -500,6 +500,12 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
&& !defined(__cplusplus))
#endif
+#if !defined(HAVE_DESIGNATED_UNION_INITIALIZERS)
+#define HAVE_DESIGNATED_UNION_INITIALIZERS \
+ (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) \
+ && (!defined(__cplusplus) || (GCC_VERSION >= 4007)))
+#endif
+
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
diff --git a/gcc/target.def b/gcc/target.def
index 3a0b413a80a..9ff97e690e9 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -2245,6 +2245,14 @@ DEFHOOK
bool, (reg_class_t rclass),
default_class_likely_spilled_p)
+/* Return the maximum number of consecutive registers
+ needed to represent mode MODE in a register of class RCLASS. */
+DEFHOOK
+(class_max_nregs,
+ "",
+ unsigned char, (reg_class_t rclass, enum machine_mode mode),
+ default_class_max_nregs)
+
DEFHOOK
(preferred_rename_class,
"A target hook that places additional preference on the register\
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index f69b39626a6..16d0b189f65 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1309,6 +1309,19 @@ default_class_likely_spilled_p (reg_class_t rclass)
return (reg_class_size[(int) rclass] == 1);
}
+/* The default implementation of TARGET_CLASS_MAX_NREGS. */
+
+unsigned char
+default_class_max_nregs (reg_class_t rclass ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+#ifdef CLASS_MAX_NREGS
+ return (unsigned char) CLASS_MAX_NREGS ((enum reg_class) rclass, mode);
+#else
+ return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
+#endif
+}
+
/* Determine the debugging unwind mechanism for the target. */
enum unwind_info_type
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 62e888445bb..552407b21db 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -163,6 +163,7 @@ extern reg_class_t default_preferred_reload_class (rtx, reg_class_t);
extern reg_class_t default_preferred_output_reload_class (rtx, reg_class_t);
extern reg_class_t default_preferred_rename_class (reg_class_t rclass);
extern bool default_class_likely_spilled_p (reg_class_t);
+extern unsigned char default_class_max_nregs (reg_class_t, enum machine_mode);
extern enum unwind_info_type default_debug_unwind_info (void);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9eb36a76045..c49e0b78fe8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,141 @@
+2011-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/target-supports.exp (check_avx_os_support_available): New.
+ (check_effective_target_avx_runtime): Use it.
+
+2011-07-21 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49770
+ * g++.dg/torture/pr49770.C: New testcase.
+
+2011-07-21 Kai Tietz <ktietz@redhat.com>
+
+ * gcc.dg/tree-ssa/pr30978.c: adjusted.
+ * gcc.dg/tree-ssa/ssa-fre-6.c: Likewise.
+
+2011-07-21 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/coarray_lib_token_1.f90: New.
+
+2011-07-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * gcc.dg/pr32912-2.c: Skip for AVR.
+ * gcc.dg/pr44674.c: Add dg-require-profiling.
+
+2011-07-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/ext/desig2.C: New.
+
+2011-07-20 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * gcc.target/powerpc/ppc-fma-1.c: Adjust to allow non-VSX fmas to
+ be generated.
+ * gcc.target/powerpc/ppc-fma-2.c: Ditto.
+ * gcc.target/powerpc/recip-3.c: Ditto.
+
+2011-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/6709 (DR 743)
+ PR c++/42603 (DR 950)
+ * g++.dg/cpp0x/decltype21.C: New.
+
+2011-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/18908
+ * gcc.dg/tree-ssa/pr18908.c: New testcase.
+ * gcc.dg/tree-ssa/bitwise-sink.c: Adjust.
+
+2011-07-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * gcc.target/arm/combine-movs.c: New.
+ * gcc.target/arm/unsigned-extend-2.c: New.
+
+2011-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/49785
+ * g++.dg/cpp0x/variadic114.C: New.
+
+2011-07-19 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/coarray_args_1.f90: New.
+ * gfortran.dg/coarray_args_2.f90: New.
+
+2011-07-19 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/49708
+ * gfortran.dg/allocate_error_3.f90: New.
+
+2011-07-19 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/bool-10.c: Adjust expected pattern.
+ * gcc.dg/tree-ssa/bool-11.c: Likewise.
+ * gcc.dg/torture/20110719-1.c: New testcase.
+
+2011-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/49768
+ * gcc.c-torture/execute/pr49768.c: New test.
+
+2011-07-19 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/49771
+ * gcc.dg/vect/pr49771.c: New test.
+
+2011-07-18 Martin Jambor <mjambor@suse.cz>
+
+ * gcc.dg/ipa/ipa-1.c: Updated testcase dump scan.
+ * gcc.dg/ipa/ipa-2.c: Likewise.
+ * gcc.dg/ipa/ipa-3.c: Likewise and made functions static.
+ * gcc.dg/ipa/ipa-4.c: Updated testcase dump scan.
+ * gcc.dg/ipa/ipa-5.c: Likewise.
+ * gcc.dg/ipa/ipa-7.c: Likewise.
+ * gcc.dg/ipa/ipa-8.c: Updated testcase dump scan.
+ * gcc.dg/ipa/ipacost-1.c: Likewise.
+ * gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some
+ functions.
+ * gcc.dg/ipa/ipcp-1.c: New test.
+ * gcc.dg/ipa/ipcp-2.c: Likewise.
+ * gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase.
+
+2011-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49675
+ * gfortran.dg/pr49675.f90: New test.
+
+2011-07-18 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/torture/20110718-1.c: New testcase.
+
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * g++.dg/ext/bitfield2.C: Remove i?86-*-netware support.
+ * g++.dg/ext/bitfield3.C: Likewise.
+ * g++.dg/ext/bitfield4.C: Likewise.
+ * g++.dg/ext/bitfield5.C: Likewise.
+ * g++.dg/other/PR23205.C: Remove *-*-netware* support.
+ * g++.dg/other/pr23205-2.C: Likewise.
+ * gcc.c-torture/compile/20001109-1.c: Remove dg-xfail-if.
+ * gcc.c-torture/compile/20001109-2.c: Likewise.
+ * gcc.dg/20040813-1.c: Remove *-*-netware* support.
+ * gcc.dg/bitfld-15.c: Remove i?86-*-netware support.
+ * gcc.dg/bitfld-16.c: Likewise.
+ * gcc.dg/bitfld-17.c: Likewise.
+ * gcc.dg/bitfld-18.c: Likewise.
+ * gcc.dg/builtins-config.h: Remove Netware support.
+ * gcc.dg/cdce1.c: Remove *-*-netware* support. Update line number.
+ * gcc.dg/cdce2.c: Likewise.
+ * gcc.dg/cpp/assert4.c: Remove netware support.
+ * gcc.dg/debug/pr35154.c: Remove *-*-netware* support.
+ * gfortran.dg/debug/pr35154-stabs.f: Remove *-*-netware* support.
+
+ * lib/target-supports.exp (check_visibility_available): Remove
+ NetWare support.
+ (check_profiling_available): Likewise.
+
+2011-07-18 Ira Rosen <ira.rosen@linaro.org>
+
+ * gcc.dg/vect/pr49038.c: Run only on targets that support mmap.
+
2011-07-17 Tobias Burnus <burnus@net-b.de>
Thomas Koenig <tkoenig@gcc.gnu.org>
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype21.C b/gcc/testsuite/g++.dg/cpp0x/decltype21.C
new file mode 100644
index 00000000000..ee73bfbc36c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype21.C
@@ -0,0 +1,18 @@
+// PR c++/6709 (DR 743)
+// PR c++/42603 (DR 950)
+// { dg-options -std=c++0x }
+
+template <class T>
+T make();
+
+struct p { typedef int t; };
+struct c : decltype(make<p>()) {};
+
+decltype(make<p>())::t t;
+
+int f();
+decltype(f())::t t2; // { dg-error "not a class" }
+
+struct D: decltype(f()) { }; // { dg-error "not a class" }
+
+// { dg-prune-output "expected initializer" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic114.C b/gcc/testsuite/g++.dg/cpp0x/variadic114.C
new file mode 100644
index 00000000000..3ffede5c507
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic114.C
@@ -0,0 +1,27 @@
+// PR c++/49785
+// { dg-options -std=c++0x }
+
+template <typename, typename ...> struct B { };
+template <typename> class A;
+
+template <typename R, typename ... S>
+struct A <R (S ...)> : public B <R, S ...>
+{
+ struct C {};
+ template <typename D> A (D, C = C ()) { }
+ R operator () (...);
+};
+
+template <typename R, typename ... S, typename T>
+auto operator >> (A <R (S ...)>, T)->A <R (S ...)>
+{
+ []() {};
+}
+
+int
+main ()
+{
+ A <int (int, int)> a = [](int, int) {};
+ auto b = []{};
+ (a >> b) (3, 5);
+}
diff --git a/gcc/testsuite/g++.dg/ext/bitfield2.C b/gcc/testsuite/g++.dg/ext/bitfield2.C
index c288cec7c33..09e0352f1d0 100644
--- a/gcc/testsuite/g++.dg/ext/bitfield2.C
+++ b/gcc/testsuite/g++.dg/ext/bitfield2.C
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* Remove pedantic. Allow the GCC extension to use char for bitfields. */
/* { dg-options "" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t /* { dg-message "note: offset of packed bit-field 't::b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
{
diff --git a/gcc/testsuite/g++.dg/ext/bitfield3.C b/gcc/testsuite/g++.dg/ext/bitfield3.C
index f9fb78cceee..75d290f00e1 100644
--- a/gcc/testsuite/g++.dg/ext/bitfield3.C
+++ b/gcc/testsuite/g++.dg/ext/bitfield3.C
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
diff --git a/gcc/testsuite/g++.dg/ext/bitfield4.C b/gcc/testsuite/g++.dg/ext/bitfield4.C
index 8562686d6eb..d707376e804 100644
--- a/gcc/testsuite/g++.dg/ext/bitfield4.C
+++ b/gcc/testsuite/g++.dg/ext/bitfield4.C
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t /* { dg-message "note: offset of packed bit-field 't::b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
{
diff --git a/gcc/testsuite/g++.dg/ext/bitfield5.C b/gcc/testsuite/g++.dg/ext/bitfield5.C
index 1d862d76975..748669543c1 100644
--- a/gcc/testsuite/g++.dg/ext/bitfield5.C
+++ b/gcc/testsuite/g++.dg/ext/bitfield5.C
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
diff --git a/gcc/testsuite/g++.dg/ext/desig2.C b/gcc/testsuite/g++.dg/ext/desig2.C
new file mode 100644
index 00000000000..229ae527d77
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/desig2.C
@@ -0,0 +1,25 @@
+// Test for C99-style designated array initializer
+
+union U
+{
+ long l;
+ const char *p;
+};
+
+__extension__ U u = { .p = "" };
+
+__extension__ int i[4] = { [0] = 1, [1] = 2 };
+
+// Currently, except for unions, the C++ front end only supports
+// designators that designate the element that would have been initialized
+// anyway. While that's true, make sure that we get a sorry rather than
+// bad code.
+
+struct A
+{
+ int i;
+ int j;
+};
+
+__extension__ A a = { .j = 1 }; // { dg-message "non-trivial" }
+__extension__ int j[2] = { [1] = 1 }; // { dg-message "non-trivial" }
diff --git a/gcc/testsuite/g++.dg/other/PR23205.C b/gcc/testsuite/g++.dg/other/PR23205.C
index 27353544482..338079fbd93 100644
--- a/gcc/testsuite/g++.dg/other/PR23205.C
+++ b/gcc/testsuite/g++.dg/other/PR23205.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks } { "*" } { "" } } */
+/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks } { "*" } { "" } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */
const int foobar = 4;
diff --git a/gcc/testsuite/g++.dg/other/pr23205-2.C b/gcc/testsuite/g++.dg/other/pr23205-2.C
index 608108ad9a0..a4333b38630 100644
--- a/gcc/testsuite/g++.dg/other/pr23205-2.C
+++ b/gcc/testsuite/g++.dg/other/pr23205-2.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */
+/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */
const int foobar = 4;
diff --git a/gcc/testsuite/g++.dg/torture/pr49770.C b/gcc/testsuite/g++.dg/torture/pr49770.C
new file mode 100644
index 00000000000..7eac9e0d9bb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr49770.C
@@ -0,0 +1,86 @@
+/* { dg-do run } */
+/* { dg-options "-std=c++0x -fno-tree-forwprop" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+template < typename > struct remove_reference;
+template < typename _Tp > struct remove_reference <_Tp & >
+{
+ typedef _Tp type;
+};
+template < typename _Tp > typename remove_reference < _Tp >::type &&
+move (_Tp && __t)
+{
+ return static_cast < typename remove_reference < _Tp >::type && >(__t);
+}
+
+template < typename _Tp > void
+stdswap (_Tp & __a, _Tp & __b)
+{
+ _Tp __tmp (__a);
+ __a = (__b);
+ __b = (__tmp);
+}
+
+struct _Deque_iterator
+{
+ int *_M_cur;
+ int *_M_first;
+ int *_M_last;
+ int **_M_node;
+};
+
+static inline int operatorMIN (_Deque_iterator & __x, _Deque_iterator & __y)
+{
+ return sizeof (int) * (__x._M_node - __y._M_node - 1)
+ + (__x._M_cur - __x._M_first) + (__y._M_last - __y._M_cur);
+}
+
+struct deque
+{
+ deque & operator = (deque && __x)
+ {
+ stdswap (_M_finish, __x._M_finish);
+ return *this;
+ }
+ size_t size ()
+ {
+ return operatorMIN (_M_finish, _M_start);
+ }
+
+deque ():
+ _M_map (), _M_map_size (), _M_start (), _M_finish ()
+ {
+ _M_start._M_last = _M_start._M_first + sizeof (int);
+ }
+
+ int **_M_map;
+ size_t _M_map_size;
+ _Deque_iterator _M_start;
+ _Deque_iterator _M_finish;
+};
+
+struct queue
+{
+ deque c;
+ size_t size ()
+ {
+ return c.size ();
+ }
+};
+
+void
+test01 ()
+{
+ queue a, b;
+ ++a.c._M_finish._M_cur;
+ b = move (a);
+ if (!b.size ())
+ __builtin_abort ();
+}
+
+main ()
+{
+ test01 ();
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20001109-1.c b/gcc/testsuite/gcc.c-torture/compile/20001109-1.c
index 6e513c9563f..cce8047ae8a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20001109-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20001109-1.c
@@ -1,5 +1,3 @@
-/* This does not work on NetWare, which has a default of 1-byte alignment. */
-/* { dg-xfail-if "" { "*-*-netware*" } { "*" } { "" } } */
typedef struct _foo foo;
extern foo bar;
struct _foo {
diff --git a/gcc/testsuite/gcc.c-torture/compile/20001109-2.c b/gcc/testsuite/gcc.c-torture/compile/20001109-2.c
index 1448215c578..a23e56bd34b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20001109-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20001109-2.c
@@ -1,5 +1,3 @@
-/* This does not work on NetWare, which has a default of 1-byte alignment. */
-/* { dg-xfail-if "" { "*-*-netware*" } { "*" } { "" } } */
extern struct foo bar;
struct foo {
int a;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49768.c b/gcc/testsuite/gcc.c-torture/execute/pr49768.c
new file mode 100644
index 00000000000..85bc9d2a06f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr49768.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/49768 */
+
+extern void abort (void);
+
+int
+main ()
+{
+ static struct { unsigned int : 1; unsigned int s : 1; } s = { .s = 1 };
+ if (s.s != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/20040813-1.c b/gcc/testsuite/gcc.dg/20040813-1.c
index fa01a530208..bf87f4172cf 100644
--- a/gcc/testsuite/gcc.dg/20040813-1.c
+++ b/gcc/testsuite/gcc.dg/20040813-1.c
@@ -2,7 +2,7 @@
/* Contributed by Devang Patel <dpatel@apple.com> */
/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */
+/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */
/* { dg-options "-gstabs" } */
int
diff --git a/gcc/testsuite/gcc.dg/binop-xor1.c b/gcc/testsuite/gcc.dg/binop-xor1.c
index 53a2ce23ab3..48f6b425959 100644
--- a/gcc/testsuite/gcc.dg/binop-xor1.c
+++ b/gcc/testsuite/gcc.dg/binop-xor1.c
@@ -7,8 +7,5 @@ foo (int a, int b, int c)
return ((a && !b && c) || (!a && b && c));
}
-/* We expect to see "<bb N>"; confirm that, so that we know to count
- it in the real test. */
-/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 5 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/binop-xor3.c b/gcc/testsuite/gcc.dg/binop-xor3.c
index 97c7888189a..9d3b50bd4ee 100644
--- a/gcc/testsuite/gcc.dg/binop-xor3.c
+++ b/gcc/testsuite/gcc.dg/binop-xor3.c
@@ -7,8 +7,5 @@ foo (int a, int b)
return ((a && !b) || (!a && b));
}
-/* We expect to see "<bb N>"; confirm that, so that we know to count
- it in the real test. */
-/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/bitfld-15.c b/gcc/testsuite/gcc.dg/bitfld-15.c
index 03f43f2de8c..32878d74dbc 100644
--- a/gcc/testsuite/gcc.dg/bitfld-15.c
+++ b/gcc/testsuite/gcc.dg/bitfld-15.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* Remove pedantic. Allow the GCC extension to use char for bitfields. */
/* { dg-options "" } */
-/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */
/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
diff --git a/gcc/testsuite/gcc.dg/bitfld-16.c b/gcc/testsuite/gcc.dg/bitfld-16.c
index 5ed30f74392..75d290f00e1 100644
--- a/gcc/testsuite/gcc.dg/bitfld-16.c
+++ b/gcc/testsuite/gcc.dg/bitfld-16.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */
/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
diff --git a/gcc/testsuite/gcc.dg/bitfld-17.c b/gcc/testsuite/gcc.dg/bitfld-17.c
index 9512f5fdf2a..6dc6989df7b 100644
--- a/gcc/testsuite/gcc.dg/bitfld-17.c
+++ b/gcc/testsuite/gcc.dg/bitfld-17.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "" } */
-/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */
/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
diff --git a/gcc/testsuite/gcc.dg/bitfld-18.c b/gcc/testsuite/gcc.dg/bitfld-18.c
index 067d9ae3851..748669543c1 100644
--- a/gcc/testsuite/gcc.dg/bitfld-18.c
+++ b/gcc/testsuite/gcc.dg/bitfld-18.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */
/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h
index 49ec0dcc8e4..fc1ade677a2 100644
--- a/gcc/testsuite/gcc.dg/builtins-config.h
+++ b/gcc/testsuite/gcc.dg/builtins-config.h
@@ -15,8 +15,6 @@
/* AVR doesn't have the entire C99 runtime. */
#elif defined(__FreeBSD__) && (__FreeBSD__ < 9)
/* FreeBSD up to version 8 lacks support for cexp and friends. */
-#elif defined(__netware__)
-/* NetWare doesn't have the entire C99 runtime. */
#elif defined(__vxworks)
/* VxWorks doesn't have a full C99 time. (cabs is missing, for example.) */
#elif defined(_WIN32) && !defined(__CYGWIN__)
diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c
index 58a3ddfb3a9..3bd35ecb786 100644
--- a/gcc/testsuite/gcc.dg/cdce1.c
+++ b/gcc/testsuite/gcc.dg/cdce1.c
@@ -1,7 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
-/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */
-/* { dg-final { scan-tree-dump "cdce1.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } } */
+/* { dg-final { scan-tree-dump "cdce1.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } } */
/* { dg-final { cleanup-tree-dump "cdce" } } */
/* { dg-require-effective-target large_double } */
diff --git a/gcc/testsuite/gcc.dg/cdce2.c b/gcc/testsuite/gcc.dg/cdce2.c
index eebebaa2390..a461ce7ac30 100644
--- a/gcc/testsuite/gcc.dg/cdce2.c
+++ b/gcc/testsuite/gcc.dg/cdce2.c
@@ -1,8 +1,7 @@
/* { dg-do run } */
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
-/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */
-/* { dg-final { scan-tree-dump "cdce2.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
+/* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { cleanup-tree-dump "cdce" } } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc/testsuite/gcc.dg/cpp/assert4.c
index ff53946c6ce..a05ef130206 100644
--- a/gcc/testsuite/gcc.dg/cpp/assert4.c
+++ b/gcc/testsuite/gcc.dg/cpp/assert4.c
@@ -128,14 +128,6 @@
# error
#endif
-#if defined __netware__
-# if !#system(netware)
-# error
-# endif
-#elif #system(netware)
-# error
-#endif
-
/* Check for #cpu and #machine assertions. */
diff --git a/gcc/testsuite/gcc.dg/debug/pr35154.c b/gcc/testsuite/gcc.dg/debug/pr35154.c
index 8706c5c295a..fa658be2cbe 100644
--- a/gcc/testsuite/gcc.dg/debug/pr35154.c
+++ b/gcc/testsuite/gcc.dg/debug/pr35154.c
@@ -23,7 +23,7 @@ main()
optb.f2 = 'D';
i_outer = 'e';
/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */
+/* { dg-skip-if "No stabs" { mmix-*-* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */
/* { dg-skip-if "stabs only" { *-*-* } { "*" } { "-gstabs" } } */
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
index e3212853cf5..3517b035f1c 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
@@ -24,9 +24,8 @@ int main ()
}
-/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
-/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
index 1d57fb00828..122a4a0181a 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
@@ -22,7 +22,6 @@ int main ()
}
-/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
-/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
index a3334c34543..e15f084b400 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
@@ -7,12 +7,12 @@
#include <stdio.h>
void t(void);
-int g (double b, double c)
+static int g (double b, double c)
{
t();
return (int)(b+c);
}
-int f (double a)
+static int f (double a)
{
if (a > 0)
g (a, 3.1);
@@ -28,8 +28,9 @@ int main ()
}
-/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of g" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
index 3cb0cd4d27e..88716dd8f4c 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
@@ -25,6 +25,6 @@ int main ()
}
-/* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
index 50af18e2b01..22d1be89c0e 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
@@ -26,8 +26,7 @@ int main ()
return 0;
}
-
-/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node" 2 "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
index 6dcc914c103..c8b510046a1 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
@@ -26,8 +26,8 @@ int main ()
}
-/* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param . with const 7" 1 "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-8.c b/gcc/testsuite/gcc.dg/ipa/ipa-8.c
index edea7f900b4..dcbed13a0ed 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-8.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-8.c
@@ -22,8 +22,9 @@ int main ()
}
-/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of g" "cp" } } */
/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
index d91546899ea..4fce41e8235 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
@@ -51,10 +51,10 @@ main()
i_can_not_be_propagated_fully2 (array);
}
-/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully2" "cp" } } */
-/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully " "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */
/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully " "optimized" } } */
/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 " "optimized" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
index 6ebd6d37481..ceb524e00ae 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
@@ -40,8 +40,23 @@ i_can_not_be_propagated_fully (int *a)
int
i_can_not_be_propagated_fully2 (int *a)
{
+ int i;
i_can_not_be_propagated_fully (a);
+ for (i=0;i<50;i++)
+ {
+ t(a[i] + 1);
+ t(a[i+1] + 1);
+ t(a[i+2] + 1);
+ t(a[i+3] + 1);
+ }
i_can_not_be_propagated_fully (a);
+ for (i=0;i<50;i++)
+ {
+ t(a[i] + 2);
+ t(a[i+1] + 2);
+ t(a[i+2] + 2);
+ t(a[i+3] + 2);
+ }
i_can_not_be_propagated_fully (a);
}
main()
@@ -50,15 +65,15 @@ main()
i_can_be_propagated_fully2 (array);
i_can_be_propagated_fully2 (array);
- for (i = 0; i < 100; i++)
+ for (i = 0; i < 7; i++)
i_can_not_be_propagated_fully2 (array);
i_can_not_be_propagated_fully2 (array);
}
-/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "versioned function i_can_not_be_propagated_fully2" 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "versioned function i_can_not_be_propagated_fully " 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */
/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully \\(" "optimized" } } */
/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 \\(" "optimized" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-1.c b/gcc/testsuite/gcc.dg/ipa/ipcp-1.c
new file mode 100644
index 00000000000..0f50ff9276a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipcp-1.c
@@ -0,0 +1,52 @@
+/* Test that IPA-CP is able to figure out that poth parameters a are constant 7
+ even though f and h recursively call each other and specialize them
+ accordinly. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern void use_stuff (int);
+
+static
+int g (int b, int c)
+{
+ int i;
+
+ for (i = 0; i < b; i++)
+ use_stuff (c);
+}
+
+static void f (int a, int x, int z);
+
+static void h (int z, int a)
+{
+ use_stuff (z);
+ f (a, 9, 10);
+
+}
+
+static void
+f (int a, int x, int z)
+{
+ if (z > 1)
+ g (a, x);
+ else
+ h (5, a);
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7, 8, argc);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-2.c b/gcc/testsuite/gcc.dg/ipa/ipcp-2.c
new file mode 100644
index 00000000000..c6dcdf0af52
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipcp-2.c
@@ -0,0 +1,99 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern int get_stuff (int);
+extern void do_stuff (int);
+extern void do_stuff2 (int);
+extern void do_other_stuff (void);
+extern int get_element (int, int, int);
+extern int adjust (int, int, int, int);
+
+extern int count;
+
+int
+foo (int s, int p)
+{
+ int c, r = 0;
+
+ for (c = 0 ; c < count; c++)
+ {
+ r += get_stuff (s);
+ /* The following is just something big that can go away. */
+ if (p != 0)
+ {
+ int a[64][64];
+ int i, j, k;
+
+ for (i = 0; i < 64; i++)
+ for (j = 0; j < 64; j++)
+ a[i][j] = get_element (p + c, i, j);
+
+ for (k = 0; k < 4; k++)
+ {
+ r = r / 2;
+
+ for (i = 1; i < 63; i++)
+ for (j = 62; j > 0; j--)
+ a[i][j] += adjust (a[i-1][j], a[i][j-1],
+ a[i+1][j], a[i][j+1]);
+
+ for (i = 4; i < 64; i += 4)
+ for (j = 4; j < 64; j += 4)
+ r += a[i][j] / 4;
+ }
+ }
+ }
+ return r;
+}
+
+int
+bar (int p, int q)
+{
+ if (q > 0)
+ do_stuff (q);
+ else
+ do_stuff (-q);
+
+ if (q % 2)
+ do_stuff2 (2 * q);
+ else
+ do_stuff2 (2 * (q + 1));
+
+ return foo (4, p);
+}
+
+int
+bah (int p, int q)
+{
+ int i, j;
+
+ while (q < -20)
+ q += get_stuff (-q);
+
+ for (i = 0; i < 36; i++)
+ for (j = 0; j < 36; j++)
+ do_stuff (get_stuff (q * i + 2));
+
+ bar (p, q);
+}
+
+int
+top1 (int q)
+{
+ do_other_stuff ();
+ return bah (0, q);
+}
+
+int
+top2 (int q)
+{
+ do_stuff (200);
+ do_other_stuff ();
+ return bah (16, q);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param p with const 0" 3 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param s with const 4" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/pr32912-2.c b/gcc/testsuite/gcc.dg/pr32912-2.c
index f3c754cc346..f29e63e7058 100644
--- a/gcc/testsuite/gcc.dg/pr32912-2.c
+++ b/gcc/testsuite/gcc.dg/pr32912-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -w" } */
+/* { dg-skip-if "TImode not supported" { "avr-*-*" } { "*" } { "" } } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/pr44674.c b/gcc/testsuite/gcc.dg/pr44674.c
index c3f16ff20ee..c71b49ea5f6 100644
--- a/gcc/testsuite/gcc.dg/pr44674.c
+++ b/gcc/testsuite/gcc.dg/pr44674.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O -fprofile-generate" } */
+/* { dg-require-profiling "-fprofile-generate" } */
void
jumpfunc (void *p)
diff --git a/gcc/testsuite/gcc.dg/torture/20110718-1.c b/gcc/testsuite/gcc.dg/torture/20110718-1.c
new file mode 100644
index 00000000000..ccabbd91421
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/20110718-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct X {
+#if (__SIZEOF_LONG__ != __SIZEOF_INT__) && (__SIZEOF_LONG__ == 8)
+ unsigned long i : 33;
+#else
+ unsigned long i;
+#endif
+};
+unsigned long __attribute__((noinline))
+foo (struct X *p)
+{
+ return ~p->i;
+}
+int main()
+{
+ struct X x;
+ x.i = -1;
+ if (foo (&x) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/20110719-1.c b/gcc/testsuite/gcc.dg/torture/20110719-1.c
new file mode 100644
index 00000000000..7797e08ad2b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/20110719-1.c
@@ -0,0 +1,10 @@
+extern void abort (void);
+int i;
+int main()
+{
+ int b = i != 0;
+ int c = ~b;
+ if (c != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c b/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c
index f44529995b7..1de04bc8431 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c
@@ -7,5 +7,5 @@ foo (_Bool x)
return (x ^ 1);
}
-/* { dg-final { scan-tree-dump-times "x\[^ \]* \\^ 1" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "~x" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c
index d7bf20da81b..58d064539a7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c
@@ -9,6 +9,6 @@ int f(_Bool x)
/* There should be no != 1 which is produced by the front-end as
bool_var != 1 is the same as !bool_var. */
/* { dg-final { scan-tree-dump-times "!= 1" 0 "optimized"} } */
-/* { dg-final { scan-tree-dump-times "!x" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c
index 8d88b7e87d5..ee266c79cb9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c
@@ -9,6 +9,6 @@ int f(_Bool x)
/* There should be no == 0 which is produced by the front-end as
bool_var == 0 is the same as !bool_var. */
/* { dg-final { scan-tree-dump-times "== 0" 0 "optimized"} } */
-/* { dg-final { scan-tree-dump-times "!x" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
index 7918eb7562d..26b433823ac 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
@@ -5,9 +5,13 @@
int
very_long_function(int a)
{
- return very_long_function (a)/4;
+ if (a > 0)
+ return 2 * a + very_long_function (a)/4;
+ else
+ return 2 * -a + very_long_function (a)/4;
}
-main()
+
+blah ()
{
very_long_function (1);
}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c
new file mode 100644
index 00000000000..cfc92fec9c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+_Bool f3(_Bool *p) { *p ^= 1; }
+
+/* We should be able to canonicalize the above to use bitwise not. */
+/* { dg-final { scan-tree-dump "~D" "forwprop1" } } */
+/* { dg-final { scan-tree-dump-not "\\\^ 1" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c b/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c
index 3329383cbe8..ee45e5b4fe8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c
@@ -10,5 +10,8 @@ int foo(int a)
return e;
}
-/* { dg-final { scan-tree-dump "e_. = a_..D. > 0;" "optimized" } } */
+/* { dg-final { scan-tree-dump-times " = " 2 "optimized" } } */
+/* One comparison and one extension to int. */
+/* { dg-final { scan-tree-dump " = a_..D. > 0;" "optimized" } } */
+/* { dg-final { scan-tree-dump "e_. = \\\(int\\\)" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c
index 65883cd14bd..18a9d9b895a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c
@@ -2,5 +2,5 @@
/* { dg-options "-O -fdump-tree-fre1-details" } */
int i; int foo(void) { i = 2; int j = i * 2; int k = i + 2; return j == k; }
-/* { dg-final { scan-tree-dump-times "Replaced " 5 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Replaced " 6 "fre1" } } */
/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr49038.c b/gcc/testsuite/gcc.dg/vect/pr49038.c
index 91c214ffd4c..681e5d50a83 100644
--- a/gcc/testsuite/gcc.dg/vect/pr49038.c
+++ b/gcc/testsuite/gcc.dg/vect/pr49038.c
@@ -1,3 +1,5 @@
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* *-*-darwin* } } */
+
#include <sys/mman.h>
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/vect/pr49771.c b/gcc/testsuite/gcc.dg/vect/pr49771.c
new file mode 100644
index 00000000000..777f615365c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr49771.c
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <stdarg.h>
+
+static int a[1000];
+
+int
+foo (void)
+{
+ int j;
+ int i;
+ for (i = 0; i < 1000; i++)
+ for (j = 0; j < 1000; j++)
+ a[j] = a[i] + 1;
+ return a[0];
+}
+
+int
+main (void)
+{
+ int res = foo ();
+ if (res != 1999)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/arm/combine-movs.c b/gcc/testsuite/gcc.target/arm/combine-movs.c
new file mode 100644
index 00000000000..4209a331427
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/combine-movs.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { arm_thumb1 } } */
+/* { dg-options "-O" } */
+
+void foo (unsigned long r[], unsigned int d)
+{
+ int i, n = d / 32;
+ for (i = 0; i < n; ++i)
+ r[i] = 0;
+}
+
+/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */
diff --git a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
new file mode 100644
index 00000000000..b610b73617d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-options "-O" } */
+
+unsigned short foo (unsigned short x)
+{
+ unsigned char i = 0;
+ for (i = 0; i < 8; i++)
+ {
+ x >>= 1;
+ x &= 0x7fff;
+ }
+ return x;
+}
+
+/* { dg-final { scan-assembler "ands" } } */
+/* { dg-final { scan-assembler-not "uxtb" } } */
+/* { dg-final { scan-assembler-not "cmp" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c
index 674115a285a..a3d532485e1 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c
@@ -3,16 +3,16 @@
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O3 -ftree-vectorize -mcpu=power7 -ffast-math" } */
/* { dg-final { scan-assembler-times "xvmadd" 4 } } */
-/* { dg-final { scan-assembler-times "xsmadd" 2 } } */
+/* { dg-final { scan-assembler-times "xsmadd\|fmadd\ " 2 } } */
/* { dg-final { scan-assembler-times "fmadds" 2 } } */
/* { dg-final { scan-assembler-times "xvmsub" 2 } } */
-/* { dg-final { scan-assembler-times "xsmsub" 1 } } */
+/* { dg-final { scan-assembler-times "xsmsub\|fmsub\ " 1 } } */
/* { dg-final { scan-assembler-times "fmsubs" 1 } } */
/* { dg-final { scan-assembler-times "xvnmadd" 2 } } */
-/* { dg-final { scan-assembler-times "xsnmadd" 1 } } */
+/* { dg-final { scan-assembler-times "xsnmadd\|fnmadd " 1 } } */
/* { dg-final { scan-assembler-times "fnmadds" 1 } } */
/* { dg-final { scan-assembler-times "xvnmsub" 2 } } */
-/* { dg-final { scan-assembler-times "xsnmsub" 1 } } */
+/* { dg-final { scan-assembler-times "xsnmsub\|fnmsub " 1 } } */
/* { dg-final { scan-assembler-times "fnmsubs" 1 } } */
/* All functions should generate an appropriate (a * b) + c instruction
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c b/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c
index 111b9cb098e..f732b9fa417 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c
@@ -3,16 +3,16 @@
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O3 -ftree-vectorize -mcpu=power7 -ffast-math -ffp-contract=off" } */
/* { dg-final { scan-assembler-times "xvmadd" 2 } } */
-/* { dg-final { scan-assembler-times "xsmadd" 1 } } */
+/* { dg-final { scan-assembler-times "xsmadd\|fmadd\ " 1 } } */
/* { dg-final { scan-assembler-times "fmadds" 1 } } */
/* { dg-final { scan-assembler-times "xvmsub" 2 } } */
-/* { dg-final { scan-assembler-times "xsmsub" 1 } } */
+/* { dg-final { scan-assembler-times "xsmsub\|fmsub\ " 1 } } */
/* { dg-final { scan-assembler-times "fmsubs" 1 } } */
/* { dg-final { scan-assembler-times "xvnmadd" 2 } } */
-/* { dg-final { scan-assembler-times "xsnmadd" 1 } } */
+/* { dg-final { scan-assembler-times "xsnmadd\|fnmadd\ " 1 } } */
/* { dg-final { scan-assembler-times "fnmadds" 1 } } */
/* { dg-final { scan-assembler-times "xvnmsub" 2 } } */
-/* { dg-final { scan-assembler-times "xsnmsub" 1 } } */
+/* { dg-final { scan-assembler-times "xsnmsub\|fnmsub\ " 1 } } */
/* { dg-final { scan-assembler-times "fnmsubs" 1 } } */
/* Only the functions calling the bulitin should generate an appropriate (a *
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-3.c b/gcc/testsuite/gcc.target/powerpc/recip-3.c
index c5ce539bb42..40658818047 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-3.c
@@ -1,9 +1,9 @@
/* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */
/* { dg-options "-O2 -mrecip -ffast-math -mcpu=power7" } */
/* { dg-final { scan-assembler-times "xsrsqrtedp" 1 } } */
-/* { dg-final { scan-assembler-times "xsmsub.dp" 1 } } */
+/* { dg-final { scan-assembler-times "xsmsub.dp\|fmsub\ " 1 } } */
/* { dg-final { scan-assembler-times "xsmuldp" 4 } } */
-/* { dg-final { scan-assembler-times "xsnmsub.dp" 2 } } */
+/* { dg-final { scan-assembler-times "xsnmsub.dp\|fnmsub\ " 2 } } */
/* { dg-final { scan-assembler-times "frsqrtes" 1 } } */
/* { dg-final { scan-assembler-times "fmsubs" 1 } } */
/* { dg-final { scan-assembler-times "fmuls" 4 } } */
diff --git a/gcc/testsuite/gfortran.dg/allocate_error_3.f90 b/gcc/testsuite/gfortran.dg/allocate_error_3.f90
new file mode 100644
index 00000000000..7616caad380
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_error_3.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+!
+! PR 49708: [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
+!
+! Contributed by <fnordxyz@yahoo.com>
+
+ real, pointer :: x(:)
+ allocate(x) ! { dg-error "Array specification required" }
+end
diff --git a/gcc/testsuite/gfortran.dg/coarray_args_1.f90 b/gcc/testsuite/gfortran.dg/coarray_args_1.f90
new file mode 100644
index 00000000000..0a3cada90d2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_args_1.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! Argument checking
+!
+ implicit none
+ type t
+ integer :: i
+ integer,allocatable :: j
+ end type t
+
+ type(t), save :: x[*]
+
+ call sub1(x%i)
+ call sub1(x[1]%i) ! { dg-error "must be a coarray" }
+contains
+ subroutine sub1(y)
+ integer :: y[*]
+ end subroutine sub1
+end
diff --git a/gcc/testsuite/gfortran.dg/coarray_args_2.f90 b/gcc/testsuite/gfortran.dg/coarray_args_2.f90
new file mode 100644
index 00000000000..66a5a921c66
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_args_2.f90
@@ -0,0 +1,50 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! Check argument passing.
+! Taken from Reinhold Bader's fortran_tests.
+!
+
+module mod_rank_mismatch_02
+ implicit none
+ integer, parameter :: ndim = 2
+contains
+ subroutine subr(n,w)
+ integer :: n
+ real :: w(n,*)[*]
+
+ integer :: k, x
+
+ if (this_image() == 0) then
+ x = 1.0
+ do k = 1, num_images()
+ if (abs(w(2,1)[k] - x) > 1.0e-5) then
+ write(*, *) 'FAIL'
+ error stop
+ end if
+ x = x + 1.0
+ end do
+ end if
+
+ end subroutine
+end module
+
+program rank_mismatch_02
+ use mod_rank_mismatch_02
+ implicit none
+ real :: a(ndim,2)[*]
+
+ a = 0.0
+ a(2,2) = 1.0 * this_image()
+
+ sync all
+
+ call subr(ndim, a(1:1,2)) ! OK
+ call subr(ndim, a(1,2)) ! { dg-error "must be simply contiguous" }
+ ! See also F08/0048 and PR 45859 about the validity
+ if (this_image() == 1) then
+ write(*, *) 'OK'
+ end if
+end program
+
+! { dg-final { cleanup-modules "mod_rank_mismatch_02" } }
diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_token_1.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_token_1.f90
new file mode 100644
index 00000000000..648a6a337a9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_lib_token_1.f90
@@ -0,0 +1,88 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -fdump-tree-original" }
+!
+! Check whether TOKEN and OFFSET are correctly propagated
+!
+
+program main
+ implicit none
+ type t
+ integer(4) :: a, b
+ end type t
+ integer :: caf[*]
+ type(t) :: caf_dt[*]
+
+ caf = 42
+ caf_dt = t (1,2)
+ call sub (caf, caf_dt%b)
+ print *,caf, caf_dt%b
+ if (caf /= -99 .or. caf_dt%b /= -101) call abort ()
+ call sub_opt ()
+ call sub_opt (caf)
+ if (caf /= 124) call abort ()
+contains
+
+ subroutine sub (x1, x2)
+ integer :: x1[*], x2[*]
+
+ call sub2 (x1, x2)
+ end subroutine sub
+
+ subroutine sub2 (y1, y2)
+ integer :: y1[*], y2[*]
+
+ print *, y1, y2
+ if (y1 /= 42 .or. y2 /= 2) call abort ()
+ y1 = -99
+ y2 = -101
+ end subroutine sub2
+
+ subroutine sub_opt (z)
+ integer, optional :: z[*]
+ if (present (z)) then
+ if (z /= -99) call abort ()
+ z = 124
+ end if
+ end subroutine sub_opt
+
+end program main
+
+! SCAN TREE DUMP AND CLEANUP
+!
+! PROTOTYPE 1:
+!
+! sub (integer(kind=4) * restrict x1, integer(kind=4) * restrict x2,
+! void * restrict caf_token.4, integer(kind=8) caf_offset.5,
+! void * restrict caf_token.6, integer(kind=8) caf_offset.7)
+!
+! { dg-final { scan-tree-dump-times "sub \\(integer.kind=4. . restrict x1, integer.kind=4. . restrict x2, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+\\)" 1 "original"} }
+!
+! PROTOTYPE 2:
+!
+! sub2 (integer(kind=4) * restrict y1, integer(kind=4) * restrict y2,
+! void * restrict caf_token.0, integer(kind=8) caf_offset.1,
+! void * restrict caf_token.2, integer(kind=8) caf_offset.3)
+!
+! { dg-final { scan-tree-dump-times "sub2 \\(integer.kind=4. . restrict y1, integer.kind=4. . restrict y2, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+\\)" 1 "original"} }
+!
+! CALL 1
+!
+! sub ((integer(kind=4) *) caf, &caf_dt->b, caf_token.9, 0, caf_token.10, 4);
+!
+! { dg-final { scan-tree-dump-times "sub \\(\[^,\]*caf, &caf_dt->b, caf_token.\[0-9\]+, 0, caf_token.\[0-9\]+, 4\\)" 1 "original"} }
+!
+! sub2 ((integer(kind=4) *) x1, (integer(kind=4) *) x2,
+! caf_token.4, NON_LVALUE_EXPR <caf_offset.5>,
+! caf_token.6, NON_LVALUE_EXPR <caf_offset.7>);
+!
+! { dg-final { scan-tree-dump-times "sub2 \\(\[^,\]*x1, \[^,\]*x2, caf_token.\[0-9]+, \[^,\]*caf_offset\[^,\]*, caf_token.\[0-9\]+, \[^,\]*caf_offset\[^,\]*\\)" 1 "original"} }
+!
+! CALL 3
+!
+! { dg-final { scan-tree-dump-times "sub_opt \\(0B, 0B, 0\\)" 1 "original"} }
+!
+! CALL 4
+!
+! { dg-final { scan-tree-dump-times "sub_opt \\(.integer.kind=4. .. caf, caf_token.\[0-9\]+, 0\\)" 1 "original"} }
+!
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
index a5976331b9c..4b518fe9e4d 100644
--- a/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
@@ -1,6 +1,6 @@
C Test program for common block debugging. G. Helffrich 11 July 2004.
C { dg-do compile }
-C { dg-skip-if "No stabs" { mmix-*-* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } }
+C { dg-skip-if "No stabs" { mmix-*-* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } }
C { dg-skip-if "No stabs" {*-*-* } { "*" } { "-gstabs" } }
common i,j
common /label/l,m
diff --git a/gcc/testsuite/gfortran.dg/pr49675.f90 b/gcc/testsuite/gfortran.dg/pr49675.f90
new file mode 100644
index 00000000000..06fd1b665bd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr49675.f90
@@ -0,0 +1,6 @@
+! PR middle-end/49675
+! { dg-do compile }
+! { dg-options "-finstrument-functions" }
+end
+! { dg-final { scan-assembler "__cyg_profile_func_enter" } }
+! { dg-final { scan-assembler "__cyg_profile_func_exit" } }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 213118503c5..bec4d6fd762 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -290,11 +290,6 @@ proc check_weak_override_available { } {
# The argument is the kind of visibility, default/protected/hidden/internal.
proc check_visibility_available { what_kind } {
- # On NetWare, support makes no sense.
- if { [istarget *-*-netware*] } {
- return 0
- }
-
if [string match "" $what_kind] { set what_kind "hidden" }
return [check_no_compiler_messages visibility_available_$what_kind object "
@@ -571,7 +566,6 @@ proc check_profiling_available { test_what } {
|| [istarget tic6x-*-elf]
|| [istarget xstormy16-*]
|| [istarget xtensa*-*-elf]
- || [istarget *-*-netware*]
|| [istarget *-*-rtems*]
|| [istarget *-*-vxworks*] } {
set profiling_available_saved 0
@@ -1076,8 +1070,8 @@ proc check_sse_os_support_available { } {
check_runtime_nocache sse_os_support_available {
int main ()
{
- __asm__ volatile ("movaps %xmm0,%xmm0");
- return 0;
+ asm volatile ("movaps %xmm0,%xmm0");
+ return 0;
}
} "-msse"
} else {
@@ -1086,6 +1080,29 @@ proc check_sse_os_support_available { } {
}]
}
+# Return 1 if the target OS supports running AVX executables, 0
+# otherwise. Cache the result.
+
+proc check_avx_os_support_available { } {
+ return [check_cached_effective_target avx_os_support_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+ expr 0
+ } else {
+ # Check that OS has AVX and SSE saving enabled.
+ check_runtime_nocache avx_os_support_available {
+ int main ()
+ {
+ unsigned int eax, edx;
+
+ asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+ return (eax & 6) != 6;
+ }
+ } ""
+ }
+ }]
+}
+
# Return 1 if the target supports executing SSE instructions, 0
# otherwise. Cache the result.
@@ -1182,7 +1199,8 @@ proc check_effective_target_sse2_runtime { } {
proc check_effective_target_avx_runtime { } {
if { [check_effective_target_avx]
- && [check_avx_hw_available] } {
+ && [check_avx_hw_available]
+ && [check_avx_os_support_available] } {
return 1
}
return 0
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index c57eaff2e95..06b7f2659da 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -387,7 +387,7 @@ add_elt_to_tree (tree expr, tree type, tree elt, double_int scale,
return fold_convert (type, elt);
if (POINTER_TYPE_P (type))
- return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+ return fold_build_pointer_plus (expr, elt);
return fold_build2 (PLUS_EXPR, type, expr, elt);
}
@@ -399,7 +399,7 @@ add_elt_to_tree (tree expr, tree type, tree elt, double_int scale,
if (POINTER_TYPE_P (type))
{
elt = fold_build1 (NEGATE_EXPR, type1, elt);
- return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+ return fold_build_pointer_plus (expr, elt);
}
return fold_build2 (MINUS_EXPR, type, expr, elt);
}
@@ -423,7 +423,7 @@ add_elt_to_tree (tree expr, tree type, tree elt, double_int scale,
{
if (code == MINUS_EXPR)
elt = fold_build1 (NEGATE_EXPR, type1, elt);
- return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+ return fold_build_pointer_plus (expr, elt);
}
return fold_build2 (code, type, expr, elt);
}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 12d8fb4e5f0..bc71dd60fa1 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2680,7 +2680,8 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
break;
case NON_LVALUE_EXPR:
- gcc_unreachable ();
+ case TRUTH_NOT_EXPR:
+ gcc_unreachable ();
CASE_CONVERT:
case FIX_TRUNC_EXPR:
@@ -2688,7 +2689,6 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case NEGATE_EXPR:
case ABS_EXPR:
case BIT_NOT_EXPR:
- case TRUTH_NOT_EXPR:
CHECK_OP (0, "invalid operand to unary operator");
break;
@@ -3203,7 +3203,9 @@ verify_gimple_comparison (tree type, tree op0, tree op1)
&& (!POINTER_TYPE_P (op0_type)
|| !POINTER_TYPE_P (op1_type)
|| TYPE_MODE (op0_type) != TYPE_MODE (op1_type)))
- || !INTEGRAL_TYPE_P (type))
+ || !INTEGRAL_TYPE_P (type)
+ || (TREE_CODE (type) != BOOLEAN_TYPE
+ && TYPE_PRECISION (type) != 1))
{
error ("type mismatch in comparison expression");
debug_generic_expr (type);
@@ -3344,19 +3346,6 @@ verify_gimple_assign_unary (gimple stmt)
/* FIXME. */
return false;
- case TRUTH_NOT_EXPR:
- /* We require two-valued operand types. */
- if (!(TREE_CODE (rhs1_type) == BOOLEAN_TYPE
- || (INTEGRAL_TYPE_P (rhs1_type)
- && TYPE_PRECISION (rhs1_type) == 1)))
- {
- error ("invalid types in truth not");
- debug_generic_expr (lhs_type);
- debug_generic_expr (rhs1_type);
- return true;
- }
- break;
-
case NEGATE_EXPR:
case ABS_EXPR:
case BIT_NOT_EXPR:
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index d58542c91ca..3e18e8d1837 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -604,8 +604,7 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
split_constant_offset (poffset, &poffset, &off1);
off0 = size_binop (PLUS_EXPR, off0, off1);
if (POINTER_TYPE_P (TREE_TYPE (base)))
- base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
- base, fold_convert (sizetype, poffset));
+ base = fold_build_pointer_plus (base, poffset);
else
base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), base,
fold_convert (TREE_TYPE (base), poffset));
@@ -4158,33 +4157,37 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
ref->pos = op1;
ref->is_read = true;
}
-
- if (DECL_P (*op0)
- || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))
- {
- ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
- ref->pos = op0;
- ref->is_read = false;
- }
}
else if (stmt_code == GIMPLE_CALL)
{
- unsigned i, n = gimple_call_num_args (stmt);
+ unsigned i, n;
+ op0 = gimple_call_lhs_ptr (stmt);
+ n = gimple_call_num_args (stmt);
for (i = 0; i < n; i++)
{
- op0 = gimple_call_arg_ptr (stmt, i);
+ op1 = gimple_call_arg_ptr (stmt, i);
- if (DECL_P (*op0)
- || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))
+ if (DECL_P (*op1)
+ || (REFERENCE_CLASS_P (*op1) && get_base_address (*op1)))
{
ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
- ref->pos = op0;
+ ref->pos = op1;
ref->is_read = true;
}
}
}
+ else
+ return clobbers_memory;
+ if (*op0
+ && (DECL_P (*op0)
+ || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0))))
+ {
+ ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
+ ref->pos = op0;
+ ref->is_read = false;
+ }
return clobbers_memory;
}
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index ae17755a9d6..165431184ab 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -285,9 +285,8 @@ generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
TYPE_SIZE_UNIT (TREE_TYPE (op0)));
}
- addr_base = fold_build2_loc (loc, POINTER_PLUS_EXPR,
- TREE_TYPE (DR_BASE_ADDRESS (dr)),
- DR_BASE_ADDRESS (dr), addr_base);
+ addr_base = fold_build_pointer_plus_loc (loc,
+ DR_BASE_ADDRESS (dr), addr_base);
mem = force_gimple_operand (addr_base, &stmts, true, NULL);
gimple_seq_add_seq (&stmt_list, stmts);
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 7b5ed4b70a9..26ef23e15f7 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -843,9 +843,8 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
elt = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (elt)),
elt);
addr = fold_convert_loc (location, ptr_type_node, elt ? elt : base);
- addr = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
- addr, fold_convert_loc (location, sizetype,
- byte_position (field)));
+ addr = fold_build_pointer_plus_loc (location,
+ addr, byte_position (field));
}
else
addr = build1 (ADDR_EXPR, build_pointer_type (type), t);
@@ -861,33 +860,25 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
case INDIRECT_REF:
addr = TREE_OPERAND (t, 0);
base = addr;
- limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
- fold_build2_loc (location,
- POINTER_PLUS_EXPR, ptr_type_node, base,
- size),
- size_int (-1));
+ limit = fold_build_pointer_plus_hwi_loc
+ (location, fold_build_pointer_plus_loc (location, base, size), -1);
break;
case MEM_REF:
- addr = fold_build2_loc (location, POINTER_PLUS_EXPR, TREE_TYPE (TREE_OPERAND (t, 0)),
- TREE_OPERAND (t, 0),
- fold_convert (sizetype, TREE_OPERAND (t, 1)));
+ addr = fold_build_pointer_plus_loc (location, TREE_OPERAND (t, 0),
+ TREE_OPERAND (t, 1));
base = addr;
- limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
- fold_build2_loc (location,
- POINTER_PLUS_EXPR, ptr_type_node, base,
- size),
- size_int (-1));
+ limit = fold_build_pointer_plus_hwi_loc (location,
+ fold_build_pointer_plus_loc (location,
+ base, size), -1);
break;
case TARGET_MEM_REF:
addr = tree_mem_ref_addr (ptr_type_node, t);
base = addr;
- limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
- fold_build2_loc (location,
- POINTER_PLUS_EXPR, ptr_type_node, base,
- size),
- size_int (-1));
+ limit = fold_build_pointer_plus_hwi_loc (location,
+ fold_build_pointer_plus_loc (location,
+ base, size), -1);
break;
case ARRAY_RANGE_REF:
@@ -920,15 +911,12 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
addr = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
addr = convert (ptr_type_node, addr);
- addr = fold_build2_loc (location, POINTER_PLUS_EXPR,
- ptr_type_node, addr, ofs);
+ addr = fold_build_pointer_plus_loc (location, addr, ofs);
base = addr;
- limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
- fold_build2_loc (location,
- POINTER_PLUS_EXPR, ptr_type_node,
- base, size),
- size_int (-1));
+ limit = fold_build_pointer_plus_hwi_loc (location,
+ fold_build_pointer_plus_loc (location,
+ base, size), -1);
}
break;
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 2dbd07d135a..94b0512bdaf 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1396,7 +1396,7 @@ ref_at_iteration (struct loop *loop, tree ref, int iter)
{
val = fold_build2 (MULT_EXPR, sizetype, iv.step,
size_int (iter));
- val = fold_build2 (POINTER_PLUS_EXPR, type, iv.base, val);
+ val = fold_build_pointer_plus (iv.base, val);
}
else
{
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index c6dced114b7..e4e944bf815 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -302,7 +302,7 @@ tree_mem_ref_addr (tree type, tree mem_ref)
}
if (addr_off)
- addr = fold_build2 (POINTER_PLUS_EXPR, type, addr_base, addr_off);
+ addr = fold_build_pointer_plus (addr_base, addr_off);
else
addr = addr_base;
@@ -521,9 +521,7 @@ add_to_parts (struct mem_address *parts, tree elt)
/* Add ELT to base. */
type = TREE_TYPE (parts->base);
if (POINTER_TYPE_P (type))
- parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
- parts->base,
- fold_convert (sizetype, elt));
+ parts->base = fold_build_pointer_plus (parts->base, elt);
else
parts->base = fold_build2 (PLUS_EXPR, type,
parts->base, elt);
@@ -692,7 +690,6 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
tree alias_ptr_type, tree iv_cand, tree base_hint, bool speed)
{
tree mem_ref, tmp;
- tree atype;
struct mem_address parts;
addr_to_parts (type, addr, iv_cand, base_hint, &parts, speed);
@@ -731,11 +728,8 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
if (parts.index)
{
- atype = TREE_TYPE (tmp);
parts.base = force_gimple_operand_gsi_1 (gsi,
- fold_build2 (POINTER_PLUS_EXPR, atype,
- tmp,
- fold_convert (sizetype, parts.base)),
+ fold_build_pointer_plus (tmp, parts.base),
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
@@ -758,11 +752,8 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
/* Add index to base. */
if (parts.base)
{
- atype = TREE_TYPE (parts.base);
parts.base = force_gimple_operand_gsi_1 (gsi,
- fold_build2 (POINTER_PLUS_EXPR, atype,
- parts.base,
- parts.index),
+ fold_build_pointer_plus (parts.base, parts.index),
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
@@ -779,11 +770,8 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
/* Try adding offset to base. */
if (parts.base)
{
- atype = TREE_TYPE (parts.base);
parts.base = force_gimple_operand_gsi_1 (gsi,
- fold_build2 (POINTER_PLUS_EXPR, atype,
- parts.base,
- fold_convert (sizetype, parts.offset)),
+ fold_build_pointer_plus (parts.base, parts.offset),
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 8e6b7040af0..c08cb18e7af 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "timevar.h"
-#include "tree-pretty-print.h"
+#include "gimple-pretty-print.h"
#include "tree-flow.h"
#include "tree-pass.h"
#include "tree-dump.h"
@@ -313,8 +313,10 @@ remove_prop_source_from_use (tree name)
return cfg_changed;
stmt = SSA_NAME_DEF_STMT (name);
- gsi = gsi_for_stmt (stmt);
bb = gimple_bb (stmt);
+ if (!bb)
+ return cfg_changed;
+ gsi = gsi_for_stmt (stmt);
release_defs (stmt);
gsi_remove (&gsi, true);
cfg_changed |= gimple_purge_dead_eh_edges (bb);
@@ -437,29 +439,36 @@ forward_propagate_into_comparison_1 (location_t loc,
/* Propagate from the ssa name definition statements of the assignment
from a comparison at *GSI into the conditional if that simplifies it.
- Returns true if the stmt was modified, false if not. */
+ Returns 1 if the stmt was modified and 2 if the CFG needs cleanup,
+ otherwise returns 0. */
-static bool
+static int
forward_propagate_into_comparison (gimple_stmt_iterator *gsi)
{
gimple stmt = gsi_stmt (*gsi);
tree tmp;
+ bool cfg_changed = false;
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
/* Combine the comparison with defining statements. */
tmp = forward_propagate_into_comparison_1 (gimple_location (stmt),
gimple_assign_rhs_code (stmt),
TREE_TYPE
(gimple_assign_lhs (stmt)),
- gimple_assign_rhs1 (stmt),
- gimple_assign_rhs2 (stmt));
+ rhs1, rhs2);
if (tmp)
{
gimple_assign_set_rhs_from_tree (gsi, tmp);
update_stmt (stmt);
- return true;
+ if (TREE_CODE (rhs1) == SSA_NAME)
+ cfg_changed |= remove_prop_source_from_use (rhs1);
+ if (TREE_CODE (rhs2) == SSA_NAME)
+ cfg_changed |= remove_prop_source_from_use (rhs2);
+ return cfg_changed ? 2 : 1;
}
- return false;
+ return 0;
}
/* Propagate from the ssa name definition statements of COND_EXPR
@@ -472,10 +481,12 @@ forward_propagate_into_comparison (gimple_stmt_iterator *gsi)
static int
forward_propagate_into_gimple_cond (gimple stmt)
{
- int did_something = 0;
location_t loc = gimple_location (stmt);
tree tmp;
enum tree_code code = gimple_cond_code (stmt);
+ bool cfg_changed = false;
+ tree rhs1 = gimple_cond_lhs (stmt);
+ tree rhs2 = gimple_cond_rhs (stmt);
/* We can do tree combining on SSA_NAME and comparison expressions. */
if (TREE_CODE_CLASS (gimple_cond_code (stmt)) != tcc_comparison)
@@ -483,18 +494,13 @@ forward_propagate_into_gimple_cond (gimple stmt)
tmp = forward_propagate_into_comparison_1 (loc, code,
boolean_type_node,
- gimple_cond_lhs (stmt),
- gimple_cond_rhs (stmt));
+ rhs1, rhs2);
if (tmp)
{
if (dump_file && tmp)
{
- tree cond = build2 (gimple_cond_code (stmt),
- boolean_type_node,
- gimple_cond_lhs (stmt),
- gimple_cond_rhs (stmt));
fprintf (dump_file, " Replaced '");
- print_generic_expr (dump_file, cond, 0);
+ print_gimple_expr (dump_file, stmt, 0, 0);
fprintf (dump_file, "' with '");
print_generic_expr (dump_file, tmp, 0);
fprintf (dump_file, "'\n");
@@ -503,14 +509,14 @@ forward_propagate_into_gimple_cond (gimple stmt)
gimple_cond_set_condition_from_tree (stmt, unshare_expr (tmp));
update_stmt (stmt);
- /* Remove defining statements. */
- if (is_gimple_min_invariant (tmp))
- did_something = 2;
- else if (did_something == 0)
- did_something = 1;
+ if (TREE_CODE (rhs1) == SSA_NAME)
+ cfg_changed |= remove_prop_source_from_use (rhs1);
+ if (TREE_CODE (rhs2) == SSA_NAME)
+ cfg_changed |= remove_prop_source_from_use (rhs2);
+ return (cfg_changed || is_gimple_min_invariant (tmp)) ? 2 : 1;
}
- return did_something;
+ return 0;
}
@@ -526,7 +532,6 @@ forward_propagate_into_cond (gimple_stmt_iterator *gsi_p)
{
gimple stmt = gsi_stmt (*gsi_p);
location_t loc = gimple_location (stmt);
- int did_something = 0;
tree tmp = NULL_TREE;
tree cond = gimple_assign_rhs1 (stmt);
@@ -541,7 +546,7 @@ forward_propagate_into_cond (gimple_stmt_iterator *gsi_p)
tree name = cond, rhs0;
gimple def_stmt = get_prop_source_stmt (name, true, NULL);
if (!def_stmt || !can_propagate_from (def_stmt))
- return did_something;
+ return 0;
rhs0 = gimple_assign_rhs1 (def_stmt);
tmp = combine_cond_expr_cond (loc, NE_EXPR, boolean_type_node, rhs0,
@@ -564,14 +569,10 @@ forward_propagate_into_cond (gimple_stmt_iterator *gsi_p)
stmt = gsi_stmt (*gsi_p);
update_stmt (stmt);
- /* Remove defining statements. */
- if (is_gimple_min_invariant (tmp))
- did_something = 2;
- else if (did_something == 0)
- did_something = 1;
+ return is_gimple_min_invariant (tmp) ? 2 : 1;
}
- return did_something;
+ return 0;
}
/* We've just substituted an ADDR_EXPR into stmt. Update all the
@@ -1109,6 +1110,9 @@ forward_propagate_comparison (gimple stmt)
tree name = gimple_assign_lhs (stmt);
gimple use_stmt;
tree tmp = NULL_TREE;
+ gimple_stmt_iterator gsi;
+ enum tree_code code;
+ tree lhs;
/* Don't propagate ssa names that occur in abnormal phis. */
if ((TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
@@ -1119,89 +1123,51 @@ forward_propagate_comparison (gimple stmt)
/* Do not un-cse comparisons. But propagate through copies. */
use_stmt = get_prop_dest_stmt (name, &name);
- if (!use_stmt)
+ if (!use_stmt
+ || !is_gimple_assign (use_stmt))
return false;
- /* Conversion of the condition result to another integral type. */
- if (is_gimple_assign (use_stmt)
- && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt))
- || TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt))
- == tcc_comparison
- || gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR)
- && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (use_stmt))))
- {
- tree lhs = gimple_assign_lhs (use_stmt);
-
- /* We can propagate the condition into a conversion. */
- if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)))
- {
- /* Avoid using fold here as that may create a COND_EXPR with
- non-boolean condition as canonical form. */
- tmp = build2 (gimple_assign_rhs_code (stmt), TREE_TYPE (lhs),
- gimple_assign_rhs1 (stmt), gimple_assign_rhs2 (stmt));
- }
- /* We can propagate the condition into X op CST where op
- is EQ_EXPR or NE_EXPR and CST is either one or zero. */
- else if (TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt))
- == tcc_comparison
- && TREE_CODE (gimple_assign_rhs1 (use_stmt)) == SSA_NAME
- && TREE_CODE (gimple_assign_rhs2 (use_stmt)) == INTEGER_CST)
- {
- enum tree_code code = gimple_assign_rhs_code (use_stmt);
- tree cst = gimple_assign_rhs2 (use_stmt);
- tree cond;
-
- cond = build2 (gimple_assign_rhs_code (stmt),
- TREE_TYPE (cst),
- gimple_assign_rhs1 (stmt),
- gimple_assign_rhs2 (stmt));
-
- tmp = combine_cond_expr_cond (gimple_location (use_stmt),
- code, TREE_TYPE (lhs),
- cond, cst, false);
- if (tmp == NULL_TREE)
- return false;
- }
- /* We can propagate the condition into a statement that
- computes the logical negation of the comparison result. */
- else if (gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR)
- {
- tree type = TREE_TYPE (gimple_assign_rhs1 (stmt));
- bool nans = HONOR_NANS (TYPE_MODE (type));
- enum tree_code code;
- code = invert_tree_comparison (gimple_assign_rhs_code (stmt), nans);
- if (code == ERROR_MARK)
- return false;
+ code = gimple_assign_rhs_code (use_stmt);
+ lhs = gimple_assign_lhs (use_stmt);
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (lhs)))
+ return false;
- tmp = build2 (code, TREE_TYPE (lhs), gimple_assign_rhs1 (stmt),
- gimple_assign_rhs2 (stmt));
- }
- else
+ /* We can propagate the condition into a statement that
+ computes the logical negation of the comparison result. */
+ if ((code == BIT_NOT_EXPR
+ && TYPE_PRECISION (TREE_TYPE (lhs)) == 1)
+ || (code == BIT_XOR_EXPR
+ && integer_onep (gimple_assign_rhs2 (use_stmt))))
+ {
+ tree type = TREE_TYPE (gimple_assign_rhs1 (stmt));
+ bool nans = HONOR_NANS (TYPE_MODE (type));
+ enum tree_code inv_code;
+ inv_code = invert_tree_comparison (gimple_assign_rhs_code (stmt), nans);
+ if (inv_code == ERROR_MARK)
return false;
- {
- gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
- gimple_assign_set_rhs_from_tree (&gsi, unshare_expr (tmp));
- use_stmt = gsi_stmt (gsi);
- update_stmt (use_stmt);
- }
+ tmp = build2 (inv_code, TREE_TYPE (lhs), gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
+ }
+ else
+ return false;
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- tree old_rhs = rhs_to_tree (TREE_TYPE (gimple_assign_lhs (stmt)),
- stmt);
- fprintf (dump_file, " Replaced '");
- print_generic_expr (dump_file, old_rhs, dump_flags);
- fprintf (dump_file, "' with '");
- print_generic_expr (dump_file, tmp, dump_flags);
- fprintf (dump_file, "'\n");
- }
+ gsi = gsi_for_stmt (use_stmt);
+ gimple_assign_set_rhs_from_tree (&gsi, unshare_expr (tmp));
+ use_stmt = gsi_stmt (gsi);
+ update_stmt (use_stmt);
- /* Remove defining statements. */
- return remove_prop_source_from_use (name);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " Replaced '");
+ print_gimple_expr (dump_file, stmt, 0, dump_flags);
+ fprintf (dump_file, "' with '");
+ print_gimple_expr (dump_file, use_stmt, 0, dump_flags);
+ fprintf (dump_file, "'\n");
}
- return false;
+ /* Remove defining statements. */
+ return remove_prop_source_from_use (name);
}
@@ -1649,16 +1615,13 @@ lookup_logical_inverted_value (tree name)
op2 = NULL_TREE;
/* Get for EQ_EXPR or BIT_XOR_EXPR operation the second operand.
- If CODE isn't an EQ_EXPR, BIT_XOR_EXPR, TRUTH_NOT_EXPR,
- or BIT_NOT_EXPR, then return. */
+ If CODE isn't an EQ_EXPR, BIT_XOR_EXPR, or BIT_NOT_EXPR, then return. */
if (code == EQ_EXPR || code == NE_EXPR
|| code == BIT_XOR_EXPR)
op2 = gimple_assign_rhs2 (def);
switch (code)
{
- case TRUTH_NOT_EXPR:
- return op1;
case BIT_NOT_EXPR:
if (truth_valued_ssa_name (name))
return op1;
@@ -1740,37 +1703,6 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
tree def1_arg1, def2_arg1;
enum tree_code def1_code, def2_code;
- /* If the first argument is an SSA name that is itself a result of a
- typecast of an ADDR_EXPR to an integer, feed the ADDR_EXPR to the
- folder rather than the ssa name. */
- if (code == BIT_AND_EXPR
- && TREE_CODE (arg2) == INTEGER_CST
- && TREE_CODE (arg1) == SSA_NAME)
- {
- gimple def = SSA_NAME_DEF_STMT (arg1);
- tree op = arg1;
-
- /* ??? This looks bogus - the conversion could be truncating. */
- if (is_gimple_assign (def)
- && CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def))
- && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
- {
- tree opp = gimple_assign_rhs1 (def);
- if (TREE_CODE (opp) == ADDR_EXPR)
- op = opp;
- }
-
- res = fold_binary_loc (gimple_location (stmt),
- BIT_AND_EXPR, TREE_TYPE (gimple_assign_lhs (stmt)),
- op, arg2);
- if (res && is_gimple_min_invariant (res))
- {
- gimple_assign_set_rhs_from_tree (gsi, res);
- update_stmt (stmt);
- return true;
- }
- }
-
def1_code = TREE_CODE (arg1);
def1_arg1 = arg1;
if (TREE_CODE (arg1) == SSA_NAME)
@@ -1810,6 +1742,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
arg2));
tem = make_ssa_name (tem, newop);
gimple_assign_set_lhs (newop, tem);
+ gimple_set_location (newop, gimple_location (stmt));
gsi_insert_before (gsi, newop, GSI_SAME_STMT);
gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR,
tem, NULL_TREE, NULL_TREE);
@@ -1839,6 +1772,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
newop = gimple_build_assign_with_ops (code, tem, def1_arg1, def2_arg1);
tem = make_ssa_name (tem, newop);
gimple_assign_set_lhs (newop, tem);
+ gimple_set_location (newop, gimple_location (stmt));
gsi_insert_before (gsi, newop, GSI_SAME_STMT);
gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR,
tem, NULL_TREE, NULL_TREE);
@@ -1867,6 +1801,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
tem, def1_arg1, arg2);
tem = make_ssa_name (tem, newop);
gimple_assign_set_lhs (newop, tem);
+ gimple_set_location (newop, gimple_location (stmt));
/* Make sure to re-process the new stmt as it's walking upwards. */
gsi_insert_before (gsi, newop, GSI_NEW_STMT);
gimple_assign_set_rhs1 (stmt, tem);
@@ -1892,6 +1827,17 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
return true;
}
+ /* Canonicalize X ^ ~0 to ~X. */
+ if (code == BIT_XOR_EXPR
+ && TREE_CODE (arg2) == INTEGER_CST
+ && integer_all_onesp (arg2))
+ {
+ gimple_assign_set_rhs_with_ops (gsi, BIT_NOT_EXPR, arg1, NULL_TREE);
+ gcc_assert (gsi_stmt (*gsi) == stmt);
+ update_stmt (stmt);
+ return true;
+ }
+
/* Try simple folding for X op !X, and X op X. */
res = simplify_bitwise_binary_1 (code, TREE_TYPE (arg1), arg1, arg2);
if (res != NULL_TREE)
@@ -2193,9 +2139,10 @@ out:
}
/* Combine two conversions in a row for the second conversion at *GSI.
- Returns true if there were any changes made. */
+ Returns 1 if there were any changes made, 2 if cfg-cleanup needs to
+ run. Else it returns 0. */
-static bool
+static int
combine_conversions (gimple_stmt_iterator *gsi)
{
gimple stmt = gsi_stmt (*gsi);
@@ -2212,15 +2159,15 @@ combine_conversions (gimple_stmt_iterator *gsi)
if (useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (op0)))
{
gimple_assign_set_rhs_code (stmt, TREE_CODE (op0));
- return true;
+ return 1;
}
if (TREE_CODE (op0) != SSA_NAME)
- return false;
+ return 0;
def_stmt = SSA_NAME_DEF_STMT (op0);
if (!is_gimple_assign (def_stmt))
- return false;
+ return 0;
if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))
{
@@ -2259,7 +2206,7 @@ combine_conversions (gimple_stmt_iterator *gsi)
gimple_assign_set_rhs1 (stmt, unshare_expr (defop0));
gimple_assign_set_rhs_code (stmt, TREE_CODE (defop0));
update_stmt (stmt);
- return true;
+ return remove_prop_source_from_use (op0) ? 2 : 1;
}
/* Likewise, if the intermediate and initial types are either both
@@ -2281,7 +2228,7 @@ combine_conversions (gimple_stmt_iterator *gsi)
{
gimple_assign_set_rhs1 (stmt, defop0);
update_stmt (stmt);
- return true;
+ return remove_prop_source_from_use (op0) ? 2 : 1;
}
/* If we have a sign-extension of a zero-extended value, we can
@@ -2292,7 +2239,7 @@ combine_conversions (gimple_stmt_iterator *gsi)
{
gimple_assign_set_rhs1 (stmt, defop0);
update_stmt (stmt);
- return true;
+ return remove_prop_source_from_use (op0) ? 2 : 1;
}
/* Two conversions in a row are not needed unless:
@@ -2321,7 +2268,7 @@ combine_conversions (gimple_stmt_iterator *gsi)
{
gimple_assign_set_rhs1 (stmt, defop0);
update_stmt (stmt);
- return true;
+ return remove_prop_source_from_use (op0) ? 2 : 1;
}
/* A truncation to an unsigned type should be canonicalized as
@@ -2345,11 +2292,11 @@ combine_conversions (gimple_stmt_iterator *gsi)
else
gimple_assign_set_rhs_from_tree (gsi, tem);
update_stmt (gsi_stmt (*gsi));
- return true;
+ return 1;
}
}
- return false;
+ return 0;
}
/* Main entry point for the forward propagation and statement combine
@@ -2491,11 +2438,15 @@ ssa_forward_propagate_and_combine (void)
else if (TREE_CODE_CLASS (code) == tcc_comparison)
{
bool no_warning = gimple_no_warning_p (stmt);
+ int did_something;
fold_defer_overflow_warnings ();
- changed = forward_propagate_into_comparison (&gsi);
+ did_something = forward_propagate_into_comparison (&gsi);
+ if (did_something == 2)
+ cfg_changed = true;
fold_undefer_overflow_warnings
(!no_warning && changed,
stmt, WARN_STRICT_OVERFLOW_CONDITIONAL);
+ changed = did_something != 0;
}
else if (code == BIT_AND_EXPR
|| code == BIT_IOR_EXPR
@@ -2507,7 +2458,12 @@ ssa_forward_propagate_and_combine (void)
else if (CONVERT_EXPR_CODE_P (code)
|| code == FLOAT_EXPR
|| code == FIX_TRUNC_EXPR)
- changed = combine_conversions (&gsi);
+ {
+ int did_something = combine_conversions (&gsi);
+ if (did_something == 2)
+ cfg_changed = true;
+ changed = did_something != 0;
+ }
break;
}
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 3717639f0d2..4d4b67af3f9 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -3586,9 +3586,7 @@ force_expr_to_var_cost (tree expr, bool speed)
symbol_cost[i] = computation_cost (addr, i) + 1;
address_cost[i]
- = computation_cost (build2 (POINTER_PLUS_EXPR, type,
- addr,
- build_int_cst (sizetype, 2000)), i) + 1;
+ = computation_cost (fold_build_pointer_plus_hwi (addr, 2000), i) + 1;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "force_expr_to_var_cost %s costs:\n", i ? "speed" : "size");
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index cf2f4556395..4acfc67b41f 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -762,8 +762,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
else if (POINTER_TYPE_P (type))
noloop = fold_build2 (GT_EXPR, boolean_type_node,
iv0->base,
- fold_build2 (POINTER_PLUS_EXPR, type,
- iv1->base, tmod));
+ fold_build_pointer_plus (iv1->base, tmod));
else
noloop = fold_build2 (GT_EXPR, boolean_type_node,
iv0->base,
@@ -788,10 +787,9 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
noloop = boolean_false_node;
else if (POINTER_TYPE_P (type))
noloop = fold_build2 (GT_EXPR, boolean_type_node,
- fold_build2 (POINTER_PLUS_EXPR, type,
- iv0->base,
- fold_build1 (NEGATE_EXPR,
- type1, tmod)),
+ fold_build_pointer_plus (iv0->base,
+ fold_build1 (NEGATE_EXPR,
+ type1, tmod)),
iv1->base);
else
noloop = fold_build2 (GT_EXPR, boolean_type_node,
@@ -1166,16 +1164,13 @@ number_of_iterations_le (tree type, affine_iv *iv0, affine_iv *iv1,
if (integer_nonzerop (iv0->step))
{
if (POINTER_TYPE_P (type))
- iv1->base = fold_build2 (POINTER_PLUS_EXPR, type, iv1->base,
- build_int_cst (type1, 1));
+ iv1->base = fold_build_pointer_plus_hwi (iv1->base, 1);
else
iv1->base = fold_build2 (PLUS_EXPR, type1, iv1->base,
build_int_cst (type1, 1));
}
else if (POINTER_TYPE_P (type))
- iv0->base = fold_build2 (POINTER_PLUS_EXPR, type, iv0->base,
- fold_build1 (NEGATE_EXPR, type1,
- build_int_cst (type1, 1)));
+ iv0->base = fold_build_pointer_plus_hwi (iv0->base, -1);
else
iv0->base = fold_build2 (MINUS_EXPR, type1,
iv0->base, build_int_cst (type1, 1));
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 9d9d249d2c2..88f95ef3d97 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -1100,8 +1100,7 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
/* Determine the address to prefetch. */
delta = (ahead + ap * ref->prefetch_mod) *
int_cst_value (ref->group->step);
- addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node,
- addr_base, size_int (delta));
+ addr = fold_build_pointer_plus_hwi (addr_base, delta);
addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true, NULL,
true, GSI_SAME_STMT);
}
@@ -1112,8 +1111,7 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
forward = fold_build2 (MULT_EXPR, sizetype,
fold_convert (sizetype, ref->group->step),
fold_convert (sizetype, size_int (ahead)));
- addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, addr_base,
- forward);
+ addr = fold_build_pointer_plus (addr_base, forward);
addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true,
NULL, true, GSI_SAME_STMT);
}
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 7f76cbfe9c0..995341f0e69 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -968,15 +968,11 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
gimple_set_has_volatile_ops (stmt, true);
/* FALLTHRU */
- case TRUTH_NOT_EXPR:
case VIEW_CONVERT_EXPR:
do_unary:
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), flags);
return;
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_XOR_EXPR:
case COMPOUND_EXPR:
case OBJ_TYPE_REF:
case ASSERT_EXPR:
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 79e8e015fda..ed8f9795e78 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -544,8 +544,9 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
/* To handle special cases like floating point comparison, it is easier and
less error-prone to build a tree and gimplify it on the fly though it is
less efficient. */
- cond = fold_build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ cond = fold_build2_loc (gimple_location (stmt),
+ gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
/* We need to know which is the true edge and which is the false
edge so that we know when to invert the condition below. */
@@ -554,7 +555,8 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
|| (e0 == false_edge && integer_onep (arg0))
|| (e1 == true_edge && integer_zerop (arg1))
|| (e1 == false_edge && integer_onep (arg1)))
- cond = fold_build1 (TRUTH_NOT_EXPR, TREE_TYPE (cond), cond);
+ cond = fold_build1_loc (gimple_location (stmt),
+ TRUTH_NOT_EXPR, TREE_TYPE (cond), cond);
/* Insert our new statements at the end of conditional block before the
COND_STMT. */
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 7c54d2a074f..a50c837db41 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1150,14 +1150,6 @@ fully_constant_expression (pre_expr e)
vn_nary_op_t nary = PRE_EXPR_NARY (e);
switch (TREE_CODE_CLASS (nary->opcode))
{
- case tcc_expression:
- if (nary->opcode == TRUTH_NOT_EXPR)
- goto do_unary;
- if (nary->opcode != TRUTH_AND_EXPR
- && nary->opcode != TRUTH_OR_EXPR
- && nary->opcode != TRUTH_XOR_EXPR)
- return e;
- /* Fallthrough. */
case tcc_binary:
case tcc_comparison:
{
@@ -1199,7 +1191,6 @@ fully_constant_expression (pre_expr e)
return e;
/* Fallthrough. */
case tcc_unary:
-do_unary:
{
/* We have to go from trees to pre exprs to value ids to
constants. */
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 7f1d84ebdfe..7741db88686 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -601,19 +601,6 @@ valid_gimple_rhs_p (tree expr)
}
break;
- case TRUTH_NOT_EXPR:
- if (!is_gimple_val (TREE_OPERAND (expr, 0)))
- return false;
- break;
-
- case TRUTH_AND_EXPR:
- case TRUTH_XOR_EXPR:
- case TRUTH_OR_EXPR:
- if (!is_gimple_val (TREE_OPERAND (expr, 0))
- || !is_gimple_val (TREE_OPERAND (expr, 1)))
- return false;
- break;
-
default:
return false;
}
@@ -979,6 +966,9 @@ replace_phi_args_in (gimple phi, ssa_prop_get_value_fn get_value)
DO_DCE is true if trivially dead stmts can be removed.
+ If DO_DCE is true, the statements within a BB are walked from
+ last to first element. Otherwise we scan from first to last element.
+
Return TRUE when something changed. */
bool
@@ -1059,9 +1049,10 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
replace_phi_args_in (gsi_stmt (i), get_value_fn);
- /* Propagate known values into stmts. Do a backward walk to expose
- more trivially deletable stmts. */
- for (i = gsi_last_bb (bb); !gsi_end_p (i);)
+ /* Propagate known values into stmts. Do a backward walk if
+ do_dce is true. In some case it exposes
+ more trivially deletable stmts to walk backward. */
+ for (i = (do_dce ? gsi_last_bb (bb) : gsi_start_bb (bb)); !gsi_end_p (i);)
{
bool did_replace;
gimple stmt = gsi_stmt (i);
@@ -1070,7 +1061,10 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
gimple_stmt_iterator oldi;
oldi = i;
- gsi_prev (&i);
+ if (do_dce)
+ gsi_prev (&i);
+ else
+ gsi_next (&i);
/* Ignore ASSERT_EXPRs. They are used by VRP to generate
range information for names and they are discarded
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 125d0444f4a..5f72f041290 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1146,29 +1146,51 @@ fully_constant_vn_reference_p (vn_reference_t ref)
/* Transform any SSA_NAME's in a vector of vn_reference_op_s
structures into their value numbers. This is done in-place, and
- the vector passed in is returned. */
+ the vector passed in is returned. *VALUEIZED_ANYTHING will specify
+ whether any operands were valueized. */
static VEC (vn_reference_op_s, heap) *
-valueize_refs (VEC (vn_reference_op_s, heap) *orig)
+valueize_refs_1 (VEC (vn_reference_op_s, heap) *orig, bool *valueized_anything)
{
vn_reference_op_t vro;
unsigned int i;
+ *valueized_anything = false;
+
FOR_EACH_VEC_ELT (vn_reference_op_s, orig, i, vro)
{
if (vro->opcode == SSA_NAME
|| (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME))
{
- vro->op0 = SSA_VAL (vro->op0);
+ tree tem = SSA_VAL (vro->op0);
+ if (tem != vro->op0)
+ {
+ *valueized_anything = true;
+ vro->op0 = tem;
+ }
/* If it transforms from an SSA_NAME to a constant, update
the opcode. */
if (TREE_CODE (vro->op0) != SSA_NAME && vro->opcode == SSA_NAME)
vro->opcode = TREE_CODE (vro->op0);
}
if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
- vro->op1 = SSA_VAL (vro->op1);
+ {
+ tree tem = SSA_VAL (vro->op1);
+ if (tem != vro->op1)
+ {
+ *valueized_anything = true;
+ vro->op1 = tem;
+ }
+ }
if (vro->op2 && TREE_CODE (vro->op2) == SSA_NAME)
- vro->op2 = SSA_VAL (vro->op2);
+ {
+ tree tem = SSA_VAL (vro->op2);
+ if (tem != vro->op2)
+ {
+ *valueized_anything = true;
+ vro->op2 = tem;
+ }
+ }
/* If it transforms from an SSA_NAME to an address, fold with
a preceding indirect reference. */
if (i > 0
@@ -1203,20 +1225,29 @@ valueize_refs (VEC (vn_reference_op_s, heap) *orig)
return orig;
}
+static VEC (vn_reference_op_s, heap) *
+valueize_refs (VEC (vn_reference_op_s, heap) *orig)
+{
+ bool tem;
+ return valueize_refs_1 (orig, &tem);
+}
+
static VEC(vn_reference_op_s, heap) *shared_lookup_references;
/* Create a vector of vn_reference_op_s structures from REF, a
REFERENCE_CLASS_P tree. The vector is shared among all callers of
- this function. */
+ this function. *VALUEIZED_ANYTHING will specify whether any
+ operands were valueized. */
static VEC(vn_reference_op_s, heap) *
-valueize_shared_reference_ops_from_ref (tree ref)
+valueize_shared_reference_ops_from_ref (tree ref, bool *valueized_anything)
{
if (!ref)
return NULL;
VEC_truncate (vn_reference_op_s, shared_lookup_references, 0);
copy_reference_ops_from_ref (ref, &shared_lookup_references);
- shared_lookup_references = valueize_refs (shared_lookup_references);
+ shared_lookup_references = valueize_refs_1 (shared_lookup_references,
+ valueized_anything);
return shared_lookup_references;
}
@@ -1694,12 +1725,14 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind,
VEC (vn_reference_op_s, heap) *operands;
struct vn_reference_s vr1;
tree cst;
+ bool valuezied_anything;
if (vnresult)
*vnresult = NULL;
vr1.vuse = vuse ? SSA_VAL (vuse) : NULL_TREE;
- vr1.operands = operands = valueize_shared_reference_ops_from_ref (op);
+ vr1.operands = operands
+ = valueize_shared_reference_ops_from_ref (op, &valuezied_anything);
vr1.type = TREE_TYPE (op);
vr1.set = get_alias_set (op);
vr1.hashcode = vn_reference_compute_hash (&vr1);
@@ -1711,12 +1744,12 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind,
{
vn_reference_t wvnresult;
ao_ref r;
- /* Make sure to use a valueized reference ... */
- if (!ao_ref_init_from_vn_reference (&r, vr1.set, vr1.type, vr1.operands))
+ /* Make sure to use a valueized reference if we valueized anything.
+ Otherwise preserve the full reference for advanced TBAA. */
+ if (!valuezied_anything
+ || !ao_ref_init_from_vn_reference (&r, vr1.set, vr1.type,
+ vr1.operands))
ao_ref_init (&r, op);
- else
- /* ... but also preserve a full reference tree for advanced TBAA. */
- r.ref = op;
vn_walk_kind = kind;
wvnresult =
(vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 82f39c2fcad..9bfbad63f70 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -362,7 +362,7 @@ new_var_info (tree t, const char *name)
|| (TREE_CODE (t) == VAR_DECL
&& DECL_HARD_REGISTER (t)));
ret->solution = BITMAP_ALLOC (&pta_obstack);
- ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
+ ret->oldsolution = NULL;
ret->next = NULL;
stats.total_vars++;
@@ -1504,13 +1504,12 @@ unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from,
}
BITMAP_FREE (get_varinfo (from)->solution);
- BITMAP_FREE (get_varinfo (from)->oldsolution);
+ if (get_varinfo (from)->oldsolution)
+ BITMAP_FREE (get_varinfo (from)->oldsolution);
- if (stats.iterations > 0)
- {
- BITMAP_FREE (get_varinfo (to)->oldsolution);
- get_varinfo (to)->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
- }
+ if (stats.iterations > 0
+ && get_varinfo (to)->oldsolution)
+ BITMAP_FREE (get_varinfo (to)->oldsolution);
}
if (valid_graph_edge (graph, to, to))
{
@@ -2544,18 +2543,27 @@ solve_graph (constraint_graph_t graph)
constraint_t c;
bitmap solution;
VEC(constraint_t,heap) *complex = graph->complex[i];
+ varinfo_t vi = get_varinfo (i);
bool solution_empty;
/* Compute the changed set of solution bits. */
- bitmap_and_compl (pts, get_varinfo (i)->solution,
- get_varinfo (i)->oldsolution);
+ if (vi->oldsolution)
+ bitmap_and_compl (pts, vi->solution, vi->oldsolution);
+ else
+ bitmap_copy (pts, vi->solution);
if (bitmap_empty_p (pts))
continue;
- bitmap_ior_into (get_varinfo (i)->oldsolution, pts);
+ if (vi->oldsolution)
+ bitmap_ior_into (vi->oldsolution, pts);
+ else
+ {
+ vi->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
+ bitmap_copy (vi->oldsolution, pts);
+ }
- solution = get_varinfo (i)->solution;
+ solution = vi->solution;
solution_empty = bitmap_empty_p (solution);
/* Process the complex constraints */
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index c6da47b6cd9..b028588d8ca 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -1088,9 +1088,7 @@ use_pred_not_overlap_with_undef_path_pred (
static inline bool
is_and_or_or (enum tree_code tc, tree typ)
{
- return (tc == TRUTH_AND_EXPR
- || tc == TRUTH_OR_EXPR
- || tc == BIT_IOR_EXPR
+ return (tc == BIT_IOR_EXPR
|| (tc == BIT_AND_EXPR
&& (typ == 0 || TREE_CODE (typ) == BOOLEAN_TYPE)));
}
@@ -1415,15 +1413,15 @@ is_norm_cond_subset_of (norm_cond_t norm_cond1,
code1 = norm_cond1->cond_code;
code2 = norm_cond2->cond_code;
- if (code1 == TRUTH_AND_EXPR || code1 == BIT_AND_EXPR)
+ if (code1 == BIT_AND_EXPR)
{
/* Both conditions are AND expressions. */
- if (code2 == TRUTH_AND_EXPR || code2 == BIT_AND_EXPR)
+ if (code2 == BIT_AND_EXPR)
return is_and_set_subset_of (norm_cond1, norm_cond2);
/* NORM_COND1 is an AND expression, and NORM_COND2 is an OR
expression. In this case, returns true if any subexpression
of NORM_COND1 is a subset of any subexpression of NORM_COND2. */
- else if (code2 == TRUTH_OR_EXPR || code2 == BIT_IOR_EXPR)
+ else if (code2 == BIT_IOR_EXPR)
{
size_t len1;
len1 = VEC_length (gimple, norm_cond1->conds);
@@ -1444,7 +1442,7 @@ is_norm_cond_subset_of (norm_cond_t norm_cond1,
}
}
/* NORM_COND1 is an OR expression */
- else if (code1 == TRUTH_OR_EXPR || code1 == BIT_IOR_EXPR)
+ else if (code1 == BIT_IOR_EXPR)
{
if (code2 != code1)
return false;
@@ -1457,10 +1455,10 @@ is_norm_cond_subset_of (norm_cond_t norm_cond1,
gcc_assert (VEC_length (gimple, norm_cond1->conds) == 1);
/* Conservatively returns false if NORM_COND1 is non-decomposible
and NORM_COND2 is an AND expression. */
- if (code2 == TRUTH_AND_EXPR || code2 == BIT_AND_EXPR)
+ if (code2 == BIT_AND_EXPR)
return false;
- if (code2 == TRUTH_OR_EXPR || code2 == BIT_IOR_EXPR)
+ if (code2 == BIT_IOR_EXPR)
return is_subset_of_any (VEC_index (gimple, norm_cond1->conds, 0),
norm_cond1->invert, norm_cond2, false);
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index e4d931f862a..a945e0ea76f 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1306,10 +1306,10 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
|| TYPE_PRECISION (inner_type) != TYPE_PRECISION (outer_type))
return false;
- /* Preserve conversions to BOOLEAN_TYPE if it is not of precision
- one. */
- if (TREE_CODE (inner_type) != BOOLEAN_TYPE
- && TREE_CODE (outer_type) == BOOLEAN_TYPE
+ /* Preserve conversions to/from BOOLEAN_TYPE if types are not
+ of precision one. */
+ if (((TREE_CODE (inner_type) == BOOLEAN_TYPE)
+ != (TREE_CODE (outer_type) == BOOLEAN_TYPE))
&& TYPE_PRECISION (outer_type) != 1)
return false;
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 28147382aac..f0d2f0d06b1 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2645,9 +2645,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
inner-loop: *(BASE+INIT). (The first location is actually
BASE+INIT+OFFSET, but we add OFFSET separately later). */
tree inner_base = build_fold_indirect_ref
- (fold_build2 (POINTER_PLUS_EXPR,
- TREE_TYPE (base), base,
- fold_convert (sizetype, init)));
+ (fold_build_pointer_plus (base, init));
if (vect_print_dump_info (REPORT_DETAILS))
{
@@ -2928,8 +2926,7 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
/* base + base_offset */
if (loop_vinfo)
- addr_base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (data_ref_base),
- data_ref_base, base_offset);
+ addr_base = fold_build_pointer_plus (data_ref_base, base_offset);
else
{
addr_base = build1 (ADDR_EXPR,
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index b8d67804f77..af4f1a74081 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -1819,9 +1819,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
fold_convert (TREE_TYPE (step_expr), niters),
step_expr);
if (POINTER_TYPE_P (TREE_TYPE (init_expr)))
- ni = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (init_expr),
- init_expr,
- fold_convert (sizetype, off));
+ ni = fold_build_pointer_plus (init_expr, off);
else
ni = fold_build2 (PLUS_EXPR, TREE_TYPE (init_expr),
init_expr,
@@ -2356,9 +2354,14 @@ static tree
vect_vfa_segment_size (struct data_reference *dr, tree length_factor)
{
tree segment_length;
- segment_length = size_binop (MULT_EXPR,
- fold_convert (sizetype, DR_STEP (dr)),
- fold_convert (sizetype, length_factor));
+
+ if (!compare_tree_int (DR_STEP (dr), 0))
+ segment_length = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr)));
+ else
+ segment_length = size_binop (MULT_EXPR,
+ fold_convert (sizetype, DR_STEP (dr)),
+ fold_convert (sizetype, length_factor));
+
if (vect_supportable_dr_alignment (dr, false)
== dr_explicit_realign_optimized)
{
@@ -2471,14 +2474,12 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
}
seg_a_min = addr_base_a;
- seg_a_max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (addr_base_a),
- addr_base_a, segment_length_a);
+ seg_a_max = fold_build_pointer_plus (addr_base_a, segment_length_a);
if (tree_int_cst_compare (DR_STEP (dr_a), size_zero_node) < 0)
seg_a_min = seg_a_max, seg_a_max = addr_base_a;
seg_b_min = addr_base_b;
- seg_b_max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (addr_base_b),
- addr_base_b, segment_length_b);
+ seg_b_max = fold_build_pointer_plus (addr_base_b, segment_length_b);
if (tree_int_cst_compare (DR_STEP (dr_b), size_zero_node) < 0)
seg_b_min = seg_b_max, seg_b_max = addr_base_b;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 89b1533d2b7..15498f4a5d0 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1877,8 +1877,7 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
anti_max,
build_int_cst (TREE_TYPE (var_vr->min), 1));
else
- min = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
- anti_max, size_int (1));
+ min = fold_build_pointer_plus_hwi (anti_max, 1);
max = real_max;
set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
}
@@ -1905,9 +1904,7 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
anti_min,
build_int_cst (TREE_TYPE (var_vr->min), 1));
else
- max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
- anti_min,
- size_int (-1));
+ max = fold_build_pointer_plus_hwi (anti_min, -1);
min = real_min;
set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 10f50de8a52..30ff80f152f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1759,9 +1759,7 @@ integer_all_onesp (const_tree expr)
if (!uns)
return 0;
- /* Note that using TYPE_PRECISION here is wrong. We care about the
- actual bits, not the (arbitrary) range of the type. */
- prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (expr)));
+ prec = TYPE_PRECISION (TREE_TYPE (expr));
if (prec >= HOST_BITS_PER_WIDE_INT)
{
HOST_WIDE_INT high_value;
@@ -9546,6 +9544,31 @@ build_common_builtin_nodes (void)
? "_Unwind_SjLj_Resume" : "_Unwind_Resume"),
ECF_NORETURN);
+ if (built_in_decls[BUILT_IN_RETURN_ADDRESS] == NULL_TREE)
+ {
+ ftype = build_function_type_list (ptr_type_node, integer_type_node,
+ NULL_TREE);
+ local_define_builtin ("__builtin_return_address", ftype,
+ BUILT_IN_RETURN_ADDRESS,
+ "__builtin_return_address",
+ ECF_NOTHROW);
+ }
+
+ if (built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER] == NULL_TREE
+ || built_in_decls[BUILT_IN_PROFILE_FUNC_EXIT] == NULL_TREE)
+ {
+ ftype = build_function_type_list (void_type_node, ptr_type_node,
+ ptr_type_node, NULL_TREE);
+ if (built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER] == NULL_TREE)
+ local_define_builtin ("__cyg_profile_func_enter", ftype,
+ BUILT_IN_PROFILE_FUNC_ENTER,
+ "__cyg_profile_func_enter", 0);
+ if (built_in_decls[BUILT_IN_PROFILE_FUNC_EXIT] == NULL_TREE)
+ local_define_builtin ("__cyg_profile_func_exit", ftype,
+ BUILT_IN_PROFILE_FUNC_EXIT,
+ "__cyg_profile_func_exit", 0);
+ }
+
/* The exception object and filter values from the runtime. The argument
must be zero before exception lowering, i.e. from the front end. After
exception lowering, it will be the region number for the exception
diff --git a/gcc/tree.h b/gcc/tree.h
index fe76f8fe5b9..5fd62c7e8cb 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5305,6 +5305,25 @@ truth_value_p (enum tree_code code)
|| code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
}
+/* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF. */
+static inline tree
+fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)
+{
+ return fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (ptr),
+ ptr, fold_convert_loc (loc, sizetype, off));
+}
+#define fold_build_pointer_plus(p,o) \
+ fold_build_pointer_plus_loc (UNKNOWN_LOCATION, p, o)
+
+/* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF. */
+static inline tree
+fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
+{
+ return fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (ptr),
+ ptr, size_int (off));
+}
+#define fold_build_pointer_plus_hwi(p,o) \
+ fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
/* In builtins.c */
extern tree fold_call_expr (location_t, tree, bool);
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 4842b780201..d5a45483ab7 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -365,7 +365,7 @@ typedef const struct value_chain_def *const_value_chain;
#define VTI(BB) ((variable_tracking_info) (BB)->aux)
/* Macro to access MEM_OFFSET as an HOST_WIDE_INT. Evaluates MEM twice. */
-#define INT_MEM_OFFSET(mem) (MEM_OFFSET (mem) ? INTVAL (MEM_OFFSET (mem)) : 0)
+#define INT_MEM_OFFSET(mem) (MEM_OFFSET_KNOWN_P (mem) ? MEM_OFFSET (mem) : 0)
/* Alloc pool for struct attrs_def. */
static alloc_pool attrs_pool;
@@ -4674,8 +4674,8 @@ track_expr_p (tree expr, bool need_rtl)
if (GET_MODE (decl_rtl) == BLKmode
|| AGGREGATE_TYPE_P (TREE_TYPE (realdecl)))
return 0;
- if (MEM_SIZE (decl_rtl)
- && INTVAL (MEM_SIZE (decl_rtl)) > MAX_VAR_PARTS)
+ if (MEM_SIZE_KNOWN_P (decl_rtl)
+ && MEM_SIZE (decl_rtl) > MAX_VAR_PARTS)
return 0;
}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 8c656960f75..88aea9bb354 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2391,7 +2391,7 @@ assemble_trampoline_template (void)
initial_trampoline = gen_const_mem (BLKmode, symbol);
set_mem_align (initial_trampoline, TRAMPOLINE_ALIGNMENT);
- set_mem_size (initial_trampoline, GEN_INT (TRAMPOLINE_SIZE));
+ set_mem_size (initial_trampoline, TRAMPOLINE_SIZE);
return initial_trampoline;
}
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 885724a4d84..8fab793254f 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.host (i[3456x]86-*-netware*): Remove.
+ * config/i386/netware-crt0.c, config/i386/t-nwld,
+ config/i386/t-slibgcc-nwld: Remove.
+
2011-07-15 Bernd Schmidt <bernds@codesourcery.com>
* config.host: Handle tic6x-*-*.
diff --git a/libgcc/config.host b/libgcc/config.host
index 293d462b89f..11760d0bda4 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -375,14 +375,6 @@ i[34567]86-pc-msdosdjgpp*)
;;
i[34567]86-*-lynxos*)
;;
-i[3456x]86-*-netware*)
- case /${with_ld} in
- */nwld)
- tmake_file="${tmake_file} i386/t-nwld i386/t-slibgcc-nwld"
- extra_parts="${extra_parts} crt0.o libgcc.def libc.def libcpre.def posixpre.def"
- ;;
- esac
- ;;
i[34567]86-*-nto-qnx*)
;;
i[34567]86-*-rtems*)
diff --git a/libgcc/config/i386/netware-crt0.c b/libgcc/config/i386/netware-crt0.c
deleted file mode 100644
index 03141ab9987..00000000000
--- a/libgcc/config/i386/netware-crt0.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Startup routines for NetWare.
- Contributed by Jan Beulich (jbeulich@novell.com)
- Copyright (C) 2004, 2007 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include <stddef.h>
-#include <stdint.h>
-#include "unwind-dw2-fde.h"
-
-int __init_environment (void *);
-int __deinit_environment (void *);
-
-
-#define SECTION_DECL(name, decl) decl __attribute__((__section__(name)))
-
-SECTION_DECL(".ctors", void(*const __CTOR_LIST__)(void))
- = (void(*)(void))(intptr_t)-1;
-SECTION_DECL(".ctors$_", void(*const __CTOR_END__)(void)) = NULL;
-
-SECTION_DECL(".dtors", void(*const __DTOR_LIST__)(void))
- = (void(*)(void))(intptr_t)-1;
-SECTION_DECL(".dtors$_", void(*const __DTOR_END__)(void)) = NULL;
-
-/* No need to use the __[de]register_frame_info_bases functions since
- for us the bases are NULL always anyway. */
-void __register_frame_info (const void *, struct object *)
- __attribute__((__weak__));
-void *__deregister_frame_info (const void *) __attribute__((__weak__));
-
-SECTION_DECL(".eh_frame", /*const*/ uint32_t __EH_FRAME_BEGIN__[]) = { };
-SECTION_DECL(".eh_frame$_", /*const*/ uint32_t __EH_FRAME_END__[]) = {0};
-
-int
-__init_environment (void *unused __attribute__((__unused__)))
-{
- void (* const * pctor)(void);
- static struct object object;
-
- if (__register_frame_info)
- __register_frame_info (__EH_FRAME_BEGIN__, &object);
-
- for (pctor = &__CTOR_END__ - 1; pctor > &__CTOR_LIST__; --pctor)
- if (*pctor != NULL)
- (*pctor)();
-
- return 0;
-}
-
-int
-__deinit_environment (void *unused __attribute__((__unused__)))
-{
- /* This should be static to prevent calling the same destructor
- twice (just in case where we get here multiple times). */
- static void (* const * pdtor)(void) = &__DTOR_LIST__ + 1;
-
- while (pdtor < &__DTOR_END__)
- if (*pdtor++ != NULL)
- pdtor[-1] ();
-
- if (__deregister_frame_info)
- __deregister_frame_info(__EH_FRAME_BEGIN__);
-
- return 0;
-}
diff --git a/libgcc/config/i386/t-nwld b/libgcc/config/i386/t-nwld
deleted file mode 100644
index d08e2827f65..00000000000
--- a/libgcc/config/i386/t-nwld
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011
-# Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-crt0.o: $(srcdir)/config/i386/netware-crt0.c
- $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $<
-
-CRTSTUFF_T_CFLAGS = -mpreferred-stack-boundary=2
-
-libgcc.def: $(srcdir)/config/i386/t-nwld
- echo "module libgcc_s" >$@
-
-libc.def: $(srcdir)/config/i386/t-nwld
- echo "module libc" >$@
-
-libcpre.def: $(srcdir)/config/i386/t-nwld
- echo "start _LibCPrelude" >$@
- echo "exit _LibCPostlude" >>$@
- echo "check _LibCCheckUnload" >>$@
-
-posixpre.def: $(srcdir)/config/i386/t-nwld
- echo "start POSIX_Start" >$@
- echo "exit POSIX_Stop" >>$@
- echo "check POSIX_CheckUnload" >>$@
diff --git a/libgcc/config/i386/t-slibgcc-nwld b/libgcc/config/i386/t-slibgcc-nwld
deleted file mode 100644
index 408587273da..00000000000
--- a/libgcc/config/i386/t-slibgcc-nwld
+++ /dev/null
@@ -1,31 +0,0 @@
-# Build a shared libgcc library for NetWare.
-
-SHLIB_EXT = .nlm
-SHLIB_NAME = @shlib_base_name@.nlm
-SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
-SHLIB_DEF = $(gcc_srcdir)/config/i386/netware-libgcc.def
-SHLIB_MAP = $(gcc_srcdir)/config/i386/netware-libgcc.exp
-SHLIB_SRC = $(gcc_srcdir)/config/i386/netware-libgcc.c
-
-SHLIB_LINK = set -e; \
- cat $(SHLIB_DEF) >@shlib_base_name@.def; \
- echo "name $(SHLIB_NAME)" >>@shlib_base_name@.def; \
- echo "version $(version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \
- touch build; \
- echo "build $$(expr $$(<build) + 0)" >>@shlib_base_name@.def; \
- echo "export @$(SHLIB_MAP)" >>@shlib_base_name@.def; \
- if mpkxdc -n -p @shlib_base_name@.xdc; \
- then echo "xdcdata @shlib_base_name@.xdc" >>@shlib_base_name@.def; \
- else echo "WARNING: $(SHLIB_NAME) built without XDC data will not work well." 1>&2; \
- fi; \
- $(CC) $(LIBGCC2_CFLAGS) -o $(SHLIB_NAME) \
- $(SHLIB_SRC) -posix -static-libgcc -lnetware \
- -Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_base_name@.def; \
- rm -f @shlib_base_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_base_name@.imp; \
- rm -f libgcc.imp; $(LN_S) @shlib_base_name@.imp libgcc.imp; \
- expr $$(<build) + 1 >build
-
-SHLIB_INSTALL = \
- $(SHELL) $(srcdir)/mkinstalldirs $(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_NAME) $(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME); \
- $(INSTALL_DATA) @shlib_base_name@.imp $(DESTDIR)$(libsubdir)/
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 36c716c518e..9225401fb35 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/49541
+ * testsuite/lib/libgomp.exp (libgomp_init): Don't add -lgomp to
+ ldflags.
+
2011-07-15 Jakub Jelinek <jakub@redhat.com>
* config/linux/wait.h (do_spin): New inline, largely copied
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 0b0b608bf9e..976543dab17 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -137,7 +137,6 @@ proc libgomp_init { args } {
lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
}
lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
- lappend ALWAYS_CFLAGS "ldflags=-lgomp"
# We use atomic operations in the testcases to validate results.
if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 4a46f39877f..3d368596335 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,119 @@
+2011-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/mutex (timed_mutex, recursive_timed_mutex): Update
+ to use steady_clock instead of monotonic_clock.
+ * config/abi/pre/gnu.ver: Export steady_clock::now.
+
+2011-07-20 Benjamin Kosnik <bkoz@redhat.com>
+ Daniel Krugler <daniel.kruegler@googlemail.com>
+
+ * include/std/array (array::at, array::operator[]): Mark constexpr.
+ * testsuite/23_containers/array/requirements/
+ constexpr_element_access.cc: Add.
+
+2011-07-20 Benjamin Kosnik <bkoz@redhat.com>
+ Daniel Krugler <daniel.kruegler@googlemail.com>
+
+ * include/std/chrono: (system_clock::is_steady): Update to N3291
+ from is_monotonic.
+ (time_point): Mark nonmember arithmetic operators constexpr.
+ * src/chrono.cc: Modify for above.
+ * src/compatibility-c++0x.cc: Same.
+ * testsuite/20_util/time_point/nonmember/constexpr.cc: New.
+ * testsuite/20_util/time_point/1.cc: Modify.
+ * testsuite/20_util/system_clock/constexpr_data.cc: Modify.
+ * testsuite/20_util/system_clock/1.cc: Modify.
+ * testsuite/20_util/monotonic_clock/constexpr_data.cc: Move to...
+ * testsuite/20_util/steady_clock/constexpr_data.cc: ...here.
+ * testsuite/30_threads/condition_variable/members/2.cc: Modify.
+ * testsuite/30_threads/condition_variable_any/members/2.cc: Modify.
+
+2011-07-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/system_error: Use noexcept.
+ * src/system_error.cc: Likewise.
+ * testsuite/19_diagnostics/error_condition/modifiers/39881.cc: Adjust.
+ * testsuite/19_diagnostics/error_condition/cons/39881.cc: Likewise.
+ * testsuite/19_diagnostics/error_code/modifiers/39882.cc: Likewise.
+ * testsuite/19_diagnostics/error_code/cons/39882.cc: Likewise.
+ * testsuite/util/testsuite_error.h: Likewise.
+
+ * include/std/system_error (error_code::error_code(_ErrorCodeEnum)):
+ Use enable_if on template parameter default.
+ (error_condition::error_condition(_ErrorConditionEnum)): Likewise.
+
+2011-07-20 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ * include/precompiled/stdc++.h: Add scoped_allocator.
+
+2011-07-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/bitset (operator[]): Make constexpr.
+ * testsuite/23_containers/bitset/operations/constexpr.cc: New.
+
+2011-07-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/debug/safe_local_iterator.h (_Safe_local_iterator<>::
+ _Safe_local_iterator(const _Iterator&, size_type, const _Sequence*)):
+ Fix typo.
+
+2011-07-19 François Dumont <francois.cppdevs@free.fr>
+
+ * include/debug/safe_unordered_base.h, safe_unordered_sequence.h,
+ safe_unordered_sequence.tcc, safe_local_iterator.h,
+ safe_local_iterator.tcc: New, support for unordered sequence safe
+ local iterators.
+ * include/Makefile.am: Add previous files.
+ * include/Makefile.in: Regenerate.
+ * include/debug/unordered_map, unordered_set: Implement
+ _Safe_unordered_sequence and expose _Safe_local_iterator.
+ * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor
+ _Safe_iterator::_M_get_distance static method to expose it as
+ __get_distance function and use it in _Safe_local_iterator type.
+ * include/debug/formatter.h: Add __msg_local_iter_compare_bad
+ _Debug_msg_id enum entry to notify invalid comparison between local
+ iterators from different buckets. Add _Parameter constructor from
+ _Safe_local_iterator.
+ * include/debug/functions.h: Add __valid_range overload for
+ _Safe_local_iterator.
+ * src/debug.cc: Add _Safe_unordered_sequence_base and
+ _Safe_local_iterator_base methods implementations.
+ * config/abi/pre/gnu.ver: Add export of some
+ _Safe_unordered_sequence_base and _Safe_local_iterator_base methods.
+ * testsuite/util/debug/checks.h: Add use_invalid_iterator function to
+ simulate use of a singular iterator.
+ * testsuite/util/debug/unordered_checks.h: New, several functions
+ to simulate classic invalid usage of unordered sequence local
+ iterators.
+ * testsuite/23_containers/unordered_map/debug/
+ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
+ use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
+ invalid_local_iterator_compare_neg.cc: New.
+ * testsuite/23_containers/unordered_multimap/debug/
+ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
+ use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
+ invalid_local_iterator_compare_neg.cc: New.
+ * testsuite/23_containers/unordered_set/debug/
+ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
+ use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
+ invalid_local_iterator_compare_neg.cc: New.
+ * testsuite/23_containers/unordered_multiset/debug/
+ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
+ use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
+ invalid_local_iterator_compare_neg.cc: New.
+
+2011-07-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/48430
+ * include/bits/shared_ptr.h (struct hash<shared_ptr<>>): Use
+ __hash_base.
+ * include/bits/unique_ptr.h (struct hash<unique_ptr<>>): Likewise.
+
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * crossconfig.m4 (*-netware): Remove.
+ * configure: Regenerate.
+
2011-07-15 Yufeng Zhang <yufeng.zhang@arm.com>
* config/locale/newlib/ctype_members.cc: New file.
@@ -1458,7 +1574,7 @@
2011-05-19 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/tuple (tuple<>::operator=(tuple&&)): Specify as
- noexcept.
+ noexcept.
(__get_helper): Likewise.
(_Head_base<>::_M_head, _Tuple_impl<>::_M_head, _M_tail): Likewise.
* include/bits/move.h (swap): Likewise.
@@ -2151,8 +2267,8 @@
2011-03-31 Jeffrey Yasskin <jyasskin@google.com>
- * libsupc++/exception_ptr.h: Forward-declare std::type_info.
- * libsupc++/nested_exception.h (__throw_with_nested): Remove a
+ * libsupc++/exception_ptr.h: Forward-declare std::type_info.
+ * libsupc++/nested_exception.h (__throw_with_nested): Remove a
redundant default argument from std::__throw_with_nested.
2011-03-31 Paolo Carlini <paolo.carlini@oracle.com>
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 427189c063d..3d797a8aa17 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1284,6 +1284,14 @@ GLIBCXX_3.4.17 {
# std::thread::hardware_concurrency
_ZNSt6thread20hardware_concurrencyEv;
+ # __gnu_debug::_Safe_unordered_sequence_base and _Safe_local_iterator_base
+ _ZN11__gnu_debug29_Safe_unordered_sequence_base7_M_swapERS0_;
+ _ZN11__gnu_debug29_Safe_unordered_sequence_base13_M_detach_allEv;
+ _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb;
+ _ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv;
+
+ # std::chrono::steady_clock::now()
+ _ZNSt6chrono12steady_clock3nowEv;
} GLIBCXX_3.4.16;
# Symbols in the support library (libsupc++) have their own tag.
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 39e6b0814bf..0bbc485d300 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -57084,155 +57084,6 @@ $as_echo "$ac_ld_relro" >&6; }
fi
;;
- *-netware)
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
-
-
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
- fi
- fi
-
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
- glibcxx_ld_is_gold=no
- if test x"$with_gnu_ld" = x"yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld version" >&5
-$as_echo_n "checking for ld version... " >&6; }
-
- if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then
- glibcxx_ld_is_gold=yes
- fi
- ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_gnu_ld_version" >&5
-$as_echo "$glibcxx_gnu_ld_version" >&6; }
- fi
-
- # Set --gc-sections.
- glibcxx_have_gc_sections=no
- if test "$glibcxx_ld_is_gold" = "yes"; then
- if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then
- glibcxx_have_gc_sections=yes
- fi
- else
- glibcxx_gcsections_min_ld=21602
- if test x"$with_gnu_ld" = x"yes" &&
- test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then
- glibcxx_have_gc_sections=yes
- fi
- fi
- if test "$glibcxx_have_gc_sections" = "yes"; then
- # Sufficiently young GNU ld it is! Joy and bunny rabbits!
- # NB: This flag only works reliably after 2.16.1. Configure tests
- # for this are difficult, so hard wire a value that should work.
-
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-Wl,--gc-sections'
-
- # Check for -Wl,--gc-sections
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,--gc-sections" >&5
-$as_echo_n "checking for ld that supports -Wl,--gc-sections... " >&6; }
- if test x$gcc_no_link = xyes; then
- as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
-fi
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- int one(void) { return 1; }
- int two(void) { return 2; }
-
-int
-main ()
-{
- two();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_gcsections=yes
-else
- ac_gcsections=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test "$ac_gcsections" = "yes"; then
- rm -f conftest.c
- touch conftest.c
- if $CC -c conftest.c; then
- if $LD --gc-sections -o conftest conftest.o 2>&1 | \
- grep "Warning: gc-sections option ignored" > /dev/null; then
- ac_gcsections=no
- fi
- fi
- rm -f conftest.c conftest.o conftest
- fi
- if test "$ac_gcsections" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_gcsections" >&5
-$as_echo "$ac_gcsections" >&6; }
-
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- fi
-
- # Set -z,relro.
- # Note this is only for shared objects.
- ac_ld_relro=no
- if test x"$with_gnu_ld" = x"yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
-$as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
- if test -n "$cxx_z_relo"; then
- OPT_LDFLAGS="-Wl,-z,relro"
- ac_ld_relro=yes
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ld_relro" >&5
-$as_echo "$ac_ld_relro" >&6; }
- fi
-
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
- fi
-
-
-
-
- $as_echo "#define HAVE_HYPOT 1" >>confdefs.h
-
- $as_echo "#define HAVE_ISINF 1" >>confdefs.h
-
- $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
-
- ;;
*-qnx6.1* | *-qnx6.2*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
index 2d0a4a83ded..361ed0b8641 100644
--- a/libstdc++-v3/crossconfig.m4
+++ b/libstdc++-v3/crossconfig.m4
@@ -173,14 +173,6 @@ case "${host}" in
AC_DEFINE(HAVE_ISNANL)
fi
;;
- *-netware)
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(SECTION_FLAGS)
- GLIBCXX_CHECK_LINKER_FEATURES
- AC_DEFINE(HAVE_HYPOT)
- AC_DEFINE(HAVE_ISINF)
- AC_DEFINE(HAVE_ISNAN)
- ;;
*-qnx6.1* | *-qnx6.2*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index c926a3133aa..52e94cc0c42 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -701,8 +701,13 @@ debug_headers = \
${debug_srcdir}/safe_base.h \
${debug_srcdir}/safe_iterator.h \
${debug_srcdir}/safe_iterator.tcc \
+ ${debug_srcdir}/safe_local_iterator.h \
+ ${debug_srcdir}/safe_local_iterator.tcc \
${debug_srcdir}/safe_sequence.h \
${debug_srcdir}/safe_sequence.tcc \
+ ${debug_srcdir}/safe_unordered_base.h \
+ ${debug_srcdir}/safe_unordered_sequence.h \
+ ${debug_srcdir}/safe_unordered_sequence.tcc \
${debug_srcdir}/set \
${debug_srcdir}/set.h \
${debug_srcdir}/string \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index c26eab0c6a0..76d4123da96 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -946,8 +946,13 @@ debug_headers = \
${debug_srcdir}/safe_base.h \
${debug_srcdir}/safe_iterator.h \
${debug_srcdir}/safe_iterator.tcc \
+ ${debug_srcdir}/safe_local_iterator.h \
+ ${debug_srcdir}/safe_local_iterator.tcc \
${debug_srcdir}/safe_sequence.h \
${debug_srcdir}/safe_sequence.tcc \
+ ${debug_srcdir}/safe_unordered_base.h \
+ ${debug_srcdir}/safe_unordered_sequence.h \
+ ${debug_srcdir}/safe_unordered_sequence.tcc \
${debug_srcdir}/set \
${debug_srcdir}/set.h \
${debug_srcdir}/string \
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index 2158de6bf81..2c45f3d7ba3 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -614,7 +614,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// std::hash specialization for shared_ptr.
template<typename _Tp>
struct hash<shared_ptr<_Tp>>
- : public std::unary_function<shared_ptr<_Tp>, size_t>
+ : public __hash_base<size_t, shared_ptr<_Tp>>
{
size_t
operator()(const shared_ptr<_Tp>& __s) const
diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h
index a6f457ee59e..869d931330c 100644
--- a/libstdc++-v3/include/bits/unique_ptr.h
+++ b/libstdc++-v3/include/bits/unique_ptr.h
@@ -542,7 +542,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// std::hash specialization for unique_ptr.
template<typename _Tp, typename _Dp>
struct hash<unique_ptr<_Tp, _Dp>>
- : public std::unary_function<unique_ptr<_Tp, _Dp>, size_t>
+ : public __hash_base<size_t, unique_ptr<_Tp, _Dp>>
{
size_t
operator()(const unique_ptr<_Tp, _Dp>& __u) const
diff --git a/libstdc++-v3/include/debug/formatter.h b/libstdc++-v3/include/debug/formatter.h
index 065a50274c5..8da171972eb 100644
--- a/libstdc++-v3/include/debug/formatter.h
+++ b/libstdc++-v3/include/debug/formatter.h
@@ -1,6 +1,6 @@
// Debug-mode error formatting implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -46,6 +46,9 @@ namespace __gnu_debug
template<typename _Iterator, typename _Sequence>
class _Safe_iterator;
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_local_iterator;
+
template<typename _Sequence>
class _Safe_sequence;
@@ -103,7 +106,9 @@ namespace __gnu_debug
// forward_list
__msg_insert_after_end,
__msg_erase_after_bad,
- __msg_valid_range2
+ __msg_valid_range2,
+ // unordered sequence local iterators
+ __msg_local_iter_compare_bad
};
class _Error_formatter
@@ -236,6 +241,42 @@ namespace __gnu_debug
}
}
+ template<typename _Iterator, typename _Sequence>
+ _Parameter(const _Safe_local_iterator<_Iterator, _Sequence>& __it,
+ const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+#ifdef __GXX_RTTI
+ _M_variant._M_iterator._M_type = &typeid(__it);
+#else
+ _M_variant._M_iterator._M_type = 0;
+#endif
+ _M_variant._M_iterator._M_constness =
+ std::__are_same<_Safe_local_iterator<_Iterator, _Sequence>,
+ typename _Sequence::local_iterator>::
+ __value ? __mutable_iterator : __const_iterator;
+ _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
+#ifdef __GXX_RTTI
+ _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
+#else
+ _M_variant._M_iterator._M_seq_type = 0;
+#endif
+
+ if (__it._M_singular())
+ _M_variant._M_iterator._M_state = __singular;
+ else
+ {
+ if (__it._M_is_end())
+ _M_variant._M_iterator._M_state = __end;
+ else if (__it._M_is_begin())
+ _M_variant._M_iterator._M_state = __begin;
+ else
+ _M_variant._M_iterator._M_state = __middle;
+ }
+ }
+
template<typename _Type>
_Parameter(const _Type*& __it, const char* __name, _Is_iterator)
: _M_kind(__iterator), _M_variant()
diff --git a/libstdc++-v3/include/debug/functions.h b/libstdc++-v3/include/debug/functions.h
index 75ed9ef057f..ea12589e3c0 100644
--- a/libstdc++-v3/include/debug/functions.h
+++ b/libstdc++-v3/include/debug/functions.h
@@ -1,6 +1,6 @@
// Debugging support implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -144,6 +144,13 @@ namespace __gnu_debug
const _Safe_iterator<_Iterator, _Sequence>& __last)
{ return __first._M_valid_range(__last); }
+ /** Safe local iterators know how to check if they form a valid range. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __valid_range(const _Safe_local_iterator<_Iterator, _Sequence>& __first,
+ const _Safe_local_iterator<_Iterator, _Sequence>& __last)
+ { return __first._M_valid_range(__last); }
+
/* Checks that [first, last) is a valid range, and then returns
* __first. This routine is useful when we can't use a separate
* assertion statement because, e.g., we are in a constructor.
diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h
index 127c3ba72d4..016ec7b9418 100644
--- a/libstdc++-v3/include/debug/safe_iterator.h
+++ b/libstdc++-v3/include/debug/safe_iterator.h
@@ -62,6 +62,43 @@ namespace __gnu_debug
__check_singular_aux(const _Safe_iterator_base* __x)
{ return __x->_M_singular(); }
+ /** The precision to which we can calculate the distance between
+ * two iterators.
+ */
+ enum _Distance_precision
+ {
+ __dp_equality, //< Can compare iterator equality, only
+ __dp_sign, //< Can determine equality and ordering
+ __dp_exact //< Can determine distance precisely
+ };
+
+ /** Determine the distance between two iterators with some known
+ * precision.
+ */
+ template<typename _Iterator1, typename _Iterator2>
+ inline std::pair<typename std::iterator_traits<_Iterator1>::difference_type,
+ _Distance_precision>
+ __get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::random_access_iterator_tag)
+ { return std::make_pair(__rhs - __lhs, __dp_exact); }
+
+ template<typename _Iterator1, typename _Iterator2>
+ inline std::pair<typename std::iterator_traits<_Iterator1>::difference_type,
+ _Distance_precision>
+ __get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::forward_iterator_tag)
+ { return std::make_pair(__lhs == __rhs? 0 : 1, __dp_equality); }
+
+ template<typename _Iterator1, typename _Iterator2>
+ inline std::pair<typename std::iterator_traits<_Iterator1>::difference_type,
+ _Distance_precision>
+ __get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs)
+ {
+ typedef typename std::iterator_traits<_Iterator1>::iterator_category
+ _Category;
+ return __get_distance(__lhs, __rhs, _Category());
+ }
+
/** \brief Safe iterator wrapper.
*
* The class template %_Safe_iterator is a wrapper around an
@@ -78,16 +115,6 @@ namespace __gnu_debug
{
typedef _Safe_iterator _Self;
- /** The precision to which we can calculate the distance between
- * two iterators.
- */
- enum _Distance_precision
- {
- __dp_equality, //< Can compare iterator equality, only
- __dp_sign, //< Can determine equality and ordering
- __dp_exact //< Can determine distance precisely
- };
-
/// The underlying iterator
_Iterator _M_current;
@@ -380,30 +407,6 @@ namespace __gnu_debug
_M_get_sequence() const
{ return static_cast<const _Sequence*>(_M_sequence); }
- /** Determine the distance between two iterators with some known
- * precision.
- */
- template<typename _Iterator1, typename _Iterator2>
- static std::pair<difference_type, _Distance_precision>
- _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs)
- {
- typedef typename std::iterator_traits<_Iterator1>::iterator_category
- _Category;
- return _M_get_distance(__lhs, __rhs, _Category());
- }
-
- template<typename _Iterator1, typename _Iterator2>
- static std::pair<difference_type, _Distance_precision>
- _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
- std::random_access_iterator_tag)
- { return std::make_pair(__rhs - __lhs, __dp_exact); }
-
- template<typename _Iterator1, typename _Iterator2>
- static std::pair<difference_type, _Distance_precision>
- _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
- std::forward_iterator_tag)
- { return std::make_pair(__lhs == __rhs? 0 : 1, __dp_equality); }
-
/// Is this iterator equal to the sequence's begin() iterator?
bool _M_is_begin() const
{ return base() == _M_get_sequence()->_M_base().begin(); }
diff --git a/libstdc++-v3/include/debug/safe_iterator.tcc b/libstdc++-v3/include/debug/safe_iterator.tcc
index 942640c651d..777a707e7f3 100644
--- a/libstdc++-v3/include/debug/safe_iterator.tcc
+++ b/libstdc++-v3/include/debug/safe_iterator.tcc
@@ -1,6 +1,6 @@
// Debugging iterator implementation (out of line) -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -48,7 +48,7 @@ namespace __gnu_debug
{
const_iterator __begin = _M_get_sequence()->_M_base().begin();
std::pair<difference_type, _Distance_precision> __dist =
- this->_M_get_distance(__begin, base());
+ __get_distance(__begin, base());
bool __ok = ((__dist.second == __dp_exact && __dist.first >= -__n)
|| (__dist.second != __dp_exact && __dist.first > 0));
return __ok;
@@ -57,7 +57,7 @@ namespace __gnu_debug
{
const_iterator __end = _M_get_sequence()->_M_base().end();
std::pair<difference_type, _Distance_precision> __dist =
- this->_M_get_distance(base(), __end);
+ __get_distance(base(), __end);
bool __ok = ((__dist.second == __dp_exact && __dist.first >= __n)
|| (__dist.second != __dp_exact && __dist.first > 0));
return __ok;
@@ -76,7 +76,7 @@ namespace __gnu_debug
/* Determine if we can order the iterators without the help of
the container */
std::pair<difference_type, _Distance_precision> __dist =
- this->_M_get_distance(base(), __rhs.base());
+ __get_distance(base(), __rhs.base());
switch (__dist.second) {
case __dp_equality:
if (__dist.first == 0)
diff --git a/libstdc++-v3/include/debug/safe_local_iterator.h b/libstdc++-v3/include/debug/safe_local_iterator.h
new file mode 100644
index 00000000000..de0cbee2a62
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_local_iterator.h
@@ -0,0 +1,369 @@
+// Safe iterator implementation -*- C++ -*-
+
+// Copyright (C) 2011 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 debug/safe_local_iterator.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_LOCAL_ITERATOR_H
+#define _GLIBCXX_DEBUG_SAFE_LOCAL_ITERATOR_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/safe_unordered_base.h>
+#include <ext/type_traits.h>
+
+namespace __gnu_debug
+{
+ /** \brief Safe iterator wrapper.
+ *
+ * The class template %_Safe_local_iterator is a wrapper around an
+ * iterator that tracks the iterator's movement among sequences and
+ * checks that operations performed on the "safe" iterator are
+ * legal. In additional to the basic iterator operations (which are
+ * validated, and then passed to the underlying iterator),
+ * %_Safe_local_iterator has member functions for iterator invalidation,
+ * attaching/detaching the iterator from sequences, and querying
+ * the iterator's state.
+ */
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_local_iterator : public _Safe_local_iterator_base
+ {
+ typedef _Safe_local_iterator _Self;
+ typedef typename _Sequence::size_type size_type;
+
+ /// The underlying iterator
+ _Iterator _M_current;
+
+ /// The bucket this local iterator belongs to
+ size_type _M_bucket;
+
+ /// Determine if this is a constant iterator.
+ bool
+ _M_constant() const
+ {
+ typedef typename _Sequence::const_local_iterator const_iterator;
+ return std::__are_same<const_iterator, _Safe_local_iterator>::__value;
+ }
+
+ typedef std::iterator_traits<_Iterator> _Traits;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename _Traits::iterator_category iterator_category;
+ typedef typename _Traits::value_type value_type;
+ typedef typename _Traits::difference_type difference_type;
+ typedef typename _Traits::reference reference;
+ typedef typename _Traits::pointer pointer;
+
+ /// @post the iterator is singular and unattached
+ _Safe_local_iterator() : _M_current() { }
+
+ /**
+ * @brief Safe iterator construction from an unsafe iterator and
+ * its sequence.
+ *
+ * @pre @p seq is not NULL
+ * @post this is not singular
+ */
+ _Safe_local_iterator(const _Iterator& __i, size_type __bucket,
+ const _Sequence* __seq)
+ : _Safe_local_iterator_base(__seq, _M_constant()), _M_current(__i),
+ _M_bucket(__bucket)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!this->_M_singular(),
+ _M_message(__msg_init_singular)
+ ._M_iterator(*this, "this"));
+ }
+
+ /**
+ * @brief Copy construction.
+ */
+ _Safe_local_iterator(const _Safe_local_iterator& __x)
+ : _Safe_local_iterator_base(__x, _M_constant()),
+ _M_current(__x._M_current), _M_bucket(__x._M_bucket)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 408. Is vector<reverse_iterator<char*> > forbidden?
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
+ || __x._M_current == _Iterator(),
+ _M_message(__msg_init_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Converting constructor from a mutable iterator to a
+ * constant iterator.
+ */
+ template<typename _MutableIterator>
+ _Safe_local_iterator(
+ const _Safe_local_iterator<_MutableIterator,
+ typename __gnu_cxx::__enable_if<std::__are_same<
+ _MutableIterator,
+ typename _Sequence::local_iterator::iterator_type>::__value,
+ _Sequence>::__type>& __x)
+ : _Safe_local_iterator_base(__x, _M_constant()),
+ _M_current(__x.base()), _M_bucket(__x._M_bucket)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 408. Is vector<reverse_iterator<char*> > forbidden?
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
+ || __x.base() == _Iterator(),
+ _M_message(__msg_init_const_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Copy assignment.
+ */
+ _Safe_local_iterator&
+ operator=(const _Safe_local_iterator& __x)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 408. Is vector<reverse_iterator<char*> > forbidden?
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
+ || __x._M_current == _Iterator(),
+ _M_message(__msg_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ _M_current = __x._M_current;
+ _M_bucket = __x._M_bucket;
+ this->_M_attach(__x._M_sequence);
+ return *this;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ */
+ reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return *_M_current;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ * @todo Make this correct w.r.t. iterators that return proxies
+ * @todo Use addressof() instead of & operator
+ */
+ pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return &*_M_current;
+ }
+
+ // ------ Input iterator requirements ------
+ /**
+ * @brief Iterator preincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_local_iterator&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ ++_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_local_iterator
+ operator++(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ _Safe_local_iterator __tmp(*this);
+ ++_M_current;
+ return __tmp;
+ }
+
+ // ------ Utilities ------
+ /**
+ * @brief Return the underlying iterator
+ */
+ _Iterator
+ base() const { return _M_current; }
+
+ /**
+ * @brief Return the bucket
+ */
+ size_type
+ bucket() const { return _M_bucket; }
+
+ /**
+ * @brief Conversion to underlying non-debug iterator to allow
+ * better interaction with non-debug containers.
+ */
+ operator _Iterator() const { return _M_current; }
+
+ /** Attach iterator to the given sequence. */
+ void
+ _M_attach(_Safe_sequence_base* __seq)
+ { _Safe_iterator_base::_M_attach(__seq, _M_constant()); }
+
+ /** Likewise, but not thread-safe. */
+ void
+ _M_attach_single(_Safe_sequence_base* __seq)
+ { _Safe_iterator_base::_M_attach_single(__seq, _M_constant()); }
+
+ /// Is the iterator dereferenceable?
+ bool
+ _M_dereferenceable() const
+ { return !this->_M_singular() && !_M_is_end(); }
+
+ /// Is the iterator incrementable?
+ bool
+ _M_incrementable() const
+ { return !this->_M_singular() && !_M_is_end(); }
+
+ // Is the iterator range [*this, __rhs) valid?
+ template<typename _Other>
+ bool
+ _M_valid_range(const _Safe_local_iterator<_Other,
+ _Sequence>& __rhs) const;
+
+ // The sequence this iterator references.
+ const _Sequence*
+ _M_get_sequence() const
+ { return static_cast<const _Sequence*>(_M_sequence); }
+
+ /// Is this iterator equal to the sequence's begin() iterator?
+ bool _M_is_begin() const
+ { return base() == _M_get_sequence()->_M_base().begin(_M_bucket); }
+
+ /// Is this iterator equal to the sequence's end() iterator?
+ bool _M_is_end() const
+ { return base() == _M_get_sequence()->_M_base().end(_M_bucket); }
+
+ /// Is this iterator part of the same bucket as the other one?
+ template <typename _Other>
+ bool _M_in_same_bucket(const _Safe_local_iterator<_Other,
+ _Sequence>& __other) const
+ { return _M_bucket == __other.bucket(); }
+ };
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator==(const _Safe_local_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_local_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_in_same_bucket(__rhs),
+ _M_message(__msg_local_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator==(const _Safe_local_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_local_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_in_same_bucket(__rhs),
+ _M_message(__msg_local_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_local_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_local_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_in_same_bucket(__rhs),
+ _M_message(__msg_local_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_local_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_local_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_in_same_bucket(__rhs),
+ _M_message(__msg_local_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+} // namespace __gnu_debug
+
+#include <debug/safe_local_iterator.tcc>
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_local_iterator.tcc b/libstdc++-v3/include/debug/safe_local_iterator.tcc
new file mode 100644
index 00000000000..e91e6bfbf08
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_local_iterator.tcc
@@ -0,0 +1,75 @@
+// Debugging iterator implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2011 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 debug/safe_locale_iterator.tcc
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_LOCAL_ITERATOR_TCC
+#define _GLIBCXX_DEBUG_SAFE_LOCAL_ITERATOR_TCC 1
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ template<typename _Other>
+ bool
+ _Safe_local_iterator<_Iterator, _Sequence>::
+ _M_valid_range(const _Safe_local_iterator<_Other, _Sequence>& __rhs) const
+ {
+ if (!_M_can_compare(__rhs))
+ return false;
+ if (_M_bucket != __rhs._M_bucket)
+ return false;
+
+ /* Determine if we can order the iterators without the help of
+ the container */
+ std::pair<difference_type, _Distance_precision> __dist =
+ __get_distance(base(), __rhs.base());
+ switch (__dist.second)
+ {
+ case __dp_equality:
+ if (__dist.first == 0)
+ return true;
+ break;
+
+ case __dp_sign:
+ case __dp_exact:
+ return __dist.first >= 0;
+ }
+
+ /* We can only test for equality, but check if one of the
+ iterators is at an extreme. */
+ /* Optim for classic [begin, it) or [it, end) ranges, limit checks
+ * when code is valid. */
+ if (_M_is_begin() || __rhs._M_is_end())
+ return true;
+ if (_M_is_end() || __rhs._M_is_begin())
+ return false;
+
+ // Assume that this is a valid range; we can't check anything else
+ return true;
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_unordered_base.h b/libstdc++-v3/include/debug/safe_unordered_base.h
new file mode 100644
index 00000000000..14d83bc49fb
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_unordered_base.h
@@ -0,0 +1,175 @@
+// Safe sequence/iterator base implementation -*- C++ -*-
+
+// Copyright (C) 2011 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 debug/safe_unordered_base.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_BASE_H
+#define _GLIBCXX_DEBUG_SAFE_UNORDERED_BASE_H 1
+
+#include <debug/safe_base.h>
+
+namespace __gnu_debug
+{
+ class _Safe_unordered_sequence_base;
+
+ /** \brief Basic functionality for a @a safe iterator.
+ *
+ * The %_Safe_local_iterator_base base class implements the functionality
+ * of a safe local iterator that is not specific to a particular iterator
+ * type. It contains a pointer back to the sequence it references
+ * along with iterator version information and pointers to form a
+ * doubly-linked list of local iterators referenced by the container.
+ *
+ * This class must not perform any operations that can throw an
+ * exception, or the exception guarantees of derived iterators will
+ * be broken.
+ */
+ class _Safe_local_iterator_base : public _Safe_iterator_base
+ {
+ protected:
+ /** Initializes the iterator and makes it singular. */
+ _Safe_local_iterator_base()
+ { }
+
+ /** Initialize the iterator to reference the sequence pointed to
+ * by @p__seq. @p __constant is true when we are initializing a
+ * constant local iterator, and false if it is a mutable local iterator.
+ * Note that @p __seq may be NULL, in which case the iterator will be
+ * singular. Otherwise, the iterator will reference @p __seq and
+ * be nonsingular.
+ */
+ _Safe_local_iterator_base(const _Safe_sequence_base* __seq, bool __constant)
+ { this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); }
+
+ /** Initializes the iterator to reference the same sequence that
+ @p __x does. @p __constant is true if this is a constant
+ iterator, and false if it is mutable. */
+ _Safe_local_iterator_base(const _Safe_local_iterator_base& __x,
+ bool __constant)
+ { this->_M_attach(__x._M_sequence, __constant); }
+
+ _Safe_local_iterator_base&
+ operator=(const _Safe_local_iterator_base&);
+
+ explicit
+ _Safe_local_iterator_base(const _Safe_local_iterator_base&);
+
+ ~_Safe_local_iterator_base() { this->_M_detach(); }
+
+ _Safe_unordered_sequence_base*
+ _M_get_sequence() const _GLIBCXX_NOEXCEPT;
+
+ public:
+ /** Attaches this iterator to the given sequence, detaching it
+ * from whatever sequence it was attached to originally. If the
+ * new sequence is the NULL pointer, the iterator is left
+ * unattached.
+ */
+ void _M_attach(_Safe_sequence_base* __seq, bool __constant);
+
+ /** Likewise, but not thread-safe. */
+ void _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw ();
+
+ /** Detach the iterator for whatever sequence it is attached to,
+ * if any.
+ */
+ void _M_detach();
+
+ /** Likewise, but not thread-safe. */
+ void _M_detach_single() throw ();
+ };
+
+ /**
+ * @brief Base class that supports tracking of local iterators that
+ * reference an unordered sequence.
+ *
+ * The %_Safe_unordered_sequence_base class provides basic support for
+ * tracking iterators into an unordered sequence. Sequences that track
+ * iterators must derived from %_Safe_sequence_base publicly, so
+ * that safe iterators (which inherit _Safe_iterator_base) can
+ * attach to them. This class contains four linked lists of
+ * iterators, one for constant iterators, one for mutable
+ * iterators, one for constant local iterators, one for mutable local
+ * iterator and a version number that allows very fast
+ * invalidation of all iterators that reference the container.
+ *
+ * This class must ensure that no operation on it may throw an
+ * exception, otherwise @a safe sequences may fail to provide the
+ * exception-safety guarantees required by the C++ standard.
+ */
+ class _Safe_unordered_sequence_base : public _Safe_sequence_base
+ {
+ typedef _Safe_sequence_base _Base;
+ public:
+ /// The list of mutable local iterators that reference this container
+ _Safe_iterator_base* _M_local_iterators;
+
+ /// The list of constant local iterators that reference this container
+ _Safe_iterator_base* _M_const_local_iterators;
+
+ protected:
+ // Initialize with a version number of 1 and no iterators
+ _Safe_unordered_sequence_base()
+ : _M_local_iterators(0), _M_const_local_iterators(0)
+ { }
+
+ /** Notify all iterators that reference this sequence that the
+ sequence is being destroyed. */
+ ~_Safe_unordered_sequence_base()
+ { this->_M_detach_all(); }
+
+ /** Detach all iterators, leaving them singular. */
+ void
+ _M_detach_all();
+
+ /** Swap this sequence with the given sequence. This operation
+ * also swaps ownership of the iterators, so that when the
+ * operation is complete all iterators that originally referenced
+ * one container now reference the other container.
+ */
+ void
+ _M_swap(_Safe_unordered_sequence_base& __x);
+
+ public:
+ /** Attach an iterator to this sequence. */
+ void
+ _M_attach_local(_Safe_iterator_base* __it, bool __constant);
+
+ /** Likewise but not thread safe. */
+ void
+ _M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw ();
+
+ /** Detach an iterator from this sequence */
+ void
+ _M_detach_local(_Safe_iterator_base* __it);
+
+ /** Likewise but not thread safe. */
+ void
+ _M_detach_local_single(_Safe_iterator_base* __it) throw ();
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_unordered_sequence.h b/libstdc++-v3/include/debug/safe_unordered_sequence.h
new file mode 100644
index 00000000000..f32b9113e6f
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_unordered_sequence.h
@@ -0,0 +1,75 @@
+// Safe sequence implementation -*- C++ -*-
+
+// Copyright (C) 2011 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 debug/safe_unordered_sequence.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H
+#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/safe_unordered_base.h>
+
+namespace __gnu_debug
+{
+ /**
+ * @brief Base class for constructing a @a safe unordered sequence type
+ * that tracks iterators that reference it.
+ *
+ * The class template %_Safe_unordered_sequence simplifies the
+ * construction of @a safe unordered sequences that track the iterators
+ * that reference the sequence, so that the iterators are notified of
+ * changes in the sequence that may affect their operation, e.g., if
+ * the container invalidates its iterators or is destructed. This class
+ * template may only be used by deriving from it and passing the name
+ * of the derived class as its template parameter via the curiously
+ * recurring template pattern. The derived class must have @c
+ * iterator and @const_iterator types that are instantiations of
+ * class template _Safe_iterator for this sequence. Iterators will
+ * then be tracked automatically.
+ */
+ template<typename _Sequence>
+ class _Safe_unordered_sequence : public _Safe_unordered_sequence_base
+ {
+ public:
+ /** Invalidates all iterators @c x that reference this sequence,
+ are not singular, and for which @c pred(x) returns @c
+ true. @c pred will be invoked with the normal iterators nested
+ in the safe ones. */
+ template<typename _Predicate>
+ void
+ _M_invalidate_if(_Predicate __pred);
+
+ template<typename _Predicate>
+ void
+ _M_invalidate_local_if(_Predicate __pred);
+ };
+} // namespace __gnu_debug
+
+#include <debug/safe_unordered_sequence.tcc>
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_unordered_sequence.tcc b/libstdc++-v3/include/debug/safe_unordered_sequence.tcc
new file mode 100644
index 00000000000..88907e8839d
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_unordered_sequence.tcc
@@ -0,0 +1,100 @@
+// Safe sequence implementation -*- C++ -*-
+
+// Copyright (C) 2011 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 debug/safe_unordered_sequence.tcc
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC
+#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC 1
+
+namespace __gnu_debug
+{
+ template<typename _Sequence>
+ template<typename _Predicate>
+ void
+ _Safe_unordered_sequence<_Sequence>::
+ _M_invalidate_if(_Predicate __pred)
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = _M_iterators; __iter;)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+ }
+
+
+ template<typename _Sequence>
+ template<typename _Predicate>
+ void
+ _Safe_unordered_sequence<_Sequence>::
+ _M_invalidate_local_if(_Predicate __pred)
+ {
+ typedef typename _Sequence::local_iterator local_iterator;
+ typedef typename _Sequence::const_local_iterator const_local_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = _M_local_iterators; __iter;)
+ {
+ local_iterator* __victim = static_cast<local_iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_const_local_iterators; __iter2;)
+ {
+ const_local_iterator* __victim =
+ static_cast<const_local_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+ }
+
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index 4f087b75992..93ce517b1f7 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -35,8 +35,9 @@
#else
# include <unordered_map>
-#include <debug/safe_sequence.h>
+#include <debug/safe_unordered_sequence.h>
#include <debug/safe_iterator.h>
+#include <debug/safe_local_iterator.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -49,15 +50,16 @@ namespace __debug
typename _Alloc = std::allocator<_Key> >
class unordered_map
: public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
- public __gnu_debug::_Safe_sequence<unordered_map<_Key, _Tp, _Hash,
- _Pred, _Alloc> >
+ public __gnu_debug::_Safe_unordered_sequence<unordered_map<_Key, _Tp,
+ _Hash, _Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_sequence<unordered_map> _Safe_base;
+ typedef __gnu_debug::_Safe_unordered_sequence<unordered_map> _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
- typedef __gnu_debug::_Equal_to<_Base_const_iterator> _Equal;
+ typedef typename _Base::const_local_iterator _Base_const_local_iterator;
+ typedef typename _Base::local_iterator _Base_local_iterator;
public:
typedef typename _Base::size_type size_type;
@@ -72,6 +74,10 @@ namespace __debug
unordered_map> iterator;
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
unordered_map> const_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<_Base_local_iterator,
+ unordered_map> local_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<_Base_const_local_iterator,
+ unordered_map> const_local_iterator;
explicit
unordered_map(size_type __n = 10,
@@ -81,7 +87,7 @@ namespace __debug
: _Base(__n, __hf, __eql, __a) { }
template<typename _InputIterator>
- unordered_map(_InputIterator __first, _InputIterator __last,
+ unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
@@ -176,15 +182,36 @@ namespace __debug
{ return const_iterator(_Base::end(), this); }
// local versions
- using _Base::begin;
- using _Base::end;
- using _Base::cbegin;
- using _Base::cend;
+ local_iterator
+ begin(size_type __b)
+ { return local_iterator(_Base::begin(__b), __b, this); }
+
+ local_iterator
+ end(size_type __b)
+ { return local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ begin(size_type __b) const
+ { return const_local_iterator(_Base::begin(__b), __b, this); }
+
+ const_local_iterator
+ end(size_type __b) const
+ { return const_local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ cbegin(size_type __b) const
+ { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+
+ const_local_iterator
+ cend(size_type __b) const
+ { return const_local_iterator(_Base::cend(__b), __b, this); }
std::pair<iterator, bool>
insert(const value_type& __obj)
{
+ size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res = _Base::insert(__obj);
+ _M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
@@ -192,43 +219,56 @@ namespace __debug
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), __obj), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__hint.base(), __obj);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
template<typename _Pair, typename = typename
std::enable_if<std::is_convertible<_Pair,
value_type>::value>::type>
- std::pair<iterator, bool>
- insert(_Pair&& __obj)
- {
+ std::pair<iterator, bool>
+ insert(_Pair&& __obj)
+ {
+ size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res =
_Base::insert(std::forward<_Pair>(__obj));
+ _M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template<typename _Pair, typename = typename
std::enable_if<std::is_convertible<_Pair,
value_type>::value>::type>
- iterator
- insert(const_iterator __hint, _Pair&& __obj)
- {
+ iterator
+ insert(const_iterator __hint, _Pair&& __obj)
+ {
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(),
- std::forward<_Pair>(__obj)),
- this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it =
+ _Base::insert(__hint.base(), std::forward<_Pair>(__obj));
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
void
insert(std::initializer_list<value_type> __l)
- { _Base::insert(__l); }
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base::insert(__l);
+ _M_check_rehashed(__bucket_count);
+ }
template<typename _InputIterator>
- void
- insert(_InputIterator __first, _InputIterator __last)
- {
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
__glibcxx_check_valid_range(__first, __last);
+ size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
+ _M_check_rehashed(__bucket_count);
}
iterator
@@ -264,8 +304,15 @@ namespace __debug
_Base_iterator __victim(_Base::find(__key));
if (__victim != _Base::end())
{
- this->_M_invalidate_if(_Equal(__victim));
+ this->_M_invalidate_if([__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
+ size_type __bucket_count = this->bucket_count();
_Base::erase(__victim);
+ _M_check_rehashed(__bucket_count);
__ret = 1;
}
return __ret;
@@ -275,8 +322,17 @@ namespace __debug
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
- this->_M_invalidate_if(_Equal(__it.base()));
- return iterator(_Base::erase(__it.base()), this);
+ _Base_const_iterator __victim = __it.base();
+ this->_M_invalidate_if([__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_const_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __next = _Base::erase(__it.base());
+ _M_check_rehashed(__bucket_count);
+ return iterator(__next, this);
}
iterator
@@ -290,10 +346,17 @@ namespace __debug
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
- this->_M_invalidate_if(_Equal(__tmp));
+ this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
+ { return __it == __tmp; });
+ _Base_const_local_iterator __local_tmp = _S_to_local(__tmp);
+ this->_M_invalidate_local_if(
+ [__local_tmp](_Base_const_local_iterator __it)
+ { return __it == __local_tmp; });
}
- return iterator(_Base::erase(__first.base(),
- __last.base()), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __next = _Base::erase(__first.base(), __last.base());
+ _M_check_rehashed(__bucket_count);
+ return iterator(__next, this);
}
_Base&
@@ -304,11 +367,37 @@ namespace __debug
private:
void
+ _M_invalidate_locals()
+ {
+ _Base_local_iterator __local_end = _Base::end(0);
+ this->_M_invalidate_local_if(
+ [__local_end](_Base_const_local_iterator __it)
+ { return __it != __local_end; });
+ }
+
+ void
_M_invalidate_all()
{
- typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
- this->_M_invalidate_if(_Not_equal(_Base::end()));
+ _Base_iterator __end = _Base::end();
+ this->_M_invalidate_if([__end](_Base_const_iterator __it)
+ { return __it != __end; });
+ _M_invalidate_locals();
}
+
+ void
+ _M_check_rehashed(size_type __prev_count)
+ {
+ if (__prev_count != this->bucket_count())
+ _M_invalidate_locals();
+ }
+
+ static _Base_local_iterator
+ _S_to_local(_Base_iterator __it)
+ { return _Base_local_iterator(__it._M_cur_node); }
+
+ static _Base_const_local_iterator
+ _S_to_local(_Base_const_iterator __it)
+ { return _Base_const_local_iterator(__it._M_cur_node); }
};
template<typename _Key, typename _Tp, typename _Hash,
@@ -341,15 +430,17 @@ namespace __debug
class unordered_multimap
: public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc>,
- public __gnu_debug::_Safe_sequence<unordered_multimap<_Key, _Tp, _Hash,
- _Pred, _Alloc> >
+ public __gnu_debug::_Safe_unordered_sequence<unordered_multimap<_Key,
+ _Tp, _Hash, _Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_sequence<unordered_multimap> _Safe_base;
+ typedef __gnu_debug::_Safe_unordered_sequence<unordered_multimap>
+ _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
- typedef __gnu_debug::_Equal_to<_Base_const_iterator> _Equal;
+ typedef typename _Base::const_local_iterator _Base_const_local_iterator;
+ typedef typename _Base::local_iterator _Base_local_iterator;
public:
typedef typename _Base::size_type size_type;
@@ -364,6 +455,10 @@ namespace __debug
unordered_multimap> iterator;
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
unordered_multimap> const_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<
+ _Base_local_iterator, unordered_multimap> local_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<
+ _Base_const_local_iterator, unordered_multimap> const_local_iterator;
explicit
unordered_multimap(size_type __n = 10,
@@ -373,7 +468,7 @@ namespace __debug
: _Base(__n, __hf, __eql, __a) { }
template<typename _InputIterator>
- unordered_multimap(_InputIterator __first, _InputIterator __last,
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
@@ -468,28 +563,60 @@ namespace __debug
{ return const_iterator(_Base::end(), this); }
// local versions
- using _Base::begin;
- using _Base::end;
- using _Base::cbegin;
- using _Base::cend;
+ local_iterator
+ begin(size_type __b)
+ { return local_iterator(_Base::begin(__b), __b, this); }
+
+ local_iterator
+ end(size_type __b)
+ { return local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ begin(size_type __b) const
+ { return const_local_iterator(_Base::begin(__b), __b, this); }
+
+ const_local_iterator
+ end(size_type __b) const
+ { return const_local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ cbegin(size_type __b) const
+ { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+
+ const_local_iterator
+ cend(size_type __b) const
+ { return const_local_iterator(_Base::cend(__b), __b, this); }
iterator
insert(const value_type& __obj)
- { return iterator(_Base::insert(__obj), this); }
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__obj);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), __obj), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__hint.base(), __obj);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
template<typename _Pair, typename = typename
std::enable_if<std::is_convertible<_Pair,
value_type>::value>::type>
- iterator
- insert(_Pair&& __obj)
- { return iterator(_Base::insert(std::forward<_Pair>(__obj)), this); }
+ iterator
+ insert(_Pair&& __obj)
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(std::forward<_Pair>(__obj));
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
template<typename _Pair, typename = typename
std::enable_if<std::is_convertible<_Pair,
@@ -498,9 +625,11 @@ namespace __debug
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(),
- std::forward<_Pair>(__obj)),
- this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it =
+ _Base::insert(__hint.base(), std::forward<_Pair>(__obj));
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
void
@@ -508,12 +637,14 @@ namespace __debug
{ _Base::insert(__l); }
template<typename _InputIterator>
- void
- insert(_InputIterator __first, _InputIterator __last)
- {
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
__glibcxx_check_valid_range(__first, __last);
+ size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
+ _M_check_rehashed(__bucket_count);
}
iterator
@@ -546,14 +677,21 @@ namespace __debug
erase(const key_type& __key)
{
size_type __ret(0);
+ size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, _Base_iterator> __pair =
_Base::equal_range(__key);
for (_Base_iterator __victim = __pair.first; __victim != __pair.second;)
{
- this->_M_invalidate_if(_Equal(__victim));
+ this->_M_invalidate_if([__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
_Base::erase(__victim++);
++__ret;
}
+ _M_check_rehashed(__bucket_count);
return __ret;
}
@@ -561,8 +699,17 @@ namespace __debug
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
- this->_M_invalidate_if(_Equal(__it.base()));
- return iterator(_Base::erase(__it.base()), this);
+ _Base_const_iterator __victim = __it.base();
+ this->_M_invalidate_if([__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_const_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __next = _Base::erase(__it.base());
+ _M_check_rehashed(__bucket_count);
+ return iterator(__next, this);
}
iterator
@@ -576,10 +723,17 @@ namespace __debug
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
- this->_M_invalidate_if(_Equal(__tmp));
+ this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
+ { return __it == __tmp; });
+ _Base_const_local_iterator __local_tmp = _S_to_local(__tmp);
+ this->_M_invalidate_local_if(
+ [__local_tmp](_Base_const_local_iterator __it)
+ { return __it == __local_tmp; });
}
- return iterator(_Base::erase(__first.base(),
- __last.base()), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __next = _Base::erase(__first.base(), __last.base());
+ _M_check_rehashed(__bucket_count);
+ return iterator(__next, this);
}
_Base&
@@ -590,11 +744,37 @@ namespace __debug
private:
void
+ _M_invalidate_locals()
+ {
+ _Base_local_iterator __local_end = _Base::end(0);
+ this->_M_invalidate_local_if(
+ [__local_end](_Base_const_local_iterator __it)
+ { return __it != __local_end; });
+ }
+
+ void
_M_invalidate_all()
{
- typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
- this->_M_invalidate_if(_Not_equal(_Base::end()));
+ _Base_iterator __end = _Base::end();
+ this->_M_invalidate_if([__end](_Base_const_iterator __it)
+ { return __it != __end; });
+ _M_invalidate_locals();
}
+
+ void
+ _M_check_rehashed(size_type __prev_count)
+ {
+ if (__prev_count != this->bucket_count())
+ _M_invalidate_locals();
+ }
+
+ static _Base_local_iterator
+ _S_to_local(_Base_iterator __it)
+ { return _Base_local_iterator(__it._M_cur_node); }
+
+ static _Base_const_local_iterator
+ _S_to_local(_Base_const_iterator __it)
+ { return _Base_const_local_iterator(__it._M_cur_node); }
};
template<typename _Key, typename _Tp, typename _Hash,
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index c0b245d95a0..981db4a83e6 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -35,8 +35,9 @@
#else
# include <unordered_set>
-#include <debug/safe_sequence.h>
+#include <debug/safe_unordered_sequence.h>
#include <debug/safe_iterator.h>
+#include <debug/safe_local_iterator.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -49,15 +50,16 @@ namespace __debug
typename _Alloc = std::allocator<_Value> >
class unordered_set
: public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>,
- public __gnu_debug::_Safe_sequence<unordered_set<_Value, _Hash,
+ public __gnu_debug::_Safe_unordered_sequence<unordered_set<_Value, _Hash,
_Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_set<_Value, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_sequence<unordered_set> _Safe_base;
+ typedef __gnu_debug::_Safe_unordered_sequence<unordered_set> _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
- typedef __gnu_debug::_Equal_to<_Base_const_iterator> _Equal;
+ typedef typename _Base::const_local_iterator _Base_const_local_iterator;
+ typedef typename _Base::local_iterator _Base_local_iterator;
public:
typedef typename _Base::size_type size_type;
@@ -72,6 +74,10 @@ namespace __debug
unordered_set> iterator;
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
unordered_set> const_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<_Base_local_iterator,
+ unordered_set> local_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<_Base_const_local_iterator,
+ unordered_set> const_local_iterator;
explicit
unordered_set(size_type __n = 10,
@@ -176,16 +182,37 @@ namespace __debug
{ return const_iterator(_Base::end(), this); }
// local versions
- using _Base::begin;
- using _Base::end;
- using _Base::cbegin;
- using _Base::cend;
+ local_iterator
+ begin(size_type __b)
+ { return local_iterator(_Base::begin(__b), __b, this); }
+
+ local_iterator
+ end(size_type __b)
+ { return local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ begin(size_type __b) const
+ { return const_local_iterator(_Base::begin(__b), __b, this); }
+
+ const_local_iterator
+ end(size_type __b) const
+ { return const_local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ cbegin(size_type __b) const
+ { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+
+ const_local_iterator
+ cend(size_type __b) const
+ { return const_local_iterator(_Base::cend(__b), __b, this); }
std::pair<iterator, bool>
insert(const value_type& __obj)
{
+ size_type __bucket_count = this->bucket_count();
typedef std::pair<_Base_iterator, bool> __pair_type;
- __pair_type __res = _Base::insert(__obj);
+ __pair_type __res = _Base::insert(__obj);
+ _M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
@@ -193,14 +220,19 @@ namespace __debug
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), __obj), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__hint.base(), __obj);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
std::pair<iterator, bool>
insert(value_type&& __obj)
{
+ size_type __bucket_count = this->bucket_count();
typedef std::pair<typename _Base::iterator, bool> __pair_type;
- __pair_type __res = _Base::insert(std::move(__obj));
+ __pair_type __res = _Base::insert(std::move(__obj));
+ _M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
@@ -208,20 +240,29 @@ namespace __debug
insert(const_iterator __hint, value_type&& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), std::move(__obj)), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__hint.base(), std::move(__obj));
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
void
insert(std::initializer_list<value_type> __l)
- { _Base::insert(__l); }
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base::insert(__l);
+ _M_check_rehashed(__bucket_count);
+ }
template<typename _InputIterator>
- void
- insert(_InputIterator __first, _InputIterator __last)
- {
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
__glibcxx_check_valid_range(__first, __last);
+ size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
+ _M_check_rehashed(__bucket_count);
}
iterator
@@ -257,8 +298,16 @@ namespace __debug
_Base_iterator __victim(_Base::find(__key));
if (__victim != _Base::end())
{
- this->_M_invalidate_if(_Equal(__victim));
+ this->_M_invalidate_if(
+ [__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
+ size_type __bucket_count = this->bucket_count();
_Base::erase(__victim);
+ _M_check_rehashed(__bucket_count);
__ret = 1;
}
return __ret;
@@ -268,8 +317,18 @@ namespace __debug
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
- this->_M_invalidate_if(_Equal(__it.base()));
- return iterator(_Base::erase(__it.base()), this);
+ _Base_const_iterator __victim = __it.base();
+ this->_M_invalidate_if(
+ [__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_const_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __next = _Base::erase(__it.base());
+ _M_check_rehashed(__bucket_count);
+ return iterator(__next, this);
}
iterator
@@ -283,10 +342,19 @@ namespace __debug
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
- this->_M_invalidate_if(_Equal(__tmp));
+ this->_M_invalidate_if(
+ [__tmp](_Base_const_iterator __it)
+ { return __it == __tmp; });
+ _Base_const_local_iterator __local_tmp = _S_to_local(__tmp);
+ this->_M_invalidate_local_if(
+ [__local_tmp](_Base_const_local_iterator __it)
+ { return __it == __local_tmp; });
}
- return iterator(_Base::erase(__first.base(),
- __last.base()), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __next = _Base::erase(__first.base(),
+ __last.base());
+ _M_check_rehashed(__bucket_count);
+ return iterator(__next, this);
}
_Base&
@@ -297,11 +365,38 @@ namespace __debug
private:
void
+ _M_invalidate_locals()
+ {
+ _Base_local_iterator __local_end = _Base::end(0);
+ this->_M_invalidate_local_if(
+ [__local_end](_Base_const_local_iterator __it)
+ { return __it != __local_end; });
+ }
+
+ void
_M_invalidate_all()
{
- typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
- this->_M_invalidate_if(_Not_equal(_Base::end()));
+ _Base_iterator __end = _Base::end();
+ this->_M_invalidate_if(
+ [__end](_Base_const_iterator __it)
+ { return __it != __end; });
+ _M_invalidate_locals();
+ }
+
+ void
+ _M_check_rehashed(size_type __prev_count)
+ {
+ if (__prev_count != this->bucket_count())
+ _M_invalidate_locals();
}
+
+ static _Base_local_iterator
+ _S_to_local(_Base_iterator __it)
+ { return _Base_local_iterator(__it._M_cur_node); }
+
+ static _Base_const_local_iterator
+ _S_to_local(_Base_const_iterator __it)
+ { return _Base_const_local_iterator(__it._M_cur_node); }
};
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
@@ -330,15 +425,17 @@ namespace __debug
typename _Alloc = std::allocator<_Value> >
class unordered_multiset
: public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>,
- public __gnu_debug::_Safe_sequence<unordered_multiset<_Value, _Hash,
- _Pred, _Alloc> >
+ public __gnu_debug::_Safe_unordered_sequence<
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_sequence<unordered_multiset> _Safe_base;
+ typedef __gnu_debug::_Safe_unordered_sequence<unordered_multiset>
+ _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
- typedef __gnu_debug::_Equal_to<_Base_const_iterator> _Equal;
+ typedef typename _Base::const_local_iterator _Base_const_local_iterator;
+ typedef typename _Base::local_iterator _Base_local_iterator;
public:
typedef typename _Base::size_type size_type;
@@ -353,6 +450,10 @@ namespace __debug
unordered_multiset> iterator;
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
unordered_multiset> const_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<
+ _Base_local_iterator, unordered_multiset> local_iterator;
+ typedef __gnu_debug::_Safe_local_iterator<
+ _Base_const_local_iterator, unordered_multiset> const_local_iterator;
explicit
unordered_multiset(size_type __n = 10,
@@ -457,44 +558,85 @@ namespace __debug
{ return const_iterator(_Base::end(), this); }
// local versions
- using _Base::begin;
- using _Base::end;
- using _Base::cbegin;
- using _Base::cend;
+ local_iterator
+ begin(size_type __b)
+ { return local_iterator(_Base::begin(__b), __b, this); }
+
+ local_iterator
+ end(size_type __b)
+ { return local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ begin(size_type __b) const
+ { return const_local_iterator(_Base::begin(__b), __b, this); }
+
+ const_local_iterator
+ end(size_type __b) const
+ { return const_local_iterator(_Base::end(__b), __b, this); }
+
+ const_local_iterator
+ cbegin(size_type __b) const
+ { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+
+ const_local_iterator
+ cend(size_type __b) const
+ { return const_local_iterator(_Base::cend(__b), __b, this); }
iterator
insert(const value_type& __obj)
- { return iterator(_Base::insert(__obj), this); }
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__obj);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), __obj), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__hint.base(), __obj);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
iterator
insert(value_type&& __obj)
- { return iterator(_Base::insert(std::move(__obj)), this); }
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(std::move(__obj));
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
iterator
insert(const_iterator __hint, value_type&& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), std::move(__obj)), this);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::insert(__hint.base(), std::move(__obj));
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
}
void
insert(std::initializer_list<value_type> __l)
- { _Base::insert(__l); }
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base::insert(__l);
+ _M_check_rehashed(__bucket_count);
+ }
template<typename _InputIterator>
- void
- insert(_InputIterator __first, _InputIterator __last)
- {
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
__glibcxx_check_valid_range(__first, __last);
+ size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
+ _M_check_rehashed(__bucket_count);
}
iterator
@@ -531,7 +673,12 @@ namespace __debug
_Base::equal_range(__key);
for (_Base_iterator __victim = __pair.first; __victim != __pair.second;)
{
- this->_M_invalidate_if(_Equal(__victim));
+ this->_M_invalidate_if([__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
_Base::erase(__victim++);
++__ret;
}
@@ -542,7 +689,13 @@ namespace __debug
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
- this->_M_invalidate_if(_Equal(__it.base()));
+ _Base_const_iterator __victim = __it.base();
+ this->_M_invalidate_if([__victim](_Base_const_iterator __it)
+ { return __it == __victim; });
+ _Base_const_local_iterator __local_victim = _S_to_local(__victim);
+ this->_M_invalidate_local_if(
+ [__local_victim](_Base_const_local_iterator __it)
+ { return __it == __local_victim; });
return iterator(_Base::erase(__it.base()), this);
}
@@ -557,7 +710,12 @@ namespace __debug
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
- this->_M_invalidate_if(_Equal(__tmp));
+ this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
+ { return __it == __tmp; });
+ _Base_const_local_iterator __local_tmp = _S_to_local(__tmp);
+ this->_M_invalidate_local_if(
+ [__local_tmp](_Base_const_local_iterator __it)
+ { return __it == __local_tmp; });
}
return iterator(_Base::erase(__first.base(),
__last.base()), this);
@@ -571,11 +729,37 @@ namespace __debug
private:
void
+ _M_invalidate_locals()
+ {
+ _Base_local_iterator __local_end = _Base::end(0);
+ this->_M_invalidate_local_if(
+ [__local_end](_Base_const_local_iterator __it)
+ { return __it != __local_end; });
+ }
+
+ void
_M_invalidate_all()
{
- typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
- this->_M_invalidate_if(_Not_equal(_Base::end()));
+ _Base_iterator __end = _Base::end();
+ this->_M_invalidate_if([__end](_Base_const_iterator __it)
+ { return __it != __end; });
+ _M_invalidate_locals();
+ }
+
+ void
+ _M_check_rehashed(size_type __prev_count)
+ {
+ if (__prev_count != this->bucket_count())
+ _M_invalidate_locals();
}
+
+ static _Base_local_iterator
+ _S_to_local(_Base_iterator __it)
+ { return _Base_local_iterator(__it._M_cur_node); }
+
+ static _Base_const_local_iterator
+ _S_to_local(_Base_const_iterator __it)
+ { return _Base_const_local_iterator(__it._M_cur_node); }
};
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h
index 510a6552f52..b0c93cabe31 100644
--- a/libstdc++-v3/include/precompiled/stdc++.h
+++ b/libstdc++-v3/include/precompiled/stdc++.h
@@ -1,6 +1,6 @@
// C++ includes used for precompiling -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -106,6 +106,7 @@
#include <random>
#include <ratio>
#include <regex>
+#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array
index 474b884ecb5..0abb628aded 100644
--- a/libstdc++-v3/include/std/array
+++ b/libstdc++-v3/include/std/array
@@ -35,6 +35,7 @@
# include <bits/c++0x_warning.h>
#else
+#include <stdexcept>
#include <bits/stl_algobase.h>
#include <bits/range_access.h>
@@ -150,8 +151,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator[](size_type __n)
{ return _M_instance[__n]; }
- const_reference
- operator[](size_type __n) const
+ constexpr const_reference
+ operator[](size_type __n) const noexcept
{ return _M_instance[__n]; }
reference
@@ -162,12 +163,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return _M_instance[__n];
}
- const_reference
+ constexpr const_reference
at(size_type __n) const
{
- if (__n >= _Nm)
- std::__throw_out_of_range(__N("array::at"));
- return _M_instance[__n];
+ return __n < _Nm ? _M_instance[__n] :
+#ifdef __EXCEPTIONS
+ throw out_of_range(__N("array::at"));
+#else
+ _M_instance[0];
+#endif
}
reference
diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset
index 6d23df2cba8..f880e72bd0d 100644
--- a/libstdc++-v3/include/std/bitset
+++ b/libstdc++-v3/include/std/bitset
@@ -111,7 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_getword(size_t __pos) _GLIBCXX_NOEXCEPT
{ return _M_w[_S_whichword(__pos)]; }
- _WordT
+ _GLIBCXX_CONSTEXPR _WordT
_M_getword(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return _M_w[_S_whichword(__pos)]; }
@@ -221,12 +221,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
// find first "on" bit
size_t
- _M_do_find_first(size_t __not_found) const _GLIBCXX_NOEXCEPT;
+ _M_do_find_first(size_t) const _GLIBCXX_NOEXCEPT;
// find the next "on" bit that follows "prev"
size_t
- _M_do_find_next(size_t __prev, size_t __not_found) const
- _GLIBCXX_NOEXCEPT;
+ _M_do_find_next(size_t, size_t) const _GLIBCXX_NOEXCEPT;
};
// Definitions of non-inline functions from _Base_bitset.
@@ -405,7 +404,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_getword(size_t) _GLIBCXX_NOEXCEPT
{ return _M_w; }
- _WordT
+ _GLIBCXX_CONSTEXPR _WordT
_M_getword(size_t) const _GLIBCXX_NOEXCEPT
{ return _M_w; }
@@ -557,7 +556,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return *new _WordT;
}
- _WordT
+ _GLIBCXX_CONSTEXPR _WordT
_M_getword(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return 0; }
@@ -1017,7 +1016,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return *this;
}
- bool
+ _GLIBCXX_CONSTEXPR bool
_Unchecked_test(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return ((this->_M_getword(__pos) & _Base::_S_maskbit(__pos))
!= static_cast<_WordT>(0)); }
@@ -1122,7 +1121,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
operator[](size_t __position)
{ return reference(*this, __position); }
- bool
+ _GLIBCXX_CONSTEXPR bool
operator[](size_t __position) const
{ return _Unchecked_test(__position); }
//@}
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index ed8fc303306..f64fd6e1e7b 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -585,7 +585,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
template<typename _Clock, typename _Dur1,
typename _Rep2, typename _Period2>
- inline time_point<_Clock,
+ inline constexpr time_point<_Clock,
typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
operator+(const time_point<_Clock, _Dur1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
@@ -593,27 +593,37 @@ _GLIBCXX_END_NAMESPACE_VERSION
typedef duration<_Rep2, _Period2> __dur2;
typedef typename common_type<_Dur1,__dur2>::type __ct;
typedef time_point<_Clock, __ct> __time_point;
- return __time_point(__lhs) += __rhs;
+ return __time_point(__lhs.time_since_epoch() + __rhs);
}
template<typename _Rep1, typename _Period1,
typename _Clock, typename _Dur2>
- inline time_point<_Clock,
+ inline constexpr time_point<_Clock,
typename common_type<duration<_Rep1, _Period1>, _Dur2>::type>
operator+(const duration<_Rep1, _Period1>& __lhs,
const time_point<_Clock, _Dur2>& __rhs)
- { return __rhs + __lhs; }
+ {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef typename common_type<__dur1,_Dur2>::type __ct;
+ typedef time_point<_Clock, __ct> __time_point;
+ return __time_point(__rhs.time_since_epoch() + __lhs);
+ }
template<typename _Clock, typename _Dur1,
typename _Rep2, typename _Period2>
- inline time_point<_Clock,
+ inline constexpr time_point<_Clock,
typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
operator-(const time_point<_Clock, _Dur1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
- { return __lhs + (-__rhs); }
+ {
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<_Dur1,__dur2>::type __ct;
+ typedef time_point<_Clock, __ct> __time_point;
+ return __time_point(__lhs.time_since_epoch() -__rhs);
+ }
template<typename _Clock, typename _Dur1, typename _Dur2>
- inline typename common_type<_Dur1, _Dur2>::type
+ inline constexpr typename common_type<_Dur1, _Dur2>::type
operator-(const time_point<_Clock, _Dur1>& __lhs,
const time_point<_Clock, _Dur2>& __rhs)
{ return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
@@ -673,7 +683,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
< system_clock::duration::zero(),
"a clock's minimum duration cannot be less than its epoch");
- static constexpr bool is_monotonic = false;
+ static constexpr bool is_steady = false;
static time_point
now() throw ();
@@ -696,21 +706,21 @@ _GLIBCXX_END_NAMESPACE_VERSION
};
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
- /// monotonic_clock
- struct monotonic_clock
+ /// steady_clock
+ struct steady_clock
{
typedef chrono::nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<monotonic_clock, duration> time_point;
+ typedef chrono::time_point<steady_clock, duration> time_point;
- static constexpr bool is_monotonic = true;
+ static constexpr bool is_steady = true;
static time_point
now();
};
#else
- typedef system_clock monotonic_clock;
+ typedef system_clock steady_clock;
#endif
typedef system_clock high_resolution_clock;
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index 1c66afc9e2c..184011715c7 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -212,7 +212,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef __gthread_mutex_t __native_type;
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
- typedef chrono::monotonic_clock __clock_t;
+ typedef chrono::steady_clock __clock_t;
#else
typedef chrono::high_resolution_clock __clock_t;
#endif
@@ -317,7 +317,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef __gthread_recursive_mutex_t __native_type;
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
- typedef chrono::monotonic_clock __clock_t;
+ typedef chrono::steady_clock __clock_t;
#else
typedef chrono::high_resolution_clock __clock_t;
#endif
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error
index da09a758825..565261e709b 100644
--- a/libstdc++-v3/include/std/system_error
+++ b/libstdc++-v3/include/std/system_error
@@ -66,47 +66,47 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
class error_category
{
protected:
- error_category();
+ error_category() noexcept;
public:
- virtual ~error_category();
+ virtual ~error_category() noexcept;
error_category(const error_category&) = delete;
error_category& operator=(const error_category&) = delete;
virtual const char*
- name() const = 0;
+ name() const noexcept = 0;
virtual string
message(int) const = 0;
virtual error_condition
- default_error_condition(int __i) const;
+ default_error_condition(int __i) const noexcept;
virtual bool
- equivalent(int __i, const error_condition& __cond) const;
+ equivalent(int __i, const error_condition& __cond) const noexcept;
virtual bool
- equivalent(const error_code& __code, int __i) const;
+ equivalent(const error_code& __code, int __i) const noexcept;
bool
- operator<(const error_category& __other) const
+ operator<(const error_category& __other) const noexcept
{ return less<const error_category*>()(this, &__other); }
bool
- operator==(const error_category& __other) const
+ operator==(const error_category& __other) const noexcept
{ return this == &__other; }
bool
- operator!=(const error_category& __other) const
+ operator!=(const error_category& __other) const noexcept
{ return this != &__other; }
};
// DR 890.
- _GLIBCXX_CONST const error_category& system_category() throw();
- _GLIBCXX_CONST const error_category& generic_category() throw();
+ _GLIBCXX_CONST const error_category& system_category() noexcept;
+ _GLIBCXX_CONST const error_category& generic_category() noexcept;
- error_code make_error_code(errc);
+ error_code make_error_code(errc) noexcept;
template<typename _Tp>
struct hash;
@@ -115,49 +115,49 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Implementation-specific error identification
struct error_code
{
- error_code()
+ error_code() noexcept
: _M_value(0), _M_cat(&system_category()) { }
- error_code(int __v, const error_category& __cat)
+ error_code(int __v, const error_category& __cat) noexcept
: _M_value(__v), _M_cat(&__cat) { }
- template<typename _ErrorCodeEnum>
- error_code(_ErrorCodeEnum __e,
- typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type* = 0)
+ template<typename _ErrorCodeEnum, typename = typename
+ enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type>
+ error_code(_ErrorCodeEnum __e) noexcept
{ *this = make_error_code(__e); }
void
- assign(int __v, const error_category& __cat)
+ assign(int __v, const error_category& __cat) noexcept
{
_M_value = __v;
_M_cat = &__cat;
}
void
- clear()
+ clear() noexcept
{ assign(0, system_category()); }
// DR 804.
template<typename _ErrorCodeEnum>
typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
error_code&>::type
- operator=(_ErrorCodeEnum __e)
+ operator=(_ErrorCodeEnum __e) noexcept
{ return *this = make_error_code(__e); }
int
- value() const { return _M_value; }
+ value() const noexcept { return _M_value; }
const error_category&
- category() const { return *_M_cat; }
+ category() const noexcept { return *_M_cat; }
error_condition
- default_error_condition() const;
+ default_error_condition() const noexcept;
string
message() const
{ return category().message(value()); }
- explicit operator bool() const
+ explicit operator bool() const noexcept
{ return _M_value != 0 ? true : false; }
// DR 804.
@@ -170,11 +170,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 19.4.2.6 non-member functions
inline error_code
- make_error_code(errc __e)
+ make_error_code(errc __e) noexcept
{ return error_code(static_cast<int>(__e), generic_category()); }
inline bool
- operator<(const error_code& __lhs, const error_code& __rhs)
+ operator<(const error_code& __lhs, const error_code& __rhs) noexcept
{
return (__lhs.category() < __rhs.category()
|| (__lhs.category() == __rhs.category()
@@ -186,26 +186,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
{ return (__os << __e.category().name() << ':' << __e.value()); }
- error_condition make_error_condition(errc);
+ error_condition make_error_condition(errc) noexcept;
/// error_condition
// Portable error identification
struct error_condition
{
- error_condition()
+ error_condition() noexcept
: _M_value(0), _M_cat(&generic_category()) { }
- error_condition(int __v, const error_category& __cat)
+ error_condition(int __v, const error_category& __cat) noexcept
: _M_value(__v), _M_cat(&__cat) { }
- template<typename _ErrorConditionEnum>
- error_condition(_ErrorConditionEnum __e,
- typename enable_if<is_error_condition_enum
- <_ErrorConditionEnum>::value>::type* = 0)
+ template<typename _ErrorConditionEnum, typename = typename
+ enable_if<is_error_condition_enum<_ErrorConditionEnum>::value>::type>
+ error_condition(_ErrorConditionEnum __e) noexcept
{ *this = make_error_condition(__e); }
void
- assign(int __v, const error_category& __cat)
+ assign(int __v, const error_category& __cat) noexcept
{
_M_value = __v;
_M_cat = &__cat;
@@ -215,25 +214,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _ErrorConditionEnum>
typename enable_if<is_error_condition_enum
<_ErrorConditionEnum>::value, error_condition&>::type
- operator=(_ErrorConditionEnum __e)
+ operator=(_ErrorConditionEnum __e) noexcept
{ return *this = make_error_condition(__e); }
void
- clear()
+ clear() noexcept
{ assign(0, generic_category()); }
// 19.4.3.4 observers
- int
- value() const { return _M_value; }
+ int
+ value() const noexcept { return _M_value; }
const error_category&
- category() const { return *_M_cat; }
+ category() const noexcept { return *_M_cat; }
string
message() const
{ return category().message(value()); }
- explicit operator bool() const
+ explicit operator bool() const noexcept
{ return _M_value != 0 ? true : false; }
// DR 804.
@@ -244,11 +243,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 19.4.3.6 non-member functions
inline error_condition
- make_error_condition(errc __e)
+ make_error_condition(errc __e) noexcept
{ return error_condition(static_cast<int>(__e), generic_category()); }
inline bool
- operator<(const error_condition& __lhs, const error_condition& __rhs)
+ operator<(const error_condition& __lhs,
+ const error_condition& __rhs) noexcept
{
return (__lhs.category() < __rhs.category()
|| (__lhs.category() == __rhs.category()
@@ -257,45 +257,47 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 19.4.4 Comparison operators
inline bool
- operator==(const error_code& __lhs, const error_code& __rhs)
+ operator==(const error_code& __lhs, const error_code& __rhs) noexcept
{ return (__lhs.category() == __rhs.category()
&& __lhs.value() == __rhs.value()); }
inline bool
- operator==(const error_code& __lhs, const error_condition& __rhs)
+ operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
{
return (__lhs.category().equivalent(__lhs.value(), __rhs)
|| __rhs.category().equivalent(__lhs, __rhs.value()));
}
inline bool
- operator==(const error_condition& __lhs, const error_code& __rhs)
+ operator==(const error_condition& __lhs, const error_code& __rhs) noexcept
{
return (__rhs.category().equivalent(__rhs.value(), __lhs)
|| __lhs.category().equivalent(__rhs, __lhs.value()));
}
inline bool
- operator==(const error_condition& __lhs, const error_condition& __rhs)
+ operator==(const error_condition& __lhs,
+ const error_condition& __rhs) noexcept
{
return (__lhs.category() == __rhs.category()
&& __lhs.value() == __rhs.value());
}
inline bool
- operator!=(const error_code& __lhs, const error_code& __rhs)
+ operator!=(const error_code& __lhs, const error_code& __rhs) noexcept
{ return !(__lhs == __rhs); }
inline bool
- operator!=(const error_code& __lhs, const error_condition& __rhs)
+ operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept
{ return !(__lhs == __rhs); }
inline bool
- operator!=(const error_condition& __lhs, const error_code& __rhs)
+ operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept
{ return !(__lhs == __rhs); }
inline bool
- operator!=(const error_condition& __lhs, const error_condition& __rhs)
+ operator!=(const error_condition& __lhs,
+ const error_condition& __rhs) noexcept
{ return !(__lhs == __rhs); }
@@ -338,7 +340,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
virtual ~system_error() throw();
const error_code&
- code() const throw() { return _M_code; }
+ code() const noexcept { return _M_code; }
};
_GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/src/chrono.cc b/libstdc++-v3/src/chrono.cc
index 6b5e669a7dc..07c932a1ad8 100644
--- a/libstdc++-v3/src/chrono.cc
+++ b/libstdc++-v3/src/chrono.cc
@@ -39,7 +39,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
- constexpr bool system_clock::is_monotonic;
+ constexpr bool system_clock::is_steady;
system_clock::time_point
system_clock::now() throw ()
@@ -63,10 +63,10 @@ namespace std _GLIBCXX_VISIBILITY(default)
}
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
- constexpr bool monotonic_clock::is_monotonic;
+ constexpr bool steady_clock::is_steady;
- monotonic_clock::time_point
- monotonic_clock::now()
+ steady_clock::time_point
+ steady_clock::now()
{
timespec tp;
// -EINVAL, -EFAULT
diff --git a/libstdc++-v3/src/compatibility-c++0x.cc b/libstdc++-v3/src/compatibility-c++0x.cc
index 08a572761f9..c5e1db092a5 100644
--- a/libstdc++-v3/src/compatibility-c++0x.cc
+++ b/libstdc++-v3/src/compatibility-c++0x.cc
@@ -1,6 +1,6 @@
// Compatibility symbols for previous versions, C++0x bits -*- C++ -*-
-// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 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
@@ -81,4 +81,17 @@ namespace std _GLIBCXX_VISIBILITY(default)
const size_t __tmp = std::_Hash_impl::hash(__e._M_value);
return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp);
}
+
+
+ // gcc-4.7.0
+ // <chrono> changes is_monotonic to is_steady.
+ namespace chrono
+ {
+ struct system_clock
+ {
+ static constexpr bool is_monotonic = false;
+ };
+ constexpr bool system_clock::is_monotonic;
+ } // namespace chrono
}
+
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
index 9074dfb0738..1144c697e0d 100644
--- a/libstdc++-v3/src/debug.cc
+++ b/libstdc++-v3/src/debug.cc
@@ -1,7 +1,7 @@
// Debugging mode support code -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-// Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+// 2011 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
@@ -25,7 +25,9 @@
#include <debug/debug.h>
#include <debug/safe_sequence.h>
+#include <debug/safe_unordered_sequence.h>
#include <debug/safe_iterator.h>
+#include <debug/safe_local_iterator.h>
#include <algorithm>
#include <cassert>
#include <cstring>
@@ -51,28 +53,58 @@ namespace
}
void
- swap_seq(__gnu_debug::_Safe_sequence_base& __lhs,
- __gnu_debug::_Safe_sequence_base& __rhs)
+ swap_its(__gnu_debug::_Safe_sequence_base& __lhs,
+ __gnu_debug::_Safe_iterator_base*& __lhs_its,
+ __gnu_debug::_Safe_sequence_base& __rhs,
+ __gnu_debug::_Safe_iterator_base*& __rhs_its)
{
- swap(__lhs._M_iterators, __rhs._M_iterators);
- swap(__lhs._M_const_iterators, __rhs._M_const_iterators);
- swap(__lhs._M_version, __rhs._M_version);
+ swap(__lhs_its, __rhs_its);
__gnu_debug::_Safe_iterator_base* __iter;
- for (__iter = __rhs._M_iterators; __iter; __iter = __iter->_M_next)
- __iter->_M_sequence = &__rhs;
- for (__iter = __lhs._M_iterators; __iter; __iter = __iter->_M_next)
- __iter->_M_sequence = &__lhs;
- for (__iter = __rhs._M_const_iterators; __iter; __iter = __iter->_M_next)
+ for (__iter = __rhs_its; __iter; __iter = __iter->_M_next)
__iter->_M_sequence = &__rhs;
- for (__iter = __lhs._M_const_iterators; __iter; __iter = __iter->_M_next)
+ for (__iter = __lhs_its; __iter; __iter = __iter->_M_next)
__iter->_M_sequence = &__lhs;
}
+
+ void
+ swap_seq(__gnu_debug::_Safe_sequence_base& __lhs,
+ __gnu_debug::_Safe_sequence_base& __rhs)
+ {
+ swap(__lhs._M_version, __rhs._M_version);
+ swap_its(__lhs, __lhs._M_iterators,
+ __rhs, __rhs._M_iterators);
+ swap_its(__lhs, __lhs._M_const_iterators,
+ __rhs, __rhs._M_const_iterators);
+ }
+
+ void
+ swap_useq(__gnu_debug::_Safe_unordered_sequence_base& __lhs,
+ __gnu_debug::_Safe_unordered_sequence_base& __rhs)
+ {
+ swap_seq(__lhs, __rhs);
+ swap_its(__lhs, __lhs._M_local_iterators,
+ __rhs, __rhs._M_local_iterators);
+ swap_its(__lhs, __lhs._M_const_local_iterators,
+ __rhs, __rhs._M_const_local_iterators);
+ }
+
+ void
+ detach_all(__gnu_debug::_Safe_iterator_base* __iter)
+ {
+ for (; __iter;)
+ {
+ __gnu_debug::_Safe_iterator_base* __old = __iter;
+ __iter = __iter->_M_next;
+ __old->_M_reset();
+ }
+ }
} // anonymous namespace
namespace __gnu_debug
{
const char* _S_debug_messages[] =
{
+ // General Checks
"function requires a valid iterator range [%1.name;, %2.name;)",
"attempt to insert into container with a singular iterator",
"attempt to insert into container with an iterator"
@@ -93,15 +125,18 @@ namespace __gnu_debug
"elements in iterator range [%1.name;, %2.name;) do not form a heap",
"elements in iterator range [%1.name;, %2.name;)"
" do not form a heap with respect to the predicate %3;",
+ // std::bitset checks
"attempt to write through a singular bitset reference",
"attempt to read from a singular bitset reference",
"attempt to flip a singular bitset reference",
+ // std::list checks
"attempt to splice a list into itself",
"attempt to splice lists with inequal allocators",
"attempt to splice elements referenced by a %1.state; iterator",
"attempt to splice an iterator from a different container",
"splice destination %1.name;"
" occurs within source range [%2.name;, %3.name;)",
+ // iterator checks
"attempt to initialize an iterator that will immediately become singular",
"attempt to copy-construct an iterator from a singular iterator",
"attempt to construct a constant iterator"
@@ -124,17 +159,24 @@ namespace __gnu_debug
" iterator to a %2.state; iterator",
"attempt to compute the different between two iterators"
" from different sequences",
+ // istream_iterator
"attempt to dereference an end-of-stream istream_iterator",
"attempt to increment an end-of-stream istream_iterator",
+ // ostream_iterator
"attempt to output via an ostream_iterator with no associated stream",
+ // istreambuf_iterator
"attempt to dereference an end-of-stream istreambuf_iterator"
" (this is a GNU extension)",
"attempt to increment an end-of-stream istreambuf_iterator",
+ // std::forward_list
"attempt to insert into container after an end iterator",
"attempt to erase from container after a %2.state; iterator not followed"
" by a dereferenceable one",
"function requires a valid iterator range (%2.name;, %3.name;)"
- ", \"%2.name;\" shall be before and not equal to \"%3.name;\""
+ ", \"%2.name;\" shall be before and not equal to \"%3.name;\"",
+ // std::unordered_sequence::local_iterator
+ "attempt to compare local iterators from different unordered sequence"
+ " buckets"
};
void
@@ -142,20 +184,10 @@ namespace __gnu_debug
_M_detach_all()
{
__gnu_cxx::__scoped_lock sentry(_M_get_mutex());
- for (_Safe_iterator_base* __iter = _M_iterators; __iter;)
- {
- _Safe_iterator_base* __old = __iter;
- __iter = __iter->_M_next;
- __old->_M_reset();
- }
+ detach_all(_M_iterators);
_M_iterators = 0;
- for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;)
- {
- _Safe_iterator_base* __old = __iter2;
- __iter2 = __iter2->_M_next;
- __old->_M_reset();
- }
+ detach_all(_M_const_iterators);
_M_const_iterators = 0;
}
@@ -299,9 +331,7 @@ namespace __gnu_debug
_M_detach()
{
if (_M_sequence)
- {
- _M_sequence->_M_detach(this);
- }
+ _M_sequence->_M_detach(this);
_M_reset();
}
@@ -311,9 +341,7 @@ namespace __gnu_debug
_M_detach_single() throw ()
{
if (_M_sequence)
- {
- _M_sequence->_M_detach_single(this);
- }
+ _M_sequence->_M_detach_single(this);
_M_reset();
}
@@ -346,6 +374,143 @@ namespace __gnu_debug
_M_get_mutex() throw ()
{ return get_safe_base_mutex(_M_sequence); }
+ _Safe_unordered_sequence_base*
+ _Safe_local_iterator_base::
+ _M_get_sequence() const _GLIBCXX_NOEXCEPT
+ { return static_cast<_Safe_unordered_sequence_base*>(_M_sequence); }
+
+ void
+ _Safe_local_iterator_base::
+ _M_attach(_Safe_sequence_base* __seq, bool __constant)
+ {
+ _M_detach();
+
+ // Attach to the new sequence (if there is one)
+ if (__seq)
+ {
+ _M_sequence = __seq;
+ _M_version = _M_sequence->_M_version;
+ _M_get_sequence()->_M_attach_local(this, __constant);
+ }
+ }
+
+ void
+ _Safe_local_iterator_base::
+ _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw ()
+ {
+ _M_detach_single();
+
+ // Attach to the new sequence (if there is one)
+ if (__seq)
+ {
+ _M_sequence = __seq;
+ _M_version = _M_sequence->_M_version;
+ _M_get_sequence()->_M_attach_local_single(this, __constant);
+ }
+ }
+
+ void
+ _Safe_local_iterator_base::
+ _M_detach()
+ {
+ if (_M_sequence)
+ _M_get_sequence()->_M_detach_local(this);
+
+ _M_reset();
+ }
+
+ void
+ _Safe_local_iterator_base::
+ _M_detach_single() throw ()
+ {
+ if (_M_sequence)
+ _M_get_sequence()->_M_detach_local_single(this);
+
+ _M_reset();
+ }
+
+ void
+ _Safe_unordered_sequence_base::
+ _M_detach_all()
+ {
+ __gnu_cxx::__scoped_lock sentry(_M_get_mutex());
+ detach_all(_M_iterators);
+ _M_iterators = 0;
+
+ detach_all(_M_const_iterators);
+ _M_const_iterators = 0;
+
+ detach_all(_M_local_iterators);
+ _M_local_iterators = 0;
+
+ detach_all(_M_const_local_iterators);
+ _M_const_local_iterators = 0;
+ }
+
+ void
+ _Safe_unordered_sequence_base::
+ _M_swap(_Safe_unordered_sequence_base& __x)
+ {
+ // We need to lock both sequences to swap
+ using namespace __gnu_cxx;
+ __mutex *__this_mutex = &_M_get_mutex();
+ __mutex *__x_mutex = &__x._M_get_mutex();
+ if (__this_mutex == __x_mutex)
+ {
+ __scoped_lock __lock(*__this_mutex);
+ swap_useq(*this, __x);
+ }
+ else
+ {
+ __scoped_lock __l1(__this_mutex < __x_mutex
+ ? *__this_mutex : *__x_mutex);
+ __scoped_lock __l2(__this_mutex < __x_mutex
+ ? *__x_mutex : *__this_mutex);
+ swap_useq(*this, __x);
+ }
+ }
+
+ void
+ _Safe_unordered_sequence_base::
+ _M_attach_local(_Safe_iterator_base* __it, bool __constant)
+ {
+ __gnu_cxx::__scoped_lock sentry(_M_get_mutex());
+ _M_attach_local_single(__it, __constant);
+ }
+
+ void
+ _Safe_unordered_sequence_base::
+ _M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw ()
+ {
+ _Safe_iterator_base*& __its =
+ __constant ? _M_const_local_iterators : _M_local_iterators;
+ __it->_M_next = __its;
+ if (__it->_M_next)
+ __it->_M_next->_M_prior = __it;
+ __its = __it;
+ }
+
+ void
+ _Safe_unordered_sequence_base::
+ _M_detach_local(_Safe_iterator_base* __it)
+ {
+ // Remove __it from this sequence's list
+ __gnu_cxx::__scoped_lock sentry(_M_get_mutex());
+ _M_detach_local_single(__it);
+ }
+
+ void
+ _Safe_unordered_sequence_base::
+ _M_detach_local_single(_Safe_iterator_base* __it) throw ()
+ {
+ // Remove __it from this sequence's list
+ __it->_M_unlink();
+ if (_M_const_local_iterators == __it)
+ _M_const_local_iterators = __it->_M_next;
+ if (_M_local_iterators == __it)
+ _M_local_iterators = __it->_M_next;
+ }
+
void
_Error_formatter::_Parameter::
_M_print_field(const _Error_formatter* __formatter, const char* __name) const
diff --git a/libstdc++-v3/src/system_error.cc b/libstdc++-v3/src/system_error.cc
index 5d9c6f5e26b..818619942e4 100644
--- a/libstdc++-v3/src/system_error.cc
+++ b/libstdc++-v3/src/system_error.cc
@@ -37,7 +37,7 @@ namespace
generic_error_category() {}
virtual const char*
- name() const
+ name() const noexcept
{ return "generic"; }
virtual string
@@ -54,7 +54,7 @@ namespace
system_error_category() {}
virtual const char*
- name() const
+ name() const noexcept
{ return "system"; }
virtual string
@@ -74,32 +74,33 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
- error_category::error_category() = default;
+ error_category::error_category() noexcept = default;
- error_category::~error_category() = default;
+ error_category::~error_category() noexcept = default;
const error_category&
- system_category() throw() { return system_category_instance; }
+ system_category() noexcept { return system_category_instance; }
const error_category&
- generic_category() throw() { return generic_category_instance; }
+ generic_category() noexcept { return generic_category_instance; }
- system_error::~system_error() throw() = default;
+ system_error::~system_error() noexcept = default;
error_condition
- error_category::default_error_condition(int __i) const
+ error_category::default_error_condition(int __i) const noexcept
{ return error_condition(__i, *this); }
bool
- error_category::equivalent(int __i, const error_condition& __cond) const
+ error_category::equivalent(int __i,
+ const error_condition& __cond) const noexcept
{ return default_error_condition(__i) == __cond; }
bool
- error_category::equivalent(const error_code& __code, int __i) const
+ error_category::equivalent(const error_code& __code, int __i) const noexcept
{ return *this == __code.category() && __code.value() == __i; }
error_condition
- error_code::default_error_condition() const
+ error_code::default_error_condition() const noexcept
{ return category().default_error_condition(value()); }
_GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc
index 9d5c2e3338e..3edb766defe 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 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
@@ -26,7 +26,7 @@ class my_error_category_impl
: public std::error_category
{
public:
- const char* name() const { return ""; }
+ const char* name() const noexcept { return ""; }
std::string message(int) const { return ""; }
} my_error_category_instance;
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/modifiers/39882.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/modifiers/39882.cc
index 880a93655e9..9755ba1964d 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_code/modifiers/39882.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/modifiers/39882.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 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
@@ -26,7 +26,7 @@ class my_error_category_impl
: public std::error_category
{
public:
- const char* name() const { return ""; }
+ const char* name() const noexcept { return ""; }
std::string message(int) const { return ""; }
} my_error_category_instance;
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/39881.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/39881.cc
index 7931f174063..f41f7469c22 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/39881.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/39881.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 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
@@ -26,7 +26,7 @@ class my_error_category_impl
: public std::error_category
{
public:
- const char* name() const { return ""; }
+ const char* name() const noexcept { return ""; }
std::string message(int) const { return ""; }
} my_error_category_instance;
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/modifiers/39881.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/modifiers/39881.cc
index 0178a91c418..ddd488ea0c1 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_condition/modifiers/39881.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/modifiers/39881.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 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
@@ -26,7 +26,7 @@ class my_error_category_impl
: public std::error_category
{
public:
- const char* name() const { return ""; }
+ const char* name() const noexcept { return ""; }
std::string message(int) const { return ""; }
} my_error_category_instance;
diff --git a/libstdc++-v3/testsuite/20_util/monotonic_clock/constexpr_data.cc b/libstdc++-v3/testsuite/20_util/steady_clock/constexpr_data.cc
index 34477ea1838..2b497cfa35b 100644
--- a/libstdc++-v3/testsuite/20_util/monotonic_clock/constexpr_data.cc
+++ b/libstdc++-v3/testsuite/20_util/steady_clock/constexpr_data.cc
@@ -34,7 +34,7 @@ namespace __gnu_test
void __constraint()
{
constexpr auto v1 __attribute__((unused))
- = _Ttesttype::is_monotonic;
+ = _Ttesttype::is_steady;
}
};
@@ -47,6 +47,6 @@ namespace __gnu_test
int main()
{
__gnu_test::constexpr_member_data test;
- test.operator()<std::chrono::monotonic_clock>();
+ test.operator()<std::chrono::steady_clock>();
return 0;
}
diff --git a/libstdc++-v3/testsuite/20_util/system_clock/1.cc b/libstdc++-v3/testsuite/20_util/system_clock/1.cc
index ead20873c7b..77426e90ce1 100644
--- a/libstdc++-v3/testsuite/20_util/system_clock/1.cc
+++ b/libstdc++-v3/testsuite/20_util/system_clock/1.cc
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -29,8 +29,8 @@ main()
using namespace std::chrono;
system_clock::time_point t1 = system_clock::now();
- bool is_monotonic = system_clock::is_monotonic;
- is_monotonic = is_monotonic; // suppress unused warning
+ bool is_steady = system_clock::is_steady;
+ is_steady = is_steady; // suppress unused warning
std::time_t t2 = system_clock::to_time_t(t1);
system_clock::time_point t3 = system_clock::from_time_t(t2);
t3 = t3; // suppress unused warning
diff --git a/libstdc++-v3/testsuite/20_util/system_clock/constexpr_data.cc b/libstdc++-v3/testsuite/20_util/system_clock/constexpr_data.cc
index 2407ef16a71..8312f536592 100644
--- a/libstdc++-v3/testsuite/20_util/system_clock/constexpr_data.cc
+++ b/libstdc++-v3/testsuite/20_util/system_clock/constexpr_data.cc
@@ -1,7 +1,7 @@
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011 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
@@ -34,7 +34,7 @@ namespace __gnu_test
void __constraint()
{
constexpr auto v1 __attribute__((unused))
- = _Ttesttype::is_monotonic;
+ = _Ttesttype::is_steady;
}
};
diff --git a/libstdc++-v3/testsuite/20_util/time_point/1.cc b/libstdc++-v3/testsuite/20_util/time_point/1.cc
index e18c6e58cf0..11a6ac49525 100644
--- a/libstdc++-v3/testsuite/20_util/time_point/1.cc
+++ b/libstdc++-v3/testsuite/20_util/time_point/1.cc
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2008, 2009, 2011 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
@@ -33,8 +33,8 @@ test01()
time_point<system_clock> t1;
VERIFY(t1.time_since_epoch() == system_clock::duration::zero());
- time_point<monotonic_clock> t2;
- VERIFY(t2.time_since_epoch() == monotonic_clock::duration::zero());
+ time_point<steady_clock> t2;
+ VERIFY(t2.time_since_epoch() == steady_clock::duration::zero());
time_point<high_resolution_clock> t3;
VERIFY(t3.time_since_epoch() == high_resolution_clock::duration::zero());
diff --git a/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc b/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc
new file mode 100644
index 00000000000..37b39f43133
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc
@@ -0,0 +1,45 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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.
+
+// 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/>.
+
+#include <chrono>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std::chrono;
+
+ typedef time_point<system_clock> time_type;
+
+ constexpr time_type t1(seconds(1));
+ constexpr time_type t2(seconds(30));
+ constexpr time_type t3(seconds(60));
+
+ constexpr duration<int> d0(12);
+ constexpr duration<int> d1(3);
+
+ constexpr auto r1 = t1 + d0;
+ constexpr auto r2 = d1 + t2;
+
+ constexpr auto r3 = t1 - d0;
+ constexpr auto r4 = t2 - t3;
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc
new file mode 100644
index 00000000000..23bc104aeab
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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.
+
+// 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/>.
+
+#include <array>
+
+int main()
+{
+ // array
+ typedef std::array<std::size_t, 6> array_type;
+ constexpr array_type a = { 0, 55, 66, 99, 4115, 2 };
+ constexpr auto v1 = a[1];
+ constexpr auto v2 = a.at(2);
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc b/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc
new file mode 100644
index 00000000000..9f0fa3d3dc1
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc
@@ -0,0 +1,40 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 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.
+
+// 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/>.
+
+#include <bitset>
+
+int main()
+{
+ // bitset base type
+ typedef std::_Base_bitset<6> bitset_base;
+ constexpr bitset_base base = bitset_base();
+
+ constexpr auto r1 = base._M_getword(2);
+ // constexpr auto r2 = base._M_getdata(); // error, pointer to this
+ auto r2 = base._M_getdata();
+ constexpr auto r3 = base._M_hiword();
+
+ // bitset operators
+ typedef std::bitset<6> bitset_type;
+ constexpr bitset_type a = bitset_type();
+ constexpr auto v = a[0];
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_compare_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_compare_neg.cc
new file mode 100644
index 00000000000..72611d3cdf6
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_compare_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_compare<std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_range_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_range_neg.cc
new file mode 100644
index 00000000000..1e45e626cdf
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_range_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_range<std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_erased_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_erased_local_iterator_neg.cc
new file mode 100644
index 00000000000..ce70ef28586
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_erased_local_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::use_erased_local_iterator<std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_iterator_neg.cc
new file mode 100644
index 00000000000..3d9f219d02e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::use_invalid_iterator<std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_local_iterator_neg.cc
new file mode 100644
index 00000000000..70cda4756e6
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/use_invalid_local_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::use_invalid_local_iterator<std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_compare_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_compare_neg.cc
new file mode 100644
index 00000000000..4ee44a4b4b1
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_compare_neg.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ typedef std::unordered_multimap<int, int> cont_type;
+ __gnu_test::invalid_local_iterator_compare<cont_type>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_range_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_range_neg.cc
new file mode 100644
index 00000000000..d70225e5870
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_range_neg.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ typedef std::unordered_multimap<int, int> cont_type;
+ __gnu_test::invalid_local_iterator_range<cont_type>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_erased_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_erased_local_iterator_neg.cc
new file mode 100644
index 00000000000..2d404e6eca7
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_erased_local_iterator_neg.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ typedef std::unordered_multimap<int, int> cont_type;
+ __gnu_test::use_erased_local_iterator<cont_type>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_iterator_neg.cc
new file mode 100644
index 00000000000..6f7c250bd14
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_iterator_neg.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/checks.h>
+
+void test01()
+{
+ typedef std::unordered_multimap<int, int> cont_type;
+ __gnu_test::use_invalid_iterator<cont_type>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_local_iterator_neg.cc
new file mode 100644
index 00000000000..e47838f624e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/use_invalid_local_iterator_neg.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ typedef std::unordered_multimap<int, int> cont_type;
+ __gnu_test::use_invalid_local_iterator<cont_type>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_compare_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_compare_neg.cc
new file mode 100644
index 00000000000..03fa0b6618a
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_compare_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_compare<std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_range_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_range_neg.cc
new file mode 100644
index 00000000000..f2f2571c0bc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_range_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_range<std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_erased_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_erased_local_iterator_neg.cc
new file mode 100644
index 00000000000..08b4e868e67
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_erased_local_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::use_erased_local_iterator<std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_iterator_neg.cc
new file mode 100644
index 00000000000..b4202f9bb78
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::use_invalid_iterator<std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_local_iterator_neg.cc
new file mode 100644
index 00000000000..9e47220ea54
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/use_invalid_local_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::use_invalid_local_iterator<std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_compare_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_compare_neg.cc
new file mode 100644
index 00000000000..bef8e7ba689
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_compare_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_compare<std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_range_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_range_neg.cc
new file mode 100644
index 00000000000..e4cb8c1d4cf
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_range_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_range<std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_erased_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_erased_local_iterator_neg.cc
new file mode 100644
index 00000000000..1807005ea9b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_erased_local_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::use_erased_local_iterator<std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_iterator_neg.cc
new file mode 100644
index 00000000000..c29889ee252
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::use_invalid_iterator<std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_local_iterator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_local_iterator_neg.cc
new file mode 100644
index 00000000000..28444ec6e84
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/use_invalid_local_iterator_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::use_invalid_local_iterator<std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
index f4904ada547..0938bc46328 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
@@ -5,7 +5,7 @@
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -38,10 +38,10 @@ void test01()
std::mutex m;
std::unique_lock<std::mutex> l(m);
- auto then = std::chrono::monotonic_clock::now();
+ auto then = std::chrono::steady_clock::now();
std::cv_status result = c1.wait_until(l, then + ms);
VERIFY( result == std::cv_status::timeout );
- VERIFY( (std::chrono::monotonic_clock::now() - then) >= ms );
+ VERIFY( (std::chrono::steady_clock::now() - then) >= ms );
VERIFY( l.owns_lock() );
}
catch (const std::system_error& e)
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
index 8e58dce818b..3ad13a37928 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
@@ -5,7 +5,7 @@
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011 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
@@ -63,10 +63,10 @@ void test01()
Mutex m;
m.lock();
- auto then = std::chrono::monotonic_clock::now();
+ auto then = std::chrono::steady_clock::now();
std::cv_status result = c1.wait_until(m, then + ms);
VERIFY( result == std::cv_status::timeout );
- VERIFY( (std::chrono::monotonic_clock::now() - then) >= ms );
+ VERIFY( (std::chrono::steady_clock::now() - then) >= ms );
VERIFY( m.locked );
}
catch (const std::system_error& e)
diff --git a/libstdc++-v3/testsuite/util/debug/checks.h b/libstdc++-v3/testsuite/util/debug/checks.h
index b42ef1a44c4..dbf6d40b148 100644
--- a/libstdc++-v3/testsuite/util/debug/checks.h
+++ b/libstdc++-v3/testsuite/util/debug/checks.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011 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
@@ -45,7 +45,7 @@ namespace __gnu_test
{
typedef _Tp value_type;
- operator value_type()
+ value_type build()
{
static value_type _S_;
++_S_;
@@ -60,7 +60,7 @@ namespace __gnu_test
typedef _Tp2 second_type;
typedef std::pair<_Tp1, _Tp2> pair_type;
- operator pair_type()
+ pair_type build()
{
static first_type _S_1;
static second_type _S_2;
@@ -86,7 +86,7 @@ namespace __gnu_test
vector_type v;
for (int i = 0; i != 5; ++i)
- v.push_back(gu);
+ v.push_back(gu.build());
VERIFY(v.size() == 5);
const val_type* first = &v.front() + 1;
@@ -116,7 +116,7 @@ namespace __gnu_test
vector_type v;
for (int i = 0; i != 5; ++i)
- v.push_back(gu);
+ v.push_back(gu.build());
VERIFY(v.size() == 5);
typename vector_type::iterator first = v.begin() + 1;
@@ -145,7 +145,7 @@ namespace __gnu_test
list_type l;
for (int i = 0; i != 5; ++i)
- l.push_back(gu);
+ l.push_back(gu.build());
VERIFY(l.size() == 5);
typename list_type::iterator first = l.begin(); ++first;
@@ -174,7 +174,7 @@ namespace __gnu_test
vector_type v;
for (int i = 0; i != 5; ++i)
- v.push_back(gu);
+ v.push_back(gu.build());
VERIFY(v.size() == 5);
val_type *first = &v.front() + 1;
@@ -201,7 +201,7 @@ namespace __gnu_test
vector_type v;
for (int i = 0; i != 5; ++i)
- v.push_back(gu);
+ v.push_back(gu.build());
VERIFY(v.size() == 5);
typename vector_type::iterator first = v.begin() + 1;
@@ -228,7 +228,7 @@ namespace __gnu_test
list_type l;
for (int i = 0; i != 5; ++i)
- l.push_back(gu);
+ l.push_back(gu.build());
VERIFY(l.size() == 5);
typename list_type::iterator first = l.begin(); ++first;
@@ -304,7 +304,7 @@ namespace __gnu_test
vector_type v;
for (int i = 0; i != 5; ++i)
- v.push_back(gu);
+ v.push_back(gu.build());
VERIFY(v.size() == 5);
const val_type* first = &v.front() + 1;
@@ -333,7 +333,7 @@ namespace __gnu_test
vector_type v;
for (int i = 0; i != 5; ++i)
- v.push_back(gu);
+ v.push_back(gu.build());
VERIFY(v.size() == 5);
typename vector_type::iterator first = v.begin() + 1;
@@ -362,7 +362,7 @@ namespace __gnu_test
list_type l;
for (int i = 0; i != 5; ++i)
- l.push_back(gu);
+ l.push_back(gu.build());
VERIFY(l.size() == 5);
typename list_type::iterator first = l.begin(); ++first;
@@ -375,5 +375,25 @@ namespace __gnu_test
cont_type c2;
InsertRangeHelper<cont_type>::Insert(c2, last, first); // Expected failure
}
+
+ template<typename _Tp>
+ void use_invalid_iterator()
+ {
+ bool test __attribute__((unused)) = true;
+
+ typedef _Tp cont_type;
+ typedef typename cont_type::value_type cont_val_type;
+ typedef typename CopyableValueType<cont_val_type>::value_type val_type;
+ generate_unique<val_type> gu;
+
+ cont_type c;
+ for (size_t i = 0; i != 5; ++i)
+ c.insert(gu.build());
+
+ typename cont_type::iterator it = c.begin();
+ cont_val_type val = *it;
+ c.clear();
+ VERIFY( *it == val );
+ }
}
diff --git a/libstdc++-v3/testsuite/util/debug/unordered_checks.h b/libstdc++-v3/testsuite/util/debug/unordered_checks.h
new file mode 100644
index 00000000000..66841508fcc
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/debug/unordered_checks.h
@@ -0,0 +1,190 @@
+// Copyright (C) 2011 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.
+//
+// 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/>.
+//
+
+#include <testsuite_hooks.h>
+
+namespace __gnu_test
+{
+ template<typename _Tp>
+ struct CopyableValueType
+ {
+ typedef _Tp value_type;
+ };
+
+ template<typename _Tp1, typename _Tp2>
+ struct CopyableValueType<std::pair<const _Tp1, _Tp2> >
+ {
+ typedef std::pair<_Tp1, _Tp2> value_type;
+ };
+
+ template<typename _Tp>
+ struct generate_unique
+ {
+ typedef _Tp value_type;
+
+ value_type build()
+ {
+ static value_type _S_;
+ ++_S_;
+ return _S_;
+ }
+ };
+
+ template<typename _Tp1, typename _Tp2>
+ struct generate_unique<std::pair<_Tp1, _Tp2> >
+ {
+ typedef _Tp1 first_type;
+ typedef _Tp2 second_type;
+ typedef std::pair<_Tp1, _Tp2> pair_type;
+
+ pair_type build()
+ {
+ static first_type _S_1;
+ static second_type _S_2;
+ ++_S_1;
+ ++_S_2;
+ return pair_type(_S_1, _S_2);
+ }
+ };
+
+ template<typename _Tp>
+ struct KeyExtractor
+ {
+ static _Tp get_key(const _Tp& val)
+ { return val; }
+ };
+
+ template<typename _Tp1, typename _Tp2>
+ struct KeyExtractor<std::pair<const _Tp1, _Tp2>>
+ {
+ static _Tp1 get_key(const std::pair<const _Tp1, _Tp2>& val)
+ { return val.first; }
+ };
+
+ template<typename _Tp>
+ void use_erased_local_iterator()
+ {
+ bool test __attribute__((unused)) = true;
+
+ typedef _Tp cont_type;
+ typedef typename cont_type::value_type cont_val_type;
+ typedef typename CopyableValueType<cont_val_type>::value_type val_type;
+ generate_unique<val_type> gu;
+
+ cont_type c;
+ for (size_t i = 0; i != 5; ++i)
+ c.insert(gu.build());
+
+ typename cont_type::local_iterator it, end;
+ for (size_t i = 0; i != c.bucket_count(); ++i)
+ {
+ it = c.begin(i);
+ end = c.end(i);
+ if (it != end)
+ break;
+ }
+ typename cont_type::key_type key = KeyExtractor<cont_val_type>::get_key(*it);
+ c.erase(key);
+ VERIFY( it != end );
+ }
+
+ template<typename _Tp>
+ void use_invalid_local_iterator()
+ {
+ bool test __attribute__((unused)) = true;
+
+ typedef _Tp cont_type;
+ typedef typename cont_type::value_type cont_val_type;
+ typedef typename CopyableValueType<cont_val_type>::value_type val_type;
+ generate_unique<val_type> gu;
+
+ cont_type c;
+ for (size_t i = 0; i != 5; ++i)
+ c.insert(gu.build());
+
+ typename cont_type::local_iterator it;
+ for (size_t i = 0; i != c.bucket_count(); ++i)
+ {
+ it = c.begin(i);
+ if (it != c.end(i))
+ break;
+ }
+ cont_val_type val = *it;
+ c.clear();
+ VERIFY( *it == val );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_compare()
+ {
+ bool test __attribute__((unused)) = true;
+
+ typedef _Tp cont_type;
+ typedef typename cont_type::value_type cont_val_type;
+ typedef typename CopyableValueType<cont_val_type>::value_type val_type;
+ generate_unique<val_type> gu;
+
+ cont_type c;
+ for (size_t i = 0; i != 5; ++i)
+ c.insert(gu.build());
+
+ typename cont_type::local_iterator it1, it2;
+ size_t i;
+ for (i = 0; i != c.bucket_count(); ++i)
+ {
+ it1 = c.begin(i);
+ if (it1 != c.end(i))
+ break;
+ }
+ VERIFY( i != c.bucket_count() );
+ for (++i; i != c.bucket_count(); ++i)
+ {
+ it2 = c.begin(i);
+ if (it2 != c.end(i))
+ break;
+ }
+
+ VERIFY( it1 != it2 );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_range()
+ {
+ bool test __attribute__((unused)) = true;
+
+ typedef _Tp cont_type;
+ typedef typename cont_type::value_type cont_val_type;
+ typedef typename CopyableValueType<cont_val_type>::value_type val_type;
+ generate_unique<val_type> gu;
+
+ cont_type c;
+ for (size_t i = 0; i != 5; ++i)
+ c.insert(gu.build());
+
+ typename cont_type::local_iterator it, end;
+ for (size_t i = 0; i != c.bucket_count(); ++i)
+ {
+ it = c.begin(i);
+ end = c.end(i);
+ if (it != end)
+ break;
+ }
+ c.insert(end, it);
+ }
+}
+
diff --git a/libstdc++-v3/testsuite/util/testsuite_error.h b/libstdc++-v3/testsuite/util/testsuite_error.h
index c2bfed737da..bb9ddd7cdea 100644
--- a/libstdc++-v3/testsuite/util/testsuite_error.h
+++ b/libstdc++-v3/testsuite/util/testsuite_error.h
@@ -1,7 +1,7 @@
// -*- C++ -*-
// Error handling utils for the C++ library testsuite.
//
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 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,8 +32,8 @@ namespace __gnu_test
test_category() {}
virtual const char*
- name() const
- {
+ name() const noexcept
+ {
const char* s = "__gnu_test::test_category";
return s;
}
@@ -48,8 +48,8 @@ namespace __gnu_test
test_derived_category() {}
virtual const char*
- name() const
- {
+ name() const noexcept
+ {
const char* s = "__gnu_test::test_derived_category";
return s;
}