aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2008-07-26 13:52:44 +0000
committerH.J. Lu <hongjiu.lu@intel.com>2008-07-26 13:52:44 +0000
commit85001a88157c9423a20e398cf23564ef1c543838 (patch)
tree55ff74a2c86638e95ee43323a1648fe0821bfaa4
parent0e44d1bce4172a1370ca7ba46d3924704099a53d (diff)
Merged with trunk at revision 138172.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/stack@138174 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog847
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in326
-rw-r--r--gcc/ada/ChangeLog13
-rw-r--r--gcc/ada/gnathtml.pl1115
-rw-r--r--gcc/ada/misc.c4
-rw-r--r--gcc/ada/raise-gcc.c4
-rw-r--r--gcc/ada/utils.c3
-rw-r--r--gcc/attribs.c36
-rw-r--r--gcc/builtins.c24
-rw-r--r--gcc/c-common.c293
-rw-r--r--gcc/c-common.h4
-rw-r--r--gcc/c-cppbuiltin.c52
-rw-r--r--gcc/c-decl.c276
-rw-r--r--gcc/c-errors.c6
-rw-r--r--gcc/c-lex.c11
-rw-r--r--gcc/c-opts.c19
-rw-r--r--gcc/c-parser.c136
-rw-r--r--gcc/c-pch.c1
-rw-r--r--gcc/c-pragma.c309
-rw-r--r--gcc/c-tree.h6
-rw-r--r--gcc/c-typeck.c205
-rw-r--r--gcc/cfgexpand.c34
-rw-r--r--gcc/cgraph.c23
-rw-r--r--gcc/cgraph.h5
-rw-r--r--gcc/cgraphbuild.c79
-rw-r--r--gcc/cgraphunit.c193
-rw-r--r--gcc/combine.c3
-rw-r--r--gcc/common.opt28
-rw-r--r--gcc/config.gcc52
-rw-r--r--gcc/config/arm/arm.c5
-rw-r--r--gcc/config/arm/iwmmxt.md36
-rw-r--r--gcc/config/bfin/bfin.c17
-rw-r--r--gcc/config/h8300/h8300.c18
-rw-r--r--gcc/config/i386/darwin.h4
-rw-r--r--gcc/config/i386/i386-c.c344
-rw-r--r--gcc/config/i386/i386-protos.h7
-rw-r--r--gcc/config/i386/i386.c1210
-rw-r--r--gcc/config/i386/i386.h215
-rw-r--r--gcc/config/i386/i386.opt163
-rw-r--r--gcc/config/i386/t-i38613
-rw-r--r--gcc/config/ia64/ia64.c16
-rw-r--r--gcc/config/rs6000/rs6000-c.c12
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/config/sh/sh.h4
-rw-r--r--gcc/config/sparc/sparc.h7
-rw-r--r--gcc/config/spu/spu-c.c74
-rw-r--r--gcc/config/spu/spu.md65
-rwxr-xr-xgcc/configure2
-rw-r--r--gcc/configure.ac2
-rw-r--r--gcc/coretypes.h2
-rw-r--r--gcc/cp/ChangeLog117
-rw-r--r--gcc/cp/call.c20
-rw-r--r--gcc/cp/class.c114
-rw-r--r--gcc/cp/cp-tree.h21
-rw-r--r--gcc/cp/cxx-pretty-print.c6
-rw-r--r--gcc/cp/decl.c154
-rw-r--r--gcc/cp/decl2.c51
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/cp/init.c21
-rw-r--r--gcc/cp/lex.c11
-rw-r--r--gcc/cp/mangle.c5
-rw-r--r--gcc/cp/method.c1
-rw-r--r--gcc/cp/name-lookup.c19
-rw-r--r--gcc/cp/operators.def4
-rw-r--r--gcc/cp/parser.c79
-rw-r--r--gcc/cp/pt.c40
-rw-r--r--gcc/cp/search.c14
-rw-r--r--gcc/cp/semantics.c19
-rw-r--r--gcc/cp/tree.c6
-rw-r--r--gcc/cp/typeck.c74
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/diagnostic.c47
-rw-r--r--gcc/diagnostic.h4
-rw-r--r--gcc/doc/c-tree.texi13
-rw-r--r--gcc/doc/extend.texi294
-rw-r--r--gcc/doc/install.texi8
-rw-r--r--gcc/doc/invoke.texi79
-rw-r--r--gcc/doc/options.texi15
-rw-r--r--gcc/doc/tm.texi52
-rw-r--r--gcc/dojump.c3
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/final.c8
-rw-r--r--gcc/flags.h5
-rw-r--r--gcc/fortran/ChangeLog158
-rw-r--r--gcc/fortran/arith.c6
-rw-r--r--gcc/fortran/array.c4
-rw-r--r--gcc/fortran/data.c6
-rw-r--r--gcc/fortran/decl.c32
-rw-r--r--gcc/fortran/dependency.c6
-rw-r--r--gcc/fortran/expr.c12
-rw-r--r--gcc/fortran/f95-lang.c12
-rw-r--r--gcc/fortran/gfortran.h18
-rw-r--r--gcc/fortran/intrinsic.c172
-rw-r--r--gcc/fortran/invoke.texi42
-rw-r--r--gcc/fortran/io.c33
-rw-r--r--gcc/fortran/lang.opt12
-rw-r--r--gcc/fortran/match.c5
-rw-r--r--gcc/fortran/matchexp.c2
-rw-r--r--gcc/fortran/module.c8
-rw-r--r--gcc/fortran/options.c27
-rw-r--r--gcc/fortran/parse.c6
-rw-r--r--gcc/fortran/primary.c8
-rw-r--r--gcc/fortran/resolve.c69
-rw-r--r--gcc/fortran/scanner.c2
-rw-r--r--gcc/fortran/symbol.c2
-rw-r--r--gcc/fortran/trans-array.c49
-rw-r--r--gcc/fortran/trans-array.h5
-rw-r--r--gcc/fortran/trans-common.c2
-rw-r--r--gcc/fortran/trans-decl.c4
-rw-r--r--gcc/fortran/trans-expr.c17
-rw-r--r--gcc/fortran/trans-intrinsic.c23
-rw-r--r--gcc/fortran/trans-io.c8
-rw-r--r--gcc/fortran/trans-stmt.c19
-rw-r--r--gcc/fortran/trans-types.c12
-rw-r--r--gcc/fortran/trans.c2
-rw-r--r--gcc/fortran/trans.h6
-rw-r--r--gcc/function.c37
-rw-r--r--gcc/input.h5
-rw-r--r--gcc/ipa-cp.c96
-rw-r--r--gcc/ipa-inline.c235
-rw-r--r--gcc/ipa-prop.c1027
-rw-r--r--gcc/ipa-prop.h96
-rw-r--r--gcc/ipa-pure-const.c2
-rw-r--r--gcc/ipa-reference.c2
-rw-r--r--gcc/ipa-type-escape.c2
-rw-r--r--gcc/java/ChangeLog7
-rw-r--r--gcc/java/decl.c24
-rw-r--r--gcc/java/lang.c2
-rw-r--r--gcc/objc/ChangeLog4
-rw-r--r--gcc/objc/objc-act.c4
-rw-r--r--gcc/opt-functions.awk17
-rw-r--r--gcc/optc-gen.awk319
-rw-r--r--gcc/opth-gen.awk171
-rw-r--r--gcc/opts.c356
-rw-r--r--gcc/opts.h1
-rw-r--r--gcc/passes.c29
-rw-r--r--gcc/print-tree.c18
-rw-r--r--gcc/recog.c14
-rw-r--r--gcc/target-def.h46
-rw-r--r--gcc/target.h34
-rw-r--r--gcc/targhooks.c34
-rw-r--r--gcc/targhooks.h3
-rw-r--r--gcc/testsuite/ChangeLog160
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted1.C43
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted2.C66
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_assign.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C16
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C16
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C (renamed from gcc/testsuite/g++.dg/ext/has_nothrow_copy.C)12
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C13
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C13
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C13
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C13
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C16
-rw-r--r--gcc/testsuite/g++.dg/inherit/thunk8.C2
-rw-r--r--gcc/testsuite/g++.dg/ipa/iinline-1.C47
-rw-r--r--gcc/testsuite/g++.dg/parse/crash27.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/error15.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash60.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash7.C6
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr19637.C3
-rw-r--r--gcc/testsuite/g++.dg/warn/pr23075.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash52.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/report.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/error2.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr11832.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr33009.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20080719-1.c65
-rw-r--r--gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c24
-rw-r--r--gcc/testsuite/gcc.dg/Wpointer-arith.c10
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/line6.c7
-rw-r--r--gcc/testsuite/gcc.dg/ipa/iinline-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/ipa/modif-1.c44
-rw-r--r--gcc/testsuite/gcc.dg/pch/valid-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/pch/valid-3.hs3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/winline-4.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/20080723-1.c49
-rw-r--r--gcc/testsuite/gcc.target/i386/cmov8.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/cold-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-1.c34
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-10.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-11.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-2.c99
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-3.c66
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-4.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-5.c125
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-6.c71
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-7.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-8.c161
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-9.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/hot-1.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/opt-1.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/opt-2.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c171
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-23.c108
-rw-r--r--gcc/testsuite/gcc.target/s390/pr36822.c16
-rw-r--r--gcc/testsuite/gcc.target/spu/vector-ansi.c35
-rw-r--r--gcc/testsuite/gcc.target/spu/vector.c32
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_module_1.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/array_temporaries_1.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/c_sizeof_2.f905
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error_3.f9036
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error_4.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error_5.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_g0_2.f082
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_g0_3.f082
-rw-r--r--gcc/testsuite/gfortran.dg/gamma_2.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_shadow_1.f0357
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_shadow_2.f0329
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_shadow_3.f0327
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_std_1.f9048
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_std_2.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_std_3.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_std_4.f9046
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_52.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/selected_char_kind_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/warn_std_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_std_2.f908
-rw-r--r--gcc/testsuite/gfortran.dg/warn_std_3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/zero_sized_5.f9015
-rw-r--r--gcc/testsuite/lib/compat.exp2
-rw-r--r--gcc/testsuite/lib/target-supports.exp24
-rw-r--r--gcc/toplev.c10
-rw-r--r--gcc/toplev.h9
-rw-r--r--gcc/tree-cfg.c2
-rw-r--r--gcc/tree-inline.c98
-rw-r--r--gcc/tree-inline.h8
-rw-r--r--gcc/tree-nrv.c8
-rw-r--r--gcc/tree-optimize.c37
-rw-r--r--gcc/tree-pass.h1
-rw-r--r--gcc/tree-profile.c7
-rw-r--r--gcc/tree-ssa-alias.c12
-rw-r--r--gcc/tree-ssa-coalesce.c50
-rw-r--r--gcc/tree-ssa-live.c12
-rw-r--r--gcc/tree-ssa-structalias.c3
-rw-r--r--gcc/tree-ssa-ter.c38
-rw-r--r--gcc/tree-ssa.c8
-rw-r--r--gcc/tree-switch-conversion.c3
-rw-r--r--gcc/tree-vrp.c4
-rw-r--r--gcc/tree.c154
-rw-r--r--gcc/tree.def7
-rw-r--r--gcc/tree.h80
-rw-r--r--gcc/treestruct.def3
-rw-r--r--gcc/varasm.c4
-rw-r--r--gcc/varpool.c14
-rw-r--r--libcpp/ChangeLog28
-rw-r--r--libcpp/directives-only.c3
-rw-r--r--libcpp/directives.c47
-rw-r--r--libcpp/errors.c2
-rw-r--r--libcpp/include/line-map.h17
-rw-r--r--libcpp/internal.h4
-rw-r--r--libcpp/lex.c2
-rw-r--r--libcpp/line-map.c6
-rw-r--r--libcpp/macro.c11
-rw-r--r--libcpp/traditional.c2
-rw-r--r--libgfortran/ChangeLog52
-rw-r--r--libgfortran/generated/cshift1_16.c8
-rw-r--r--libgfortran/generated/cshift1_4.c8
-rw-r--r--libgfortran/generated/cshift1_8.c8
-rw-r--r--libgfortran/generated/eoshift1_16.c5
-rw-r--r--libgfortran/generated/eoshift1_4.c5
-rw-r--r--libgfortran/generated/eoshift1_8.c5
-rw-r--r--libgfortran/generated/eoshift3_16.c5
-rw-r--r--libgfortran/generated/eoshift3_4.c5
-rw-r--r--libgfortran/generated/eoshift3_8.c5
-rw-r--r--libgfortran/intrinsics/cshift0.c61
-rw-r--r--libgfortran/intrinsics/eoshift0.c5
-rw-r--r--libgfortran/intrinsics/eoshift2.c13
-rw-r--r--libgfortran/io/file_pos.c2
-rw-r--r--libgfortran/io/format.c10
-rw-r--r--libgfortran/io/list_read.c2
-rw-r--r--libgfortran/io/write_float.def53
-rw-r--r--libgfortran/m4/cshift1.m48
-rw-r--r--libgfortran/m4/eoshift1.m45
-rw-r--r--libgfortran/m4/eoshift3.m45
-rw-r--r--libiberty/ChangeLog7
-rw-r--r--libiberty/Makefile.in150
-rw-r--r--libiberty/maint-tool4
-rw-r--r--libstdc++-v3/ChangeLog132
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver40
-rw-r--r--libstdc++-v3/config/os/gnu-linux/arm-eabi-extra.ver18
-rw-r--r--libstdc++-v3/configure.host5
-rw-r--r--libstdc++-v3/include/bits/basic_string.h87
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc8
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h28
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h68
-rw-r--r--libstdc++-v3/include/bits/stl_list.h58
-rw-r--r--libstdc++-v3/include/bits/stl_map.h37
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h49
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h49
-rw-r--r--libstdc++-v3/include/bits/stl_set.h49
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h72
-rw-r--r--libstdc++-v3/include/debug/deque28
-rw-r--r--libstdc++-v3/include/debug/list26
-rw-r--r--libstdc++-v3/include/debug/map.h19
-rw-r--r--libstdc++-v3/include/debug/multimap.h19
-rw-r--r--libstdc++-v3/include/debug/multiset.h19
-rw-r--r--libstdc++-v3/include/debug/safe_association.h12
-rw-r--r--libstdc++-v3/include/debug/set.h19
-rw-r--r--libstdc++-v3/include/debug/string56
-rw-r--r--libstdc++-v3/include/debug/unordered_map33
-rw-r--r--libstdc++-v3/include/debug/unordered_set33
-rw-r--r--libstdc++-v3/include/debug/vector28
-rw-r--r--libstdc++-v3/include/ext/rc_string_base.h2
-rw-r--r--libstdc++-v3/include/ext/sso_string_base.h2
-rw-r--r--libstdc++-v3/include/ext/vstring.h85
-rw-r--r--libstdc++-v3/include/std/chrono2
-rw-r--r--libstdc++-v3/include/std/condition_variable75
-rw-r--r--libstdc++-v3/include/std/mutex128
-rw-r--r--libstdc++-v3/include/std/unordered_map1
-rw-r--r--libstdc++-v3/include/std/unordered_set1
-rw-r--r--libstdc++-v3/include/std/valarray36
-rw-r--r--libstdc++-v3/include/tr1_impl/hashtable6
-rw-r--r--libstdc++-v3/include/tr1_impl/regex14
-rw-r--r--libstdc++-v3/include/tr1_impl/unordered_map34
-rw-r--r--libstdc++-v3/include/tr1_impl/unordered_set34
-rw-r--r--libstdc++-v3/src/Makefile.am10
-rw-r--r--libstdc++-v3/src/Makefile.in10
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc81
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/init-list.cc69
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/init-list.cc74
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/init-list.cc63
-rw-r--r--libstdc++-v3/testsuite/23_containers/multimap/init-list.cc72
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset/init-list.cc68
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/init-list.cc68
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc63
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/init-list.cc77
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/init-list.cc68
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/init-list.cc68
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/init-list.cc69
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/valarray/init-list.cc58
-rw-r--r--libstdc++-v3/testsuite/28_regex/init-list.cc58
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/vstring/init-list.cc79
363 files changed, 14167 insertions, 2878 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 50edf353df9..a461d7b1c3c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,850 @@
+2008-07-25 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE.
+ * cgraphunit.c (record_cdtor_fn): Do not initialize DECL_INLINE
+ (cgraph_preserve_function_body_p): Do not rely on DECL_INLINE.
+ * dojump.c (clear_pending_stack_adjust): Likewise.
+ * print-tree.c (print_node): Ignore DECL_INLINE.
+ * tree-inline.c (inlinable_function_p): Likewise.
+
+2008-07-25 Michael Meissner <gnu@the-meissners.org>
+
+ * doc/extend.texi (hot attribute): Document that the hot attribute
+ turns on -O3 for some ports.
+ (cold attribute): Document that the cold attribute turns on -Os
+ for some ports
+
+ * doc/tm.texi (OPTIMIZATION_OPTIONS): Update documentation to
+ reflect function specific option support.
+
+ * target.h (struct target_option_hooks): Add fields to say whether
+ the cold attribute implies -Os and the hot attribute implies -O3.
+
+ * target-def.h (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION):
+ By default, do not turn on -Os for cold functions.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): By default, do
+ not turn on -O3 for hot functions.
+
+ * c-common.c (handle_hot_attribute): Use target hook to determine
+ if hot functions should enable -O3.
+ (handle_cold_attribute): Use target hook to determine if cold
+ functions should enable -Os.
+
+ * config/i386/i386.c (ix86_target_string): Add -m3dnowa support.
+ (override_options): Move disable scheduling to
+ optimization_options.
+ (optimization_options): Disable scheduling here, not
+ override_options.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+
+ * config/ia64/ia64.c (ia64_override_options): Move setting
+ scheduling flags to ia64_optimization_options.
+ (ia64_optimization_options): Disable scheduling options here, and
+ not in ia64_override_options.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+
+2008-07-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36936
+ * config/i386/i386.c (override_options): Don't clear TARGET_CMOVE.
+
+2008-07-25 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/36926
+ * ipa-prop.c (ipa_analyze_call_uses): Call
+ ipa_is_ssa_with_stmt_def instead of SSA_NAME_IS_DEFAULT_DEF.
+
+2008-07-25 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
+ movv2si_internal): Add mem = reg alternative.
+
+2008-07-25 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR bootstrap/36918
+ * config/sparc/sparc.h (DEFAULT_PCC_STRUCT_RETURN): Define
+ DEFAULT_PCC_STRUCT_RETURN to 127.
+
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
+ (build_cgraph_edges): Likewise.
+ * cgraph.c (cgraph_node): Do not update assembler hash.
+ (cgraph_remove_node): Drop non-unit-at-a-time code.
+ * tree-pass.h (pass_O0_always_inline): Remove.
+ * ipa-reference.c (gate_reference): Remove unit-at-a-time check.
+ * toplev.c (process_options): Flag unit-at-a-time does not imply
+ no section anchors.
+ * cgraphunit.c: Update comments.
+ (decide_is_function_needed): Drop non-unit-at-a-time mode.
+ (cgraph_assemble_pending_functions): Remove.
+ (cgraph_reset_node): Drop non-unit-at-a-time code.
+ (cgraph_finalize_function): Likewise.
+ (cgraph_analyze_function): Likewise.
+ (cgraph_finalize_compilation_unit): Likewise.
+ (cgraph_expand_function): Likewise.
+ (cgraph_optimize): Likesise.
+ (save_inline_function_body): Likewise.
+ * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check.
+ * tree-ssa-alias.c (maybe_be_aliased): Likewise.
+ * ipa-inline.c: Update comments.
+ (enum inlining_mode): remove INLINE_SPEED.
+ (cgraph_clone_inlined_nodes): Drop unit-at-a-time check.
+ (cgraph_mark_inline_edge): Likewise.
+ (try_inline): Likewise.
+ (cgraph_decide_inlining_incrementally): Likewise.
+ (cgraph_gate_inlining): Remove.
+ (cgraph_early_inlining): Remove flag_unit_at_a_time checks.
+ (cgraph_gate_early_inlining): Likewise.
+ (gate_inline_passes): Remove.
+ (pass_inline_parameters, pass_ipa_inline): Remove gates.
+ (cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
+ pass_O0_always_inline): Remove.
+ * c-pch.c (c_pch_matching): Remove -funit-at-a-time.
+ * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check.
+ * opts.c (no_unit_at_a_time_default): Remove.
+ (decode_options): Remove flag_unit_at_a_time reset and warning.
+ * opts.h (no_unit_at_a_time_default): Remove.
+ * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword
+ early in GNU dialect.
+ (merge_decls): Update comment; drop unit-at-a-time check.
+ (finish_decl): Likewise.
+ (grok_declaration): Remove flag_inline_trees code.
+ (finish_functions): Return on function returning non-void on all
+ statics.
+ * ipa-tye-escape.c (gate_type_escape_vars): Remove.
+ * cfgexpand.c (expand_one_static_var): Remove.
+ (expand_one_var): Remove expand_one_static_var call.
+ (expand_used_vars_for_block): Remove flag_unit_a_time check.
+ * c-opts.c (c_common_post_options): Remove flag_inline_trees code
+ and flag_unit_at_a-time compatibility checks.
+ * varasm.c (assemble_alias): Remove flag_unit_at_a_time check.
+ * tree-inline.c (flag_inline_trees): Remove.
+ (inlinable_function_p): Don't check it.
+ (expand_call_inline): Remove non-unit-at-a-time code.
+ * tree-inline.h (flag_inline_trees): Remove.
+ * tree-optimize.c (execute_early_local_optimizations): Remove
+ unit-at-a-time checks.
+ (tree_rest_of_compilation): Likewise.
+ * combine.c (setup_incoming_promotions): Likewise.
+ * tree-profile.c (tree_gen_ic_func_profiler): Likewise.
+ * tree-ssa-structalias.c (delete_points_to_sets): Likewise.
+ * passes.c (pass_inline_parameters): Update comments; remove
+ O0_alwaysinline pass.
+ (execute_one_ipa_transform_pass): Do not reset in_gimple_form.
+ (execute_one_pass): Likewise.
+ * i386.c (ix86_function_regparm): Remove unit-at-a-time check.
+ (ix86_function_sseregparm): Likewise.
+ * arm.c (arm_function_in_section_p): Likewise.
+ * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise.
+ * varpool.c: Update comments.
+ (decide_is_variable_needed): Remove unit-at-a-time checks.
+ (varpool_finalize_decl): Likewise.
+
+2008-07-24 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer
+ to 2 instead of -1.
+ (OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal
+ to 2.
+
+2008-07-24 Kai Tietz <kai.tietz@onevision.com>
+
+ * config/i386/i386.c (get_dllimport_decl): Treat user_label_prefix for
+ imp symbol extension.
+
+ 2008-07-23 Ian Lance Taylor <iant@google.com>
+
+ * tree-vrp.c (infer_value_range): Ignore asm statements when
+ looking for memory accesses for -fdelete-null-pointer-checks.
+
+2008-07-24 Ben Elliston <bje@au.ibm.com>
+
+ * config/spu/spu-c.c (__vector_keyword): New variable.
+ (vector_keyword): Likewise.
+ (spu_categorize_keyword): New function.
+ (spu_macro_to_expand): Likewise.
+ (spu_cpu_cpp_builtins): Enable context-sensitive macros if not
+ compiling an ISO C dialect.
+
+2008-07-24 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/rs6000-c.c: Move GTY(()) markers to match
+ conventional usage.
+
+2008-07-23 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * configure: Regenerate.
+ * configure.ac: Require texinfo 4.7.
+ * doc/install.texi: Document texinfo 4.7 requirement.
+
+2008-07-23 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed
+ rather than for DECL_SAVED_TREE.
+ * ipa-prop.c: Include diagnostic.h.
+ (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs
+ thoroughly.
+ (ipa_detect_param_modifications): Function rewritten from scratch.
+ (ipa_compute_jump_functions): Changed accesses to modification flags.
+ (ipa_free_node_params_substructures): Update flags destruction.
+ (ipa_node_duplication_hook): Update flags duplication.
+ (ipa_print_all_params_modified): Updated flag access.
+ * ipa-prop.h (struct ipa_param_flags): New structure.
+ (struct ipa_node_params): New field modification_analysis_done,
+ modified_flags changed into param_flags.
+ (ipa_is_ith_param_modified): Changed to use new flags.
+ * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies.
+
+ * ipa-prop.c (ipa_print_all_jump_functions): Moved here from
+ ipa-cp.c and split into two functions.
+ (ipa_print_node_jump_functions): New function.
+ (compute_scalar_jump_functions): New function.
+ (type_like_member_ptr_p): New function.
+ (compute_pass_through_member_ptrs): New function.
+ (fill_member_ptr_cst_jump_function): New function.
+ (determine_cst_member_ptr): New function.
+ (compute_cst_member_ptr_arguments): New function.
+ (ipa_compute_jump_functions): Complete rewrite.
+ * ipa-prop.h (enum jump_func_type): Make explicit that we depend
+ on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR.
+ (struct ipa_member_ptr_cst): New structure.
+ (union jump_func_value): New field member_cst.
+ * ipa-cp.c (ipcp_lat_is_insertable): New function.
+ (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled
+ jump function types.
+ (ipcp_print_all_lattices): Slight fprintf rearrangement.
+ (ipcp_print_all_structures): Call ipa_print_all_jump_functions
+ instead of ipcp_print_all_jump_functions.
+ (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps
+ only for replacable scalars.
+
+ * doc/invoke.texi (Optimize options): Add description of
+ -findirect-inlining.
+ * common.opt (flag_indirect_inlining): New flag.
+ * opts.c (decode_options): Set flag_indirect_inlining when
+ optimize >= 3.
+
+ * ipa-inline.c: Include ipa-prop.h.
+ (inline_indirect_intraprocedural_analysis): New function.
+ (inline_generate_summary): Allocate parameter and argument info
+ structures, call inline_indirect_intraprocedural_analysis on each
+ node when doing indirect inlining and deallocate indirect inlining
+ data structures in the end.
+ * ipa-prop.c (ipa_create_param_decls_array): Return if already done.
+ (free_all_ipa_structures_after_iinln): New function.
+ (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be
+ done.
+ * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies.
+
+ * cgraphbuild.c (compute_call_stmt_bb_frequency): New function.
+ (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead
+ of computing the frequency separately.
+ (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead
+ of computing the frequency separately.
+ * ipa-cp.c (ipcp_print_all_structures): Replace a call to
+ ipa_print_all_param_modified with a call to ipa_print_all_param_flags.
+ * ipa-prop.c (ipa_get_member_ptr_load_param): New function.
+ (ipa_get_stmt_member_ptr_load_param): New function.
+ (ipa_is_ssa_with_stmt_def): New function.
+ (ipa_note_param_call): New function.
+ (ipa_analyze_call_uses): New function.
+ (ipa_analyze_stmt_uses): New function.
+ (ipa_analyze_params_uses): New function.
+ (ipa_free_node_params_substructures): Also free the param_calls linked
+ list.
+ (ipa_node_duplication_hook): Also duplicate the param_calls linked list.
+ (ipa_print_node_param_flags): New function.
+ (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags.
+ (ipa_print_all_param_flags): Calls ipa_print_node_param_flags.
+ * ipa-prop.h (struct ipa_param_flags): New field called.
+ (struct ipa_param_call_note): New structure.
+ (struct ipa_node_params): New fields param_calls and
+ uses_analysis_done.
+ (ipa_is_ith_param_called): New function.
+ * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
+ ipa_analyze_params_uses and dump parameter flags.
+
+ * ipa-inline.c (cgraph_decide_recursive_inlining): Call
+ ipa_propagate_indirect_call_infos if performing indirect inlining,
+ pass a new parameter new_edges to it.
+ (add_new_edges_to_heap): New fucntion.
+ (cgraph_decide_inlining_of_small_functions): New vector
+ new_indirect_edges for newly found indirect edges , call
+ ipa_propagate_indirect_call_infos after inlining.
+ (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after
+ inlining if performing indirect inlining. Call
+ free_all_ipa_structures_after_iinln when doing so too.
+ (inline_generate_summary): Do not call
+ free_all_ipa_structures_after_iinln here.
+ * ipa-prop.c (update_jump_functions_after_inlining): New function.
+ (print_edge_addition_message): New function.
+ (update_call_notes_after_inlining): New function.
+ (propagate_info_to_inlined_callees): New function.
+ (ipa_propagate_indirect_call_infos): New function.
+ * ipa-prop.h: Include cgraph.h
+ (struct ipa_param_call_note): Fields reordered, new field processed.
+ * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new
+ flag indirect_call.
+ * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have
+ rediscovered call statements.
+ * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero.
+ (dump_cgraph_node): Dump also the indirect_call flag.
+ (cgraph_clone_edge): Copy also the indirect_call flag.
+ * tree-inline.c (copy_bb): Do not check for fndecls from call
+ expressions, check for edge availability when moving clones.
+ (get_indirect_callee_fndecl): New function.
+ (expand_call_inline): If callee declaration is not apprent from
+ the statement, try calling get_indirect_callee_fndecl. Do not
+ issue warnings or call sorry when not inlinings an indirect edge.
+ * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies.
+
+ * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a
+ bit more frandly to matching.
+ * testsuite/g++.dg/ipa/iinline-1.C: New testcase.
+ * testsuite/gcc.dg/ipa/iinline-1.c: New testcase.
+ * testsuite/gcc.dg/ipa/modif-1.c: New testcase.
+
+2008-07-23 Michael Meissner <gnu@the-meissners.org>
+
+ PR 36907
+ * opth-gen.awk: Suppress function specific features when building
+ target libraries.
+ * optc-gen.awk: Ditto.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * diagnostic.c (pedwarn): Add opt parameter.
+ (pedwarn0): New.
+ * c-tree.h (pedwarn_init): Add opt parameter.
+ (pedwarn_c90): Likewise.
+ (pedwarn_c99): Likewise.
+ * c-errors.c (pedwarn_c99): Likewise.
+ (pedwarn_c90): Likewise.
+ * toplev.h (pedwarn): Update declaration.
+ (pedwarn0): Declare.
+ * c-lex.c: All calls to pedwarn changed.
+ * builtins.c: All calls to pedwarn changed.
+ * toplev.c: All calls to pedwarn changed.
+ * c-decl.c: All calls to pedwarn changed.
+ * c-typeck.c: All calls to pedwarn changed.
+ * c-common.c: All calls to pedwarn changed.
+ * c-parser.c: All calls to pedwarn changed.
+
+2008-07-23 Michael Meissner <gnu@the-meissners.org>
+ Karthik Kumar <karthikkumar@gmail.com>
+
+ * attribs.c (file scope): Include c-common.h.
+ (decl_attributes): Add support for #pragma GCC optimize and
+ #pragma GCC option.
+
+ * targhooks.c (default_can_inline_p): New function that is the
+ default for the TARGET_CAN_INLINE_P target hook.
+
+ * targhooks.h (default_can_inline_p): Add declaration.
+
+ * tree.c (cl_optimization_node): New static tree for building
+ OPTIMIZATION_NODE tree.
+ (cl_target_option_node): New static tree for building
+ TARGET_OPTION_NODE tree.
+ (cl_option_hash_table): New hash table for hashing
+ OPTIMIZATION_NODE and TARGET_OPTION_NODE trees.
+ (cl_option_hash_hash): New function to provide the hash value for
+ OPTIMIZATION_NODE and TARGET_OPTION_NODE trees.
+ (cl_option_hash_eq): New function to provide an equality test for
+ OPTIMIZATION_NODE and TARGET_OPTION_NODE trees.
+ (tree_code_size): Add support for OPTIMIZATION_NODE and
+ TARGET_OPTION_NODE trees.
+ (tree_code_structure): Add support for OPTIMIZATION_NODE and
+ TARGET_OPTION_NODE trees.
+ (build_optimization_node): Build a tree that has all of the
+ current optimization options.
+ (build_target_option_node): Build a tree that has the target
+ options that might be changed on a per function basis.
+
+ * tree.h (file scope): Include options.h.
+ (DECL_FUNCTION_SPECIFIC_TARGET): New accessor macro.
+ (DECL_FUNCTION_SPECIFIC_OPTIMIZATION): Ditto.
+ (TREE_OPTIMIZATION): Ditto.
+ (TREE_TARGET_SPECIFIC): Ditto.
+ (struct tree_function_decl): Add fields for remembering the
+ current optimization options and target specific options.
+ (struct tree_optimization_option): New tree variant that remembers
+ the optimization options.
+ (struct tree_target_option): New tree variant that remembers the
+ target specific flags that might change for compiling a particular
+ function.
+ (union tree_node): Include tree_optimization_option and
+ tree_target_option fields.
+ (enum tree_index): Add TI_OPTIMIZATION_DEFAULT,
+ TI_OPTIMIZATION_CURRENT, TI_OPTIMIZATION_COLD,
+ TI_OPTIMIZATION_HOT, TI_TARGET_OPTION_DEFAULT,
+ TI_TARGET_OPTION_CURRENT, TI_CURRENT_OPTION_PRAGMA,
+ TI_CURRENT_OPTIMIZE_PRAGMA entries for saving function specific
+ optimization and target options.
+ (optimization_default_node): New macro to refer to global_trees
+ field.
+ (optimization_current_node): Ditto.
+ (optimization_cold_node): Ditto.
+ (optimization_hot_node): Ditto.
+ (target_option_default_node): Ditto.
+ (target_option_current_node): Ditto.
+ (current_option_pragma): Ditto.
+ (current_optimize_pragma): Ditto.
+
+ * target.h (struct gcc_target): Add valid_option_attribute_p,
+ target_option_save, target_option_restore, target_option_print,
+ target_option_pragma_parse, and can_inline_p hooks.
+
+ * toplev.h (parse_optimize_options): Add declaration.
+ (fast_math_flags_struct_set_p): Ditto.
+
+ * c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): New function to
+ adjust the current __OPTIMIZE__, etc. macros when #pragma GCC
+ optimize is used.
+
+ * ipa-inline.c (cgraph_decide_inlining_of_small_function): Call
+ tree_can_inline_p hook to see if one function can inline another.
+ (cgraph_decide_inlining): Ditto.
+ (cgraph_decide_inlining_incrementally): Ditto.
+
+ * opts.c (decode_options): Add support for running multiple times
+ to allow functions with different target or optimization options
+ than was specified on the command line.
+ (fast_math_flags_struct_set_p): New function that is similar to
+ fast_math_flags_set_p, except it uses the values in the
+ cl_optimization structure instead of global variables.
+
+ * optc-gen.awk: Add support for TargetSave to allow a back end to
+ declare new fields that need to be saved when using function
+ specific options. Include flags.h and target.h in the options.c
+ source. Add support for Save to indicate which options can be set
+ for individual functions. Generate cl_optimize_save,
+ cl_optimize_restore, cl_optimize_print, cl_target_option_save,
+ cl_target_option_restore, cl_target_option_print functions to
+ allow functions to use different optimization or target options.
+
+ * opt-functions.awk (var_type_struct): Return the type used for
+ storing the field in a structure.
+
+ * opth-gen.awk: Add support for TargetSave to allow a back end to
+ declare new fields that need to be saved when using function
+ specific options. Add support for Save to indicate which options
+ can be set for individual functions. Only generate one extern for
+ Mask fields. Generate cl_optimization and cl_target_option
+ structures to remember optimization and target options.
+
+ * treestruct.def (TS_OPTIMIZATION): Add support for garbage
+ collecting new tree nodes.
+ (TS_TARGET_OPTION): Ditto.
+
+ * c-decl.c (merge_decls): Merge function specific target and
+ optimization options.
+
+ * function.c (invoke_set_current_function_hook): If the function
+ uses different optimization options, change the global variables
+ to reflect this.
+
+ * coretypes.h (struct cl_optimization): Add forward reference.
+ (struct cl_target_option): Ditto.
+
+ * c-pragma.c (option_stack): New static vector to remember the
+ current #pragma GCC option stack.
+ (handle_pragma_option): New function to support #pragma GCC option
+ to change target options.
+ (optimize_stack): New static vector to remember the current
+ #pragma GCC optimize stack.
+ (handle_pragma_optimize): New function to support #pragma GCC
+ optimize to change optimization options.
+ (init_pragma): Add support for #pragma GCC optimize and #pragma
+ GCC option.
+
+ * tree.def (OPTIMIZATION_NODE): New tree code for remembering
+ optimization options.
+ (TARGET_OPTION_NODE): New tree code for remembering certain target
+ options.
+
+ * print-tree.c (print_node): Add support for OPTIMIZATION_NODE and
+ TARGET_OPTION_NODE trees.
+
+ * common.opt (-O): Add Optimization flag.
+ (-Os): Ditto.
+ (-fmath-errno): Ditto.
+ (-falign-functions): Add UInteger flag to make sure flag gets full
+ int in cl_optimization structure.
+ (-falign-jumps): Ditto.
+ (-falign-labels): Ditto.
+ (-falign-loops): Ditto.
+ (-fsched-stalled-insns): Ditto.
+ (-fsched-stalled-insns-dep): Ditto.
+
+ * target-def.h (TARGET_VALID_OPTION_ATTRIBUTE_P): Add default
+ definition.
+ (TARGET_OPTION_SAVE): Ditto.
+ (TARGET_OPTION_RESTORE): Ditto.
+ (TARGET_OPTION_PRINT): Ditto.
+ (TARGET_OPTION_PRAGMA_PARSE): Ditto.
+ (TARGET_CAN_INLINE_P): Ditto.
+ (TARGET_INITIALIZER): Add new hooks.
+
+ * tree-inline.c (tree_can_inline_p): New function to determine
+ whether one function can inline another. Check if the functions
+ use compatible optimization options, and also call the backend
+ can_inline_p hook.
+
+ * tree-inline.h (tree_can_inline_p): Add declaration.
+
+ * c-common.c (c_common_attribute): Add support for option and
+ optimize attributes.
+ (handle_option_attribute): Add support for the option attribute to
+ allow the user to specify different target options for compiling a
+ specific function.
+ (handle_optimize_attribute): Add support for the optimize
+ attribute to allow the user to specify different optimization
+ options for compiling a specific function.
+ (handle_hot_attribute): Turn on -O3 optimization for this one
+ function if it isn't the default optimization level.
+ (handle_cold_attribute): Turn on -Os optimization for this one
+ function if it insn't the default optimization.
+ (const_char_p): New const char * typedef.
+ (optimize_args): New static vector to remember the optimization
+ arguments.
+ (parse_optimize_options): New function to set up the optimization
+ arguments from either the optimize attribute or #pragma GCC
+ optimize.
+
+ * c-common.h (c_cpp_builtins_optimize_pragma): Add declaration.
+ (builtin_define_std): Ditto.
+
+ * config.gcc (i[3467]86-*-*): Add i386-c.o to C/C++ languages.
+ Add t-i386 Makefile fragment to add i386-c.o and i386.o
+ dependencies.
+ (x86_64-*-*): Ditto.
+
+ * Makefile.in (TREE_H): Add options.h.
+ (options.o): Add $(TARGET_H) $(FLAGS_H) dependencies.
+
+ * doc/extend.texi (option attribute): Document new attribute.
+ (optimize attribute): Ditto.
+ (hot attribute): Document hot attribute sets -O3.
+ (cold attribute): Document cold attribute sets -Os.
+ (#pragma GCC option): Document new pragma.
+ (#pragma GCC optimize): Ditto.
+
+ * doc/options.texi (TargetSave): Document TargetSave syntax.
+ (UInteger): Document UInteger must be used for certain flags.
+ (Save): Document Save option to create target specific options
+ that can be saved/restored on a function specific context.
+
+ * doc/c-tree.texi (DECL_FUNCTION_SPECIFIC_TARGET): Document new
+ macro.
+ (DECL_FUNCTION_SPECIFIC_OPTIMIZATION): Ditto.
+
+ * doc/tm.texi (TARGET_VALID_OPTION_ATTRIBUTE_P): Document new
+ hook.
+ (TARGET_OPTION_SAVE): Ditto.
+ (TARGET_OPTION_RESTORE): Ditto.
+ (TARGET_OPTION_PRINT): Ditto.
+ (TARGET_OPTION_PRAGMA_PARSE): Ditto.
+ (TARGET_CAN_INLINE_P): Ditto.
+
+ * doc/invoke.texi (-mfpmath=sse+387): Document as an alias for
+ -mfpmath=sse,387.
+ (-mfpmath=both): Ditto.
+
+2008-07-23 Michael Meissner <gnu@the-meissners.org>
+ Karthik Kumar <karthikkumar@gmail.com>
+
+ * config/i386/i386.h (TARGET_ABM): Move switch into
+ ix86_isa_flags.
+ (TARGET_POPCNT): Ditto.
+ (TARGET_SAHF): Ditto.
+ (TARGET_AES): Ditto.
+ (TARGET_PCLMUL): Ditto.
+ (TARGET_CMPXCHG16B): Ditto.
+ (TARGET_RECIP): Move switch into target_flags.
+ (TARGET_FUSED_MADD): Ditto.
+ (ix86_arch_features): Make an unsigned char type.
+ (ix86_tune_features): Ditto.
+ (OVERRIDE_OPTIONS): Add bool argument to override_options call.
+ (TARGET_CPU_CPP_BUILTINS): Move into ix86_target_macros.
+ (REGISTER_TARGET_PRAGMAS): Define, call ix86_register_pragmas.
+
+ * config/i386/i386.opt (arch): New TargetSave field to define
+ fields that need to be saved for function specific option
+ support.
+ (tune): Ditto.
+ (fpmath): Ditto.
+ (branch_cost): Ditto.
+ (ix86_isa_flags_explicit): Ditto.
+ (tune_defaulted): Ditto.
+ (arch_specified): Ditto.
+ (-m128-long-double): Add Save flag to save option for target
+ specific option support.
+ (-m80387): Ditto.
+ (-maccumulate-outgoing-args): Ditto.
+ (-malign-double): Ditto.
+ (-malign-stringops): Ditto.
+ (-mfancy-math-387): Ditto.
+ (-mhard-float): Ditto.
+ (-mieee-fp): Ditto.
+ (-minline-all-stringops): Ditto.
+ (-minline-stringops-dynamically): Ditto.
+ (-mms-bitfields): Ditto.
+ (-mno-align-stringops): Ditto.
+ (-mno-fancy-math-387): Ditto.
+ (-mno-push-args): Ditto.
+ (-mno-red-zone): Ditto.
+ (-mpush-args): Ditto.
+ (-mred-zone): Ditto.
+ (-mrtd): Ditto.
+ (-msseregparm): Ditto.
+ (-mstack-arg-probe): Ditto.
+ (-m32): Ditto.
+ (-m64): Ditto.
+ (-mmmx): Ditto.
+ (-m3dnow): Ditto.
+ (-m3dnowa): Ditto.
+ (-msse): Ditto.
+ (-msse2): Ditto.
+ (-msse3): Ditto.
+ (-msse4.1): Ditto.
+ (-msse4.2): Ditto.
+ (-msse4): Ditto.
+ (-mno-sse4): Ditto.
+ (-msse4a): Ditto.
+ (-msse5): Ditto.
+ (-mrecip): Move flag into target_flags.
+ (-mcld): Ditto.
+ (-mno-fused-madd): Ditto.
+ (-mfused-madd): Ditto.
+ (-mabm): Move flag into ix86_isa_flags.
+ (-mcx16): Ditto.
+ (-mpopcnt): Ditto.
+ (-msahf): Ditto.
+ (-maes): Ditto.
+ (-mpclmul): Ditto.
+
+ * config/i386/i386-c.c: New file for #pragma support.
+ (ix86_target_macros_internal): New function to #define or #undef
+ target macros based when the user uses the #pragma GCC option to
+ change target options.
+ (ix86_pragma_option_parse): New function to add #pragma GCC option
+ support.
+ (ix86_target_macros): Move defining the target macros here from
+ TARGET_CPU_CPP_BUILTINS in i386.h.
+ (ix86_register_pragmas): Register the #pragma GCC option hook. If
+ defined, initialize any subtarget #pragmas.
+
+ * config/i386/darwin.h (REGISTER_SUBTARGET_PRAGMAS): Rename from
+ REGISTER_TARGET_PRAGMAS.
+
+ * config/i386/t-i386: New file for x86 dependencies.
+ (i386.o): Make dependencies mirror the include files used.
+ (i386-c.o): New file, add dependencies.
+
+ * config/i386/i386-protos.h (override_options): Add bool
+ argument.
+ (ix86_valid_option_attribute_tree): Add declaration.
+ (ix86_target_macros): Ditto.
+ (ix86_register_macros): Ditto.
+
+ * config/i386/i386.c (ix86_tune_features): Move initialization of
+ the target masks to initial_ix86_tune_features to allow functions
+ to have different target options. Make type unsigned char,
+ instead of unsigned int.
+ (initial_ix86_tune_features): New static vector to hold processor
+ masks for the tune variables.
+ (ix86_arch_features): Move initialization of the target masks to
+ initial_ix86_arch_features to allow functions to have different
+ target options. Make type unsigned char, instead of unsigned
+ int.
+ (initial_ix86_arch_features): New static vector to hold processor
+ masks for the arch variables.
+ (enum ix86_function_specific_strings): New enum to describe the
+ string options used for attribute((option(...))).
+ (ix86_target_string): New function to return a string that
+ describes the target options.
+ (ix86_debug_options): New function to print the current options in
+ the debugger.
+ (ix86_function_specific_save): New function hook to save the
+ function specific global variables in the cl_target_option
+ structure.
+ (ix86_function_specific_restore): New function hook to restore the
+ function specific variables from the cl_target_option structure to
+ the global variables.
+ (ix86_function_specific_print): New function hook to print the
+ target specific options in the cl_target_option structure.
+ (ix86_valid_option_attribute_p): New function hook to validate
+ attribute((option(...))) arguments.
+ (ix86_valid_option_attribute_tree): New function that is common
+ code between attribute((option(...))) and #pragma GCC option
+ support that parses the options and returns a tree holding the
+ options.
+ (ix86_valid_option_attribute_inner_p): New helper function for
+ ix86_valid_option_attribute_tree.
+ (ix86_can_inline_p): New function hook to decide if one function
+ can inline another on a target specific basis.
+ (ix86_set_current_function); New function hook to switch target
+ options if the user used attribute((option(...))) or #pragma GCC
+ option.
+ (ix86_tune_defaulted): Move to static file scope from
+ override_options.
+ (ix86_arch_specified): Ditto.
+ (OPTION_MASK_ISA_AES_SET): New macro for moving switches into
+ ix86_isa_flags.
+ (OPTION_MASK_ISA_PCLMUL_SET): Ditto.
+ (OPTION_MASK_ISA_ABM_SET): Ditto.
+ (OPTION_MASK_ISA_POPCNT_SET): Ditto.
+ (OPTION_MASK_ISA_CX16_SET): Ditto.
+ (OPTION_MASK_ISA_SAHF_SET): Ditto.
+ (OPTION_MASK_ISA_AES_UNSET): Ditto.
+ (OPTION_MASK_ISA_PCLMUL_UNSET): Ditto.
+ (OPTION_MASK_ISA_ABM_UNSET): Ditto.
+ (OPTION_MASK_ISA_POPCNT_UNSET): Ditto.
+ (OPTION_MASK_ISA_CX16_UNSET): Ditto.
+ (OPTION_MASK_ISA_SAHF_UNSET): Ditto.
+ (struct ptt): Move to static file scope from override_options.
+ (processor_target_table): Ditto.
+ (cpu_names): Ditto.
+ (ix86_handle_option): Add support for options that are now isa
+ options.
+ (override_options): Add support for declaring functions that
+ support different target options than were specified on the
+ command line. Move struct ptt, processor_target_table, cpu_names,
+ ix86_tune_defaulted, ix86_arch_specified to static file scope.
+ Add bool argument. Fix up error messages so the appropriate error
+ is given for either command line or attribute.
+ (ix86_previous_fndecl): New static to remember previous function
+ declaration to see if we need to change target options.
+ (ix86_builtins_isa): New array to record the ISA of each builtin
+ function.
+ (def_builtin): Always create the builtin function, even if the
+ current ISA doesn't support it.
+ (ix86_init_mmx_sse_builtins): Remove TARGET_AES and TARGET_PCLMUL
+ tests for those builtins.
+ (ix86_init_builtins): Remove TARGET_MMX test for calling
+ ix86_init_mmx_sse_builtins.
+ (ix86_expand_builtin): If the current ISA doesn't support a given
+ builtin, signal an error.
+ (TARGET_VALID_OPTION_ATTRIBUTE_P): Set target hook.
+ (TARGET_SET_CURRENT_FUNCTION): Ditto.
+ (TARGET_OPTION_SAVE): Ditto.
+ (TARGET_OPTION_RESTORE): Ditto.
+ (TARGET_OPTION_PRINT): Ditto.
+ (TARGET_CAN_INLINE_P): Ditto.
+
+2008-07-22 Rafael Avila de Espindola <espindola@google.com>
+
+ * c-typeck.c (build_external_ref): Don't call assemble_external.
+ * final.c (output_operand): Call assemble_external.
+
+2008-07-21 DJ Delorie <dj@redhat.com>
+
+ * config/h8300/h8300.c (h8300_hard_regno_scratch_ok): New.
+ (TARGET_HARD_REGNO_SCRATCH_OK): Define.
+
+2008-07-21 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.md ("div<mode>3"): Convert into expander, move
+ original insn and splitter contents into ...
+ ("*div<mode>3_fast"): ... this new pattern. Enable only if
+ flag_unsafe_math_optimizations. Add dummy scratch register.
+ ("*div<mode>3_adjusted"): New insn and splitter. Enable only if
+ !flag_unsafe_math_optimizations. Returns number with next
+ highest magnitude if this is still less or equal to the true
+ quotient in magnitude.
+
+2008-07-21 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.in: Replace toplev.h with TOPLEV_H.
+ * c-decl.c (merge_decls): Don't set DECL_IN_SYSTEM_HEADER.
+ * c-lex.c (fe_file_change): Don't set in_system_header.
+ * c-parser.c (c_token): Remove in_system_header.
+ (c_lex_one_token): Don't set in_system_header.
+ (c_parser_set_source_position_from_token): Don't set in_system_header.
+ * diagnostic.c (diagnostic_report_diagnostic): Use location from
+ diagnostic_info.
+ (warning_at): New.
+ * diagnostic.h (diagnostic_report_warnings_p): Add LOC argument.
+ * flags.h (in_system_header): Remove.
+ * function.c (saved_in_system_header): Remove.
+ (push_cfun): Don't set in_system_header.
+ (pop_cfun): Don't set in_system_header.
+ (push_struct_function): Don't set in_system_header.
+ * input.h (expanded_location): Add sysp.
+ (in_system_header_at): New.
+ (in_system_header): New.
+ * toplev.c (in_system_header): Remove.
+ * toplev.h: Include input.h
+ (warning_at): New.
+ * tree-cfg.c (execute_warn_function_return): Call warning_at.
+ * tree-ssa.c (warn_uninit): Call warning_at.
+ (warn_uninitialized_var): Update calls to warn_uninit.
+ (warn_uninitialized_phi): Update calls to warn_uninit.
+ * tree.c (make_node_stat): Don't set DECL_IN_SYSTEM_HEADER.
+ (expand_location): Initialize xloc.sysp.
+ * tree.h (DECL_IN_SYSTEM_HEADER): Use in_system_header_at.
+ (tree_decl_with_vis): Remove in_system_header_flag.
+
+2008-07-21 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ PR target/36822
+ * recog.c (asm_operand_ok): Change the order of the extra
+ memory constraint checks.
+
+2008-07-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/36879
+ * tree-switch-conversion.c (build_one_array): Call
+ varpool_mark_needed_node and varpool_finalize_decl
+ instead of assemble_variable.
+
+2008-07-19 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_add_new_function): Do early local passes.
+ * tree-nrv.c (gate_pass_return_slot): New gate.
+ (pass_nrv): Add the gate.
+ * tree-ssa-coalese.c (hash_ssa_name_by_var, eq_ssa_name_by_var): New
+ functions.
+ (coalesce_ssa_name): Coalesce SSA names.
+ * tree-ssa-live.c (remove_unused_locals): Be more conservative when
+ not optimizing so unused user vars remains visible.
+ * common.opt (flag_tree_ter): Always enable by default.
+ * tree-ssa-ter.c: Include flags.h
+ (is_replaceable_p): Check that locations match; when aliasing is missing
+ be conservative about loads.
+ * tree-optimize.c (gate_init_datastructures): Remove.
+ (pass_init_datastructures): New.
+ * passes.c: Reorder passes so we always go into SSA.
+
+2008-07-19 Jan Hubicka <jh@suse.cz>
+
+ * doc/extend.texi (flatten attribute): Remove note about unit-at-a-time
+ * doc/invoke.texi (--combine): Likewise.
+ (-finline-functions-called-once): Update levels when enabled.
+ (-funit-at-a-time): Document new behaviour.
+ (-ftoplevel-reorder): Document that it is enabled -O0 and imply
+ -fno-section-anchors when disabled explicitly.
+ (inline params): They are not ignored now.
+ (precompiled headers): Remove unit-at-a-time as being incompatible.
+ * opts.c (decode_options): Handle unit-at-a-time as alias;
+ imply -fno-section-anchors when toplevel reorder is disabled
+ explicitly.
+ * common.opt (ftoplevel-reorder): Set default value to 2.
+ (funit-at-a-time): Set default value to 1.
+ * config/rs6000/rs6000.c (optimization_options): Set section anchors
+ to 2.
+
+2008-07-19 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (expand_builtin_int_roundingfn,
+ expand_builtin_int_roundingfn_2): Do not take subtarget argument;
+ it is not useful.
+
2008-07-19 Richard Guenther <rguenther@suse.de>
PR bootstrap/36864
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index d5199fa0760..833bdd6a838 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080720
+20080726
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 430de8bb425..f73686f0300 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -778,6 +778,7 @@ REVISION_s :=
endif
# Shorthand variables for dependency lists.
+TOPLEV_H = toplev.h input.h
TARGET_H = $(TM_H) target.h insn-modes.h
MACHMODE_H = machmode.h mode-classes.def insn-modes.h
HOOKS_H = hooks.h $(MACHMODE_H)
@@ -793,7 +794,7 @@ BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def
TREE_H = tree.h all-tree.def tree.def c-common.def $(lang_tree_files) \
$(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \
$(INPUT_H) statistics.h vec.h treestruct.def $(HASHTAB_H) \
- double-int.h alias.h $(SYMTAB_H)
+ double-int.h alias.h $(SYMTAB_H) options.h
BASIC_BLOCK_H = basic-block.h $(BITMAP_H) sbitmap.h varray.h $(PARTITION_H) \
hard-reg-set.h $(PREDICT_H) vec.h $(FUNCTION_H) \
cfghooks.h $(OBSTACK_H)
@@ -828,7 +829,7 @@ INSN_ATTR_H = insn-attr.h $(INSN_ADDR_H) $(srcdir)/varray.h
INSN_ADDR_H = $(srcdir)/insn-addr.h vecprim.h
C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H)
C_PRAGMA_H = c-pragma.h $(CPPLIB_H)
-C_TREE_H = c-tree.h $(C_COMMON_H) toplev.h $(DIAGNOSTIC_H)
+C_TREE_H = c-tree.h $(C_COMMON_H) $(TOPLEV_H) $(DIAGNOSTIC_H)
SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
$(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
PREDICT_H = predict.h predict.def
@@ -859,7 +860,7 @@ TREE_INLINE_H = tree-inline.h $(VARRAY_H) pointer-set.h
REAL_H = real.h $(MACHMODE_H)
DBGCNT_H = dbgcnt.h dbgcnt.def
EBIMAP_H = ebitmap.h sbitmap.h
-IPA_PROP_H = ipa-prop.h $(TREE_H) vec.h
+IPA_PROP_H = ipa-prop.h $(TREE_H) vec.h $(CGRAPH_H)
GSTAB_H = gstab.h stab.def
BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
@@ -1775,7 +1776,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(FLAGS_H) $(DIAGNOSTIC_H) $(TM_P_H)
c-parser.o : c-parser.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(GGC_H) $(TIMEVAR_H) $(C_TREE_H) $(INPUT_H) $(FLAGS_H) toplev.h output.h \
+ $(GGC_H) $(TIMEVAR_H) $(C_TREE_H) $(INPUT_H) $(FLAGS_H) $(TOPLEV_H) output.h \
$(CPPLIB_H) gt-c-parser.h $(RTL_H) langhooks.h $(C_COMMON_H) $(C_PRAGMA_H) \
vec.h $(TARGET_H) $(CGRAPH_H)
@@ -1790,14 +1791,14 @@ incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) output.h \
- $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \
+ $(EXPR_H) debug.h $(TOPLEV_H) intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \
opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \
except.h $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \
$(DIAGNOSTIC_H) $(INPUT_H) langhooks.h $(TREE_GIMPLE_H) tree-mudflap.h \
pointer-set.h $(BASIC_BLOCK_H)
c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(C_TREE_H) $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) \
- $(RTL_H) toplev.h $(TM_P_H) langhooks.h $(GGC_H) $(TREE_FLOW_H) \
+ $(RTL_H) $(TOPLEV_H) $(TM_P_H) langhooks.h $(GGC_H) $(TREE_FLOW_H) \
$(TREE_GIMPLE_H) tree-iterator.h
c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(DIAGNOSTIC_H) \
@@ -1807,25 +1808,25 @@ stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
$(C_COMMON_H)
c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) $(REAL_H) $(SPLAY_TREE_H) \
- $(C_PRAGMA_H) $(INPUT_H) intl.h $(FLAGS_H) toplev.h output.h \
+ $(C_PRAGMA_H) $(INPUT_H) intl.h $(FLAGS_H) $(TOPLEV_H) output.h \
$(CPPLIB_H) $(TARGET_H) $(TIMEVAR_H) $(TM_P_H)
c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(C_COMMON_H) $(TREE_H) $(CPPLIB_H) $(CPP_INTERNAL_H) $(C_PRAGMA_H)
c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
- $(FUNCTION_H) $(FLAGS_H) toplev.h $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(VARRAY_H) \
+ $(FUNCTION_H) $(FLAGS_H) $(TOPLEV_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(VARRAY_H) \
langhooks.h $(GGC_H) $(TARGET_H) $(C_PRETTY_PRINT_H) c-objc-common.h \
tree-mudflap.h
c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(C_TREE_H) $(FLAGS_H) toplev.h
+ $(C_TREE_H) $(FLAGS_H) $(TOPLEV_H)
c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(FLAGS_H) toplev.h $(C_COMMON_H) convert.h $(C_TREE_H) \
+ $(TREE_H) $(FLAGS_H) $(TOPLEV_H) $(C_COMMON_H) convert.h $(C_TREE_H) \
langhooks.h $(TARGET_H)
c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(FUNCTION_H) $(C_PRAGMA_H) toplev.h output.h $(GGC_H) $(TM_P_H) \
+ $(TREE_H) $(FUNCTION_H) $(C_PRAGMA_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \
$(C_COMMON_H) $(TARGET_H) gt-c-pragma.h $(CPPLIB_H) $(FLAGS_H) $(DIAGNOSTIC_H) \
opts.h
-graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(FLAGS_H) output.h \
+graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(FLAGS_H) output.h \
$(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) \
$(CONFIG_H)
sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
@@ -1854,7 +1855,7 @@ tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h
# A file used by all variants of C.
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) toplev.h output.h $(C_PRAGMA_H) \
+ $(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) $(TOPLEV_H) output.h $(C_PRAGMA_H) \
$(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def \
$(DIAGNOSTIC_H) gt-c-common.h langhooks.h $(VARRAY_H) $(RTL_H) \
$(TARGET_H) $(C_TREE_H) tree-iterator.h langhooks.h tree-mudflap.h \
@@ -1866,7 +1867,7 @@ c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \
$(DIAGNOSTIC_H) tree-iterator.h fixed-value.h
c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h langhooks.h \
+ $(TREE_H) $(C_PRAGMA_H) $(FLAGS_H) $(TOPLEV_H) langhooks.h \
$(TREE_INLINE_H) $(DIAGNOSTIC_H) intl.h debug.h $(C_COMMON_H) \
opts.h options.h $(MKDEPS_H) incpath.h cppdefault.h $(TARGET_H) \
$(TM_P_H) $(VARRAY_H)
@@ -1874,7 +1875,7 @@ c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h \
+ $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) $(TOPLEV_H) \
output.h except.h $(REAL_H) $(TARGET_H) $(TM_P_H) $(BASEVER)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -DBASEVER=$(BASEVER_s) \
$< $(OUTPUT_OPTION)
@@ -1882,15 +1883,15 @@ c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
# A file used by all variants of C and some other languages.
attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) $(TM_P_H) \
+ $(FLAGS_H) $(TOPLEV_H) output.h $(RTL_H) $(GGC_H) $(TM_P_H) \
$(TARGET_H) langhooks.h $(CPPLIB_H)
c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \
- $(C_COMMON_H) $(FLAGS_H) toplev.h intl.h $(DIAGNOSTIC_H) alloc-pool.h \
+ $(C_COMMON_H) $(FLAGS_H) $(TOPLEV_H) intl.h $(DIAGNOSTIC_H) alloc-pool.h \
c-format.h
c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) \
+ $(TREE_H) $(FLAGS_H) $(TOPLEV_H) output.h $(RTL_H) $(GGC_H) \
$(PREDICT_H) $(TREE_INLINE_H) $(C_COMMON_H) except.h $(FUNCTION_H) \
langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(TREE_GIMPLE_H) \
$(VARRAY_H)
@@ -1899,14 +1900,14 @@ c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(TREE_DUMP_H)
c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \
- $(C_COMMON_H) output.h toplev.h $(C_PRAGMA_H) $(GGC_H) debug.h \
+ $(C_COMMON_H) output.h $(TOPLEV_H) $(C_PRAGMA_H) $(GGC_H) debug.h \
langhooks.h $(FLAGS_H) hosthooks.h version.h $(TARGET_H) opts.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DHOST_MACHINE=\"$(host)\" -DTARGET_MACHINE=\"$(target)\" \
$< $(OUTPUT_OPTION)
c-omp.o : c-omp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FUNCTION_H) $(C_COMMON_H) toplev.h $(TREE_GIMPLE_H) $(BITMAP_H) \
+ $(FUNCTION_H) $(C_COMMON_H) $(TOPLEV_H) $(TREE_GIMPLE_H) $(BITMAP_H) \
langhooks.h
# Language-independent files.
@@ -1964,7 +1965,8 @@ s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk
$(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h
$(STAMP) $@
-options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h
+options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) $(FLAGS_H) \
+ $(TM_H) opts.h intl.h
gcc-options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(OUTPUT_OPTION) -DGCC_DRIVER options.c
@@ -1991,13 +1993,13 @@ gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(CFGLOOP_H)
ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \
- $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h $(HOSTHOOKS_DEF_H)
+ $(HASHTAB_H) $(TOPLEV_H) $(PARAMS_H) hosthooks.h $(HOSTHOOKS_DEF_H)
ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
- $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H)
+ $(FLAGS_H) $(TOPLEV_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H)
ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \
+ $(TREE_H) $(FLAGS_H) $(TOPLEV_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \
$(PARAMS_H) $(BITMAP_H) $(VARRAY_H)
ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \
@@ -2013,25 +2015,25 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \
-c $(srcdir)/prefix.c $(OUTPUT_OPTION)
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FLAGS_H) convert.h toplev.h langhooks.h $(REAL_H) fixed-value.h
+ $(FLAGS_H) convert.h $(TOPLEV_H) langhooks.h $(REAL_H) fixed-value.h
double-int.o: double-int.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) toplev.h $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
+ $(TREE_H) $(TOPLEV_H) $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
langhooks.h $(TARGET_H) $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
intl.h $(TREE_GIMPLE_H)
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
all-tree.def $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \
- toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
+ $(TOPLEV_H) $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
$(REAL_H) gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
$(OBSTACK_H) pointer-set.h fixed-value.h
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \
+ $(TREE_H) langhooks.h $(TOPLEV_H) $(SPLAY_TREE_H) $(TREE_DUMP_H) \
tree-iterator.h tree-pass.h $(DIAGNOSTIC_H) $(REAL_H) fixed-value.h
tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) $(INPUT_H) insn-config.h \
- $(VARRAY_H) $(HASHTAB_H) toplev.h langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \
+ $(VARRAY_H) $(HASHTAB_H) $(TOPLEV_H) langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \
intl.h $(FUNCTION_H) $(GGC_H) $(TREE_GIMPLE_H) \
debug.h $(DIAGNOSTIC_H) except.h $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \
$(IPA_PROP_H) value-prof.h tree-pass.h $(TARGET_H) $(INTEGRATE_H)
@@ -2040,7 +2042,7 @@ print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H
stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) output.h $(RTL_H) \
$(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
- toplev.h
+ $(TOPLEV_H)
tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \
$(SYSTEM_H) $(CONFIG_H) coretypes.h $(TM_H) $(GGC_H) $(OBSTACK_H) $(BITMAP_H) \
$(FLAGS_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) output.h errors.h \
@@ -2050,7 +2052,7 @@ tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \
$(CGRAPH_H) $(ALIAS_H) pointer-set.h
tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \
- toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
+ $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) langhooks.h tree-pass.h $(BASIC_BLOCK_H) $(BITMAP_H) \
$(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) pointer-set.h \
$(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H)
@@ -2065,10 +2067,10 @@ tree-ssa-ter.o : tree-ssa-ter.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_SSA_LIVE_H) $(BITMAP_H)
tree-ssa-coalesce.o : tree-ssa-coalesce.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- $(TREE_SSA_LIVE_H) $(BITMAP_H) $(FLAGS_H) $(HASHTAB_H) toplev.h
+ $(TREE_SSA_LIVE_H) $(BITMAP_H) $(FLAGS_H) $(HASHTAB_H) $(TOPLEV_H)
tree-outof-ssa.o : tree-outof-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- tree-pass.h $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) $(BITMAP_H) $(GGC_H) toplev.h
+ tree-pass.h $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) $(BITMAP_H) $(GGC_H) $(TOPLEV_H)
tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) domwalk.h $(FLAGS_H) \
@@ -2125,12 +2127,12 @@ tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(TREE_FLOW_H)
tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
- gt-tree-phinodes.h $(RTL_H) toplev.h
+ gt-tree-phinodes.h $(RTL_H) $(TOPLEV_H)
domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) domwalk.h $(GGC_H)
tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- $(TREE_SSA_LIVE_H) $(BITMAP_H) toplev.h debug.h $(FLAGS_H)
+ $(TREE_SSA_LIVE_H) $(BITMAP_H) $(TOPLEV_H) debug.h $(FLAGS_H)
tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) tree-pass.h \
$(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \
@@ -2151,18 +2153,18 @@ tree-ssa-sccvn.o : tree-ssa-sccvn.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(GGC_H) \
$(BASIC_BLOCK_H) tree-ssa-propagate.h $(FLAGS_H) $(TREE_DUMP_H) \
- $(CFGLOOP_H) tree-chrec.h $(TIMEVAR_H) toplev.h intl.h
+ $(CFGLOOP_H) tree-chrec.h $(TIMEVAR_H) $(TOPLEV_H) intl.h
tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \
- $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h toplev.h \
+ $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(TOPLEV_H) \
value-prof.h tree-ssa-propagate.h $(TREE_INLINE_H)
tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \
- $(DIAGNOSTIC_H) toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
+ $(DIAGNOSTIC_H) $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \
- $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) toplev.h \
+ $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) $(TOPLEV_H) \
tree-ssa-propagate.h tree-scalar-evolution.h
rtl-factoring.o : rtl-factoring.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
coretypes.h $(TM_H) $(BASIC_BLOCK_H) $(RESOURCE_H) $(GGC_H) $(REGS_H) \
@@ -2196,12 +2198,12 @@ tree-dfa.o : tree-dfa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_GIMPLE_H)
tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
- $(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) tree-pass.h toplev.h \
+ $(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) tree-pass.h $(TOPLEV_H) \
coretypes.h langhooks.h $(IPA_REFERENCE_H)
tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) $(FUNCTION_H) except.h langhooks.h \
$(GGC_H) tree-pass.h coretypes.h $(TIMEVAR_H) $(TM_P_H) pointer-set.h \
- $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h toplev.h
+ $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h $(TOPLEV_H)
tree-ssa-loop.o : tree-ssa-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) output.h \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) tree-pass.h $(TIMEVAR_H) \
@@ -2219,7 +2221,7 @@ tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \
$(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- toplev.h $(FLAGS_H) tree-pass.h $(SCEV_H) $(TREE_DATA_REF_H) $(BASIC_BLOCK_H) \
+ $(TOPLEV_H) $(FLAGS_H) tree-pass.h $(SCEV_H) $(TREE_DATA_REF_H) $(BASIC_BLOCK_H) \
$(GGC_H) hard-reg-set.h tree-chrec.h intl.h
tree-ssa-loop-ivcanon.o : tree-ssa-loop-ivcanon.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \
@@ -2235,7 +2237,7 @@ tree-ssa-loop-prefetch.o: tree-ssa-loop-prefetch.c $(TREE_FLOW_H) $(CONFIG_H) \
output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \
$(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \
- tree-chrec.h toplev.h langhooks.h $(TREE_INLINE_H) $(TREE_DATA_REF_H) \
+ tree-chrec.h $(TOPLEV_H) langhooks.h $(TREE_INLINE_H) $(TREE_DATA_REF_H) \
$(OPTABS_H)
tree-predcom.o: tree-predcom.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) \
$(CFGLOOP_H) $(TREE_FLOW_H) $(GGC_H) $(TREE_DATA_REF_H) $(SCEV_H) \
@@ -2265,7 +2267,7 @@ tree-ssa-math-opts.o : tree-ssa-math-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h
alloc-pool.h $(BASIC_BLOCK_H) $(TARGET_H)
tree-ssa-alias-warnings.o : tree-ssa-alias-warnings.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TREE_DUMP_H) \
- $(TREE_FLOW_H) $(PARAMS_H) $(FUNCTION_H) $(EXPR_H) toplev.h \
+ $(TREE_FLOW_H) $(PARAMS_H) $(FUNCTION_H) $(EXPR_H) $(TOPLEV_H) \
tree-ssa-structalias.h tree-ssa-propagate.h langhooks.h alloc-pool.h \
$(DIAGNOSTIC_H)
tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
@@ -2282,29 +2284,29 @@ tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) hard-reg-set.h $(EXPR_H) $(GGC_H) output.h \
$(DIAGNOSTIC_H) $(BASIC_BLOCK_H) $(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
- $(TREE_DUMP_H) toplev.h $(FUNCTION_H) langhooks.h $(FLAGS_H) $(CGRAPH_H) \
+ $(TREE_DUMP_H) $(TOPLEV_H) $(FUNCTION_H) langhooks.h $(FLAGS_H) $(CGRAPH_H) \
$(TREE_INLINE_H) tree-mudflap.h $(GGC_H) graph.h $(CGRAPH_H) tree-pass.h \
$(CFGLOOP_H) except.h
c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \
- $(FLAGS_H) langhooks.h toplev.h $(RTL_H) $(TREE_FLOW_H) $(LANGHOOKS_DEF_H) \
+ $(FLAGS_H) langhooks.h $(TOPLEV_H) $(RTL_H) $(TREE_FLOW_H) $(LANGHOOKS_DEF_H) \
$(TM_H) coretypes.h $(C_PRETTY_PRINT_H) $(CGRAPH_H) $(BASIC_BLOCK_H) \
hard-reg-set.h $(TREE_DUMP_H) $(TREE_INLINE_H)
gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \
- $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) toplev.h $(OPTABS_H) \
+ $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) $(TOPLEV_H) $(OPTABS_H) \
$(REAL_H) $(SPLAY_TREE_H)
gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) tree-pass.h \
- $(HASHTAB_H) toplev.h
+ $(HASHTAB_H) $(TOPLEV_H)
omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_H) \
- $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) toplev.h tree-pass.h \
+ $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(TOPLEV_H) tree-pass.h \
$(GGC_H) except.h $(SPLAY_TREE_H) $(OPTABS_H) $(CFGLOOP_H)
tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \
@@ -2327,22 +2329,22 @@ tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RECOG_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) tree-chrec.h \
- toplev.h $(RECOG_H)
+ $(TOPLEV_H) $(RECOG_H)
tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(EXPR_H) \
- $(OPTABS_H) $(PARAMS_H) $(TREE_DATA_REF_H) tree-vectorizer.h $(RECOG_H) toplev.h
+ $(OPTABS_H) $(PARAMS_H) $(TREE_DATA_REF_H) tree-vectorizer.h $(RECOG_H) $(TOPLEV_H)
tree-vect-transform.o: tree-vect-transform.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(OPTABS_H) $(RECOG_H) $(TREE_H) $(RTL_H) \
$(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
$(TIMEVAR_H) $(CFGLOOP_H) $(TARGET_H) tree-pass.h $(EXPR_H) \
- tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) langhooks.h toplev.h \
+ tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) langhooks.h $(TOPLEV_H) \
tree-chrec.h
tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
tree-pass.h $(EXPR_H) $(RECOG_H) tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) \
- $(INPUT_H) $(TARGET_H) $(CFGLAYOUT_H) toplev.h tree-chrec.h
+ $(INPUT_H) $(TARGET_H) $(CFGLAYOUT_H) $(TOPLEV_H) tree-chrec.h
tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
@@ -2361,7 +2363,7 @@ tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FUNCTION_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \
tree-stdarg.h $(TARGET_H) langhooks.h
tree-object-size.o: tree-object-size.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TREE_H) toplev.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \
+ $(TM_H) $(TREE_H) $(TOPLEV_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \
tree-ssa-propagate.h
tree-gimple.o : tree-gimple.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(EXPR_H) \
$(RTL_H) $(TREE_GIMPLE_H) $(TM_H) coretypes.h $(BITMAP_H) $(GGC_H) \
@@ -2370,36 +2372,36 @@ tree-mudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \
$(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(CGRAPH_H) $(GGC_H) \
gt-tree-mudflap.h $(BASIC_BLOCK_H) $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h \
- $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) toplev.h
+ $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(TOPLEV_H)
tree-nomudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \
$(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \
output.h $(VARRAY_H) langhooks.h tree-mudflap.h $(TM_H) coretypes.h \
- $(GGC_H) gt-tree-mudflap.h tree-pass.h toplev.h
+ $(GGC_H) gt-tree-mudflap.h tree-pass.h $(TOPLEV_H)
tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(REAL_H) $(HASHTAB_H) $(TREE_FLOW_H) \
$(TM_H) coretypes.h tree-iterator.h tree-chrec.h langhooks.h tree-pass.h \
value-prof.h fixed-value.h output.h
fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(FLAGS_H) $(REAL_H) toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
+ $(TREE_H) $(FLAGS_H) $(REAL_H) $(TOPLEV_H) $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
$(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h fixed-value.h $(TARGET_H)
diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) $(INPUT_H) toplev.h intl.h \
+ $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) intl.h \
$(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h
-opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \
+opts.o : opts.c opts.h options.h $(TOPLEV_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \
output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \
$(FLAGS_H) $(PARAMS_H) tree-pass.h $(DBGCNT_H) debug.h varray.h
opts-common.o : opts-common.c opts.h $(CONFIG_H) $(SYSTEM_H) \
coretypes.h intl.h
targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
- $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h toplev.h \
+ $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
$(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h \
$(OPTABS_H) $(RECOG_H) reload.h
toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
version.h $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h $(INPUT_H) \
$(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) debug.h insn-config.h intl.h \
- $(RECOG_H) Makefile toplev.h dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
+ $(RECOG_H) Makefile $(TOPLEV_H) dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
hard-reg-set.h $(BASIC_BLOCK_H) graph.h except.h $(REGS_H) $(TIMEVAR_H) \
value-prof.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h $(CFGLAYOUT_H) $(CFGLOOP_H) hosthooks.h \
@@ -2411,7 +2413,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h $(INPUT_H) $(INSN_ATTR_H) output.h \
- $(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) toplev.h \
+ $(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) $(TOPLEV_H) \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
$(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
@@ -2420,54 +2422,54 @@ passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h $(TREE_FLOW_H) $(TREE_INLINE_H) \
gt-passes.h $(DF_H) $(PREDICT_H)
-main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h
+main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H)
host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
hosthooks.h $(HOSTHOOKS_DEF_H)
rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(INSN_ATTR_H) insn-config.h $(INPUT_H) toplev.h intl.h $(DIAGNOSTIC_H) \
+ $(INSN_ATTR_H) insn-config.h $(INPUT_H) $(TOPLEV_H) intl.h $(DIAGNOSTIC_H) \
$(CONFIG_H) varray.h
rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(GGC_H) $(BCONFIG_H) insn-notes.def reg-notes.def toplev.h $(REAL_H)
+ $(GGC_H) $(BCONFIG_H) insn-notes.def reg-notes.def $(TOPLEV_H) $(REAL_H)
print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(FLAGS_H) \
$(BCONFIG_H) $(REAL_H)
-rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \
+rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) \
$(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) $(REAL_H) \
$(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) $(TREE_H) \
$(DF_H)
varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \
- output.h $(C_PRAGMA_H) toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
+ output.h $(C_PRAGMA_H) $(TOPLEV_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
$(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \
$(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h $(REAL_H) tree-iterator.h
function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(CFGLAYOUT_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \
$(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
- output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \
+ output.h $(TOPLEV_H) except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \
gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \
tree-pass.h $(DF_H) $(TIMEVAR_H) vecprim.h
statistics.o : statistics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
tree-pass.h $(TREE_DUMP_H) $(HASHTAB_H) statistics.h $(TM_H) $(FUNCTION_H)
stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) insn-config.h hard-reg-set.h $(EXPR_H) \
- libfuncs.h except.h $(RECOG_H) toplev.h output.h $(GGC_H) $(TM_P_H) \
+ libfuncs.h except.h $(RECOG_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \
langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) $(MACHMODE_H) \
$(REGS_H) alloc-pool.h
except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) except.h $(FUNCTION_H) $(EXPR_H) libfuncs.h \
langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
- dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
+ dwarf2asm.h dwarf2out.h $(TOPLEV_H) $(HASHTAB_H) intl.h $(GGC_H) \
gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \
$(TARGET_H) $(TM_P_H) tree-pass.h $(TIMEVAR_H)
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \
libfuncs.h $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \
- typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h reload.h \
+ typeclass.h hard-reg-set.h $(TOPLEV_H) hard-reg-set.h except.h reload.h \
$(GGC_H) langhooks.h intl.h $(TM_P_H) $(REAL_H) $(TARGET_H) \
tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \
tree-pass.h $(DF_H) $(DIAGNOSTIC_H) vecprim.h
@@ -2477,37 +2479,37 @@ dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_
builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \
$(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \
- hard-reg-set.h toplev.h hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \
+ hard-reg-set.h $(TOPLEV_H) hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \
libfuncs.h $(REAL_H) langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h \
$(BUILTINS_DEF) $(MACHMODE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) value-prof.h
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \
- libfuncs.h $(REGS_H) toplev.h output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \
+ libfuncs.h $(REGS_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \
$(CGRAPH_H) except.h sbitmap.h $(DBGCNT_H)
expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(REAL_H) \
- toplev.h $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H)
+ $(TOPLEV_H) $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H)
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
- toplev.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
+ $(TOPLEV_H) $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
$(TARGET_H) output.h
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \
- $(RECOG_H) reload.h toplev.h $(GGC_H) $(REAL_H) $(TM_P_H) except.h \
+ $(RECOG_H) reload.h $(TOPLEV_H) $(GGC_H) $(REAL_H) $(TM_P_H) except.h \
gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) $(FUNCTION_H)
dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) $(FUNCTION_H) \
langhooks.h insn-config.h reload.h $(GSTAB_H) xcoffout.h output.h dbxout.h \
- toplev.h $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h
+ $(TOPLEV_H) $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h
debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \
$(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \
- output.h toplev.h $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \
+ output.h $(TOPLEV_H) $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \
gt-sdbout.h reload.h $(VARRAY_H)
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \
output.h $(DIAGNOSTIC_H) $(REAL_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \
- libfuncs.h toplev.h dwarf2out.h reload.h $(GGC_H) except.h dwarf2asm.h \
+ libfuncs.h $(TOPLEV_H) dwarf2out.h reload.h $(GGC_H) except.h dwarf2asm.h \
$(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \
$(MD5_H) $(INPUT_H) $(FUNCTION_H) $(VARRAY_H)
dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
@@ -2516,39 +2518,39 @@ dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \
$(FLAGS_H) $(RTL_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H)
xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) toplev.h output.h dbxout.h \
+ $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) $(TOPLEV_H) output.h dbxout.h \
$(GGC_H) $(TARGET_H) debug.h $(GSTAB_H) xcoff.h
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) \
- $(GGC_H) $(EXPR_H) hard-reg-set.h $(BITMAP_H) toplev.h $(BASIC_BLOCK_H) \
+ $(GGC_H) $(EXPR_H) hard-reg-set.h $(BITMAP_H) $(TOPLEV_H) $(BASIC_BLOCK_H) \
$(HASHTAB_H) $(TM_P_H) debug.h langhooks.h tree-pass.h gt-emit-rtl.h \
$(REAL_H) $(DF_H)
real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- toplev.h $(TM_P_H) $(REAL_H) dfp.h
+ $(TOPLEV_H) $(TM_P_H) $(REAL_H) dfp.h
dfp.o : dfp.c dfp.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- toplev.h $(TM_P_H) $(REAL_H) $(DECNUM_H)
+ $(TOPLEV_H) $(TM_P_H) $(REAL_H) $(DECNUM_H)
fixed-value.o: fixed-value.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) fixed-value.h $(REAL_H) toplev.h
+ $(TREE_H) fixed-value.h $(REAL_H) $(TOPLEV_H)
integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h \
$(EXPR_H) $(REAL_H) $(REGS_H) intl.h $(FUNCTION_H) output.h $(RECOG_H) \
- except.h toplev.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \
+ except.h $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \
gt-integrate.h $(GGC_H) tree-pass.h $(DF_H)
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) \
$(REAL_H) except.h $(FUNCTION_H) tree-pass.h $(DIAGNOSTIC_H) \
- toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) \
+ $(TOPLEV_H) $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) \
$(TIMEVAR_H) $(TARGET_H)
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h \
- $(RECOG_H) $(EXPR_H) toplev.h output.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) \
+ $(RECOG_H) $(EXPR_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) \
$(TREE_H) $(TARGET_H)
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
+ langhooks.h $(TOPLEV_H) $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \
$(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H)
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(FLAGS_H) $(GGC_H) \
+ $(TREE_H) langhooks.h $(TREE_INLINE_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
$(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \
$(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \
$(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) $(IPA_PROP_H) \
@@ -2562,8 +2564,8 @@ varpool.o : varpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_FLOW_H) gt-varpool.h
ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) \
tree-pass.h $(TIMEVAR_H)
-ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) \
+ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TM_H) tree-pass.h $(FLAGS_H) $(TREE_H) $(TREE_INLINE_H) \
$(TIMEVAR_H)
ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -2571,7 +2573,7 @@ ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) $(TREE_INLINE_H)
matrix-reorg.o : matrix-reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) $(TREE_INLINE_H) $(TREE_FLOW_H) \
- tree-flow-inline.h langhooks.h $(HASHTAB_H) toplev.h $(FLAGS_H) $(GGC_H) \
+ tree-flow-inline.h langhooks.h $(HASHTAB_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
debug.h $(TARGET_H) $(CGRAPH_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(PARAMS_H) \
$(FIBHEAP_H) $(C_COMMON_H) intl.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(CFGLOOP_H) \
tree-iterator.h tree-pass.h opts.h $(TREE_DATA_REF_H) tree-chrec.h \
@@ -2579,7 +2581,7 @@ matrix-reorg.o : matrix-reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
ipa-inline.o : ipa-inline.c gt-ipa-inline.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \
$(DIAGNOSTIC_H) $(FIBHEAP_H) $(PARAMS_H) $(TIMEVAR_H) tree-pass.h \
- $(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(RTL_H)
+ $(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(RTL_H) $(IPA_PROP_H)
ipa-utils.o : ipa-utils.c $(IPA_UTILS_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(C_COMMON_H) $(TREE_GIMPLE_H) \
@@ -2602,21 +2604,21 @@ ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
$(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H)
ipa-struct-reorg.o: ipa-struct-reorg.c ipa-struct-reorg.h $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TREE_GIMPLE_H) tree-inline.h \
- $(TREE_FLOW_H) langhooks.h pointer-set.h $(HASHTAB_H) $(C_TREE_H) toplev.h \
+ $(TREE_FLOW_H) langhooks.h pointer-set.h $(HASHTAB_H) $(C_TREE_H) $(TOPLEV_H) \
$(FLAGS_H) debug.h $(TARGET_H) $(CGRAPH_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(PARAMS_H) $(FIBHEAP_H) intl.h $(FUNCTION_H) $(BASIC_BLOCK_H) tree-iterator.h \
tree-pass.h opts.h $(IPA_TYPE_ESCAPE_H) $(TREE_DUMP_H) $(C_COMMON_H)
coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
- $(FUNCTION_H) toplev.h $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \
+ $(FUNCTION_H) $(TOPLEV_H) $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \
$(HASHTAB_H) tree-iterator.h $(CGRAPH_H) tree-pass.h gcov-io.c
cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(RECOG_H) \
- $(EMIT_RTL_H) toplev.h output.h $(FUNCTION_H) cselib.h $(GGC_H) $(TM_P_H) \
+ $(EMIT_RTL_H) $(TOPLEV_H) output.h $(FUNCTION_H) cselib.h $(GGC_H) $(TM_P_H) \
gt-cselib.h $(PARAMS_H) alloc-pool.h $(HASHTAB_H) $(TARGET_H)
cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
- hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
+ hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) $(TOPLEV_H) \
output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \
except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) \
$(DF_H) $(DBGCNT_H)
@@ -2628,11 +2630,11 @@ dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(RECOG_H) $(EXPR_H) $(DF_H) cselib.h $(DBGCNT_H) $(TIMEVAR_H) tree-pass.h \
alloc-pool.h $(ALIAS_H) dse.h $(OPTABS_H)
fwprop.o : fwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- toplev.h insn-config.h $(RECOG_H) $(FLAGS_H) $(OBSTACK_H) $(BASIC_BLOCK_H) \
+ $(TOPLEV_H) insn-config.h $(RECOG_H) $(FLAGS_H) $(OBSTACK_H) $(BASIC_BLOCK_H) \
output.h $(DF_H) alloc-pool.h $(TIMEVAR_H) tree-pass.h $(TARGET_H) $(TM_P_H) \
$(CFGLOOP_H) $(EMIT_RTL_H)
web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \
+ hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
$(DF_H) $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h
see.o : see.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h \
@@ -2640,12 +2642,12 @@ see.o : see.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(HASHTAB_H) $(REGS_H) dce.h
gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(GGC_H) \
- $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \
+ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
$(TM_P_H) $(PARAMS_H) except.h gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) \
intl.h $(OBSTACK_H) tree-pass.h $(DF_H) $(DBGCNT_H)
resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \
coretypes.h $(TM_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) $(DF_H) \
- $(FUNCTION_H) toplev.h $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
+ $(FUNCTION_H) $(TOPLEV_H) $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(RECOG_H) \
$(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) output.h $(REAL_H)
@@ -2666,7 +2668,7 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \
- tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) toplev.h
+ tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(TOPLEV_H)
tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
$(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
$(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_GIMPLE_H) \
@@ -2709,55 +2711,55 @@ var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(REGS_H) $(EXPR_H) $(TIMEVAR_H) tree-pass.h
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) $(FUNCTION_H) \
- toplev.h $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \
+ $(TOPLEV_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \
$(CFGLOOP_H) $(TIMEVAR_H) tree-pass.h
tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
- $(FUNCTION_H) toplev.h $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \
+ $(FUNCTION_H) $(TOPLEV_H) $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \
tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) $(GGC_H) gt-tree-profile.h $(CGRAPH_H)
value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \
$(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
$(TREE_H) $(COVERAGE_H) $(RTL_H) $(GCOV_IO_H) $(TREE_FLOW_H) \
- tree-flow-inline.h $(TIMEVAR_H) tree-pass.h toplev.h pointer-set.h
+ tree-flow-inline.h $(TIMEVAR_H) tree-pass.h $(TOPLEV_H) pointer-set.h
loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) \
- toplev.h $(CFGLOOP_H) output.h $(PARAMS_H) $(TARGET_H)
+ $(TOPLEV_H) $(CFGLOOP_H) output.h $(PARAMS_H) $(TARGET_H)
alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H)
auto-inc-dec.o : auto-inc-dec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) insn-config.h \
- $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) except.h toplev.h $(RECOG_H) \
+ $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) except.h $(TOPLEV_H) $(RECOG_H) \
$(EXPR_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H)
cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \
- $(REGS_H) hard-reg-set.h output.h toplev.h $(FUNCTION_H) except.h $(GGC_H) \
+ $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(FUNCTION_H) except.h $(GGC_H) \
$(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) alloc-pool.h \
$(HASHTAB_H) $(DF_H) $(CFGLOOP_H) $(TREE_FLOW_H) tree-pass.h
cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) toplev.h $(CFGLOOP_H)
+ $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TOPLEV_H) $(CFGLOOP_H)
cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) except.h langhooks.h tree-pass.h $(RTL_H) \
- $(DIAGNOSTIC_H) toplev.h $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) \
+ $(DIAGNOSTIC_H) $(TOPLEV_H) $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) \
value-prof.h $(TREE_INLINE_H) $(TARGET_H)
cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \
- output.h toplev.h $(FUNCTION_H) except.h $(TM_P_H) insn-config.h $(EXPR_H) \
+ output.h $(TOPLEV_H) $(FUNCTION_H) except.h $(TM_P_H) insn-config.h $(EXPR_H) \
$(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \
tree-pass.h $(DF_H) $(GGC_H)
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(TM_P_H) \
- $(TIMEVAR_H) $(OBSTACK_H) toplev.h vecprim.h
+ $(TIMEVAR_H) $(OBSTACK_H) $(TOPLEV_H) vecprim.h
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
+ $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) \
$(FUNCTION_H) except.h $(TIMEVAR_H) $(TREE_H)
cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \
- toplev.h insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \
+ $(TOPLEV_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \
$(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) tree-pass.h $(CFGLOOP_H) $(EXPR_H) \
$(DF_H) $(DBGCNT_H) dce.h
cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \
- $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \
+ $(OBSTACK_H) $(TOPLEV_H) $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \
$(GGC_H)
cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \
@@ -2766,7 +2768,7 @@ graphds.o : graphds.c graphds.h $(CONFIG_H) $(SYSTEM_H) $(BITMAP_H) $(OBSTACK_H)
coretypes.h vec.h vecprim.h
loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) \
- output.h intl.h toplev.h $(DF_H) $(HASHTAB_H)
+ output.h intl.h $(TOPLEV_H) $(DF_H) $(HASHTAB_H)
loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) coretypes.h \
$(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) $(OBSTACK_H) output.h \
@@ -2785,45 +2787,45 @@ loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) \
$(OBSTACK_H)
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) toplev.h \
+ hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) $(TOPLEV_H) \
$(TIMEVAR_H) graphds.h vecprim.h pointer-set.h
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
et-forest.h alloc-pool.h $(BASIC_BLOCK_H)
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(FUNCTION_H) insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
rtlhooks-def.h $(BASIC_BLOCK_H) $(RECOG_H) $(REAL_H) hard-reg-set.h \
- toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \
+ $(TOPLEV_H) $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \
insn-codes.h $(TIMEVAR_H) tree-pass.h $(DF_H) vecprim.h $(CGRAPH_H)
regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) addresses.h $(REGS_H) insn-config.h \
- $(RECOG_H) reload.h $(REAL_H) toplev.h $(FUNCTION_H) output.h $(GGC_H) \
+ $(RECOG_H) reload.h $(REAL_H) $(TOPLEV_H) $(FUNCTION_H) output.h $(GGC_H) \
$(TM_P_H) $(EXPR_H) $(TIMEVAR_H) gt-regclass.h $(HASHTAB_H) \
$(TARGET_H) tree-pass.h $(DF_H)
local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
- output.h $(FUNCTION_H) $(INSN_ATTR_H) toplev.h except.h reload.h $(TM_P_H) \
+ output.h $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) except.h reload.h $(TM_P_H) \
$(GGC_H) $(INTEGRATE_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H)
bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(GGC_H) gt-bitmap.h $(BITMAP_H) $(OBSTACK_H) $(HASHTAB_H)
global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \
- insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \
+ insn-config.h output.h $(TOPLEV_H) $(TM_P_H) $(MACHMODE_H) tree-pass.h \
$(TIMEVAR_H) vecprim.h $(DF_H) $(DBGCNT_H) $(RA_H)
ra-conflict.o : ra-conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \
- insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \
+ insn-config.h output.h $(TOPLEV_H) $(TM_P_H) $(MACHMODE_H) tree-pass.h \
$(TIMEVAR_H) vecprim.h $(DF_H) $(RA_H) sbitmap.h sparseset.h
varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \
- $(HASHTAB_H) $(BCONFIG_H) $(VARRAY_H) toplev.h
+ $(HASHTAB_H) $(BCONFIG_H) $(VARRAY_H) $(TOPLEV_H)
vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h vec.h $(GGC_H) \
- toplev.h
+ $(TOPLEV_H)
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) output.h $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \
- hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) real.h toplev.h \
+ hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) real.h $(TOPLEV_H) \
addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(REAL_H) $(DF_H)
reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
- $(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) toplev.h $(TM_P_H) \
+ $(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) $(TOPLEV_H) $(TM_P_H) \
addresses.h except.h $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \
$(OBSTACK_H) $(DF_H) $(TARGET_H) dse.h
rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
@@ -2831,28 +2833,28 @@ rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REAL_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \
hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \
- $(FUNCTION_H) toplev.h cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \
+ $(FUNCTION_H) $(TOPLEV_H) cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \
$(OBSTACK_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H)
postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \
+ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
$(TM_P_H) except.h $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \
$(PARAMS_H) $(TIMEVAR_H) tree-pass.h $(REAL_H) $(DBGCNT_H)
caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(FUNCTION_H) \
- addresses.h $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H) $(DF_H) \
+ addresses.h $(RECOG_H) reload.h $(EXPR_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) \
gt-caller-save.h $(GGC_H)
bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) except.h \
$(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h $(EXPR_H) \
- $(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) tree-pass.h toplev.h \
+ $(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) tree-pass.h $(TOPLEV_H) \
$(DF_H) vecprim.h $(RECOG_H)
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \
$(INSN_ATTR_H) except.h $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \
- $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \
+ $(EXPR_H) $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \
$(TIMEVAR_H) $(TARGET_H) tree-pass.h
alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h \
+ $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) $(TOPLEV_H) output.h \
$(ALIAS_H) $(EMIT_RTL_H) $(GGC_H) $(FUNCTION_H) cselib.h $(TREE_H) $(TM_P_H) \
langhooks.h $(TARGET_H) gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) \
$(SPLAY_TREE_H) $(VARRAY_H) $(IPA_TYPE_ESCAPE_H) $(DF_H) tree-pass.h
@@ -2865,37 +2867,37 @@ init-regs.o : init-regs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(TIMEVAR_H) tree-pass.h $(DF_H)\
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
- $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) except.h reload.h
combine-stack-adj.o : combine-stack-adj.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) insn-config.h $(TIMEVAR_H) tree-pass.h \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
- $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) $(DF_H) except.h reload.h
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) except.h reload.h
ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \
- toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
+ $(TOPLEV_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \
$(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(BITMAP_H) \
hard-reg-set.h sbitmap.h $(TM_H)
modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TARGET_H) toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
+ coretypes.h $(TARGET_H) $(TOPLEV_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \
$(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(PARAMS_H) \
cfghooks.h $(GCOV_IO_H) hard-reg-set.h $(TM_H) $(TIMEVAR_H) tree-pass.h \
$(DF_H) $(DBGCNT_H)
haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \
- $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) output.h \
+ $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) output.h \
$(PARAMS_H) $(DBGCNT_H)
sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h cselib.h \
$(PARAMS_H) $(TM_P_H)
sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h $(PARAMS_H) \
$(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h $(DBGCNT_H)
sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h $(TM_P_H) \
$(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) output.h
sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) \
@@ -2903,33 +2905,33 @@ sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \
insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \
- except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h tree-pass.h \
+ except.h debug.h xcoffout.h $(TOPLEV_H) reload.h dwarf2out.h tree-pass.h \
$(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \
$(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) $(DF_H) vecprim.h $(GGC_H) \
$(CFGLOOP_H) $(PARAMS_H)
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \
- $(FLAGS_H) insn-config.h $(INSN_ATTR_H) toplev.h output.h reload.h \
+ $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(TOPLEV_H) output.h reload.h \
addresses.h $(TM_P_H) $(TIMEVAR_H) tree-pass.h hard-reg-set.h $(REAL_H) \
$(DF_H) $(DBGCNT_H) $(TARGET_H)
reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
- insn-config.h toplev.h reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \
+ insn-config.h $(TOPLEV_H) reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \
$(BASIC_BLOCK_H) $(CFGLAYOUT_H) output.h $(VARRAY_H) $(TIMEVAR_H) \
tree-pass.h $(TARGET_H) vecprim.h $(DF_H)
sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \
- hard-reg-set.h output.h toplev.h $(RECOG_H) $(FUNCTION_H) except.h \
+ hard-reg-set.h output.h $(TOPLEV_H) $(RECOG_H) $(FUNCTION_H) except.h \
$(TM_P_H) $(PREDICT_H) sreal.h $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) \
$(COVERAGE_H) $(SCEV_H) $(GGC_H) predict.def $(TIMEVAR_H) $(TREE_DUMP_H) \
$(TREE_FLOW_H) tree-pass.h $(EXPR_H) pointer-set.h
-lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \
+lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) \
$(RTL_H) $(GGC_H) gt-lists.h
bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(TIMEVAR_H) output.h $(CFGLAYOUT_H) $(FIBHEAP_H) \
$(TARGET_H) $(FUNCTION_H) $(TM_P_H) $(OBSTACK_H) $(EXPR_H) $(REGS_H) \
- $(PARAMS_H) toplev.h tree-pass.h $(DF_H)
+ $(PARAMS_H) $(TOPLEV_H) tree-pass.h $(DF_H)
tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) \
$(FLAGS_H) $(TIMEVAR_H) $(PARAMS_H) $(COVERAGE_H) $(FIBHEAP_H) \
@@ -2940,13 +2942,13 @@ cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) tree-pass.h vecprim.h \
$(DF_H)
timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TIMEVAR_H) $(FLAGS_H) intl.h toplev.h $(RTL_H) timevar.def
+ $(TIMEVAR_H) $(FLAGS_H) intl.h $(TOPLEV_H) $(RTL_H) timevar.def
regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \
output.h $(RECOG_H) $(FUNCTION_H) $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) \
- addresses.h reload.h toplev.h $(TIMEVAR_H) tree-pass.h $(DF_H)
+ addresses.h reload.h $(TOPLEV_H) $(TIMEVAR_H) tree-pass.h $(DF_H)
ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(REGS_H) toplev.h $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \
+ $(REGS_H) $(TOPLEV_H) $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \
$(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \
$(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h \
$(DF_H) $(DBGCNT_H)
@@ -2959,7 +2961,7 @@ lambda-code.o: lambda-code.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) coretypes.h $(TARGET_H) \
tree-chrec.h tree-pass.h vec.h vecprim.h $(OBSTACK_H) pointer-set.h
-params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h
+params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) $(TOPLEV_H)
pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H)
hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H) \
@@ -2974,7 +2976,7 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
- output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
+ output.h $(INSN_ATTR_H) $(SYSTEM_H) $(TOPLEV_H) $(TARGET_H) libfuncs.h \
$(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \
langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
@@ -3030,17 +3032,17 @@ genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H)\
$(GGC_H) $(OBSTACK_H)
insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) $(REAL_H) output.h $(INSN_ATTR_H) \
- insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H)
+ insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H)
insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) $(REAL_H) output.h $(INSN_ATTR_H) \
- insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H)
+ insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H)
insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TM_P_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) $(REAL_H) \
dfp.h $(FLAGS_H) output.h insn-config.h hard-reg-set.h $(RECOG_H) \
- $(RESOURCE_H) reload.h toplev.h $(REGS_H) tm-constrs.h $(GGC_H) \
+ $(RESOURCE_H) reload.h $(TOPLEV_H) $(REGS_H) tm-constrs.h $(GGC_H) \
$(BASIC_BLOCK_H) $(INTEGRATE_H)
insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(RTL_H) toplev.h insn-config.h $(RECOG_H)
+ $(TM_H) $(RTL_H) $(TOPLEV_H) insn-config.h $(RECOG_H)
insn-modes.o : insn-modes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(MACHMODE_H) $(REAL_H)
insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -3049,18 +3051,18 @@ insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(GGC_H) $(REGS_H) $(REAL_H) conditions.h \
hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h \
- $(RECOG_H) $(FUNCTION_H) toplev.h $(FLAGS_H) insn-codes.h $(TM_P_H) \
+ $(RECOG_H) $(FUNCTION_H) $(TOPLEV_H) $(FLAGS_H) insn-codes.h $(TM_P_H) \
$(TARGET_H) tm-constrs.h
insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
insn-config.h $(RTL_H) $(TM_P_H) $(REGS_H) output.h $(REAL_H) \
- $(RECOG_H) except.h $(FUNCTION_H) toplev.h $(FLAGS_H) tm-constrs.h
+ $(RECOG_H) except.h $(FUNCTION_H) $(TOPLEV_H) $(FLAGS_H) tm-constrs.h
insn-preds.o : insn-preds.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) insn-config.h $(RECOG_H) output.h \
$(FLAGS_H) $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) \
- toplev.h reload.h $(REGS_H) $(REAL_H) tm-constrs.h
+ $(TOPLEV_H) reload.h $(REGS_H) $(REAL_H) tm-constrs.h
insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) insn-config.h $(RECOG_H) output.h $(FLAGS_H) \
- $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) toplev.h \
+ $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) $(TOPLEV_H) \
reload.h $(REAL_H) $(REGS_H) tm-constrs.h
# For each of the files generated by running a generator program over
@@ -3278,11 +3280,11 @@ build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
$(RTL_H) $(REAL_H) $(GGC_H) errors.h
build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h vec.h \
- $(GGC_H) toplev.h
+ $(GGC_H) $(TOPLEV_H)
build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H) \
$(FUNCTION_H) $(REGS_H) $(RECOG_H) $(REAL_H) output.h $(FLAGS_H) \
- $(RESOURCE_H) toplev.h reload.h except.h tm-constrs.h
+ $(RESOURCE_H) $(TOPLEV_H) reload.h except.h tm-constrs.h
# This pulls in tm-pred.h which contains inline functions wrapping up
# predicates from the back-end so those functions must be discarded.
# No big deal since gencondmd.c is a dummy file for non-GCC compilers.
@@ -3330,7 +3332,7 @@ build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) errors.h gensupport.h
build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h gensupport.h toplev.h
+ coretypes.h $(GTM_H) errors.h gensupport.h $(TOPLEV_H)
build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) errors.h gensupport.h $(OBSTACK_H)
build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f08dc9f72d7..137d6524c6e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,16 @@
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * ada/utils.c (end_subprog_body): Remove inline trees check.
+ * ada/misc.c (gnat_post_options): Do not set flag_inline_trees.
+
+2008-07-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * raise-gcc.c: Move tsystem.h before tm.h.
+
+2008-07-20 Arnaud Charlet <charlet@adacore.com>
+
+ * gnathtml.pl: New file.
+
2008-07-19 Olivier Hainque <hainque@adacore.com>
* targtyps.c (get_target_default_allocator_alignment): Use
diff --git a/gcc/ada/gnathtml.pl b/gcc/ada/gnathtml.pl
new file mode 100644
index 00000000000..9d893268055
--- /dev/null
+++ b/gcc/ada/gnathtml.pl
@@ -0,0 +1,1115 @@
+#! /usr/bin/env perl
+
+#-----------------------------------------------------------------------------
+#- --
+#- GNAT COMPILER COMPONENTS --
+#- --
+#- G N A T H T M L --
+#- --
+#- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
+#- --
+#- GNAT is free software; you can redistribute it and/or modify it under --
+#- terms of the GNU General Public License as published by the Free Soft- --
+#- ware Foundation; either version 2, or (at your option) any later ver- --
+#- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+#- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+#- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+#- for more details. You should have received a copy of the GNU General --
+#- Public License distributed with GNAT; see file COPYING. If not, write --
+#- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
+#- MA 02111-1307, USA. --
+#- --
+#- GNAT was originally developed by the GNAT team at New York University. --
+#- Extensive contributions were provided by Ada Core Technologies Inc. --
+#- --
+#-----------------------------------------------------------------------------
+
+## This script converts an Ada file (and its dependency files) to Html.
+## Keywords, comments and strings are color-hilighted. If the cross-referencing
+## information provided by Gnat (when not using the -gnatx switch) is found,
+## the html files will also have some cross-referencing features, i.e. if you
+## click on a type, its declaration will be displayed.
+##
+## To find more about the switches provided by this script, please use the
+## following command :
+## perl gnathtml.pl -h
+## You may also change the first line of this script to indicates where Perl is
+## installed on your machine, so that you can just type
+## gnathtml.pl -h
+##
+## Unless you supply another directory with the -odir switch, the html files
+## will be saved saved in a html subdirectory
+
+use Cwd 'abs_path';
+use File::Basename;
+
+### Print help if necessary
+sub print_usage
+{
+ print "Usage is:\n";
+ print " $0 [switches] main_file[.adb] main_file2[.adb] ...\n";
+ print " -83 : Use Ada83 keywords only (default is Ada95)\n";
+ print " -cc color : Choose the color for comments\n";
+ print " -d : Convert also the files which main_file depends on\n";
+ print " -D : same as -d, also looks for files in the standard library\n";
+ print " -f : Include cross-references for local entities too\n";
+ print " -absolute : Display absolute filenames in the headers\n";
+ print " -h : Print this help page\n";
+ print " -lnb : Display line numbers every nb lines\n";
+ print " -Idir : Specify library/object files search path\n";
+ print " -odir : Name of the directory where the html files will be\n";
+ print " saved. Default is 'html/'\n";
+ print " -pfile : Use file as a project file (.adp file)\n";
+ print " -sc color : Choose the color for symbol definitions\n";
+ print " -Tfile : Read the name of the files from file rather than the\n";
+ print " command line\n";
+ print " -ext ext : Choose the generated file names extension (default\n";
+ print " is htm)\n";
+ print "This program attemps to generate an html file from an Ada file\n";
+ exit;
+}
+
+### Parse the command line
+local ($ada83_mode) = 0;
+local ($prjfile) = "";
+local (@list_files) = ();
+local ($line_numbers) = 0;
+local ($dependencies) = 0;
+local ($standard_library) = 0;
+local ($output_dir) = "html";
+local ($xref_variable) = 0;
+local (@search_dir) = ('.');
+local ($tab_size) = 8;
+local ($comment_color) = "green";
+local ($symbol_color) = "red";
+local ($absolute) = 0;
+local ($fileext) = "htm";
+
+while ($_ = shift @ARGV)
+{
+ /^-83$/ && do { $ada83_mode = 1; };
+ /^-d$/ && do { $dependencies = 1; };
+ /^-D$/ && do { $dependencies = 1;
+ $standard_library = 1; };
+ /^-f$/ && do { $xref_variable = 1; };
+ /^-absolute$/ && do {$absolute = 1; };
+ /^-h$/ && do { &print_usage; };
+ /^[^-]/ && do { $_ .= ".adb" if (! /\.ad[bs]$/);
+ push (@list_files, $_); };
+
+ if (/^-o\s*(.*)$/)
+ {
+ $output_dir = ($1 eq "") ? shift @ARGV : $1;
+ chop $output_dir if ($output_dir =~ /\/$/);
+ &print_usage if ($output_dir =~ /^-/ || $output_dir eq "");
+ }
+
+ if (/^-T\s*(.*)$/)
+ {
+ my ($source_file) = ($1 eq "") ? shift @ARGV : $1;
+ local (*SOURCE);
+ open (SOURCE, "$source_file") || die "file not found: $source_file";
+ while (<SOURCE>) {
+ @files = split;
+ foreach (@files) {
+ $_ .= ".adb" if (! /\.ad[bs]$/);
+ push (@list_files, $_);
+ }
+ }
+ }
+
+ if (/^-cc\s*(.*)$/)
+ {
+ $comment_color = ($1 eq "") ? shift @ARGV : $1;
+ &print_usage if ($comment_color =~ /^-/ || $comment_color eq "");
+ }
+
+ if (/^-sc\s*(.*)$/)
+ {
+ $symbol_color = ($1 eq "") ? shift @ARGV : $1;
+ &print_usage if ($symbol_color =~ /^-/ || $symbol_color eq "");
+ }
+
+ if (/^-I\s*(.*)$/)
+ {
+ push (@search_dir, ($1 eq "") ? scalar (shift @ARGV) : $1);
+ }
+
+ if (/^-p\s*(.*)$/)
+ {
+ $prjfile = ($1 eq "") ? shift @ARGV : $1;
+ &print_usage if ($prjfile =~ /^-/ || $prjfile eq "");
+ }
+
+ if (/^-l\s*(.*)$/)
+ {
+ $line_numbers = ($1 eq "") ? shift @ARGV : $1;
+ &print_usage if ($line_numbers =~ /^-/ || $line_numbers eq "");
+ }
+
+ if (/^-ext\s*(.*)$/)
+ {
+ $fileext = ($1 eq "") ? shift @ARGV : $1;
+ &print_usage if ($fileext =~ /^-/ || $fileext eq "");
+ }
+}
+
+&print_usage if ($#list_files == -1);
+local (@original_list) = @list_files;
+
+## This regexp should match all the files from the standard library (and only them)
+## Note that at this stage the '.' in the file names has been replaced with __
+$standard_file_regexp="^([agis]-|ada__|gnat__|system__|interface__).*\$";
+
+local (@src_dir) = ();
+local (@obj_dir) = ();
+
+if ($standard_library) {
+ open (PIPE, "gnatls -v | ");
+ local ($mode) = "";
+ while (defined ($_ = <PIPE>)) {
+ chop;
+ s/^\s+//;
+ $_ = './' if (/<Current_Directory>/);
+ next if (/^$/);
+
+ if (/Source Search Path:/) {
+ $mode = 's';
+ }
+ elsif (/Object Search Path:/) {
+ $mode = 'o';
+ }
+ elsif ($mode eq 's') {
+ push (@src_dir, $_);
+ }
+ elsif ($mode eq 'o') {
+ push (@obj_dir, $_);
+ }
+ }
+ close (PIPE);
+}
+else
+{
+ push (@src_dir, "./");
+ push (@obj_dir, "./");
+}
+
+foreach (@list_files) {
+ local ($dir) = $_;
+ $dir =~ s/\/([^\/]+)$//;
+ push (@src_dir, $dir. '/');
+ push (@obj_dir, $dir. '/');
+}
+
+### Defines and compiles the Ada key words :
+local (@Ada_keywords) = ('abort', 'abs', 'accept', 'access', 'all', 'and',
+ 'array', 'at', 'begin', 'body', 'case', 'constant',
+ 'declare', 'delay', 'delta', 'digits', 'do', 'else',
+ 'elsif', 'end', 'entry', 'exception', 'exit', 'for',
+ 'function', 'generic', 'goto', 'if', 'in', 'is',
+ 'limited', 'loop', 'mod', 'new', 'not', 'null', 'of',
+ 'or', 'others', 'out', 'package', 'pragma', 'private',
+ 'procedure', 'raise', 'range', 'record', 'rem',
+ 'renames', 'return', 'reverse', 'select', 'separate',
+ 'subtype', 'task', 'terminate', 'then', 'type',
+ 'until', 'use', 'when', 'while', 'with', 'xor');
+local (@Ada95_keywords) = ('abstract', 'aliased', 'protected', 'requeue',
+ 'tagged');
+
+local (%keywords) = ();
+grep (++ $keywords{$_}, @Ada_keywords);
+grep (++ $keywords{$_}, @Ada95_keywords) unless ($ada83_mode);
+
+### Symbols declarations for the current file
+### format is (line_column => 1, ...)
+local (%symbols);
+
+### Symbols usage for the current file
+### format is ($adafile#$line_$column => $htmlfile#$linedecl_$columndecl, ...)
+local (%symbols_used);
+
+### the global index of all symbols
+### format is ($name => [[file, line, column], [file, line, column], ...])
+local (%global_index);
+
+#########
+## This function create the header of every html file.
+## These header is returned as a string
+## Params: - Name of the Ada file associated with this html file
+#########
+sub create_header
+{
+ local ($adafile) = shift;
+ local ($string) = "<HEAD><TITLE>$adafile</TITLE></HEAD>
+<BODY>\n";
+
+ if ($adafile ne "")
+ {
+ $string .= "<HR><DIV ALIGN=\"center\"><H1> File : $adafile "
+ . "</H1></DIV><HR>\n<PRE>";
+ }
+ return $string;
+}
+
+#########
+## Protect a string (or character) from the Html parser
+## Params: - the string to protect
+## Out: - the protected string
+#########
+sub protect_string
+{
+ local ($string) = shift;
+ $string =~ s/&/&amp;/g;
+ $string =~ s/</&lt;/g;
+ $string =~ s/>/&gt;/g;
+ return $string;
+}
+
+#########
+## This function creates the footer of the html file
+## The footer is returned as a string
+## Params : - Name of the Ada file associated with this html file
+#########
+sub create_footer
+{
+ local ($adafile) = shift;
+ local ($string) = "";
+ $string = "</PRE>" if ($adafile ne "");
+ return $string . "</BODY></HTML>\n";
+}
+
+#########
+## This function creates the string to use for comment output
+## Params : - the comment itself
+#########
+sub output_comment
+{
+ local ($comment) = &protect_string (shift);
+ return "<FONT COLOR=$comment_color><EM>--$comment</EM></FONT>";
+}
+
+########
+## This function creates the string to use for symbols output
+## Params : - the symbol to output
+## - the current line
+## - the current column
+########
+sub output_symbol
+{
+ local ($symbol) = &protect_string (shift);
+ local ($lineno) = shift;
+ local ($column) = shift;
+ return "<FONT COLOR=$symbol_color><A NAME=\"$lineno\_$column\">$symbol</A></FONT>";
+}
+
+########
+## This function creates the string to use for keyword output
+## Params : - the keyword to output
+########
+sub output_keyword
+{
+ local ($keyw) = shift;
+ return "<b>$keyw</b>";
+}
+
+########
+## This function outputs a line number
+## Params : - the line number to generate
+########
+sub output_line_number
+{
+ local ($no) = shift;
+ if ($no != -1)
+ {
+ return "<EM><FONT SIZE=-1>" . sprintf ("%4d ", $no) . "</FONT></EM>";
+ }
+ else
+ {
+ return "<FONT SIZE=-1> </FONT>";
+ }
+}
+
+########
+## Converts a character into the corresponding Ada type
+## This is based on the ali format (see lib-xref.adb) in the GNAT sources
+## Note: 'f' or 'K' should be returned in case a link from the body to the
+## spec needs to be generated.
+## Params : - the character to convert
+########
+sub to_type
+{
+ local ($char) = shift;
+ $char =~ tr/a-z/A-Z/;
+
+ return 'array' if ($char eq 'A');
+ return 'boolean' if ($char eq 'B');
+ return 'class' if ($char eq 'C');
+ return 'decimal' if ($char eq 'D');
+ return 'enumeration' if ($char eq 'E');
+ return 'floating point' if ($char eq 'F');
+ return 'signed integer' if ($char eq 'I');
+ # return 'generic package' if ($char eq 'K');
+ return 'block' if ($char eq 'L');
+ return 'modular integer' if ($char eq 'M');
+ return 'enumeration litteral' if ($char eq 'N');
+ return 'ordinary fixed point' if ($char eq 'O');
+ return 'access' if ($char eq 'P');
+ return 'label' if ($char eq 'Q');
+ return 'record' if ($char eq 'R');
+ return 'string' if ($char eq 'S');
+ return 'task' if ($char eq 'T');
+ return 'f' if ($char eq 'U');
+ return 'f' if ($char eq 'V');
+ return 'exception' if ($char eq 'X');
+ return 'entry' if ($char eq 'Y');
+ return "$char";
+}
+
+########
+## Changes a file name to be http compatible
+########
+sub http_string
+{
+ local ($str) = shift;
+ $str =~ s/\//__/g;
+ $str =~ s/\\/__/g;
+ $str =~ s/:/__/g;
+ $str =~ s/\./__/g;
+ return $str;
+}
+
+########
+## Creates the complete file-name, with directory
+## use the variables read in the .prj file
+## Params : - file name
+## RETURNS : the relative path_name to the file
+########
+sub get_real_file_name
+{
+ local ($filename) = shift;
+ local ($path) = $filename;
+
+ foreach (@src_dir)
+ {
+ if ( -r "$_$filename")
+ {
+ $path = "$_$filename";
+ last;
+ }
+ }
+
+ $path =~ s/^\.\///;
+ return $path if (substr ($path, 0, 1) ne '/');
+
+ ## We want to return relative paths only, so that the name of the HTML files
+ ## can easily be generated
+ local ($pwd) = `pwd`;
+ chop ($pwd);
+ local (@pwd) = split (/\//, $pwd);
+ local (@path) = split (/\//, $path);
+
+ while (@pwd)
+ {
+ if ($pwd [0] ne $path [0])
+ {
+ return '../' x ($#pwd + 1) . join ("/", @path);
+ }
+ shift @pwd;
+ shift @path;
+ }
+ return join ('/', @path);
+}
+
+########
+## Reads and parses .adp files
+## Params : - adp file name
+########
+sub parse_prj_file
+{
+ local ($filename) = shift;
+ local (@src) = ();
+ local (@obj) = ();
+
+ print "Parsing project file : $filename\n";
+
+ open (PRJ, $filename) || do { print " ... sorry, file not found\n";
+ return;
+ };
+ while (<PRJ>)
+ {
+ chop;
+ s/\/$//;
+ push (@src, $1 . "/") if (/^src_dir=(.*)/);
+ push (@obj, $1 . "/") if (/^obj_dir=(.*)/);
+ }
+ unshift (@src_dir, @src);
+ unshift (@obj_dir, @obj);
+ close (PRJ);
+}
+
+########
+## Finds a file in the search path
+## Params : - the name of the file
+## RETURNS : - the directory/file_name
+########
+sub find_file
+{
+ local ($filename) = shift;
+
+ foreach (@search_dir) {
+ if (-f "$_/$filename") {
+ return "$_/$filename";
+ }
+ }
+ return $filename;
+}
+
+########
+## Inserts a new reference in the list of references
+## Params: - Ref as it appears in the .ali file ($line$type$column)
+## - Current file for the reference
+## - Current offset to be added from the line (handling of
+## pragma Source_Reference)
+## - Current entity reference
+## Modifies: - %symbols_used
+########
+sub create_new_reference
+{
+ local ($ref) = shift;
+ local ($lastfile) = shift;
+ local ($offset) = shift;
+ local ($currentref) = shift;
+ local ($refline, $type, $refcol);
+
+ ## Do not generate references to the standard library files if we
+ ## do not generate the corresponding html files
+ return if (! $standard_library && $lastfile =~ /$standard_file_regexp/);
+
+ ($refline, $type, $extern, $refcol) = /(\d+)(.)(<[^>]+>)?(\d+)/;
+ $refline += $offset;
+
+ ## If we have a body, then we only generate the cross-reference from
+ ## the spec to the body if we have a subprogram (or a package)
+
+
+ if ($type eq "b")
+# && ($symbols {$currentref} eq 'f' || $symbols {$currentref} eq 'K'))
+ {
+ local ($cref_file, $cref) = ($currentref =~ /([^\#]+).$fileext\#(.+)/);
+
+ $symbols_used {"$cref_file#$cref"} = "$lastfile.$fileext#$refline\_$refcol";
+ $symbols_used {"$lastfile#$refline\_$refcol"} = $currentref;
+ $symbols {"$lastfile.$fileext#$refline\_$refcol"} = "body";
+ }
+
+ ## Do not generate cross-references for "e" and "t", since these point to the
+ ## semicolon that terminates the block -- irrelevant for gnathtml
+ ## "p" is also removed, since it is used for primitive subprograms
+ ## "d" is also removed, since it is used for discriminants
+ ## "i" is removed since it is used for implicit references
+ ## "z" is used for generic formals
+ ## "k" is for references to parent package
+ ## "=", "<", ">", "^" is for subprogram parameters
+
+ elsif ($type !~ /[eztpid=<>^k]/)
+ {
+ $symbols_used {"$lastfile#$refline\_$refcol"} = $currentref;
+ }
+}
+
+########
+## Parses the ali file associated with the current Ada file
+## Params : - the complete ali file name
+########
+sub parse_ali
+{
+ local ($filename) = shift;
+ local ($currentfile);
+ local ($currentref);
+ local ($lastfile);
+
+ # A file | line type column reference
+ local ($reference) = "(?:(?:\\d+\\|)?\\d+.\\d+|\\w+)";
+
+ # The following variable is used to represent the possible xref information
+ # output by GNAT when -gnatdM is used. It includes renaming references, and
+ # references to the parent type, as well as references to the generic parent
+
+ local ($typeref) = "(?:=$reference|<$reference>|\\{$reference\\}|\\($reference\\)|\\[$reference\\])?";
+
+ # The beginning of an entity declaration line in the ALI file
+ local ($decl_line) = "^(\\d+)(.)(\\d+)[ *]([\\w\\d.-]+|\"..?\")$typeref\\s+(\\S.*)?\$";
+
+ # Contains entries of the form [ filename source_reference_offset]
+ # Offset needs to be added to the lines read in the cross-references, and are
+ # used when the source comes from a gnatchop-ed file. See lib-write.ads, lines
+ # with ^D in the ALI file.
+ local (@reffiles) = ();
+
+ open (ALI, &find_file ($filename)) || do {
+ print "no ", &find_file ($filename), " file...\n";
+ return;
+ };
+ local (@ali) = <ALI>;
+ close (ALI);
+
+ undef %symbols;
+ undef %symbols_used;
+
+ foreach (@ali)
+ {
+ ## The format of D lines is
+ ## D source-name time-stamp checksum [subunit-name] line:file-name
+
+ if (/^D\s+([\w\d.-]+)\s+\S+ \S+(\s+\D[^: ]+)?( (\d+):(.*))?/)
+ {
+ # The offset will be added to each cross-reference line. If it is
+ # greater than 1, this means that we have a pragma Source_Reference,
+ # and this must not be counted in the xref information.
+ my ($file, $offset) = ($1, (defined $4) ? 2 - $4 : 0);
+
+ if ($dependencies)
+ {
+ push (@list_files, $1) unless (grep (/$file/, @list_files));
+ }
+ push (@reffiles, [&http_string (&get_real_file_name ($file)), $offset]);
+ }
+
+ elsif (/^X\s+(\d+)/)
+ {
+ $currentfile = $lastfile = $1 - 1;
+ }
+
+ elsif (defined $currentfile && /$decl_line/)
+ {
+ my ($line) = $1 + $reffiles[$currentfile][1];
+ next if (! $standard_library
+ && $reffiles[$currentfile][0] =~ /$standard_file_regexp/);
+ if ($xref_variable || $2 eq &uppercases ($2))
+ {
+ $currentref = $reffiles[$currentfile][0] . ".$fileext#$line\_$3";
+ $symbols {$currentref} = &to_type ($2);
+ $lastfile = $currentfile;
+
+ local ($endofline) = $5;
+
+ foreach (split (" ", $endofline))
+ {
+ (s/^(\d+)\|//) && do { $lastfile = $1 - 1; };
+ &create_new_reference
+ ($_, $reffiles[$lastfile][0],
+ $reffiles[$lastfile][1], $currentref);
+ }
+ }
+ else
+ {
+ $currentref = "";
+ }
+ }
+ elsif (/^\.\s(.*)/ && $reffiles[$currentfile][0] ne "" && $currentref ne "")
+ {
+ next if (! $standard_library
+ && $reffiles[$currentfile][0] =~ /$standard_file_regexp/);
+ foreach (split (" ", $1))
+ {
+ (s/^(\d+)\|//) && do { $lastfile = $1 - 1; };
+ &create_new_reference
+ ($_, $reffiles[$lastfile][0], $reffiles[$lastfile][1],
+ $currentref);
+ }
+ }
+ }
+}
+
+#########
+## Return the name of the ALI file to use for a given source
+## Params: - Name of the source file
+## return: Name and location of the ALI file
+#########
+
+sub ali_file_name {
+ local ($source) = shift;
+ local ($alifilename, $unitname);
+ local ($in_separate) = 0;
+
+ $source =~ s/\.ad[sb]$//;
+ $alifilename = $source;
+ $unitname = $alifilename;
+ $unitname =~ s/-/./g;
+
+ ## There are two reasons why we might not find the ALI file: either the
+ ## user did not generate them at all, or we are working on a separate unit.
+ ## Thus, we search in the parent's ALI file.
+
+ while ($alifilename ne "") {
+
+ ## Search in the object path
+ foreach (@obj_dir) {
+
+ ## Check if the ALI file does apply to the source file
+ ## We check the ^D lines, which have the following format:
+ ## D source-name time-stamp checksum [subunit-name] line:file-name
+
+ if (-r "$_$alifilename.ali") {
+ if ($in_separate) {
+ open (FILE, "$_$alifilename.ali");
+
+ if (grep (/^D \S+\s+\S+\s+\S+ $unitname/, <FILE>)) {
+ close FILE;
+ return "$_$alifilename.ali";
+
+ } else {
+ ## If the ALI file doesn't apply to the source file, we can
+ ## return now, since there won't be a parent ALI file above
+ ## anyway
+ close FILE;
+ return "$source.ali";
+ }
+ } else {
+ return "$_$alifilename.ali";
+ }
+ }
+ }
+
+ ## Get the parent's ALI file name
+
+ if (! ($alifilename =~ s/-[^-]+$//)) {
+ $alifilename = "";
+ }
+ $in_separate = 1;
+ }
+
+ return "$source.ali";
+}
+
+#########
+## Convert a path to an absolute path
+#########
+
+sub to_absolute
+{
+ local ($path) = shift;
+ local ($name, $suffix, $separator);
+ ($name,$path,$suffix) = fileparse ($path, ());
+ $path = &abs_path ($path);
+ $separator = substr ($path, 0, 1);
+ return $path . $separator . $name;
+}
+
+#########
+## This function outputs the html version of the file FILE
+## The output is send to FILE.htm.
+## Params : - Name of the file to convert (ends with .ads or .adb)
+#########
+sub output_file
+{
+ local ($filename_param) = shift;
+ local ($lineno) = 1;
+ local ($column);
+ local ($found);
+
+ local ($alifilename) = &ali_file_name ($filename_param);
+
+ $filename = &get_real_file_name ($filename_param);
+ $found = &find_file ($filename);
+
+ ## Read the whole file
+ open (FILE, $found) || do {
+ print $found, " not found ... skipping.\n";
+ return 0;
+ };
+ local (@file) = <FILE>;
+ close (FILE);
+
+ ## Parse the .ali file to find the cross-references
+ print "converting ", $filename, "\n";
+ &parse_ali ($alifilename);
+
+ ## Create and initialize the html file
+ open (OUTPUT, ">$output_dir/" . &http_string ($filename) . ".$fileext")
+ || die "Couldn't write $output_dir/" . &http_string ($filename)
+ . ".$fileext\n";
+
+ if ($absolute) {
+ print OUTPUT &create_header (&to_absolute ($found)), "\n";
+ } else {
+ print OUTPUT &create_header ($filename_param), "\n";
+ }
+
+ ## Print the file
+ $filename = &http_string ($filename);
+ foreach (@file)
+ {
+ local ($index);
+ local ($line) = $_;
+ local ($comment);
+
+ $column = 1;
+ chop ($line);
+
+ ## Print either the line number or a space if required
+ if ($line_numbers)
+ {
+ if ($lineno % $line_numbers == 0)
+ {
+ print OUTPUT &output_line_number ($lineno);
+ }
+ else
+ {
+ print OUTPUT &output_line_number (-1);
+ }
+ }
+
+ ## First, isolate any comment on the line
+ undef $comment;
+ $index = index ($line, '--');
+ if ($index != -1) {
+ $comment = substr ($line, $index + 2);
+ if ($index > 1)
+ {
+ $line = substr ($line, 0, $index);
+ }
+ else
+ {
+ undef $line;
+ }
+ }
+
+ ## Then print the line
+ if (defined $line)
+ {
+ $index = 0;
+ while ($index < length ($line))
+ {
+ local ($substring) = substr ($line, $index);
+
+ if ($substring =~ /^\t/)
+ {
+ print OUTPUT ' ' x ($tab_size - (($column - 1) % $tab_size));
+ $column += $tab_size - (($column - 1) % $tab_size);
+ $index ++;
+ }
+ elsif ($substring =~ /^(\w+)/
+ || $substring =~ /^("[^\"]*")/
+ || $substring =~ /^(\W)/)
+ {
+ local ($word) = $1;
+ $index += length ($word);
+
+ local ($lowercase) = $word;
+ $lowercase =~ tr/A-Z/a-z/;
+
+ if ($keywords{$lowercase})
+ {
+ print OUTPUT &output_keyword ($word);
+ }
+ elsif ($symbols {"$filename.$fileext#$lineno\_$column"})
+ {
+ ## A symbol can both have a link and be a reference for
+ ## another link, as is the case for bodies and
+ ## declarations
+
+ if ($symbols_used{"$filename#$lineno\_$column"})
+ {
+ print OUTPUT "<A HREF=\"",
+ $symbols_used{"$filename#$lineno\_$column"},
+ "\">", &protect_string ($word), "</A>";
+ print OUTPUT &output_symbol ('', $lineno, $column);
+ }
+ else
+ {
+ print OUTPUT &output_symbol ($word, $lineno, $column);
+ }
+
+ ## insert only functions into the global index
+
+ if ($symbols {"$filename.$fileext#$lineno\_$column"} eq 'f')
+ {
+ push (@{$global_index {$word}},
+ [$filename_param, $filename, $lineno, $column]);
+ }
+ }
+ elsif ($symbols_used{"$filename#$lineno\_$column"})
+ {
+ print OUTPUT "<A HREF=\"",
+ $symbols_used{"$filename#$lineno\_$column"},
+ "\">", &protect_string ($word), "</A>";
+ }
+ else
+ {
+ print OUTPUT &protect_string ($word);
+ }
+ $column += length ($word);
+ }
+ else
+ {
+ $index ++;
+ $column ++;
+ print OUTPUT &protect_string (substr ($substring, 0, 1));
+ }
+ }
+ }
+
+ ## Then output the comment
+ print OUTPUT &output_comment ($comment) if (defined $comment);
+ print OUTPUT "\n";
+
+ $lineno ++;
+ }
+
+ print OUTPUT &create_footer ($filename);
+ close (OUTPUT);
+ return 1;
+}
+
+#########
+## This function generates the global index
+#########
+sub create_index_file
+{
+ open (INDEX, ">$output_dir/index.$fileext") || die "couldn't write $output_dir/index.$fileext";
+
+ print INDEX <<"EOF";
+<HTML>
+<HEAD><TITLE>Source Browser</TITLE></HEAD>
+<FRAMESET COLS='250,*'>
+<NOFRAME>
+EOF
+ ;
+
+ local (@files) = &create_file_index;
+ print INDEX join ("\n", @files), "\n";
+
+ print INDEX "<HR>\n";
+ local (@functions) = &create_function_index;
+ print INDEX join ("\n", @functions), "\n";
+
+ print INDEX <<"EOF";
+</NOFRAME>
+<FRAMESET ROWS='50%,50%'>
+<FRAME NAME=files SRC=files.$fileext>
+<FRAME NAME=funcs SRC=funcs.$fileext>
+</FRAMESET>
+<FRAME NAME=main SRC=main.$fileext>
+</FRAMESET>
+</HTML>
+EOF
+ ;
+ close (INDEX);
+
+ open (MAIN, ">$output_dir/main.$fileext") || die "couldn't write $output_dir/main.$fileext";
+ print MAIN &create_header (""),
+ "<P ALIGN=right>",
+ "<A HREF=main.$fileext TARGET=_top>[No frame version is here]</A>",
+ "<P>",
+ join ("\n", @files), "\n<HR>",
+ join ("\n", @functions), "\n";
+
+ if ($dependencies) {
+ print MAIN "<HR>\n";
+ print MAIN "You should start your browsing with one of these files:\n";
+ print MAIN "<UL>\n";
+ foreach (@original_list) {
+ print MAIN "<LI><A HREF=", &http_string (&get_real_file_name ($_)),
+ ".$fileext>$_</A>\n";
+ }
+ }
+ print MAIN &create_footer ("");
+ close (MAIN);
+}
+
+#######
+## Convert to upper cases (did not exist in Perl 4)
+#######
+
+sub uppercases {
+ local ($tmp) = shift;
+ $tmp =~ tr/a-z/A-Z/;
+ return $tmp;
+}
+
+#######
+## This function generates the file_index
+## RETURN : - table with the html lines to be printed
+#######
+sub create_file_index
+{
+ local (@output) = ("<H2 ALIGN=CENTER>Files</H2>");
+
+
+ open (FILES, ">$output_dir/files.$fileext") || die "couldn't write $output_dir/files.$fileext";
+ print FILES &create_header (""), join ("\n", @output), "\n";
+
+
+ if ($#list_files > 20)
+ {
+ local ($last_letter) = '';
+ foreach (sort {&uppercases ($a) cmp &uppercases ($b)} @list_files)
+ {
+ next if ($_ eq "");
+ if (&uppercases (substr ($_, 0, 1)) ne $last_letter)
+ {
+ if ($last_letter ne '')
+ {
+ print INDEX_FILE "</UL></BODY></HTML>\n";
+ close (INDEX_FILE);
+ }
+ $last_letter = &uppercases (substr ($_, 0, 1));
+ open (INDEX_FILE, ">$output_dir/files/$last_letter.$fileext")
+ || die "couldn't write $output_dir/files/$last_letter.$fileext";
+ print INDEX_FILE <<"EOF";
+<HTML><HEAD><TITLE>$last_letter</TITLE></HEAD>
+<BODY>
+<H2>Files - $last_letter</H2>
+<A HREF=../files.$fileext TARGET=_self>[index]</A>
+<UL COMPACT TYPE=DISC>
+EOF
+ ;
+ local ($str) = "<A HREF=files/$last_letter.$fileext>[$last_letter]</A>";
+ push (@output, $str);
+ print FILES "$str\n";
+ }
+ print INDEX_FILE "<LI><A HREF=../",
+ &http_string (&get_real_file_name ($_)),
+ ".$fileext TARGET=main>$_</A>\n"; ## Problem with TARGET when in no_frame mode!
+ }
+
+ print INDEX_FILE "</UL></BODY></HTML>\n";
+ close INDEX_FILE;
+ }
+ else
+ {
+ push (@output, "<UL COMPACT TYPE=DISC>");
+ print FILES "<UL COMPACT TYPE=DISC>";
+ foreach (sort {&uppercases ($a) cmp &uppercases ($b)} @list_files)
+ {
+ next if ($_ eq "");
+ local ($ref) = &http_string (&get_real_file_name ($_));
+ push (@output, "<LI><A HREF=$ref.$fileext>$_</A>");
+ print FILES "<LI><A HREF=$ref.$fileext TARGET=main>$_</A>\n";
+ }
+ }
+
+ print FILES &create_footer ("");
+ close (FILES);
+
+ push (@output, "</UL>");
+ return @output;
+}
+
+#######
+## This function generates the function_index
+## RETURN : - table with the html lines to be printed
+#######
+sub create_function_index
+{
+ local (@output) = ("<H2 ALIGN=CENTER>Functions/Procedures</H2>");
+ local ($initial) = "";
+
+ open (FUNCS, ">$output_dir/funcs.$fileext") || die "couldn't write $output_dir/funcs.$fileext";
+ print FUNCS &create_header (""), join ("\n", @output), "\n";
+
+ ## If there are more than 20 entries, we just want to create some
+ ## submenus
+ if (scalar (keys %global_index) > 20)
+ {
+ local ($last_letter) = '';
+ foreach (sort {&uppercases ($a) cmp &uppercases ($b)} keys %global_index)
+ {
+ if (&uppercases (substr ($_, 0, 1)) ne $last_letter)
+ {
+ if ($last_letter ne '')
+ {
+ print INDEX_FILE "</UL></BODY></HTML>\n";
+ close (INDEX_FILE);
+ }
+
+ $last_letter = &uppercases (substr ($_, 0, 1));
+ $initial = $last_letter;
+ if ($initial eq '"')
+ {
+ $initial = "operators";
+ }
+ if ($initial ne '.')
+ {
+ open (INDEX_FILE, ">$output_dir/funcs/$initial.$fileext")
+ || die "couldn't write $output_dir/funcs/$initial.$fileext";
+ print INDEX_FILE <<"EOF";
+<HTML><HEAD><TITLE>$initial</TITLE></HEAD>
+<BODY>
+<H2>Functions - $initial</H2>
+<A HREF=../funcs.$fileext TARGET=_self>[index]</A>
+<UL COMPACT TYPE=DISC>
+EOF
+ ;
+ local ($str) = "<A HREF=funcs/$initial.$fileext>[$initial]</A>";
+ push (@output, $str);
+ print FUNCS "$str\n";
+ }
+ }
+ local ($ref);
+ local ($is_overloaded) = ($#{$global_index {$_}} > 0 ? 1 : 0);
+ foreach $ref (@{$global_index {$_}})
+ {
+ ($file, $full_file, $lineno, $column) = @{$ref};
+ local ($symbol) = ($is_overloaded ? "$_ - $file:$lineno" : $_);
+ print INDEX_FILE "<LI><A HREF=../$full_file.$fileext#$lineno\_$column TARGET=main>$symbol</A>";
+ }
+ }
+
+ print INDEX_FILE "</UL></BODY></HTML>\n";
+ close INDEX_FILE;
+ }
+ else
+ {
+ push (@output, "<UL COMPACT TYPE=DISC>");
+ print FUNCS "<UL COMPACT TYPE=DISC>";
+ foreach (sort {&uppercases ($a) cmp &uppercases ($b)} keys %global_index)
+ {
+ local ($ref);
+ local ($is_overloaded) = ($#{$global_index {$_}} > 0 ? 1 : 0);
+ foreach $ref (@{$global_index {$_}})
+ {
+ ($file, $full_file, $lineno, $column) = @{$ref};
+ local ($symbol) = ($is_overloaded ? "$_ - $file:$lineno" : $_);
+ push (@output, "<LI><A HREF=$full_file.$fileext#$lineno\_$column>$symbol</A>");
+ print FUNCS "<LI><A HREF=$full_file.$fileext#$lineno\_$column TARGET=main>$symbol</A>";
+ }
+ }
+ }
+
+ print FUNCS &create_footer ("");
+ close (FUNCS);
+
+ push (@output, "</UL>");
+ return (@output);
+}
+
+######
+## Main function
+######
+
+local ($index_file) = 0;
+
+mkdir ($output_dir, 0777) if (! -d $output_dir);
+mkdir ($output_dir."/files", 0777) if (! -d $output_dir."/files");
+mkdir ($output_dir."/funcs", 0777) if (! -d $output_dir."/funcs");
+
+&parse_prj_file ($prjfile) if ($prjfile);
+
+while ($index_file <= $#list_files)
+{
+ local ($file) = $list_files [$index_file];
+
+ if (&output_file ($file) == 0)
+ {
+ $list_files [$index_file] = "";
+ }
+ $index_file ++;
+}
+&create_index_file;
+
+$indexfile = "$output_dir/index.$fileext";
+$indexfile =~ s!//!/!g;
+print "You can now download the $indexfile file to see the ",
+ "created pages\n";
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 85dd22e8bb3..006da96b2b7 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -340,12 +340,8 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* ??? The warning machinery is outsmarted by Ada. */
warn_unused_parameter = 0;
- flag_inline_trees = 1;
-
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* Force eliminate_unused_debug_types to 0 unless an explicit positive
-f has been passed. This forces the default to 0 for Ada, which might
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index bb25ea631d1..e2662e14f23 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -35,6 +35,7 @@
#ifdef IN_RTS
#include "tconfig.h"
+#include "tsystem.h"
/* In the top-of-tree GCC, tconfig does not include tm.h, but in GCC 3.2
it does. To avoid branching raise.c just for that purpose, we kludge by
looking for a symbol always defined by tm.h and if it's not defined,
@@ -43,7 +44,6 @@
#include "coretypes.h"
#include "tm.h"
#endif
-#include "tsystem.h"
#include <sys/stat.h>
#include <stdarg.h>
typedef char bool;
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 27825595885..4668fa21c36 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2217,8 +2217,7 @@ end_subprog_body (tree body)
/* Deal with inline. If declared inline or we should default to inline,
set the flag in the decl. */
- DECL_INLINE (fndecl)
- = DECL_DECLARED_INLINE_P (fndecl) || flag_inline_trees == 2;
+ DECL_INLINE (fndecl) = 1;
/* We handle pending sizes via the elaboration of types, so we don't
need to save them. */
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 3c60e8bd967..ba6a9e294c8 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "langhooks.h"
#include "hashtab.h"
+#include "c-common.h"
static void init_attributes (void);
@@ -232,6 +233,41 @@ decl_attributes (tree *node, tree attributes, int flags)
if (!attributes_initialized)
init_attributes ();
+ /* If this is a function and the user used #pragma GCC optimize, add the
+ options to the attribute((optimize(...))) list. */
+ if (TREE_CODE (*node) == FUNCTION_DECL && current_optimize_pragma)
+ {
+ tree cur_attr = lookup_attribute ("optimize", attributes);
+ tree opts = copy_list (current_optimize_pragma);
+
+ if (! cur_attr)
+ attributes
+ = tree_cons (get_identifier ("optimize"), opts, attributes);
+ else
+ TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr));
+ }
+
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ && optimization_current_node != optimization_default_node
+ && !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node))
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node) = optimization_current_node;
+
+ /* If this is a function and the user used #pragma GCC option, add the
+ options to the attribute((option(...))) list. */
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ && current_option_pragma
+ && targetm.target_option.valid_attribute_p (*node, NULL_TREE,
+ current_option_pragma, 0))
+ {
+ tree cur_attr = lookup_attribute ("option", attributes);
+ tree opts = copy_list (current_option_pragma);
+
+ if (! cur_attr)
+ attributes = tree_cons (get_identifier ("option"), opts, attributes);
+ else
+ TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr));
+ }
+
targetm.insert_attributes (*node, &attributes);
for (a = attributes; a; a = TREE_CHAIN (a))
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 7119dab8b71..01c6b1fca65 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -98,8 +98,8 @@ static rtx expand_builtin_mathfn_3 (tree, rtx, rtx);
static rtx expand_builtin_interclass_mathfn (tree, rtx, rtx);
static rtx expand_builtin_sincos (tree);
static rtx expand_builtin_cexpi (tree, rtx, rtx);
-static rtx expand_builtin_int_roundingfn (tree, rtx, rtx);
-static rtx expand_builtin_int_roundingfn_2 (tree, rtx, rtx);
+static rtx expand_builtin_int_roundingfn (tree, rtx);
+static rtx expand_builtin_int_roundingfn_2 (tree, rtx);
static rtx expand_builtin_args_info (tree);
static rtx expand_builtin_next_arg (void);
static rtx expand_builtin_va_start (tree);
@@ -2477,11 +2477,10 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
do not need to worry about setting errno to EDOM.
If expanding via optab fails, lower expression to (int)(floor(x)).
EXP is the expression that is a call to the builtin function;
- if convenient, the result should be placed in TARGET. SUBTARGET may
- be used as the target for computing one of EXP's operands. */
+ if convenient, the result should be placed in TARGET. */
static rtx
-expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget)
+expand_builtin_int_roundingfn (tree exp, rtx target)
{
convert_optab builtin_optab;
rtx op0, insns, tmp;
@@ -2524,7 +2523,7 @@ expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget)
side-effects more the once. */
CALL_EXPR_ARG (exp, 0) = arg = builtin_save_expr (arg);
- op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
+ op0 = expand_expr (arg, NULL, VOIDmode, EXPAND_NORMAL);
start_sequence ();
@@ -2605,11 +2604,10 @@ expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget)
conversion (lrint).
Return 0 if a normal call should be emitted rather than expanding the
function in-line. EXP is the expression that is a call to the builtin
- function; if convenient, the result should be placed in TARGET.
- SUBTARGET may be used as the target for computing one of EXP's operands. */
+ function; if convenient, the result should be placed in TARGET. */
static rtx
-expand_builtin_int_roundingfn_2 (tree exp, rtx target, rtx subtarget)
+expand_builtin_int_roundingfn_2 (tree exp, rtx target)
{
convert_optab builtin_optab;
rtx op0, insns;
@@ -2648,7 +2646,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target, rtx subtarget)
side-effects more the once. */
CALL_EXPR_ARG (exp, 0) = arg = builtin_save_expr (arg);
- op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
+ op0 = expand_expr (arg, NULL, VOIDmode, EXPAND_NORMAL);
start_sequence ();
@@ -6220,7 +6218,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
CASE_FLT_FN (BUILT_IN_LLCEIL):
CASE_FLT_FN (BUILT_IN_LFLOOR):
CASE_FLT_FN (BUILT_IN_LLFLOOR):
- target = expand_builtin_int_roundingfn (exp, target, subtarget);
+ target = expand_builtin_int_roundingfn (exp, target);
if (target)
return target;
break;
@@ -6229,7 +6227,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
CASE_FLT_FN (BUILT_IN_LLRINT):
CASE_FLT_FN (BUILT_IN_LROUND):
CASE_FLT_FN (BUILT_IN_LLROUND):
- target = expand_builtin_int_roundingfn_2 (exp, target, subtarget);
+ target = expand_builtin_int_roundingfn_2 (exp, target);
if (target)
return target;
break;
@@ -7263,7 +7261,7 @@ fold_builtin_inf (tree type, int warn)
Thus we pedwarn to ensure this constraint violation is
diagnosed. */
if (!MODE_HAS_INFINITIES (TYPE_MODE (type)) && warn)
- pedwarn ("target format does not support infinity");
+ pedwarn (0, "target format does not support infinity");
real_inf (&real);
return build_real (type, real);
diff --git a/gcc/c-common.c b/gcc/c-common.c
index cc13e056fd5..c9ffd9c9aa3 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -574,6 +574,8 @@ static tree handle_warn_unused_result_attribute (tree *, tree, tree, int,
static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *);
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
static tree handle_alloc_size_attribute (tree *, tree, tree, int, bool *);
+static tree handle_option_attribute (tree *, tree, tree, int, bool *);
+static tree handle_optimize_attribute (tree *, tree, tree, int, bool *);
static void check_function_nonnull (tree, int, tree *);
static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT);
@@ -857,6 +859,10 @@ const struct attribute_spec c_common_attribute_table[] =
handle_error_attribute },
{ "error", 1, 1, true, false, false,
handle_error_attribute },
+ { "option", 1, -1, true, false, false,
+ handle_option_attribute },
+ { "optimize", 1, -1, true, false, false,
+ handle_optimize_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -1041,7 +1047,7 @@ fname_decl (unsigned int rid, tree id)
input_location = saved_location;
}
if (!ix && !current_function_decl)
- pedwarn ("%qD is not defined outside of function scope", decl);
+ pedwarn (0, "%qD is not defined outside of function scope", decl);
return decl;
}
@@ -1090,7 +1096,8 @@ fix_string_type (tree value)
separate the %d from the 'C'. 'ISO' should not be
translated, but it may be moved after 'C%d' in languages
where modifiers follow nouns. */
- pedwarn ("string length %qd is greater than the length %qd "
+ pedwarn (OPT_Woverlength_strings,
+ "string length %qd is greater than the length %qd "
"ISO C%d compilers are required to support",
nchars - 1, nchars_max, relevant_std);
}
@@ -1137,7 +1144,7 @@ constant_expression_warning (tree value)
|| TREE_CODE (value) == VECTOR_CST
|| TREE_CODE (value) == COMPLEX_CST)
&& TREE_OVERFLOW (value))
- pedwarn ("overflow in constant expression");
+ pedwarn (OPT_Woverflow, "overflow in constant expression");
}
/* The same as above but print an unconditional error. */
@@ -1355,7 +1362,7 @@ check_main_parameter_types (tree decl)
{
case 1:
if (TYPE_MAIN_VARIANT (type) != integer_type_node)
- pedwarn ("first argument of %q+D should be %<int%>", decl);
+ pedwarn (0, "first argument of %q+D should be %<int%>", decl);
break;
case 2:
@@ -1363,8 +1370,8 @@ check_main_parameter_types (tree decl)
|| TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
- pedwarn ("second argument of %q+D should be %<char **%>",
- decl);
+ pedwarn (0, "second argument of %q+D should be %<char **%>",
+ decl);
break;
case 3:
@@ -1372,8 +1379,8 @@ check_main_parameter_types (tree decl)
|| TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
- pedwarn ("third argument of %q+D should probably be "
- "%<char **%>", decl);
+ pedwarn (0, "third argument of %q+D should probably be "
+ "%<char **%>", decl);
break;
}
}
@@ -1382,7 +1389,7 @@ check_main_parameter_types (tree decl)
argument because it's only mentioned in an appendix of the
standard. */
if (argct > 0 && (argct < 2 || argct > 3))
- pedwarn ("%q+D takes only zero or two arguments", decl);
+ pedwarn (0, "%q+D takes only zero or two arguments", decl);
}
/* True if pointers to distinct types T1 and T2 can be converted to
@@ -3073,20 +3080,20 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
- if (pedantic || warn_pointer_arith)
- pedwarn ("pointer of type %<void *%> used in arithmetic");
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer of type %<void *%> used in arithmetic");
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE)
{
- if (pedantic || warn_pointer_arith)
- pedwarn ("pointer to a function used in arithmetic");
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer to a function used in arithmetic");
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == METHOD_TYPE)
{
- if (pedantic || warn_pointer_arith)
- pedwarn ("pointer to member function used in arithmetic");
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer to member function used in arithmetic");
size_exp = integer_one_node;
}
else
@@ -3594,7 +3601,8 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
if (is_sizeof)
{
if (complain && (pedantic || warn_pointer_arith))
- pedwarn ("invalid application of %<sizeof%> to a function type");
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "invalid application of %<sizeof%> to a function type");
else if (!complain)
return error_mark_node;
value = size_one_node;
@@ -3606,7 +3614,8 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
{
if (type_code == VOID_TYPE
&& complain && (pedantic || warn_pointer_arith))
- pedwarn ("invalid application of %qs to a void type", op_name);
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "invalid application of %qs to a void type", op_name);
else if (!complain)
return error_mark_node;
value = size_one_node;
@@ -4472,8 +4481,9 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type,
}
/* Case ranges are a GNU extension. */
- if (high_value && pedantic)
- pedwarn ("range expressions in switch statements are non-standard");
+ if (high_value)
+ pedwarn (OPT_pedantic,
+ "range expressions in switch statements are non-standard");
type = TREE_TYPE (cond);
if (low_value)
@@ -4786,8 +4796,7 @@ finish_label_address_expr (tree label)
{
tree result;
- if (pedantic)
- pedwarn ("taking the address of a label is non-standard");
+ pedwarn (OPT_pedantic, "taking the address of a label is non-standard");
if (label == error_mark_node)
return error_mark_node;
@@ -5027,7 +5036,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
static tree
handle_hot_attribute (tree *node, tree name, tree ARG_UNUSED (args),
- int ARG_UNUSED (flags), bool *no_add_attrs)
+ int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
{
@@ -5037,8 +5046,34 @@ handle_hot_attribute (tree *node, tree name, tree ARG_UNUSED (args),
name, "cold");
*no_add_attrs = true;
}
- /* Do nothing else, just set the attribute. We'll get at
- it later with lookup_attribute. */
+ else
+ {
+ tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
+
+ /* If we are not at -O3, but are optimizing, turn on -O3
+ optimizations just for this one function. */
+ if (((optimize > 0 && optimize < 3) || optimize_size)
+ && targetm.target_option.hot_attribute_sets_optimization
+ && (!old_opts || old_opts == optimization_default_node))
+ {
+ /* Create the hot optimization node if needed. */
+ if (!optimization_hot_node)
+ {
+ struct cl_optimization current_options;
+ static const char *os_argv[] = { NULL, "-O3", NULL };
+
+ cl_optimization_save (&current_options);
+ decode_options (2, os_argv);
+ optimization_hot_node = build_optimization_node ();
+ cl_optimization_restore (&current_options);
+ }
+
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
+ = optimization_hot_node;
+ }
+ /* Most of the rest of the hot processing is done later with
+ lookup_attribute. */
+ }
}
else
{
@@ -5063,8 +5098,34 @@ handle_cold_attribute (tree *node, tree name, tree ARG_UNUSED (args),
name, "hot");
*no_add_attrs = true;
}
- /* Do nothing else, just set the attribute. We'll get at
- it later with lookup_attribute. */
+ else
+ {
+ tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
+
+ /* If we are optimizing, but not optimizing for space, turn on -Os
+ optimizations just for this one function. */
+ if (optimize && !optimize_size
+ && targetm.target_option.cold_attribute_sets_optimization
+ && (!old_opts || old_opts == optimization_default_node))
+ {
+ /* Create the cold optimization node if needed. */
+ if (!optimization_cold_node)
+ {
+ struct cl_optimization current_options;
+ static const char *os_argv[] = { NULL, "-Os", NULL };
+
+ cl_optimization_save (&current_options);
+ decode_options (2, os_argv);
+ optimization_cold_node = build_optimization_node ();
+ cl_optimization_restore (&current_options);
+ }
+
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
+ = optimization_cold_node;
+ }
+ /* Most of the rest of the cold processing is done later with
+ lookup_attribute. */
+ }
}
else
{
@@ -6762,6 +6823,186 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
return NULL_TREE;
}
+
+/* For handling "option" attribute. arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_option_attribute (tree *node, tree name, tree args, int flags,
+ bool *no_add_attrs)
+{
+ /* Ensure we have a function type. */
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+ else if (targetm.target_option.valid_attribute_p
+ == default_target_option_valid_attribute_p)
+ {
+ warning (OPT_Wattributes,
+ "%qE attribute is not supported on this machine",
+ name);
+ *no_add_attrs = true;
+ }
+ else if (! targetm.target_option.valid_attribute_p (*node, name, args,
+ flags))
+ *no_add_attrs = true;
+
+ return NULL_TREE;
+}
+
+/* Arguments being collected for optimization. */
+typedef const char *const_char_p; /* For DEF_VEC_P. */
+DEF_VEC_P(const_char_p);
+DEF_VEC_ALLOC_P(const_char_p, gc);
+static GTY(()) VEC(const_char_p, gc) *optimize_args;
+
+
+/* Inner function to convert a TREE_LIST to argv string to parse the optimize
+ options in ARGS. ATTR_P is true if this is for attribute(optimize), and
+ false for #pragma GCC optimize. */
+
+bool
+parse_optimize_options (tree args, bool attr_p)
+{
+ bool ret = true;
+ unsigned opt_argc;
+ unsigned i;
+ const char **opt_argv;
+ tree ap;
+
+ /* Build up argv vector. Just in case the string is stored away, use garbage
+ collected strings. */
+ VEC_truncate (const_char_p, optimize_args, 0);
+ VEC_safe_push (const_char_p, gc, optimize_args, NULL);
+
+ for (ap = args; ap != NULL_TREE; ap = TREE_CHAIN (ap))
+ {
+ tree value = TREE_VALUE (ap);
+
+ if (TREE_CODE (value) == INTEGER_CST)
+ {
+ char buffer[20];
+ sprintf (buffer, "-O%ld", (long) TREE_INT_CST_LOW (value));
+ VEC_safe_push (const_char_p, gc, optimize_args, ggc_strdup (buffer));
+ }
+
+ else if (TREE_CODE (value) == STRING_CST)
+ {
+ /* Split string into multiple substrings. */
+ size_t len = TREE_STRING_LENGTH (value);
+ char *p = ASTRDUP (TREE_STRING_POINTER (value));
+ char *end = p + len;
+ char *comma;
+ char *next_p = p;
+
+ while (next_p != NULL)
+ {
+ size_t len2;
+ char *q, *r;
+
+ p = next_p;
+ comma = strchr (p, ',');
+ if (comma)
+ {
+ len2 = comma - p;
+ *comma = '\0';
+ next_p = comma+1;
+ }
+ else
+ {
+ len2 = end - p;
+ next_p = NULL;
+ }
+
+ r = q = (char *) ggc_alloc (len2 + 3);
+
+ /* If the user supplied -Oxxx or -fxxx, only allow -Oxxx or -fxxx
+ options. */
+ if (*p == '-' && p[1] != 'O' && p[1] != 'f')
+ {
+ ret = false;
+ if (attr_p)
+ warning (OPT_Wattributes,
+ "Bad option %s to optimize attribute.", p);
+ else
+ warning (OPT_Wpragmas,
+ "Bad option %s to pragma attribute", p);
+ continue;
+ }
+
+ if (*p != '-')
+ {
+ *r++ = '-';
+
+ /* Assume that Ox is -Ox, a numeric value is -Ox, a s by
+ itself is -Os, and any other switch begins with a -f. */
+ if ((*p >= '0' && *p <= '9')
+ || (p[0] == 's' && p[1] == '\0'))
+ *r++ = 'O';
+ else if (*p != 'O')
+ *r++ = 'f';
+ }
+
+ memcpy (r, p, len2);
+ r[len2] = '\0';
+ VEC_safe_push (const_char_p, gc, optimize_args, q);
+ }
+
+ }
+ }
+
+ opt_argc = VEC_length (const_char_p, optimize_args);
+ opt_argv = (const char **) alloca (sizeof (char *) * (opt_argc + 1));
+
+ for (i = 1; i < opt_argc; i++)
+ opt_argv[i] = VEC_index (const_char_p, optimize_args, i);
+
+ /* Now parse the options. */
+ decode_options (opt_argc, opt_argv);
+
+ VEC_truncate (const_char_p, optimize_args, 0);
+ return ret;
+}
+
+/* For handling "optimize" attribute. arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_optimize_attribute (tree *node, tree name, tree args,
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+{
+ /* Ensure we have a function type. */
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+ else
+ {
+ struct cl_optimization cur_opts;
+ tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
+
+ /* Save current options. */
+ cl_optimization_save (&cur_opts);
+
+ /* If we previously had some optimization options, use them as the
+ default. */
+ if (old_opts)
+ cl_optimization_restore (TREE_OPTIMIZATION (old_opts));
+
+ /* Parse options, and update the vector. */
+ parse_optimize_options (args, true);
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
+ = build_optimization_node ();
+
+ /* Restore current options. */
+ cl_optimization_restore (&cur_opts);
+ }
+
+ return NULL_TREE;
+}
/* Check for valid arguments being passed to a function.
ATTRS is a list of attributes. There are NARGS arguments in the array
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 486fdeb8811..9850dfa94d0 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -870,6 +870,7 @@ extern tree c_staticp (tree);
extern void init_c_lex (void);
extern void c_cpp_builtins (cpp_reader *);
+extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree);
/* Positive if an implicit `extern "C"' scope has just been entered;
negative if such a scope has just been exited. */
@@ -925,7 +926,6 @@ extern void warn_about_parentheses (enum tree_code, enum tree_code,
extern void warn_for_unused_label (tree label);
extern void warn_for_div_by_zero (tree divisor);
-
/* In c-gimplify.c */
extern void c_genericize (tree);
extern int c_gimplify_expr (tree *, tree *, tree *);
@@ -944,6 +944,8 @@ extern void c_common_print_pch_checksum (FILE *f);
/* In *-checksum.c */
extern const unsigned char executable_checksum[16];
+/* In c-cppbuiltin.c */
+extern void builtin_define_std (const char *macro);
extern void builtin_define_with_value (const char *, const char *, int);
extern void c_stddef_cpp_builtins (void);
extern void fe_file_change (const struct line_map *);
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 82bd5c27313..57d00580d24 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -405,6 +405,58 @@ builtin_define_stdint_macros (void)
builtin_define_type_max ("__INTMAX_MAX__", intmax_type_node, intmax_long);
}
+/* Adjust the optimization macros when a #pragma GCC optimization is done to
+ reflect the current level. */
+void
+c_cpp_builtins_optimize_pragma (cpp_reader *pfile, tree prev_tree,
+ tree cur_tree)
+{
+ struct cl_optimization *prev = TREE_OPTIMIZATION (prev_tree);
+ struct cl_optimization *cur = TREE_OPTIMIZATION (cur_tree);
+ bool prev_fast_math;
+ bool cur_fast_math;
+
+ /* -undef turns off target-specific built-ins. */
+ if (flag_undef)
+ return;
+
+ /* Other target-independent built-ins determined by command-line
+ options. */
+ if (!prev->optimize_size && cur->optimize_size)
+ cpp_define (pfile, "__OPTIMIZE_SIZE__");
+ else if (prev->optimize_size && !cur->optimize_size)
+ cpp_undef (pfile, "__OPTIMIZE_SIZE__");
+
+ if (!prev->optimize && cur->optimize)
+ cpp_define (pfile, "__OPTIMIZE__");
+ else if (prev->optimize && !cur->optimize)
+ cpp_undef (pfile, "__OPTIMIZE__");
+
+ prev_fast_math = fast_math_flags_struct_set_p (prev);
+ cur_fast_math = fast_math_flags_struct_set_p (cur);
+ if (!prev_fast_math && cur_fast_math)
+ cpp_define (pfile, "__FAST_MATH__");
+ else if (prev_fast_math && !cur_fast_math)
+ cpp_undef (pfile, "__FAST_MATH__");
+
+ if (!prev->flag_signaling_nans && cur->flag_signaling_nans)
+ cpp_define (pfile, "__SUPPORT_SNAN__");
+ else if (prev->flag_signaling_nans && !cur->flag_signaling_nans)
+ cpp_undef (pfile, "__SUPPORT_SNAN__");
+
+ if (!prev->flag_finite_math_only && cur->flag_finite_math_only)
+ {
+ cpp_undef (pfile, "__FINITE_MATH_ONLY__");
+ cpp_define (pfile, "__FINITE_MATH_ONLY__=1");
+ }
+ else if (!prev->flag_finite_math_only && cur->flag_finite_math_only)
+ {
+ cpp_undef (pfile, "__FINITE_MATH_ONLY__");
+ cpp_define (pfile, "__FINITE_MATH_ONLY__=0");
+ }
+}
+
+
/* Hook that registers front end and target-specific built-ins. */
void
c_cpp_builtins (cpp_reader *pfile)
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4815797e564..dd5f1ea0888 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -786,7 +786,7 @@ pop_scope (void)
&& TREE_PUBLIC (p)
&& !DECL_INITIAL (p)
&& !flag_gnu89_inline)
- pedwarn ("inline function %q+D declared but never defined", p);
+ pedwarn (0, "inline function %q+D declared but never defined", p);
goto common_symbol;
@@ -1223,7 +1223,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& TYPE_MAIN_VARIANT (TREE_TYPE (newtype)) == integer_type_node
&& C_FUNCTION_IMPLICIT_INT (newdecl) && !DECL_INITIAL (olddecl))
{
- pedwarn ("conflicting types for %q+D", newdecl);
+ pedwarn (0, "conflicting types for %q+D", newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (newdecl) = *newtypep = newtype = oldtype;
C_FUNCTION_IMPLICIT_INT (newdecl) = 0;
@@ -1236,7 +1236,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& TYPE_MAIN_VARIANT (TREE_TYPE (oldtype)) == integer_type_node
&& C_DECL_IMPLICIT (olddecl) && !DECL_INITIAL (olddecl))
{
- pedwarn ("conflicting types for %q+D", newdecl);
+ pedwarn (0, "conflicting types for %q+D", newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (olddecl) = *oldtypep = oldtype = newtype;
pedwarned = true;
@@ -1515,30 +1515,6 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
"noinline follows inline declaration ", newdecl);
warned = true;
}
-
- /* Inline declaration after use or definition.
- ??? Should we still warn about this now we have unit-at-a-time
- mode and can get it right?
- Definitely don't complain if the decls are in different translation
- units.
- C99 permits this, so don't warn in that case. (The function
- may not be inlined everywhere in function-at-a-time mode, but
- we still shouldn't warn.) */
- if (DECL_DECLARED_INLINE_P (newdecl) && !DECL_DECLARED_INLINE_P (olddecl)
- && same_translation_unit_p (olddecl, newdecl)
- && flag_gnu89_inline)
- {
- if (TREE_USED (olddecl))
- {
- warning (0, "%q+D declared inline after being called", olddecl);
- warned = true;
- }
- else if (DECL_INITIAL (olddecl))
- {
- warning (0, "%q+D declared inline after its definition", olddecl);
- warned = true;
- }
- }
}
else /* PARM_DECL, VAR_DECL */
{
@@ -1588,7 +1564,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
/* Report location of previous decl/defn in a consistent manner. */
if (warned || pedwarned)
- locate_old_decl (olddecl, pedwarned ? pedwarn : warning0);
+ locate_old_decl (olddecl, pedwarned ? pedwarn0 : warning0);
#undef DECL_EXTERN_INLINE
@@ -1686,17 +1662,11 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS)
&& DECL_IN_SYSTEM_HEADER (olddecl)
&& !DECL_IN_SYSTEM_HEADER (newdecl) )
- {
- DECL_IN_SYSTEM_HEADER (newdecl) = 1;
- DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
- }
+ DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
else if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS)
&& DECL_IN_SYSTEM_HEADER (newdecl)
&& !DECL_IN_SYSTEM_HEADER (olddecl))
- {
- DECL_IN_SYSTEM_HEADER (olddecl) = 1;
- DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (newdecl);
- }
+ DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (newdecl);
else if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
|| (old_is_prototype && !new_is_prototype
&& !C_DECL_BUILTIN_PROTOTYPE (olddecl)))
@@ -1807,9 +1777,9 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (new_is_definition && DECL_INITIAL (olddecl))
{
if (TREE_USED (olddecl)
- /* In unit-at-a-time mode we never inline re-defined extern
- inline functions. */
- && !flag_unit_at_a_time
+ /* We never inline re-defined extern inline functions.
+ FIXME: This would be better handled by keeping both functions
+ as separate declarations. */
&& cgraph_function_possibly_inlined_p (olddecl))
(*debug_hooks->outlining_inline_function) (olddecl);
@@ -1848,6 +1818,17 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
= C_DECL_BUILTIN_PROTOTYPE (olddecl);
}
+ /* Preserve function specific target and optimization options */
+ if (DECL_FUNCTION_SPECIFIC_TARGET (olddecl)
+ && !DECL_FUNCTION_SPECIFIC_TARGET (newdecl))
+ DECL_FUNCTION_SPECIFIC_TARGET (newdecl)
+ = DECL_FUNCTION_SPECIFIC_TARGET (olddecl);
+
+ if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl)
+ && !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl))
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl)
+ = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl);
+
/* Also preserve various other info from the definition. */
if (!new_is_definition)
{
@@ -2351,7 +2332,8 @@ implicit_decl_warning (tree id, tree olddecl)
if (warn_implicit_function_declaration)
{
if (flag_isoc99)
- pedwarn (G_("implicit declaration of function %qE"), id);
+ pedwarn (OPT_Wimplicit_function_declaration,
+ G_("implicit declaration of function %qE"), id);
else
warning (OPT_Wimplicit_function_declaration,
G_("implicit declaration of function %qE"), id);
@@ -2903,7 +2885,7 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (warned != 1 && code != ENUMERAL_TYPE)
/* Empty unnamed enum OK */
{
- pedwarn ("unnamed struct/union that defines no instances");
+ pedwarn (0, "unnamed struct/union that defines no instances");
warned = 1;
}
}
@@ -2911,8 +2893,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
&& declspecs->storage_class != csc_none)
{
if (warned != 1)
- pedwarn ("empty declaration with storage class specifier "
- "does not redeclare tag");
+ pedwarn (0, "empty declaration with storage class specifier "
+ "does not redeclare tag");
warned = 1;
pending_xref_error ();
}
@@ -2922,8 +2904,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
|| declspecs->restrict_p))
{
if (warned != 1)
- pedwarn ("empty declaration with type qualifier "
- "does not redeclare tag");
+ pedwarn (0, "empty declaration with type qualifier "
+ "does not redeclare tag");
warned = 1;
pending_xref_error ();
}
@@ -2943,14 +2925,14 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
{
if (warned != 1 && !in_system_header)
{
- pedwarn ("useless type name in empty declaration");
+ pedwarn (0, "useless type name in empty declaration");
warned = 1;
}
}
}
else if (warned != 1 && !in_system_header && declspecs->typedef_p)
{
- pedwarn ("useless type name in empty declaration");
+ pedwarn (0, "useless type name in empty declaration");
warned = 1;
}
@@ -2997,7 +2979,7 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (warned != 1)
{
if (!found_tag)
- pedwarn ("empty declaration");
+ pedwarn (0, "empty declaration");
}
}
@@ -3060,13 +3042,13 @@ build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p,
}
declarator->u.array.static_p = static_p;
declarator->u.array.vla_unspec_p = vla_unspec_p;
- if (pedantic && !flag_isoc99)
+ if (!flag_isoc99)
{
if (static_p || quals != NULL)
- pedwarn ("ISO C90 does not support %<static%> or type "
+ pedwarn (OPT_pedantic, "ISO C90 does not support %<static%> or type "
"qualifiers in parameter array declarators");
if (vla_unspec_p)
- pedwarn ("ISO C90 does not support %<[*]%> array declarators");
+ pedwarn (OPT_pedantic, "ISO C90 does not support %<[*]%> array declarators");
}
if (vla_unspec_p)
{
@@ -3322,8 +3304,8 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
&& !TREE_READONLY (decl)
&& DECL_DECLARED_INLINE_P (current_function_decl)
&& DECL_EXTERNAL (current_function_decl))
- pedwarn ("%q+D is static but declared in inline function %qD "
- "which is not static", decl, current_function_decl);
+ pedwarn (0, "%q+D is static but declared in inline function %qD "
+ "which is not static", decl, current_function_decl);
/* Add this decl to the current scope.
TEM may equal DECL or it may be a previous decl of the same name. */
@@ -3612,10 +3594,6 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
}
}
- /* If this was marked 'used', be sure it will be output. */
- if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- mark_decl_referenced (decl);
-
if (TREE_CODE (decl) == TYPE_DECL)
{
if (!DECL_FILE_SCOPE_P (decl)
@@ -3700,7 +3678,7 @@ mark_forward_parm_decls (void)
if (pedantic && !current_scope->warned_forward_parm_decls)
{
- pedwarn ("ISO C forbids forward parameter declarations");
+ pedwarn (OPT_pedantic, "ISO C forbids forward parameter declarations");
current_scope->warned_forward_parm_decls = true;
}
@@ -3847,12 +3825,11 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
}
type_mv = TYPE_MAIN_VARIANT (*type);
- if (pedantic
- && !in_system_header
+ if (!in_system_header
&& type_mv != integer_type_node
&& type_mv != unsigned_type_node
&& type_mv != boolean_type_node)
- pedwarn ("type of bit-field %qs is a GCC extension", name);
+ pedwarn (OPT_pedantic, "type of bit-field %qs is a GCC extension", name);
max_width = TYPE_PRECISION (*type);
@@ -3882,28 +3859,27 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
static void
warn_variable_length_array (const char *name, tree size)
{
- int ped = !flag_isoc99 && pedantic && warn_vla != 0;
int const_size = TREE_CONSTANT (size);
- if (ped)
+ if (!flag_isoc99 && pedantic && warn_vla != 0)
{
if (const_size)
{
if (name)
- pedwarn ("ISO C90 forbids array %qs whose size "
+ pedwarn (OPT_Wvla, "ISO C90 forbids array %qs whose size "
"can%'t be evaluated",
name);
else
- pedwarn ("ISO C90 forbids array whose size "
+ pedwarn (OPT_Wvla, "ISO C90 forbids array whose size "
"can%'t be evaluated");
}
else
{
if (name)
- pedwarn ("ISO C90 forbids variable length array %qs",
+ pedwarn (OPT_Wvla, "ISO C90 forbids variable length array %qs",
name);
else
- pedwarn ("ISO C90 forbids variable length array");
+ pedwarn (OPT_Wvla, "ISO C90 forbids variable length array");
}
}
else if (warn_vla > 0)
@@ -4064,8 +4040,9 @@ grokdeclarator (const struct c_declarator *declarator,
if ((warn_implicit_int || warn_return_type || flag_isoc99)
&& funcdef_flag)
warn_about_return_type = 1;
- else if (warn_implicit_int || flag_isoc99)
- pedwarn_c99 ("type defaults to %<int%> in declaration of %qs", name);
+ else
+ pedwarn_c99 (flag_isoc99 ? 0 : OPT_Wimplicit_int,
+ "type defaults to %<int%> in declaration of %qs", name);
}
/* Adjust the type if a bit-field is being declared,
@@ -4093,11 +4070,11 @@ grokdeclarator (const struct c_declarator *declarator,
if (pedantic && !flag_isoc99)
{
if (constp > 1)
- pedwarn ("duplicate %<const%>");
+ pedwarn (OPT_pedantic, "duplicate %<const%>");
if (restrictp > 1)
- pedwarn ("duplicate %<restrict%>");
+ pedwarn (OPT_pedantic, "duplicate %<restrict%>");
if (volatilep > 1)
- pedwarn ("duplicate %<volatile%>");
+ pedwarn (OPT_pedantic, "duplicate %<volatile%>");
}
if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
type = TYPE_MAIN_VARIANT (type);
@@ -4114,9 +4091,9 @@ grokdeclarator (const struct c_declarator *declarator,
|| storage_class == csc_register
|| storage_class == csc_typedef))
{
- if (storage_class == csc_auto
- && (pedantic || current_scope == file_scope))
- pedwarn ("function definition declared %<auto%>");
+ if (storage_class == csc_auto)
+ pedwarn ((current_scope == file_scope) ? 0 : OPT_pedantic,
+ "function definition declared %<auto%>");
if (storage_class == csc_register)
error ("function definition declared %<register%>");
if (storage_class == csc_typedef)
@@ -4172,7 +4149,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (storage_class == csc_auto)
error ("file-scope declaration of %qs specifies %<auto%>", name);
if (pedantic && storage_class == csc_register)
- pedwarn ("file-scope declaration of %qs specifies %<register%>", name);
+ pedwarn (OPT_pedantic, "file-scope declaration of %qs specifies %<register%>", name);
}
else
{
@@ -4285,7 +4262,7 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (pedantic && !in_system_header && flexible_array_type_p (type))
- pedwarn ("invalid use of structure with flexible array member");
+ pedwarn (OPT_pedantic, "invalid use of structure with flexible array member");
if (size == error_mark_node)
type = error_mark_node;
@@ -4310,7 +4287,7 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (pedantic && integer_zerop (size))
- pedwarn ("ISO C forbids zero-size array %qs", name);
+ pedwarn (OPT_pedantic, "ISO C forbids zero-size array %qs", name);
if (TREE_CODE (size) == INTEGER_CST)
{
@@ -4382,7 +4359,7 @@ grokdeclarator (const struct c_declarator *declarator,
else if (decl_context == FIELD)
{
if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn ("ISO C90 does not support flexible array members");
+ pedwarn (OPT_pedantic, "ISO C90 does not support flexible array members");
/* ISO C99 Flexible array members are effectively
identical to GCC's zero-length array extension. */
@@ -4527,7 +4504,7 @@ grokdeclarator (const struct c_declarator *declarator,
function definitions in ISO C; GCC used to used
them for noreturn functions. */
if (VOID_TYPE_P (type) && really_funcdef)
- pedwarn ("function definition has qualified void return type");
+ pedwarn (0, "function definition has qualified void return type");
else
warning (OPT_Wignored_qualifiers,
"type qualifiers ignored on function return type");
@@ -4559,7 +4536,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn ("ISO C forbids qualified function types");
+ pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
size_varies = 0;
@@ -4640,7 +4617,7 @@ grokdeclarator (const struct c_declarator *declarator,
tree decl;
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn ("ISO C forbids qualified function types");
+ pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
decl = build_decl (TYPE_DECL, declarator->u.id, type);
@@ -4648,7 +4625,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (declspecs->explicit_signed_p)
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
if (declspecs->inline_p)
- pedwarn ("typedef %q+D declared %<inline%>", decl);
+ pedwarn (0, "typedef %q+D declared %<inline%>", decl);
return decl;
}
@@ -4663,7 +4640,7 @@ grokdeclarator (const struct c_declarator *declarator,
&& !declspecs->inline_p);
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn ("ISO C forbids const or volatile function types");
+ pedwarn (OPT_pedantic, "ISO C forbids const or volatile function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
return type;
@@ -4673,7 +4650,8 @@ grokdeclarator (const struct c_declarator *declarator,
&& variably_modified_type_p (type, NULL_TREE))
{
/* C99 6.7.2.1p8 */
- pedwarn ("a member of a structure or union cannot have a variably modified type");
+ pedwarn (OPT_pedantic,
+ "a member of a structure or union cannot have a variably modified type");
}
/* Aside from typedefs and type names (handle above),
@@ -4726,8 +4704,8 @@ grokdeclarator (const struct c_declarator *declarator,
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
- if (pedantic && type_quals)
- pedwarn ("ISO C forbids qualified function types");
+ if (type_quals)
+ pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
type = build_pointer_type (type);
@@ -4753,7 +4731,7 @@ grokdeclarator (const struct c_declarator *declarator,
DECL_ARG_TYPE (decl) = promoted_type;
if (declspecs->inline_p)
- pedwarn ("parameter %q+D declared %<inline%>", decl);
+ pedwarn (0, "parameter %q+D declared %<inline%>", decl);
}
else if (decl_context == FIELD)
{
@@ -4799,10 +4777,7 @@ grokdeclarator (const struct c_declarator *declarator,
GCC allows 'auto', perhaps with 'inline', to support
nested functions. */
if (storage_class == csc_auto)
- {
- if (pedantic)
- pedwarn ("invalid storage class for function %qs", name);
- }
+ pedwarn (OPT_pedantic, "invalid storage class for function %qs", name);
else if (storage_class == csc_static)
{
error ("invalid storage class for function %qs", name);
@@ -4818,7 +4793,8 @@ grokdeclarator (const struct c_declarator *declarator,
decl = build_decl_attribute_variant (decl, decl_attr);
if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl))
- pedwarn ("ISO C forbids qualified function types");
+ pedwarn (OPT_pedantic,
+ "ISO C forbids qualified function types");
/* GNU C interprets a volatile-qualified function type to indicate
that the function does not return. */
@@ -4860,7 +4836,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (flag_hosted && MAIN_NAME_P (declarator->u.id))
{
if (declspecs->inline_p)
- pedwarn ("cannot inline function %<main%>");
+ pedwarn (0, "cannot inline function %<main%>");
}
else if (declspecs->inline_p)
{
@@ -4874,10 +4850,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (initialized)
DECL_INLINE (decl) = 1;
}
- /* If -finline-functions, assume it can be inlined. This does
- two things: let the function be deferred until it is actually
- needed, and let dwarf2 know that the function is inlinable. */
- else if (flag_inline_trees == 2 && initialized)
+ else if (initialized)
DECL_INLINE (decl) = 1;
}
else
@@ -4913,7 +4886,7 @@ grokdeclarator (const struct c_declarator *declarator,
C_DECL_VARIABLE_SIZE (decl) = 1;
if (declspecs->inline_p)
- pedwarn ("variable %q+D declared %<inline%>", decl);
+ pedwarn (0, "variable %q+D declared %<inline%>", decl);
/* At file scope, an initialized extern declaration may follow
a static declaration. In that case, DECL_EXTERNAL will be
@@ -5021,7 +4994,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
else if (arg_types && TREE_CODE (TREE_VALUE (arg_types)) == IDENTIFIER_NODE)
{
if (!funcdef_flag)
- pedwarn ("parameter names (without types) in function declaration");
+ pedwarn (0, "parameter names (without types) in function declaration");
arg_info->parms = arg_info->types;
arg_info->types = 0;
@@ -5435,11 +5408,10 @@ grokfield (struct c_declarator *declarator, struct c_declspecs *declspecs,
}
if (!ok)
{
- pedwarn ("declaration does not declare anything");
+ pedwarn (0, "declaration does not declare anything");
return NULL_TREE;
}
- if (pedantic)
- pedwarn ("ISO C doesn%'t support unnamed structs/unions");
+ pedwarn (OPT_pedantic, "ISO C doesn%'t support unnamed structs/unions");
}
value = grokdeclarator (declarator, declspecs, FIELD, false,
@@ -5538,16 +5510,16 @@ finish_struct (tree t, tree fieldlist, tree attributes)
if (TREE_CODE (t) == UNION_TYPE)
{
if (fieldlist)
- pedwarn ("union has no named members");
+ pedwarn (OPT_pedantic, "union has no named members");
else
- pedwarn ("union has no members");
+ pedwarn (OPT_pedantic, "union has no members");
}
else
{
if (fieldlist)
- pedwarn ("struct has no named members");
+ pedwarn (OPT_pedantic, "struct has no named members");
else
- pedwarn ("struct has no members");
+ pedwarn (OPT_pedantic, "struct has no members");
}
}
}
@@ -5626,7 +5598,8 @@ finish_struct (tree t, tree fieldlist, tree attributes)
if (pedantic && !in_system_header && TREE_CODE (t) == RECORD_TYPE
&& flexible_array_type_p (TREE_TYPE (x)))
- pedwarn ("%Jinvalid use of structure with flexible array member", x);
+ pedwarn (OPT_pedantic,
+ "%Jinvalid use of structure with flexible array member", x);
if (DECL_NAME (x))
saw_named_field = 1;
@@ -6011,7 +5984,7 @@ build_enumerator (struct c_enum_contents *the_enum, tree name, tree value)
if (pedantic && !int_fits_type_p (value, integer_type_node))
{
- pedwarn ("ISO C restricts enumerator values to range of %<int%>");
+ pedwarn (OPT_pedantic, "ISO C restricts enumerator values to range of %<int%>");
/* XXX This causes -pedantic to change the meaning of the program.
Remove? -zw 2004-03-15 */
value = convert (integer_type_node, value);
@@ -6127,7 +6100,9 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
}
if (warn_about_return_type)
- pedwarn_c99 ("return type defaults to %<int%>");
+ pedwarn_c99 (flag_isoc99 ? 0
+ : (warn_return_type ? OPT_Wreturn_type : OPT_Wimplicit_int),
+ "return type defaults to %<int%>");
/* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in pop_scope) with the BLOCK. */
@@ -6248,12 +6223,12 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
{
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1)))
!= integer_type_node)
- pedwarn ("return type of %q+D is not %<int%>", decl1);
+ pedwarn (OPT_Wmain, "return type of %q+D is not %<int%>", decl1);
check_main_parameter_types(decl1);
if (!TREE_PUBLIC (decl1))
- pedwarn ("%q+D is normally a non-static function", decl1);
+ pedwarn (OPT_Wmain, "%q+D is normally a non-static function", decl1);
}
/* Record the decl so that the function name is defined.
@@ -6401,7 +6376,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
warn_if_shadowing (decl);
if (flag_isoc99)
- pedwarn ("type of %q+D defaults to %<int%>", decl);
+ pedwarn (0, "type of %q+D defaults to %<int%>", decl);
else
warning (OPT_Wmissing_parameter_type, "type of %q+D defaults to %<int%>", decl);
}
@@ -6512,22 +6487,19 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
< TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (parm) = integer_type_node;
- if (pedantic)
+ /* ??? Is it possible to get here with a
+ built-in prototype or will it always have
+ been diagnosed as conflicting with an
+ old-style definition and discarded? */
+ if (current_function_prototype_built_in)
+ warning (OPT_pedantic, "promoted argument %qD "
+ "doesn%'t match built-in prototype", parm);
+ else
{
- /* ??? Is it possible to get here with a
- built-in prototype or will it always have
- been diagnosed as conflicting with an
- old-style definition and discarded? */
- if (current_function_prototype_built_in)
- warning (0, "promoted argument %qD "
- "doesn%'t match built-in prototype", parm);
- else
- {
- pedwarn ("promoted argument %qD "
- "doesn%'t match prototype", parm);
- pedwarn ("%Hprototype declaration",
- &current_function_prototype_locus);
- }
+ pedwarn (OPT_pedantic, "promoted argument %qD "
+ "doesn%'t match prototype", parm);
+ pedwarn (OPT_pedantic, "%Hprototype declaration",
+ &current_function_prototype_locus);
}
}
else
@@ -6719,7 +6691,7 @@ finish_function (void)
/* If warn_main is 1 (-Wmain) or 2 (-Wall), we have already warned.
If warn_main is -1 (-Wno-main) we don't want to be warned. */
if (!warn_main)
- pedwarn ("return type of %q+D is not %<int%>", fndecl);
+ pedwarn (0, "return type of %q+D is not %<int%>", fndecl);
}
else
{
@@ -6752,9 +6724,9 @@ finish_function (void)
&& !MAIN_NAME_P (DECL_NAME (fndecl))
/* Or if they didn't actually specify a return type. */
&& !C_FUNCTION_IMPLICIT_INT (fndecl)
- /* Normally, with -Wreturn-type, flow will complain. Unless we're an
- inline function, as we might never be compiled separately. */
- && DECL_INLINE (fndecl))
+ /* Normally, with -Wreturn-type, flow will complain, but we might
+ optimize out static functions. */
+ && !TREE_PUBLIC (fndecl))
{
warning (OPT_Wreturn_type,
"no return statement in function returning non-void");
@@ -7170,8 +7142,8 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual)
default:
gcc_unreachable ();
}
- if (dupe && pedantic && !flag_isoc99)
- pedwarn ("duplicate %qE", qual);
+ if (dupe && !flag_isoc99)
+ pedwarn (OPT_pedantic, "duplicate %qE", qual);
return specs;
}
@@ -7219,9 +7191,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
"declaration specifiers");
break;
}
- if (pedantic && !flag_isoc99 && !in_system_header
- && warn_long_long)
- pedwarn ("ISO C90 does not support %<long long%>");
+ if (pedantic && !flag_isoc99 && !in_system_header)
+ pedwarn (OPT_Wlong_long, "ISO C90 does not support %<long long%>");
specs->long_long_p = 1;
break;
}
@@ -7344,8 +7315,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
break;
case RID_COMPLEX:
dupe = specs->complex_p;
- if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn ("ISO C90 does not support complex types");
+ if (!flag_isoc99 && !in_system_header)
+ pedwarn (OPT_pedantic, "ISO C90 does not support complex types");
if (specs->typespec_word == cts_void)
error ("both %<complex%> and %<void%> in "
"declaration specifiers");
@@ -7375,8 +7346,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
break;
case RID_SAT:
dupe = specs->saturating_p;
- if (pedantic)
- pedwarn ("ISO C does not support saturating types");
+ pedwarn (OPT_pedantic, "ISO C does not support saturating types");
if (specs->typespec_word == cts_void)
error ("both %<_Sat%> and %<void%> in "
"declaration specifiers");
@@ -7573,8 +7543,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
}
if (!targetm.decimal_float_supported_p ())
error ("decimal floating point not supported for this target");
- if (pedantic)
- pedwarn ("ISO C does not support decimal floating point");
+ pedwarn (OPT_pedantic,
+ "ISO C does not support decimal floating point");
return specs;
case RID_FRACT:
case RID_ACCUM:
@@ -7594,8 +7564,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
}
if (!targetm.fixed_point_supported_p ())
error ("fixed-point types not supported for this target");
- if (pedantic)
- pedwarn ("ISO C does not support fixed-point types");
+ pedwarn (OPT_pedantic,
+ "ISO C does not support fixed-point types");
return specs;
default:
/* ObjC reserved word "id", handled below. */
@@ -7781,9 +7751,9 @@ finish_declspecs (struct c_declspecs *specs)
else if (specs->complex_p)
{
specs->typespec_word = cts_double;
- if (pedantic)
- pedwarn ("ISO C does not support plain %<complex%> meaning "
- "%<double complex%>");
+ pedwarn (OPT_pedantic,
+ "ISO C does not support plain %<complex%> meaning "
+ "%<double complex%>");
}
else
{
@@ -7826,8 +7796,8 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = char_type_node;
if (specs->complex_p)
{
- if (pedantic)
- pedwarn ("ISO C does not support complex integer types");
+ pedwarn (OPT_pedantic,
+ "ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
break;
@@ -7852,8 +7822,8 @@ finish_declspecs (struct c_declspecs *specs)
: integer_type_node);
if (specs->complex_p)
{
- if (pedantic)
- pedwarn ("ISO C does not support complex integer types");
+ pedwarn (OPT_pedantic,
+ "ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
break;
@@ -8003,7 +7973,7 @@ c_write_global_declarations_1 (tree globals)
&& !TREE_PUBLIC (decl)
&& C_DECL_USED (decl))
{
- pedwarn ("%q+F used but never defined", decl);
+ pedwarn (0, "%q+F used but never defined", decl);
TREE_NO_WARNING (decl) = 1;
}
diff --git a/gcc/c-errors.c b/gcc/c-errors.c
index dc47b764f39..8adeeeb3538 100644
--- a/gcc/c-errors.c
+++ b/gcc/c-errors.c
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see
/* Issue an ISO C99 pedantic warning MSGID. */
void
-pedwarn_c99 (const char *gmsgid, ...)
+pedwarn_c99 (int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
@@ -39,6 +39,7 @@ pedwarn_c99 (const char *gmsgid, ...)
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
flag_isoc99 ? pedantic_warning_kind () : DK_WARNING);
+ diagnostic.option_index = opt;
report_diagnostic (&diagnostic);
va_end (ap);
}
@@ -49,7 +50,7 @@ pedwarn_c99 (const char *gmsgid, ...)
(There is no flag_c90.) */
void
-pedwarn_c90 (const char *gmsgid, ...)
+pedwarn_c90 (int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
@@ -57,6 +58,7 @@ pedwarn_c90 (const char *gmsgid, ...)
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
flag_isoc99 ? DK_WARNING : pedantic_warning_kind ());
+ diagnostic.option_index = opt;
report_diagnostic (&diagnostic);
va_end (ap);
}
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 3c2c225c59f..e49e3319c3f 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -239,7 +239,6 @@ fe_file_change (const struct line_map *new_map)
}
update_header_times (new_map->to_file);
- in_system_header = new_map->sysp != 0;
input_location = new_map->start_location;
}
@@ -588,8 +587,8 @@ interpret_integer (const cpp_token *token, unsigned int flags)
if (itk > itk_unsigned_long
&& (flags & CPP_N_WIDTH) != CPP_N_LARGE
&& !in_system_header && !flag_isoc99)
- pedwarn ("integer constant is too large for %qs type",
- (flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
+ pedwarn (0, "integer constant is too large for %qs type",
+ (flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
value = build_int_cst_wide (type, integer.low, integer.high);
@@ -642,8 +641,8 @@ interpret_float (const cpp_token *token, unsigned int flags)
return error_mark_node;
}
- else if (pedantic)
- pedwarn ("non-standard suffix on floating constant");
+ else
+ pedwarn (OPT_pedantic, "non-standard suffix on floating constant");
type = c_common_type_for_mode (mode, 0);
gcc_assert (type);
@@ -685,7 +684,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
if (REAL_VALUE_ISINF (real))
{
if (!MODE_HAS_INFINITIES (TYPE_MODE (type)))
- pedwarn ("floating constant exceeds range of %qT", type);
+ pedwarn (0, "floating constant exceeds range of %qT", type);
else
warning (OPT_Woverflow, "floating constant exceeds range of %qT", type);
}
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 33d0e6bed26..258101c39cf 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -1018,13 +1018,9 @@ c_common_post_options (const char **pfilename)
C_COMMON_OVERRIDE_OPTIONS;
#endif
- flag_inline_trees = 1;
-
/* Use tree inlining. */
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* By default we use C99 inline semantics in GNU99 or C99 mode. C99
inline semantics are not supported in GNU89 or C89 mode. */
@@ -1033,14 +1029,6 @@ c_common_post_options (const char **pfilename)
else if (!flag_gnu89_inline && !flag_isoc99)
error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
- /* If we are given more than one input file, we must use
- unit-at-a-time mode. */
- if (num_in_fnames > 1)
- flag_unit_at_a_time = 1;
-
- if (pch_file && !flag_unit_at_a_time)
- sorry ("Precompiled headers require -funit-at-a-time");
-
/* Default to ObjC sjlj exception handling if NeXT runtime. */
if (flag_objc_sjlj_exceptions < 0)
flag_objc_sjlj_exceptions = flag_next_runtime;
@@ -1091,12 +1079,7 @@ c_common_post_options (const char **pfilename)
if (c_dialect_cxx ())
{
if (!flag_no_inline)
- {
- flag_inline_trees = 1;
- flag_no_inline = 1;
- }
- if (flag_inline_functions)
- flag_inline_trees = 2;
+ flag_no_inline = 1;
}
/* In C, -Wconversion enables -Wsign-conversion (unless disabled
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index aba007c9bc2..a2ea45f6a78 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -149,8 +149,6 @@ typedef struct c_token GTY (())
/* If this token is a CPP_PRAGMA, this indicates the pragma that
was seen. Otherwise it is PRAGMA_NONE. */
ENUM_BITFIELD (pragma_kind) pragma_kind : 7;
- /* True if this token is from a system header. */
- BOOL_BITFIELD in_system_header : 1;
/* The value associated with this token, if any. */
tree value;
/* The location at which this token was found. */
@@ -206,7 +204,6 @@ c_lex_one_token (c_parser *parser, c_token *token)
token->id_kind = C_ID_NONE;
token->keyword = RID_MAX;
token->pragma_kind = PRAGMA_NONE;
- token->in_system_header = in_system_header;
switch (token->type)
{
@@ -545,7 +542,6 @@ c_parser_set_source_position_from_token (c_token *token)
if (token->type != CPP_EOF)
{
input_location = token->location;
- in_system_header = token->in_system_header;
}
}
@@ -964,9 +960,8 @@ c_parser_translation_unit (c_parser *parser)
{
if (c_parser_next_token_is (parser, CPP_EOF))
{
- if (pedantic)
- pedwarn ("%HISO C forbids an empty translation unit",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic, "%HISO C forbids an empty translation unit",
+ &c_parser_peek_token (parser)->location);
}
else
{
@@ -1050,9 +1045,9 @@ c_parser_external_declaration (c_parser *parser)
}
break;
case CPP_SEMICOLON:
- if (pedantic)
- pedwarn ("%HISO C does not allow extra %<;%> outside of a function",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic,
+ "%HISO C does not allow extra %<;%> outside of a function",
+ &c_parser_peek_token (parser)->location);
c_parser_consume_token (parser);
break;
case CPP_PRAGMA:
@@ -1166,7 +1161,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
else
{
shadow_tag_warned (specs, 1);
- pedwarn ("%Hempty declaration", &here);
+ pedwarn (0, "%Hempty declaration", &here);
}
c_parser_consume_token (parser);
return;
@@ -1202,8 +1197,8 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
if (!diagnosed_no_specs && !specs->declspecs_seen_p)
{
diagnosed_no_specs = true;
- pedwarn ("%Hdata definition has no type or storage class",
- &here);
+ pedwarn (0, "%Hdata definition has no type or storage class",
+ &here);
}
/* Having seen a data definition, there cannot now be a
function definition. */
@@ -1272,8 +1267,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
/* Function definition (nested or otherwise). */
if (nested)
{
- if (pedantic)
- pedwarn ("%HISO C forbids nested functions", &here);
+ pedwarn (OPT_pedantic, "%HISO C forbids nested functions", &here);
c_push_function_context ();
}
if (!start_function (specs, declarator, all_prefix_attrs))
@@ -1667,8 +1661,9 @@ c_parser_enum_specifier (c_parser *parser)
}
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
- if (seen_comma && pedantic && !flag_isoc99)
- pedwarn ("%Hcomma at end of enumerator list", &comma_loc);
+ if (seen_comma && !flag_isoc99)
+ pedwarn (OPT_pedantic, "%Hcomma at end of enumerator list",
+ &comma_loc);
c_parser_consume_token (parser);
break;
}
@@ -1699,7 +1694,8 @@ c_parser_enum_specifier (c_parser *parser)
if (pedantic && !COMPLETE_TYPE_P (ret.spec))
{
gcc_assert (ident);
- pedwarn ("%HISO C forbids forward references to %<enum%> types",
+ pedwarn (OPT_pedantic,
+ "%HISO C forbids forward references to %<enum%> types",
&ident_loc);
}
return ret;
@@ -1824,9 +1820,9 @@ c_parser_struct_or_union_specifier (c_parser *parser)
/* Parse any stray semicolon. */
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
- if (pedantic)
- pedwarn ("%Hextra semicolon in struct or union specified",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic,
+ "%Hextra semicolon in struct or union specified",
+ &c_parser_peek_token (parser)->location);
c_parser_consume_token (parser);
continue;
}
@@ -1854,8 +1850,8 @@ c_parser_struct_or_union_specifier (c_parser *parser)
else
{
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
- pedwarn ("%Hno semicolon at end of struct or union",
- &c_parser_peek_token (parser)->location);
+ pedwarn (0, "%Hno semicolon at end of struct or union",
+ &c_parser_peek_token (parser)->location);
else
{
c_parser_error (parser, "expected %<;%>");
@@ -1946,9 +1942,9 @@ c_parser_struct_declaration (c_parser *parser)
tree ret;
if (!specs->type_seen_p)
{
- if (pedantic)
- pedwarn ("%HISO C forbids member declarations with no members",
- &decl_loc);
+ pedwarn (OPT_pedantic,
+ "%HISO C forbids member declarations with no members",
+ &decl_loc);
shadow_tag_warned (specs, pedantic);
ret = NULL_TREE;
}
@@ -3001,8 +2997,8 @@ c_parser_braced_init (c_parser *parser, tree type, bool nested_p)
really_start_incremental_init (type);
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
- if (pedantic)
- pedwarn ("%HISO C forbids empty initializer braces", &brace_loc);
+ pedwarn (OPT_pedantic, "%HISO C forbids empty initializer braces",
+ &brace_loc);
}
else
{
@@ -3046,12 +3042,10 @@ c_parser_initelt (c_parser *parser)
{
/* Old-style structure member designator. */
set_init_label (c_parser_peek_token (parser)->value);
- if (pedantic)
- {
- /* Use the colon as the error location. */
- pedwarn ("%Hobsolete use of designated initializer with %<:%>",
- &c_parser_peek_2nd_token (parser)->location);
- }
+ /* Use the colon as the error location. */
+ pedwarn (OPT_pedantic,
+ "%Hobsolete use of designated initializer with %<:%>",
+ &c_parser_peek_2nd_token (parser)->location);
c_parser_consume_token (parser);
c_parser_consume_token (parser);
}
@@ -3179,8 +3173,9 @@ c_parser_initelt (c_parser *parser)
{
c_parser_consume_token (parser);
set_init_index (first, second);
- if (pedantic && second)
- pedwarn ("%HISO C forbids specifying range of "
+ if (second)
+ pedwarn (OPT_pedantic,
+ "%HISO C forbids specifying range of "
"elements to initialize", &ellipsis_loc);
}
else
@@ -3192,8 +3187,9 @@ c_parser_initelt (c_parser *parser)
{
if (c_parser_next_token_is (parser, CPP_EQ))
{
- if (pedantic && !flag_isoc99)
- pedwarn ("%HISO C90 forbids specifying subobject "
+ if (!flag_isoc99)
+ pedwarn (OPT_pedantic,
+ "%HISO C90 forbids specifying subobject "
"to initialize", &des_loc);
c_parser_consume_token (parser);
}
@@ -3201,10 +3197,10 @@ c_parser_initelt (c_parser *parser)
{
if (des_seen == 1)
{
- if (pedantic)
- pedwarn ("%Hobsolete use of designated initializer "
- "without %<=%>",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic,
+ "%Hobsolete use of designated initializer "
+ "without %<=%>",
+ &c_parser_peek_token (parser)->location);
}
else
{
@@ -3355,8 +3351,7 @@ c_parser_compound_statement_nostart (c_parser *parser)
}
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
}
- if (pedantic)
- pedwarn ("%HISO C forbids label declarations", &err_loc);
+ pedwarn (OPT_pedantic, "%HISO C forbids label declarations", &err_loc);
}
/* We must now have at least one statement, label or declaration. */
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
@@ -3386,10 +3381,11 @@ c_parser_compound_statement_nostart (c_parser *parser)
{
last_label = false;
c_parser_declaration_or_fndef (parser, true, true, true, true);
- if (last_stmt
- && ((pedantic && !flag_isoc99)
- || warn_declaration_after_statement))
- pedwarn_c90 ("%HISO C90 forbids mixed declarations and code",
+ if (last_stmt)
+ pedwarn_c90 ((pedantic && !flag_isoc99)
+ ? OPT_pedantic
+ : OPT_Wdeclaration_after_statement,
+ "%HISO C90 forbids mixed declarations and code",
&loc);
last_stmt = false;
}
@@ -3414,10 +3410,11 @@ c_parser_compound_statement_nostart (c_parser *parser)
/* Following the old parser, __extension__ does not
disable this diagnostic. */
restore_extension_diagnostics (ext);
- if (last_stmt
- && ((pedantic && !flag_isoc99)
- || warn_declaration_after_statement))
- pedwarn_c90 ("%HISO C90 forbids mixed declarations and code",
+ if (last_stmt)
+ pedwarn_c90 ((pedantic && !flag_isoc99)
+ ? OPT_pedantic
+ : OPT_Wdeclaration_after_statement,
+ "%HISO C90 forbids mixed declarations and code",
&loc);
last_stmt = false;
}
@@ -4424,9 +4421,9 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after)
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_COLON))
{
- if (pedantic)
- pedwarn ("%HISO C forbids omitting the middle term of a ?: expression",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic,
+ "%HISO C forbids omitting the middle term of a ?: expression",
+ &c_parser_peek_token (parser)->location);
/* Make sure first operand is calculated only once. */
exp1.value = save_expr (default_conversion (cond.value));
cond.value = c_objc_common_truthvalue_conversion (exp1.value);
@@ -5128,9 +5125,8 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_compound_statement_nostart (parser);
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
"expected %<)%>");
- if (pedantic)
- pedwarn ("%HISO C forbids braced-groups within expressions",
- &here);
+ pedwarn (OPT_pedantic,
+ "%HISO C forbids braced-groups within expressions", &here);
expr.value = c_finish_stmt_expr (stmt);
expr.original_code = ERROR_MARK;
}
@@ -5490,8 +5486,9 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
finish_init ();
maybe_warn_string_init (type, init);
- if (pedantic && !flag_isoc99)
- pedwarn ("%HISO C90 forbids compound literals", &start_loc);
+ if (!flag_isoc99)
+ pedwarn (OPT_pedantic, "%HISO C90 forbids compound literals",
+ &start_loc);
expr.value = build_compound_literal (type, init.value);
expr.original_code = ERROR_MARK;
return c_parser_postfix_expression_after_primary (parser, expr);
@@ -5792,9 +5789,9 @@ c_parser_objc_class_instance_variables (c_parser *parser)
/* Parse any stray semicolon. */
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
- if (pedantic)
- pedwarn ("%Hextra semicolon in struct or union specified",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic,
+ "%Hextra semicolon in struct or union specified",
+ &c_parser_peek_token (parser)->location);
c_parser_consume_token (parser);
continue;
}
@@ -6010,9 +6007,9 @@ c_parser_objc_method_definition (c_parser *parser)
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
c_parser_consume_token (parser);
- if (pedantic)
- pedwarn ("%Hextra semicolon in method definition specified",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic,
+ "%Hextra semicolon in method definition specified",
+ &c_parser_peek_token (parser)->location);
}
if (!c_parser_next_token_is (parser, CPP_OPEN_BRACE))
{
@@ -6048,10 +6045,9 @@ c_parser_objc_methodprotolist (c_parser *parser)
switch (c_parser_peek_token (parser)->type)
{
case CPP_SEMICOLON:
- if (pedantic)
- pedwarn ("%HISO C does not allow extra %<;%> "
- "outside of a function",
- &c_parser_peek_token (parser)->location);
+ pedwarn (OPT_pedantic, "%HISO C does not allow extra %<;%> "
+ "outside of a function",
+ &c_parser_peek_token (parser)->location);
c_parser_consume_token (parser);
break;
case CPP_PLUS:
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 8273914f144..3fde4611fab 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -45,7 +45,6 @@ static const struct c_pch_matching
const char *flag_name;
} pch_matching[] = {
{ &flag_exceptions, "-fexceptions" },
- { &flag_unit_at_a_time, "-funit-at-a-time" }
};
enum {
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index e7bb928c8a9..6e4043ae672 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -866,6 +866,313 @@ handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy))
GCC_BAD ("unknown option after %<#pragma GCC diagnostic%> kind");
}
+/* Stack of the #pragma GCC options created with #pragma GCC option push. */
+static GTY(()) VEC(tree,gc) *option_stack;
+
+/* Parse #pragma GCC option (xxx) to set target specific options. */
+static void
+handle_pragma_option(cpp_reader *ARG_UNUSED(dummy))
+{
+ enum cpp_ttype token;
+ const char *name;
+ tree x;
+ bool close_paren_needed_p = false;
+
+ if (cfun)
+ {
+ error ("#pragma GCC option is not allowed inside functions");
+ return;
+ }
+
+ if (!targetm.target_option.pragma_parse)
+ {
+ error ("#pragma GCC option is not supported for this system");
+ return;
+ }
+
+ token = pragma_lex (&x);
+ if (token == CPP_OPEN_PAREN)
+ {
+ close_paren_needed_p = true;
+ token = pragma_lex (&x);
+ }
+
+ if (token == CPP_NAME)
+ {
+ bool call_pragma_parse_p = false;
+ bool ok_p;
+
+ name = IDENTIFIER_POINTER (x);
+ if (strcmp (name, "reset") == 0)
+ {
+ current_option_pragma = NULL_TREE;
+ call_pragma_parse_p = true;
+ }
+
+ else if (strcmp (name, "push") == 0)
+ VEC_safe_push (tree, gc, option_stack,
+ copy_list (current_option_pragma));
+
+ else if (strcmp (name, "pop") == 0)
+ {
+ int len = VEC_length (tree, option_stack);
+ if (len == 0)
+ {
+ GCC_BAD ("%<#pragma GCC option pop%> without a %<#pragma GCC "
+ "option push%>");
+ return;
+ }
+ else
+ {
+ VEC_truncate (tree, option_stack, len-1);
+ current_option_pragma = ((len > 1)
+ ? VEC_last (tree, option_stack)
+ : NULL_TREE);
+
+ call_pragma_parse_p = true;
+ }
+ }
+
+ else
+ {
+ GCC_BAD ("%<#pragma GCC option%> is not a string or "
+ "push/pop/reset");
+ return;
+ }
+
+ token = pragma_lex (&x);
+ if (close_paren_needed_p)
+ {
+ if (token == CPP_CLOSE_PAREN)
+ token = pragma_lex (&x);
+ else
+ GCC_BAD ("%<#pragma GCC option ([push|pop|reset])%> does not "
+ "have a final %<)%>.");
+ }
+
+ if (token != CPP_EOF)
+ {
+ GCC_BAD ("%<#pragma GCC option [push|pop|reset]%> is badly "
+ "formed");
+ return;
+ }
+
+ /* See if we need to call the pragma_parse hook. This must occur at the
+ end after processing all of the tokens, or we may get spurious errors
+ when we define or undef macros. */
+ ok_p = targetm.target_option.pragma_parse (current_option_pragma);
+ gcc_assert (ok_p);
+ }
+
+ else if (token != CPP_STRING)
+ {
+ GCC_BAD ("%<#pragma GCC option%> is not a string or push/pop/reset");
+ return;
+ }
+
+ /* Strings are user options. */
+ else
+ {
+ tree args = NULL_TREE;
+
+ do
+ {
+ /* Build up the strings now as a tree linked list. Skip empty
+ strings. */
+ if (TREE_STRING_LENGTH (x) > 0)
+ args = tree_cons (NULL_TREE, x, args);
+
+ token = pragma_lex (&x);
+ while (token == CPP_COMMA)
+ token = pragma_lex (&x);
+ }
+ while (token == CPP_STRING);
+
+ if (close_paren_needed_p)
+ {
+ if (token == CPP_CLOSE_PAREN)
+ token = pragma_lex (&x);
+ else
+ GCC_BAD ("%<#pragma GCC option (string [,string]...)%> does "
+ "not have a final %<)%>.");
+ }
+
+ if (token != CPP_EOF)
+ {
+ error ("#pragma GCC option string... is badly formed");
+ return;
+ }
+
+ /* put arguments in the order the user typed them. */
+ args = nreverse (args);
+
+ if (targetm.target_option.pragma_parse (args))
+ current_option_pragma = args;
+ }
+}
+
+/* Stack of the #pragma GCC optimize options created with #pragma GCC optimize
+ push. */
+static GTY(()) VEC(tree,gc) *optimize_stack;
+
+/* Handle #pragma GCC optimize to set optimization options. */
+static void
+handle_pragma_optimize(cpp_reader *ARG_UNUSED(dummy))
+{
+ enum cpp_ttype token;
+ const char *name;
+ tree x;
+ bool close_paren_needed_p = false;
+ tree optimization_previous_node = optimization_current_node;
+
+ if (cfun)
+ {
+ error ("#pragma GCC optimize is not allowed inside functions");
+ return;
+ }
+
+ token = pragma_lex (&x);
+ if (token == CPP_OPEN_PAREN)
+ {
+ close_paren_needed_p = true;
+ token = pragma_lex (&x);
+ }
+
+ if (token == CPP_NAME)
+ {
+ bool call_opt_p = false;
+
+ name = IDENTIFIER_POINTER (x);
+ if (strcmp (name, "reset") == 0)
+ {
+ struct cl_optimization *def
+ = TREE_OPTIMIZATION (optimization_default_node);
+ current_optimize_pragma = NULL_TREE;
+ optimization_current_node = optimization_default_node;
+ cl_optimization_restore (def);
+ call_opt_p = true;
+ }
+
+ else if (strcmp (name, "push") == 0)
+ VEC_safe_push (tree, gc, optimize_stack, current_optimize_pragma);
+
+ else if (strcmp (name, "pop") == 0)
+ {
+ int len = VEC_length (tree, optimize_stack);
+ if (len == 0)
+ {
+ GCC_BAD ("%<#pragma GCC optimize pop%> without a %<#pragma "
+ "GCC optimize push%>");
+ return;
+ }
+ else
+ {
+ VEC_truncate (tree, optimize_stack, len-1);
+ current_optimize_pragma
+ = ((len > 1)
+ ? VEC_last (tree, optimize_stack)
+ : NULL_TREE);
+
+ call_opt_p = true;
+ if (current_optimize_pragma)
+ {
+ bool ok_p
+ = parse_optimize_options (current_optimize_pragma, false);
+ gcc_assert (ok_p); /* should be parsed previously. */
+ optimization_current_node = build_optimization_node ();
+ }
+ else
+ {
+ struct cl_optimization *opt
+ = TREE_OPTIMIZATION (optimization_default_node);
+ optimization_current_node = optimization_default_node;
+ cl_optimization_restore (opt);
+ }
+ }
+ }
+
+ else
+ {
+ GCC_BAD ("%<#pragma GCC optimize%> is not a string or "
+ "push/pop/reset");
+ return;
+ }
+
+ token = pragma_lex (&x);
+ if (close_paren_needed_p)
+ {
+ if (token == CPP_CLOSE_PAREN)
+ token = pragma_lex (&x);
+ else
+ GCC_BAD ("%<#pragma GCC optimize ([push|pop|reset])%> does not "
+ "have a final %<)%>.");
+ }
+
+ if (token != CPP_EOF)
+ {
+ GCC_BAD ("%<#pragma GCC optimize [push|pop|reset]%> is badly "
+ "formed");
+ return;
+ }
+
+ if (call_opt_p &&
+ (optimization_previous_node != optimization_current_node))
+ c_cpp_builtins_optimize_pragma (parse_in,
+ optimization_previous_node,
+ optimization_current_node);
+
+ }
+
+ else if (token != CPP_STRING && token != CPP_NUMBER)
+ {
+ GCC_BAD ("%<#pragma GCC optimize%> is not a string, number, or "
+ "push/pop/reset");
+ return;
+ }
+
+ /* Strings/numbers are user options. */
+ else
+ {
+ tree args = NULL_TREE;
+
+ do
+ {
+ /* Build up the numbers/strings now as a list. */
+ if (token != CPP_STRING || TREE_STRING_LENGTH (x) > 0)
+ args = tree_cons (NULL_TREE, x, args);
+
+ token = pragma_lex (&x);
+ while (token == CPP_COMMA)
+ token = pragma_lex (&x);
+ }
+ while (token == CPP_STRING || token == CPP_NUMBER);
+
+ if (close_paren_needed_p)
+ {
+ if (token == CPP_CLOSE_PAREN)
+ token = pragma_lex (&x);
+ else
+ GCC_BAD ("%<#pragma GCC optimize (string [,string]...)%> does "
+ "not have a final %<)%>.");
+ }
+
+ if (token != CPP_EOF)
+ {
+ error ("#pragma GCC optimize string... is badly formed");
+ return;
+ }
+
+ /* put arguments in the order the user typed them. */
+ args = nreverse (args);
+
+ parse_optimize_options (args, false);
+ optimization_current_node = build_optimization_node ();
+ c_cpp_builtins_optimize_pragma (parse_in,
+ optimization_previous_node,
+ optimization_current_node);
+ }
+}
+
/* A vector of registered pragma callbacks. */
DEF_VEC_O (pragma_handler);
@@ -1028,6 +1335,8 @@ init_pragma (void)
#endif
c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic);
+ c_register_pragma ("GCC", "option", handle_pragma_option);
+ c_register_pragma ("GCC", "optimize", handle_pragma_optimize);
c_register_pragma_with_expansion (0, "redefine_extname", handle_pragma_redefine_extname);
c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 14df0444377..d3e3695341c 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -563,7 +563,7 @@ extern tree c_cast_expr (struct c_type_name *, tree);
extern tree build_c_cast (tree, tree);
extern void store_init_value (tree, tree);
extern void error_init (const char *);
-extern void pedwarn_init (const char *);
+extern void pedwarn_init (int opt, const char *);
extern void maybe_warn_string_init (tree, struct c_expr);
extern void start_init (tree, tree, int);
extern void finish_init (void);
@@ -640,7 +640,7 @@ extern void c_write_global_declarations (void);
#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
-extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
-extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
+extern void pedwarn_c90 (int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(2,3);
+extern void pedwarn_c99 (int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(2,3);
#endif /* ! GCC_C_TREE_H */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index dafce2ac23c..5d7036a4367 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -470,8 +470,8 @@ composite_type (tree t1, tree t2)
{
TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
TREE_VALUE (p2));
- if (pedantic)
- pedwarn ("function types not truly compatible in ISO C");
+ pedwarn (OPT_pedantic,
+ "function types not truly compatible in ISO C");
goto parm_done;
}
}
@@ -495,8 +495,8 @@ composite_type (tree t1, tree t2)
{
TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
TREE_VALUE (p1));
- if (pedantic)
- pedwarn ("function types not truly compatible in ISO C");
+ pedwarn (OPT_pedantic,
+ "function types not truly compatible in ISO C");
goto parm_done;
}
}
@@ -1039,8 +1039,8 @@ comp_target_types (tree ttl, tree ttr)
mvr = TYPE_MAIN_VARIANT (mvr);
val = comptypes (mvl, mvr);
- if (val == 2 && pedantic)
- pedwarn ("types are not quite compatible");
+ if (val == 2)
+ pedwarn (OPT_pedantic, "types are not quite compatible");
return val;
}
@@ -1363,7 +1363,7 @@ function_types_compatible_p (const_tree f1, const_tree f2)
/* 'volatile' qualifiers on a function's return type used to mean
the function is noreturn. */
if (TYPE_VOLATILE (ret1) != TYPE_VOLATILE (ret2))
- pedwarn ("function return types not compatible due to %<volatile%>");
+ pedwarn (0, "function return types not compatible due to %<volatile%>");
if (TYPE_VOLATILE (ret1))
ret1 = build_qualified_type (TYPE_MAIN_VARIANT (ret1),
TYPE_QUALS (ret1) & ~TYPE_QUAL_VOLATILE);
@@ -2115,9 +2115,11 @@ build_array_ref (tree array, tree index)
while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0);
if (TREE_CODE (foo) == VAR_DECL && C_DECL_REGISTER (foo))
- pedwarn ("ISO C forbids subscripting %<register%> array");
+ pedwarn (OPT_pedantic,
+ "ISO C forbids subscripting %<register%> array");
else if (!flag_isoc99 && !lvalue_p (foo))
- pedwarn ("ISO C90 forbids subscripting non-lvalue array");
+ pedwarn (OPT_pedantic,
+ "ISO C90 forbids subscripting non-lvalue array");
}
type = TREE_TYPE (TREE_TYPE (array));
@@ -2191,8 +2193,6 @@ build_external_ref (tree id, int fun, location_t loc)
/* Recursive call does not count as usage. */
if (ref != current_function_decl)
{
- if (!skip_evaluation)
- assemble_external (ref);
TREE_USED (ref) = 1;
}
@@ -2233,8 +2233,8 @@ build_external_ref (tree id, int fun, location_t loc)
&& (TREE_CODE (ref) != VAR_DECL || TREE_STATIC (ref))
&& ! TREE_PUBLIC (ref)
&& DECL_CONTEXT (ref) != current_function_decl)
- pedwarn ("%H%qD is static but used in inline function %qD "
- "which is not static", &loc, ref, current_function_decl);
+ pedwarn (0, "%H%qD is static but used in inline function %qD "
+ "which is not static", &loc, ref, current_function_decl);
return ref;
}
@@ -2458,7 +2458,7 @@ build_function_call (tree function, tree params)
if (TREE_CONSTANT (result)
&& (name == NULL_TREE
|| strncmp (IDENTIFIER_POINTER (name), "__builtin_", 10) != 0))
- pedwarn_init ("initializer element is not constant");
+ pedwarn_init (0, "initializer element is not constant");
}
else
result = fold_build_call_array (TREE_TYPE (fntype),
@@ -2802,13 +2802,12 @@ pointer_diff (tree op0, tree op1)
tree con0, con1, lit0, lit1;
tree orig_op1 = op1;
- if (pedantic || warn_pointer_arith)
- {
- if (TREE_CODE (target_type) == VOID_TYPE)
- pedwarn ("pointer of type %<void *%> used in subtraction");
- if (TREE_CODE (target_type) == FUNCTION_TYPE)
- pedwarn ("pointer to a function used in subtraction");
- }
+ if (TREE_CODE (target_type) == VOID_TYPE)
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer of type %<void *%> used in subtraction");
+ if (TREE_CODE (target_type) == FUNCTION_TYPE)
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer to a function used in subtraction");
/* If the conversion to ptrdiff_type does anything like widening or
converting a partial to an integral mode, we get a convert_expression
@@ -2950,8 +2949,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
else if (typecode == COMPLEX_TYPE)
{
code = CONJ_EXPR;
- if (pedantic)
- pedwarn ("ISO C does not support %<~%> for complex conjugation");
+ pedwarn (OPT_pedantic,
+ "ISO C does not support %<~%> for complex conjugation");
if (!noconvert)
arg = default_conversion (arg);
}
@@ -3022,9 +3021,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
{
tree real, imag;
- if (pedantic)
- pedwarn ("ISO C does not support %<++%> and %<--%>"
- " on complex types");
+ pedwarn (OPT_pedantic, "ISO C does not support %<++%> and %<--%>"
+ " on complex types");
arg = stabilize_reference (arg);
real = build_unary_op (REALPART_EXPR, arg, 1);
@@ -3069,14 +3067,15 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
else
error ("decrement of pointer to unknown structure");
}
- else if ((pedantic || warn_pointer_arith)
- && (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE
- || TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE))
+ else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE
+ || TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
- pedwarn ("wrong type argument to increment");
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "wrong type argument to increment");
else
- pedwarn ("wrong type argument to decrement");
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "wrong type argument to decrement");
}
inc = c_size_in_bytes (TREE_TYPE (result_type));
@@ -3351,7 +3350,7 @@ c_mark_addressable (tree exp)
("global register variable %qD used in nested function", x);
return false;
}
- pedwarn ("register variable %qD used in nested function", x);
+ pedwarn (0, "register variable %qD used in nested function", x);
}
else if (C_DECL_REGISTER (x))
{
@@ -3458,8 +3457,9 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
}
else if (code1 == VOID_TYPE || code2 == VOID_TYPE)
{
- if (pedantic && (code1 != VOID_TYPE || code2 != VOID_TYPE))
- pedwarn ("ISO C forbids conditional expr with only one void side");
+ if (code1 != VOID_TYPE || code2 != VOID_TYPE)
+ pedwarn (OPT_pedantic,
+ "ISO C forbids conditional expr with only one void side");
result_type = void_type_node;
}
else if (code1 == POINTER_TYPE && code2 == POINTER_TYPE)
@@ -3472,30 +3472,30 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
result_type = qualify_type (type1, type2);
else if (VOID_TYPE_P (TREE_TYPE (type1)))
{
- if (pedantic && TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids conditional expr between "
+ if (TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
+ pedwarn (OPT_pedantic, "ISO C forbids conditional expr between "
"%<void *%> and function pointer");
result_type = build_pointer_type (qualify_type (TREE_TYPE (type1),
TREE_TYPE (type2)));
}
else if (VOID_TYPE_P (TREE_TYPE (type2)))
{
- if (pedantic && TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids conditional expr between "
+ if (TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
+ pedwarn (OPT_pedantic, "ISO C forbids conditional expr between "
"%<void *%> and function pointer");
result_type = build_pointer_type (qualify_type (TREE_TYPE (type2),
TREE_TYPE (type1)));
}
else
{
- pedwarn ("pointer type mismatch in conditional expression");
+ pedwarn (0, "pointer type mismatch in conditional expression");
result_type = build_pointer_type (void_type_node);
}
}
else if (code1 == POINTER_TYPE && code2 == INTEGER_TYPE)
{
if (!null_pointer_constant_p (orig_op2))
- pedwarn ("pointer/integer type mismatch in conditional expression");
+ pedwarn (0, "pointer/integer type mismatch in conditional expression");
else
{
op2 = null_pointer_node;
@@ -3505,7 +3505,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
else if (code2 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
if (!null_pointer_constant_p (orig_op1))
- pedwarn ("pointer/integer type mismatch in conditional expression");
+ pedwarn (0, "pointer/integer type mismatch in conditional expression");
else
{
op1 = null_pointer_node;
@@ -3616,12 +3616,10 @@ build_c_cast (tree type, tree expr)
if (type == TYPE_MAIN_VARIANT (TREE_TYPE (value)))
{
- if (pedantic)
- {
- if (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE)
- pedwarn ("ISO C forbids casting nonscalar to the same type");
- }
+ if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE)
+ pedwarn (OPT_pedantic,
+ "ISO C forbids casting nonscalar to the same type");
}
else if (TREE_CODE (type) == UNION_TYPE)
{
@@ -3637,8 +3635,7 @@ build_c_cast (tree type, tree expr)
{
tree t;
- if (pedantic)
- pedwarn ("ISO C forbids casts to union type");
+ pedwarn (OPT_pedantic, "ISO C forbids casts to union type");
t = digest_init (type,
build_constructor_single (type, field, value),
true, 0);
@@ -3749,7 +3746,8 @@ build_c_cast (tree type, tree expr)
&& TREE_CODE (otype) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (otype)) == FUNCTION_TYPE
&& TREE_CODE (TREE_TYPE (type)) != FUNCTION_TYPE)
- pedwarn ("ISO C forbids conversion of function pointer to object pointer type");
+ pedwarn (OPT_pedantic, "ISO C forbids "
+ "conversion of function pointer to object pointer type");
if (pedantic
&& TREE_CODE (type) == POINTER_TYPE
@@ -3757,7 +3755,8 @@ build_c_cast (tree type, tree expr)
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
&& TREE_CODE (TREE_TYPE (otype)) != FUNCTION_TYPE
&& !null_pointer_constant_p (value))
- pedwarn ("ISO C forbids conversion of object pointer to function pointer type");
+ pedwarn (OPT_pedantic, "ISO C forbids "
+ "conversion of object pointer to function pointer type");
ovalue = value;
value = convert (type, value);
@@ -3953,19 +3952,19 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
switch (errtype) \
{ \
case ic_argpass: \
- pedwarn (AR, parmnum, rname); \
+ pedwarn (0, AR, parmnum, rname); \
break; \
case ic_argpass_nonproto: \
- warning (0, AR, parmnum, rname); \
+ warning (0, AR, parmnum, rname); \
break; \
case ic_assign: \
- pedwarn (AS); \
+ pedwarn (0, AS); \
break; \
case ic_init: \
- pedwarn (IN); \
+ pedwarn (0, IN); \
break; \
case ic_return: \
- pedwarn (RE); \
+ pedwarn (0, RE); \
break; \
default: \
gcc_unreachable (); \
@@ -4172,8 +4171,9 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
memb = marginal_memb;
}
- if (pedantic && (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl)))
- pedwarn ("ISO C prohibits argument conversion to union type");
+ if (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl))
+ pedwarn (OPT_pedantic,
+ "ISO C prohibits argument conversion to union type");
rhs = fold_convert (TREE_TYPE (memb), rhs);
return build_constructor_single (type, memb, rhs);
@@ -4618,19 +4618,20 @@ error_init (const char *msgid)
error ("(near initialization for %qs)", ofwhat);
}
-/* Issue a pedantic warning for a bad initializer component.
- MSGID identifies the message.
- The component name is taken from the spelling stack. */
+/* Issue a pedantic warning for a bad initializer component. OPT is
+ the option OPT_* (from options.h) controlling this warning or 0 if
+ it is unconditionally given. MSGID identifies the message. The
+ component name is taken from the spelling stack. */
void
-pedwarn_init (const char *msgid)
+pedwarn_init (int opt, const char *msgid)
{
char *ofwhat;
- pedwarn ("%s", _(msgid));
+ pedwarn (opt, "%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
- pedwarn ("(near initialization for %qs)", ofwhat);
+ pedwarn (opt, "(near initialization for %qs)", ofwhat);
}
/* Issue a warning for a bad initializer component.
@@ -4661,7 +4662,8 @@ maybe_warn_string_init (tree type, struct c_expr expr)
&& TREE_CODE (type) == ARRAY_TYPE
&& TREE_CODE (expr.value) == STRING_CST
&& expr.original_code != STRING_CST)
- pedwarn_init ("array initialized from parenthesized string constant");
+ pedwarn_init (OPT_pedantic,
+ "array initialized from parenthesized string constant");
}
/* Digest the parser output INIT as an initializer for type TYPE.
@@ -4754,7 +4756,7 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
TREE_STRING_LENGTH (inside_init)
- (TYPE_PRECISION (typ1)
/ BITS_PER_UNIT)))
- pedwarn_init ("initializer-string for array of chars is too long");
+ pedwarn_init (0, "initializer-string for array of chars is too long");
return inside_init;
}
@@ -4869,7 +4871,7 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
if (inside_init == error_mark_node)
error_init ("initializer element is not constant");
else
- pedwarn_init ("initializer element is not constant");
+ pedwarn_init (OPT_pedantic, "initializer element is not constant");
if (flag_pedantic_errors)
inside_init = error_mark_node;
}
@@ -5542,8 +5544,8 @@ pop_init_level (int implicit)
if (constructor_depth > 2)
error_init ("initialization of flexible array member in a nested context");
- else if (pedantic)
- pedwarn_init ("initialization of a flexible array member");
+ else
+ pedwarn_init (OPT_pedantic, "initialization of a flexible array member");
/* We have already issued an error message for the existence
of a flexible array member not at the end of the structure.
@@ -6280,7 +6282,7 @@ output_init_element (tree value, bool strict_string, tree type, tree field,
value = error_mark_node;
}
else if (require_constant_elements)
- pedwarn ("initializer element is not computable at load time");
+ pedwarn (0, "initializer element is not computable at load time");
}
/* If this field is empty (and not at the end of structure),
@@ -6607,7 +6609,7 @@ process_init_element (struct c_expr value)
if (constructor_fields == 0)
{
- pedwarn_init ("excess elements in struct initializer");
+ pedwarn_init (0, "excess elements in struct initializer");
break;
}
@@ -6690,7 +6692,7 @@ process_init_element (struct c_expr value)
if (constructor_fields == 0)
{
- pedwarn_init ("excess elements in union initializer");
+ pedwarn_init (0, "excess elements in union initializer");
break;
}
@@ -6777,7 +6779,7 @@ process_init_element (struct c_expr value)
&& (tree_int_cst_lt (constructor_max_index, constructor_index)
|| integer_all_onesp (constructor_max_index)))
{
- pedwarn_init ("excess elements in array initializer");
+ pedwarn_init (0, "excess elements in array initializer");
break;
}
@@ -6807,7 +6809,7 @@ process_init_element (struct c_expr value)
always have a fixed size derived from their type. */
if (tree_int_cst_lt (constructor_max_index, constructor_index))
{
- pedwarn_init ("excess elements in vector initializer");
+ pedwarn_init (0, "excess elements in vector initializer");
break;
}
@@ -6831,7 +6833,7 @@ process_init_element (struct c_expr value)
else if (constructor_type != error_mark_node
&& constructor_fields == 0)
{
- pedwarn_init ("excess elements in scalar initializer");
+ pedwarn_init (0, "excess elements in scalar initializer");
break;
}
else
@@ -7062,8 +7064,7 @@ c_finish_goto_label (tree label)
tree
c_finish_goto_ptr (tree expr)
{
- if (pedantic)
- pedwarn ("ISO C forbids %<goto *expr;%>");
+ pedwarn (OPT_pedantic, "ISO C forbids %<goto *expr;%>");
expr = convert (ptr_type_node, expr);
return add_stmt (build1 (GOTO_EXPR, void_type_node, expr));
}
@@ -7086,7 +7087,8 @@ c_finish_return (tree retval)
if ((warn_return_type || flag_isoc99)
&& valtype != 0 && TREE_CODE (valtype) != VOID_TYPE)
{
- pedwarn_c99 ("%<return%> with no value, in "
+ pedwarn_c99 (flag_isoc99 ? 0 : OPT_Wreturn_type,
+ "%<return%> with no value, in "
"function returning non-void");
no_warning = true;
}
@@ -7095,9 +7097,10 @@ c_finish_return (tree retval)
{
current_function_returns_null = 1;
if (TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
- pedwarn ("%<return%> with a value, in function returning void");
- else if (pedantic)
- pedwarn ("ISO C forbids %<return%> with expression, in function returning void");
+ pedwarn (0, "%<return%> with a value, in function returning void");
+ else
+ pedwarn (OPT_pedantic, "ISO C forbids "
+ "%<return%> with expression, in function returning void");
}
else
{
@@ -8167,20 +8170,20 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
whose value is 0 but which isn't a valid null ptr const. */
if (pedantic && !null_pointer_constant_p (orig_op0)
&& TREE_CODE (tt1) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids comparison of %<void *%>"
- " with function pointer");
+ pedwarn (OPT_pedantic, "ISO C forbids "
+ "comparison of %<void *%> with function pointer");
}
else if (VOID_TYPE_P (tt1))
{
if (pedantic && !null_pointer_constant_p (orig_op1)
&& TREE_CODE (tt0) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids comparison of %<void *%>"
- " with function pointer");
+ pedwarn (OPT_pedantic, "ISO C forbids "
+ "comparison of %<void *%> with function pointer");
}
else
/* Avoid warning about the volatile ObjC EH puts on decls. */
if (!objc_ok)
- pedwarn ("comparison of distinct pointer types lacks a cast");
+ pedwarn (0, "comparison of distinct pointer types lacks a cast");
if (result_type == NULL_TREE)
result_type = ptr_type_node;
@@ -8204,12 +8207,12 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- pedwarn ("comparison between pointer and integer");
+ pedwarn (0, "comparison between pointer and integer");
}
else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
{
result_type = type1;
- pedwarn ("comparison between pointer and integer");
+ pedwarn (0, "comparison between pointer and integer");
}
break;
@@ -8230,38 +8233,42 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
result_type = common_pointer_type (type0, type1);
if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
!= !COMPLETE_TYPE_P (TREE_TYPE (type1)))
- pedwarn ("comparison of complete and incomplete pointers");
- else if (pedantic
- && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
+ pedwarn (0, "comparison of complete and incomplete pointers");
+ else if (TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+ pedwarn (OPT_pedantic, "ISO C forbids "
+ "ordered comparisons of pointers to functions");
}
else
{
result_type = ptr_type_node;
- pedwarn ("comparison of distinct pointer types lacks a cast");
+ pedwarn (0, "comparison of distinct pointer types lacks a cast");
}
}
else if (code0 == POINTER_TYPE && null_pointer_constant_p (orig_op1))
{
result_type = type0;
- if (pedantic || extra_warnings)
- pedwarn ("ordered comparison of pointer with integer zero");
+ if (pedantic)
+ pedwarn (OPT_pedantic,
+ "ordered comparison of pointer with integer zero");
+ else if (extra_warnings)
+ warning (OPT_Wextra,
+ "ordered comparison of pointer with integer zero");
}
else if (code1 == POINTER_TYPE && null_pointer_constant_p (orig_op0))
{
result_type = type1;
- if (pedantic)
- pedwarn ("ordered comparison of pointer with integer zero");
+ pedwarn (OPT_pedantic,
+ "ordered comparison of pointer with integer zero");
}
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- pedwarn ("comparison between pointer and integer");
+ pedwarn (0, "comparison between pointer and integer");
}
else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
{
result_type = type1;
- pedwarn ("comparison between pointer and integer");
+ pedwarn (0, "comparison between pointer and integer");
}
break;
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 2aad6350705..96ff417f687 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -632,28 +632,6 @@ expand_one_stack_var (tree var)
expand_one_stack_var_at (var, offset);
}
-/* A subroutine of expand_one_var. Called to assign rtl
- to a TREE_STATIC VAR_DECL. */
-
-static void
-expand_one_static_var (tree var)
-{
- /* In unit-at-a-time all the static variables are expanded at the end
- of compilation process. */
- if (flag_unit_at_a_time)
- return;
- /* If this is an inlined copy of a static local variable,
- look up the original. */
- var = DECL_ORIGIN (var);
-
- /* If we've already processed this variable because of that, do nothing. */
- if (TREE_ASM_WRITTEN (var))
- return;
-
- /* Otherwise, just emit the variable. */
- rest_of_decl_compilation (var, 0, 0);
-}
-
/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL
that will reside in a hard register. */
@@ -782,10 +760,7 @@ expand_one_var (tree var, bool toplevel, bool really_expand)
else if (DECL_HAS_VALUE_EXPR_P (var))
;
else if (TREE_STATIC (var))
- {
- if (really_expand)
- expand_one_static_var (var);
- }
+ ;
else if (DECL_RTL_SET_P (var))
;
else if (TREE_TYPE (var) == error_mark_node)
@@ -830,12 +805,7 @@ expand_used_vars_for_block (tree block, bool toplevel)
/* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
- if (TREE_USED (t)
- /* Force local static variables to be output when marked by
- used attribute. For unit-at-a-time, cgraph code already takes
- care of this. */
- || (!flag_unit_at_a_time && TREE_STATIC (t)
- && DECL_PRESERVE_P (t)))
+ if (TREE_USED (t))
expand_one_var (t, toplevel, true);
this_sv_num = stack_vars_num;
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 881bc42dfe1..b88ab68f056 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -412,17 +412,6 @@ cgraph_node (tree decl)
node->master_clone = node;
}
- /* This code can go away once flag_unit_at_a_mode is removed. */
- if (assembler_name_hash)
- {
- tree name = DECL_ASSEMBLER_NAME (node->decl);
- slot = ((struct cgraph_node **)
- htab_find_slot_with_hash (assembler_name_hash, name,
- decl_assembler_name_hash (name),
- INSERT));
- if (!*slot)
- *slot = node;
- }
return node;
}
@@ -625,6 +614,7 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
gcc_assert (freq >= 0);
gcc_assert (freq <= CGRAPH_FREQ_MAX);
edge->loop_nest = nest;
+ edge->indirect_call = 0;
edge->uid = cgraph_edge_max_uid++;
if (caller->call_site_hash)
{
@@ -893,7 +883,7 @@ cgraph_remove_node (struct cgraph_node *node)
htab_clear_slot (assembler_name_hash, slot);
}
- if (kill_body && flag_unit_at_a_time)
+ if (kill_body)
cgraph_release_function_body (node);
node->decl = NULL;
if (node->call_site_hash)
@@ -1048,6 +1038,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
edge->frequency / (double)CGRAPH_FREQ_BASE);
if (!edge->inline_failed)
fprintf(f, "(inlined) ");
+ if (edge->indirect_call)
+ fprintf(f, "(indirect) ");
}
fprintf (f, "\n calls: ");
@@ -1057,6 +1049,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
edge->callee->uid);
if (!edge->inline_failed)
fprintf(f, "(inlined) ");
+ if (edge->indirect_call)
+ fprintf(f, "(indirect) ");
if (edge->count)
fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ",
(HOST_WIDEST_INT)edge->count);
@@ -1146,7 +1140,7 @@ bool
cgraph_function_possibly_inlined_p (tree decl)
{
if (!cgraph_global_info_ready)
- return (DECL_INLINE (decl) && !flag_really_no_inline);
+ return !DECL_UNINLINABLE (decl) && !flag_really_no_inline;
return DECL_POSSIBLY_INLINED (decl);
}
@@ -1166,6 +1160,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
e->loop_nest + loop_nest);
new->inline_failed = e->inline_failed;
+ new->indirect_call = e->indirect_call;
if (update_original)
{
e->count -= new->count;
@@ -1366,7 +1361,7 @@ cgraph_add_new_function (tree fndecl, bool lowered)
if (!lowered)
tree_lowering_passes (fndecl);
bitmap_obstack_initialize (NULL);
- if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)) && optimize)
+ if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
execute_pass_list (pass_early_local_passes.pass.sub);
bitmap_obstack_release (NULL);
tree_rest_of_compilation (fndecl);
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index b817f87f7f0..f36f6f577a2 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -208,7 +208,9 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call
per function call. The range is 0 to CGRAPH_FREQ_MAX. */
int frequency;
/* Depth of loop nest, 1 means no loop nest. */
- int loop_nest;
+ unsigned int loop_nest : 31;
+ /* Whether this edge describes a call that was originally indirect. */
+ unsigned int indirect_call : 1;
/* Unique id of the edge. */
int uid;
};
@@ -376,6 +378,7 @@ void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
/* In cgraphbuild.c */
unsigned int rebuild_cgraph_edges (void);
+int compute_call_stmt_bb_frequency (basic_block bb);
/* In ipa.c */
bool cgraph_remove_unreachable_nodes (bool, FILE *);
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 19e198344b6..60b691113d9 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -38,6 +38,7 @@ static tree
record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
tree t = *tp;
+ tree decl;
switch (TREE_CODE (t))
{
@@ -52,32 +53,23 @@ record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case FDESC_EXPR:
case ADDR_EXPR:
- if (flag_unit_at_a_time)
- {
- /* Record dereferences to the functions. This makes the
- functions reachable unconditionally. */
- tree decl = TREE_OPERAND (*tp, 0);
- if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_mark_needed_node (cgraph_node (decl));
- }
+ /* Record dereferences to the functions. This makes the
+ functions reachable unconditionally. */
+ decl = TREE_OPERAND (*tp, 0);
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ cgraph_mark_needed_node (cgraph_node (decl));
break;
case OMP_PARALLEL:
- if (flag_unit_at_a_time)
- {
- if (OMP_PARALLEL_FN (*tp))
- cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp)));
- }
+ if (OMP_PARALLEL_FN (*tp))
+ cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp)));
break;
case OMP_TASK:
- if (flag_unit_at_a_time)
- {
- if (OMP_TASK_FN (*tp))
- cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp)));
- if (OMP_TASK_COPYFN (*tp))
- cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp)));
- }
+ if (OMP_TASK_FN (*tp))
+ cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp)));
+ if (OMP_TASK_COPYFN (*tp))
+ cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp)));
break;
default:
@@ -122,6 +114,25 @@ initialize_inline_failed (struct cgraph_node *node)
}
}
+/* Computes the frequency of the call statement so that it can be stored in
+ cgraph_edge. BB is the basic block of the call statement. */
+int
+compute_call_stmt_bb_frequency (basic_block bb)
+{
+ int entry_freq = ENTRY_BLOCK_PTR->frequency;
+ int freq;
+
+ if (!entry_freq)
+ entry_freq = 1;
+
+ freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
+ : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
+ if (freq > CGRAPH_FREQ_MAX)
+ freq = CGRAPH_FREQ_MAX;
+
+ return freq;
+}
+
/* Create cgraph edges for function calls.
Also look for functions and variables having addresses taken. */
@@ -133,10 +144,6 @@ build_cgraph_edges (void)
struct pointer_set_t *visited_nodes = pointer_set_create ();
block_stmt_iterator bsi;
tree step;
- int entry_freq = ENTRY_BLOCK_PTR->frequency;
-
- if (!entry_freq)
- entry_freq = 1;
/* Create the callgraph edges and record the nodes referenced by the function.
body. */
@@ -151,12 +158,8 @@ build_cgraph_edges (void)
{
int i;
int n = call_expr_nargs (call);
- int freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
- : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
- if (freq > CGRAPH_FREQ_MAX)
- freq = CGRAPH_FREQ_MAX;
cgraph_create_edge (node, cgraph_node (decl), stmt,
- bb->count, freq,
+ bb->count, compute_call_stmt_bb_frequency (bb),
bb->loop_depth);
for (i = 0; i < n; i++)
walk_tree (&CALL_EXPR_ARG (call, i),
@@ -176,8 +179,7 @@ build_cgraph_edges (void)
{
tree decl = TREE_VALUE (step);
if (TREE_CODE (decl) == VAR_DECL
- && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
- && flag_unit_at_a_time)
+ && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
varpool_finalize_decl (decl);
else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl))
walk_tree (&DECL_INITIAL (decl), record_reference, node, visited_nodes);
@@ -227,10 +229,6 @@ rebuild_cgraph_edges (void)
basic_block bb;
struct cgraph_node *node = cgraph_node (current_function_decl);
block_stmt_iterator bsi;
- int entry_freq = ENTRY_BLOCK_PTR->frequency;
-
- if (!entry_freq)
- entry_freq = 1;
cgraph_node_remove_callees (node);
@@ -244,14 +242,9 @@ rebuild_cgraph_edges (void)
tree decl;
if (call && (decl = get_callee_fndecl (call)))
- {
- int freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
- : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
- if (freq > CGRAPH_FREQ_MAX)
- freq = CGRAPH_FREQ_MAX;
- cgraph_create_edge (node, cgraph_node (decl), stmt,
- bb->count, freq, bb->loop_depth);
- }
+ cgraph_create_edge (node, cgraph_node (decl), stmt,
+ bb->count, compute_call_stmt_bb_frequency (bb),
+ bb->loop_depth);
}
initialize_inline_failed (node);
gcc_assert (!node->global.inlined_to);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 5994ad12a03..9f4f87c2451 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see
This function is called once (source level) compilation unit is finalized
and it will no longer change.
- In the unit-at-a-time the call-graph construction and local function
+ In the the call-graph construction and local function
analysis takes place here. Bodies of unreachable functions are released
to conserve memory usage.
@@ -77,9 +77,7 @@ along with GCC; see the file COPYING3. If not see
??? On the tree-ssa genericizing should take place here and we will avoid
need for these hooks (replacing them by genericizing hook)
- We implement two compilation modes.
-
- - unit-at-a-time: In this mode analyzing of all functions is deferred
+ Analyzing of all functions is deferred
to cgraph_finalize_compilation_unit and expansion into cgraph_optimize.
In cgraph_finalize_compilation_unit the reachable functions are
@@ -105,23 +103,7 @@ along with GCC; see the file COPYING3. If not see
??? Reorganize code so variables are output very last and only if they
really has been referenced by produced code, so we catch more cases
- where reference has been optimized out.
-
- - non-unit-at-a-time
-
- All functions are variables are output as early as possible to conserve
- memory consumption. This may or may not result in less memory used but
- it is still needed for some legacy code that rely on particular ordering
- of things output from the compiler.
-
- Varpool data structures are not used and variables are output directly.
-
- Functions are output early using call of
- cgraph_assemble_pending_function from cgraph_finalize_function. The
- decision on whether function is needed is made more conservative so
- uninlinable static functions are needed too. During the call-graph
- construction the edge destinations are not marked as reachable and it
- is completely relied upon assemble_variable to mark them. */
+ where reference has been optimized out. */
#include "config.h"
@@ -190,7 +172,6 @@ record_cdtor_fn (tree fndecl)
VEC_safe_push (tree, gc, static_dtors, fndecl);
DECL_STATIC_DESTRUCTOR (fndecl) = 0;
}
- DECL_INLINE (fndecl) = 1;
node = cgraph_node (fndecl);
node->local.disregard_inline_limits = 1;
cgraph_mark_reachable_node (node);
@@ -326,13 +307,11 @@ cgraph_build_cdtor_fns (void)
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
- configury, or (if not doing unit-at-a-time) to something we haven't
- seen yet. */
+ configury. */
static bool
decide_is_function_needed (struct cgraph_node *node, tree decl)
{
- tree origin;
if (MAIN_NAME_P (DECL_NAME (decl))
&& TREE_PUBLIC (decl))
{
@@ -344,9 +323,6 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
if (node->local.externally_visible)
return true;
- if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- return true;
-
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
in assemble_name then. This is arguably a bug. */
@@ -389,32 +365,6 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))
return true;
- if (flag_unit_at_a_time)
- return false;
-
- /* If not doing unit at a time, then we'll only defer this function
- if its marked for inlining. Otherwise we want to emit it now. */
-
- /* "extern inline" functions are never output locally. */
- if (DECL_EXTERNAL (decl))
- return false;
- /* Nested functions of extern inline function shall not be emit unless
- we inlined the origin. */
- for (origin = decl_function_context (decl); origin;
- origin = decl_function_context (origin))
- if (DECL_EXTERNAL (origin))
- return false;
- /* We want to emit COMDAT functions only when absolutely necessary. */
- if (DECL_COMDAT (decl))
- return false;
- if (!DECL_INLINE (decl)
- || (!node->local.disregard_inline_limits
- /* When declared inline, defer even the uninlinable functions.
- This allows them to be eliminated when unused. */
- && !DECL_DECLARED_INLINE_P (decl)
- && (!node->local.inlinable || !cgraph_default_inline_p (node, NULL))))
- return true;
-
return false;
}
@@ -487,39 +437,6 @@ cgraph_process_new_functions (void)
return output;
}
-/* When not doing unit-at-a-time, output all functions enqueued.
- Return true when such a functions were found. */
-
-static bool
-cgraph_assemble_pending_functions (void)
-{
- bool output = false;
-
- if (flag_unit_at_a_time || errorcount || sorrycount)
- return false;
-
- cgraph_output_pending_asms ();
-
- while (cgraph_nodes_queue)
- {
- struct cgraph_node *n = cgraph_nodes_queue;
-
- cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
- n->next_needed = NULL;
- if (!n->global.inlined_to
- && !n->alias
- && !DECL_EXTERNAL (n->decl))
- {
- cgraph_expand_function (n);
- output = true;
- }
- output |= cgraph_process_new_functions ();
- }
-
- return output;
-}
-
-
/* As an GCC extension we allow redefinition of the function. The
semantics when both copies of bodies differ is not well defined.
We replace the old body with new body so in unit at a time mode
@@ -533,12 +450,11 @@ cgraph_assemble_pending_functions (void)
static void
cgraph_reset_node (struct cgraph_node *node)
{
- /* If node->output is set, then this is a unit-at-a-time compilation
- and we have already begun whole-unit analysis. This is *not*
- testing for whether we've already emitted the function. That
- case can be sort-of legitimately seen with real function
- redefinition errors. I would argue that the front end should
- never present us with such a case, but don't enforce that for now. */
+ /* If node->output is set, then we have already begun whole-unit analysis.
+ This is *not* testing for whether we've already emitted the function.
+ That case can be sort-of legitimately seen with real function redefinition
+ errors. I would argue that the front end should never present us with
+ such a case, but don't enforce that for now. */
gcc_assert (!node->output);
/* Reset our data structures so we can analyze the function again. */
@@ -549,18 +465,6 @@ cgraph_reset_node (struct cgraph_node *node)
node->local.redefined_extern_inline = true;
node->local.finalized = false;
- if (!flag_unit_at_a_time)
- {
- struct cgraph_node *n, *next;
-
- for (n = cgraph_nodes; n; n = next)
- {
- next = n->next;
- if (n->global.inlined_to == node)
- cgraph_remove_node (n);
- }
- }
-
cgraph_node_remove_callees (node);
/* We may need to re-queue the node for assembling in case
@@ -609,11 +513,6 @@ cgraph_finalize_function (tree decl, bool nested)
lower_nested_functions (decl);
gcc_assert (!node->nested);
- /* If not unit at a time, then we need to create the call graph
- now, so that called functions can be queued and emitted now. */
- if (!flag_unit_at_a_time)
- cgraph_analyze_function (node);
-
if (decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
@@ -623,14 +522,6 @@ cgraph_finalize_function (tree decl, bool nested)
if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)))
cgraph_mark_reachable_node (node);
- /* If not unit at a time, go ahead and emit everything we've found
- to be reachable at this time. */
- if (!nested)
- {
- if (!cgraph_assemble_pending_functions ())
- ggc_collect ();
- }
-
/* If we've not yet emitted decl, tell the debug info about it. */
if (!TREE_ASM_WRITTEN (decl))
(*debug_hooks->deferred_inline_function) (decl);
@@ -638,6 +529,9 @@ cgraph_finalize_function (tree decl, bool nested)
/* Possibly warn about unused parameters. */
if (warn_unused_parameter)
do_warn_unused_parameter (decl);
+
+ if (!nested)
+ ggc_collect ();
}
/* C99 extern inline keywords allow changing of declaration after function
@@ -796,7 +690,7 @@ verify_cgraph_node (struct cgraph_node *node)
for (e = node->callees; e; e = e->next_callee)
{
- if (!e->aux)
+ if (!e->aux && !e->indirect_call)
{
error ("edge %s->%s has no corresponding call_stmt",
cgraph_node_name (e->caller),
@@ -855,16 +749,6 @@ cgraph_analyze_function (struct cgraph_node *node)
cgraph_lower_function (node);
node->analyzed = true;
- if (!flag_unit_at_a_time && !sorrycount && !errorcount)
- {
- bitmap_obstack_initialize (NULL);
- tree_register_cfg_hooks ();
- execute_pass_list (pass_early_local_passes.pass.sub);
- free_dominance_info (CDI_POST_DOMINATORS);
- free_dominance_info (CDI_DOMINATORS);
- bitmap_obstack_release (NULL);
- }
-
pop_cfun ();
current_function_decl = NULL;
}
@@ -1072,14 +956,6 @@ cgraph_finalize_compilation_unit (void)
finish_aliases_1 ();
- if (!flag_unit_at_a_time)
- {
- cgraph_output_pending_asms ();
- cgraph_assemble_pending_functions ();
- varpool_output_debug_info ();
- return;
- }
-
if (!quiet_flag)
{
fprintf (stderr, "\nAnalyzing compilation unit\n");
@@ -1147,8 +1023,7 @@ cgraph_expand_function (struct cgraph_node *node)
/* We ought to not compile any inline clones. */
gcc_assert (!node->global.inlined_to);
- if (flag_unit_at_a_time)
- announce_function (decl);
+ announce_function (decl);
gcc_assert (node->lowered);
@@ -1335,10 +1210,8 @@ bool
cgraph_preserve_function_body_p (tree decl)
{
struct cgraph_node *node;
- if (!cgraph_global_info_ready)
- return (flag_really_no_inline
- ? DECL_DISREGARD_INLINE_LIMITS (decl)
- : DECL_INLINE (decl));
+
+ gcc_assert (cgraph_global_info_ready);
/* Look if there is any clone around. */
for (node = cgraph_node (decl); node; node = node->next_clone)
if (node->global.inlined_to)
@@ -1372,16 +1245,6 @@ cgraph_optimize (void)
/* Call functions declared with the "constructor" or "destructor"
attribute. */
cgraph_build_cdtor_fns ();
- if (!flag_unit_at_a_time)
- {
- cgraph_assemble_pending_functions ();
- cgraph_process_new_functions ();
- cgraph_state = CGRAPH_STATE_FINISHED;
- cgraph_output_pending_asms ();
- varpool_assemble_pending_decls ();
- varpool_output_debug_info ();
- return;
- }
/* Frontend may output common variables after the unit has been finalized.
It is safe to deal with them here as they are always zero initialized. */
@@ -1453,8 +1316,7 @@ cgraph_optimize (void)
verify_cgraph ();
/* Double check that all inline clones are gone and that all
function bodies have been released from memory. */
- if (flag_unit_at_a_time
- && !(sorrycount || errorcount))
+ if (!(sorrycount || errorcount))
{
struct cgraph_node *node;
bool error_found = false;
@@ -1683,29 +1545,10 @@ save_inline_function_body (struct cgraph_node *node)
cgraph_lower_function (node);
- /* In non-unit-at-a-time we construct full fledged clone we never output to
- assembly file. This clone is pointed out by inline_decl of original function
- and inlining infrastructure knows how to deal with this. */
- if (!flag_unit_at_a_time)
- {
- struct cgraph_edge *e;
-
- first_clone = cgraph_clone_node (node, node->count, 0, CGRAPH_FREQ_BASE,
- false);
- first_clone->needed = 0;
- first_clone->reachable = 1;
- /* Recursively clone all bodies. */
- for (e = first_clone->callees; e; e = e->next_callee)
- if (!e->inline_failed)
- cgraph_clone_inlined_nodes (e, true, false);
- }
- else
- first_clone = node->next_clone;
+ first_clone = node->next_clone;
first_clone->decl = copy_node (node->decl);
node->next_clone = NULL;
- if (!flag_unit_at_a_time)
- node->inline_decl = first_clone->decl;
first_clone->prev_clone = NULL;
cgraph_insert_node_to_hashtable (first_clone);
gcc_assert (first_clone == cgraph_node (first_clone->decl));
diff --git a/gcc/combine.c b/gcc/combine.c
index 706ee0689f3..16cd040afd5 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1340,8 +1340,7 @@ setup_incoming_promotions (rtx first)
function lie within the current compilation unit. (This does
take into account the exporting of a function via taking its
address, and so forth.) */
- if (flag_unit_at_a_time)
- strictly_local = cgraph_local_info (current_function_decl)->local;
+ strictly_local = cgraph_local_info (current_function_decl)->local;
/* The mode and signedness of the argument before any promotions happen
(equal to the mode of the pseudo holding it at that stage). */
diff --git a/gcc/common.opt b/gcc/common.opt
index 28a5af25dd9..5d730a8cbf4 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -59,11 +59,11 @@ Common Joined Separate UInteger
-G<number> Put global and static data smaller than <number> bytes into a special section (on some targets)
O
-Common JoinedOrMissing
+Common JoinedOrMissing Optimization
-O<number> Set optimization level to <number>
Os
-Common
+Common Optimization
Optimize for space rather than speed
W
@@ -275,28 +275,28 @@ fabi-version=
Common Joined UInteger Var(flag_abi_version) Init(2)
falign-functions
-Common Report Var(align_functions,0)
+Common Report Var(align_functions,0) Optimization UInteger
Align the start of functions
falign-functions=
Common RejectNegative Joined UInteger
falign-jumps
-Common Report Var(align_jumps,0) Optimization
+Common Report Var(align_jumps,0) Optimization UInteger
Align labels which are only reached by jumping
falign-jumps=
Common RejectNegative Joined UInteger
falign-labels
-Common Report Var(align_labels,0) Optimization
+Common Report Var(align_labels,0) Optimization UInteger
Align all labels
falign-labels=
Common RejectNegative Joined UInteger
falign-loops
-Common Report Var(align_loops) Optimization
+Common Report Var(align_loops) Optimization UInteger
Align the start of loops
falign-loops=
@@ -571,6 +571,10 @@ finhibit-size-directive
Common Report Var(flag_inhibit_size_directive)
Do not generate .size directives
+findirect-inlining
+Common Report Var(flag_indirect_inlining)
+Perform indirect inlining
+
; Nonzero means that functions declared `inline' will be treated
; as `static'. Prevents generation of zillions of copies of unused
; static inline functions; instead, `inlines' are written out
@@ -666,7 +670,7 @@ Common
Does nothing. Preserved for backward compatibility.
fmath-errno
-Common Report Var(flag_errno_math) Init(1)
+Common Report Var(flag_errno_math) Init(1) Optimization
Set errno after built-in math functions
fmem-report
@@ -925,7 +929,7 @@ Reschedule instructions after register allocation
; sched_stalled_insns means that insns can be moved prematurely from the queue
; of stalled insns into the ready list.
fsched-stalled-insns
-Common Report Var(flag_sched_stalled_insns) Optimization
+Common Report Var(flag_sched_stalled_insns) Optimization UInteger
Allow premature scheduling of queued insns
fsched-stalled-insns=
@@ -937,7 +941,7 @@ Common RejectNegative Joined UInteger
; premature removal from the queue of stalled insns into the ready list (has
; an effect only if the flag 'sched_stalled_insns' is set).
fsched-stalled-insns-dep
-Common Report Var(flag_sched_stalled_insns_dep,1) Init(1) Optimization
+Common Report Var(flag_sched_stalled_insns_dep,1) Init(1) Optimization UInteger
Set dependence distance checking in premature scheduling of queued insns
fsched-stalled-insns-dep=
@@ -1046,7 +1050,7 @@ Common Joined RejectNegative
-ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec] Set the default thread-local storage code generation model
ftoplevel-reorder
-Common Report Var(flag_toplevel_reorder) Init(1) Optimization
+Common Report Var(flag_toplevel_reorder) Init(2) Optimization
Reorder top level functions, variables, and asms
ftracer
@@ -1157,7 +1161,7 @@ Common Report Var(flag_tree_sra) Optimization
Perform scalar replacement of aggregates
ftree-ter
-Common Report Var(flag_tree_ter) Optimization
+Common Report Var(flag_tree_ter) Init(1) Optimization
Replace temporary expressions in the SSA->normal pass
ftree-lrs
@@ -1169,7 +1173,7 @@ Common Report Var(flag_tree_vrp) Init(0) Optimization
Perform Value Range Propagation on trees
funit-at-a-time
-Common Report Var(flag_unit_at_a_time) Optimization
+Common Report Var(flag_unit_at_a_time) Init(1) Optimization
Compile whole compilation unit at a time
funroll-loops
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5cd17073380..bc818e6f585 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -294,6 +294,8 @@ fido-*-*)
;;
i[34567]86-*-*)
cpu_type=i386
+ c_target_objs="i386-c.o"
+ cxx_target_objs="i386-c.o"
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h mmintrin-common.h
@@ -301,6 +303,8 @@ i[34567]86-*-*)
;;
x86_64-*-*)
cpu_type=i386
+ c_target_objs="i386-c.o"
+ cxx_target_objs="i386-c.o"
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h mmintrin-common.h
@@ -410,8 +414,8 @@ case ${target} in
tmake_file="t-darwin ${cpu_type}/t-darwin t-slibgcc-darwin"
target_gtfiles="\$(srcdir)/config/darwin.c"
extra_options="${extra_options} darwin.opt"
- c_target_objs="darwin-c.o"
- cxx_target_objs="darwin-c.o"
+ c_target_objs="${c_target_objs} darwin-c.o"
+ cxx_target_objs="${cxx_target_objs} darwin-c.o"
fortran_target_objs="darwin-f.o"
extra_objs="darwin.o"
extra_gcc_objs="darwin-driver.o"
@@ -1028,16 +1032,16 @@ i[34567]86-*-darwin*)
;;
x86_64-*-darwin*)
with_cpu=${with_cpu:-generic}
- tmake_file="t-darwin ${cpu_type}/t-darwin64 t-slibgcc-darwin i386/t-crtpc i386/t-crtfm"
+ tmake_file="${tmake_file} t-darwin ${cpu_type}/t-darwin64 t-slibgcc-darwin i386/t-crtpc i386/t-crtfm"
tm_file="${tm_file} ${cpu_type}/darwin64.h"
;;
i[34567]86-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
- tmake_file="i386/t-i386elf t-svr4"
+ tmake_file="${tmake_file} i386/t-i386elf t-svr4"
;;
x86_64-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/x86-64.h"
- tmake_file="i386/t-i386elf t-svr4"
+ tmake_file="${tmake_file} i386/t-i386elf t-svr4"
;;
i[34567]86-*-aout*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/i386-aout.h"
@@ -1054,7 +1058,7 @@ i[34567]86-*-netbsdelf*)
;;
i[34567]86-*-netbsd*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h"
- tmake_file=t-netbsd
+ tmake_file="${tmake_file} t-netbsd"
extra_parts=""
use_collect2=yes
;;
@@ -1065,7 +1069,7 @@ x86_64-*-netbsd*)
i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
# needed to unconfuse gdb
- tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
+ tmake_file="${tmake_file} t-libc-ok t-openbsd i386/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
@@ -1126,7 +1130,7 @@ i[34567]86-*-gnu*)
i[34567]86-pc-msdosdjgpp*)
xm_file=i386/xm-djgpp.h
tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h"
- tmake_file=i386/t-djgpp
+ tmake_file="${tmake_file} i386/t-djgpp"
extra_options="${extra_options} i386/djgpp.opt"
gnu_ld=yes
gas=yes
@@ -1134,7 +1138,7 @@ i[34567]86-pc-msdosdjgpp*)
i[34567]86-*-lynxos*)
xm_defines=POSIX
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
- tmake_file="i386/t-crtstuff t-lynx"
+ tmake_file="${tmake_file} i386/t-crtstuff t-lynx"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_options="${extra_options} lynx.opt"
thread_file=lynx
@@ -1143,7 +1147,7 @@ i[34567]86-*-lynxos*)
;;
i[3456x]86-*-netware*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h tm-dwarf2.h i386/netware.h"
- tmake_file=i386/t-netware
+ tmake_file="${tmake_file} i386/t-netware"
extra_objs=netware.o
case /${with_ld} in
*/nwld)
@@ -1162,14 +1166,14 @@ i[3456x]86-*-netware*)
;;
i[34567]86-*-nto-qnx*)
tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h svr4.h i386/unix.h i386/nto.h"
- tmake_file=i386/t-nto
+ tmake_file="${tmake_file} i386/t-nto"
gnu_ld=yes
gas=yes
;;
i[34567]86-*-rtems*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h"
extra_parts="crtbegin.o crtend.o crti.o crtn.o"
- tmake_file="i386/t-rtems-i386 i386/t-crtstuff t-rtems"
+ tmake_file="${tmake_file} i386/t-rtems-i386 i386/t-crtstuff t-rtems"
;;
i[34567]86-*-solaris2*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h"
@@ -1179,9 +1183,9 @@ i[34567]86-*-solaris2*)
;;
esac
tm_file="${tm_file} i386/sol2.h"
- tmake_file="t-sol2 i386/t-sol2 t-svr4"
- c_target_objs="sol2-c.o"
- cxx_target_objs="sol2-c.o"
+ tmake_file="${tmake_file} t-sol2 i386/t-sol2 t-svr4"
+ c_target_objs="${c_target_objs} sol2-c.o"
+ cxx_target_objs="${cxx_target_objs} sol2-c.o"
extra_objs="sol2.o"
tm_p_file="${tm_p_file} sol2-protos.h"
if test x$gnu_ld = xyes; then
@@ -1247,12 +1251,12 @@ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
i[34567]86-*-pe | i[34567]86-*-cygwin*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h"
xm_file=i386/xm-cygwin.h
- tmake_file="i386/t-cygwin i386/t-cygming"
+ tmake_file="${tmake_file} i386/t-cygwin i386/t-cygming"
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
extra_options="${extra_options} i386/cygming.opt"
extra_objs="winnt.o winnt-stubs.o"
- c_target_objs="cygwin2.o msformat-c.o"
- cxx_target_objs="cygwin2.o winnt-cxx.o msformat-c.o"
+ c_target_objs="${c_target_objs} cygwin2.o msformat-c.o"
+ cxx_target_objs="${cxx_target_objs} cygwin2.o winnt-cxx.o msformat-c.o"
extra_gcc_objs=cygwin1.o
if test x$enable_threads = xyes; then
thread_file='posix'
@@ -1261,12 +1265,12 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
i[34567]86-*-mingw* | x86_64-*-mingw*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
xm_file=i386/xm-mingw32.h
- tmake_file="i386/t-cygming i386/t-mingw32"
+ tmake_file="${tmake_file} i386/t-cygming i386/t-mingw32"
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
extra_options="${extra_options} i386/cygming.opt"
extra_objs="winnt.o winnt-stubs.o"
- c_target_objs="msformat-c.o"
- cxx_target_objs="winnt-cxx.o msformat-c.o"
+ c_target_objs="${c_target_objs} msformat-c.o"
+ cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
default_use_cxa_atexit=yes
case ${enable_threads} in
"" | yes | win32)
@@ -1291,7 +1295,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
;;
i[34567]86-*-interix3*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h"
- tmake_file="i386/t-interix"
+ tmake_file="${tmake_file} i386/t-interix"
extra_objs=winnt.o
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
if test x$enable_threads = xyes ; then
@@ -2369,10 +2373,10 @@ esac
case ${target} in
i[34567]86-*-linux* | x86_64-*-linux*)
- tmake_file="${tmake_file} i386/t-pmm_malloc"
+ tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
;;
i[34567]86-*-* | x86_64-*-*)
- tmake_file="${tmake_file} i386/t-gmm_malloc"
+ tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
;;
esac
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d64b6fda34f..dfee7c3740e 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3267,11 +3267,6 @@ arm_function_in_section_p (tree decl, section *section)
/* If DECL_SECTION_NAME is set, assume it is trustworthy. */
if (!DECL_SECTION_NAME (decl))
{
- /* Only cater for unit-at-a-time mode, where we know that the user
- cannot later specify a section for DECL. */
- if (!flag_unit_at_a_time)
- return false;
-
/* Make sure that we will not create a unique section for DECL. */
if (flag_function_sections || DECL_ONE_ONLY (decl))
return false;
diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md
index 633aaaa875f..b484b55e6cd 100644
--- a/gcc/config/arm/iwmmxt.md
+++ b/gcc/config/arm/iwmmxt.md
@@ -168,8 +168,8 @@
)
(define_insn "movv8qi_internal"
- [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r")
- (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,r,mi"))]
+ [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
+ (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
"TARGET_REALLY_IWMMXT"
"*
switch (which_alternative)
@@ -183,14 +183,14 @@
default: return output_move_double (operands);
}"
[(set_attr "predicable" "yes")
- (set_attr "length" "4, 4, 4,4,4,8, 8")
- (set_attr "type" "*,store1,load1,*,*,*,load1")
- (set_attr "pool_range" "*, *, 256,*,*,*, 256")
- (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244")])
+ (set_attr "length" "4, 4, 4,4,4,8, 8,8")
+ (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
+ (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
+ (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
(define_insn "movv4hi_internal"
- [(set (match_operand:V4HI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r")
- (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,r,mi"))]
+ [(set (match_operand:V4HI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
+ (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
"TARGET_REALLY_IWMMXT"
"*
switch (which_alternative)
@@ -204,14 +204,14 @@
default: return output_move_double (operands);
}"
[(set_attr "predicable" "yes")
- (set_attr "length" "4, 4, 4,4,4,8, 8")
- (set_attr "type" "*,store1,load1,*,*,*,load1")
- (set_attr "pool_range" "*, *, 256,*,*,*, 256")
- (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244")])
+ (set_attr "length" "4, 4, 4,4,4,8, 8,8")
+ (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
+ (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
+ (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
(define_insn "movv2si_internal"
- [(set (match_operand:V2SI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r")
- (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,r,mi"))]
+ [(set (match_operand:V2SI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
+ (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
"TARGET_REALLY_IWMMXT"
"*
switch (which_alternative)
@@ -225,10 +225,10 @@
default: return output_move_double (operands);
}"
[(set_attr "predicable" "yes")
- (set_attr "length" "4, 4, 4,4,4,8, 24")
- (set_attr "type" "*,store1,load1,*,*,*,load1")
- (set_attr "pool_range" "*, *, 256,*,*,*, 256")
- (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244")])
+ (set_attr "length" "4, 4, 4,4,4,8, 24,8")
+ (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
+ (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
+ (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
;; This pattern should not be needed. It is to match a
;; wierd case generated by GCC when no optimizations are
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 05a5e495cea..843726067b6 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -1129,8 +1129,7 @@ bfin_load_pic_reg (rtx dest)
struct cgraph_local_info *i = NULL;
rtx addr, insn;
- if (flag_unit_at_a_time)
- i = cgraph_local_info (current_function_decl);
+ i = cgraph_local_info (current_function_decl);
/* Functions local to the translation unit don't need to reload the
pic reg, since the caller always passes a usable one. */
@@ -1906,6 +1905,7 @@ static bool
bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
tree exp ATTRIBUTE_UNUSED)
{
+ struct cgraph_local_info *this_func, *called_func;
e_funkind fkind = funkind (TREE_TYPE (current_function_decl));
if (fkind != SUBROUTINE)
return false;
@@ -1917,17 +1917,10 @@ bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
not need to reload P5 in the prologue, but the sibcall wil pop P5 in the
sibcall epilogue, and we end up with the wrong value in P5. */
- if (!flag_unit_at_a_time || decl == NULL)
- /* Not enough information. */
- return false;
-
- {
- struct cgraph_local_info *this_func, *called_func;
- this_func = cgraph_local_info (current_function_decl);
- called_func = cgraph_local_info (decl);
- return !called_func->local || this_func->local;
- }
+ this_func = cgraph_local_info (current_function_decl);
+ called_func = cgraph_local_info (decl);
+ return !called_func->local || this_func->local;
}
/* Emit RTL insns to initialize the variable parts of a trampoline at
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index f90bd414735..86790699f13 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -111,6 +111,7 @@ static unsigned int h8300_bitfield_length (rtx, rtx);
static unsigned int h8300_binary_length (rtx, const h8300_length_table *);
static bool h8300_short_move_mem_p (rtx, enum rtx_code);
static unsigned int h8300_move_length (rtx *, const h8300_length_table *);
+static bool h8300_hard_regno_scratch_ok (unsigned int);
/* CPU_TYPE, says what cpu we're compiling for. */
int cpu_type;
@@ -5612,6 +5613,20 @@ h8300_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
return 1;
}
+/* Returns true if register REGNO is safe to be allocated as a scratch
+ register in the current function. */
+
+static bool
+h8300_hard_regno_scratch_ok (unsigned int regno)
+{
+ if (h8300_current_function_interrupt_function_p ()
+ && ! WORD_REG_USED (regno))
+ return false;
+
+ return true;
+}
+
+
/* Return nonzero if X is a legitimate constant. */
int
@@ -5745,6 +5760,9 @@ h8300_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG h8300_reorg
+#undef TARGET_HARD_REGNO_SCRATCH_OK
+#define TARGET_HARD_REGNO_SCRATCH_OK h8300_hard_regno_scratch_ok
+
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 6001f64b42a..c6ed10d8a72 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -263,8 +263,8 @@ extern void darwin_x86_file_end (void);
: (n) >= 11 && (n) <= 18 ? (n) + 1 \
: (n))
-#undef REGISTER_TARGET_PRAGMAS
-#define REGISTER_TARGET_PRAGMAS() DARWIN_REGISTER_TARGET_PRAGMAS()
+#undef REGISTER_SUBTARGET_PRAGMAS
+#define REGISTER_SUBTARGET_PRAGMAS() DARWIN_REGISTER_TARGET_PRAGMAS()
#undef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES darwin_set_default_type_attributes
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
new file mode 100644
index 00000000000..f0a3a17f9f6
--- /dev/null
+++ b/gcc/config/i386/i386-c.c
@@ -0,0 +1,344 @@
+/* Subroutines used for macro/preprocessor support on the ia-32.
+ Copyright (C) 2008
+ 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 "tree.h"
+#include "tm_p.h"
+#include "flags.h"
+#include "c-common.h"
+#include "ggc.h"
+#include "target.h"
+#include "target-def.h"
+#include "cpplib.h"
+#include "c-pragma.h"
+
+static bool ix86_pragma_option_parse (tree);
+static void ix86_target_macros_internal
+ (int, enum processor_type, enum processor_type, enum fpmath_unit,
+ void (*def_or_undef) (cpp_reader *, const char *));
+
+
+/* Internal function to either define or undef the appropriate system
+ macros. */
+static void
+ix86_target_macros_internal (int isa_flag,
+ enum processor_type arch,
+ enum processor_type tune,
+ enum fpmath_unit fpmath,
+ void (*def_or_undef) (cpp_reader *,
+ const char *))
+{
+ /* For some of the k6/pentium varients there weren't seperate ISA bits to
+ identify which tune/arch flag was passed, so figure it out here. */
+ size_t arch_len = strlen (ix86_arch_string);
+ size_t tune_len = strlen (ix86_tune_string);
+ int last_arch_char = ix86_arch_string[arch_len - 1];
+ int last_tune_char = ix86_tune_string[tune_len - 1];
+
+ /* Built-ins based on -march=. */
+ switch (arch)
+ {
+ case PROCESSOR_I386:
+ break;
+ case PROCESSOR_I486:
+ def_or_undef (parse_in, "__i486");
+ def_or_undef (parse_in, "__i486__");
+ break;
+ case PROCESSOR_PENTIUM:
+ def_or_undef (parse_in, "__i586");
+ def_or_undef (parse_in, "__i586__");
+ def_or_undef (parse_in, "__pentium");
+ def_or_undef (parse_in, "__pentium__");
+ if (isa_flag & OPTION_MASK_ISA_MMX)
+ def_or_undef (parse_in, "__pentium_mmx__");
+ break;
+ case PROCESSOR_PENTIUMPRO:
+ def_or_undef (parse_in, "__i686");
+ def_or_undef (parse_in, "__i686__");
+ def_or_undef (parse_in, "__pentiumpro");
+ def_or_undef (parse_in, "__pentiumpro__");
+ break;
+ case PROCESSOR_GEODE:
+ def_or_undef (parse_in, "__geode");
+ def_or_undef (parse_in, "__geode__");
+ break;
+ case PROCESSOR_K6:
+ def_or_undef (parse_in, "__k6");
+ def_or_undef (parse_in, "__k6__");
+ if (last_arch_char == '2')
+ def_or_undef (parse_in, "__k6_2__");
+ else if (last_arch_char == '3')
+ def_or_undef (parse_in, "__k6_3__");
+ else if (isa_flag & OPTION_MASK_ISA_3DNOW)
+ def_or_undef (parse_in, "__k6_3__");
+ break;
+ case PROCESSOR_ATHLON:
+ def_or_undef (parse_in, "__athlon");
+ def_or_undef (parse_in, "__athlon__");
+ if (isa_flag & OPTION_MASK_ISA_SSE)
+ def_or_undef (parse_in, "__athlon_sse__");
+ break;
+ case PROCESSOR_K8:
+ def_or_undef (parse_in, "__k8");
+ def_or_undef (parse_in, "__k8__");
+ break;
+ case PROCESSOR_AMDFAM10:
+ def_or_undef (parse_in, "__amdfam10");
+ def_or_undef (parse_in, "__amdfam10__");
+ break;
+ case PROCESSOR_PENTIUM4:
+ def_or_undef (parse_in, "__pentium4");
+ def_or_undef (parse_in, "__pentium4__");
+ break;
+ case PROCESSOR_NOCONA:
+ def_or_undef (parse_in, "__nocona");
+ def_or_undef (parse_in, "__nocona__");
+ break;
+ case PROCESSOR_CORE2:
+ def_or_undef (parse_in, "__core2");
+ def_or_undef (parse_in, "__core2__");
+ break;
+ /* use PROCESSOR_max to not set/unset the arch macro. */
+ case PROCESSOR_max:
+ break;
+ case PROCESSOR_GENERIC32:
+ case PROCESSOR_GENERIC64:
+ gcc_unreachable ();
+ }
+
+ /* Built-ins based on -mtune=. */
+ switch (tune)
+ {
+ case PROCESSOR_I386:
+ def_or_undef (parse_in, "__tune_i386__");
+ break;
+ case PROCESSOR_I486:
+ def_or_undef (parse_in, "__tune_i486__");
+ break;
+ case PROCESSOR_PENTIUM:
+ def_or_undef (parse_in, "__tune_i586__");
+ def_or_undef (parse_in, "__tune_pentium__");
+ if (last_tune_char == 'x')
+ def_or_undef (parse_in, "__tune_pentium_mmx__");
+ break;
+ case PROCESSOR_PENTIUMPRO:
+ def_or_undef (parse_in, "__tune_i686__");
+ def_or_undef (parse_in, "__tune_pentiumpro__");
+ switch (last_tune_char)
+ {
+ case '3':
+ def_or_undef (parse_in, "__tune_pentium3__");
+ /* FALLTHRU */
+ case '2':
+ def_or_undef (parse_in, "__tune_pentium2__");
+ break;
+ }
+ break;
+ case PROCESSOR_GEODE:
+ def_or_undef (parse_in, "__tune_geode__");
+ break;
+ case PROCESSOR_K6:
+ def_or_undef (parse_in, "__tune_k6__");
+ if (last_tune_char == '2')
+ def_or_undef (parse_in, "__tune_k6_2__");
+ else if (last_tune_char == '3')
+ def_or_undef (parse_in, "__tune_k6_3__");
+ else if (isa_flag & OPTION_MASK_ISA_3DNOW)
+ def_or_undef (parse_in, "__tune_k6_3__");
+ break;
+ case PROCESSOR_ATHLON:
+ def_or_undef (parse_in, "__tune_athlon__");
+ if (isa_flag & OPTION_MASK_ISA_SSE)
+ def_or_undef (parse_in, "__tune_athlon_sse__");
+ break;
+ case PROCESSOR_K8:
+ def_or_undef (parse_in, "__tune_k8__");
+ break;
+ case PROCESSOR_AMDFAM10:
+ def_or_undef (parse_in, "__tune_amdfam10__");
+ break;
+ case PROCESSOR_PENTIUM4:
+ def_or_undef (parse_in, "__tune_pentium4__");
+ break;
+ case PROCESSOR_NOCONA:
+ def_or_undef (parse_in, "__tune_nocona__");
+ break;
+ case PROCESSOR_CORE2:
+ def_or_undef (parse_in, "__tune_core2__");
+ break;
+ case PROCESSOR_GENERIC32:
+ case PROCESSOR_GENERIC64:
+ break;
+ /* use PROCESSOR_max to not set/unset the tune macro. */
+ case PROCESSOR_max:
+ break;
+ }
+
+ if (isa_flag & OPTION_MASK_ISA_MMX)
+ def_or_undef (parse_in, "__MMX__");
+ if (isa_flag & OPTION_MASK_ISA_3DNOW)
+ def_or_undef (parse_in, "__3dNOW__");
+ if (isa_flag & OPTION_MASK_ISA_3DNOW_A)
+ def_or_undef (parse_in, "__3dNOW_A__");
+ if (isa_flag & OPTION_MASK_ISA_SSE)
+ def_or_undef (parse_in, "__SSE__");
+ if (isa_flag & OPTION_MASK_ISA_SSE2)
+ def_or_undef (parse_in, "__SSE2__");
+ if (isa_flag & OPTION_MASK_ISA_SSE3)
+ def_or_undef (parse_in, "__SSE3__");
+ if (isa_flag & OPTION_MASK_ISA_SSSE3)
+ def_or_undef (parse_in, "__SSSE3__");
+ if (isa_flag & OPTION_MASK_ISA_SSE4_1)
+ def_or_undef (parse_in, "__SSE4_1__");
+ if (isa_flag & OPTION_MASK_ISA_SSE4_2)
+ def_or_undef (parse_in, "__SSE4_2__");
+ if (isa_flag & OPTION_MASK_ISA_AES)
+ def_or_undef (parse_in, "__AES__");
+ if (isa_flag & OPTION_MASK_ISA_PCLMUL)
+ def_or_undef (parse_in, "__PCLMUL__");
+ if (isa_flag & OPTION_MASK_ISA_SSE4A)
+ def_or_undef (parse_in, "__SSE4A__");
+ if (isa_flag & OPTION_MASK_ISA_SSE5)
+ def_or_undef (parse_in, "__SSE5__");
+ if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE))
+ def_or_undef (parse_in, "__SSE_MATH__");
+ if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2))
+ def_or_undef (parse_in, "__SSE2_MATH__");
+}
+
+
+/* Hook to validate the current #pragma option and set the state, and update
+ the macros based on what was changed. */
+
+static bool
+ix86_pragma_option_parse (tree args)
+{
+ tree prev_tree = build_target_option_node ();
+ tree cur_tree;
+ struct cl_target_option *prev_opt;
+ struct cl_target_option *cur_opt;
+ int prev_isa;
+ int cur_isa;
+ int diff_isa;
+ enum processor_type prev_arch;
+ enum processor_type prev_tune;
+ enum processor_type cur_arch;
+ enum processor_type cur_tune;
+
+ if (! args)
+ {
+ cur_tree = target_option_default_node;
+ cl_target_option_restore (TREE_TARGET_OPTION (cur_tree));
+ }
+ else
+ {
+ cur_tree = ix86_valid_option_attribute_tree (args);
+ if (!cur_tree)
+ return false;
+ }
+
+ target_option_current_node = cur_tree;
+
+ /* Figure out the previous/current isa, arch, tune and the differences. */
+ prev_opt = TREE_TARGET_OPTION (prev_tree);
+ cur_opt = TREE_TARGET_OPTION (cur_tree);
+ prev_isa = prev_opt->ix86_isa_flags;
+ cur_isa = cur_opt->ix86_isa_flags;
+ diff_isa = (prev_isa ^ cur_isa);
+ prev_arch = prev_opt->arch;
+ prev_tune = prev_opt->tune;
+ cur_arch = cur_opt->arch;
+ cur_tune = cur_opt->tune;
+
+ /* If the same processor is used for both previous and current options, don't
+ change the macros. */
+ if (cur_arch == prev_arch)
+ cur_arch = prev_arch = PROCESSOR_max;
+
+ if (cur_tune == prev_tune)
+ cur_tune = prev_tune = PROCESSOR_max;
+
+ /* Undef all of the macros for that are no longer current. */
+ ix86_target_macros_internal (prev_isa & diff_isa,
+ prev_arch,
+ prev_tune,
+ prev_opt->fpmath,
+ cpp_undef);
+
+ /* Define all of the macros for new options that were just turned on. */
+ ix86_target_macros_internal (cur_isa & diff_isa,
+ cur_arch,
+ cur_tune,
+ cur_opt->fpmath,
+ cpp_define);
+
+ return true;
+}
+
+/* Function to tell the preprocessor about the defines for the current target. */
+
+void
+ix86_target_macros (void)
+{
+ /* 32/64-bit won't change with target specific options, so do the assert and
+ builtin_define_std calls here. */
+ if (TARGET_64BIT)
+ {
+ cpp_assert (parse_in, "cpu=x86_64");
+ cpp_assert (parse_in, "machine=x86_64");
+ cpp_define (parse_in, "__amd64");
+ cpp_define (parse_in, "__amd64__");
+ cpp_define (parse_in, "__x86_64");
+ cpp_define (parse_in, "__x86_64__");
+ }
+ else
+ {
+ cpp_assert (parse_in, "cpu=i386");
+ cpp_assert (parse_in, "machine=i386");
+ builtin_define_std ("i386");
+ }
+
+ ix86_target_macros_internal (ix86_isa_flags,
+ ix86_arch,
+ ix86_tune,
+ ix86_fpmath,
+ cpp_define);
+}
+
+
+/* Register target pragmas. We need to add the hook for parsing #pragma GCC
+ option here rather than in i386.c since it will pull in various preprocessor
+ functions, and those are not present in languages like fortran without a
+ preprocessor. */
+
+void
+ix86_register_pragmas (void)
+{
+ /* Update pragma hook to allow parsing #pragma GCC option. */
+ targetm.target_option.pragma_parse = ix86_pragma_option_parse;
+
+#ifdef REGISTER_SUBTARGET_PRAGMAS
+ REGISTER_SUBTARGET_PRAGMAS ();
+#endif
+}
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 7ae7babe86f..3276bd8e202 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Functions in i386.c */
-extern void override_options (void);
+extern void override_options (bool);
extern void optimization_options (int, int);
extern int ix86_can_use_return_insn_p (void);
@@ -203,6 +203,7 @@ extern int ix86_constant_alignment (tree, int);
extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *);
extern tree ix86_handle_selectany_attribute (tree *, tree, tree, int, bool *);
extern int x86_field_alignment (tree, int);
+extern tree ix86_valid_option_attribute_tree (tree);
#endif
extern rtx ix86_tls_get_addr (void);
@@ -216,6 +217,10 @@ extern void ix86_expand_reduc_v4sf (rtx (*)(rtx, rtx, rtx), rtx, rtx);
extern bool ix86_sse5_valid_op_p (rtx [], rtx, int, bool, int, bool);
extern void ix86_expand_sse5_multiple_memory (rtx [], int, enum machine_mode);
+/* In i386-c.c */
+extern void ix86_target_macros (void);
+extern void ix86_register_pragmas (void);
+
/* In winnt.c */
extern void i386_pe_unique_section (tree, int);
extern void i386_pe_declare_function_type (FILE *, const char *, int);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4edc688a9e5..17f3f2fa5a8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1210,7 +1210,11 @@ const struct processor_costs *ix86_cost = &pentium_cost;
#define m_GENERIC (m_GENERIC32 | m_GENERIC64)
/* Feature tests against the various tunings. */
-unsigned int ix86_tune_features[X86_TUNE_LAST] = {
+unsigned char ix86_tune_features[X86_TUNE_LAST];
+
+/* Feature tests against the various tunings used to create ix86_tune_features
+ based on the processor mask. */
+static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
/* X86_TUNE_USE_LEAVE: Leave does not affect Nocona SPEC2000 results
negatively, so enabling for Generic64 seems like good code size
tradeoff. We can't enable it for 32bit generic because it does not
@@ -1443,7 +1447,11 @@ unsigned int ix86_tune_features[X86_TUNE_LAST] = {
};
/* Feature tests against the various architecture variations. */
-unsigned int ix86_arch_features[X86_ARCH_LAST] = {
+unsigned char ix86_arch_features[X86_ARCH_LAST];
+
+/* Feature tests against the various architecture variations, used to create
+ ix86_arch_features based on the processor mask. */
+static unsigned int initial_ix86_arch_features[X86_ARCH_LAST] = {
/* X86_ARCH_CMOVE: Conditional move was added for pentiumpro. */
~(m_386 | m_486 | m_PENT | m_K6),
@@ -1785,6 +1793,26 @@ static void ix86_compute_frame_layout (struct ix86_frame *);
static bool ix86_expand_vector_init_one_nonzero (bool, enum machine_mode,
rtx, rtx, int);
+enum ix86_function_specific_strings
+{
+ IX86_FUNCTION_SPECIFIC_ARCH,
+ IX86_FUNCTION_SPECIFIC_TUNE,
+ IX86_FUNCTION_SPECIFIC_FPMATH,
+ IX86_FUNCTION_SPECIFIC_MAX
+};
+
+static char *ix86_target_string (int, int, const char *, const char *,
+ const char *, bool);
+static void ix86_debug_options (void) ATTRIBUTE_UNUSED;
+static void ix86_function_specific_save (struct cl_target_option *);
+static void ix86_function_specific_restore (struct cl_target_option *);
+static void ix86_function_specific_print (FILE *, int,
+ struct cl_target_option *);
+static bool ix86_valid_option_attribute_p (tree, tree, tree, int);
+static bool ix86_valid_option_attribute_inner_p (tree, char *[]);
+static bool ix86_can_inline_p (tree, tree);
+static void ix86_set_current_function (tree);
+
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
@@ -1792,6 +1820,10 @@ static bool ix86_expand_vector_init_one_nonzero (bool, enum machine_mode,
#define DEFAULT_PCC_STRUCT_RETURN 1
#endif
+/* Whether -mtune= or -march= were specified */
+static int ix86_tune_defaulted;
+static int ix86_arch_specified;
+
/* Bit flags that specify the ISA we are compiling for. */
int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT;
@@ -1827,6 +1859,18 @@ static int ix86_isa_flags_explicit;
#define OPTION_MASK_ISA_SSE5_SET \
(OPTION_MASK_ISA_SSE5 | OPTION_MASK_ISA_SSE4A_SET)
+/* AES and PCLMUL need SSE2 because they use xmm registers */
+#define OPTION_MASK_ISA_AES_SET \
+ (OPTION_MASK_ISA_AES | OPTION_MASK_ISA_SSE2_SET)
+#define OPTION_MASK_ISA_PCLMUL_SET \
+ (OPTION_MASK_ISA_PCLMUL | OPTION_MASK_ISA_SSE2_SET)
+
+#define OPTION_MASK_ISA_ABM_SET \
+ (OPTION_MASK_ISA_ABM | OPTION_MASK_ISA_POPCNT)
+#define OPTION_MASK_ISA_POPCNT_SET OPTION_MASK_ISA_POPCNT
+#define OPTION_MASK_ISA_CX16_SET OPTION_MASK_ISA_CX16
+#define OPTION_MASK_ISA_SAHF_SET OPTION_MASK_ISA_SAHF
+
/* Define a set of ISAs which aren't available when a given ISA is
disabled. MMX and SSE ISAs are handled separately. */
@@ -1856,14 +1900,73 @@ static int ix86_isa_flags_explicit;
#define OPTION_MASK_ISA_SSE4A_UNSET \
(OPTION_MASK_ISA_SSE4A | OPTION_MASK_ISA_SSE5_UNSET)
-
#define OPTION_MASK_ISA_SSE5_UNSET OPTION_MASK_ISA_SSE5
+#define OPTION_MASK_ISA_AES_UNSET OPTION_MASK_ISA_AES
+#define OPTION_MASK_ISA_PCLMUL_UNSET OPTION_MASK_ISA_PCLMUL
+#define OPTION_MASK_ISA_ABM_UNSET OPTION_MASK_ISA_ABM
+#define OPTION_MASK_ISA_POPCNT_UNSET OPTION_MASK_ISA_POPCNT
+#define OPTION_MASK_ISA_CX16_UNSET OPTION_MASK_ISA_CX16
+#define OPTION_MASK_ISA_SAHF_UNSET OPTION_MASK_ISA_SAHF
/* Vectorization library interface and handlers. */
tree (*ix86_veclib_handler)(enum built_in_function, tree, tree) = NULL;
static tree ix86_veclibabi_svml (enum built_in_function, tree, tree);
static tree ix86_veclibabi_acml (enum built_in_function, tree, tree);
+/* Processor target table, indexed by processor number */
+struct ptt
+{
+ const struct processor_costs *cost; /* Processor costs */
+ const int align_loop; /* Default alignments. */
+ const int align_loop_max_skip;
+ const int align_jump;
+ const int align_jump_max_skip;
+ const int align_func;
+};
+
+static const struct ptt processor_target_table[PROCESSOR_max] =
+{
+ {&i386_cost, 4, 3, 4, 3, 4},
+ {&i486_cost, 16, 15, 16, 15, 16},
+ {&pentium_cost, 16, 7, 16, 7, 16},
+ {&pentiumpro_cost, 16, 15, 16, 10, 16},
+ {&geode_cost, 0, 0, 0, 0, 0},
+ {&k6_cost, 32, 7, 32, 7, 32},
+ {&athlon_cost, 16, 7, 16, 7, 16},
+ {&pentium4_cost, 0, 0, 0, 0, 0},
+ {&k8_cost, 16, 7, 16, 7, 16},
+ {&nocona_cost, 0, 0, 0, 0, 0},
+ {&core2_cost, 16, 10, 16, 10, 16},
+ {&generic32_cost, 16, 7, 16, 7, 16},
+ {&generic64_cost, 16, 10, 16, 10, 16},
+ {&amdfam10_cost, 32, 24, 32, 7, 32}
+};
+
+static const char *const cpu_names[TARGET_CPU_DEFAULT_max] =
+{
+ "generic",
+ "i386",
+ "i486",
+ "pentium",
+ "pentium-mmx",
+ "pentiumpro",
+ "pentium2",
+ "pentium3",
+ "pentium4",
+ "pentium-m",
+ "prescott",
+ "nocona",
+ "core2",
+ "geode",
+ "k6",
+ "k6-2",
+ "k6-3",
+ "athlon",
+ "athlon-4",
+ "k8",
+ "amdfam10"
+};
+
/* Implement TARGET_HANDLE_OPTION. */
static bool
@@ -2014,11 +2117,295 @@ ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
}
return true;
+ case OPT_mabm:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_ABM_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_ABM_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_UNSET;
+ }
+ return true;
+
+ case OPT_mpopcnt:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_POPCNT_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_POPCNT_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_UNSET;
+ }
+ return true;
+
+ case OPT_msahf:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_SAHF_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_SAHF_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_UNSET;
+ }
+ return true;
+
+ case OPT_mcx16:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_CX16_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_CX16_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_UNSET;
+ }
+ return true;
+
+ case OPT_maes:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_AES_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_AES_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_UNSET;
+ }
+ return true;
+
+ case OPT_mpclmul:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_PCLMUL_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_UNSET;
+ }
+ return true;
+
default:
return true;
}
}
+
+/* Return a string the documents the current -m options. The caller is
+ responsible for freeing the string. */
+static char *
+ix86_target_string (int isa, int flags, const char *arch, const char *tune,
+ const char *fpmath, bool add_nl_p)
+{
+ struct ix86_target_opts
+ {
+ const char *option; /* option string */
+ int mask; /* isa mask options */
+ };
+
+ /* This table is ordered so that options like -msse5 or -msse4.2 that imply
+ preceding options while match those first. */
+ static struct ix86_target_opts isa_opts[] =
+ {
+ { "-m64", OPTION_MASK_ISA_64BIT },
+ { "-msse5", OPTION_MASK_ISA_SSE5 },
+ { "-msse4a", OPTION_MASK_ISA_SSE4A },
+ { "-msse4.2", OPTION_MASK_ISA_SSE4_2 },
+ { "-msse4.1", OPTION_MASK_ISA_SSE4_1 },
+ { "-mssse3", OPTION_MASK_ISA_SSSE3 },
+ { "-msse3", OPTION_MASK_ISA_SSE3 },
+ { "-msse2", OPTION_MASK_ISA_SSE2 },
+ { "-msse", OPTION_MASK_ISA_SSE },
+ { "-m3dnow", OPTION_MASK_ISA_3DNOW },
+ { "-m3dnowa", OPTION_MASK_ISA_3DNOW_A },
+ { "-mmmx", OPTION_MASK_ISA_MMX },
+ { "-mabm", OPTION_MASK_ISA_ABM },
+ { "-mpopcnt", OPTION_MASK_ISA_POPCNT },
+ { "-maes", OPTION_MASK_ISA_AES },
+ { "-mpclmul", OPTION_MASK_ISA_PCLMUL },
+ };
+
+ /* Flag options. */
+ static struct ix86_target_opts flag_opts[] =
+ {
+ { "-m128bit-long-double", MASK_128BIT_LONG_DOUBLE },
+ { "-m80387", MASK_80387 },
+ { "-maccumulate-outgoing-args", MASK_ACCUMULATE_OUTGOING_ARGS },
+ { "-malign-double", MASK_ALIGN_DOUBLE },
+ { "-mcld", MASK_CLD },
+ { "-mfp-ret-in-387", MASK_FLOAT_RETURNS },
+ { "-mieee-fp", MASK_IEEE_FP },
+ { "-minline-all-stringops", MASK_INLINE_ALL_STRINGOPS },
+ { "-minline-stringops-dynamically", MASK_INLINE_STRINGOPS_DYNAMICALLY },
+ { "-mms-bitfields", MASK_MS_BITFIELD_LAYOUT },
+ { "-mno-align-stringops", MASK_NO_ALIGN_STRINGOPS },
+ { "-mno-fancy-math-387", MASK_NO_FANCY_MATH_387 },
+ { "-mno-fused-madd", MASK_NO_FUSED_MADD },
+ { "-mno-push-args", MASK_NO_PUSH_ARGS },
+ { "-mno-red-zone", MASK_NO_RED_ZONE },
+ { "-momit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER },
+ { "-mrecip", MASK_RECIP },
+ { "-mrtd", MASK_RTD },
+ { "-msseregparm", MASK_SSEREGPARM },
+ { "-mstack-arg-probe", MASK_STACK_PROBE },
+ { "-mtls-direct-seg-refs", MASK_TLS_DIRECT_SEG_REFS },
+ };
+
+ const char *opts[ (sizeof (isa_opts) / sizeof (isa_opts[0])
+ + sizeof (flag_opts) / sizeof (flag_opts[0])
+ + 6)][2];
+
+ char isa_other[40];
+ char target_other[40];
+ unsigned num = 0;
+ unsigned i, j;
+ char *ret;
+ char *ptr;
+ size_t len;
+ size_t line_len;
+ size_t sep_len;
+
+ memset (opts, '\0', sizeof (opts));
+
+ /* Add -march= option. */
+ if (arch)
+ {
+ opts[num][0] = "-march=";
+ opts[num++][1] = arch;
+ }
+
+ /* Add -mtune= option. */
+ if (tune)
+ {
+ opts[num][0] = "-mtune=";
+ opts[num++][1] = tune;
+ }
+
+ /* Pick out the options in isa options. */
+ for (i = 0; i < sizeof (isa_opts) / sizeof (isa_opts[0]); i++)
+ {
+ if ((isa & isa_opts[i].mask) != 0)
+ {
+ opts[num++][0] = isa_opts[i].option;
+ isa &= ~ isa_opts[i].mask;
+ }
+ }
+
+ if (isa && add_nl_p)
+ {
+ opts[num++][0] = isa_other;
+ sprintf (isa_other, "(other isa: 0x%x)", isa);
+ }
+
+ /* Add flag options. */
+ for (i = 0; i < sizeof (flag_opts) / sizeof (flag_opts[0]); i++)
+ {
+ if ((flags & flag_opts[i].mask) != 0)
+ {
+ opts[num++][0] = flag_opts[i].option;
+ flags &= ~ flag_opts[i].mask;
+ }
+ }
+
+ if (flags && add_nl_p)
+ {
+ opts[num++][0] = target_other;
+ sprintf (target_other, "(other flags: 0x%x)", isa);
+ }
+
+ /* Add -fpmath= option. */
+ if (fpmath)
+ {
+ opts[num][0] = "-mfpmath=";
+ opts[num++][1] = fpmath;
+ }
+
+ /* Any options? */
+ if (num == 0)
+ return NULL;
+
+ gcc_assert (num < sizeof (opts) / sizeof (opts[0]));
+
+ /* Size the string. */
+ len = 0;
+ sep_len = (add_nl_p) ? 3 : 1;
+ for (i = 0; i < num; i++)
+ {
+ len += sep_len;
+ for (j = 0; j < 2; j++)
+ if (opts[i][j])
+ len += strlen (opts[i][j]);
+ }
+
+ /* Build the string. */
+ ret = ptr = (char *) xmalloc (len);
+ line_len = 0;
+
+ for (i = 0; i < num; i++)
+ {
+ size_t len2[2];
+
+ for (j = 0; j < 2; j++)
+ len2[j] = (opts[i][j]) ? strlen (opts[i][j]) : 0;
+
+ if (i != 0)
+ {
+ *ptr++ = ' ';
+ line_len++;
+
+ if (add_nl_p && line_len + len2[0] + len2[1] > 70)
+ {
+ *ptr++ = '\\';
+ *ptr++ = '\n';
+ line_len = 0;
+ }
+ }
+
+ for (j = 0; j < 2; j++)
+ if (opts[i][j])
+ {
+ memcpy (ptr, opts[i][j], len2[j]);
+ ptr += len2[j];
+ line_len += len2[j];
+ }
+ }
+
+ *ptr = '\0';
+ gcc_assert (ret + len >= ptr);
+
+ return ret;
+}
+
+/* Function that is callable from the debugger to print the current
+ options. */
+void
+ix86_debug_options (void)
+{
+ char *opts = ix86_target_string (ix86_isa_flags, target_flags,
+ ix86_arch_string, ix86_tune_string,
+ ix86_fpmath_string, true);
+
+ if (opts)
+ {
+ fprintf (stderr, "%s\n\n", opts);
+ free (opts);
+ }
+ else
+ fprintf (stderr, "<no options>\n\n");
+
+ return;
+}
+
/* Sometimes certain combinations of command options do not make
sense on a particular target machine. You can define a macro
`OVERRIDE_OPTIONS' to take account of this. This macro, if
@@ -2029,68 +2416,17 @@ ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
`-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
void
-override_options (void)
+override_options (bool main_args_p)
{
int i;
- int ix86_tune_defaulted = 0;
- int ix86_arch_specified = 0;
unsigned int ix86_arch_mask, ix86_tune_mask;
+ const char *prefix;
+ const char *suffix;
+ const char *sw;
/* Comes from final.c -- no real reason to change it. */
#define MAX_CODE_ALIGN 16
- static struct ptt
- {
- const struct processor_costs *cost; /* Processor costs */
- const int align_loop; /* Default alignments. */
- const int align_loop_max_skip;
- const int align_jump;
- const int align_jump_max_skip;
- const int align_func;
- }
- const processor_target_table[PROCESSOR_max] =
- {
- {&i386_cost, 4, 3, 4, 3, 4},
- {&i486_cost, 16, 15, 16, 15, 16},
- {&pentium_cost, 16, 7, 16, 7, 16},
- {&pentiumpro_cost, 16, 15, 16, 10, 16},
- {&geode_cost, 0, 0, 0, 0, 0},
- {&k6_cost, 32, 7, 32, 7, 32},
- {&athlon_cost, 16, 7, 16, 7, 16},
- {&pentium4_cost, 0, 0, 0, 0, 0},
- {&k8_cost, 16, 7, 16, 7, 16},
- {&nocona_cost, 0, 0, 0, 0, 0},
- {&core2_cost, 16, 10, 16, 10, 16},
- {&generic32_cost, 16, 7, 16, 7, 16},
- {&generic64_cost, 16, 10, 16, 10, 16},
- {&amdfam10_cost, 32, 24, 32, 7, 32}
- };
-
- static const char *const cpu_names[TARGET_CPU_DEFAULT_max] =
- {
- "generic",
- "i386",
- "i486",
- "pentium",
- "pentium-mmx",
- "pentiumpro",
- "pentium2",
- "pentium3",
- "pentium4",
- "pentium-m",
- "prescott",
- "nocona",
- "core2",
- "geode",
- "k6",
- "k6-2",
- "k6-3",
- "athlon",
- "athlon-4",
- "k8",
- "amdfam10"
- };
-
enum pta_flags
{
PTA_SSE = 1 << 0,
@@ -2209,6 +2545,21 @@ override_options (void)
int const pta_size = ARRAY_SIZE (processor_alias_table);
+ /* Set up prefix/suffix so the error messages refer to either the command
+ line argument, or the attribute(option). */
+ if (main_args_p)
+ {
+ prefix = "-m";
+ suffix = "";
+ sw = "switch";
+ }
+ else
+ {
+ prefix = "option(\"";
+ suffix = "\")";
+ sw = "attribute";
+ }
+
#ifdef SUBTARGET_OVERRIDE_OPTIONS
SUBTARGET_OVERRIDE_OPTIONS;
#endif
@@ -2258,8 +2609,15 @@ override_options (void)
else
ix86_tune_string = "generic32";
}
+ /* If this call is for setting the option attribute, allow the
+ generic32/generic64 that was previously set. */
+ else if (!main_args_p
+ && (!strcmp (ix86_tune_string, "generic32")
+ || !strcmp (ix86_tune_string, "generic64")))
+ ;
else if (!strncmp (ix86_tune_string, "generic", 7))
- error ("bad value (%s) for -mtune= switch", ix86_tune_string);
+ error ("bad value (%s) for %stune=%s %s",
+ ix86_tune_string, prefix, suffix, sw);
}
else
{
@@ -2300,11 +2658,13 @@ override_options (void)
else if (!strcmp (ix86_stringop_string, "unrolled_loop"))
stringop_alg = unrolled_loop;
else
- error ("bad value (%s) for -mstringop-strategy= switch", ix86_stringop_string);
+ error ("bad value (%s) for %sstringop-strategy=%s %s",
+ ix86_stringop_string, prefix, suffix, sw);
}
if (!strcmp (ix86_tune_string, "x86-64"))
- warning (OPT_Wdeprecated, "-mtune=x86-64 is deprecated. Use -mtune=k8 or "
- "-mtune=generic instead as appropriate.");
+ warning (OPT_Wdeprecated, "%stune=x86-64%s is deprecated. Use "
+ "%stune=k8%s or %stune=generic%s instead as appropriate.",
+ prefix, suffix, prefix, suffix, prefix, suffix);
if (!ix86_arch_string)
ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386";
@@ -2312,9 +2672,11 @@ override_options (void)
ix86_arch_specified = 1;
if (!strcmp (ix86_arch_string, "generic"))
- error ("generic CPU can be used only for -mtune= switch");
+ error ("generic CPU can be used only for %stune=%s %s",
+ prefix, suffix, sw);
if (!strncmp (ix86_arch_string, "generic", 7))
- error ("bad value (%s) for -march= switch", ix86_arch_string);
+ error ("bad value (%s) for %sarch=%s %s",
+ ix86_arch_string, prefix, suffix, sw);
if (ix86_cmodel_string != 0)
{
@@ -2331,7 +2693,8 @@ override_options (void)
else if (!strcmp (ix86_cmodel_string, "kernel") && !flag_pic)
ix86_cmodel = CM_KERNEL;
else
- error ("bad value (%s) for -mcmodel= switch", ix86_cmodel_string);
+ error ("bad value (%s) for %scmodel=%s %s",
+ ix86_cmodel_string, prefix, suffix, sw);
}
else
{
@@ -2354,7 +2717,8 @@ override_options (void)
else if (!strcmp (ix86_asm_string, "att"))
ix86_asm_dialect = ASM_ATT;
else
- error ("bad value (%s) for -masm= switch", ix86_asm_string);
+ error ("bad value (%s) for %sasm=%s %s",
+ ix86_asm_string, prefix, suffix, sw);
}
if ((TARGET_64BIT == 0) != (ix86_cmodel == CM_32))
error ("code model %qs not supported in the %s bit mode",
@@ -2407,31 +2771,37 @@ override_options (void)
if (processor_alias_table[i].flags & PTA_SSE5
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_SSE5))
ix86_isa_flags |= OPTION_MASK_ISA_SSE5;
-
- if (processor_alias_table[i].flags & PTA_ABM)
- x86_abm = true;
- if (processor_alias_table[i].flags & PTA_CX16)
- x86_cmpxchg16b = true;
- if (processor_alias_table[i].flags & (PTA_POPCNT | PTA_ABM))
- x86_popcnt = true;
+ if (processor_alias_table[i].flags & PTA_ABM
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_ABM))
+ ix86_isa_flags |= OPTION_MASK_ISA_ABM;
+ if (processor_alias_table[i].flags & PTA_CX16
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_CX16))
+ ix86_isa_flags |= OPTION_MASK_ISA_CX16;
+ if (processor_alias_table[i].flags & (PTA_POPCNT | PTA_ABM)
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_POPCNT))
+ ix86_isa_flags |= OPTION_MASK_ISA_POPCNT;
+ if (!(TARGET_64BIT && (processor_alias_table[i].flags & PTA_NO_SAHF))
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_SAHF))
+ ix86_isa_flags |= OPTION_MASK_ISA_SAHF;
+ if (processor_alias_table[i].flags & PTA_AES
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_AES))
+ ix86_isa_flags |= OPTION_MASK_ISA_AES;
+ if (processor_alias_table[i].flags & PTA_PCLMUL
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_PCLMUL))
+ ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL;
if (processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE))
x86_prefetch_sse = true;
- if (!(TARGET_64BIT && (processor_alias_table[i].flags & PTA_NO_SAHF)))
- x86_sahf = true;
- if (processor_alias_table[i].flags & PTA_AES)
- x86_aes = true;
- if (processor_alias_table[i].flags & PTA_PCLMUL)
- x86_pclmul = true;
break;
}
if (i == pta_size)
- error ("bad value (%s) for -march= switch", ix86_arch_string);
+ error ("bad value (%s) for %sarch=%s %s",
+ ix86_arch_string, prefix, suffix, sw);
ix86_arch_mask = 1u << ix86_arch;
for (i = 0; i < X86_ARCH_LAST; ++i)
- ix86_arch_features[i] &= ix86_arch_mask;
+ ix86_arch_features[i] = !!(initial_ix86_arch_features[i] & ix86_arch_mask);
for (i = 0; i < pta_size; i++)
if (! strcmp (ix86_tune_string, processor_alias_table[i].name))
@@ -2463,19 +2833,12 @@ override_options (void)
break;
}
if (i == pta_size)
- error ("bad value (%s) for -mtune= switch", ix86_tune_string);
-
- /* Enable SSE2 if AES or PCLMUL is enabled. */
- if ((x86_aes || x86_pclmul)
- && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_SSE2))
- {
- ix86_isa_flags |= OPTION_MASK_ISA_SSE2_SET;
- ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_SET;
- }
+ error ("bad value (%s) for %stune=%s %s",
+ ix86_tune_string, prefix, suffix, sw);
ix86_tune_mask = 1u << ix86_tune;
for (i = 0; i < X86_TUNE_LAST; ++i)
- ix86_tune_features[i] &= ix86_tune_mask;
+ ix86_tune_features[i] = !!(initial_ix86_tune_features[i] & ix86_tune_mask);
if (optimize_size)
ix86_cost = &size_cost;
@@ -2489,10 +2852,11 @@ override_options (void)
if (ix86_regparm_string)
{
if (TARGET_64BIT)
- warning (0, "-mregparm is ignored in 64-bit mode");
+ warning (0, "%sregparm%s is ignored in 64-bit mode", prefix, suffix);
i = atoi (ix86_regparm_string);
if (i < 0 || i > REGPARM_MAX)
- error ("-mregparm=%d is not between 0 and %d", i, REGPARM_MAX);
+ error ("%sregparm=%d%s is not between 0 and %d",
+ prefix, i, suffix, REGPARM_MAX);
else
ix86_regparm = i;
}
@@ -2504,12 +2868,14 @@ override_options (void)
Remove this code in GCC 3.2 or later. */
if (ix86_align_loops_string)
{
- warning (0, "-malign-loops is obsolete, use -falign-loops");
+ warning (0, "%salign-loops%s is obsolete, use %salign-loops%s",
+ prefix, suffix, prefix, suffix);
if (align_loops == 0)
{
i = atoi (ix86_align_loops_string);
if (i < 0 || i > MAX_CODE_ALIGN)
- error ("-malign-loops=%d is not between 0 and %d", i, MAX_CODE_ALIGN);
+ error ("%salign-loops=%d%s is not between 0 and %d",
+ prefix, i, suffix, MAX_CODE_ALIGN);
else
align_loops = 1 << i;
}
@@ -2517,12 +2883,14 @@ override_options (void)
if (ix86_align_jumps_string)
{
- warning (0, "-malign-jumps is obsolete, use -falign-jumps");
+ warning (0, "%salign-jumps%s is obsolete, use %salign-jumps%s",
+ prefix, suffix, prefix, suffix);
if (align_jumps == 0)
{
i = atoi (ix86_align_jumps_string);
if (i < 0 || i > MAX_CODE_ALIGN)
- error ("-malign-loops=%d is not between 0 and %d", i, MAX_CODE_ALIGN);
+ error ("%salign-loops=%d%s is not between 0 and %d",
+ prefix, i, suffix, MAX_CODE_ALIGN);
else
align_jumps = 1 << i;
}
@@ -2530,12 +2898,14 @@ override_options (void)
if (ix86_align_funcs_string)
{
- warning (0, "-malign-functions is obsolete, use -falign-functions");
+ warning (0, "%salign-functions%s is obsolete, use %salign-functions%s",
+ prefix, suffix, prefix, suffix);
if (align_functions == 0)
{
i = atoi (ix86_align_funcs_string);
if (i < 0 || i > MAX_CODE_ALIGN)
- error ("-malign-loops=%d is not between 0 and %d", i, MAX_CODE_ALIGN);
+ error ("%salign-loops=%d%s is not between 0 and %d",
+ prefix, i, suffix, MAX_CODE_ALIGN);
else
align_functions = 1 << i;
}
@@ -2563,7 +2933,7 @@ override_options (void)
{
i = atoi (ix86_branch_cost_string);
if (i < 0 || i > 5)
- error ("-mbranch-cost=%d is not between 0 and 5", i);
+ error ("%sbranch-cost=%d%s is not between 0 and 5", prefix, i, suffix);
else
ix86_branch_cost = i;
}
@@ -2571,7 +2941,7 @@ override_options (void)
{
i = atoi (ix86_section_threshold_string);
if (i < 0)
- error ("-mlarge-data-threshold=%d is negative", i);
+ error ("%slarge-data-threshold=%d%s is negative", prefix, i, suffix);
else
ix86_section_threshold = i;
}
@@ -2585,8 +2955,8 @@ override_options (void)
else if (strcmp (ix86_tls_dialect_string, "sun") == 0)
ix86_tls_dialect = TLS_DIALECT_SUN;
else
- error ("bad value (%s) for -mtls-dialect= switch",
- ix86_tls_dialect_string);
+ error ("bad value (%s) for %stls-dialect=%s %s",
+ ix86_tls_dialect_string, prefix, suffix, sw);
}
if (ix87_precision_string)
@@ -2609,7 +2979,7 @@ override_options (void)
| TARGET_SUBTARGET64_ISA_DEFAULT) & ~ix86_isa_flags_explicit);
if (TARGET_RTD)
- warning (0, "-mrtd is ignored in 64bit mode");
+ warning (0, "%srtd%s is ignored in 64bit mode", prefix, suffix);
}
else
{
@@ -2655,7 +3025,7 @@ override_options (void)
/* Turn on popcnt instruction for -msse4.2 or -mabm. */
if (TARGET_SSE4_2 || TARGET_ABM)
- x86_popcnt = true;
+ ix86_isa_flags |= OPTION_MASK_ISA_POPCNT & ~ix86_isa_flags_explicit;
/* Validate -mpreferred-stack-boundary= value or default it to
PREFERRED_STACK_BOUNDARY_DEFAULT. */
@@ -2664,8 +3034,8 @@ override_options (void)
{
i = atoi (ix86_preferred_stack_boundary_string);
if (i < (TARGET_64BIT ? 4 : 2) || i > 12)
- error ("-mpreferred-stack-boundary=%d is not between %d and 12", i,
- TARGET_64BIT ? 4 : 2);
+ error ("%spreferred-stack-boundary=%d%s is not between %d and 12",
+ prefix, i, suffix, TARGET_64BIT ? 4 : 2);
else
ix86_preferred_stack_boundary = (1 << i) * BITS_PER_UNIT;
}
@@ -2698,7 +3068,7 @@ override_options (void)
/* Accept -msseregparm only if at least SSE support is enabled. */
if (TARGET_SSEREGPARM
&& ! TARGET_SSE)
- error ("-msseregparm used without SSE enabled");
+ error ("%ssseregparm%s used without SSE enabled", prefix, suffix);
ix86_fpmath = TARGET_FPMATH_DEFAULT;
if (ix86_fpmath_string != 0)
@@ -2716,7 +3086,10 @@ override_options (void)
ix86_fpmath = FPMATH_SSE;
}
else if (! strcmp (ix86_fpmath_string, "387,sse")
- || ! strcmp (ix86_fpmath_string, "sse,387"))
+ || ! strcmp (ix86_fpmath_string, "387+sse")
+ || ! strcmp (ix86_fpmath_string, "sse,387")
+ || ! strcmp (ix86_fpmath_string, "sse+387")
+ || ! strcmp (ix86_fpmath_string, "both"))
{
if (!TARGET_SSE)
{
@@ -2732,7 +3105,8 @@ override_options (void)
ix86_fpmath = (enum fpmath_unit) (FPMATH_SSE | FPMATH_387);
}
else
- error ("bad value (%s) for -mfpmath= switch", ix86_fpmath_string);
+ error ("bad value (%s) for %sfpmath=%s %s",
+ ix86_fpmath_string, prefix, suffix, sw);
}
/* If the i387 is disabled, then do not return values in it. */
@@ -2748,7 +3122,8 @@ override_options (void)
ix86_veclib_handler = ix86_veclibabi_acml;
else
error ("unknown vectorization library ABI type (%s) for "
- "-mveclibabi= switch", ix86_veclibabi_string);
+ "%sveclibabi=%s %s", ix86_veclibabi_string,
+ prefix, suffix, sw);
}
if ((x86_accumulate_outgoing_args & ix86_tune_mask)
@@ -2767,7 +3142,8 @@ override_options (void)
{
if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS)
warning (0, "unwind tables currently require either a frame pointer "
- "or -maccumulate-outgoing-args for correctness");
+ "or %saccumulate-outgoing-args%s for correctness",
+ prefix, suffix);
target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
@@ -2778,8 +3154,8 @@ override_options (void)
&& !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
{
if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS)
- warning (0, "stack probing requires -maccumulate-outgoing-args "
- "for correctness");
+ warning (0, "stack probing requires %saccumulate-outgoing-args%s "
+ "for correctness", prefix, suffix);
target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
@@ -2797,11 +3173,6 @@ override_options (void)
*p = '\0';
}
- /* When scheduling description is not available, disable scheduler pass
- so it won't slow down the compilation and make x87 code slower. */
- if (!TARGET_SCHEDULE)
- flag_schedule_insns_after_reload = flag_schedule_insns = 0;
-
if (!PARAM_SET_P (PARAM_SIMULTANEOUS_PREFETCHES))
set_param_value ("simultaneous-prefetches",
ix86_cost->simultaneous_prefetches);
@@ -2845,7 +3216,499 @@ override_options (void)
if (!TARGET_64BIT)
target_flags |= MASK_CLD & ~target_flags_explicit;
#endif
+
+ /* Save the initial options in case the user does function specific options */
+ if (main_args_p)
+ target_option_default_node = target_option_current_node
+ = build_target_option_node ();
+}
+
+/* Save the current options */
+
+static void
+ix86_function_specific_save (struct cl_target_option *ptr)
+{
+ gcc_assert (IN_RANGE (ix86_arch, 0, 255));
+ gcc_assert (IN_RANGE (ix86_tune, 0, 255));
+ gcc_assert (IN_RANGE (ix86_fpmath, 0, 255));
+ gcc_assert (IN_RANGE (ix86_branch_cost, 0, 255));
+
+ ptr->arch = ix86_arch;
+ ptr->tune = ix86_tune;
+ ptr->fpmath = ix86_fpmath;
+ ptr->branch_cost = ix86_branch_cost;
+ ptr->tune_defaulted = ix86_tune_defaulted;
+ ptr->arch_specified = ix86_arch_specified;
+ ptr->ix86_isa_flags_explicit = ix86_isa_flags_explicit;
+ ptr->target_flags_explicit = target_flags_explicit;
+}
+
+/* Restore the current options */
+
+static void
+ix86_function_specific_restore (struct cl_target_option *ptr)
+{
+ enum processor_type old_tune = ix86_tune;
+ enum processor_type old_arch = ix86_arch;
+ unsigned int ix86_arch_mask, ix86_tune_mask;
+ int i;
+
+ ix86_arch = ptr->arch;
+ ix86_tune = ptr->tune;
+ ix86_fpmath = ptr->fpmath;
+ ix86_branch_cost = ptr->branch_cost;
+ ix86_tune_defaulted = ptr->tune_defaulted;
+ ix86_arch_specified = ptr->arch_specified;
+ ix86_isa_flags_explicit = ptr->ix86_isa_flags_explicit;
+ target_flags_explicit = ptr->target_flags_explicit;
+
+ /* Recreate the arch feature tests if the arch changed */
+ if (old_arch != ix86_arch)
+ {
+ ix86_arch_mask = 1u << ix86_arch;
+ for (i = 0; i < X86_ARCH_LAST; ++i)
+ ix86_arch_features[i]
+ = !!(initial_ix86_arch_features[i] & ix86_arch_mask);
+ }
+
+ /* Recreate the tune optimization tests */
+ if (old_tune != ix86_tune)
+ {
+ ix86_tune_mask = 1u << ix86_tune;
+ for (i = 0; i < X86_TUNE_LAST; ++i)
+ ix86_tune_features[i]
+ = !!(initial_ix86_tune_features[i] & ix86_tune_mask);
+ }
+}
+
+/* Print the current options */
+
+static void
+ix86_function_specific_print (FILE *file, int indent,
+ struct cl_target_option *ptr)
+{
+ char *target_string
+ = ix86_target_string (ptr->ix86_isa_flags, ptr->target_flags,
+ NULL, NULL, NULL, false);
+
+ fprintf (file, "%*sarch = %d (%s)\n",
+ indent, "",
+ ptr->arch,
+ ((ptr->arch < TARGET_CPU_DEFAULT_max)
+ ? cpu_names[ptr->arch]
+ : "<unknown>"));
+
+ fprintf (file, "%*stune = %d (%s)\n",
+ indent, "",
+ ptr->tune,
+ ((ptr->tune < TARGET_CPU_DEFAULT_max)
+ ? cpu_names[ptr->tune]
+ : "<unknown>"));
+
+ fprintf (file, "%*sfpmath = %d%s%s\n", indent, "", ptr->fpmath,
+ (ptr->fpmath & FPMATH_387) ? ", 387" : "",
+ (ptr->fpmath & FPMATH_SSE) ? ", sse" : "");
+ fprintf (file, "%*sbranch_cost = %d\n", indent, "", ptr->branch_cost);
+
+ if (target_string)
+ {
+ fprintf (file, "%*s%s\n", indent, "", target_string);
+ free (target_string);
+ }
}
+
+
+/* Inner function to process the attribute((option(...))), take an argument and
+ set the current options from the argument. If we have a list, recursively go
+ over the list. */
+
+static bool
+ix86_valid_option_attribute_inner_p (tree args, char *p_strings[])
+{
+ char *next_optstr;
+ bool ret = true;
+
+#define IX86_ATTR_ISA(S,O) { S, sizeof (S)-1, ix86_opt_isa, O, 0 }
+#define IX86_ATTR_STR(S,O) { S, sizeof (S)-1, ix86_opt_str, O, 0 }
+#define IX86_ATTR_YES(S,O,M) { S, sizeof (S)-1, ix86_opt_yes, O, M }
+#define IX86_ATTR_NO(S,O,M) { S, sizeof (S)-1, ix86_opt_no, O, M }
+
+ enum ix86_opt_type
+ {
+ ix86_opt_unknown,
+ ix86_opt_yes,
+ ix86_opt_no,
+ ix86_opt_str,
+ ix86_opt_isa
+ };
+
+ static const struct
+ {
+ const char *string;
+ size_t len;
+ enum ix86_opt_type type;
+ int opt;
+ int mask;
+ } attrs[] = {
+ /* isa options */
+ IX86_ATTR_ISA ("3dnow", OPT_m3dnow),
+ IX86_ATTR_ISA ("abm", OPT_mabm),
+ IX86_ATTR_ISA ("aes", OPT_maes),
+ IX86_ATTR_ISA ("mmx", OPT_mmmx),
+ IX86_ATTR_ISA ("pclmul", OPT_mpclmul),
+ IX86_ATTR_ISA ("popcnt", OPT_mpopcnt),
+ IX86_ATTR_ISA ("sse", OPT_msse),
+ IX86_ATTR_ISA ("sse2", OPT_msse2),
+ IX86_ATTR_ISA ("sse3", OPT_msse3),
+ IX86_ATTR_ISA ("sse4", OPT_msse4),
+ IX86_ATTR_ISA ("sse4.1", OPT_msse4_1),
+ IX86_ATTR_ISA ("sse4.2", OPT_msse4_2),
+ IX86_ATTR_ISA ("sse4a", OPT_msse4a),
+ IX86_ATTR_ISA ("sse5", OPT_msse5),
+ IX86_ATTR_ISA ("ssse3", OPT_mssse3),
+
+ /* string options */
+ IX86_ATTR_STR ("arch=", IX86_FUNCTION_SPECIFIC_ARCH),
+ IX86_ATTR_STR ("fpmath=", IX86_FUNCTION_SPECIFIC_FPMATH),
+ IX86_ATTR_STR ("tune=", IX86_FUNCTION_SPECIFIC_TUNE),
+
+ /* flag options */
+ IX86_ATTR_YES ("cld",
+ OPT_mcld,
+ MASK_CLD),
+
+ IX86_ATTR_NO ("fancy-math-387",
+ OPT_mfancy_math_387,
+ MASK_NO_FANCY_MATH_387),
+
+ IX86_ATTR_NO ("fused-madd",
+ OPT_mfused_madd,
+ MASK_NO_FUSED_MADD),
+
+ IX86_ATTR_YES ("ieee-fp",
+ OPT_mieee_fp,
+ MASK_IEEE_FP),
+
+ IX86_ATTR_YES ("inline-all-stringops",
+ OPT_minline_all_stringops,
+ MASK_INLINE_ALL_STRINGOPS),
+
+ IX86_ATTR_YES ("inline-stringops-dynamically",
+ OPT_minline_stringops_dynamically,
+ MASK_INLINE_STRINGOPS_DYNAMICALLY),
+
+ IX86_ATTR_NO ("align-stringops",
+ OPT_mno_align_stringops,
+ MASK_NO_ALIGN_STRINGOPS),
+
+ IX86_ATTR_YES ("recip",
+ OPT_mrecip,
+ MASK_RECIP),
+
+ };
+
+ /* If this is a list, recurse to get the options. */
+ if (TREE_CODE (args) == TREE_LIST)
+ {
+ bool ret = true;
+
+ for (; args; args = TREE_CHAIN (args))
+ if (TREE_VALUE (args)
+ && !ix86_valid_option_attribute_inner_p (TREE_VALUE (args), p_strings))
+ ret = false;
+
+ return ret;
+ }
+
+ else if (TREE_CODE (args) != STRING_CST)
+ gcc_unreachable ();
+
+ /* Handle multiple arguments separated by commas. */
+ next_optstr = ASTRDUP (TREE_STRING_POINTER (args));
+
+ while (next_optstr && *next_optstr != '\0')
+ {
+ char *p = next_optstr;
+ char *orig_p = p;
+ char *comma = strchr (next_optstr, ',');
+ const char *opt_string;
+ size_t len, opt_len;
+ int opt;
+ bool opt_set_p;
+ char ch;
+ unsigned i;
+ enum ix86_opt_type type = ix86_opt_unknown;
+ int mask = 0;
+
+ if (comma)
+ {
+ *comma = '\0';
+ len = comma - next_optstr;
+ next_optstr = comma + 1;
+ }
+ else
+ {
+ len = strlen (p);
+ next_optstr = NULL;
+ }
+
+ /* Recognize no-xxx. */
+ if (len > 3 && p[0] == 'n' && p[1] == 'o' && p[2] == '-')
+ {
+ opt_set_p = false;
+ p += 3;
+ len -= 3;
+ }
+ else
+ opt_set_p = true;
+
+ /* Find the option. */
+ ch = *p;
+ opt = N_OPTS;
+ for (i = 0; i < sizeof (attrs) / sizeof (attrs[0]); i++)
+ {
+ type = attrs[i].type;
+ opt_len = attrs[i].len;
+ if (ch == attrs[i].string[0]
+ && ((type != ix86_opt_str) ? len == opt_len : len > opt_len)
+ && memcmp (p, attrs[i].string, opt_len) == 0)
+ {
+ opt = attrs[i].opt;
+ mask = attrs[i].mask;
+ opt_string = attrs[i].string;
+ break;
+ }
+ }
+
+ /* Process the option. */
+ if (opt == N_OPTS)
+ {
+ error ("attribute(option(\"%s\")) is unknown", orig_p);
+ ret = false;
+ }
+
+ else if (type == ix86_opt_isa)
+ ix86_handle_option (opt, p, opt_set_p);
+
+ else if (type == ix86_opt_yes || type == ix86_opt_no)
+ {
+ if (type == ix86_opt_no)
+ opt_set_p = !opt_set_p;
+
+ if (opt_set_p)
+ target_flags |= mask;
+ else
+ target_flags &= ~mask;
+ }
+
+ else if (type == ix86_opt_str)
+ {
+ if (p_strings[opt])
+ {
+ error ("option(\"%s\") was already specified", opt_string);
+ ret = false;
+ }
+ else
+ p_strings[opt] = xstrdup (p + opt_len);
+ }
+
+ else
+ gcc_unreachable ();
+ }
+
+ return ret;
+}
+
+/* Return a TARGET_OPTION_NODE tree of the target options listed or NULL. */
+
+tree
+ix86_valid_option_attribute_tree (tree args)
+{
+ const char *orig_arch_string = ix86_arch_string;
+ const char *orig_tune_string = ix86_tune_string;
+ const char *orig_fpmath_string = ix86_fpmath_string;
+ int orig_tune_defaulted = ix86_tune_defaulted;
+ int orig_arch_specified = ix86_arch_specified;
+ char *option_strings[IX86_FUNCTION_SPECIFIC_MAX] = { NULL, NULL, NULL };
+ tree t = NULL_TREE;
+ int i;
+ struct cl_target_option *def
+ = TREE_TARGET_OPTION (target_option_default_node);
+
+ /* Process each of the options on the chain. */
+ if (! ix86_valid_option_attribute_inner_p (args, option_strings))
+ return NULL_TREE;
+
+ /* If the changed options are different from the default, rerun override_options,
+ and then save the options away. The string options are are attribute options,
+ and will be undone when we copy the save structure. */
+ if (ix86_isa_flags != def->ix86_isa_flags
+ || target_flags != def->target_flags
+ || option_strings[IX86_FUNCTION_SPECIFIC_ARCH]
+ || option_strings[IX86_FUNCTION_SPECIFIC_TUNE]
+ || option_strings[IX86_FUNCTION_SPECIFIC_FPMATH])
+ {
+ /* If we are using the default tune= or arch=, undo the string assigned,
+ and use the default. */
+ if (option_strings[IX86_FUNCTION_SPECIFIC_ARCH])
+ ix86_arch_string = option_strings[IX86_FUNCTION_SPECIFIC_ARCH];
+ else if (!orig_arch_specified)
+ ix86_arch_string = NULL;
+
+ if (option_strings[IX86_FUNCTION_SPECIFIC_TUNE])
+ ix86_tune_string = option_strings[IX86_FUNCTION_SPECIFIC_TUNE];
+ else if (orig_tune_defaulted)
+ ix86_tune_string = NULL;
+
+ /* If fpmath= is not set, and we now have sse2 on 32-bit, use it. */
+ if (option_strings[IX86_FUNCTION_SPECIFIC_FPMATH])
+ ix86_fpmath_string = option_strings[IX86_FUNCTION_SPECIFIC_FPMATH];
+ else if (!TARGET_64BIT && TARGET_SSE)
+ ix86_fpmath_string = "sse,387";
+
+ /* Do any overrides, such as arch=xxx, or tune=xxx support. */
+ override_options (false);
+
+ /* Save the current options unless we are validating options for
+ #pragma. */
+ t = build_target_option_node ();
+
+ ix86_arch_string = orig_arch_string;
+ ix86_tune_string = orig_tune_string;
+ ix86_fpmath_string = orig_fpmath_string;
+
+ /* Free up memory allocated to hold the strings */
+ for (i = 0; i < IX86_FUNCTION_SPECIFIC_MAX; i++)
+ if (option_strings[i])
+ free (option_strings[i]);
+ }
+
+ return t;
+}
+
+/* Hook to validate attribute((option("string"))). */
+
+static bool
+ix86_valid_option_attribute_p (tree fndecl,
+ tree ARG_UNUSED (name),
+ tree args,
+ int ARG_UNUSED (flags))
+{
+ struct cl_target_option cur_opts;
+ bool ret = true;
+ tree new_opts;
+
+ cl_target_option_save (&cur_opts);
+ new_opts = ix86_valid_option_attribute_tree (args);
+ if (!new_opts)
+ ret = false;
+
+ else if (fndecl)
+ DECL_FUNCTION_SPECIFIC_TARGET (fndecl) = new_opts;
+
+ cl_target_option_restore (&cur_opts);
+ return ret;
+}
+
+
+/* Hook to determine if one function can safely inline another. */
+
+static bool
+ix86_can_inline_p (tree caller, tree callee)
+{
+ bool ret = false;
+ tree caller_tree = DECL_FUNCTION_SPECIFIC_TARGET (caller);
+ tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee);
+
+ /* If callee has no option attributes, then it is ok to inline. */
+ if (!callee_tree)
+ ret = true;
+
+ /* If caller has no option attributes, but callee does then it is not ok to
+ inline. */
+ else if (!caller_tree)
+ ret = false;
+
+ else
+ {
+ struct cl_target_option *caller_opts = TREE_TARGET_OPTION (caller_tree);
+ struct cl_target_option *callee_opts = TREE_TARGET_OPTION (callee_tree);
+
+ /* Callee's isa options should a subset of the caller's, i.e. a SSE5 function
+ can inline a SSE2 function but a SSE2 function can't inline a SSE5
+ function. */
+ if ((caller_opts->ix86_isa_flags & callee_opts->ix86_isa_flags)
+ != callee_opts->ix86_isa_flags)
+ ret = false;
+
+ /* See if we have the same non-isa options. */
+ else if (caller_opts->target_flags != callee_opts->target_flags)
+ ret = false;
+
+ /* See if arch, tune, etc. are the same. */
+ else if (caller_opts->arch != callee_opts->arch)
+ ret = false;
+
+ else if (caller_opts->tune != callee_opts->tune)
+ ret = false;
+
+ else if (caller_opts->fpmath != callee_opts->fpmath)
+ ret = false;
+
+ else if (caller_opts->branch_cost != callee_opts->branch_cost)
+ ret = false;
+
+ else
+ ret = true;
+ }
+
+ return ret;
+}
+
+
+/* Remember the last target of ix86_set_current_function. */
+static GTY(()) tree ix86_previous_fndecl;
+
+/* Establish appropriate back-end context for processing the function
+ FNDECL. The argument might be NULL to indicate processing at top
+ level, outside of any function scope. */
+static void
+ix86_set_current_function (tree fndecl)
+{
+ /* Only change the context if the function changes. This hook is called
+ several times in the course of compiling a function, and we don't want to
+ slow things down too much or call target_reinit when it isn't safe. */
+ if (fndecl && fndecl != ix86_previous_fndecl)
+ {
+ tree old_tree = (ix86_previous_fndecl
+ ? DECL_FUNCTION_SPECIFIC_TARGET (ix86_previous_fndecl)
+ : NULL_TREE);
+
+ tree new_tree = (fndecl
+ ? DECL_FUNCTION_SPECIFIC_TARGET (fndecl)
+ : NULL_TREE);
+
+ ix86_previous_fndecl = fndecl;
+ if (old_tree == new_tree)
+ ;
+
+ else if (new_tree)
+ {
+ cl_target_option_restore (TREE_TARGET_OPTION (new_tree));
+ target_reinit ();
+ }
+
+ else if (old_tree)
+ {
+ struct cl_target_option *def
+ = TREE_TARGET_OPTION (target_option_current_node);
+
+ cl_target_option_restore (def);
+ target_reinit ();
+ }
+ }
+}
+
/* Return true if this goes in large data/bss. */
@@ -3079,6 +3942,11 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED)
flag_schedule_insns = 0;
#endif
+ /* When scheduling description is not available, disable scheduler pass
+ so it won't slow down the compilation and make x87 code slower. */
+ if (!TARGET_SCHEDULE)
+ flag_schedule_insns_after_reload = flag_schedule_insns = 0;
+
if (TARGET_MACHO)
/* The Darwin libraries never set errno, so we might as well
avoid calling them when that's the only reason we would. */
@@ -3364,7 +4232,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
/* Use register calling convention for local functions when possible. */
if (decl && TREE_CODE (decl) == FUNCTION_DECL
- && flag_unit_at_a_time && !profile_flag)
+ && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
@@ -3448,7 +4316,7 @@ ix86_function_sseregparm (const_tree type, const_tree decl, bool warn)
/* For local functions, pass up to SSE_REGPARM_MAX SFmode
(and DFmode for SSE2) arguments in SSE registers. */
- if (decl && TARGET_SSE_MATH && flag_unit_at_a_time && !profile_flag)
+ if (decl && TARGET_SSE_MATH && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
@@ -8472,7 +9340,8 @@ get_dllimport_decl (tree decl)
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = targetm.strip_name_encoding (name);
- prefix = name[0] == FASTCALL_PREFIX ? "*__imp_": "*__imp__";
+ prefix = name[0] == FASTCALL_PREFIX || user_label_prefix[0] == 0
+ ? "*__imp_" : "*__imp__";
namelen = strlen (name);
prefixlen = strlen (prefix);
imp_name = (char *) alloca (namelen + prefixlen + 1);
@@ -18347,22 +19216,29 @@ enum ix86_builtins
/* Table for the ix86 builtin decls. */
static GTY(()) tree ix86_builtins[(int) IX86_BUILTIN_MAX];
-/* Add an ix86 target builtin function with CODE, NAME and TYPE. Do so,
- * if the target_flags include one of MASK. Stores the function decl
- * in the ix86_builtins array.
- * Returns the function decl or NULL_TREE, if the builtin was not added. */
+/* Table to record which ISA options the builtin needs. */
+static int ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
+
+/* Add an ix86 target builtin function with CODE, NAME and TYPE. Save the MASK
+ * of which isa_flags to use in the ix86_builtins_isa array. Stores the
+ * function decl in the ix86_builtins array. Returns the function decl or
+ * NULL_TREE, if the builtin was not added.
+ *
+ * Record all builtins, even if it isn't an instruction set in the current ISA
+ * in case the user uses function specific options for a different ISA. When
+ * the builtin is expanded, check at that time whether it is valid. */
static inline tree
def_builtin (int mask, const char *name, tree type, enum ix86_builtins code)
{
tree decl = NULL_TREE;
- if (mask & ix86_isa_flags
- && (!(mask & OPTION_MASK_ISA_64BIT) || TARGET_64BIT))
+ if (!(mask & OPTION_MASK_ISA_64BIT) || TARGET_64BIT)
{
decl = add_builtin_function (name, type, code, BUILT_IN_MD,
NULL, NULL_TREE);
ix86_builtins[(int) code] = decl;
+ ix86_builtins_isa[(int) code] = mask;
}
return decl;
@@ -19405,9 +20281,10 @@ static const struct builtin_description bdesc_multi_arg[] =
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5_pcom_tfv2di3, "__builtin_ia32_pcomtrueuq", IX86_BUILTIN_PCOMTRUEUQ, PCOM_TRUE, (int)MULTI_ARG_2_DI_TF },
};
-/* Set up all the MMX/SSE builtins. This is not called if TARGET_MMX
- is zero. Otherwise, if TARGET_SSE is not set, only expand the MMX
- builtins. */
+/* Set up all the MMX/SSE builtins, even builtins for instructions that are not
+ in the current target ISA to allow the user to compile particular modules
+ with different target specific options that differ from the command line
+ options. */
static void
ix86_init_mmx_sse_builtins (void)
{
@@ -20346,23 +21223,15 @@ ix86_init_mmx_sse_builtins (void)
def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_mwait", void_ftype_unsigned_unsigned, IX86_BUILTIN_MWAIT);
/* AES */
- if (TARGET_AES)
- {
- /* Define AES built-in functions only if AES is enabled. */
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_aesenc128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESENC128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_aesenclast128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESENCLAST128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_aesdec128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESDEC128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_aesdeclast128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESDECLAST128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_aesimc128", v2di_ftype_v2di, IX86_BUILTIN_AESIMC128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_aeskeygenassist128", v2di_ftype_v2di_int, IX86_BUILTIN_AESKEYGENASSIST128);
- }
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesenc128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESENC128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesenclast128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESENCLAST128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesdec128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESDEC128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesdeclast128", v2di_ftype_v2di_v2di, IX86_BUILTIN_AESDECLAST128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aesimc128", v2di_ftype_v2di, IX86_BUILTIN_AESIMC128);
+ def_builtin_const (OPTION_MASK_ISA_AES, "__builtin_ia32_aeskeygenassist128", v2di_ftype_v2di_int, IX86_BUILTIN_AESKEYGENASSIST128);
/* PCLMUL */
- if (TARGET_PCLMUL)
- {
- /* Define PCLMUL built-in function only if PCLMUL is enabled. */
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pclmulqdq128", v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PCLMULQDQ128);
- }
+ def_builtin_const (OPTION_MASK_ISA_PCLMUL, "__builtin_ia32_pclmulqdq128", v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PCLMULQDQ128);
/* Access to the vec_init patterns. */
ftype = build_function_type_list (V2SI_type_node, integer_type_node,
@@ -20617,8 +21486,7 @@ ix86_init_builtins (void)
ix86_builtins[(int) IX86_BUILTIN_COPYSIGNQ] = decl;
TREE_READONLY (decl) = 1;
- if (TARGET_MMX)
- ix86_init_mmx_sse_builtins ();
+ ix86_init_mmx_sse_builtins ();
if (TARGET_64BIT)
ix86_init_builtins_va_builtins_abi ();
}
@@ -21834,6 +22702,28 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
enum machine_mode mode0, mode1, mode2;
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
+ /* Determine whether the builtin function is available under the current ISA.
+ Originally the builtin was not created if it wasn't applicable to the
+ current ISA based on the command line switches. With function specific
+ options, we need to check in the context of the function making the call
+ whether it is supported. */
+ if (ix86_builtins_isa[fcode]
+ && !(ix86_builtins_isa[fcode] & ix86_isa_flags))
+ {
+ char *opts = ix86_target_string (ix86_builtins_isa[fcode], 0, NULL,
+ NULL, NULL, false);
+
+ if (!opts)
+ error ("%qE needs unknown isa option", fndecl);
+ else
+ {
+ gcc_assert (opts != NULL);
+ error ("%qE needs isa option %s", fndecl, opts);
+ free (opts);
+ }
+ return const0_rtx;
+ }
+
switch (fcode)
{
case IX86_BUILTIN_MASKMOVQ:
@@ -26658,6 +27548,30 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
#undef TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST
#define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST x86_builtin_vectorization_cost
+#undef TARGET_SET_CURRENT_FUNCTION
+#define TARGET_SET_CURRENT_FUNCTION ix86_set_current_function
+
+#undef TARGET_OPTION_VALID_ATTRIBUTE_P
+#define TARGET_OPTION_VALID_ATTRIBUTE_P ix86_valid_option_attribute_p
+
+#undef TARGET_OPTION_SAVE
+#define TARGET_OPTION_SAVE ix86_function_specific_save
+
+#undef TARGET_OPTION_RESTORE
+#define TARGET_OPTION_RESTORE ix86_function_specific_restore
+
+#undef TARGET_OPTION_PRINT
+#define TARGET_OPTION_PRINT ix86_function_specific_print
+
+#undef TARGET_OPTION_CAN_INLINE_P
+#define TARGET_OPTION_CAN_INLINE_P ix86_can_inline_p
+
+#undef TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION
+#define TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION true
+
+#undef TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION
+#define TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION true
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-i386.h"
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index a148cf28e7d..a98e278e9ad 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -49,6 +49,13 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_SSE4A OPTION_ISA_SSE4A
#define TARGET_SSE5 OPTION_ISA_SSE5
#define TARGET_ROUND OPTION_ISA_ROUND
+#define TARGET_ABM OPTION_ISA_ABM
+#define TARGET_POPCNT OPTION_ISA_POPCNT
+#define TARGET_SAHF OPTION_ISA_SAHF
+#define TARGET_AES OPTION_ISA_AES
+#define TARGET_PCLMUL OPTION_ISA_PCLMUL
+#define TARGET_CMPXCHG16B OPTION_ISA_CX16
+
/* SSE5 and SSE4.1 define the same round instructions */
#define OPTION_MASK_ISA_ROUND (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSE5)
@@ -286,7 +293,7 @@ enum ix86_tune_indices {
X86_TUNE_LAST
};
-extern unsigned int ix86_tune_features[X86_TUNE_LAST];
+extern unsigned char ix86_tune_features[X86_TUNE_LAST];
#define TARGET_USE_LEAVE ix86_tune_features[X86_TUNE_USE_LEAVE]
#define TARGET_PUSH_MEMORY ix86_tune_features[X86_TUNE_PUSH_MEMORY]
@@ -380,7 +387,7 @@ enum ix86_arch_indices {
X86_ARCH_LAST
};
-extern unsigned int ix86_arch_features[X86_ARCH_LAST];
+extern unsigned char ix86_arch_features[X86_ARCH_LAST];
#define TARGET_CMOVE ix86_arch_features[X86_ARCH_CMOVE]
#define TARGET_CMPXCHG ix86_arch_features[X86_ARCH_CMPXCHG]
@@ -392,15 +399,7 @@ extern unsigned int ix86_arch_features[X86_ARCH_LAST];
extern int x86_prefetch_sse;
-#define TARGET_ABM x86_abm
-#define TARGET_CMPXCHG16B x86_cmpxchg16b
-#define TARGET_POPCNT x86_popcnt
#define TARGET_PREFETCH_SSE x86_prefetch_sse
-#define TARGET_SAHF x86_sahf
-#define TARGET_RECIP x86_recip
-#define TARGET_FUSED_MADD x86_fused_muladd
-#define TARGET_AES (TARGET_SSE2 && x86_aes)
-#define TARGET_PCLMUL (TARGET_SSE2 && x86_pclmul)
#define ASSEMBLER_DIALECT (ix86_asm_dialect)
@@ -475,7 +474,7 @@ enum calling_abi
Don't use this macro to turn on various extra optimizations for
`-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
-#define OVERRIDE_OPTIONS override_options ()
+#define OVERRIDE_OPTIONS override_options (true)
/* Define this to change the optimizations performed by default. */
#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
@@ -537,196 +536,10 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#endif
/* Target CPU builtins. */
-#define TARGET_CPU_CPP_BUILTINS() \
- do \
- { \
- size_t arch_len = strlen (ix86_arch_string); \
- size_t tune_len = strlen (ix86_tune_string); \
- int last_arch_char = ix86_arch_string[arch_len - 1]; \
- int last_tune_char = ix86_tune_string[tune_len - 1]; \
- \
- if (TARGET_64BIT) \
- { \
- builtin_assert ("cpu=x86_64"); \
- builtin_assert ("machine=x86_64"); \
- builtin_define ("__amd64"); \
- builtin_define ("__amd64__"); \
- builtin_define ("__x86_64"); \
- builtin_define ("__x86_64__"); \
- } \
- else \
- { \
- builtin_assert ("cpu=i386"); \
- builtin_assert ("machine=i386"); \
- builtin_define_std ("i386"); \
- } \
- \
- /* Built-ins based on -march=. */ \
- switch (ix86_arch) \
- { \
- case PROCESSOR_I386: \
- break; \
- case PROCESSOR_I486: \
- builtin_define ("__i486"); \
- builtin_define ("__i486__"); \
- break; \
- case PROCESSOR_PENTIUM: \
- builtin_define ("__i586"); \
- builtin_define ("__i586__"); \
- builtin_define ("__pentium"); \
- builtin_define ("__pentium__"); \
- if (last_arch_char == 'x') \
- builtin_define ("__pentium_mmx__"); \
- break; \
- case PROCESSOR_PENTIUMPRO: \
- builtin_define ("__i686"); \
- builtin_define ("__i686__"); \
- builtin_define ("__pentiumpro"); \
- builtin_define ("__pentiumpro__"); \
- break; \
- case PROCESSOR_GEODE: \
- builtin_define ("__geode"); \
- builtin_define ("__geode__"); \
- break; \
- case PROCESSOR_K6: \
- builtin_define ("__k6"); \
- builtin_define ("__k6__"); \
- if (last_arch_char == '2') \
- builtin_define ("__k6_2__"); \
- else if (last_arch_char == '3') \
- builtin_define ("__k6_3__"); \
- break; \
- case PROCESSOR_ATHLON: \
- builtin_define ("__athlon"); \
- builtin_define ("__athlon__"); \
- /* Only plain "athlon" lacks SSE. */ \
- if (last_arch_char != 'n') \
- builtin_define ("__athlon_sse__"); \
- break; \
- case PROCESSOR_K8: \
- builtin_define ("__k8"); \
- builtin_define ("__k8__"); \
- break; \
- case PROCESSOR_AMDFAM10: \
- builtin_define ("__amdfam10"); \
- builtin_define ("__amdfam10__"); \
- break; \
- case PROCESSOR_PENTIUM4: \
- builtin_define ("__pentium4"); \
- builtin_define ("__pentium4__"); \
- break; \
- case PROCESSOR_NOCONA: \
- builtin_define ("__nocona"); \
- builtin_define ("__nocona__"); \
- break; \
- case PROCESSOR_CORE2: \
- builtin_define ("__core2"); \
- builtin_define ("__core2__"); \
- break; \
- case PROCESSOR_GENERIC32: \
- case PROCESSOR_GENERIC64: \
- case PROCESSOR_max: \
- gcc_unreachable (); \
- } \
- \
- /* Built-ins based on -mtune=. */ \
- switch (ix86_tune) \
- { \
- case PROCESSOR_I386: \
- builtin_define ("__tune_i386__"); \
- break; \
- case PROCESSOR_I486: \
- builtin_define ("__tune_i486__"); \
- break; \
- case PROCESSOR_PENTIUM: \
- builtin_define ("__tune_i586__"); \
- builtin_define ("__tune_pentium__"); \
- if (last_tune_char == 'x') \
- builtin_define ("__tune_pentium_mmx__"); \
- break; \
- case PROCESSOR_PENTIUMPRO: \
- builtin_define ("__tune_i686__"); \
- builtin_define ("__tune_pentiumpro__"); \
- switch (last_tune_char) \
- { \
- case '3': \
- builtin_define ("__tune_pentium3__"); \
- /* FALLTHRU */ \
- case '2': \
- builtin_define ("__tune_pentium2__"); \
- break; \
- } \
- break; \
- case PROCESSOR_GEODE: \
- builtin_define ("__tune_geode__"); \
- break; \
- case PROCESSOR_K6: \
- builtin_define ("__tune_k6__"); \
- if (last_tune_char == '2') \
- builtin_define ("__tune_k6_2__"); \
- else if (last_tune_char == '3') \
- builtin_define ("__tune_k6_3__"); \
- break; \
- case PROCESSOR_ATHLON: \
- builtin_define ("__tune_athlon__"); \
- /* Only plain "athlon" lacks SSE. */ \
- if (last_tune_char != 'n') \
- builtin_define ("__tune_athlon_sse__"); \
- break; \
- case PROCESSOR_K8: \
- builtin_define ("__tune_k8__"); \
- break; \
- case PROCESSOR_AMDFAM10: \
- builtin_define ("__tune_amdfam10__"); \
- break; \
- case PROCESSOR_PENTIUM4: \
- builtin_define ("__tune_pentium4__"); \
- break; \
- case PROCESSOR_NOCONA: \
- builtin_define ("__tune_nocona__"); \
- break; \
- case PROCESSOR_CORE2: \
- builtin_define ("__tune_core2__"); \
- break; \
- case PROCESSOR_GENERIC32: \
- case PROCESSOR_GENERIC64: \
- break; \
- case PROCESSOR_max: \
- gcc_unreachable (); \
- } \
- \
- if (TARGET_MMX) \
- builtin_define ("__MMX__"); \
- if (TARGET_3DNOW) \
- builtin_define ("__3dNOW__"); \
- if (TARGET_3DNOW_A) \
- builtin_define ("__3dNOW_A__"); \
- if (TARGET_SSE) \
- builtin_define ("__SSE__"); \
- if (TARGET_SSE2) \
- builtin_define ("__SSE2__"); \
- if (TARGET_SSE3) \
- builtin_define ("__SSE3__"); \
- if (TARGET_SSSE3) \
- builtin_define ("__SSSE3__"); \
- if (TARGET_SSE4_1) \
- builtin_define ("__SSE4_1__"); \
- if (TARGET_SSE4_2) \
- builtin_define ("__SSE4_2__"); \
- if (TARGET_AES) \
- builtin_define ("__AES__"); \
- if (TARGET_PCLMUL) \
- builtin_define ("__PCLMUL__"); \
- if (TARGET_SSE4A) \
- builtin_define ("__SSE4A__"); \
- if (TARGET_SSE5) \
- builtin_define ("__SSE5__"); \
- if (TARGET_SSE_MATH && TARGET_SSE) \
- builtin_define ("__SSE_MATH__"); \
- if (TARGET_SSE_MATH && TARGET_SSE2) \
- builtin_define ("__SSE2_MATH__"); \
- } \
- while (0)
+#define TARGET_CPU_CPP_BUILTINS() ix86_target_macros ()
+
+/* Target Pragmas. */
+#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
enum target_cpu_default
{
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index aff259d00e0..b00f6e07a30 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -18,24 +18,58 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+;; Definitions to add to the cl_target_option structure
+;; -march= processor
+TargetSave
+unsigned char arch
+
+;; -mtune= processor
+TargetSave
+unsigned char tune
+
+;; -mfpath=
+TargetSave
+unsigned char fpmath
+
+;; branch cost
+TargetSave
+unsigned char branch_cost
+
+;; which flags were passed by the user
+TargetSave
+int ix86_isa_flags_explicit
+
+;; which flags were passed by the user
+TargetSave
+int target_flags_explicit
+
+;; whether -mtune was not specified
+TargetSave
+unsigned char tune_defaulted
+
+;; whether -march was specified
+TargetSave
+unsigned char arch_specified
+
+;; x86 options
m128bit-long-double
-Target RejectNegative Report Mask(128BIT_LONG_DOUBLE)
+Target RejectNegative Report Mask(128BIT_LONG_DOUBLE) Save
sizeof(long double) is 16
m80387
-Target Report Mask(80387)
+Target Report Mask(80387) Save
Use hardware fp
m96bit-long-double
-Target RejectNegative Report InverseMask(128BIT_LONG_DOUBLE)
+Target RejectNegative Report InverseMask(128BIT_LONG_DOUBLE) Save
sizeof(long double) is 12
maccumulate-outgoing-args
-Target Report Mask(ACCUMULATE_OUTGOING_ARGS)
+Target Report Mask(ACCUMULATE_OUTGOING_ARGS) Save
Reserve space for outgoing arguments in the function prologue
malign-double
-Target Report Mask(ALIGN_DOUBLE)
+Target Report Mask(ALIGN_DOUBLE) Save
Align some doubles on dword boundary
malign-functions=
@@ -51,7 +85,7 @@ Target RejectNegative Joined Var(ix86_align_loops_string)
Loop code aligned to this power of 2
malign-stringops
-Target RejectNegative Report InverseMask(NO_ALIGN_STRINGOPS, ALIGN_STRINGOPS)
+Target RejectNegative Report InverseMask(NO_ALIGN_STRINGOPS, ALIGN_STRINGOPS) Save
Align destination of the string operations
march=
@@ -75,7 +109,7 @@ Target RejectNegative Joined Var(ix86_cmodel_string)
Use given x86-64 code model
mfancy-math-387
-Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387)
+Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) Save
Generate sin, cos, sqrt for FPU
mforce-drap
@@ -83,7 +117,7 @@ Target Report Var(ix86_force_drap)
Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack.
mfp-ret-in-387
-Target Report Mask(FLOAT_RETURNS)
+Target Report Mask(FLOAT_RETURNS) Save
Return values of functions in FPU registers
mfpmath=
@@ -91,19 +125,19 @@ Target RejectNegative Joined Var(ix86_fpmath_string)
Generate floating point mathematics using given instruction set
mhard-float
-Target RejectNegative Mask(80387) MaskExists
+Target RejectNegative Mask(80387) MaskExists Save
Use hardware fp
mieee-fp
-Target Report Mask(IEEE_FP)
+Target Report Mask(IEEE_FP) Save
Use IEEE math for fp comparisons
minline-all-stringops
-Target Report Mask(INLINE_ALL_STRINGOPS)
+Target Report Mask(INLINE_ALL_STRINGOPS) Save
Inline all known string operations
minline-stringops-dynamically
-Target Report Mask(INLINE_STRINGOPS_DYNAMICALLY)
+Target Report Mask(INLINE_STRINGOPS_DYNAMICALLY) Save
Inline memset/memcpy string operations, but perform inline version only for small blocks
mintel-syntax
@@ -111,23 +145,23 @@ Target Undocumented
;; Deprecated
mms-bitfields
-Target Report Mask(MS_BITFIELD_LAYOUT)
+Target Report Mask(MS_BITFIELD_LAYOUT) Save
Use native (MS) bitfield layout
mno-align-stringops
-Target RejectNegative Report Mask(NO_ALIGN_STRINGOPS) Undocumented
+Target RejectNegative Report Mask(NO_ALIGN_STRINGOPS) Undocumented Save
mno-fancy-math-387
-Target RejectNegative Report Mask(NO_FANCY_MATH_387) Undocumented
+Target RejectNegative Report Mask(NO_FANCY_MATH_387) Undocumented Save
mno-push-args
-Target RejectNegative Report Mask(NO_PUSH_ARGS) Undocumented
+Target RejectNegative Report Mask(NO_PUSH_ARGS) Undocumented Save
mno-red-zone
-Target RejectNegative Report Mask(NO_RED_ZONE) Undocumented
+Target RejectNegative Report Mask(NO_RED_ZONE) Undocumented Save
momit-leaf-frame-pointer
-Target Report Mask(OMIT_LEAF_FRAME_POINTER)
+Target Report Mask(OMIT_LEAF_FRAME_POINTER) Save
Omit the frame pointer in leaf functions
mpc
@@ -143,11 +177,11 @@ Target RejectNegative Joined Var(ix86_incoming_stack_boundary_string)
Assume incoming stack aligned to this power of 2
mpush-args
-Target Report InverseMask(NO_PUSH_ARGS, PUSH_ARGS)
+Target Report InverseMask(NO_PUSH_ARGS, PUSH_ARGS) Save
Use push instructions to save outgoing arguments
mred-zone
-Target RejectNegative Report InverseMask(NO_RED_ZONE, RED_ZONE)
+Target RejectNegative Report InverseMask(NO_RED_ZONE, RED_ZONE) Save
Use red-zone in the x86-64 code
mregparm=
@@ -155,15 +189,15 @@ Target RejectNegative Joined Var(ix86_regparm_string)
Number of registers used to pass integer arguments
mrtd
-Target Report Mask(RTD)
+Target Report Mask(RTD) Save
Alternate calling convention
msoft-float
-Target InverseMask(80387)
+Target InverseMask(80387) Save
Do not use hardware fp
msseregparm
-Target RejectNegative Mask(SSEREGPARM)
+Target RejectNegative Mask(SSEREGPARM) Save
Use SSE register passing conventions for SF and DF mode
mstackrealign
@@ -171,7 +205,7 @@ Target Report Var(ix86_force_align_arg_pointer) Init(-1)
Realign stack in prologue
mstack-arg-probe
-Target Report Mask(STACK_PROBE)
+Target Report Mask(STACK_PROBE) Save
Enable stack probing
mstringop-strategy=
@@ -194,104 +228,105 @@ mveclibabi=
Target RejectNegative Joined Var(ix86_veclibabi_string)
Vector library ABI to use
+mrecip
+Target Report Mask(RECIP) Save
+Generate reciprocals instead of divss and sqrtss.
+
+mcld
+Target Report Mask(CLD) Save
+Generate cld instruction in the function prologue.
+
+mno-fused-madd
+Target RejectNegative Report Mask(NO_FUSED_MADD) Undocumented Save
+
+mfused-madd
+Target Report InverseMask(NO_FUSED_MADD, FUSED_MADD) Save
+Enable automatic generation of fused floating point multiply-add instructions
+if the ISA supports such instructions. The -mfused-madd option is on by
+default.
+
;; ISA support
m32
-Target RejectNegative Negative(m64) Report InverseMask(ISA_64BIT) Var(ix86_isa_flags) VarExists
+Target RejectNegative Negative(m64) Report InverseMask(ISA_64BIT) Var(ix86_isa_flags) VarExists Save
Generate 32bit i386 code
m64
-Target RejectNegative Negative(m32) Report Mask(ISA_64BIT) Var(ix86_isa_flags) VarExists
+Target RejectNegative Negative(m32) Report Mask(ISA_64BIT) Var(ix86_isa_flags) VarExists Save
Generate 64bit x86-64 code
mmmx
-Target Report Mask(ISA_MMX) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_MMX) Var(ix86_isa_flags) VarExists Save
Support MMX built-in functions
m3dnow
-Target Report Mask(ISA_3DNOW) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_3DNOW) Var(ix86_isa_flags) VarExists Save
Support 3DNow! built-in functions
m3dnowa
-Target Undocumented Mask(ISA_3DNOW_A) Var(ix86_isa_flags) VarExists
+Target Undocumented Mask(ISA_3DNOW_A) Var(ix86_isa_flags) VarExists Save
Support Athlon 3Dnow! built-in functions
msse
-Target Report Mask(ISA_SSE) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE) Var(ix86_isa_flags) VarExists Save
Support MMX and SSE built-in functions and code generation
msse2
-Target Report Mask(ISA_SSE2) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE2) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE and SSE2 built-in functions and code generation
msse3
-Target Report Mask(ISA_SSE3) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE3) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation
mssse3
-Target Report Mask(ISA_SSSE3) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSSE3) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation
msse4.1
-Target Report Mask(ISA_SSE4_1) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE4_1) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1 built-in functions and code generation
msse4.2
-Target Report Mask(ISA_SSE4_2) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE4_2) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation
msse4
-Target RejectNegative Report Mask(ISA_SSE4_2) MaskExists Var(ix86_isa_flags) VarExists
+Target RejectNegative Report Mask(ISA_SSE4_2) MaskExists Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation
mno-sse4
-Target RejectNegative Report InverseMask(ISA_SSE4_1) MaskExists Var(ix86_isa_flags) VarExists
+Target RejectNegative Report InverseMask(ISA_SSE4_1) MaskExists Var(ix86_isa_flags) VarExists Save
Do not support SSE4.1 and SSE4.2 built-in functions and code generation
msse4a
-Target Report Mask(ISA_SSE4A) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE4A) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation
msse5
-Target Report Mask(ISA_SSE5) Var(ix86_isa_flags) VarExists
+Target Report Mask(ISA_SSE5) Var(ix86_isa_flags) VarExists Save
Support SSE5 built-in functions and code generation
-;; Instruction support
-
-mcld
-Target Report Mask(CLD)
-Generate cld instruction in the function prologue.
-
mabm
-Target Report RejectNegative Var(x86_abm)
+Target Report Mask(ISA_ABM) Var(ix86_isa_flags) VarExists Save
Support code generation of Advanced Bit Manipulation (ABM) instructions.
-mcx16
-Target Report RejectNegative Var(x86_cmpxchg16b)
-Support code generation of cmpxchg16b instruction.
-
mpopcnt
-Target Report RejectNegative Var(x86_popcnt)
+Target Report Mask(ISA_POPCNT) Var(ix86_isa_flags) VarExists Save
Support code generation of popcnt instruction.
+mcx16
+Target Report Mask(ISA_CX16) Var(ix86_isa_flags) VarExists Save
+Support code generation of cmpxchg16b instruction.
+
msahf
-Target Report RejectNegative Var(x86_sahf)
+Target Report Mask(ISA_SAHF) Var(ix86_isa_flags) VarExists Save
Support code generation of sahf instruction in 64bit x86-64 code.
-mrecip
-Target Report RejectNegative Var(x86_recip)
-Generate reciprocals instead of divss and sqrtss.
-
-mfused-madd
-Target Report Var(x86_fused_muladd) Init(1)
-Enable automatic generation of fused floating point multiply-add instructions
-if the ISA supports such instructions. The -mfused-madd option is on by
-default.
-
maes
-Target Report RejectNegative Var(x86_aes)
+Target Report Mask(ISA_AES) Var(ix86_isa_flags) VarExists Save
Support AES built-in functions and code generation
mpclmul
-Target Report RejectNegative Var(x86_pclmul)
+Target Report Mask(ISA_PCLMUL) Var(ix86_isa_flags) VarExists Save
Support PCLMUL built-in functions and code generation
diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386
new file mode 100644
index 00000000000..4c0c046dae6
--- /dev/null
+++ b/gcc/config/i386/t-i386
@@ -0,0 +1,13 @@
+i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) $(TREE_H) $(TM_P_H) $(REGS_H) hard-reg-set.h \
+ $(REAL_H) insn-config.h conditions.h output.h insn-codes.h \
+ $(INSN_ATTR_H) $(FLAGS_H) $(C_COMMON_H) except.h $(FUNCTION_H) \
+ $(RECOG_H) $(EXPR_H) $(OPTABS_H) toplev.h $(BASIC_BLOCK_H) \
+ $(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \
+ $(TREE_GIMPLE_H) dwarf2.h $(DF_H) tm-constrs.h $(PARAMS_H)
+
+i386-c.o: $(srcdir)/config/i386/i386-c.c \
+ $(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(FLAGS_H) $(C_COMMON_H) $(GGC_H) \
+ $(TARGET_H) $(TARGET_DEF_H) $(CPPLIB_H) $(C_PRAGMA_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/i386-c.c
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index e93ae31b0bd..29a9a8dacf2 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -493,6 +493,12 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_C_MODE_FOR_SUFFIX
#define TARGET_C_MODE_FOR_SUFFIX ia64_c_mode_for_suffix
+#undef TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION
+#define TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION true
+
+#undef TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION
+#define TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION true
+
struct gcc_target targetm = TARGET_INITIALIZER;
typedef enum
@@ -5232,9 +5238,6 @@ ia64_override_options (void)
TARGET_INLINE_SQRT = INL_MAX_THR;
}
- ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
- flag_schedule_insns_after_reload = 0;
-
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
@@ -9927,6 +9930,13 @@ void
ia64_optimization_options (int level ATTRIBUTE_UNUSED,
int size ATTRIBUTE_UNUSED)
{
+ /* Disable the second machine independent scheduling pass and use one for the
+ IA-64. This needs to be here instead of in OVERRIDE_OPTIONS because this
+ is done whenever the optimization is changed via #pragma GCC optimize or
+ attribute((optimize(...))). */
+ ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
+ flag_schedule_insns_after_reload = 0;
+
/* Let the scheduler form additional regions. */
set_param_value ("max-sched-extend-regions-iters", 2);
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index ce1ec4b9665..76c92352b57 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -85,12 +85,12 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED)
#define builtin_assert(TXT) cpp_assert (pfile, TXT)
/* Keep the AltiVec keywords handy for fast comparisons. */
-static tree __vector_keyword;
-static tree vector_keyword;
-static tree __pixel_keyword;
-static tree pixel_keyword;
-static tree __bool_keyword;
-static tree bool_keyword;
+static GTY(()) tree __vector_keyword;
+static GTY(()) tree vector_keyword;
+static GTY(()) tree __pixel_keyword;
+static GTY(()) tree pixel_keyword;
+static GTY(()) tree __bool_keyword;
+static GTY(()) tree bool_keyword;
/* Preserved across calls. */
static tree expand_bool_pixel;
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 88c7226d7a2..5e2f7ac38a1 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -2111,7 +2111,7 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
Skip section anchors for Objective C and Objective C++
until front-ends fixed. */
if (!TARGET_MACHO && lang_hooks.name[4] != 'O')
- flag_section_anchors = 1;
+ flag_section_anchors = 2;
}
/* Implement TARGET_HANDLE_OPTION. */
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 5204847abc5..2305872903d 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -463,7 +463,7 @@ do { \
do { \
if (LEVEL) \
{ \
- flag_omit_frame_pointer = -1; \
+ flag_omit_frame_pointer = 2; \
if (! SIZE) \
sh_div_str = "inv:minlat"; \
} \
@@ -690,7 +690,7 @@ do { \
if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno))) \
sh_additional_register_names[regno][0] = '\0'; \
\
- if (flag_omit_frame_pointer < 0) \
+ if (flag_omit_frame_pointer == 2) \
{ \
/* The debugging information is sufficient, \
but gdb doesn't implement this yet */ \
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index ef60292cef3..4d180da8285 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -981,9 +981,12 @@ extern int sparc_mode_class[];
/* Pick a default value we can notice from override_options:
!v9: Default is on.
- v9: Default is off. */
+ v9: Default is off.
+ Originally it was -1, but later on the container of options changed to
+ unsigned byte, so we decided to pick 127 as default value, which does
+ reflect an undefined default value in case of 0/1. */
-#define DEFAULT_PCC_STRUCT_RETURN -1
+#define DEFAULT_PCC_STRUCT_RETURN 127
/* Functions which return large structures get the address
to place the wanted value at offset 64 from the frame.
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index 0b0d2e8743a..96fe43e6e94 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -35,6 +35,64 @@
#include "spu-builtins.h"
+/* Keep the vector keywords handy for fast comparisons. */
+static GTY(()) tree __vector_keyword;
+static GTY(()) tree vector_keyword;
+
+static cpp_hashnode *
+spu_categorize_keyword (const cpp_token *tok)
+{
+ if (tok->type == CPP_NAME)
+ {
+ cpp_hashnode *ident = tok->val.node;
+
+ if (ident == C_CPP_HASHNODE (vector_keyword)
+ || ident == C_CPP_HASHNODE (__vector_keyword))
+ return C_CPP_HASHNODE (__vector_keyword);
+ else
+ return ident;
+ }
+ return 0;
+}
+
+/* Called to decide whether a conditional macro should be expanded.
+ Since we have exactly one such macro (i.e, 'vector'), we do not
+ need to examine the 'tok' parameter. */
+
+static cpp_hashnode *
+spu_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
+{
+ cpp_hashnode *expand_this = tok->val.node;
+ cpp_hashnode *ident;
+
+ ident = spu_categorize_keyword (tok);
+ if (ident == C_CPP_HASHNODE (__vector_keyword))
+ {
+ tok = cpp_peek_token (pfile, 0);
+ ident = spu_categorize_keyword (tok);
+
+ if (ident)
+ {
+ enum rid rid_code = (enum rid)(ident->rid_code);
+ if (ident->type == NT_MACRO)
+ {
+ (void) cpp_get_token (pfile);
+ tok = cpp_peek_token (pfile, 0);
+ ident = spu_categorize_keyword (tok);
+ if (ident)
+ rid_code = (enum rid)(ident->rid_code);
+ }
+
+ if (rid_code == RID_UNSIGNED || rid_code == RID_LONG
+ || rid_code == RID_SHORT || rid_code == RID_SIGNED
+ || rid_code == RID_INT || rid_code == RID_CHAR
+ || rid_code == RID_FLOAT || rid_code == RID_DOUBLE)
+ expand_this = C_CPP_HASHNODE (__vector_keyword);
+ }
+ }
+ return expand_this;
+}
+
/* target hook for resolve_overloaded_builtin(). Returns a function call
RTX if we can resolve the overloaded builtin */
tree
@@ -140,6 +198,22 @@ spu_cpu_cpp_builtins (struct cpp_reader *pfile)
if (spu_arch == PROCESSOR_CELLEDP)
builtin_define_std ("__SPU_EDP__");
builtin_define_std ("__vector=__attribute__((__spu_vector__))");
+
+ if (!flag_iso)
+ {
+ /* Define this when supporting context-sensitive keywords. */
+ cpp_define (pfile, "__VECTOR_KEYWORD_SUPPORTED__");
+ cpp_define (pfile, "vector=vector");
+
+ /* Initialize vector keywords. */
+ __vector_keyword = get_identifier ("__vector");
+ C_CPP_HASHNODE (__vector_keyword)->flags |= NODE_CONDITIONAL;
+ vector_keyword = get_identifier ("vector");
+ C_CPP_HASHNODE (vector_keyword)->flags |= NODE_CONDITIONAL;
+
+ /* Enable context-sensitive macros. */
+ cpp_get_callbacks (pfile)->macro_to_expand = spu_macro_to_expand;
+ }
}
void
diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md
index 6985a683697..c267efd29d1 100644
--- a/gcc/config/spu/spu.md
+++ b/gcc/config/spu/spu.md
@@ -1721,20 +1721,33 @@
[(set_attr "type" "multi0")
(set_attr "length" "80")])
-(define_insn_and_split "div<mode>3"
+(define_expand "div<mode>3"
+ [(parallel
+ [(set (match_operand:VSF 0 "spu_reg_operand" "")
+ (div:VSF (match_operand:VSF 1 "spu_reg_operand" "")
+ (match_operand:VSF 2 "spu_reg_operand" "")))
+ (clobber (match_scratch:VSF 3 ""))
+ (clobber (match_scratch:VSF 4 ""))
+ (clobber (match_scratch:VSF 5 ""))])]
+ ""
+ "")
+
+(define_insn_and_split "*div<mode>3_fast"
[(set (match_operand:VSF 0 "spu_reg_operand" "=r")
(div:VSF (match_operand:VSF 1 "spu_reg_operand" "r")
(match_operand:VSF 2 "spu_reg_operand" "r")))
(clobber (match_scratch:VSF 3 "=&r"))
- (clobber (match_scratch:VSF 4 "=&r"))]
- ""
+ (clobber (match_scratch:VSF 4 "=&r"))
+ (clobber (scratch:VSF))]
+ "flag_unsafe_math_optimizations"
"#"
"reload_completed"
[(set (match_dup:VSF 0)
(div:VSF (match_dup:VSF 1)
(match_dup:VSF 2)))
(clobber (match_dup:VSF 3))
- (clobber (match_dup:VSF 4))]
+ (clobber (match_dup:VSF 4))
+ (clobber (scratch:VSF))]
{
emit_insn (gen_frest_<mode>(operands[3], operands[2]));
emit_insn (gen_fi_<mode>(operands[3], operands[2], operands[3]));
@@ -1744,6 +1757,50 @@
DONE;
})
+(define_insn_and_split "*div<mode>3_adjusted"
+ [(set (match_operand:VSF 0 "spu_reg_operand" "=r")
+ (div:VSF (match_operand:VSF 1 "spu_reg_operand" "r")
+ (match_operand:VSF 2 "spu_reg_operand" "r")))
+ (clobber (match_scratch:VSF 3 "=&r"))
+ (clobber (match_scratch:VSF 4 "=&r"))
+ (clobber (match_scratch:VSF 5 "=&r"))]
+ "!flag_unsafe_math_optimizations"
+ "#"
+ "reload_completed"
+ [(set (match_dup:VSF 0)
+ (div:VSF (match_dup:VSF 1)
+ (match_dup:VSF 2)))
+ (clobber (match_dup:VSF 3))
+ (clobber (match_dup:VSF 4))
+ (clobber (match_dup:VSF 5))]
+ {
+ emit_insn (gen_frest_<mode> (operands[3], operands[2]));
+ emit_insn (gen_fi_<mode> (operands[3], operands[2], operands[3]));
+ emit_insn (gen_mul<mode>3 (operands[4], operands[1], operands[3]));
+ emit_insn (gen_fnms_<mode> (operands[5], operands[4], operands[2], operands[1]));
+ emit_insn (gen_fma_<mode> (operands[3], operands[5], operands[3], operands[4]));
+
+ /* Due to truncation error, the quotient result may be low by 1 ulp.
+ Conditionally add one if the estimate is too small in magnitude. */
+
+ emit_move_insn (gen_lowpart (<F2I>mode, operands[4]),
+ spu_const (<F2I>mode, 0x80000000ULL));
+ emit_move_insn (gen_lowpart (<F2I>mode, operands[5]),
+ spu_const (<F2I>mode, 0x3f800000ULL));
+ emit_insn (gen_selb (operands[5], operands[5], operands[1], operands[4]));
+
+ emit_insn (gen_add<f2i>3 (gen_lowpart (<F2I>mode, operands[4]),
+ gen_lowpart (<F2I>mode, operands[3]),
+ spu_const (<F2I>mode, 1)));
+ emit_insn (gen_fnms_<mode> (operands[0], operands[2], operands[4], operands[1]));
+ emit_insn (gen_mul<mode>3 (operands[0], operands[0], operands[5]));
+ emit_insn (gen_cgt_<f2i> (gen_lowpart (<F2I>mode, operands[0]),
+ gen_lowpart (<F2I>mode, operands[0]),
+ spu_const (<F2I>mode, -1)));
+ emit_insn (gen_selb (operands[0], operands[3], operands[4], operands[0]));
+ DONE;
+ })
+
;; Taken from STI's gcc
;; Does not correctly handle INF or NAN.
(define_expand "divdf3"
diff --git a/gcc/configure b/gcc/configure
index 09d2768e669..c015f6e52e3 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -8541,7 +8541,7 @@ else
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
- 4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*) gcc_cv_prog_makeinfo_modern=yes;;
+ 4.[7-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*) gcc_cv_prog_makeinfo_modern=yes;;
*) gcc_cv_prog_makeinfo_modern=no;;
esac
diff --git a/gcc/configure.ac b/gcc/configure.ac
index d5244bd3800..03c3d1c3888 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -842,7 +842,7 @@ AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
# that we can use it.
ACX_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
- [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
+ [4.[7-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
if test $gcc_cv_prog_makeinfo_modern = no; then
AC_MSG_WARN([
*** Makeinfo is missing or too old.
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index f585eb411c6..f5d62cab785 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -50,6 +50,8 @@ typedef union tree_node *tree;
typedef const union tree_node *const_tree;
union section;
typedef union section section;
+struct cl_target_option;
+struct cl_optimization;
/* The major intermediate representations of GCC. */
enum ir_type {
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2112b8fd8e6..b8e54a5aca8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,120 @@
+2008-07-25 Jan Hubicka <jh@suse.cz>
+
+ * typeck.c (inline_conversion): Remove.
+ (cp_build_function_call): Do not use inline_conversion.
+ * decl.c (duplicate_decls): Do not insist on inline being declared
+ early.
+ (start_cleanup_fn): Do not assume that INLINE flags prevent function
+ from being output. We now remove static functions always.
+ (finish_function): Do return warning on all static functions.
+ * call.c (build_over_call): Do not use inline_conversion.
+ * cp-tree.h (possibly_inlined_p): Declare.
+ (inline_conversion): Remove.
+ * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
+ * decl2.c (cp_write_global_declarations): Likewise.
+ (mark_used): Likewise.
+ (possibly_inlined_p): New functions.
+
+2008-07-25 Jason Merrill <jason@redhat.com>
+
+ * class.c (type_has_user_provided_default_constructor): Handle
+ templates.
+
+2008-07-23 Jan Hubicka <jh@suse.cz>
+
+ * decl.c (duplicate_decls): Update comment and unit-at-a-time.
+ (grogfndecl): Drop flag_inline_trees code.
+ * pt.c (instantiate_decl): Drop flag_iline_trees code.
+ * lex.c (cxx_init): Do not set unit-at-a-time.
+
+2008-07-23 Jason Merrill <jason@redhat.com>
+
+ * mangle.c (write_unqualified_name): Avoid infinite recursion when
+ trying to mangle a decl with no name.
+
+ Implement defaulted/deleted functions as per N2346
+ * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
+ (DECL_DELETED_FN): New macro.
+ (DECL_DEFAULTED_FN): New macro.
+ * class.c (user_provided_p): New fn.
+ (defaultable_fn_p): New fn.
+ (type_has_user_provided_constructor): New fn.
+ (type_has_user_provided_default_constructor): New fn.
+ (check_methods): A defaulted fn is still trivial.
+ (check_bases_and_members): Likewise.
+ * decl.c (grok_special_member_properties): Likewise.
+ (duplicate_decls): Complain about redeclaring a function as deleted.
+ (start_decl): initialized==2 means deleted.
+ (cp_finish_decl): Handle deleted/defaulted semantics.
+ * decl2.c (grokfield): Likewise.
+ (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
+ Complain about using a deleted fn.
+ * init.c (build_value_init_1): Use type_has_user_provided_constructor.
+ (perform_member_init): Check for a user-provided default constructor
+ even if TYPE_NEEDS_CONSTRUCTING.
+ (build_new_1): Likewise.
+ * call.c (build_over_call): Don't call mark_used twice.
+ * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
+ * search.c (check_final_overrider): Check for deleted mismatch.
+ * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
+ (cp_parser_pure_specifier): Handle =default and =delete.
+
+ * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * typeck.c: All calls to pedwarn changed.
+ * decl.c: All calls to pedwarn changed.
+ * call.c: All calls to pedwarn changed.
+ * error.c: All calls to pedwarn changed.
+ * typeck2.c: All calls to pedwarn changed.
+ * pt.c: All calls to pedwarn changed.
+ * name-lookup.c: All calls to pedwarn changed.
+ * parser.c: All calls to pedwarn changed.
+
+2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * call.c: Fix comment typos.
+ * class.c: Likewise.
+ * cp-tree.h: Likewise.
+ * cxx-pretty-print.c: Likewise.
+ * decl.c: Likewise.
+ * init.c: Likewise.
+ * name-lookup.c: Likewise.
+ * operators.def: Likewise.
+ * parser.c: Likewise.
+ * pt.c: Likewise.
+ * tree.c: Likewise.
+ * typeck.c: Likewise.
+
+2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36871
+ PR c++/36872
+ * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
+ copy constructors and copy assignment operators proper.
+
+2008-07-21 Rafael Avila de Espindola <espindola@google.com>
+
+ * parser.c (cp_token): Remove in_system_header.
+ (eof_token): Remove in_system_header.
+ (cp_lexer_get_preprocessor_token): Don't set in_system_header.
+ (cp_lexer_set_source_position_from_token): Don't set in_system_header.
+ (cp_parser_member_declaration): Use in_system_header_at.
+ * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
+ (pop_tinst_level): Don't set in_system_header.
+ (instantiate_class_template): Don't set in_system_header.
+ (instantiate_decl): Don't set in_system_header.
+ (instantiate_pending_templates): Don't set in_system_header.
+
+2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36870
+ * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
+ TYPE_NOTHROW_P, not TREE_NOTHROW.
+ (trait_expr_value): Likewise.
+
2008-07-18 Dodji Seketeli <dseketel@redhat.com>
PR c++/36407
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 3c54001e3bd..cb07c82f1ab 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3404,8 +3404,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
calculated only once. */
if (!arg2)
{
- if (pedantic && (complain & tf_error))
- pedwarn ("ISO C++ forbids omitting the middle term of a ?: expression");
+ if (complain & tf_error)
+ pedwarn (OPT_pedantic,
+ "ISO C++ forbids omitting the middle term of a ?: expression");
/* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */
if (real_lvalue_p (arg1))
@@ -3416,7 +3417,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
/* [expr.cond]
- The first expr ession is implicitly converted to bool (clause
+ The first expression is implicitly converted to bool (clause
_conv_). */
arg1 = perform_implicit_conversion (boolean_type_node, arg1, complain);
@@ -5089,6 +5090,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
int is_method = 0;
int nargs;
tree *argarray;
+ bool already_used = false;
/* In a template, there is no need to perform all of the work that
is normally done. We are only interested in the type of the call
@@ -5309,7 +5311,10 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
/* [class.copy]: the copy constructor is implicitly defined even if
the implementation elided its use. */
if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn)))
- mark_used (fn);
+ {
+ mark_used (fn);
+ already_used = true;
+ }
/* If we're creating a temp and we already have one, don't create a
new one. If we're not creating a temp but we get one, use
@@ -5369,7 +5374,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
return val;
}
- mark_used (fn);
+ if (!already_used)
+ mark_used (fn);
if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0)
{
@@ -5394,8 +5400,6 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
fn = build_vfn_ref (argarray[0], DECL_VINDEX (fn));
TREE_TYPE (fn) = t;
}
- else if (DECL_INLINE (fn))
- fn = inline_conversion (fn);
else
fn = build_addr_func (fn);
@@ -6760,7 +6764,7 @@ tweak:
{
if (warn)
{
- warning (0,
+ pedwarn (0,
"ISO C++ says that these are ambiguous, even "
"though the worst conversion for the first is better than "
"the worst conversion for the second:");
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 12b17f3751c..18204608da3 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3045,7 +3045,7 @@ check_field_decls (tree t, tree *access_decls,
/* Core issue 80: A nonstatic data member is required to have a
different name from the class iff the class has a
- user-defined constructor. */
+ user-declared constructor. */
if (constructor_name_p (DECL_NAME (x), t)
&& TYPE_HAS_USER_CONSTRUCTOR (t))
permerror ("field %q+#D with same name as class", x);
@@ -3767,8 +3767,8 @@ check_methods (tree t)
if (DECL_PURE_VIRTUAL_P (x))
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
}
- /* All user-declared destructors are non-trivial. */
- if (DECL_DESTRUCTOR_P (x))
+ /* All user-provided destructors are non-trivial. */
+ if (DECL_DESTRUCTOR_P (x) && !DECL_DEFAULTED_FN (x))
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1;
}
}
@@ -4067,6 +4067,87 @@ type_has_user_nondefault_constructor (tree t)
return false;
}
+/* Returns true iff FN is a user-provided function, i.e. user-declared
+ and not defaulted at its first declaration. */
+
+static bool
+user_provided_p (tree fn)
+{
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
+ return true;
+ else
+ return (!DECL_ARTIFICIAL (fn)
+ && !(DECL_DEFAULTED_FN (fn)
+ && DECL_INITIALIZED_IN_CLASS_P (fn)));
+}
+
+/* Returns true iff class T has a user-provided constructor. */
+
+bool
+type_has_user_provided_constructor (tree t)
+{
+ tree fns;
+
+ if (!TYPE_HAS_USER_CONSTRUCTOR (t))
+ return false;
+
+ /* This can happen in error cases; avoid crashing. */
+ if (!CLASSTYPE_METHOD_VEC (t))
+ return false;
+
+ for (fns = CLASSTYPE_CONSTRUCTORS (t); fns; fns = OVL_NEXT (fns))
+ if (user_provided_p (OVL_CURRENT (fns)))
+ return true;
+
+ return false;
+}
+
+/* Returns true iff class T has a user-provided default constructor. */
+
+bool
+type_has_user_provided_default_constructor (tree t)
+{
+ tree fns;
+
+ if (!TYPE_HAS_USER_CONSTRUCTOR (t))
+ return false;
+
+ for (fns = CLASSTYPE_CONSTRUCTORS (t); fns; fns = OVL_NEXT (fns))
+ {
+ tree fn = OVL_CURRENT (fns);
+ if (TREE_CODE (fn) == FUNCTION_DECL
+ && user_provided_p (fn)
+ && (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
+ == NULL_TREE))
+ return true;
+ }
+
+ return false;
+}
+
+/* Returns true if FN can be explicitly defaulted. */
+
+bool
+defaultable_fn_p (tree fn)
+{
+ if (DECL_CONSTRUCTOR_P (fn))
+ {
+ if (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
+ == NULL_TREE)
+ return true;
+ else if (copy_fn_p (fn) > 0)
+ return true;
+ else
+ return false;
+ }
+ else if (DECL_DESTRUCTOR_P (fn))
+ return true;
+ else if (DECL_ASSIGNMENT_OPERATOR_P (fn))
+ return copy_fn_p (fn);
+ else
+ return false;
+}
+
/* Remove all zero-width bit-fields from T. */
static void
@@ -4158,6 +4239,8 @@ check_bases_and_members (tree t)
should take a non-const reference argument. */
int no_const_asn_ref;
tree access_decls;
+ bool saved_complex_asn_ref;
+ bool saved_nontrivial_dtor;
/* By default, we use const reference arguments and generate default
constructors. */
@@ -4171,6 +4254,12 @@ check_bases_and_members (tree t)
/* Check all the method declarations. */
check_methods (t);
+ /* Save the initial values of these flags which only indicate whether
+ or not the class has user-provided functions. As we analyze the
+ bases and members we can set these flags for other reasons. */
+ saved_complex_asn_ref = TYPE_HAS_COMPLEX_ASSIGN_REF (t);
+ saved_nontrivial_dtor = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t);
+
/* Check all the data member declarations. We cannot call
check_field_decls until we have called check_bases check_methods,
as check_field_decls depends on TYPE_HAS_NONTRIVIAL_DESTRUCTOR
@@ -4186,30 +4275,27 @@ check_bases_and_members (tree t)
/* Do some bookkeeping that will guide the generation of implicitly
declared member functions. */
- TYPE_HAS_COMPLEX_INIT_REF (t)
- |= (TYPE_HAS_INIT_REF (t) || TYPE_CONTAINS_VPTR_P (t));
+ TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_CONTAINS_VPTR_P (t);
/* We need to call a constructor for this class if it has a
- user-declared constructor, or if the default constructor is going
+ user-provided constructor, or if the default constructor is going
to initialize the vptr. (This is not an if-and-only-if;
TYPE_NEEDS_CONSTRUCTING is set elsewhere if bases or members
themselves need constructing.) */
TYPE_NEEDS_CONSTRUCTING (t)
- |= (TYPE_HAS_USER_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (t));
+ |= (type_has_user_provided_constructor (t) || TYPE_CONTAINS_VPTR_P (t));
/* [dcl.init.aggr]
- An aggregate is an arry or a class with no user-declared
+ An aggregate is an array or a class with no user-provided
constructors ... and no virtual functions.
Again, other conditions for being an aggregate are checked
elsewhere. */
CLASSTYPE_NON_AGGREGATE (t)
- |= (TYPE_HAS_USER_CONSTRUCTOR (t) || TYPE_POLYMORPHIC_P (t));
+ |= (type_has_user_provided_constructor (t) || TYPE_POLYMORPHIC_P (t));
CLASSTYPE_NON_POD_P (t)
|= (CLASSTYPE_NON_AGGREGATE (t)
- || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
- || TYPE_HAS_ASSIGN_REF (t));
- TYPE_HAS_COMPLEX_ASSIGN_REF (t)
- |= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t);
+ || saved_nontrivial_dtor || saved_complex_asn_ref);
+ TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_CONTAINS_VPTR_P (t);
TYPE_HAS_COMPLEX_DFLT (t)
|= (TYPE_HAS_DEFAULT_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (t));
@@ -7386,7 +7472,7 @@ build_vtbl_initializer (tree binfo,
We first check this in update_vtable_entry_for_fn, so we handle
restored primary bases properly; we also need to do it here so we
- zero out unused slots in ctor vtables, rather than filling themff
+ zero out unused slots in ctor vtables, rather than filling them
with erroneous values (though harmless, apart from relocation
costs). */
for (b = binfo; ; b = get_primary_binfo (b))
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index b07effead05..13c1797795f 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -853,7 +853,7 @@ struct language_function GTY(())
#define cp_function_chain (cfun->language)
/* In a constructor destructor, the point at which all derived class
- destroying/construction has been has been done. Ie. just before a
+ destroying/construction has been done. I.e., just before a
constructor returns, or before any base class destroying will be done
in a destructor. */
@@ -1609,7 +1609,7 @@ struct lang_decl_flags GTY(())
unsigned repo_available_p : 1;
unsigned hidden_friend_p : 1;
unsigned threadprivate_p : 1;
- /* One unused bit. */
+ unsigned defaulted_p : 1;
union lang_decl_u {
/* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
@@ -1917,7 +1917,7 @@ struct lang_decl GTY(())
/* Nonzero if the DECL was initialized in the class definition itself,
rather than outside the class. This is used for both static member
- VAR_DECLS, and FUNTION_DECLS that are defined in the class. */
+ VAR_DECLS, and FUNCTION_DECLS that are defined in the class. */
#define DECL_INITIALIZED_IN_CLASS_P(DECL) \
(DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class)
@@ -2626,6 +2626,14 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define CP_DECL_THREADPRIVATE_P(DECL) \
(DECL_LANG_SPECIFIC (VAR_DECL_CHECK (DECL))->decl_flags.threadprivate_p)
+/* Nonzero if DECL was declared with '= delete'. */
+#define DECL_DELETED_FN(DECL) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.threadprivate_p)
+
+/* Nonzero if DECL was declared with '= default'. */
+#define DECL_DEFAULTED_FN(DECL) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.defaulted_p)
+
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
@@ -3199,7 +3207,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
template <class T> struct S { friend void f(T) {}; };
the declaration of `void f(int)' generated when S<int> is
instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
- a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */
+ a DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION. */
#define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
(DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
@@ -4171,6 +4179,9 @@ extern void check_for_override (tree, tree);
extern void push_class_stack (void);
extern void pop_class_stack (void);
extern bool type_has_user_nondefault_constructor (tree);
+extern bool type_has_user_provided_constructor (tree);
+extern bool type_has_user_provided_default_constructor (tree);
+extern bool defaultable_fn_p (tree);
/* in cvt.c */
extern tree convert_to_reference (tree, tree, int, int, tree);
@@ -4323,6 +4334,7 @@ extern void mark_needed (tree);
extern bool decl_needed_p (tree);
extern void note_vague_linkage_fn (tree);
extern tree build_artificial_parm (tree, tree);
+extern bool possibly_inlined_p (tree);
/* in error.c */
extern void init_error (void);
@@ -4801,7 +4813,6 @@ extern int comp_cv_qual_signature (tree, tree);
extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code, bool);
extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool);
extern tree cxx_sizeof_nowarn (tree);
-extern tree inline_conversion (tree);
extern tree is_bitfield_expr_with_lowered_type (const_tree);
extern tree unlowered_expr_type (const_tree);
extern tree decay_conversion (tree);
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 62ff1fc3fc3..cf9ed482e84 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -452,7 +452,7 @@ pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t)
reinterpret_cast < type-id > ( expression )
const_cast < type-id > ( expression )
typeid ( expression )
- typeif ( type-id ) */
+ typeid ( type-id ) */
static void
pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t)
@@ -810,7 +810,7 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
- /* Handle unfortunate OFFESET_REF overloading here. */
+ /* Handle unfortunate OFFSET_REF overloading here. */
case OFFSET_REF:
if (TYPE_P (TREE_OPERAND (t, 0)))
{
@@ -2016,7 +2016,7 @@ pp_cxx_template_parameter (cxx_pretty_printer *pp, tree t)
pp_cxx_identifier (pp, "...");
if (DECL_NAME (parameter))
pp_cxx_tree_identifier (pp, DECL_NAME (parameter));
- /* FIXME: Chech if we should print also default argument. */
+ /* FIXME: Check if we should print also default argument. */
break;
case PARM_DECL:
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index cd6f287c857..b762f680d83 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -315,7 +315,7 @@ current_tmpl_spec_kind (int n_class_scopes)
template <class T> void S<T>::f(int);
- The `class T' maches the `S<T>', leaving no template headers
+ The `class T' matches the `S<T>', leaving no template headers
corresponding to the `f'. */
return tsk_none;
else if (n_template_parm_scopes > n_class_scopes + 1)
@@ -1551,14 +1551,6 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
olddecl);
}
}
-
- if (DECL_DECLARED_INLINE_P (newdecl)
- && ! DECL_DECLARED_INLINE_P (olddecl)
- && TREE_ADDRESSABLE (olddecl) && warn_inline)
- {
- warning (0, "%q#D was used before it was declared inline", newdecl);
- warning (0, "%Jprevious non-inline declaration here", olddecl);
- }
}
}
@@ -1613,6 +1605,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
warning (OPT_Wredundant_decls, "redundant redeclaration of %qD in same scope", newdecl);
warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl);
}
+
+ if (DECL_DELETED_FN (newdecl))
+ {
+ error ("deleted definition of %qD", newdecl);
+ error ("after previous declaration %q+D", olddecl);
+ }
}
/* Deal with C++: must preserve virtual function table size. */
@@ -1948,8 +1946,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
}
else if (new_defines_function && DECL_INITIAL (olddecl))
{
- /* C++ is always in in unit-at-a-time mode, so we never
- inline re-defined extern inline functions. */
+ /* Never inline re-defined extern inline functions.
+ FIXME: this could be better handled by keeping both
+ function as separate declarations. */
DECL_INLINE (newdecl) = 0;
DECL_UNINLINABLE (newdecl) = 1;
}
@@ -3813,9 +3812,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
/* Anonymous unions are objects, so they can have specifiers. */;
SET_ANON_AGGR_TYPE_P (declared_type);
- if (TREE_CODE (declared_type) != UNION_TYPE && pedantic
- && !in_system_header)
- pedwarn ("ISO C++ prohibits anonymous structs");
+ if (TREE_CODE (declared_type) != UNION_TYPE && !in_system_header)
+ pedwarn (OPT_pedantic, "ISO C++ prohibits anonymous structs");
}
else
@@ -3932,13 +3930,14 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
grokfield.) The DECL corresponding to the DECLARATOR is returned.
If an error occurs, the error_mark_node is returned instead.
- DECLSPECS are the decl-specifiers for the declaration. INITIALIZED
- is true if an explicit initializer is present, but false if this is
- a variable implicitly initialized via a default constructor.
- ATTRIBUTES and PREFIX_ATTRIBUTES are GNU attributes associated with
- this declaration. *PUSHED_SCOPE_P is set to the scope entered in
- this function, if any; if set, the caller is responsible for
- calling pop_scope. */
+ DECLSPECS are the decl-specifiers for the declaration. INITIALIZED is 1
+ if an explicit initializer is present, or 2 for an explicitly defaulted
+ function, or 3 for an explicitly deleted function, but 0 if this is a
+ variable implicitly initialized via a default constructor. ATTRIBUTES
+ and PREFIX_ATTRIBUTES are GNU attributes associated with this
+ declaration. *PUSHED_SCOPE_P is set to the scope entered in this
+ function, if any; if set, the caller is responsible for calling
+ pop_scope. */
tree
start_decl (const cp_declarator *declarator,
@@ -3992,12 +3991,15 @@ start_decl (const cp_declarator *declarator,
switch (TREE_CODE (decl))
{
case TYPE_DECL:
- error ("typedef %qD is initialized (use __typeof__ instead)", decl);
+ error ("typedef %qD is initialized (use decltype instead)", decl);
return error_mark_node;
case FUNCTION_DECL:
- error ("function %q#D is initialized like a variable", decl);
- return error_mark_node;
+ if (initialized == 3)
+ /* We'll handle the rest of the semantics later, but we need to
+ set this now so it's visible to duplicate_decls. */
+ DECL_DELETED_FN (decl) = 1;
+ break;
default:
break;
@@ -4345,7 +4347,7 @@ check_array_designated_initializer (const constructor_elt *ce)
if (ce->index)
{
/* The parser only allows identifiers as designated
- intializers. */
+ initializers. */
gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE);
error ("name %qD used in a GNU-style designated "
"initializer for an array", ce->index);
@@ -5687,10 +5689,38 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
else
abstract_virtuals_error (decl, type);
- if (TREE_CODE (decl) == FUNCTION_DECL
- || TREE_TYPE (decl) == error_mark_node)
+ if (TREE_TYPE (decl) == error_mark_node)
/* No initialization required. */
;
+ else if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ if (init)
+ {
+ if (init == ridpointers[(int)RID_DELETE])
+ {
+ /* fixme check this is 1st decl */
+ DECL_DELETED_FN (decl) = 1;
+ DECL_DECLARED_INLINE_P (decl) = 1;
+ DECL_INITIAL (decl) = error_mark_node;
+ }
+ else if (init == ridpointers[(int)RID_DEFAULT])
+ {
+ if (!defaultable_fn_p (decl))
+ error ("%qD cannot be defaulted", decl);
+ else
+ {
+ /* An out-of-class default definition is defined at
+ the point where it is explicitly defaulted. */
+ DECL_DEFAULTED_FN (decl) = 1;
+ if (DECL_INITIAL (decl) == error_mark_node)
+ synthesize_method (decl);
+ }
+ }
+ else
+ error ("function %q#D is initialized like a variable", decl);
+ }
+ /* else no initialization required. */
+ }
else if (DECL_EXTERNAL (decl)
&& ! (DECL_LANG_SPECIFIC (decl)
&& DECL_NOT_REALLY_EXTERN (decl)))
@@ -5916,8 +5946,6 @@ start_cleanup_fn (void)
actually needed. It is unlikely that it will be inlined, since
it is only called via a function pointer, but we avoid unnecessary
emissions this way. */
- DECL_INLINE (fndecl) = 1;
- DECL_DECLARED_INLINE_P (fndecl) = 1;
DECL_INTERFACE_KNOWN (fndecl) = 1;
/* Build the parameter. */
if (use_cxa_atexit)
@@ -6606,7 +6634,7 @@ grokfndecl (tree ctype,
/* We inline functions that are explicitly declared inline, or, when
the user explicitly asks us to, all functions. */
if (DECL_DECLARED_INLINE_P (decl)
- || (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag))
+ || (!DECL_INLINE (decl) && funcdef_flag))
DECL_INLINE (decl) = 1;
DECL_EXTERNAL (decl) = 1;
@@ -7004,8 +7032,8 @@ check_static_variable_definition (tree decl, tree type)
error ("ISO C++ forbids in-class initialization of non-const "
"static member %qD",
decl);
- else if (pedantic && !INTEGRAL_TYPE_P (type))
- pedwarn ("ISO C++ forbids initialization of member constant "
+ else if (!INTEGRAL_TYPE_P (type))
+ pedwarn (OPT_pedantic, "ISO C++ forbids initialization of member constant "
"%qD of non-integral type %qT", decl, type);
return 0;
@@ -7050,7 +7078,7 @@ compute_array_index_type (tree name, tree size)
if (!abi_version_at_least (2) && processing_template_decl)
/* For abi-1, we handled all instances in templates the same way,
- even when they were non-dependent. This effects the manglings
+ even when they were non-dependent. This affects the manglings
produced. So, we do the normal checking for non-dependent
sizes, but at the end we'll return the same type that abi-1
would have, but with TYPE_CANONICAL set to the "right"
@@ -7082,12 +7110,12 @@ compute_array_index_type (tree name, tree size)
}
/* As an extension we allow zero-sized arrays. We always allow
them in system headers because glibc uses them. */
- else if (integer_zerop (size) && pedantic && !in_system_header)
+ else if (integer_zerop (size) && !in_system_header)
{
if (name)
- pedwarn ("ISO C++ forbids zero-size array %qD", name);
+ pedwarn (OPT_pedantic, "ISO C++ forbids zero-size array %qD", name);
else
- pedwarn ("ISO C++ forbids zero-size array");
+ pedwarn (OPT_pedantic, "ISO C++ forbids zero-size array");
}
}
else if (TREE_CONSTANT (size))
@@ -7103,9 +7131,9 @@ compute_array_index_type (tree name, tree size)
else if (pedantic && warn_vla != 0)
{
if (name)
- pedwarn ("ISO C++ forbids variable length array %qD", name);
+ pedwarn (OPT_Wvla, "ISO C++ forbids variable length array %qD", name);
else
- pedwarn ("ISO C++ forbids variable length array");
+ pedwarn (OPT_Wvla, "ISO C++ forbids variable length array");
}
else if (warn_vla > 0)
{
@@ -7362,7 +7390,7 @@ check_var_type (tree identifier, tree type)
Don't make a DECL node; just return the ..._TYPE node.
FIELD for a struct or union field; make a FIELD_DECL.
BITFIELD for a field with specified width.
- INITIALIZED is 1 if the decl has an initializer.
+ INITIALIZED is as for start_decl.
ATTRLIST is a pointer to the list of attributes, which may be NULL
if there are none; *ATTRLIST may be modified if attributes from inside
@@ -7460,6 +7488,9 @@ grokdeclarator (const cp_declarator *declarator,
else if (decl_context == BITFIELD)
bitfield = 1, decl_context = FIELD;
+ if (initialized > 1)
+ funcdef_flag = true;
+
/* Look inside a declarator for the name being declared
and get it as a string, for an error message. */
for (id_declarator = declarator;
@@ -7736,7 +7767,8 @@ grokdeclarator (const cp_declarator *declarator,
else if (! is_main)
permerror ("ISO C++ forbids declaration of %qs with no type", name);
else if (pedantic)
- pedwarn ("ISO C++ forbids declaration of %qs with no type", name);
+ pedwarn (OPT_pedantic,
+ "ISO C++ forbids declaration of %qs with no type", name);
else
warning (OPT_Wreturn_type,
"ISO C++ forbids declaration of %qs with no type", name);
@@ -7791,7 +7823,8 @@ grokdeclarator (const cp_declarator *declarator,
ok = 1;
if (!explicit_int && !defaulted_int && !explicit_char && pedantic)
{
- pedwarn ("long, short, signed or unsigned used invalidly for %qs",
+ pedwarn (OPT_pedantic,
+ "long, short, signed or unsigned used invalidly for %qs",
name);
if (flag_pedantic_errors)
ok = 0;
@@ -7896,7 +7929,8 @@ grokdeclarator (const cp_declarator *declarator,
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ pedwarn (OPT_pedantic,
+ "ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}
type_quals = TYPE_UNQUALIFIED;
@@ -9124,10 +9158,12 @@ grokdeclarator (const cp_declarator *declarator,
&& pedantic)
{
if (storage_class == sc_static)
- pedwarn ("%<static%> specified invalid for function %qs "
+ pedwarn (OPT_pedantic,
+ "%<static%> specified invalid for function %qs "
"declared out of global scope", name);
else
- pedwarn ("%<inline%> specifier invalid for function %qs "
+ pedwarn (OPT_pedantic,
+ "%<inline%> specifier invalid for function %qs "
"declared out of global scope", name);
}
@@ -9215,9 +9251,9 @@ grokdeclarator (const cp_declarator *declarator,
}
if (storage_class == sc_extern && pedantic)
{
- pedwarn ("cannot explicitly declare member %q#D to have "
- "extern linkage",
- decl);
+ pedwarn (OPT_pedantic,
+ "cannot explicitly declare member %q#D to have "
+ "extern linkage", decl);
storage_class = sc_none;
}
}
@@ -9666,6 +9702,8 @@ grok_special_member_properties (tree decl)
are no other parameters or else all other parameters have
default arguments. */
TYPE_HAS_INIT_REF (class_type) = 1;
+ if (!DECL_DEFAULTED_FN (decl))
+ TYPE_HAS_COMPLEX_INIT_REF (class_type) = 1;
if (ctor > 1)
TYPE_HAS_CONST_INIT_REF (class_type) = 1;
}
@@ -9687,6 +9725,8 @@ grok_special_member_properties (tree decl)
if (assop)
{
TYPE_HAS_ASSIGN_REF (class_type) = 1;
+ if (!DECL_DEFAULTED_FN (decl))
+ TYPE_HAS_COMPLEX_ASSIGN_REF (class_type) = 1;
if (assop != 1)
TYPE_HAS_CONST_ASSIGN_REF (class_type) = 1;
}
@@ -10104,8 +10144,8 @@ grok_op_properties (tree decl, bool complain)
if (operator_code == POSTINCREMENT_EXPR
|| operator_code == POSTDECREMENT_EXPR)
{
- if (pedantic)
- pedwarn ("%qD cannot have default arguments", decl);
+ pedwarn (OPT_pedantic, "%qD cannot have default arguments",
+ decl);
}
else
{
@@ -10839,7 +10879,7 @@ finish_enum (tree enumtype)
underlying_type = integer_types[itk_unsigned_long_long];
}
- /* Compute the minium and maximum values for the type.
+ /* Compute the minimum and maximum values for the type.
[dcl.enum]
@@ -11961,13 +12001,15 @@ finish_function (int flags)
/* Don't complain if we abort or throw. */
&& !current_function_returns_abnormally
&& !DECL_NAME (DECL_RESULT (fndecl))
- /* Normally, with -Wreturn-type, flow will complain. Unless we're an
- inline function, as we might never be compiled separately. */
- && (DECL_INLINE (fndecl) || processing_template_decl)
+ && !TREE_NO_WARNING (fndecl)
/* Structor return values (if any) are set by the compiler. */
&& !DECL_CONSTRUCTOR_P (fndecl)
&& !DECL_DESTRUCTOR_P (fndecl))
- warning (OPT_Wreturn_type, "no return statement in function returning non-void");
+ {
+ warning (OPT_Wreturn_type,
+ "no return statement in function returning non-void");
+ TREE_NO_WARNING (fndecl) = 1;
+ }
/* Store the end of the function, so that we get good line number
info for the epilogue. */
@@ -12195,7 +12237,7 @@ maybe_register_incomplete_var (tree var)
}
/* Called when a class type (given by TYPE) is defined. If there are
- any existing VAR_DECLs whose type hsa been completed by this
+ any existing VAR_DECLs whose type has been completed by this
declaration, update them now. */
void
@@ -12260,7 +12302,7 @@ cxx_maybe_build_cleanup (tree decl)
initial checks on the attribute. Note that those checks
include ensuring that the function found is not an overloaded
function, or an object with an overloaded call operator,
- etc.; we can rely on the fact that the functionfound is an
+ etc.; we can rely on the fact that the function found is an
ordinary FUNCTION_DECL. */
fn = lookup_name (id);
arg = build_address (decl);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f14f94d16b5..a156e32dcdb 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -821,7 +821,25 @@ grokfield (const cp_declarator *declarator,
{
/* Initializers for functions are rejected early in the parser.
If we get here, it must be a pure specifier for a method. */
- if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
+ if (init == ridpointers[(int)RID_DELETE])
+ {
+ DECL_DELETED_FN (value) = 1;
+ DECL_DECLARED_INLINE_P (value) = 1;
+ DECL_INITIAL (value) = error_mark_node;
+ }
+ else if (init == ridpointers[(int)RID_DEFAULT])
+ {
+ if (!defaultable_fn_p (value))
+ error ("%qD cannot be defaulted", value);
+ else
+ {
+ DECL_DEFAULTED_FN (value) = 1;
+ DECL_INITIALIZED_IN_CLASS_P (value) = 1;
+ DECL_DECLARED_INLINE_P (value) = 1;
+ DECL_INLINE (value) = 1;
+ }
+ }
+ else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
{
gcc_assert (error_operand_p (init) || integer_zerop (init));
DECL_PURE_VIRTUAL_P (value) = 1;
@@ -3404,7 +3422,7 @@ cp_write_global_declarations (void)
{
/* Does it need synthesizing? */
if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl)
- && (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl)))
+ && (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl)))
{
/* Even though we're already at the top-level, we push
there again. That way, when we pop back a few lines
@@ -3665,6 +3683,22 @@ check_default_args (tree x)
}
}
+/* Return true if function DECL can be inlined. This is used to force
+ instantiation of methods that might be interesting for inlining. */
+bool
+possibly_inlined_p (tree decl)
+{
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+ if (DECL_UNINLINABLE (decl))
+ return false;
+ if (!optimize)
+ return DECL_DECLARED_INLINE_P (decl);
+ /* When optimizing, we might inline everything when flatten
+ attribute or heuristics inlining for size or autoinlining
+ is used. */
+ return true;
+}
+
/* Mark DECL (either a _DECL or a BASELINK) as "used" in the program.
If DECL is a specialization or implicitly declared class member,
generate the actual definition. */
@@ -3739,7 +3773,7 @@ mark_used (tree decl)
/* Is it a synthesized method that needs to be synthesized? */
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
- && DECL_ARTIFICIAL (decl)
+ && DECL_DEFAULTED_FN (decl)
&& !DECL_THUNK_P (decl)
&& ! DECL_INITIAL (decl)
/* Kludge: don't synthesize for default args. Unfortunately this
@@ -3752,12 +3786,19 @@ mark_used (tree decl)
/* If we've already synthesized the method we don't need to
do the instantiation test below. */
}
+ else if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_DELETED_FN (decl))
+ {
+ error ("deleted function %q+D", decl);
+ error ("used here");
+ }
else if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL)
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
&& (!DECL_EXPLICIT_INSTANTIATION (decl)
|| (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_INLINE (DECL_TEMPLATE_RESULT
- (template_for_substitution (decl))))
+ && possibly_inlined_p
+ (DECL_TEMPLATE_RESULT (
+ template_for_substitution (decl))))
/* We need to instantiate static data members so that there
initializers are available in integral constant
expressions. */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 80aa6e962d2..ef26ad9114a 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2685,7 +2685,7 @@ maybe_warn_cpp0x (const char* str)
/* We really want to suppress this warning in system headers,
because libstdc++ uses variadic templates even when we aren't
in C++0x mode. */
- pedwarn ("%s only available with -std=c++0x", str);
+ pedwarn (0, "%s only available with -std=c++0x or -std=gnu++0x", str);
}
/* Warn about the use of variadic templates when appropriate. */
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index add7596b97a..3dd6c4e328b 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -346,7 +346,7 @@ build_value_init_1 (tree type, bool have_ctor)
if (CLASS_TYPE_P (type))
{
- if (TYPE_HAS_USER_CONSTRUCTOR (type) && !have_ctor)
+ if (type_has_user_provided_constructor (type) && !have_ctor)
return build_cplus_new
(type,
build_special_member_call (NULL_TREE, complete_ctor_identifier,
@@ -516,8 +516,17 @@ perform_member_init (tree member, tree init)
tf_warning_or_error));
}
else
- finish_expr_stmt (build_aggr_init (decl, init, 0,
- tf_warning_or_error));
+ {
+ if (CP_TYPE_CONST_P (type)
+ && init == NULL_TREE
+ && !type_has_user_provided_default_constructor (type))
+ /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
+ vtable; still give this diagnostic. */
+ permerror ("%Juninitialized member %qD with %<const%> type %qT",
+ current_function_decl, member, type);
+ finish_expr_stmt (build_aggr_init (decl, init, 0,
+ tf_warning_or_error));
+ }
}
else
{
@@ -1578,7 +1587,7 @@ build_offset_ref (tree type, tree member, bool address_p)
a class derived from that class (_class.base.init_). */
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (member))
{
- /* Build a representation of a the qualified name suitable
+ /* Build a representation of the qualified name suitable
for use as the operand to "&" -- even though the "&" is
not actually present. */
member = build2 (OFFSET_REF, TREE_TYPE (member), decl, member);
@@ -1883,7 +1892,9 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
return error_mark_node;
is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || init);
- if (CP_TYPE_CONST_P (elt_type) && !is_initialized)
+
+ if (CP_TYPE_CONST_P (elt_type) && !init
+ && !type_has_user_provided_default_constructor (elt_type))
{
if (complain & tf_error)
error ("uninitialized const in %<new%> of %q#T", elt_type);
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index ee2f2a80706..2c169d1bd76 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -247,17 +247,6 @@ cxx_init (void)
cxx_init_decl_processing ();
- /* The fact that G++ uses COMDAT for many entities (inline
- functions, template instantiations, virtual tables, etc.) mean
- that it is fundamentally unreliable to try to make decisions
- about whether or not to output a particular entity until the end
- of the compilation. However, the inliner requires that functions
- be provided to the back end if they are to be inlined.
- Therefore, we always use unit-at-a-time mode; in that mode, we
- can provide entities to the back end and it will decide what to
- emit based on what is actually needed. */
- flag_unit_at_a_time = 1;
-
if (c_common_init () == false)
{
input_location = saved_loc;
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 1bc72b86a2d..0703d0a96f7 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1056,7 +1056,10 @@ write_unqualified_name (const tree decl)
else if (DECL_LANG_SPECIFIC (decl) != NULL && DECL_DESTRUCTOR_P (decl))
write_special_name_destructor (decl);
else if (DECL_NAME (decl) == NULL_TREE)
- write_source_name (DECL_ASSEMBLER_NAME (decl));
+ {
+ gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
+ write_source_name (DECL_ASSEMBLER_NAME (decl));
+ }
else if (DECL_CONV_FN_P (decl))
{
/* Conversion operator. Handle it right here.
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index bd63d0cba52..f3d23eba23d 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1108,6 +1108,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
DECL_IN_AGGR_P (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
+ DECL_DEFAULTED_FN (fn) = 1;
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_INLINE (fn) = 1;
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index edf74f9c81f..9b456d54c57 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -131,7 +131,7 @@ struct binding_table_s GTY(())
binding_entry * GTY((length ("%h.chain_count"))) chain;
/* The number of chains in this table. This is the length of the
- the member "chain" considered as an array. */
+ member "chain" considered as an array. */
size_t chain_count;
/* Number of "binding_entry"s in this table. */
@@ -724,10 +724,10 @@ pushdecl_maybe_friend (tree x, bool is_friend)
/* Don't do anything just yet. */;
else if (t == wchar_decl_node)
{
- if (pedantic && ! DECL_IN_SYSTEM_HEADER (x))
- pedwarn ("redeclaration of %<wchar_t%> as %qT",
+ if (! DECL_IN_SYSTEM_HEADER (x))
+ pedwarn (OPT_pedantic, "redeclaration of %<wchar_t%> as %qT",
TREE_TYPE (x));
-
+
/* Throw away the redeclaration. */
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
@@ -782,7 +782,7 @@ pushdecl_maybe_friend (tree x, bool is_friend)
tree previous = function_binding->value;
/* In case either x or previous is declared to throw an exception,
- make sure both exception speficications are equal. */
+ make sure both exception specifications are equal. */
if (decls_match (x, previous))
{
tree x_exception_spec = NULL_TREE;
@@ -796,10 +796,11 @@ pushdecl_maybe_friend (tree x, bool is_friend)
x_exception_spec,
true))
{
- pedwarn ("declaration of %q#D with C language linkage", x);
- pedwarn ("conflicts with previous declaration %q+#D",
- previous);
- pedwarn ("due to different exception specifications");
+ pedwarn (0, "declaration of %q#D with C language linkage",
+ x);
+ pedwarn (0, "conflicts with previous declaration %q+#D",
+ previous);
+ pedwarn (0, "due to different exception specifications");
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
}
diff --git a/gcc/cp/operators.def b/gcc/cp/operators.def
index 6c24ba19251..9c2dd8b2ca1 100644
--- a/gcc/cp/operators.def
+++ b/gcc/cp/operators.def
@@ -5,7 +5,7 @@
non-overloadable operators (like the `?:' ternary operator).
Written by Mark Mitchell <mark@codesourcery.com>
- Copyright (C) 2000, 2001, 2002, 2003, 2005, 2007
+ Copyright (C) 2000, 2001, 2002, 2003, 2005, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -56,7 +56,7 @@ along with GCC; see the file COPYING3. If not see
A boolean value. If nonzero, this is an assignment operator.
- Before including this file, you should define DEFOPERATOR
+ Before including this file, you should define DEF_OPERATOR
to take these arguments.
There is code (such as in grok_op_properties) that depends on the
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 02fb6607130..15b66b03b95 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -71,8 +71,6 @@ typedef struct cp_token GTY (())
unsigned char flags;
/* Identifier for the pragma. */
ENUM_BITFIELD (pragma_kind) pragma_kind : 6;
- /* True if this token is from a system header. */
- BOOL_BITFIELD in_system_header : 1;
/* True if this token is from a context where it is implicitly extern "C" */
BOOL_BITFIELD implicit_extern_c : 1;
/* True for a CPP_NAME token that is not a keyword (i.e., for which
@@ -97,7 +95,7 @@ DEF_VEC_ALLOC_P (cp_token_position,heap);
static cp_token eof_token =
{
- CPP_EOF, RID_MAX, 0, PRAGMA_NONE, 0, false, 0, { NULL },
+ CPP_EOF, RID_MAX, 0, PRAGMA_NONE, false, 0, { NULL },
0
};
@@ -408,7 +406,6 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
lexer == NULL ? 0 : C_LEX_RAW_STRINGS);
token->keyword = RID_MAX;
token->pragma_kind = PRAGMA_NONE;
- token->in_system_header = in_system_header;
/* On some systems, some header files are surrounded by an
implicit extern "C" block. Set a flag in the token if it
@@ -478,15 +475,13 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
}
}
-/* Update the globals input_location and in_system_header and the
- input file stack from TOKEN. */
+/* Update the globals input_location and the input file stack from TOKEN. */
static inline void
cp_lexer_set_source_position_from_token (cp_token *token)
{
if (token->type != CPP_EOF)
{
input_location = token->location;
- in_system_header = token->in_system_header;
}
}
@@ -1377,7 +1372,7 @@ cp_parser_context_new (cp_parser_context* next)
/* No errors have occurred yet in this context. */
context->status = CP_PARSER_STATUS_KIND_NO_ERROR;
- /* If this is not the bottomost context, copy information that we
+ /* If this is not the bottommost context, copy information that we
need from the previous context. */
if (next)
{
@@ -2167,7 +2162,8 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs,
error ("%H%<long long long%> is too long for GCC", &location);
else if (pedantic && !in_system_header && warn_long_long
&& cxx_dialect == cxx98)
- pedwarn ("%HISO C++ 1998 does not support %<long long%>",
+ pedwarn (OPT_Wlong_long,
+ "%HISO C++ 1998 does not support %<long long%>",
&location);
}
else if (count > 1)
@@ -3219,9 +3215,9 @@ cp_parser_primary_expression (cp_parser *parser,
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
/* Statement-expressions are not allowed by the standard. */
- if (pedantic)
- pedwarn ("%HISO C++ forbids braced-groups within expressions",
- &token->location);
+ pedwarn (OPT_pedantic,
+ "%HISO C++ forbids braced-groups within expressions",
+ &token->location);
/* And they're not allowed outside of a function-body; you
cannot, for example, write:
@@ -4550,8 +4546,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
{
/* Warn the user that a compound literal is not
allowed in standard C++. */
- if (pedantic)
- pedwarn ("ISO C++ forbids compound-literals");
+ pedwarn (OPT_pedantic, "ISO C++ forbids compound-literals");
/* For simplicity, we disallow compound literals in
constant-expressions. We could
allow compound literals of integer type, whose
@@ -6324,7 +6319,7 @@ cp_parser_assignment_operator_opt (cp_parser* parser)
enum tree_code op;
cp_token *token;
- /* Peek at the next toen. */
+ /* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer);
switch (token->type)
@@ -7615,8 +7610,7 @@ cp_parser_jump_statement (cp_parser* parser)
if (cp_lexer_next_token_is (parser->lexer, CPP_MULT))
{
/* Issue a warning about this use of a GNU extension. */
- if (pedantic)
- pedwarn ("%HISO C++ forbids computed gotos", &token->location);
+ pedwarn (OPT_pedantic, "%HISO C++ forbids computed gotos", &token->location);
/* Consume the '*' token. */
cp_lexer_consume_token (parser->lexer);
/* Parse the dependent expression. */
@@ -7755,8 +7749,8 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
/* A declaration consisting of a single semicolon is
invalid. Allow it unless we're being pedantic. */
cp_lexer_consume_token (parser->lexer);
- if (pedantic && !in_system_header)
- pedwarn ("extra %<;%>");
+ if (!in_system_header)
+ pedwarn (OPT_pedantic, "extra %<;%>");
continue;
}
@@ -10473,7 +10467,7 @@ cp_parser_template_argument (cp_parser* parser)
{
cp_parser_parse_tentatively (parser);
argument = cp_parser_primary_expression (parser,
- /*adress_p=*/false,
+ /*address_p=*/false,
/*cast_p=*/false,
/*template_arg_p=*/true,
&idk);
@@ -11739,8 +11733,8 @@ cp_parser_enumerator_list (cp_parser* parser, tree type)
/* If the next token is a `}', there is a trailing comma. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
- if (pedantic && !in_system_header)
- pedwarn ("comma at end of enumerator list");
+ if (!in_system_header)
+ pedwarn (OPT_pedantic, "comma at end of enumerator list");
break;
}
}
@@ -12384,7 +12378,7 @@ cp_parser_init_declarator (cp_parser* parser,
tree initializer;
tree decl = NULL_TREE;
tree scope;
- bool is_initialized;
+ int is_initialized;
/* Only valid if IS_INITIALIZED is true. In that case, CPP_EQ if
initialized with "= ..", CPP_OPEN_PAREN if initialized with
"(...)". */
@@ -12520,8 +12514,18 @@ cp_parser_init_declarator (cp_parser* parser,
|| token->type == CPP_OPEN_PAREN
|| token->type == CPP_OPEN_BRACE)
{
- is_initialized = true;
+ is_initialized = 1;
initialization_kind = token->type;
+
+ if (token->type == CPP_EQ
+ && function_declarator_p (declarator))
+ {
+ cp_token *t2 = cp_lexer_peek_nth_token (parser->lexer, 2);
+ if (t2->keyword == RID_DEFAULT)
+ is_initialized = 2;
+ else if (t2->keyword == RID_DELETE)
+ is_initialized = 3;
+ }
}
else
{
@@ -12533,7 +12537,7 @@ cp_parser_init_declarator (cp_parser* parser,
cp_parser_error (parser, "expected initializer");
return error_mark_node;
}
- is_initialized = false;
+ is_initialized = 0;
initialization_kind = CPP_EOF;
}
@@ -12591,7 +12595,7 @@ cp_parser_init_declarator (cp_parser* parser,
cp_parser_perform_template_parameter_access_checks (checks);
/* Perform the access control checks for the declarator and the
- the decl-specifiers. */
+ decl-specifiers. */
perform_deferred_access_checks ();
/* Restore the saved value. */
@@ -12868,7 +12872,7 @@ cp_parser_direct_declarator (cp_parser* parser,
int i (3);
The first is the declaration of a function while the
- second is a the definition of a variable, including its
+ second is the definition of a variable, including its
initializer.
Having seen only the parenthesis, we cannot know which of
@@ -14374,8 +14378,8 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
&& cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_COLON)
{
/* Warn the user that they are using an extension. */
- if (pedantic)
- pedwarn ("ISO C++ does not allow designated initializers");
+ pedwarn (OPT_pedantic,
+ "ISO C++ does not allow designated initializers");
/* Consume the identifier. */
identifier = cp_lexer_consume_token (parser->lexer)->u.value;
/* Consume the `:'. */
@@ -15011,9 +15015,9 @@ cp_parser_class_head (cp_parser* parser,
}
/* [dcl.meaning]
- A declarator-id shall not be qualified exception of the
+ A declarator-id shall not be qualified except for the
definition of a ... nested class outside of its class
- ... [or] a the definition or explicit instantiation of a
+ ... [or] the definition or explicit instantiation of a
class member of a namespace outside of its namespace. */
if (scope == nested_name_specifier)
{
@@ -15391,8 +15395,8 @@ cp_parser_member_declaration (cp_parser* parser)
if (!decl_specifiers.any_specifiers_p)
{
cp_token *token = cp_lexer_peek_token (parser->lexer);
- if (pedantic && !token->in_system_header)
- pedwarn ("%Hextra %<;%>", &token->location);
+ if (!in_system_header_at (token->location))
+ pedwarn (OPT_pedantic, "%Hextra %<;%>", &token->location);
}
else
{
@@ -15687,6 +15691,15 @@ cp_parser_pure_specifier (cp_parser* parser)
return error_mark_node;
/* Look for the `0' token. */
token = cp_lexer_consume_token (parser->lexer);
+
+ /* Accept = default or = delete in c++0x mode. */
+ if (token->keyword == RID_DEFAULT
+ || token->keyword == RID_DELETE)
+ {
+ maybe_warn_cpp0x ("defaulted and deleted functions");
+ return token->u.value;
+ }
+
/* c_lex_with_flags marks a single digit '0' with PURE_ZERO. */
if (token->type != CPP_NUMBER || !(token->flags & PURE_ZERO))
{
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8b2d8c3507d..b47ee5e6b3f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4241,7 +4241,7 @@ fold_non_dependent_expr (tree expr)
/* EXPR is an expression which is used in a constant-expression context.
For instance, it could be a VAR_DECL with a constant initializer.
- Extract the innest constant expression.
+ Extract the innermost constant expression.
This is basically a more powerful version of
integral_constant_value, which can be used also in templates where
@@ -5888,8 +5888,6 @@ lookup_template_class (tree d1,
= TREE_PRIVATE (TYPE_STUB_DECL (template_type));
TREE_PROTECTED (type_decl)
= TREE_PROTECTED (TYPE_STUB_DECL (template_type));
- DECL_IN_SYSTEM_HEADER (type_decl)
- = DECL_IN_SYSTEM_HEADER (templ);
if (CLASSTYPE_VISIBILITY_SPECIFIED (template_type))
{
DECL_VISIBILITY_SPECIFIED (type_decl) = 1;
@@ -6338,7 +6336,6 @@ pop_tinst_level (void)
/* Restore the filename and line number stashed away when we started
this instantiation. */
input_location = current_tinst_level->locus;
- in_system_header = current_tinst_level->in_system_header_p;
current_tinst_level = current_tinst_level->next;
--tinst_depth;
++tinst_level_tick;
@@ -6404,7 +6401,7 @@ tsubst_friend_function (tree decl, tree args)
/* Friend functions are looked up in the containing namespace scope.
We must enter that scope, to avoid finding member functions of the
- current cless with same name. */
+ current class with same name. */
push_nested_namespace (ns);
fns = tsubst_expr (DECL_TI_TEMPLATE (decl), args,
tf_warning_or_error, NULL_TREE,
@@ -6910,7 +6907,6 @@ instantiate_class_template (tree type)
if tsubsting causes an error. */
typedecl = TYPE_MAIN_DECL (type);
input_location = DECL_SOURCE_LOCATION (typedecl);
- in_system_header = DECL_IN_SYSTEM_HEADER (typedecl);
TYPE_HAS_USER_CONSTRUCTOR (type) = TYPE_HAS_USER_CONSTRUCTOR (pattern);
TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern);
@@ -7108,7 +7104,7 @@ instantiate_class_template (tree type)
{
tree r;
- /* The the file and line for this declaration, to
+ /* The file and line for this declaration, to
assist in error message reporting. Since we
called push_tinst_level above, we don't need to
restore these. */
@@ -7267,7 +7263,7 @@ instantiate_class_template (tree type)
/* Build new DECL_FRIENDLIST. */
tree r;
- /* The the file and line for this declaration, to
+ /* The file and line for this declaration, to
assist in error message reporting. Since we
called push_tinst_level above, we don't need to
restore these. */
@@ -11177,7 +11173,7 @@ tsubst_copy_and_build (tree t,
tree init = RECUR (TREE_OPERAND (t, 3));
if (TREE_OPERAND (t, 3) && !init)
- /* If there was an initializer in the the original tree, but
+ /* If there was an initializer in the original tree, but
it instantiated to an empty list, then we should pass on
VOID_ZERO_NODE to tell build_new that it was an empty
initializer () rather than no initializer. This can only
@@ -13567,7 +13563,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
/* CV qualifications for methods can never be deduced, they must
match exactly. We need to check them explicitly here,
because type_unification_real treats them as any other
- cvqualified parameter. */
+ cv-qualified parameter. */
if (TREE_CODE (parm) == METHOD_TYPE
&& (!check_cv_quals_for_unify
(UNIFY_ALLOW_NONE,
@@ -14614,8 +14610,9 @@ do_decl_instantiation (tree decl, tree storage)
;
else if (storage == ridpointers[(int) RID_EXTERN])
{
- if (pedantic && !in_system_header && (cxx_dialect == cxx98))
- pedwarn ("ISO C++ 1998 forbids the use of %<extern%> on explicit "
+ if (!in_system_header && (cxx_dialect == cxx98))
+ pedwarn (OPT_pedantic,
+ "ISO C++ 1998 forbids the use of %<extern%> on explicit "
"instantiations");
extern_p = 1;
}
@@ -14701,16 +14698,17 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (storage != NULL_TREE)
{
- if (pedantic && !in_system_header)
+ if (!in_system_header)
{
if (storage == ridpointers[(int) RID_EXTERN])
{
if (cxx_dialect == cxx98)
- pedwarn("ISO C++ 1998 forbids the use of %<extern%> on "
+ pedwarn(OPT_pedantic,
+ "ISO C++ 1998 forbids the use of %<extern%> on "
"explicit instantiations");
}
else
- pedwarn("ISO C++ forbids the use of %qE on explicit "
+ pedwarn(OPT_pedantic, "ISO C++ forbids the use of %qE on explicit "
"instantiations", storage);
}
@@ -15016,7 +15014,6 @@ instantiate_decl (tree d, int defer_ok,
bool pattern_defined;
int need_push;
location_t saved_loc = input_location;
- int saved_in_system_header = in_system_header;
bool external_p;
/* This function should only be used to instantiate templates for
@@ -15099,7 +15096,6 @@ instantiate_decl (tree d, int defer_ok,
mark_definable (d);
input_location = DECL_SOURCE_LOCATION (d);
- in_system_header = DECL_IN_SYSTEM_HEADER (d);
/* If D is a member of an explicitly instantiated class template,
and no definition is available, treat it like an implicit
@@ -15148,7 +15144,8 @@ instantiate_decl (tree d, int defer_ok,
if (external_p
/* ... but we instantiate inline functions so that we can inline
them and ... */
- && ! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d))
+ && ! (TREE_CODE (d) == FUNCTION_DECL
+ && possibly_inlined_p (d))
/* ... we instantiate static data members whose values are
needed in integral constant expressions. */
&& ! (TREE_CODE (d) == VAR_DECL
@@ -15225,9 +15222,7 @@ instantiate_decl (tree d, int defer_ok,
/* Instantiate inline functions so that the inliner can do its
job, even though we'll not be emitting a copy of this
function. */
- if (!(TREE_CODE (d) == FUNCTION_DECL
- && flag_inline_trees
- && DECL_DECLARED_INLINE_P (d)))
+ if (!(TREE_CODE (d) == FUNCTION_DECL && possibly_inlined_p (d)))
goto out;
}
@@ -15371,7 +15366,6 @@ instantiate_decl (tree d, int defer_ok,
out:
input_location = saved_loc;
- in_system_header = saved_in_system_header;
pop_deferring_access_checks ();
pop_tinst_level ();
@@ -15389,7 +15383,6 @@ instantiate_pending_templates (int retries)
{
int reconsider;
location_t saved_loc = input_location;
- int saved_in_system_header = in_system_header;
/* Instantiating templates may trigger vtable generation. This in turn
may require further template instantiations. We place a limit here
@@ -15473,7 +15466,6 @@ instantiate_pending_templates (int retries)
while (reconsider);
input_location = saved_loc;
- in_system_header = saved_in_system_header;
}
/* Substitute ARGVEC into T, which is a list of initializers for
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index cee29240e9e..7fc040bc8c4 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1912,6 +1912,20 @@ check_final_overrider (tree overrider, tree basefn)
return 0;
}
+ if (DECL_DELETED_FN (basefn) != DECL_DELETED_FN (overrider))
+ {
+ if (DECL_DELETED_FN (overrider))
+ {
+ error ("deleted function %q+D", overrider);
+ error ("overriding non-deleted function %q+D", basefn);
+ }
+ else
+ {
+ error ("non-deleted function %q+D", overrider);
+ error ("overriding deleted function %q+D", basefn);
+ }
+ return 0;
+ }
return 1;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index d2f56ea810a..ffa6493ced4 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4677,8 +4677,20 @@ classtype_has_nothrow_assign_or_copy_p (tree type, bool assign_p)
return false;
for (; fns; fns = OVL_NEXT (fns))
- if (!TREE_NOTHROW (OVL_CURRENT (fns)))
- return false;
+ {
+ tree fn = OVL_CURRENT (fns);
+
+ if (assign_p)
+ {
+ if (copy_fn_p (fn) == 0)
+ continue;
+ }
+ else if (copy_fn_p (fn) <= 0)
+ continue;
+
+ if (!TYPE_NOTHROW_P (TREE_TYPE (fn)))
+ return false;
+ }
return true;
}
@@ -4712,7 +4724,8 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
type1 = strip_array_types (type1);
return (trait_expr_value (CPTK_HAS_TRIVIAL_CONSTRUCTOR, type1, type2)
|| (CLASS_TYPE_P (type1)
- && (t = locate_ctor (type1, NULL)) && TREE_NOTHROW (t)));
+ && (t = locate_ctor (type1, NULL))
+ && TYPE_NOTHROW_P (TREE_TYPE (t))));
case CPTK_HAS_TRIVIAL_CONSTRUCTOR:
type1 = strip_array_types (type1);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b288c5bbfca..0522ae2786f 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -683,7 +683,7 @@ c_build_qualified_type (tree type, int type_quals)
arrays correctly. In particular, if TYPE is an array of T's, and
TYPE_QUALS is non-empty, returns an array of qualified T's.
- FLAGS determines how to deal with illformed qualifications. If
+ FLAGS determines how to deal with ill-formed qualifications. If
tf_ignore_bad_quals is set, then bad qualifications are dropped
(this is permitted if TYPE was introduced via a typedef or template
type parameter). If bad qualifications are dropped and tf_warning
@@ -795,8 +795,8 @@ cp_build_qualified_type_real (tree type,
return make_pack_expansion (t);
}
- /* A reference or method type shall not be cv qualified.
- [dcl.ref], [dct.fct] */
+ /* A reference or method type shall not be cv-qualified.
+ [dcl.ref], [dcl.fct] */
if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)
&& (TREE_CODE (type) == REFERENCE_TYPE
|| TREE_CODE (type) == METHOD_TYPE))
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ad297106a6e..fcf52dc9db4 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -511,9 +511,10 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
tree attributes;
tree result_type;
- if (pedantic && TYPE_PTRFN_P (t2) && (complain & tf_error))
- pedwarn ("ISO C++ forbids %s between pointer of type %<void *%> "
- "and pointer-to-function", location);
+ if (TYPE_PTRFN_P (t2) && (complain & tf_error))
+ pedwarn (OPT_pedantic, "ISO C++ forbids %s "
+ "between pointer of type %<void *%> and pointer-to-function",
+ location);
result_type
= cp_build_qualified_type (void_type_node,
(cp_type_quals (TREE_TYPE (t1))
@@ -1278,8 +1279,9 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
type = non_reference (type);
if (TREE_CODE (type) == METHOD_TYPE)
{
- if (complain && (pedantic || warn_pointer_arith))
- pedwarn ("invalid application of %qs to a member function",
+ if (complain)
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "invalid application of %qs to a member function",
operator_name_info[(int) op].name);
value = size_one_node;
}
@@ -1645,7 +1647,7 @@ decay_conversion (tree exp)
return exp;
}
-/* Perform prepatory conversions, as part of the "usual arithmetic
+/* Perform preparatory conversions, as part of the "usual arithmetic
conversions". In particular, as per [expr]:
Whenever an lvalue expression appears as an operand of an
@@ -1696,18 +1698,6 @@ perform_integral_promotions (tree expr)
return expr;
}
-/* Take the address of an inline function without setting TREE_ADDRESSABLE
- or TREE_USED. */
-
-tree
-inline_conversion (tree exp)
-{
- if (TREE_CODE (exp) == FUNCTION_DECL)
- exp = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (exp)), exp);
-
- return exp;
-}
-
/* Returns nonzero iff exp is a STRING_CST or the result of applying
decay_conversion to one. */
@@ -2596,8 +2586,8 @@ build_array_ref (tree array, tree idx)
return error_mark_node;
}
- if (pedantic && !lvalue_p (array))
- pedwarn ("ISO C++ forbids subscripting non-lvalue array");
+ if (!lvalue_p (array))
+ pedwarn (OPT_pedantic, "ISO C++ forbids subscripting non-lvalue array");
/* Note in C++ it is valid to subscript a `register' array, since
it is valid to take the address of something with that
@@ -2822,17 +2812,11 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
fndecl = function;
/* Convert anything with function type to a pointer-to-function. */
- if (pedantic && DECL_MAIN_P (function) && (complain & tf_error))
- pedwarn ("ISO C++ forbids calling %<::main%> from within program");
-
- /* Differs from default_conversion by not setting TREE_ADDRESSABLE
- (because calling an inline function does not mean the function
- needs to be separately compiled). */
+ if (DECL_MAIN_P (function) && (complain & tf_error))
+ pedwarn (OPT_pedantic,
+ "ISO C++ forbids calling %<::main%> from within program");
- if (DECL_INLINE (function))
- function = inline_conversion (function);
- else
- function = build_addr_func (function);
+ function = build_addr_func (function);
}
else
{
@@ -3299,7 +3283,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
TREE_TYPE (type1)))
return pointer_diff (op0, op1, common_type (type0, type1));
/* In all other cases except pointer - int, the usual arithmetic
- rules aply. */
+ rules apply. */
else if (!(code0 == POINTER_TYPE && code1 == INTEGER_TYPE))
{
common = 1;
@@ -3821,7 +3805,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
For them, this optimization is safe only if
both args are zero-extended or both are sign-extended.
Otherwise, we might change the result.
- Eg, (short)-1 | (unsigned short)-1 is (int)-1
+ E.g., (short)-1 | (unsigned short)-1 is (int)-1
but calculated in (unsigned short) it would be (unsigned short)-1. */
if (shorten && none_complex)
@@ -4101,15 +4085,12 @@ pointer_diff (tree op0, tree op1, tree ptrtype)
if (!complete_type_or_else (target_type, NULL_TREE))
return error_mark_node;
- if (pedantic || warn_pointer_arith)
- {
- if (TREE_CODE (target_type) == VOID_TYPE)
- permerror ("ISO C++ forbids using pointer of type %<void *%> in subtraction");
- if (TREE_CODE (target_type) == FUNCTION_TYPE)
- permerror ("ISO C++ forbids using pointer to a function in subtraction");
- if (TREE_CODE (target_type) == METHOD_TYPE)
- permerror ("ISO C++ forbids using pointer to a method in subtraction");
- }
+ if (TREE_CODE (target_type) == VOID_TYPE)
+ permerror ("ISO C++ forbids using pointer of type %<void *%> in subtraction");
+ if (TREE_CODE (target_type) == FUNCTION_TYPE)
+ permerror ("ISO C++ forbids using pointer to a function in subtraction");
+ if (TREE_CODE (target_type) == METHOD_TYPE)
+ permerror ("ISO C++ forbids using pointer to a method in subtraction");
/* First do the subtraction as integers;
then drop through to build the divide operator. */
@@ -4559,7 +4540,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
arg = build1 (CONVERT_EXPR, type, arg);
return arg;
}
- else if (pedantic && DECL_MAIN_P (arg))
+ else if (DECL_MAIN_P (arg))
{
/* ARM $3.4 */
if (complain & tf_error)
@@ -4655,7 +4636,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
/* Even if we're not being pedantic, we cannot allow this
extension when we're instantiating in a SFINAE
context. */
- if (! lvalue_p (arg) && (pedantic || complain == tf_none))
+ if (! lvalue_p (arg) && complain == tf_none)
{
if (complain & tf_error)
permerror ("ISO C++ forbids taking the address of a cast to a non-lvalue expression");
@@ -5443,7 +5424,8 @@ convert_member_func_to_ptr (tree type, tree expr)
|| TREE_CODE (intype) == METHOD_TYPE);
if (pedantic || warn_pmf2ptr)
- pedwarn ("converting from %qT to %qT", intype, type);
+ pedwarn (pedantic ? OPT_pedantic : OPT_Wpmf_conversions,
+ "converting from %qT to %qT", intype, type);
if (TREE_CODE (intype) == METHOD_TYPE)
expr = build_addr_func (expr);
@@ -6980,7 +6962,6 @@ check_return_expr (tree retval, bool *no_warning)
else
permerror ("return-statement with a value, in function "
"returning 'void'");
-
current_function_returns_null = 1;
/* There's really no value to return, after all. */
@@ -7347,7 +7328,8 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl)
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ pedwarn (OPT_pedantic,
+ "ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index a30ff547f18..ee686fecf33 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -345,7 +345,7 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type
if (diag_type == 1)
p_msg = warning0;
else if (diag_type == 2)
- p_msg = pedwarn;
+ p_msg = pedwarn0;
else
p_msg = error;
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 5a6aaee914d..49b3f9a058f 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -299,13 +299,14 @@ void
diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic_info *diagnostic)
{
+ location_t location = diagnostic->location;
bool maybe_print_warnings_as_errors_message = false;
const char *saved_format_spec;
/* Give preference to being able to inhibit warnings, before they
get reclassified to something else. */
if (diagnostic->kind == DK_WARNING
- && !diagnostic_report_warnings_p ())
+ && !diagnostic_report_warnings_p (location))
return;
if (context->lock > 0)
@@ -470,8 +471,8 @@ inform (const char *gmsgid, ...)
va_end (ap);
}
-/* A warning. Use this for code which is correct according to the
- relevant language specification but is likely to be buggy anyway. */
+/* A warning at INPUT_LOCATION. Use this for code which is correct according
+ to the relevant language specification but is likely to be buggy anyway. */
void
warning (int opt, const char *gmsgid, ...)
{
@@ -498,6 +499,22 @@ warning0 (const char *gmsgid, ...)
va_end (ap);
}
+/* A warning at LOCATION. Use this for code which is correct according to the
+ relevant language specification but is likely to be buggy anyway. */
+void
+warning_at (location_t location, int opt, const char *gmsgid, ...)
+{
+ diagnostic_info diagnostic;
+ va_list ap;
+
+ va_start (ap, gmsgid);
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_WARNING);
+ diagnostic.option_index = opt;
+
+ report_diagnostic (&diagnostic);
+ va_end (ap);
+}
+
/* A "pedantic" warning: issues a warning unless -pedantic-errors was
given on the command line, in which case it issues an error. Use
this for diagnostics required by the relevant language standard,
@@ -505,16 +522,34 @@ warning0 (const char *gmsgid, ...)
Note that these diagnostics are issued independent of the setting
of the -pedantic command-line switch. To get a warning enabled
- only with that switch, write "if (pedantic) pedwarn (...);" */
+ only with that switch, use either "if (pedantic) pedwarn
+ (OPT_pedantic,...)" or just "pedwarn (OPT_pedantic,..)". To get a
+ pedwarn independently of the -pedantic switch use "pedwarn (0,...)". */
+
+void
+pedwarn (int opt, const char *gmsgid, ...)
+{
+ diagnostic_info diagnostic;
+ va_list ap;
+
+ va_start (ap, gmsgid);
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
+ pedantic_warning_kind ());
+ diagnostic.option_index = opt;
+
+ report_diagnostic (&diagnostic);
+ va_end (ap);
+}
+
void
-pedwarn (const char *gmsgid, ...)
+pedwarn0 (const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
- pedantic_warning_kind ());
+ pedantic_warning_kind ());
report_diagnostic (&diagnostic);
va_end (ap);
}
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index a249574d4aa..1d13eeeae42 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -183,9 +183,9 @@ extern diagnostic_context *global_dc;
#define sorrycount diagnostic_kind_count (global_dc, DK_SORRY)
/* Returns nonzero if warnings should be emitted. */
-#define diagnostic_report_warnings_p() \
+#define diagnostic_report_warnings_p(LOC) \
(!inhibit_warnings \
- && !(in_system_header && !warn_system_headers))
+ && !(in_system_header_at (LOC) && !warn_system_headers))
#define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D)
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi
index 1f019763d09..6eef7d12ef3 100644
--- a/gcc/doc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -1330,6 +1330,8 @@ a containing function, and the back end must take appropriate action.
@findex DECL_GLOBAL_CTOR_P
@findex DECL_GLOBAL_DTOR_P
@findex GLOBAL_INIT_PRIORITY
+@findex DECL_FUNCTION_SPECIFIC_TARGET
+@findex DECL_FUNCTION_SPECIFIC_OPTIMIZATION
The following macros and functions can be used on a @code{FUNCTION_DECL}:
@ftable @code
@@ -1514,6 +1516,17 @@ is of the form `@code{()}'.
This predicate holds if the function an overloaded
@code{operator delete[]}.
+@item DECL_FUNCTION_SPECIFIC_TARGET
+This macro returns a tree node that holds the target options that are
+to be used to compile this particular function or @code{NULL_TREE} if
+the function is to be compiled with the target options specified on
+the command line.
+
+@item DECL_FUNCTION_SPECIFIC_OPTIMIZATION
+This macro returns a tree node that holds the optimization options
+that are to be used to compile this particular function or
+@code{NULL_TREE} if the function is to be compiled with the
+optimization options specified on the command line.
@end ftable
@c ---------------------------------------------------------------------
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 22ea0f69170..85c418afab5 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1792,6 +1792,8 @@ the enclosing block.
@cindex functions that are passed arguments in registers on the 386
@cindex functions that pop the argument stack on the 386
@cindex functions that do not pop the argument stack on the 386
+@cindex functions that have different compilation options on the 386
+@cindex functions that have different optimization options
In GNU C, you declare certain things about functions called in your program
which help the compiler optimize function calls and check your code more
@@ -1945,8 +1947,7 @@ body.
Generally, inlining into a function is limited. For a function marked with
this attribute, every call inside this function will be inlined, if possible.
Whether the function itself is considered for inlining depends on its size and
-the current inlining parameters. The @code{flatten} attribute only works
-reliably in unit-at-a-time mode.
+the current inlining parameters.
@item error ("@var{message}")
@cindex @code{error} function attribute
@@ -2663,6 +2664,207 @@ with the notable exceptions of @code{qsort} and @code{bsearch} that
take function pointer arguments. The @code{nothrow} attribute is not
implemented in GCC versions earlier than 3.3.
+@item option
+@cindex @code{option} function attribute
+The @code{option} attribute is used to specify that a function is to
+be compiled with different target options than specified on the
+command line. This can be used for instance to have functions
+compiled with a different ISA (instruction set architecture) than the
+default. You can also use the @samp{#pragma GCC option} pragma to set
+more than one function to be compiled with specific target options.
+@xref{Function Specific Option Pragmas}, for details about the
+@samp{#pragma GCC option} pragma.
+
+For instance on a 386, you could compile one function with
+@code{option("sse4.1,arch=core2")} and another with
+@code{option("sse4a,arch=amdfam10")} that would be equivalent to
+compiling the first function with @option{-msse4.1} and
+@option{-march=core2} options, and the second function with
+@option{-msse4a} and @option{-march=amdfam10} options. It is up to the
+user to make sure that a function is only invoked on a machine that
+supports the particular ISA it was compiled for (for example by using
+@code{cpuid} on 386 to determine what feature bits and architecture
+family are used).
+
+@smallexample
+int core2_func (void) __attribute__ ((__option__ ("arch=core2")));
+int sse3_func (void) __attribute__ ((__option__ ("sse3")));
+@end smallexample
+
+On the 386, the following options are allowed:
+
+@table @samp
+@item abm
+@itemx no-abm
+@cindex option("abm")
+Enable/disable the generation of the advanced bit instructions.
+
+@item aes
+@itemx no-aes
+@cindex @code{option("aes")} attribute
+Enable/disable the generation of the AES instructions.
+
+@item mmx
+@itemx no-mmx
+@cindex @code{option("mmx")} attribute
+Enable/disable the generation of the MMX instructions.
+
+@item pclmul
+@itemx no-pclmul
+@cindex @code{option("pclmul")} attribute
+Enable/disable the generation of the PCLMUL instructions.
+
+@item popcnt
+@itemx no-popcnt
+@cindex @code{option("popcnt")} attribute
+Enable/disable the generation of the POPCNT instruction.
+
+@item sse
+@itemx no-sse
+@cindex @code{option("sse")} attribute
+Enable/disable the generation of the SSE instructions.
+
+@item sse2
+@itemx no-sse2
+@cindex @code{option("sse2")} attribute
+Enable/disable the generation of the SSE2 instructions.
+
+@item sse3
+@itemx no-sse3
+@cindex @code{option("sse3")} attribute
+Enable/disable the generation of the SSE3 instructions.
+
+@item sse4
+@itemx no-sse4
+@cindex @code{option("sse4")} attribute
+Enable/disable the generation of the SSE4 instructions (both SSE4.1
+and SSE4.2).
+
+@item sse4.1
+@itemx no-sse4.1
+@cindex @code{option("sse4.1")} attribute
+Enable/disable the generation of the sse4.1 instructions.
+
+@item sse4.2
+@itemx no-sse4.2
+@cindex @code{option("sse4.2")} attribute
+Enable/disable the generation of the sse4.2 instructions.
+
+@item sse4a
+@itemx no-sse4a
+@cindex @code{option("sse4a")} attribute
+Enable/disable the generation of the SSE4A instructions.
+
+@item sse5
+@itemx no-sse5
+@cindex @code{option("sse5")} attribute
+Enable/disable the generation of the SSE5 instructions.
+
+@item ssse3
+@itemx no-ssse3
+@cindex @code{option("ssse3")} attribute
+Enable/disable the generation of the SSSE3 instructions.
+
+@item cld
+@itemx no-cld
+@cindex @code{option("cld")} attribute
+Enable/disable the generation of the CLD before string moves.
+
+@item fancy-math-387
+@itemx no-fancy-math-387
+@cindex @code{option("fancy-math-387")} attribute
+Enable/disable the generation of the @code{sin}, @code{cos}, and
+@code{sqrt} instructions on the 387 floating point unit.
+
+@item fused-madd
+@itemx no-fused-madd
+@cindex @code{option("fused-madd")} attribute
+Enable/disable the generation of the fused multiply/add instructions.
+
+@item ieee-fp
+@itemx no-ieee-fp
+@cindex @code{option("ieee-fp")} attribute
+Enable/disable the generation of floating point that depends on IEEE arithmetic.
+
+@item inline-all-stringops
+@itemx no-inline-all-stringops
+@cindex @code{option("inline-all-stringops")} attribute
+Enable/disable inlining of string operations.
+
+@item inline-stringops-dynamically
+@itemx no-inline-stringops-dynamically
+@cindex @code{option("inline-stringops-dynamically")} attribute
+Enable/disable the generation of the inline code to do small string
+operations and calling the library routines for large operations.
+
+@item align-stringops
+@itemx no-align-stringops
+@cindex @code{option("align-stringops")} attribute
+Do/do not align destination of inlined string operations.
+
+@item recip
+@itemx no-recip
+@cindex @code{option("recip")} attribute
+Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and RSQRTPS
+instructions followed an additional Newton-Rhapson step instead of
+doing a floating point division.
+
+@item arch=@var{ARCH}
+@cindex @code{option("arch=@var{ARCH}")} attribute
+Specify the architecture to generate code for in compiling the function.
+
+@item tune=@var{TUNE}
+@cindex @code{option("tune=@var{TUNE}")} attribute
+Specify the architecture to tune for in compiling the function.
+
+@item fpmath=@var{FPMATH}
+@cindex @code{option("fpmath=@var{FPMATH}")} attribute
+Specify which floating point unit to use. The
+@code{option("fpmath=sse,387")} option must be specified as
+@code{option("fpmath=sse+387")} because the comma would separate
+different options.
+@end table
+
+On the 386, you can use either multiple strings to specify multiple
+options, or you can separate the option with a comma (@code{,}).
+
+On the 386, the inliner will not inline a function that has different
+target options than the caller, unless the callee has a subset of the
+target options of the caller. For example a function declared with
+@code{option("sse5")} can inline a function with
+@code{option("sse2")}, since @code{-msse5} implies @code{-msse2}.
+
+The @code{option} attribute is not implemented in GCC versions earlier
+than 4.4, and at present only the 386 uses it.
+
+@item optimize
+@cindex @code{optimize} function attribute
+The @code{optimize} attribute is used to specify that a function is to
+be compiled with different optimization options than specified on the
+command line. Arguments can either be numbers or strings. Numbers
+are assumed to be an optimization level. Strings that begin with
+@code{O} are assumed to be an optimization option, while other options
+are assumed to be used with a @code{-f} prefix. You can also use the
+@samp{#pragma GCC optimize} pragma to set the optimization options
+that affect more than one function.
+@xref{Function Specific Option Pragmas}, for details about the
+@samp{#pragma GCC option} pragma.
+
+This can be used for instance to have frequently executed functions
+compiled with more aggressive optimization options that produce faster
+and larger code, while other functions can be called with less
+aggressive options. On some targets, the @code{hot} attribute implies
+@code{optimize("O3")}, and @code{cold} attribute implies
+@code{optimize("Os")}.
+
+@smallexample
+int fast_func (void) __attribute__ ((__optimize__ ("O3,unroll-loops")));
+int slow_func (void) __attribute__ ((__optimize__ ("Os")));
+@end smallexample
+
+The inliner will not inline functions with a higher optimization level
+than the caller or different space/time trade offs.
+
@item pure
@cindex @code{pure} function attribute
Many functions have no effects except the return value and their
@@ -2698,7 +2900,12 @@ all hot functions appears close together improving locality.
When profile feedback is available, via @option{-fprofile-use}, hot functions
are automatically detected and this attribute is ignored.
-The @code{hot} attribute is not implemented in GCC versions earlier than 4.3.
+The @code{hot} attribute is not implemented in GCC versions earlier
+than 4.3.
+
+Starting with GCC 4.4, the @code{cold} attribute sets
+@code{optimize("O3")} to turn on more aggressive optimization on the
+the i386, x86_64, and IA-64 targets.
@item cold
@cindex @code{cold} function attribute
@@ -2715,7 +2922,11 @@ occasions.
When profile feedback is available, via @option{-fprofile-use}, hot functions
are automatically detected and this attribute is ignored.
-The @code{hot} attribute is not implemented in GCC versions earlier than 4.3.
+The @code{cold} attribute is not implemented in GCC versions earlier than 4.3.
+
+Starting with GCC 4.4, the @code{cold} attribute sets
+@code{optimize("Os")} to save space on the the i386, x86_64, and IA-64
+targets.
@item regparm (@var{number})
@cindex @code{regparm} attribute
@@ -11105,6 +11316,7 @@ for further explanation.
* Diagnostic Pragmas::
* Visibility Pragmas::
* Push/Pop Macro Pragmas::
+* Function Specific Option Pragmas::
@end menu
@node ARM Pragmas
@@ -11455,6 +11667,80 @@ int x [X];
In this example, the definition of X as 1 is saved by @code{#pragma
push_macro} and restored by @code{#pragma pop_macro}.
+@node Function Specific Option Pragmas
+@subsection Function Specific Option Pragmas
+
+@table @code
+@item #pragma GCC option (@var{"string"}...)
+@cindex pragma GCC option
+
+This pragma allows you to set target specific options for functions
+defined later in the source file. One or more strings can be
+specified. Each function that is defined after this point will be as
+if @code{attribute((option("STRING")))} was specified for that
+function. The parenthesis around the options is optional.
+@xref{Function Attributes}, for more information about the
+@code{option} attribute and the attribute syntax.
+
+The @samp{#pragma GCC option} pragma is not implemented in GCC
+versions earlier than 4.4, and is currently only implemented for the
+386 and x86_64 backend.
+@end table
+
+@table @code
+@item #pragma GCC option (push)
+@itemx #pragma GCC option (pop)
+@cindex pragma GCC option
+
+These pragmas maintain a stack of the current options. It is
+intended for include files where you temporarily want to switch to
+using a different @samp{#pragma GCC option} and then to pop back to
+the previous options.
+@end table
+
+@table @code
+@item #pragma GCC option (reset)
+@cindex pragma, target option
+@cindex pragma GCC option
+
+This pragma clears the current @code{#pragma GCC options} to use the
+default switches as specified on the command line.
+@end table
+@table @code
+@item #pragma GCC optimize (@var{"string"}...)
+@cindex pragma GCC optimize
+
+This pragma allows you to set global optimization options for functions
+defined later in the source file. One or more strings can be
+specified. Each function that is defined after this point will be as
+if @code{attribute((optimize("STRING")))} was specified for that
+function. The parenthesis around the options is optional.
+@xref{Function Attributes}, for more information about the
+@code{optimize} attribute and the attribute syntax.
+
+The @samp{#pragma GCC optimize} pragma is not implemented in GCC
+versions earlier than 4.4.
+@end table
+
+@table @code
+@item #pragma GCC optimize (push)
+@itemx #pragma GCC optimize (pop)
+@cindex pragma GCC optimize
+
+These pragmas maintain a stack of the current optimization options.
+It is intended for include files where you temporarily want to switch
+to using a different @code{#pragma GCC optimize} and then to pop back
+to the previous optimizations.
+@end table
+
+@table @code
+@item #pragma GCC optimize reset
+@cindex pragma GCC optimize
+
+This pragma clears the current @code{#pragma GCC optimize} to use the
+default switches as specified on the command line.
+@end table
+
@node Unnamed Fields
@section Unnamed struct/union fields within structs/unions
@cindex struct
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 8913ec0c923..cf2e48105db 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -386,7 +386,7 @@ Necessary to build GCC during development because the generated output
files are not included in the SVN repository. They are included in
releases.
-@item Texinfo version 4.4 (or later)
+@item Texinfo version 4.7 (or later)
Necessary for running @command{makeinfo} when modifying @file{*.texi}
files to test your changes.
@@ -1765,7 +1765,7 @@ build machinery, not of GCC itself) that is used even if you only
build the C front end.
When building from SVN or snapshots, or if you modify Texinfo
-documentation, you need version 4.4 or later of Texinfo installed if you
+documentation, you need version 4.7 or later of Texinfo installed if you
want Info documentation to be regenerated. Releases contain Info
documentation pre-built for the unmodified documentation in the release.
@@ -2362,7 +2362,7 @@ If you find a bug, please report it following the
@uref{../bugs.html,,bug reporting guidelines}.
If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
-dvi}. You will need to have @command{texi2dvi} (version at least 4.4)
+dvi}. You will need to have @command{texi2dvi} (version at least 4.7)
and @TeX{} installed. This creates a number of @file{.dvi} files in
subdirectories of @file{@var{objdir}}; these may be converted for
printing with programs such as @command{dvips}. Alternately, by using
@@ -3676,7 +3676,7 @@ or newer for a working GCC@.
@end html
@heading @anchor{powerpc-x-netbsd}powerpc-*-netbsd*
PowerPC system in big endian mode running NetBSD@. To build the
-documentation you will need Texinfo version 4.4 (NetBSD 1.5.1 included
+documentation you will need Texinfo version 4.7 (NetBSD 1.5.1 included
Texinfo version 3.12).
@html
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4494511fdee..b66994c8be3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -328,8 +328,8 @@ Objective-C and Objective-C++ Dialects}.
-fearly-inlining -fexpensive-optimizations -ffast-math @gol
-ffinite-math-only -ffloat-store -fforward-propagate @gol
-ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
--fgcse-sm -fif-conversion -fif-conversion2 -finline-functions @gol
--finline-functions-called-once -finline-limit=@var{n} @gol
+-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
+-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-marix-reorg -fipa-pta @gol
-fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
-fipa-type-escape -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
@@ -5131,14 +5131,10 @@ Turning on optimization flags makes the compiler attempt to improve
the performance and/or code size at the expense of compilation time
and possibly the ability to debug the program.
-The compiler performs optimization based on the knowledge it has of
-the program. Optimization levels @option{-O} and above, in
-particular, enable @emph{unit-at-a-time} mode, which allows the
-compiler to consider information gained from later functions in
-the file when compiling a function. Compiling multiple files at
-once to a single output file in @emph{unit-at-a-time} mode allows
-the compiler to use information gained from all of the files when
-compiling each of them.
+The compiler performs optimization based on the knowledge it has of the
+program. Compiling multiple files at once to a single output file mode allows
+the compiler to use information gained from all of the files when compiling
+each of them.
Not all optimizations are controlled directly by a flag. Only
optimizations that have a flag are listed.
@@ -5205,6 +5201,7 @@ also turns on the following optimization flags:
-fdelete-null-pointer-checks @gol
-fexpensive-optimizations @gol
-fgcse -fgcse-lm @gol
+-findirect-inlining @gol
-foptimize-sibling-calls @gol
-fpeephole2 @gol
-fregmove @gol
@@ -5222,8 +5219,8 @@ invoking @option{-O2} on programs that use computed gotos.
@item -O3
@opindex O3
-Optimize yet more. @option{-O3} turns on all optimizations specified by
-@option{-O2} and also turns on the @option{-finline-functions},
+Optimize yet more. @option{-O3} turns on all optimizations specified
+by @option{-O2} and also turns on the @option{-finline-functions},
@option{-funswitch-loops}, @option{-fpredictive-commoning},
@option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
@@ -5325,6 +5322,15 @@ in this way.
Enabled at level @option{-O2}.
+@item -findirect-inlining
+@opindex findirect-inlining
+Inline also indirect calls that are discovered to be known at compile
+time thanks to previous inlining. This option has any effect only
+when inlining itself is turned on by the @option{-finline-functions}
+or @option{-finline-small-functions} options.
+
+Enabled at level @option{-O2}.
+
@item -finline-functions
@opindex finline-functions
Integrate all simple functions into their callers. The compiler
@@ -5344,7 +5350,7 @@ caller even if they are not marked @code{inline}. If a call to a given
function is integrated, then the function is not output as assembler code
in its own right.
-Enabled if @option{-funit-at-a-time} is enabled.
+Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
@item -fearly-inlining
@opindex fearly-inlining
@@ -6318,39 +6324,11 @@ Enabled at levels @option{-O2}, @option{-O3}.
@item -funit-at-a-time
@opindex funit-at-a-time
-Parse the whole compilation unit before starting to produce code.
-This allows some extra optimizations to take place but consumes
-more memory (in general). There are some compatibility issues
-with @emph{unit-at-a-time} mode:
-@itemize @bullet
-@item
-enabling @emph{unit-at-a-time} mode may change the order
-in which functions, variables, and top-level @code{asm} statements
-are emitted, and will likely break code relying on some particular
-ordering. The majority of such top-level @code{asm} statements,
-though, can be replaced by @code{section} attributes. The
-@option{fno-toplevel-reorder} option may be used to keep the ordering
-used in the input file, at the cost of some optimizations.
-
-@item
-@emph{unit-at-a-time} mode removes unreferenced static variables
-and functions. This may result in undefined references
-when an @code{asm} statement refers directly to variables or functions
-that are otherwise unused. In that case either the variable/function
-shall be listed as an operand of the @code{asm} statement operand or,
-in the case of top-level @code{asm} statements the attribute @code{used}
-shall be used on the declaration.
+This option is left for compatibility reasons. @option{-funit-at-a-time}
+has no effect, while @option{-fno-unit-at-a-time} implies
+@option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
-@item
-Static functions now can use non-standard passing conventions that
-may break @code{asm} statements calling functions directly. Again,
-attribute @code{used} will prevent this behavior.
-@end itemize
-
-As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
-but this scheme may not be supported by future releases of GCC@.
-
-Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled by default.
@item -fno-toplevel-reorder
@opindex fno-toplevel-reorder
@@ -6361,6 +6339,10 @@ will not be removed. This option is intended to support existing code
which relies on a particular ordering. For new code, it is better to
use attributes.
+Enabled at level @option{-O0}. When disabled explicitly, it also imply
+@option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
+targets.
+
@item -fweb
@opindex fweb
Constructs webs as commonly used for register allocation purposes and assign
@@ -6946,12 +6928,10 @@ limit after inlining inlining is constrained by
@option{--param large-function-growth}. This parameter is useful primarily
to avoid extreme compilation time caused by non-linear algorithms used by the
backend.
-This parameter is ignored when @option{-funit-at-a-time} is not used.
The default value is 2700.
@item large-function-growth
Specifies maximal growth of large function caused by inlining in percents.
-This parameter is ignored when @option{-funit-at-a-time} is not used.
The default value is 100 which limits large function growth to 2.0 times
the original size.
@@ -6968,7 +6948,6 @@ before applying @option{--param inline-unit-growth}. The default is 10000
@item inline-unit-growth
Specifies maximal overall growth of the compilation unit caused by inlining.
-This parameter is ignored when @option{-funit-at-a-time} is not used.
The default value is 30 which limits unit growth to 1.3 times the original
size.
@@ -10576,6 +10555,8 @@ code that expects temporaries to be 80bit.
This is the default choice for the x86-64 compiler.
@item sse,387
+@itemx sse+387
+@itemx both
Attempt to utilize both instruction sets at once. This effectively double the
amount of available registers and on chips with separate execution units for
387 and SSE the execution resources too. Use this option with care, as it is
@@ -15620,7 +15601,7 @@ for any cases where this rule is relaxed.
@item Each of the following options must be the same when building and using
the precompiled header:
-@gccoptlist{-fexceptions -funit-at-a-time}
+@gccoptlist{-fexceptions}
@item
Some other command-line options starting with @option{-f},
diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi
index e13279b962b..4581ead6da6 100644
--- a/gcc/doc/options.texi
+++ b/gcc/doc/options.texi
@@ -35,8 +35,11 @@ has been declared in this way, it can be used as an option property.
@xref{Option properties}.
@item
-An option definition record. These records have the following fields:
+A target specific save record to save additional information. These
+records have two fields: the string @samp{TargetSave}, and a
+declaration type to go in the @code{cl_target_option} structure.
+@item
@enumerate
@item
the name of the option, with the leading ``-'' removed
@@ -124,7 +127,10 @@ This property cannot be used alongside @code{Joined} or @code{Separate}.
@item UInteger
The option's argument is a non-negative integer. The option parser
will check and convert the argument before passing it to the relevant
-option handler.
+option handler. @code{UInteger} should also be used on options like
+@code{-falign-loops} where both @code{-falign-loops} and
+@code{-falign-loops}=@var{n} are supported to make sure the saved
+options are given a full integer.
@item Var(@var{var})
The state of this option should be stored in variable @var{var}.
@@ -221,4 +227,9 @@ The option should only be accepted if preprocessor condition
option will be present even if @var{cond} is false; @var{cond} simply
controls whether the option is accepted and whether it is printed in
the @option{--help} output.
+
+@item Save
+Build the @code{cl_target_option} structure to hold a copy of the
+option, add the functions @code{cl_target_option_save} and
+@code{cl_target_option_restore} to save and restore the options.
@end table
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 4f42a86ed2b..65177fbf88f 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -833,10 +833,9 @@ specified, 1 if @option{-O} is specified, and 0 if neither is specified.
@var{size} is nonzero if @option{-Os} is specified and zero otherwise.
-You should not use this macro to change options that are not
-machine-specific. These should uniformly selected by the same
-optimization level on all supported machines. Use this macro to enable
-machine-specific optimizations.
+This macro is run once at program startup and when the optimization
+options are changed via @code{#pragma GCC optimize} or by using the
+@code{optimize} attribute.
@strong{Do not examine @code{write_symbols} in
this macro!} The debugging options are not supposed to alter the
@@ -9289,6 +9288,51 @@ attributes, @code{false} otherwise. By default, if a function has a
target specific attribute attached to it, it will not be inlined.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_VALID_OPTION_ATTRIBUTE_P (tree @var{fndecl}, tree @var{name}, tree @var{args}, int @var{flags})
+This hook is called to parse the @code{attribute(option("..."))}, and
+it allows the function to set different target machine compile time
+options for the current function that might be different than the
+options specified on the command line. The hook should return
+@code{true} if the options are valid.
+
+The hook should set the @var{DECL_FUNCTION_SPECIFIC_TARGET} field in
+the function declaration to hold a pointer to a target specific
+@var{struct cl_target_option} structure.
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_OPTION_SAVE (struct cl_target_option *@var{ptr})
+This hook is called to save any additional target specific information
+in the @var{struct cl_target_option} structure for function specific
+options.
+@xref{Option file format}.
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_OPTION_RESTORE (struct cl_target_option *@var{ptr})
+This hook is called to restore any additional target specific
+information in the @var{struct cl_target_option} structure for
+function specific options.
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_OPTION_PRINT (struct cl_target_option *@var{ptr})
+This hook is called to print any additional target specific
+information in the @var{struct cl_target_option} structure for
+function specific options.
+@end deftypefn
+
+@deftypefn {Target Hook} bool TARGET_OPTION_PRAGMA_PARSE (target @var{args})
+This target hook parses the options for @code{#pragma GCC option} to
+set the machine specific options for functions that occur later in the
+input stream. The options should be the same as handled by the
+@code{TARGET_VALID_OPTION_ATTRIBUTE_P} hook.
+@end deftypefn
+
+@deftypefn {Target Hook} bool TARGET_CAN_INLINE_P (tree @var{caller}, tree @var{callee})
+This target hook returns @code{false} if the @var{caller} function
+cannot inline @var{callee}, based on target specific information. By
+default, inlining is not allowed if the callee function has function
+specific target options and the caller does not use the same options.
+@end deftypefn
+
@node Emulated TLS
@section Emulating TLS
@cindex Emulated TLS
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 43373481955..fb8d139b111 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -71,8 +71,7 @@ clear_pending_stack_adjust (void)
{
if (optimize > 0
&& (! flag_omit_frame_pointer || cfun->calls_alloca)
- && EXIT_IGNORE_STACK
- && ! (DECL_INLINE (current_function_decl) && ! flag_no_inline))
+ && EXIT_IGNORE_STACK)
discard_pending_stack_adjust ();
}
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 292c3437ca4..6fde8b2a438 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10702,8 +10702,6 @@ reference_to_unused (tree * tp, int * walk_subtrees,
if (DECL_P (*tp) && ! TREE_PUBLIC (*tp) && ! TREE_USED (*tp)
&& ! TREE_ASM_WRITTEN (*tp))
return *tp;
- else if (!flag_unit_at_a_time)
- return NULL_TREE;
/* ??? The C++ FE emits debug information for using decls, so
putting gcc_unreachable here falls over. See PR31899. For now
be conservative. */
diff --git a/gcc/final.c b/gcc/final.c
index f27e4308741..787c43abad5 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3344,6 +3344,14 @@ output_operand (rtx x, int code ATTRIBUTE_UNUSED)
gcc_assert (!x || !REG_P (x) || REGNO (x) < FIRST_PSEUDO_REGISTER);
PRINT_OPERAND (asm_out_file, x, code);
+ if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+ {
+ tree t;
+ x = XEXP (x, 0);
+ t = SYMBOL_REF_DECL (x);
+ if (t)
+ assemble_external (t);
+ }
}
/* Print a memory reference operand for address X
diff --git a/gcc/flags.h b/gcc/flags.h
index edc96e95920..f4cc3aca69d 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -143,11 +143,6 @@ extern HOST_WIDE_INT larger_than_size;
extern bool warn_frame_larger_than;
extern HOST_WIDE_INT frame_larger_than_size;
-/* Temporarily suppress certain warnings.
- This is set while reading code from a system header file. */
-
-extern int in_system_header;
-
/* Nonzero for -dp: annotate the assembly with a comment describing the
pattern and alternative used. */
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9325c45ff23..4569f523ca4 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,161 @@
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * fortran/options.c (gfc_post_options): Remove flag_unline_trees code.
+
+2008-07-24 Daniel Kraft <d@domob.eu>
+
+ PR fortran/33141
+ * lang.opt (Wnonstd-intrinsics): Removed option.
+ (Wintrinsics-std), (Wintrinsic-shadow): New options.
+ * invoke.texi (Option Summary): Removed -Wnonstd-intrinsics
+ from the list and added -Wintrinsics-std and -Wintrinsic-shadow.
+ (Error and Warning Options): Documented the new options and removed
+ the documentation for -Wnonstd-intrinsics.
+ * gfortran.h (gfc_option_t): New members warn_intrinsic_shadow and
+ warn_intrinsics_std, removed warn_nonstd_intrinsics.
+ (gfc_is_intrinsic): Renamed from gfc_intrinsic_name.
+ (gfc_warn_intrinsic_shadow), (gfc_check_intrinsic_standard): New.
+ * decl.c (match_procedure_decl): Replaced gfc_intrinsic_name by
+ the new name gfc_is_intrinsic.
+ (warn_intrinsic_shadow): New helper method.
+ (gfc_match_function_decl), (gfc_match_subroutine): Call the new method
+ warn_intrinsic_shadow to check the just-parsed procedure.
+ * expr.c (check_init_expr): Call new gfc_is_intrinsic to check whether
+ the function called is really an intrinsic in the selected standard.
+ * intrinsic.c (gfc_is_intrinsic): Renamed from gfc_intrinsic_name and
+ extended to take into account the selected standard settings when trying
+ to find out whether a symbol is an intrinsic or not.
+ (gfc_check_intrinsic_standard): Made public and extended.
+ (gfc_intrinsic_func_interface), (gfc_intrinsic_sub_interface): Removed
+ the calls to check_intrinsic_standard, this check now happens inside
+ gfc_is_intrinsic.
+ (gfc_warn_intrinsic_shadow): New method defined.
+ * options.c (gfc_init_options): Initialize new warning flags to false
+ and removed intialization of Wnonstd-intrinsics flag.
+ (gfc_post_options): Removed logic for Wnonstd-intrinsics flag.
+ (set_Wall): Set new warning flags and removed Wnonstd-intrinsics flag.
+ (gfc_handle_option): Handle the new flags and removed handling of the
+ old Wnonstd-intrinsics flag.
+ * primary.c (gfc_match_rvalue): Replaced call to gfc_intrinsic_name by
+ the new name gfc_is_intrinsic.
+ * resolve.c (resolve_actual_arglist): Ditto.
+ (resolve_generic_f), (resolve_unknown_f): Ditto.
+ (is_external_proc): Ditto.
+ (resolve_generic_s), (resolve_unknown_s): Ditto.
+ (resolve_symbol): Ditto and ensure for symbols declared INTRINSIC that
+ they are really available in the selected standard setting.
+
+2008-07-24 Daniel Kraft <d@domob.eu>
+
+ * match.c (gfc_match): Add assertion to catch wrong calls trying to
+ match upper-case characters.
+
+2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/29952
+ * gfortran.h: Add "warn_array_temp" to gfc_option_t.
+ * lang.opt: Add -Warray-temporaries.
+ * invoke.texi: Document -Warray-temporaries
+ * trans-array.h (gfc_trans_create_temp_array): Add argument of
+ type *locus.
+ (gfc_conv_loop_setup): Likewise.
+ * trans-array.c (gfc_trans_create_temp_array): If
+ -Warray-temporaries is given and locus is present, warn about
+ creation of array temporaries.
+ (gfc_trans_array_constructor_subarray): Add locus to call
+ of gfc_conv_loop_setup.
+ (gfc_trans_array_constructor): Add where argument. Pass where
+ argument to call of gfc_trans_create_temp_array.
+ (gfc_add_loop_ss_code): Add where argument. Pass where argument
+ to recursive call of gfc_add_loop_ss_code and to call of
+ gfc_trans_array_constructor.
+ (gfc_conv_loop_setup): Add where argument. Pass where argument
+ to calls to gfc_add_loop_ss_code and to gfc_trans_create_temp_array.
+ (gfc_conv_expr_descriptor): Pass location to call of
+ gfc_conv_loop_setup.
+ (gfc_conv_array_parameter): If -Warray-temporaries is given,
+ warn about creation of temporary arrays.
+ * trans-expr.c (gfc_conv_subref_array_arg): Add where argument
+ to call to gfc_conv_loop_setup.
+ (gfc_conv_function_call): Add where argument to call to
+ gfc_trans_creat_temp_array.
+ (gfc_trans_subarray_assign): Likewise.
+ (gfc_trans_assignment_1): Add where argument to call to
+ gfc_conv_loop_setup.
+ * trans-stmt.c (gfc_conv_elemental_dependencies): Add where
+ argument to call to gfc_trans_create_temp_array.
+ (gfc_trans_call): Add where argument to call to gfc_conv_loop_setup.
+ (generate_loop_for_temp_to_lhs): Likewise.
+ (generate_loop_for_rhs_to_temp): Likewise.
+ (compute_inner_temp_size): Likewise.
+ (gfc_trans-pointer_assign_need_temp): Likewise.
+ (gfc_evaluate_where_mask): Likewise.
+ (gfc_trans_where_assign): Likewise.
+ (gfc_trans_where_3): Likewise.
+ * trans-io.c (transfer_srray_component): Add where argument
+ to function. Add where argument to call to gfc_conv_loop_setup.
+ (transfer_expr): Add where argument to call to
+ transfer_array_component.
+ (gfc_trans_transfer): Add where expression to call to
+ gfc_conv_loop_setup.
+ * trans-intrinsic.c (gfc_conv_intrinsic_anyall): Add
+ where argument to call to gfc_conv_loop_setup.
+ (gfc_conv_intrinsic_count): Likewise.
+ (gfc_conv_intrinsic_arith): Likewise.
+ (gfc_conv_intrinsic_dot_product): Likewise.
+ (gfc_conv_intrinsic_minmaxloc): Likewise.
+ (gfc_conv_intrinsic_minmaxval): Likewise.
+ (gfc_conv_intrinsic_array_transfer): Warn about
+ creation of temporary array.
+ Add where argument to call to gfc_trans_create_temp_array.
+ * options.c (gfc_init_options): Initialize gfc_option.warn_array_temp.
+ (gfc_handle_option): Set gfc_option.warn_array_temp.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
+
+2008-07-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/29835
+ * io.c (error_element), (format_locus): New static globals.
+ (unexpected_element): Spelled out this message fully.
+ (next_char): Keep track of locus when not MODE_STRING.
+ (next_char_not_space): Remember last parsed element in error_element.
+ (format_lex): Fix two indentation errors.
+ (check_format): Use format_locus and possibly error_element for a
+ slightly better error message on invalid format.
+ (check_format_string): Set format_locus to start of the string
+ expression used as format.
+
+2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * expr.c (gfc_check_pointer_assign): Fix typo in string.
+ * io.c (check_format): Fix typo in string. Fix comment typos.
+ * parse.c (gfc_global_used): Likewise.
+ * resolve.c (resolve_allocate_expr): Likewise.
+ * symbol.c (gfc_set_default_type): Likewise.
+ * arith.c: Fix typos in comments.
+ * array.c: Likewise.
+ * data.c: Likewise.
+ * decl.c: Likewise.
+ * dependency.c: Likewise.
+ * f95-lang.c: Likewise.
+ * gfortran.h: Likewise.
+ * matchexp.c: Likewise.
+ * module.c: Likewise.
+ * primary.c: Likewise.
+ * scanner.c: Likewise.
+ * trans-array.c: Likewise.
+ * trans-common.c: Likewise.
+ * trans-decl.c: Likewise.
+ * trans-expr.c: Likewise.
+ * trans-intrinsic.c: Likewise.
+ * trans-types.c: Likewise.
+ * trans.c: Likewise.
+ * trans.h: Likewise.
+
2008-07-19 Tobias Burnus <burnus@net-b.de>
PR fortran/36795
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 38b71629df6..2e21b840e2a 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1092,7 +1092,7 @@ gfc_arith_concat (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
}
/* Comparison between real values; returns 0 if (op1 .op. op2) is true.
- This function mimics mpr_cmp but takes NaN into account. */
+ This function mimics mpfr_cmp but takes NaN into account. */
static int
compare_real (gfc_expr *op1, gfc_expr *op2, gfc_intrinsic_op op)
@@ -1159,7 +1159,7 @@ gfc_compare_expr (gfc_expr *op1, gfc_expr *op2, gfc_intrinsic_op op)
/* Compare a pair of complex numbers. Naturally, this is only for
- equality and nonequality. */
+ equality and inequality. */
static int
compare_complex (gfc_expr *op1, gfc_expr *op2)
@@ -2084,7 +2084,7 @@ arith_error (arith rc, gfc_typespec *from, gfc_typespec *to, locus *where)
gfc_internal_error ("gfc_arith_error(): Bad error code");
}
- /* TODO: Do something about the error, ie, throw exception, return
+ /* TODO: Do something about the error, i.e., throw exception, return
NaN, etc. */
}
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index ab9e42842fd..7216d1f472e 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -1577,7 +1577,7 @@ resolve_array_list (gfc_constructor *p)
}
/* Resolve character array constructor. If it has a specified constant character
- length, pad/trunkate the elements here; if the length is not specified and
+ length, pad/truncate the elements here; if the length is not specified and
all elements are of compile-time known length, emit an error as this is
invalid. */
@@ -1675,7 +1675,7 @@ got_charlen:
max_length only if they pass. */
gfc_extract_int (expr->ts.cl->length, &found_length);
- /* Now pad/trunkate the elements accordingly to the specified character
+ /* Now pad/truncate the elements accordingly to the specified character
length. This is ok inside this conditional, as in the case above
(without typespec) all elements are verified to have the same length
anyway. */
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index 6cc7223af2f..bda448a8f56 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
/* Notes for DATA statement implementation:
We first assign initial value to each symbol by gfc_assign_data_value
- during resolveing DATA statement. Refer to check_data_variable and
+ during resolving DATA statement. Refer to check_data_variable and
traverse_data_list in resolve.c.
The complexity exists in the handling of array section, implied do
@@ -144,7 +144,7 @@ find_con_by_component (gfc_component *com, gfc_constructor *con)
/* Create a character type initialization expression from RVALUE.
TS [and REF] describe [the substring of] the variable being initialized.
- INIT is thh existing initializer, not NULL. Initialization is performed
+ INIT is the existing initializer, not NULL. Initialization is performed
according to normal assignment rules. */
static gfc_expr *
@@ -754,7 +754,7 @@ formalize_structure_cons (gfc_expr *expr)
}
-/* Make sure an initialization expression is in normalized form. Ie. all
+/* Make sure an initialization expression is in normalized form, i.e., all
elements of the constructors are in the correct order. */
static void
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index b7b98d544b3..9b5aa7f0f93 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -762,7 +762,7 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
(*result)->ts = sym->ts;
/* Put the symbol in the procedure namespace so that, should
- the ENTRY preceed its specification, the specification
+ the ENTRY precede its specification, the specification
can be applied. */
(*result)->ns = gfc_current_ns;
@@ -4120,8 +4120,8 @@ match_procedure_decl (void)
/* Handle intrinsic procedures. */
if (!(proc_if->attr.external || proc_if->attr.use_assoc
|| proc_if->attr.if_source == IFSRC_IFBODY)
- && (gfc_intrinsic_name (proc_if->name, 0)
- || gfc_intrinsic_name (proc_if->name, 1)))
+ && (gfc_is_intrinsic (proc_if, 0, gfc_current_locus)
+ || gfc_is_intrinsic (proc_if, 1, gfc_current_locus)))
proc_if->attr.intrinsic = 1;
if (proc_if->attr.intrinsic
&& !gfc_intrinsic_actual_ok (proc_if->name, 0))
@@ -4336,6 +4336,22 @@ gfc_match_procedure (void)
}
+/* Warn if a matched procedure has the same name as an intrinsic; this is
+ simply a wrapper around gfc_warn_intrinsic_shadow that interprets the current
+ parser-state-stack to find out whether we're in a module. */
+
+static void
+warn_intrinsic_shadow (const gfc_symbol* sym, bool func)
+{
+ bool in_module;
+
+ in_module = (gfc_state_stack->previous
+ && gfc_state_stack->previous->state == COMP_MODULE);
+
+ gfc_warn_intrinsic_shadow (sym, in_module, func);
+}
+
+
/* Match a function declaration. */
match
@@ -4460,6 +4476,9 @@ gfc_match_function_decl (void)
sym->result = result;
}
+ /* Warn if this procedure has the same name as an intrinsic. */
+ warn_intrinsic_shadow (sym, true);
+
return MATCH_YES;
}
@@ -4842,6 +4861,9 @@ gfc_match_subroutine (void)
if (copy_prefix (&sym->attr, &sym->declared_at) == FAILURE)
return MATCH_ERROR;
+ /* Warn if it has the same name as an intrinsic. */
+ warn_intrinsic_shadow (sym, false);
+
return MATCH_YES;
}
@@ -5770,7 +5792,7 @@ syntax:
/* The PRIVATE statement is a bit weird in that it can be an attribute
- declaration, but also works as a standlone statement inside of a
+ declaration, but also works as a standalone statement inside of a
type declaration or a module. */
match
@@ -6341,7 +6363,7 @@ gfc_match_derived_decl (void)
components. The ways this can happen is via a function
definition, an INTRINSIC statement or a subtype in another
derived type that is a pointer. The first part of the AND clause
- is true if a the symbol is not the return value of a function. */
+ is true if the symbol is not the return value of a function. */
if (sym->attr.flavor != FL_DERIVED
&& gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index 3d98cac90ed..558b7675873 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -37,7 +37,7 @@ typedef enum
{
GFC_DEP_ERROR,
GFC_DEP_EQUAL, /* Identical Ranges. */
- GFC_DEP_FORWARD, /* eg. a(1:3), a(2:4). */
+ GFC_DEP_FORWARD, /* e.g., a(1:3), a(2:4). */
GFC_DEP_OVERLAP, /* May overlap in some other way. */
GFC_DEP_NODEP /* Distinct ranges. */
}
@@ -523,7 +523,7 @@ gfc_check_fncall_dependency (gfc_expr *other, sym_intent intent,
/* Return 1 if e1 and e2 are equivalenced arrays, either
- directly or indirectly; ie. equivalence (a,b) for a and b
+ directly or indirectly; i.e., equivalence (a,b) for a and b
or equivalence (a,c),(b,c). This function uses the equiv_
lists, generated in trans-common(add_equivalences), that are
guaranteed to pick up indirect equivalences. We explicitly
@@ -1183,7 +1183,7 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref)
while (lref && rref)
{
/* We're resolving from the same base symbol, so both refs should be
- the same type. We traverse the reference chain intil we find ranges
+ the same type. We traverse the reference chain until we find ranges
that are not equal. */
gcc_assert (lref->type == rref->type);
switch (lref->type)
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index aabcb4f7fb1..4d0c2c33f64 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2160,7 +2160,6 @@ check_init_expr (gfc_expr *e)
{
match m;
try t;
- gfc_intrinsic_sym *isym;
if (e == NULL)
return SUCCESS;
@@ -2179,7 +2178,12 @@ check_init_expr (gfc_expr *e)
if ((m = check_specification_function (e)) != MATCH_YES)
{
- if ((m = gfc_intrinsic_func_interface (e, 0)) != MATCH_YES)
+ gfc_intrinsic_sym* isym;
+ gfc_symbol* sym;
+
+ sym = e->symtree->n.sym;
+ if (!gfc_is_intrinsic (sym, 0, e->where)
+ || (m = gfc_intrinsic_func_interface (e, 0)) != MATCH_YES)
{
gfc_error ("Function '%s' in initialization expression at %L "
"must be an intrinsic or a specification function",
@@ -2201,7 +2205,7 @@ check_init_expr (gfc_expr *e)
/* Try to scalarize an elemental intrinsic function that has an
array argument. */
- isym = gfc_find_function (e->symtree->n.sym->name);
+ isym = gfc_find_function (e->symtree->n.sym->name);
if (isym && isym->elemental
&& (t = scalarize_intrinsic_call (e)) == SUCCESS)
break;
@@ -3002,7 +3006,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
if (attr.is_protected && attr.use_assoc)
{
- gfc_error ("Pointer assigment target has PROTECTED "
+ gfc_error ("Pointer assignment target has PROTECTED "
"attribute at %L", &rvalue->where);
return FAILURE;
}
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 9dfb4233210..941f7cd47d2 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -236,7 +236,7 @@ gfc_be_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
cgraph_finalize_compilation_unit ();
cgraph_optimize ();
- /* Tell the frontent about any errors. */
+ /* Tell the frontend about any errors. */
gfc_get_errors (&warnings, &errors);
errorcount += errors;
warningcount += warnings;
@@ -437,7 +437,7 @@ poplevel (int keep, int reverse, int functionbody)
}
else if (current_binding_level == global_binding_level)
/* When using gfc_start_block/gfc_finish_block from middle-end hooks,
- don't add newly created BLOCKs as sublocks of global_binding_level. */
+ don't add newly created BLOCKs as subblocks of global_binding_level. */
;
else if (block_node)
{
@@ -547,7 +547,7 @@ gfc_init_decl_processing (void)
only use it for actual characters, not for INTEGER(1). Also, we
want double_type_node to actually have double precision. */
build_common_tree_nodes (false, false);
- /* x86_64 minw32 has a sizetype of "unsigned long long", most other hosts
+ /* x86_64 mingw32 has a sizetype of "unsigned long long", most other hosts
have a sizetype of "unsigned long". Therefore choose the correct size
in mostly target independent way. */
if (TYPE_MODE (long_unsigned_type_node) == ptr_mode)
@@ -604,8 +604,8 @@ gfc_mark_addressable (tree exp)
IDENTIFIER_POINTER (DECL_NAME (x)));
return false;
}
- pedwarn ("register variable %qs used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
+ pedwarn0 ("register variable %qs used in nested function",
+ IDENTIFIER_POINTER (DECL_NAME (x)));
}
else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
{
@@ -629,7 +629,7 @@ gfc_mark_addressable (tree exp)
}
#endif
- pedwarn ("address of register variable %qs requested",
+ pedwarn0 ("address of register variable %qs requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
}
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 5a3b4c87f26..18af94e3b8d 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -78,7 +78,7 @@ char *alloca ();
#define stringize(x) expand_macro(x)
#define expand_macro(x) # x
-/* For a the runtime library, a standard prefix is a requirement to
+/* For the runtime library, a standard prefix is a requirement to
avoid cluttering the namespace with things nobody asked for. It's
ugly to look at and a pain to type when you add the prefix by hand,
so we hide it behind a macro. */
@@ -304,7 +304,7 @@ extern const mstring save_status[];
enum gfc_isym_id
{
/* GFC_ISYM_NONE is used for intrinsics which will never be seen by
- the backend (eg. KIND). */
+ the backend (e.g. KIND). */
GFC_ISYM_NONE = 0,
GFC_ISYM_ABORT,
GFC_ISYM_ABS,
@@ -693,7 +693,7 @@ typedef struct
unsigned cray_pointer:1, cray_pointee:1;
/* The symbol is a derived type with allocatable components, pointer
- components or private components, possibly nested. zer_comp
+ components or private components, possibly nested. zero_comp
is true if the derived type has no component at all. */
unsigned alloc_comp:1, pointer_comp:1, private_comp:1, zero_comp:1;
@@ -1872,7 +1872,10 @@ typedef struct
int warn_surprising;
int warn_tabs;
int warn_underflow;
+ int warn_intrinsic_shadow;
+ int warn_intrinsics_std;
int warn_character_truncation;
+ int warn_array_temp;
int max_errors;
int flag_all_intrinsics;
@@ -1914,7 +1917,6 @@ typedef struct
int warn_std;
int allow_std;
- int warn_nonstd_intrinsics;
int fshort_enums;
int convert;
int record_marker;
@@ -1960,7 +1962,7 @@ typedef struct gfc_finalizer
{
struct gfc_finalizer* next;
gfc_symbol* procedure;
- locus where; /* Where the FINAL declaration occured. */
+ locus where; /* Where the FINAL declaration occurred. */
}
gfc_finalizer;
@@ -2254,7 +2256,7 @@ try gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int);
try gfc_convert_chartype (gfc_expr *, gfc_typespec *);
int gfc_generic_intrinsic (const char *);
int gfc_specific_intrinsic (const char *);
-int gfc_intrinsic_name (const char *, int);
+bool gfc_is_intrinsic (gfc_symbol*, int, locus);
int gfc_intrinsic_actual_ok (const char *, const bool);
gfc_intrinsic_sym *gfc_find_function (const char *);
gfc_intrinsic_sym *gfc_find_subroutine (const char *);
@@ -2262,6 +2264,10 @@ gfc_intrinsic_sym *gfc_find_subroutine (const char *);
match gfc_intrinsic_func_interface (gfc_expr *, int);
match gfc_intrinsic_sub_interface (gfc_code *, int);
+void gfc_warn_intrinsic_shadow (const gfc_symbol*, bool, bool);
+try gfc_check_intrinsic_standard (const gfc_intrinsic_sym*, const char**,
+ bool, locus);
+
/* match.c -- FIXME */
void gfc_free_iterator (gfc_iterator *, int);
void gfc_free_forall_iterator (gfc_forall_iterator *);
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 4c55a2c99ba..e5eec7ef4aa 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -807,15 +807,47 @@ gfc_intrinsic_actual_ok (const char *name, const bool subroutine_flag)
}
-/* Given a string, figure out if it is the name of an intrinsic
- subroutine or function. There are no generic intrinsic
- subroutines, they are all specific. */
+/* Given a symbol, find out if it is (and is to be treated) an intrinsic. If
+ it's name refers to an intrinsic but this intrinsic is not included in the
+ selected standard, this returns FALSE and sets the symbol's external
+ attribute. */
-int
-gfc_intrinsic_name (const char *name, int subroutine_flag)
+bool
+gfc_is_intrinsic (gfc_symbol* sym, int subroutine_flag, locus loc)
{
- return subroutine_flag ? gfc_find_subroutine (name) != NULL
- : gfc_find_function (name) != NULL;
+ gfc_intrinsic_sym* isym;
+ const char* symstd;
+
+ /* If INTRINSIC/EXTERNAL state is already known, return. */
+ if (sym->attr.intrinsic)
+ return true;
+ if (sym->attr.external)
+ return false;
+
+ if (subroutine_flag)
+ isym = gfc_find_subroutine (sym->name);
+ else
+ isym = gfc_find_function (sym->name);
+
+ /* No such intrinsic available at all? */
+ if (!isym)
+ return false;
+
+ /* See if this intrinsic is allowed in the current standard. */
+ if (gfc_check_intrinsic_standard (isym, &symstd, false, loc) == FAILURE)
+ {
+ if (gfc_option.warn_intrinsics_std)
+ gfc_warning_now ("The intrinsic '%s' at %L is not included in the"
+ " selected standard but %s and '%s' will be treated as"
+ " if declared EXTERNAL. Use an appropriate -std=*"
+ " option or define -fall-intrinsics to allow this"
+ " intrinsic.", sym->name, &loc, symstd, sym->name);
+ sym->attr.external = 1;
+
+ return false;
+ }
+
+ return true;
}
@@ -3448,21 +3480,82 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
/* Check whether an intrinsic belongs to whatever standard the user
- has chosen. */
+ has chosen, taking also into account -fall-intrinsics. Here, no
+ warning/error is emitted; but if symstd is not NULL, it is pointed to a
+ textual representation of the symbols standard status (like
+ "new in Fortran 2008", "a GNU extension" or "obsolescent in Fortran 95") that
+ can be used to construct a detailed warning/error message in case of
+ a FAILURE. */
-static try
-check_intrinsic_standard (const char *name, int standard, locus *where)
+try
+gfc_check_intrinsic_standard (const gfc_intrinsic_sym* isym,
+ const char** symstd, bool silent, locus where)
{
- /* Do not warn about GNU-extensions if -std=gnu. */
- if (!gfc_option.warn_nonstd_intrinsics
- || (standard == GFC_STD_GNU && gfc_option.warn_std & GFC_STD_GNU))
+ const char* symstd_msg;
+
+ /* For -fall-intrinsics, just succeed. */
+ if (gfc_option.flag_all_intrinsics)
return SUCCESS;
- if (gfc_notify_std (standard, "Intrinsic '%s' at %L is not included "
- "in the selected standard", name, where) == FAILURE)
- return FAILURE;
+ /* Find the symbol's standard message for later usage. */
+ switch (isym->standard)
+ {
+ case GFC_STD_F77:
+ symstd_msg = "available since Fortran 77";
+ break;
- return SUCCESS;
+ case GFC_STD_F95_OBS:
+ symstd_msg = "obsolescent in Fortran 95";
+ break;
+
+ case GFC_STD_F95_DEL:
+ symstd_msg = "deleted in Fortran 95";
+ break;
+
+ case GFC_STD_F95:
+ symstd_msg = "new in Fortran 95";
+ break;
+
+ case GFC_STD_F2003:
+ symstd_msg = "new in Fortran 2003";
+ break;
+
+ case GFC_STD_F2008:
+ symstd_msg = "new in Fortran 2008";
+ break;
+
+ case GFC_STD_GNU:
+ symstd_msg = "a GNU Fortran extension";
+ break;
+
+ case GFC_STD_LEGACY:
+ symstd_msg = "for backward compatibility";
+ break;
+
+ default:
+ gfc_internal_error ("Invalid standard code on intrinsic '%s' (%d)",
+ isym->name, isym->standard);
+ }
+
+ /* If warning about the standard, warn and succeed. */
+ if (gfc_option.warn_std & isym->standard)
+ {
+ /* Do only print a warning if not a GNU extension. */
+ if (!silent && isym->standard != GFC_STD_GNU)
+ gfc_warning ("Intrinsic '%s' (is %s) is used at %L",
+ isym->name, _(symstd_msg), &where);
+
+ return SUCCESS;
+ }
+
+ /* If allowing the symbol's standard, succeed, too. */
+ if (gfc_option.allow_std & isym->standard)
+ return SUCCESS;
+
+ /* Otherwise, fail. */
+ if (symstd)
+ *symstd = _(symstd_msg);
+ return FAILURE;
}
@@ -3508,9 +3601,6 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
return MATCH_NO;
}
- if (check_intrinsic_standard (name, isym->standard, &expr->where) == FAILURE)
- return MATCH_ERROR;
-
if ((isym->id == GFC_ISYM_REAL || isym->id == GFC_ISYM_DBLE
|| isym->id == GFC_ISYM_CMPLX)
&& gfc_init_expr
@@ -3605,9 +3695,6 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
if (isym == NULL)
return MATCH_NO;
- if (check_intrinsic_standard (name, isym->standard, &c->loc) == FAILURE)
- return MATCH_ERROR;
-
gfc_suppress_error = !error_flag;
init_arglist (isym);
@@ -3827,3 +3914,42 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
return SUCCESS;
}
+
+
+/* Check if the passed name is name of an intrinsic (taking into account the
+ current -std=* and -fall-intrinsic settings). If it is, see if we should
+ warn about this as a user-procedure having the same name as an intrinsic
+ (-Wintrinsic-shadow enabled) and do so if we should. */
+
+void
+gfc_warn_intrinsic_shadow (const gfc_symbol* sym, bool in_module, bool func)
+{
+ gfc_intrinsic_sym* isym;
+
+ /* If the warning is disabled, do nothing at all. */
+ if (!gfc_option.warn_intrinsic_shadow)
+ return;
+
+ /* Try to find an intrinsic of the same name. */
+ if (func)
+ isym = gfc_find_function (sym->name);
+ else
+ isym = gfc_find_subroutine (sym->name);
+
+ /* If no intrinsic was found with this name or it's not included in the
+ selected standard, everything's fine. */
+ if (!isym || gfc_check_intrinsic_standard (isym, NULL, true,
+ sym->declared_at) == FAILURE)
+ return;
+
+ /* Emit the warning. */
+ if (in_module)
+ gfc_warning ("'%s' declared at %L may shadow the intrinsic of the same"
+ " name. In order to call the intrinsic, explicit INTRINSIC"
+ " declarations may be required.",
+ sym->name, &sym->declared_at);
+ else
+ gfc_warning ("'%s' declared at %L is also the name of an intrinsic. It can"
+ " only be called via an explicit interface or if declared"
+ " EXTERNAL.", sym->name, &sym->declared_at);
+}
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 445b4a7d1a9..ed3e1e70daf 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -137,9 +137,9 @@ by type. Explanations are in the following sections.
and warnings}.
@gccoptlist{-fmax-errors=@var{n} @gol
-fsyntax-only -pedantic -pedantic-errors @gol
--Wall -Waliasing -Wampersand -Wcharacter-truncation -Wconversion @gol
--Wimplicit-interface -Wline-truncation -Wnonstd-intrinsics -Wsurprising @gol
--Wno-tabs -Wunderflow -Wunused-parameter}
+-Wall -Waliasing -Wampersand -Warray-bounds -Wcharacter-truncation @gol
+-Wconversion -Wimplicit-interface -Wline-truncation -Wintrinsics-std @gol
+-Wsurprising -Wno-tabs -Wunderflow -Wunused-parameter -Wintrinsics-shadow}
@item Debugging Options
@xref{Debugging Options,,Options for debugging your program or GNU Fortran}.
@@ -211,7 +211,9 @@ form is determined by the file extension.
Accept all of the intrinsic procedures provided in libgfortran
without regard to the setting of @option{-std}. In particular,
this option can be quite useful with @option{-std=f95}. Additionally,
-@command{gfortran} will ignore @option{-Wnonstd-intrinsics}.
+@command{gfortran} will ignore @option{-Wintrinsics-std} and will never try
+to link to an @code{EXTERNAL} version if the intrinsic is not included in the
+selected standard.
@item -fd-lines-as-code
@item -fd-lines-as-comments
@@ -662,8 +664,8 @@ warnings.
Enables commonly used warning options pertaining to usage that
we recommend avoiding and that we believe are easy to avoid.
This currently includes @option{-Waliasing},
-@option{-Wampersand}, @option{-Wsurprising}, @option{-Wnonstd-intrinsics},
-@option{-Wno-tabs}, and @option{-Wline-truncation}.
+@option{-Wampersand}, @option{-Wsurprising}, @option{-Wintrinsics-std},
+@option{-Wno-tabs}, @option{-Wintrinsic-shadow} and @option{-Wline-truncation}.
@item -Waliasing
@opindex @code{Waliasing}
@@ -698,6 +700,13 @@ given in a continued character constant, GNU Fortran assumes continuation
at the first non-comment, non-whitespace character after the ampersand
that initiated the continuation.
+@item -Warray-temporaries
+@opindex @code{Warray-temporaries}
+@cindex warnings, array temporaries
+Warn about array temporaries generated by the compiler. The information
+generated by this warning is sometimes useful in optimization, in order to
+avoid such temporaries.
+
@item -Wcharacter-truncation
@opindex @code{Wcharacter-truncation}
@cindex warnings, character truncation
@@ -721,11 +730,15 @@ Warn if a procedure is called without an explicit interface.
Note this only checks that an explicit interface is present. It does not
check that the declared interfaces are consistent across program units.
-@item -Wnonstd-intrinsics
-@opindex @code{Wnonstd-intrinsics}
+@item -Wintrinsics-std
+@opindex @code{Wintrinsics-std}
@cindex warnings, non-standard intrinsics
-Warn if the user tries to use an intrinsic that does not belong to the
-standard the user has chosen via the @option{-std} option.
+@cindex warnings, intrinsics of other standards
+Warn if @command{gfortran} finds a procedure named like an intrinsic not
+available in the currently selected standard (with @option{-std}) and treats
+it as @code{EXTERNAL} procedure because of this. @option{-fall-intrinsics} can
+be used to never trigger this behaviour and always link to the intrinsic
+regardless of the selected standard.
@item -Wsurprising
@opindex @code{Wsurprising}
@@ -765,6 +778,15 @@ is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
Produce a warning when numerical constant expressions are
encountered, which yield an UNDERFLOW during compilation.
+@item -Wintrinsic-shadow
+@opindex @code{Wintrinsic-shadow}
+@cindex warnings, intrinsic
+@cindex intrinsic
+Warn if a user-defined procedure or module procedure has the same name as an
+intrinsic; in this case, an explicit interface or @code{EXTERNAL} or
+@code{INTRINSIC} declaration might be needed to get calls later resolved to
+the desired intrinsic/procedure.
+
@item -Wunused-parameter
@opindex @code{Wunused-parameter}
@cindex warnings, unused parameter
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 4af09710883..188cf95ad06 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -119,6 +119,8 @@ format_token;
process. */
static gfc_char_t *format_string;
static int format_length, use_last_char;
+static char error_element;
+static locus format_locus;
static format_token saved_token;
@@ -165,6 +167,9 @@ next_char (int in_string)
if (mode == MODE_COPY)
*format_string++ = c;
+ if (mode != MODE_STRING)
+ format_locus = gfc_current_locus;
+
c = gfc_wide_toupper (c);
return c;
}
@@ -186,7 +191,7 @@ next_char_not_space (bool *error)
char c;
do
{
- c = next_char (0);
+ error_element = c = next_char (0);
if (c == '\t')
{
if (gfc_option.allow_std & GFC_STD_GNU)
@@ -431,14 +436,14 @@ format_lex (void)
{
if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DP format "
"specifier not allowed at %C") == FAILURE)
- return FMT_ERROR;
+ return FMT_ERROR;
token = FMT_DP;
}
else if (c == 'C')
{
if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DC format "
"specifier not allowed at %C") == FAILURE)
- return FMT_ERROR;
+ return FMT_ERROR;
token = FMT_DC;
}
else
@@ -474,7 +479,8 @@ check_format (bool is_input)
{
const char *posint_required = _("Positive width required");
const char *nonneg_required = _("Nonnegative width required");
- const char *unexpected_element = _("Unexpected element");
+ const char *unexpected_element = _("Unexpected element '%c' in format string"
+ " at %L");
const char *unexpected_end = _("Unexpected end of format string");
const char *zero_width = _("Zero width in format descriptor");
const char *g0_precision = _("Specifying precision with G0 not allowed");
@@ -696,7 +702,7 @@ data_desc:
goto syntax;
}
- if (gfc_notify_std (GFC_STD_F2008, "Fortran F2008: 'G0' in "
+ if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: 'G0' in "
"format at %C") == FAILURE)
return FAILURE;
@@ -960,10 +966,11 @@ extension_optional_comma:
goto format_item;
syntax:
- gfc_error ("%s in format string at %C", error);
+ if (error == unexpected_element)
+ gfc_error (error, error_element, &format_locus);
+ else
+ gfc_error ("%s in format string at %L", error, &format_locus);
fail:
- /* TODO: More elaborate measures are needed to show where a problem
- is within a format string that has been calculated. */
rv = FAILURE;
finished:
@@ -982,6 +989,12 @@ check_format_string (gfc_expr *e, bool is_input)
mode = MODE_STRING;
format_string = e->value.character.string;
+
+ /* More elaborate measures are needed to show where a problem is within a
+ format string that has been calculated, but that's probably not worth the
+ effort. */
+ format_locus = e->where;
+
return check_format (is_input);
}
@@ -2489,9 +2502,9 @@ gfc_resolve_dt (gfc_dt *dt)
else
{
/* At this point, we have an extra comma. If io_unit has arrived as
- type chracter, we assume its really the "format" form of the I/O
+ type character, we assume its really the "format" form of the I/O
statement. We set the io_unit to the default unit and format to
- the chracter expression. See F95 Standard section 9.4. */
+ the character expression. See F95 Standard section 9.4. */
io_kind k;
k = dt->extra_comma->value.iokind;
if (e->ts.type == BT_CHARACTER && (k == M_READ || k == M_PRINT))
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index f0f6c6a756d..7a067604e89 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -76,6 +76,10 @@ Wampersand
Fortran Warning
Warn about missing ampersand in continued character constants
+Warray-temporaries
+Fortran Warning
+Warn about creation of array temporaries
+
Wcharacter-truncation
Fortran Warning
Warn about truncated character expressions
@@ -92,9 +96,9 @@ Wline-truncation
Fortran Warning
Warn about truncated source lines
-Wnonstd-intrinsics
+Wintrinsics-std
Fortran Warning
-Warn about usage of non-standard intrinsics
+Warn on intrinsics not part of the selected standard
Wreturn-type
Fortran Warning
@@ -112,6 +116,10 @@ Wunderflow
Fortran Warning
Warn about underflow of numerical constant expressions
+Wintrinsic-shadow
+Fortran Warning
+Warn if a user-procedure has the same name as an intrinsic
+
cpp
Fortran Joined Separate Negative(nocpp)
Enable preprocessing
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 19a97e930e9..42fe7943aea 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -1187,6 +1187,11 @@ loop:
}
default:
+
+ /* gfc_next_ascii_char converts characters to lower-case, so we shouldn't
+ expect an upper case character here! */
+ gcc_assert (TOLOWER (c) == c);
+
if (c == gfc_next_ascii_char ())
goto loop;
break;
diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c
index 0092f4086bb..f7573655316 100644
--- a/gcc/fortran/matchexp.c
+++ b/gcc/fortran/matchexp.c
@@ -254,7 +254,7 @@ match_level_1 (gfc_expr **result)
/* As a GNU extension we support an expanded level-2 expression syntax.
Via this extension we support (arbitrary) nesting of unary plus and
minus operations following unary and binary operators, such as **.
- The grammar of section 7.1.1.3 is effectively rewitten as:
+ The grammar of section 7.1.1.3 is effectively rewritten as:
R704 mult-operand is level-1-expr [ power-op ext-mult-operand ]
R704' ext-mult-operand is add-op ext-mult-operand
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 365dd98a60f..a418bb9d9a4 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -20,7 +20,7 @@ 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/>. */
-/* The syntax of gfortran modules resembles that of lisp lists, ie a
+/* The syntax of gfortran modules resembles that of lisp lists, i.e. a
sequence of atoms, which can be left or right parenthesis, names,
integers or strings. Parenthesis are always matched which allows
us to skip over sections at high speed without having to know
@@ -446,7 +446,7 @@ associate_integer_pointer (pointer_info *p, void *gp)
either store the pointer from an already-known value or create a
fixup structure in order to store things later. Returns zero if
the reference has been actually stored, or nonzero if the reference
- must be fixed later (ie associate_integer_pointer must be called
+ must be fixed later (i.e., associate_integer_pointer must be called
sometime later. Returns the pointer_info structure. */
static pointer_info *
@@ -3062,7 +3062,7 @@ mio_namelist (gfc_symbol *sym)
}
-/* Save/restore lists of gfc_interface stuctures. When loading an
+/* Save/restore lists of gfc_interface structures. When loading an
interface, we are really appending to the existing list of
interfaces. Checking for duplicate and ambiguous interfaces has to
be done later when all symbols have been loaded. */
@@ -3272,7 +3272,7 @@ find_symtree_for_symbol (gfc_symtree *st, gfc_symbol *sym)
}
-/* A recursive function to look for a speficic symbol by name and by
+/* A recursive function to look for a specific symbol by name and by
module. Whilst several symtrees might point to one symbol, its
is sufficient for the purposes here than one exist. Note that
generic interfaces are distinguished as are symbols that have been
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 8480364bc52..9bbb39a35c0 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -69,12 +69,15 @@ gfc_init_options (unsigned int argc, const char **argv)
gfc_option.warn_aliasing = 0;
gfc_option.warn_ampersand = 0;
gfc_option.warn_character_truncation = 0;
+ gfc_option.warn_array_temp = 0;
gfc_option.warn_conversion = 0;
gfc_option.warn_implicit_interface = 0;
gfc_option.warn_line_truncation = 0;
gfc_option.warn_surprising = 0;
gfc_option.warn_tabs = 1;
gfc_option.warn_underflow = 1;
+ gfc_option.warn_intrinsic_shadow = 0;
+ gfc_option.warn_intrinsics_std = 0;
gfc_option.max_errors = 25;
gfc_option.flag_all_intrinsics = 0;
@@ -123,8 +126,6 @@ gfc_init_options (unsigned int argc, const char **argv)
set_default_std_flags ();
- gfc_option.warn_nonstd_intrinsics = 0;
-
/* -fshort-enums can be default on some targets. */
gfc_option.fshort_enums = targetm.default_short_enums ();
@@ -292,13 +293,9 @@ gfc_post_options (const char **pfilename)
gfc_warning_now ("'-fd-lines-as-code' has no effect in free form");
}
- flag_inline_trees = 1;
-
/* Use tree inlining. */
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* If -pedantic, warn about the use of GNU extensions. */
if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0)
@@ -354,9 +351,6 @@ gfc_post_options (const char **pfilename)
gfc_option.warn_tabs = 0;
}
- if (gfc_option.flag_all_intrinsics)
- gfc_option.warn_nonstd_intrinsics = 0;
-
gfc_cpp_post_options ();
/* FIXME: return gfc_cpp_preprocess_only ();
@@ -378,10 +372,11 @@ set_Wall (int setting)
gfc_option.warn_aliasing = setting;
gfc_option.warn_ampersand = setting;
gfc_option.warn_line_truncation = setting;
- gfc_option.warn_nonstd_intrinsics = setting;
gfc_option.warn_surprising = setting;
gfc_option.warn_tabs = !setting;
gfc_option.warn_underflow = setting;
+ gfc_option.warn_intrinsic_shadow = setting;
+ gfc_option.warn_intrinsics_std = setting;
gfc_option.warn_character_truncation = setting;
set_Wunused (setting);
@@ -485,6 +480,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_ampersand = value;
break;
+ case OPT_Warray_temporaries:
+ gfc_option.warn_array_temp = value;
+ break;
+
case OPT_Wcharacter_truncation:
gfc_option.warn_character_truncation = value;
break;
@@ -517,6 +516,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_underflow = value;
break;
+ case OPT_Wintrinsic_shadow:
+ gfc_option.warn_intrinsic_shadow = value;
+ break;
+
case OPT_fall_intrinsics:
gfc_option.flag_all_intrinsics = 1;
break;
@@ -778,8 +781,8 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_std = 0;
break;
- case OPT_Wnonstd_intrinsics:
- gfc_option.warn_nonstd_intrinsics = value;
+ case OPT_Wintrinsics_std:
+ gfc_option.warn_intrinsics_std = value;
break;
case OPT_fshort_enums:
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 781efbc205d..1a479627668 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -1533,7 +1533,7 @@ unexpected_statement (gfc_statement st)
issue an error and return FAILURE. Otherwise we return SUCCESS.
Individual parsers need to verify that the statements seen are
- valid before calling here, ie ENTRY statements are not allowed in
+ valid before calling here, i.e., ENTRY statements are not allowed in
INTERFACE blocks. The following diagram is taken from the standard:
+---------------------------------------+
@@ -3413,7 +3413,7 @@ gfc_global_used (gfc_gsymbol *sym, locus *where)
name = "MODULE";
break;
default:
- gfc_internal_error ("gfc_gsymbol_type(): Bad type");
+ gfc_internal_error ("gfc_global_used(): Bad type");
name = NULL;
}
@@ -3688,7 +3688,7 @@ done:
duplicate_main:
/* If we see a duplicate main program, shut down. If the second
- instance is an implied main program, ie data decls or executable
+ instance is an implied main program, i.e. data decls or executable
statements, we're in for lots of errors. */
gfc_error ("Two main PROGRAMs at %L and %C", &prog_locus);
reject_statement ();
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 1d69d886797..782f38e4425 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2413,8 +2413,8 @@ gfc_match_rvalue (gfc_expr **result)
goto function0;
if (sym->attr.flavor == FL_UNKNOWN) sym->attr.flavor = FL_PROCEDURE;
- if (gfc_intrinsic_name (sym->name, 0)
- || gfc_intrinsic_name (sym->name, 1))
+ if (gfc_is_intrinsic (sym, 0, gfc_current_locus)
+ || gfc_is_intrinsic (sym, 1, gfc_current_locus))
sym->attr.intrinsic = 1;
e = gfc_get_expr ();
e->expr_type = EXPR_VARIABLE;
@@ -2689,7 +2689,7 @@ gfc_match_rvalue (gfc_expr **result)
}
-/* Match a variable, ie something that can be assigned to. This
+/* Match a variable, i.e. something that can be assigned to. This
starts as a symbol, can be a structure component or an array
reference. It can be a function if the function doesn't have a
separate RESULT variable. If the symbol has not been previously
@@ -2714,7 +2714,7 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag)
we force the changed_symbols mechanism to work by setting
host_flag to 0. This prevents valid symbols that have the name
of keywords, such as 'end', being turned into variables by
- failed matching to assignments for, eg., END INTERFACE. */
+ failed matching to assignments for, e.g., END INTERFACE. */
if (gfc_current_state () == COMP_MODULE
|| gfc_current_state () == COMP_INTERFACE
|| gfc_current_state () == COMP_CONTAINS)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 758f86f7ed5..0b27da18fd0 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1,4 +1,4 @@
-/* Perform type resolution on the various stuctures.
+/* Perform type resolution on the various structures.
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Andy Vaught
@@ -1076,7 +1076,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype)
if (!sym->attr.intrinsic
&& !(sym->attr.external || sym->attr.use_assoc
|| sym->attr.if_source == IFSRC_IFBODY)
- && gfc_intrinsic_name (sym->name, sym->attr.subroutine))
+ && gfc_is_intrinsic (sym, sym->attr.subroutine, e->where))
sym->attr.intrinsic = 1;
if (sym->attr.proc == PROC_ST_FUNCTION)
@@ -1535,7 +1535,7 @@ generic:
/* Last ditch attempt. See if the reference is to an intrinsic
that possesses a matching interface. 14.1.2.4 */
- if (sym && !gfc_intrinsic_name (sym->name, 0))
+ if (sym && !gfc_is_intrinsic (sym, 0, expr->where))
{
gfc_error ("There is no specific function for the generic '%s' at %L",
expr->symtree->n.sym->name, &expr->where);
@@ -1568,7 +1568,7 @@ resolve_specific_f0 (gfc_symbol *sym, gfc_expr *expr)
gfc_intrinsic_sym *isym;
isym = gfc_find_function (sym->ts.interface->name);
- /* Existance of isym should be checked already. */
+ /* Existence of isym should be checked already. */
gcc_assert (isym);
sym->ts.type = isym->ts.type;
@@ -1673,7 +1673,7 @@ resolve_unknown_f (gfc_expr *expr)
/* See if we have an intrinsic function reference. */
- if (gfc_intrinsic_name (sym->name, 0))
+ if (gfc_is_intrinsic (sym, 0, expr->where))
{
if (gfc_intrinsic_func_interface (expr, 1) == MATCH_YES)
return SUCCESS;
@@ -1721,13 +1721,13 @@ is_external_proc (gfc_symbol *sym)
{
if (!sym->attr.dummy && !sym->attr.contained
&& !(sym->attr.intrinsic
- || gfc_intrinsic_name (sym->name, sym->attr.subroutine))
+ || gfc_is_intrinsic (sym, sym->attr.subroutine, sym->declared_at))
&& sym->attr.proc != PROC_ST_FUNCTION
&& !sym->attr.use_assoc
&& sym->name)
return true;
- else
- return false;
+
+ return false;
}
@@ -2469,7 +2469,7 @@ generic:
that possesses a matching interface. 14.1.2.4 */
sym = c->symtree->n.sym;
- if (!gfc_intrinsic_name (sym->name, 1))
+ if (!gfc_is_intrinsic (sym, 1, c->loc))
{
gfc_error ("There is no specific subroutine for the generic '%s' at %L",
sym->name, &c->loc);
@@ -2644,7 +2644,7 @@ resolve_specific_s0 (gfc_code *c, gfc_symbol *sym)
isym = gfc_find_function (sym->ts.interface->name);
- /* Existance of isym should be checked already. */
+ /* Existence of isym should be checked already. */
gcc_assert (isym);
sym->ts.type = isym->ts.type;
@@ -2748,7 +2748,7 @@ resolve_unknown_s (gfc_code *c)
/* See if we have an intrinsic function reference. */
- if (gfc_intrinsic_name (sym->name, 1))
+ if (gfc_is_intrinsic (sym, 1, c->loc))
{
if (gfc_intrinsic_sub_interface (c, 1) == MATCH_YES)
return SUCCESS;
@@ -3185,7 +3185,7 @@ resolve_operator (gfc_expr *e)
{
t = gfc_simplify_expr (e, 0);
/* Some calls do not succeed in simplification and return FAILURE
- even though there is no error; eg. variable references to
+ even though there is no error; e.g. variable references to
PARAMETER arrays. */
if (!gfc_is_constant_expr (e))
t = SUCCESS;
@@ -4873,7 +4873,7 @@ check_symbols:
|| (ar->end[i] != NULL
&& gfc_find_sym_in_expr (sym, ar->end[i])))
{
- gfc_error ("'%s' must not appear an the array specification at "
+ gfc_error ("'%s' must not appear in the array specification at "
"%L in the same ALLOCATE statement where it is "
"itself allocated", sym->name, &ar->where);
return FAILURE;
@@ -5999,7 +5999,7 @@ gfc_resolve_blocks (gfc_code *b, gfc_namespace *ns)
/* Does everything to resolve an ordinary assignment. Returns true
- if this is an interface asignment. */
+ if this is an interface assignment. */
static bool
resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
{
@@ -7251,7 +7251,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
}
/* Ensure that derived type for are not of a private type. Internal
- module procedures are excluded by 2.2.3.3 - ie. they are not
+ module procedures are excluded by 2.2.3.3 - i.e., they are not
externally accessible and can access all the objects accessible in
the host. */
if (!(sym->ns->parent
@@ -7563,7 +7563,7 @@ gfc_resolve_finalizers (gfc_symbol* derived)
prev_link = &list->next;
continue;
- /* Remove wrong nodes immediatelly from the list so we don't risk any
+ /* Remove wrong nodes immediately from the list so we don't risk any
troubles in the future when they might fail later expectations. */
error:
result = FAILURE;
@@ -7961,24 +7961,45 @@ resolve_symbol (gfc_symbol *sym)
type to avoid spurious warnings. */
if (sym->attr.flavor != FL_MODULE && sym->attr.intrinsic)
{
- if (gfc_intrinsic_name (sym->name, 0))
+ gfc_intrinsic_sym* isym;
+ const char* symstd;
+
+ /* We already know this one is an intrinsic, so we don't call
+ gfc_is_intrinsic for full checking but rather use gfc_find_function and
+ gfc_find_subroutine directly to check whether it is a function or
+ subroutine. */
+
+ if ((isym = gfc_find_function (sym->name)))
{
if (sym->ts.type != BT_UNKNOWN && gfc_option.warn_surprising)
- gfc_warning ("Type specified for intrinsic function '%s' at %L is ignored",
- sym->name, &sym->declared_at);
+ gfc_warning ("Type specified for intrinsic function '%s' at %L is"
+ " ignored", sym->name, &sym->declared_at);
}
- else if (gfc_intrinsic_name (sym->name, 1))
+ else if ((isym = gfc_find_subroutine (sym->name)))
{
if (sym->ts.type != BT_UNKNOWN)
{
- gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type specifier",
- sym->name, &sym->declared_at);
+ gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type"
+ " specifier", sym->name, &sym->declared_at);
return;
}
}
else
{
- gfc_error ("Intrinsic '%s' at %L does not exist", sym->name, &sym->declared_at);
+ gfc_error ("'%s' declared INTRINSIC at %L does not exist",
+ sym->name, &sym->declared_at);
+ return;
+ }
+
+ /* Check it is actually available in the standard settings. */
+ if (gfc_check_intrinsic_standard (isym, &symstd, false, sym->declared_at)
+ == FAILURE)
+ {
+ gfc_error ("The intrinsic '%s' declared INTRINSIC at %L is not"
+ " available in the current standard settings but %s. Use"
+ " an appropriate -std=* option or enable -fall-intrinsics"
+ " in order to use it.",
+ sym->name, &sym->declared_at, symstd);
return;
}
}
@@ -8642,7 +8663,7 @@ resolve_data (gfc_data *d)
is storage associated with any such variable, shall not be used in the
following contexts: (clients of this function). */
-/* Determines if a variable is not 'pure', ie not assignable within a pure
+/* Determines if a variable is not 'pure', i.e., not assignable within a pure
procedure. Returns zero if assignment is OK, nonzero if there is a
problem. */
int
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 3087c62e41b..c0becf05e2c 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1917,7 +1917,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
/* Open a new file and start scanning from that file. Returns SUCCESS
- if everything went OK, FAILURE otherwise. If form == FORM_UKNOWN
+ if everything went OK, FAILURE otherwise. If form == FORM_UNKNOWN
it tries to determine the source form from the filename, defaulting
to free form. */
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index ca1237e78d9..121f62ea2cb 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -272,7 +272,7 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
{
/* Dummy args to a BIND(C) routine may not be interoperable if
they are implicitly typed. */
- gfc_warning_now ("Implicity declared variable '%s' at %L may not "
+ gfc_warning_now ("Implicitly declared variable '%s' at %L may not "
"be C interoperable but it is a dummy argument to "
"the BIND(C) procedure '%s' at %L", sym->name,
&(sym->declared_at), sym->ns->proc_name->name,
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 2a966988dec..9ec8406c428 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see
In fortran all the rhs values of an assignment must be evaluated before
any assignments take place. This can require a temporary array to store the
values. We also require a temporary when we are passing array expressions
- or vector subecripts as procedure parameters.
+ or vector subscripts as procedure parameters.
Array sections are passed without copying to a temporary. These use the
scalarizer to determine the shape of the section. The flag
@@ -576,7 +576,7 @@ tree
gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
gfc_loopinfo * loop, gfc_ss_info * info,
tree eltype, bool dynamic, bool dealloc,
- bool callee_alloc)
+ bool callee_alloc, locus * where)
{
tree type;
tree desc;
@@ -589,6 +589,10 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
int dim;
gcc_assert (info->dimen > 0);
+
+ if (gfc_option.warn_array_temp && where)
+ gfc_warning ("Creating array temporary at %L", where);
+
/* Set the lower bound to zero. */
for (dim = 0; dim < info->dimen; dim++)
{
@@ -1070,7 +1074,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock,
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
/* Make sure the constructed array has room for the new data. */
if (dynamic)
@@ -1645,7 +1649,7 @@ gfc_trans_constant_array_constructor (gfc_loopinfo * loop,
/* Helper routine of gfc_trans_array_constructor to determine if the
bounds of the loop specified by LOOP are constant and simple enough
to use with gfc_trans_constant_array_constructor. Returns the
- the iteration count of the loop if suitable, and NULL_TREE otherwise. */
+ iteration count of the loop if suitable, and NULL_TREE otherwise. */
static tree
constant_array_constructor_loop_size (gfc_loopinfo * loop)
@@ -1683,7 +1687,7 @@ constant_array_constructor_loop_size (gfc_loopinfo * loop)
simplest method. */
static void
-gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
+gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
{
gfc_constructor *c;
tree offset;
@@ -1809,7 +1813,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
loopfrom = NULL_TREE;
gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, &ss->data.info,
- type, dynamic, true, false);
+ type, dynamic, true, false, where);
if (loopfrom != NULL_TREE)
{
@@ -1896,13 +1900,14 @@ gfc_set_vector_loop_bounds (gfc_loopinfo * loop, gfc_ss_info * info)
but before the actual scalarizing loops. */
static void
-gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
+gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
+ locus * where)
{
gfc_se se;
int n;
- /* TODO: This can generate bad code if there are ordering dependencies.
- eg. a callee allocated function and an unknown size constructor. */
+ /* TODO: This can generate bad code if there are ordering dependencies,
+ e.g., a callee allocated function and an unknown size constructor. */
gcc_assert (ss != NULL);
for (; ss != gfc_ss_terminator; ss = ss->loop_chain)
@@ -1950,7 +1955,8 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
/* Add the expressions for scalar and vector subscripts. */
for (n = 0; n < GFC_MAX_DIMENSIONS; n++)
if (ss->data.info.subscript[n])
- gfc_add_loop_ss_code (loop, ss->data.info.subscript[n], true);
+ gfc_add_loop_ss_code (loop, ss->data.info.subscript[n], true,
+ where);
gfc_set_vector_loop_bounds (loop, &ss->data.info);
break;
@@ -1993,7 +1999,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
gfc_add_block_to_block (&loop->pre, &se.pre);
gfc_add_block_to_block (&loop->post, &se.post);
}
- gfc_trans_array_constructor (loop, ss);
+ gfc_trans_array_constructor (loop, ss, where);
break;
case GFC_SS_TEMP:
@@ -3327,7 +3333,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
moved outside the loop. */
void
-gfc_conv_loop_setup (gfc_loopinfo * loop)
+gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
{
int n;
int dim;
@@ -3493,7 +3499,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
/* Add all the scalar code that can be taken out of the loops.
This may include calculating the loop bounds, so do it before
allocating the temporary. */
- gfc_add_loop_ss_code (loop, loop->ss, false);
+ gfc_add_loop_ss_code (loop, loop->ss, false, where);
/* If we want a temporary then create it. */
if (loop->temp_ss != NULL)
@@ -3515,7 +3521,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
loop->temp_ss->data.info.dimen = n;
gfc_trans_create_temp_array (&loop->pre, &loop->post, loop,
&loop->temp_ss->data.info, tmp, false, true,
- false);
+ false, where);
}
for (n = 0; n < loop->temp_dim; n++)
@@ -4299,6 +4305,9 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
stmt_unpacked = build_call_expr (gfor_fndecl_in_pack, 1, tmp);
stride = gfc_index_one_node;
+
+ if (gfc_option.warn_array_temp)
+ gfc_warning ("Creating array temporary at %L", &loc);
}
/* This is for the case where the array data is used directly without
@@ -4536,7 +4545,7 @@ gfc_get_dataptr_offset (stmtblock_t *block, tree parm, tree desc, tree offset,
tmp = gfc_build_array_ref (tmp, offset, NULL);
/* Offset the data pointer for pointer assignments from arrays with
- subreferences; eg. my_integer => my_type(:)%integer_component. */
+ subreferences; e.g. my_integer => my_type(:)%integer_component. */
if (subref)
{
/* Go past the array reference. */
@@ -4635,7 +4644,7 @@ get_elemental_fcn_charlen (gfc_expr *expr, gfc_se *se)
arg = expr->value.function.actual;
gfc_init_interface_mapping (&mapping);
- /* Set se = NULL in the calls to the interface mapping, to supress any
+ /* Set se = NULL in the calls to the interface mapping, to suppress any
backend stuff. */
for (; arg != NULL; arg = arg->next, formal = formal ? formal->next : NULL)
{
@@ -4871,7 +4880,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
gfc_add_ss_to_loop (&loop, loop.temp_ss);
}
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, & expr->where);
if (need_tmp)
{
@@ -5219,6 +5228,10 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
{
desc = se->expr;
/* Repack the array. */
+
+ if (gfc_option.warn_array_temp)
+ gfc_warning ("Creating array temporary at %L", &expr->where);
+
ptr = build_call_expr (gfor_fndecl_in_pack, 1, desc);
ptr = gfc_evaluate_now (ptr, &se->pre);
se->expr = ptr;
@@ -5865,7 +5878,7 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr)
if (head == ss)
{
/* First operand is scalar. We build the chain in reverse order, so
- add the scarar SS after the second operand. */
+ add the scalar SS after the second operand. */
head = head2;
while (head && head->next != ss)
head = head->next;
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h
index 2b644c7880b..1e34c9a9f28 100644
--- a/gcc/fortran/trans-array.h
+++ b/gcc/fortran/trans-array.h
@@ -32,7 +32,8 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *,
/* Generate code to create a temporary array. */
tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *,
- gfc_ss_info *, tree, bool, bool, bool);
+ gfc_ss_info *, tree, bool, bool, bool,
+ locus *);
/* Generate function entry code for allocation of compiler allocated array
variables. */
@@ -88,7 +89,7 @@ void gfc_trans_scalarizing_loops (gfc_loopinfo *, stmtblock_t *);
/* Mark the end of the main loop body and the start of the copying loop. */
void gfc_trans_scalarized_loop_boundary (gfc_loopinfo *, stmtblock_t *);
/* Initialize the scalarization loop parameters. */
-void gfc_conv_loop_setup (gfc_loopinfo *);
+void gfc_conv_loop_setup (gfc_loopinfo *, locus *);
/* Resolve array assignment dependencies. */
void gfc_conv_resolve_dependencies (gfc_loopinfo *, gfc_ss *, gfc_ss *);
/* Build a null array descriptor constructor. */
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 4b95f5fbe78..8c30309b81f 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -955,7 +955,7 @@ find_equivalence (segment_info *n)
segment list multiple times to include indirect equivalences. Since
a new segment_info can inserted at the beginning of the segment list,
depending on its offset, we have to force a final pass through the
- loop by demanding that completion sees a pass with no matches; ie.
+ loop by demanding that completion sees a pass with no matches; i.e.,
all symbols with equiv_built set and no new equivalences found. */
static void
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 5fe460e91e2..d2161f5c5c7 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -525,7 +525,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
a default initializer; this must be applied each time the variable
comes into scope it therefore need not be static. These variables
are SAVE_NONE but have an initializer. Otherwise explicitly
- intitialized variables are SAVE_IMPLICIT and explicitly saved are
+ initialized variables are SAVE_IMPLICIT and explicitly saved are
SAVE_EXPLICIT. */
if (!sym->attr.use_assoc
&& (sym->attr.save != SAVE_NONE || sym->attr.data
@@ -1584,7 +1584,7 @@ create_function_arglist (gfc_symbol * sym)
if (f->sym->attr.proc_pointer)
type = build_pointer_type (type);
- /* Build a the argument declaration. */
+ /* Build the argument declaration. */
parm = build_decl (PARM_DECL, gfc_sym_identifier (f->sym), type);
/* Fill in arg stuff. */
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 568febc956e..3240d7f678c 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1927,7 +1927,7 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping,
/* ...and to the expression's symbol, if it has one. */
/* TODO Find out why the condition on expr->symtree had to be moved into
- the loop rather than being ouside it, as originally. */
+ the loop rather than being outside it, as originally. */
for (sym = mapping->syms; sym; sym = sym->next)
if (expr->symtree && sym->old == expr->symtree->n.sym)
{
@@ -2059,7 +2059,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr,
gfc_add_ss_to_loop (&loop, loop.temp_ss);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
/* Pass the temporary descriptor back to the caller. */
info = &loop.temp_ss->data.info;
@@ -2124,7 +2124,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr,
gfc_conv_ss_startstride (&loop2);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop2);
+ gfc_conv_loop_setup (&loop2, &expr->where);
gfc_copy_loopinfo_to_se (&lse, &loop2);
gfc_copy_loopinfo_to_se (&rse, &loop2);
@@ -2691,7 +2691,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
{
if (se->direct_byref)
{
- /* Sometimes, too much indirection can be applied; eg. for
+ /* Sometimes, too much indirection can be applied; e.g. for
function_result = array_valued_recursive_function. */
if (TREE_TYPE (TREE_TYPE (se->expr))
&& TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr)))
@@ -2717,7 +2717,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
mustn't be deallocated. */
callee_alloc = sym->attr.allocatable || sym->attr.pointer;
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp,
- false, !sym->attr.pointer, callee_alloc);
+ false, !sym->attr.pointer, callee_alloc,
+ &se->ss->expr->where);
/* Pass the temporary as the first argument. */
tmp = info->descriptor;
@@ -3335,7 +3336,7 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
gfc_conv_ss_startstride (&loop);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
/* Setup the gfc_se structures. */
gfc_copy_loopinfo_to_se (&lse, &loop);
@@ -3934,7 +3935,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
/* Makes sure se is suitable for passing as a function string parameter. */
-/* TODO: Need to check all callers fo this function. It may be abused. */
+/* TODO: Need to check all callers of this function. It may be abused. */
void
gfc_conv_string_parameter (gfc_se * se)
@@ -4415,7 +4416,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag)
/* Resolve any data dependencies in the statement. */
gfc_conv_resolve_dependencies (&loop, lss, rss);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
/* Setup the gfc_se structures. */
gfc_copy_loopinfo_to_se (&lse, &loop);
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 31780240cd2..b76dd76ce9c 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -1731,7 +1731,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
/* Generate the loop body. */
@@ -1813,7 +1813,7 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
/* Generate the loop body. */
@@ -1901,7 +1901,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
if (maskss)
@@ -2019,7 +2019,7 @@ gfc_conv_intrinsic_dot_product (gfc_se * se, gfc_expr * expr)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss1, 1);
gfc_mark_ss_chain_used (arrayss2, 1);
@@ -2159,7 +2159,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gcc_assert (loop.dimen == 1);
@@ -2355,7 +2355,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
if (maskss)
@@ -2754,7 +2754,7 @@ gfc_conv_intrinsic_index_scan_verify (gfc_se * se, gfc_expr * expr,
args = (tree *) alloca (sizeof (tree) * 5);
/* Get number of arguments; characters count double due to the
- string length argument. Kind= is not passed to the libary
+ string length argument. Kind= is not passed to the library
and thus ignored. */
if (expr->value.function.actual->next->next->expr == NULL)
num_args = 4;
@@ -3434,6 +3434,10 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
&& arg->expr->ref->u.ar.type == AR_FULL))
{
tmp = build_fold_addr_expr (argse.expr);
+
+ if (gfc_option.warn_array_temp)
+ gfc_warning ("Creating array temporary at %L", &expr->where);
+
source = build_call_expr (gfor_fndecl_in_pack, 1, tmp);
source = gfc_evaluate_now (source, &argse.pre);
@@ -3587,7 +3591,8 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
FIXME callee_alloc is not set! */
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop,
- info, mold_type, false, true, false);
+ info, mold_type, false, true, false,
+ &expr->where);
/* Cast the pointer to the result. */
tmp = gfc_conv_descriptor_data_get (info->descriptor);
@@ -4666,7 +4671,7 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr)
}
-/* Returns nonzero if the specified intrinsic function call maps directly to a
+/* Returns nonzero if the specified intrinsic function call maps directly to
an external library call. Should only be used for functions that return
arrays. */
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index f210169abe0..7f98e5c7c71 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1900,7 +1900,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code);
recursive. */
static tree
-transfer_array_component (tree expr, gfc_component * cm)
+transfer_array_component (tree expr, gfc_component * cm, locus * where)
{
tree tmp;
stmtblock_t body;
@@ -1944,7 +1944,7 @@ transfer_array_component (tree expr, gfc_component * cm)
gfc_init_loopinfo (&loop);
gfc_add_ss_to_loop (&loop, ss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, where);
gfc_mark_ss_chain_used (ss, 1);
gfc_start_scalarized_body (&loop, &body);
@@ -2089,7 +2089,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code)
if (c->dimension)
{
- tmp = transfer_array_component (tmp, c);
+ tmp = transfer_array_component (tmp, c, & code->loc);
gfc_add_expr_to_block (&se->pre, tmp);
}
else
@@ -2213,7 +2213,7 @@ gfc_trans_transfer (gfc_code * code)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &code->expr->where);
/* The main loop body. */
gfc_mark_ss_chain_used (ss, 1);
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 6afac5d3734..e19695fdade 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -269,7 +269,8 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
tmp = gfc_typenode_for_spec (&e->ts);
tmp = gfc_trans_create_temp_array (&se->pre, &se->post,
&tmp_loop, info, tmp,
- false, true, false);
+ false, true, false,
+ & arg->expr->where);
gfc_add_modify_expr (&se->pre, size, tmp);
tmp = fold_convert (pvoid_type_node, info->data);
gfc_add_modify_expr (&se->pre, data, tmp);
@@ -375,7 +376,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check)
gfc_add_ss_to_loop (&loop, ss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &code->expr->where);
gfc_mark_ss_chain_used (ss, 1);
/* Convert the arguments, checking for dependencies. */
@@ -1977,7 +1978,7 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree count3,
/* Calculate the bounds of the scalarization. */
gfc_conv_ss_startstride (&loop1);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop1);
+ gfc_conv_loop_setup (&loop1, &expr->where);
gfc_mark_ss_chain_used (lss, 1);
@@ -2075,7 +2076,7 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree count3,
gfc_add_ss_to_loop (&loop, rss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
gfc_mark_ss_chain_used (rss, 1);
/* Start the loop body. */
@@ -2197,7 +2198,7 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2,
flag_bounds_check = 0;
gfc_conv_ss_startstride (&loop);
flag_bounds_check = save_flag;
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
/* Figure out how many elements we need. */
for (i = 0; i < loop.dimen; i++)
@@ -2538,7 +2539,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
/* Setup the scalarizing loops and bounds. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
info = &rss->data.info;
desc = info->descriptor;
@@ -3019,7 +3020,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
gfc_add_ss_to_loop (&loop, rss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &me->where);
gfc_mark_ss_chain_used (rss, 1);
/* Start the loop body. */
@@ -3186,7 +3187,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
gfc_conv_resolve_dependencies (&loop, lss_section, rss);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
/* Setup the gfc_se structures. */
gfc_copy_loopinfo_to_se (&lse, &loop);
@@ -3634,7 +3635,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
}
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &tdst->where);
gfc_mark_ss_chain_used (css, 1);
gfc_mark_ss_chain_used (tdss, 1);
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 9fc0dc9a06c..2928cc68bf2 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -361,7 +361,7 @@ gfc_init_kinds (void)
if (kind == 16)
saw_r16 = true;
- /* Careful we don't stumble a wierd internal mode. */
+ /* Careful we don't stumble a weird internal mode. */
gcc_assert (r_index <= 0 || gfc_real_kinds[r_index-1].kind != kind);
/* Or have too many modes for the allocated space. */
gcc_assert (r_index != MAX_REAL_KINDS);
@@ -393,7 +393,7 @@ gfc_init_kinds (void)
gfc_default_integer_kind = 8;
/* Even if the user specified that the default integer kind be 8,
- the numerica storage size isn't 64. In this case, a warning will
+ the numeric storage size isn't 64. In this case, a warning will
be issued when NUMERIC_STORAGE_SIZE is used. */
gfc_numeric_storage_size = 4 * 8;
}
@@ -1065,8 +1065,8 @@ gfc_get_element_type (tree type)
ARRAYS comment.
The data component points to the first element in the array. The
- offset field is the position of the origin of the array (ie element
- (0, 0 ...)). This may be outsite the bounds of the array.
+ offset field is the position of the origin of the array (i.e. element
+ (0, 0 ...)). This may be outside the bounds of the array.
An element is accessed by
data[offset + index0*stride0 + index1*stride1 + index2*stride2]
@@ -1078,7 +1078,7 @@ gfc_get_element_type (tree type)
elements of the origin (2^63 on 64-bit machines). For example
integer, dimension (80000:90000, 80000:90000, 2) :: array
may not work properly on 32-bit machines because 80000*80000 >
- 2^31, so the calculation for stride02 would overflow. This may
+ 2^31, so the calculation for stride2 would overflow. This may
still work, but I haven't checked, and it relies on the overflow
doing the right thing.
@@ -2163,7 +2163,7 @@ gfc_type_for_size (unsigned bits, int unsignedp)
}
/* Handle TImode as a special case because it is used by some backends
- (eg. ARM) even though it is not available for normal use. */
+ (e.g. ARM) even though it is not available for normal use. */
#if HOST_BITS_PER_WIDE_INT >= 64
if (bits == TYPE_PRECISION (intTI_type_node))
return intTI_type_node;
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 5bd3005a2b3..1db628eff42 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -129,7 +129,7 @@ gfc_create_var (tree type, const char *prefix)
}
-/* If the an expression is not constant, evaluate it now. We assign the
+/* If the expression is not constant, evaluate it now. We assign the
result of the expression to an artificially created variable VAR, and
return a pointer to the VAR_DECL node for this variable. */
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index d19c6794a30..98002a9f2f7 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -1,5 +1,5 @@
/* Header for code translation functions
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
Foundation, Inc.
Contributed by Paul Brook
@@ -137,7 +137,7 @@ typedef enum
/* A non-elemental function call returning an array. The call is executed
before entering the scalarization loop, storing the result in a
temporary. This temporary is then used inside the scalarization loop.
- Simple assignments, eg. a(:) = fn() are handles without a temporary
+ Simple assignments, e.g. a(:) = fn(), are handled without a temporary
as a special case. */
GFC_SS_FUNCTION,
@@ -654,7 +654,7 @@ struct lang_decl GTY(())
#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)
-/* Code should use gfc_get_dtype instead of accesing this directly. It may
+/* Code should use gfc_get_dtype instead of accessing this directly. It may
not be known when the type is created. */
#define GFC_TYPE_ARRAY_DTYPE(node) (TYPE_LANG_SPECIFIC(node)->dtype)
#define GFC_TYPE_ARRAY_DATAPTR_TYPE(node) \
diff --git a/gcc/function.c b/gcc/function.c
index 86de92f4ca4..1e948f45f51 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3852,13 +3852,30 @@ debug_find_var_in_block_tree (tree var, tree block)
static bool in_dummy_function;
-/* Invoke the target hook when setting cfun. */
+/* Invoke the target hook when setting cfun. Update the optimization options
+ if the function uses different options than the default. */
static void
invoke_set_current_function_hook (tree fndecl)
{
if (!in_dummy_function)
- targetm.set_current_function (fndecl);
+ {
+ tree opts = ((fndecl)
+ ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl)
+ : optimization_default_node);
+
+ if (!opts)
+ opts = optimization_default_node;
+
+ /* Change optimization options if needed. */
+ if (optimization_current_node != opts)
+ {
+ optimization_current_node = opts;
+ cl_optimization_restore (TREE_OPTIMIZATION (opts));
+ }
+
+ targetm.set_current_function (fndecl);
+ }
}
/* cfun should never be set directly; use this function. */
@@ -3884,22 +3901,12 @@ DEF_VEC_ALLOC_P(function_p,heap);
static VEC(function_p,heap) *cfun_stack;
-/* We save the value of in_system_header here when pushing the first
- function on the cfun stack, and we restore it from here when
- popping the last function. */
-
-static bool saved_in_system_header;
-
/* Push the current cfun onto the stack, and set cfun to new_cfun. */
void
push_cfun (struct function *new_cfun)
{
- if (cfun == NULL)
- saved_in_system_header = in_system_header;
VEC_safe_push (function_p, heap, cfun_stack, cfun);
- if (new_cfun)
- in_system_header = DECL_IN_SYSTEM_HEADER (new_cfun->decl);
set_cfun (new_cfun);
}
@@ -3909,8 +3916,6 @@ void
pop_cfun (void)
{
struct function *new_cfun = VEC_pop (function_p, cfun_stack);
- in_system_header = ((new_cfun == NULL) ? saved_in_system_header
- : DECL_IN_SYSTEM_HEADER (new_cfun->decl));
set_cfun (new_cfun);
}
@@ -3988,11 +3993,7 @@ allocate_struct_function (tree fndecl, bool abstract_p)
void
push_struct_function (tree fndecl)
{
- if (cfun == NULL)
- saved_in_system_header = in_system_header;
VEC_safe_push (function_p, heap, cfun_stack, cfun);
- if (fndecl)
- in_system_header = DECL_IN_SYSTEM_HEADER (fndecl);
allocate_struct_function (fndecl, false);
}
diff --git a/gcc/input.h b/gcc/input.h
index 5d432592315..299f56c3ce6 100644
--- a/gcc/input.h
+++ b/gcc/input.h
@@ -41,6 +41,9 @@ typedef struct GTY (())
int line;
int column;
+
+ /* In a system header?. */
+ bool sysp;
} expanded_location;
extern expanded_location expand_location (source_location);
@@ -59,5 +62,7 @@ extern location_t input_location;
#define input_line LOCATION_LINE (input_location)
#define input_filename LOCATION_FILE (input_location)
+#define in_system_header_at(LOC) ((expand_location (LOC)).sysp != 0)
+#define in_system_header (in_system_header_at (input_location))
#endif
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 505f17d101c..92d12c44d91 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -183,6 +183,18 @@ ipcp_lat_is_const (struct ipcp_lattice *lat)
return false;
}
+/* 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)
+{
+ if ((lat->type == IPA_CONST_VALUE || lat->type == IPA_CONST_VALUE_REF)
+ && !POINTER_TYPE_P (TREE_TYPE (lat->constant)))
+ return true;
+ else
+ return false;
+}
+
/* Return true if LAT1 and LAT2 are equal. */
static inline bool
ipcp_lats_are_equal (struct ipcp_lattice *lat1, struct ipcp_lattice *lat2)
@@ -247,9 +259,7 @@ static void
ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
struct ipa_jump_func *jfunc)
{
- if (jfunc->type == IPA_UNKNOWN)
- lat->type = IPA_BOTTOM;
- else if (jfunc->type == IPA_CONST)
+ if (jfunc->type == IPA_CONST)
{
lat->type = IPA_CONST_VALUE;
lat->constant = jfunc->value.constant;
@@ -267,6 +277,8 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
lat->type = caller_lat->type;
lat->constant = caller_lat->constant;
}
+ else
+ lat->type = IPA_BOTTOM;
}
/* True when OLD and NEW values are not the same. */
@@ -303,17 +315,18 @@ ipcp_print_all_lattices (FILE * f)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
+
+ fprintf (f, " param [%d]: ", i);
if (lat->type == IPA_CONST_VALUE || lat->type == IPA_CONST_VALUE_REF)
{
- fprintf (f, " param [%d]: ", i);
fprintf (f, "type is CONST ");
print_generic_expr (f, lat->constant, 0);
fprintf (f, "\n");
}
else if (lat->type == IPA_TOP)
- fprintf (f, "param [%d]: type is TOP \n", i);
+ fprintf (f, "type is TOP\n");
else
- fprintf (f, "param [%d]: type is BOTTOM \n", i);
+ fprintf (f, "type is BOTTOM\n");
}
}
}
@@ -551,58 +564,6 @@ ipcp_node_not_modifiable_p (struct cgraph_node *node)
return false;
}
-/* Print ipa_jump_func data structures to F. */
-static void
-ipcp_print_all_jump_functions (FILE * f)
-{
- struct cgraph_node *node;
- int i, count;
- struct cgraph_edge *cs;
- struct ipa_jump_func *jump_func;
- enum jump_func_type type;
- tree info_type;
-
- fprintf (f, "\nCALLSITE PARAM PRINT\n");
- for (node = cgraph_nodes; node; node = node->next)
- {
- if (!node->analyzed)
- continue;
-
- for (cs = node->callees; cs; cs = cs->next_callee)
- {
- fprintf (f, "callsite %s ", cgraph_node_name (node));
- fprintf (f, "-> %s :: \n", cgraph_node_name (cs->callee));
-
- if (!ipa_edge_args_info_available_for_edge_p (cs)
- || ipa_is_called_with_var_arguments (IPA_NODE_REF (cs->callee)))
- continue;
-
- count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
- for (i = 0; i < count; i++)
- {
- jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
- type = jump_func->type;
-
- fprintf (f, " param %d: ", i);
- if (type == IPA_UNKNOWN)
- fprintf (f, "UNKNOWN\n");
- else if (type == IPA_CONST || type == IPA_CONST_REF)
- {
- info_type = jump_func->value.constant;
- fprintf (f, "CONST : ");
- print_generic_expr (f, info_type, 0);
- fprintf (f, "\n");
- }
- else if (type == IPA_PASS_THROUGH)
- {
- fprintf (f, "PASS THROUGH : ");
- fprintf (f, "%d\n", jump_func->value.formal_id);
- }
- }
- }
- }
-}
-
/* Print count scale data structures. */
static void
ipcp_function_scale_print (FILE * f)
@@ -664,7 +625,7 @@ ipcp_print_edge_profiles (FILE * f)
for (node = cgraph_nodes; node; node = node->next)
{
fprintf (f, "function %s: \n", cgraph_node_name (node));
- if (DECL_SAVED_TREE (node->decl))
+ if (node->analyzed)
{
bb =
ENTRY_BLOCK_PTR_FOR_FUNCTION (DECL_STRUCT_FUNCTION (node->decl));
@@ -751,8 +712,8 @@ ipcp_print_all_structures (FILE * f)
ipcp_print_all_lattices (f);
ipcp_function_scale_print (f);
ipa_print_all_tree_maps (f);
- ipa_print_all_params_modified (f);
- ipcp_print_all_jump_functions (f);
+ ipa_print_all_param_flags (f);
+ ipa_print_all_jump_functions (f);
}
/* Print profile info for all functions. */
@@ -781,10 +742,8 @@ ipcp_create_replace_map (struct function *func, tree parm_tree,
tree const_val;
replace_map = XCNEW (struct ipa_replace_map);
- gcc_assert (ipcp_lat_is_const (lat));
- if (lat->type != IPA_CONST_VALUE_REF
- && is_gimple_reg (parm_tree) && gimple_default_def (func, parm_tree)
- && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_default_def (func,
+ if (is_gimple_reg (parm_tree) && gimple_default_def (func, parm_tree)
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_default_def (func,
parm_tree)))
{
if (dump_file)
@@ -944,7 +903,7 @@ ipcp_insert_stage (void)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (ipcp_lat_is_const (lat))
+ if (ipcp_lat_is_insertable (lat))
const_param++;
}
if (const_param == 0)
@@ -953,7 +912,8 @@ ipcp_insert_stage (void)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (ipcp_lat_is_const (lat))
+ if (lat->type == IPA_CONST_VALUE
+ && !POINTER_TYPE_P (TREE_TYPE (lat->constant)))
{
parm_tree = ipa_get_ith_param (info, i);
replace_param =
@@ -990,7 +950,7 @@ ipcp_insert_stage (void)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (ipcp_lat_is_const (lat))
+ if (ipcp_lat_is_insertable (lat))
{
parm_tree = ipa_get_ith_param (info, i);
if (lat->type != IPA_CONST_VALUE_REF
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 6d74c1f71b7..6d744c43c85 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -60,7 +60,7 @@ along with GCC; see the file COPYING3. If not see
cgraph_decide_inlining implements heuristics taking whole callgraph
into account, while cgraph_decide_inlining_incrementally considers
- only one function at a time and is used in non-unit-at-a-time mode.
+ only one function at a time and is used by early inliner.
The inliner itself is split into several passes:
@@ -82,15 +82,13 @@ along with GCC; see the file COPYING3. If not see
to do inlining expanding code size it might result in unbounded growth of
whole unit.
- This is the main inlining pass in non-unit-at-a-time.
-
- With unit-at-a-time the pass is run during conversion into SSA form.
- Only functions already converted into SSA form are inlined, so the
- conversion must happen in topological order on the callgraph (that is
- maintained by pass manager). The functions after inlining are early
- optimized so the early inliner sees unoptimized function itself, but
- all considered callees are already optimized allowing it to unfold
- abstraction penalty on C++ effectively and cheaply.
+ The pass is run during conversion into SSA form. Only functions already
+ converted into SSA form are inlined, so the conversion must happen in
+ topological order on the callgraph (that is maintained by pass manager).
+ The functions after inlining are early optimized so the early inliner sees
+ unoptimized function itself, but all considered callees are already
+ optimized allowing it to unfold abstraction penalty on C++ effectively and
+ cheaply.
pass_ipa_early_inlining
@@ -139,6 +137,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "tree-flow.h"
#include "rtl.h"
+#include "ipa-prop.h"
/* Mode incremental inliner operate on:
@@ -149,16 +148,11 @@ along with GCC; see the file COPYING3. If not see
In SIZE mode, only functions that reduce function body size after inlining
are inlined, this is used during early inlining.
- In SPEED mode, all small functions are inlined. This might result in
- unbounded growth of compilation unit and is used only in non-unit-at-a-time
- mode.
-
in ALL mode, everything is inlined. This is used during flattening. */
enum inlining_mode {
INLINE_NONE = 0,
INLINE_ALWAYS_INLINE,
INLINE_SIZE,
- INLINE_SPEED,
INLINE_ALL
};
static bool
@@ -210,8 +204,7 @@ cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, bool update_o
In that case just go ahead and re-use it. */
if (!e->callee->callers->next_caller
&& !e->callee->needed
- && !cgraph_new_nodes
- && flag_unit_at_a_time)
+ && !cgraph_new_nodes)
{
gcc_assert (!e->callee->global.inlined_to);
if (DECL_SAVED_TREE (e->callee->decl))
@@ -261,7 +254,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original)
gcc_assert (e->inline_failed);
e->inline_failed = NULL;
- if (!e->callee->global.inlined && flag_unit_at_a_time)
+ if (!e->callee->global.inlined)
DECL_POSSIBLY_INLINED (e->callee->decl) = true;
e->callee->global.inlined = true;
@@ -660,10 +653,12 @@ lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where,
}
/* Decide on recursive inlining: in the case function has recursive calls,
- inline until body size reaches given argument. */
+ inline until body size reaches given argument. If any new indirect edges
+ are discovered in the process, add them to NEW_EDGES, unless it is NULL. */
static bool
-cgraph_decide_recursive_inlining (struct cgraph_node *node)
+cgraph_decide_recursive_inlining (struct cgraph_node *node,
+ VEC (cgraph_edge_p, heap) *new_edges)
{
int limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO);
int max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO);
@@ -760,6 +755,8 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node)
}
cgraph_redirect_edge_callee (curr, master_clone);
cgraph_mark_inline_edge (curr, false);
+ if (flag_indirect_inlining)
+ ipa_propagate_indirect_call_infos (curr, new_edges);
lookup_recursive_calls (node, curr->callee, heap);
n++;
}
@@ -817,6 +814,20 @@ compute_max_insns (int insns)
* (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100);
}
+/* Compute badness of all edges in NEW_EDGES and add them to the HEAP. */
+static void
+add_new_edges_to_heap (fibheap_t heap, VEC (cgraph_edge_p, heap) *new_edges)
+{
+ while (VEC_length (cgraph_edge_p, new_edges) > 0)
+ {
+ struct cgraph_edge *edge = VEC_pop (cgraph_edge_p, new_edges);
+
+ gcc_assert (!edge->aux);
+ edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge), edge);
+ }
+}
+
+
/* We use greedy algorithm for inlining of small functions:
All inline candidates are put into prioritized heap based on estimated
growth of the overall number of instructions and then update the estimates.
@@ -833,6 +844,10 @@ cgraph_decide_inlining_of_small_functions (void)
fibheap_t heap = fibheap_new ();
bitmap updated_nodes = BITMAP_ALLOC (NULL);
int min_insns, max_insns;
+ VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
+
+ if (flag_indirect_inlining)
+ new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
if (dump_file)
fprintf (dump_file, "\nDeciding on smaller functions:\n");
@@ -954,14 +969,24 @@ cgraph_decide_inlining_of_small_functions (void)
}
continue;
}
+ if (!tree_can_inline_p (edge->caller->decl, edge->callee->decl))
+ {
+ CALL_STMT_CANNOT_INLINE_P (edge->call_stmt) = true;
+ edge->inline_failed = N_("target specific option mismatch");
+ if (dump_file)
+ fprintf (dump_file, " inline_failed:%s.\n", edge->inline_failed);
+ continue;
+ }
if (cgraph_recursive_inlining_p (edge->caller, edge->callee,
&edge->inline_failed))
{
where = edge->caller;
if (where->global.inlined_to)
where = where->global.inlined_to;
- if (!cgraph_decide_recursive_inlining (where))
+ if (!cgraph_decide_recursive_inlining (where, new_indirect_edges))
continue;
+ if (flag_indirect_inlining)
+ add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, where, updated_nodes);
}
else
@@ -978,6 +1003,11 @@ cgraph_decide_inlining_of_small_functions (void)
}
callee = edge->callee;
cgraph_mark_inline_edge (edge, true);
+ if (flag_indirect_inlining)
+ {
+ ipa_propagate_indirect_call_infos (edge, new_indirect_edges);
+ add_new_edges_to_heap (heap, new_indirect_edges);
+ }
update_callee_keys (heap, callee, updated_nodes);
}
where = edge->caller;
@@ -1020,6 +1050,9 @@ cgraph_decide_inlining_of_small_functions (void)
&edge->inline_failed))
edge->inline_failed = N_("--param inline-unit-growth limit reached");
}
+
+ if (new_indirect_edges)
+ VEC_free (cgraph_edge_p, heap, new_indirect_edges);
fibheap_delete (heap);
BITMAP_FREE (updated_nodes);
}
@@ -1098,7 +1131,14 @@ cgraph_decide_inlining (void)
if (cgraph_recursive_inlining_p (e->caller, e->callee,
&e->inline_failed))
continue;
+ if (!tree_can_inline_p (e->caller->decl, e->callee->decl))
+ {
+ CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true;
+ continue;
+ }
cgraph_mark_inline_edge (e, true);
+ if (flag_indirect_inlining)
+ ipa_propagate_indirect_call_infos (e, NULL);
if (dump_file)
fprintf (dump_file,
" Inlined into %s which now has %i insns.\n",
@@ -1120,6 +1160,11 @@ cgraph_decide_inlining (void)
if (!flag_really_no_inline)
cgraph_decide_inlining_of_small_functions ();
+ /* After this point, any edge discovery performed by indirect inlining is no
+ good so let's give up. */
+ if (flag_indirect_inlining)
+ free_all_ipa_structures_after_iinln ();
+
if (!flag_really_no_inline
&& flag_inline_functions_called_once)
{
@@ -1246,13 +1291,13 @@ try_inline (struct cgraph_edge *e, enum inlining_mode mode, int depth)
if (e->inline_failed)
cgraph_mark_inline (e);
- /* In order to fully inline always_inline functions at -O0, we need to
+ /* In order to fully inline always_inline functions, we need to
recurse here, since the inlined functions might not be processed by
incremental inlining at all yet.
Also flattening needs to be done recursively. */
- if (!flag_unit_at_a_time || mode == INLINE_ALL || always_inline)
+ if (mode == INLINE_ALL || always_inline)
cgraph_decide_inlining_incrementally (e->callee, mode, depth + 1);
callee->aux = (void *)(size_t) callee_mode;
return true;
@@ -1322,6 +1367,17 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
continue;
}
+ if (!tree_can_inline_p (node->decl, e->callee->decl))
+ {
+ CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true;
+ if (dump_file)
+ {
+ indent_to (dump_file, depth);
+ fprintf (dump_file,
+ "Not inlining: Target specific option mismatch.\n");
+ }
+ continue;
+ }
if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->decl))
!= gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->callee->decl)))
{
@@ -1418,22 +1474,24 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
continue;
}
+ if (!tree_can_inline_p (node->decl, e->callee->decl))
+ {
+ CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true;
+ if (dump_file)
+ {
+ indent_to (dump_file, depth);
+ fprintf (dump_file,
+ "Not inlining: Target specific option mismatch.\n");
+ }
+ continue;
+ }
if (cgraph_default_inline_p (e->callee, &failed_reason))
inlined |= try_inline (e, mode, depth);
- else if (!flag_unit_at_a_time)
- e->inline_failed = failed_reason;
}
node->aux = (void *)(size_t) old_mode;
return inlined;
}
-/* When inlining shall be performed. */
-static bool
-cgraph_gate_inlining (void)
-{
- return flag_inline_trees;
-}
-
/* Because inlining might remove no-longer reachable nodes, we need to
keep the array visible to garbage collector to avoid reading collected
out nodes. */
@@ -1451,9 +1509,7 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount)
return 0;
- if (cgraph_decide_inlining_incrementally (node,
- flag_unit_at_a_time || optimize_size
- ? INLINE_SIZE : INLINE_SPEED, 0))
+ if (cgraph_decide_inlining_incrementally (node, INLINE_SIZE, 0))
{
timevar_push (TV_INTEGRATION);
todo = optimize_inline_calls (current_function_decl);
@@ -1466,7 +1522,7 @@ cgraph_early_inlining (void)
static bool
cgraph_gate_early_inlining (void)
{
- return flag_inline_trees && flag_early_inlining;
+ return flag_early_inlining;
}
struct gimple_opt_pass pass_early_inline =
@@ -1492,7 +1548,7 @@ struct gimple_opt_pass pass_early_inline =
static bool
cgraph_gate_ipa_early_inlining (void)
{
- return (flag_inline_trees && flag_early_inlining
+ return (flag_early_inlining
&& (flag_branch_probabilities || flag_test_coverage
|| profile_arc_flag));
}
@@ -1551,19 +1607,12 @@ compute_inline_parameters_for_current (void)
return 0;
}
-/* When inlining shall be performed. */
-static bool
-gate_inline_passes (void)
-{
- return flag_inline_trees;
-}
-
struct gimple_opt_pass pass_inline_parameters =
{
{
GIMPLE_PASS,
NULL, /* name */
- gate_inline_passes, /* gate */
+ NULL, /* gate */
compute_inline_parameters_for_current,/* execute */
NULL, /* sub */
NULL, /* next */
@@ -1577,6 +1626,31 @@ struct gimple_opt_pass pass_inline_parameters =
}
};
+/* This function performs intraprocedural analyzis in NODE that is required to
+ inline indirect calls. */
+static void
+inline_indirect_intraprocedural_analysis (struct cgraph_node *node)
+{
+ struct cgraph_edge *cs;
+
+ ipa_count_formal_params (node);
+ ipa_create_param_decls_array (node);
+ ipa_detect_param_modifications (node);
+ ipa_analyze_params_uses (node);
+
+ if (dump_file)
+ ipa_print_node_param_flags (dump_file, node);
+
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ {
+ ipa_count_arguments (cs);
+ ipa_compute_jump_functions (cs);
+ }
+
+ if (dump_file)
+ ipa_print_node_jump_functions (dump_file, node);
+}
+
/* Note function body size. */
static void
inline_generate_summary (void)
@@ -1586,6 +1660,13 @@ inline_generate_summary (void)
int nnodes = cgraph_postorder (order);
int i;
+ if (flag_indirect_inlining)
+ {
+ ipa_register_cgraph_hooks ();
+ ipa_check_create_node_params ();
+ ipa_check_create_edge_args ();
+ }
+
for (i = nnodes - 1; i >= 0; i--)
{
struct cgraph_node *node = order[i];
@@ -1597,6 +1678,10 @@ inline_generate_summary (void)
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
current_function_decl = node->decl;
compute_inline_parameters (node);
+
+ if (flag_indirect_inlining)
+ inline_indirect_intraprocedural_analysis (node);
+
pop_cfun ();
}
}
@@ -1635,7 +1720,7 @@ struct ipa_opt_pass pass_ipa_inline =
{
IPA_PASS,
"inline", /* name */
- cgraph_gate_inlining, /* gate */
+ NULL, /* gate */
cgraph_decide_inlining, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -1658,62 +1743,4 @@ struct ipa_opt_pass pass_ipa_inline =
};
-/* When inlining shall be performed. */
-static bool
-cgraph_gate_O0_always_inline (void)
-{
- return !flag_unit_at_a_time || !flag_inline_trees;
-}
-
-static unsigned int
-cgraph_O0_always_inline (void)
-{
- struct cgraph_node *node = cgraph_node (current_function_decl);
- unsigned int todo = 0;
- bool inlined;
-
- if (sorrycount || errorcount)
- return 0;
- inlined = cgraph_decide_inlining_incrementally (node, INLINE_SPEED, 0);
- /* We might need the body of this function so that we can expand
- it inline somewhere else. */
- if (cgraph_preserve_function_body_p (current_function_decl))
- save_inline_function_body (node);
- if (inlined || warn_inline)
- {
- timevar_push (TV_INTEGRATION);
- todo = optimize_inline_calls (current_function_decl);
- timevar_pop (TV_INTEGRATION);
- }
- /* In non-unit-at-a-time we must mark all referenced functions as needed. */
- if (!flag_unit_at_a_time)
- {
- struct cgraph_edge *e;
- for (e = node->callees; e; e = e->next_callee)
- if (e->callee->analyzed)
- cgraph_mark_needed_node (e->callee);
- }
- return todo | execute_fixup_cfg ();
-}
-
-struct gimple_opt_pass pass_O0_always_inline =
-{
- {
- GIMPLE_PASS,
- "always_inline", /* name */
- cgraph_gate_O0_always_inline, /* gate */
- cgraph_O0_always_inline, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_INLINE_HEURISTICS, /* tv_id */
- 0, /* properties_required */
- PROP_cfg, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
-};
-
#include "gt-ipa-inline.h"
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index ff833d77f23..c87a5777b1b 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "timevar.h"
#include "flags.h"
+#include "diagnostic.h"
/* Vector where the parameter infos are actually stored. */
VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
@@ -117,6 +118,9 @@ ipa_create_param_decls_array (struct cgraph_node *mt)
int param_num;
struct ipa_node_params *info = IPA_NODE_REF (mt);
+ if (info->param_decls)
+ return;
+
info->param_decls = XCNEWVEC (tree, ipa_get_param_count (info));
fndecl = mt->decl;
fnargs = DECL_ARGUMENTS (fndecl);
@@ -146,95 +150,84 @@ ipa_count_formal_params (struct cgraph_node *mt)
ipa_set_param_count (IPA_NODE_REF (mt), param_num);
}
-/* Check STMT to detect whether a formal is modified within MT, the appropriate
- entry is updated in the modified_flags array of ipa_node_params (associated
- with MT). */
+/* Check STMT to detect whether a formal parameter is directly modified within
+ STMT, the appropriate entry is updated in the modified flags of INFO.
+ Directly means that this function does not check for modifications through
+ pointers or escaping addresses because all TREE_ADDRESSABLE parameters are
+ considered modified anyway. */
static void
-ipa_check_stmt_modifications (struct cgraph_node *mt, tree stmt)
+ipa_check_stmt_modifications (struct ipa_node_params *info, tree stmt)
{
- int index, j;
- tree parm_decl;
- struct ipa_node_params *info;
+ int j;
+ int index;
+ tree lhs;
switch (TREE_CODE (stmt))
{
case GIMPLE_MODIFY_STMT:
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == PARM_DECL)
- {
- info = IPA_NODE_REF (mt);
- parm_decl = GIMPLE_STMT_OPERAND (stmt, 0);
- index = ipa_get_param_decl_index (info, parm_decl);
- if (index >= 0)
- info->modified_flags[index] = true;
- }
+ lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+
+ while (handled_component_p (lhs))
+ lhs = TREE_OPERAND (lhs, 0);
+ if (TREE_CODE (lhs) == SSA_NAME)
+ lhs = SSA_NAME_VAR (lhs);
+ index = ipa_get_param_decl_index (info, lhs);
+ if (index >= 0)
+ info->param_flags[index].modified = true;
break;
+
case ASM_EXPR:
/* Asm code could modify any of the parameters. */
- info = IPA_NODE_REF (mt);
- for (j = 0; j < ipa_get_param_count (IPA_NODE_REF (mt)); j++)
- info->modified_flags[j] = true;
+ for (j = 0; j < ipa_get_param_count (info); j++)
+ info->param_flags[j].modified = true;
break;
+
default:
break;
}
}
-/* The modify computation driver for MT. Compute which formal arguments
- of function MT are locally modified. Formals may be modified in MT
- if their address is taken, or if
- they appear on the left hand side of an assignment. */
+/* Compute which formal parameters of function associated with NODE are locally
+ modified. Parameters may be modified in NODE if they are TREE_ADDRESSABLE,
+ if they appear on the left hand side of an assignment or if there is an
+ ASM_EXPR in the function. */
void
-ipa_detect_param_modifications (struct cgraph_node *mt)
+ipa_detect_param_modifications (struct cgraph_node *node)
{
- tree decl;
- tree body;
- int j, count;
+ tree decl = node->decl;
basic_block bb;
struct function *func;
block_stmt_iterator bsi;
- tree stmt, parm_tree;
- struct ipa_node_params *info = IPA_NODE_REF (mt);
+ tree stmt;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int i, count;
- if (ipa_get_param_count (info) == 0 || info->modified_flags)
+ if (ipa_get_param_count (info) == 0 || info->modification_analysis_done)
return;
- count = ipa_get_param_count (info);
- info->modified_flags = XCNEWVEC (bool, count);
- decl = mt->decl;
- /* ??? Handle pending sizes case. Set all parameters
- of the function to be modified. */
+ if (!info->param_flags)
+ info->param_flags = XCNEWVEC (struct ipa_param_flags,
+ ipa_get_param_count (info));
- if (DECL_UNINLINABLE (decl))
- {
- for (j = 0; j < count; j++)
- info->modified_flags[j] = true;
-
- return;
- }
- /* Formals whose address is taken are considered modified. */
- for (j = 0; j < count; j++)
- {
- parm_tree = ipa_get_ith_param (info, j);
- if (!is_gimple_reg (parm_tree)
- && TREE_ADDRESSABLE (parm_tree))
- info->modified_flags[j] = true;
- }
- body = DECL_SAVED_TREE (decl);
- if (body != NULL)
+ func = DECL_STRUCT_FUNCTION (decl);
+ FOR_EACH_BB_FN (bb, func)
{
- func = DECL_STRUCT_FUNCTION (decl);
- FOR_EACH_BB_FN (bb, func)
- {
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- stmt = bsi_stmt (bsi);
- ipa_check_stmt_modifications (mt, stmt);
- }
- }
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ stmt = bsi_stmt (bsi);
+ ipa_check_stmt_modifications (info, stmt);
+ }
}
+
+ count = ipa_get_param_count (info);
+ for (i = 0; i < count; i++)
+ if (TREE_ADDRESSABLE (ipa_get_ith_param (info, i)))
+ info->param_flags[i].modified = true;
+
+ info->modification_analysis_done = 1;
}
-/* Count number of arguments callsite CS has and store it in
+/* Count number of arguments callsite CS has and store it in
ipa_edge_args structure corresponding to this callsite. */
void
ipa_count_arguments (struct cgraph_edge *cs)
@@ -248,91 +241,780 @@ ipa_count_arguments (struct cgraph_edge *cs)
ipa_set_cs_argument_count (IPA_EDGE_REF (cs), arg_num);
}
-/* Compute jump function for all arguments of callsite CS
- and insert the information in the jump_functions array
- in the ipa_edge_args corresponding to this callsite. */
+/* The following function prints the jump functions of all arguments on all
+ call graph edges going from NODE to file F. */
void
-ipa_compute_jump_functions (struct cgraph_edge *cs)
+ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node)
{
- tree call_tree;
- tree arg, cst_decl;
- int arg_num;
- struct cgraph_node *mt;
- tree parm_decl;
- struct function *curr_cfun;
- call_expr_arg_iterator iter;
- struct ipa_edge_args *args = IPA_EDGE_REF (cs);
+ int i, count;
+ struct cgraph_edge *cs;
+ struct ipa_jump_func *jump_func;
+ enum jump_func_type type;
- if (ipa_get_cs_argument_count (args) == 0 || args->jump_functions)
- return;
- args->jump_functions = XCNEWVEC (struct ipa_jump_func,
- ipa_get_cs_argument_count (args));
- call_tree = get_call_expr_in (cs->call_stmt);
- gcc_assert (TREE_CODE (call_tree) == CALL_EXPR);
- arg_num = 0;
+ fprintf (f, "JUMP FUNCTIONS OF CALLER %s:\n", cgraph_node_name (node));
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ {
+ if (!ipa_edge_args_info_available_for_edge_p (cs))
+ continue;
+
+ fprintf (f, "callsite %s ", cgraph_node_name (node));
+ fprintf (f, "-> %s :: \n", cgraph_node_name (cs->callee));
- FOR_EACH_CALL_EXPR_ARG (arg, iter, call_tree)
+ count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
+ for (i = 0; i < count; i++)
+ {
+ jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ type = jump_func->type;
+
+ fprintf (f, " param %d: ", i);
+ if (type == IPA_UNKNOWN)
+ fprintf (f, "UNKNOWN\n");
+ else if (type == IPA_CONST || type == IPA_CONST_REF)
+ {
+ tree val = jump_func->value.constant;
+ fprintf (f, "CONST: ");
+ print_generic_expr (f, val, 0);
+ fprintf (f, "\n");
+ }
+ else if (type == IPA_CONST_MEMBER_PTR)
+ {
+ fprintf (f, "CONST MEMBER PTR: ");
+ print_generic_expr (f, jump_func->value.member_cst.pfn, 0);
+ fprintf (f, ", ");
+ print_generic_expr (f, jump_func->value.member_cst.delta, 0);
+ fprintf (f, "\n");
+ }
+ else if (type == IPA_PASS_THROUGH)
+ {
+ fprintf (f, "PASS THROUGH: ");
+ fprintf (f, "%d\n", jump_func->value.formal_id);
+ }
+ }
+ }
+}
+
+/* Print ipa_jump_func data structures of all nodes in the call graph to F. */
+void
+ipa_print_all_jump_functions (FILE *f)
+{
+ struct cgraph_node *node;
+
+ fprintf (f, "\nCALLSITE PARAM PRINT\n");
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ ipa_print_node_jump_functions (f, node);
+ }
+}
+
+/* The following function determines the jump functions of scalar arguments.
+ Scalar means SSA names and constants of a number of selected types. INFO is
+ the ipa_node_params structure associated with the caller, FUNCTIONS is a
+ pointer to an array of jump function structures associated with CALL which
+ is the call statement being examined.*/
+static void
+compute_scalar_jump_functions (struct ipa_node_params *info,
+ struct ipa_jump_func *functions,
+ tree call)
+{
+ call_expr_arg_iterator iter;
+ tree arg;
+ int num = 0;
+
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
{
- /* If the formal parameter was passed as argument, we store
- IPA_PASS_THROUGH and its index in the caller as the jump function
- of this argument. */
- if ((TREE_CODE (arg) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
- || TREE_CODE (arg) == PARM_DECL)
+ if (TREE_CODE (arg) == INTEGER_CST
+ || TREE_CODE (arg) == REAL_CST
+ || TREE_CODE (arg) == FIXED_CST)
{
- struct ipa_node_params *info;
- int index;
-
- mt = cs->caller;
- info = IPA_NODE_REF (mt);
- parm_decl = TREE_CODE (arg) == PARM_DECL ? arg : SSA_NAME_VAR (arg);
-
- index = ipa_get_param_decl_index (info, parm_decl);
- if (TREE_CODE (arg) == SSA_NAME && IS_VALID_JUMP_FUNC_INDEX (index))
+ functions[num].type = IPA_CONST;
+ functions[num].value.constant = arg;
+ }
+ else if (TREE_CODE (arg) == ADDR_EXPR)
+ {
+ if (TREE_CODE (TREE_OPERAND (arg, 0)) == FUNCTION_DECL)
{
- curr_cfun = DECL_STRUCT_FUNCTION (mt->decl);
- if (!gimple_default_def (curr_cfun, parm_decl)
- || gimple_default_def (curr_cfun, parm_decl) != arg)
- info->modified_flags[index] = true;
+ functions[num].type = IPA_CONST;
+ functions[num].value.constant = TREE_OPERAND (arg, 0);
}
- if (!IS_VALID_JUMP_FUNC_INDEX (index) || info->modified_flags[index])
- args->jump_functions[arg_num].type = IPA_UNKNOWN;
- else
+ else if (TREE_CODE (TREE_OPERAND (arg, 0)) == CONST_DECL)
+ {
+ tree cst_decl = TREE_OPERAND (arg, 0);
+
+ if (TREE_CODE (DECL_INITIAL (cst_decl)) == INTEGER_CST
+ || TREE_CODE (DECL_INITIAL (cst_decl)) == REAL_CST
+ || TREE_CODE (DECL_INITIAL (cst_decl)) == FIXED_CST)
+ {
+ functions[num].type = IPA_CONST_REF;
+ functions[num].value.constant = cst_decl;
+ }
+ }
+ }
+ else if ((TREE_CODE (arg) == SSA_NAME) && SSA_NAME_IS_DEFAULT_DEF (arg))
+ {
+ int index = ipa_get_param_decl_index (info, SSA_NAME_VAR (arg));
+
+ if (index >= 0)
{
- args->jump_functions[arg_num].type = IPA_PASS_THROUGH;
- args->jump_functions[arg_num].value.formal_id = index;
+ functions[num].type = IPA_PASS_THROUGH;
+ functions[num].value.formal_id = index;
}
}
- /* If a constant value was passed as argument,
- we store IPA_CONST and its value as the jump function
- of this argument. */
- else if (TREE_CODE (arg) == INTEGER_CST
- || TREE_CODE (arg) == REAL_CST
- || TREE_CODE (arg) == FIXED_CST)
+
+ num++;
+ }
+}
+
+/* This function inspects the given TYPE and returns true iff it has the same
+ structure (the same number of fields of the same types) as a C++ member
+ pointer. If METHOD_PTR and DELTA are non-NULL, the trees representing the
+ corresponding fields are stored there. */
+static bool
+type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
+{
+ tree fld;
+
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return false;
+
+ fld = TYPE_FIELDS (type);
+ if (!fld || !POINTER_TYPE_P (TREE_TYPE (fld))
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (fld))) != METHOD_TYPE)
+ return false;
+
+ if (method_ptr)
+ *method_ptr = fld;
+
+ fld = TREE_CHAIN (fld);
+ if (!fld || INTEGRAL_TYPE_P (fld))
+ return false;
+ if (delta)
+ *delta = fld;
+
+ if (TREE_CHAIN (fld))
+ return false;
+
+ return true;
+}
+
+/* This function goes through arguments of the CALL and for every one that
+ looks like a member pointer, it checks whether it can be safely declared
+ pass-through and if so, marks that to the corresponding item of jum
+ FUNCTIONS . It returns true iff there were non-pass-through member pointers
+ within the arguments. INFO describes formal parameters of the caller. */
+static bool
+compute_pass_through_member_ptrs (struct ipa_node_params *info,
+ struct ipa_jump_func *functions,
+ tree call)
+{
+ call_expr_arg_iterator iter;
+ bool undecided_members = false;
+ int num = 0;
+ tree arg;
+
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
+ {
+ if (type_like_member_ptr_p (TREE_TYPE (arg), NULL, NULL))
{
- args->jump_functions[arg_num].type = IPA_CONST;
- args->jump_functions[arg_num].value.constant = arg;
+ if (TREE_CODE (arg) == PARM_DECL)
+ {
+ int index = ipa_get_param_decl_index (info, arg);
+
+ gcc_assert (index >=0);
+ if (!ipa_is_ith_param_modified (info, index))
+ {
+ functions[num].type = IPA_PASS_THROUGH;
+ functions[num].value.formal_id = index;
+ }
+ else
+ undecided_members = true;
+ }
+ else
+ undecided_members = true;
}
- /* This is for the case of Fortran. If the address of a const_decl
- was passed as argument then we store
- IPA_CONST_REF/IPA_CONST_REF and the constant
- value as the jump function corresponding to this argument. */
- else if (TREE_CODE (arg) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (arg, 0)) == CONST_DECL)
+
+ num++;
+ }
+
+ return undecided_members;
+}
+
+/* Simple function filling in a member pointer constant jump function (with PFN
+ and DELTA as the constant value) into JFUNC. */
+static void
+fill_member_ptr_cst_jump_function (struct ipa_jump_func *jfunc,
+ tree pfn, tree delta)
+{
+ jfunc->type = IPA_CONST_MEMBER_PTR;
+ jfunc->value.member_cst.pfn = pfn;
+ jfunc->value.member_cst.delta = delta;
+}
+
+/* Traverse statements from CALL_STMT backwards, scanning whether the argument
+ ARG which is a member pointer is filled in with constant values. If it is,
+ fill the jump function JFUNC in appropriately. METHOD_FIELD and DELTA_FIELD
+ are fields of the record type of the member pointer. To give an example, we
+ look for a pattern looking like the following:
+
+ D.2515.__pfn ={v} printStuff;
+ D.2515.__delta ={v} 0;
+ i_1 = doprinting (D.2515); */
+static void
+determine_cst_member_ptr (tree call_stmt, tree arg, tree method_field,
+ tree delta_field, struct ipa_jump_func *jfunc)
+{
+ block_stmt_iterator bsi;
+ tree method = NULL_TREE;
+ tree delta = NULL_TREE;
+
+ bsi = bsi_for_stmt (call_stmt);
+
+ bsi_prev (&bsi);
+ for (; !bsi_end_p (bsi); bsi_prev (&bsi))
+ {
+ tree stmt = bsi_stmt (bsi);
+ tree lhs, rhs, fld;
+
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ return;
+
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ if (TREE_CODE (rhs) == CALL_EXPR)
+ return;
+
+ lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+
+ if (TREE_CODE (lhs) != COMPONENT_REF
+ || TREE_OPERAND (lhs, 0) != arg)
+ continue;
+
+ fld = TREE_OPERAND (lhs, 1);
+ if (!method && fld == method_field)
{
- cst_decl = TREE_OPERAND (arg, 0);
- if (TREE_CODE (DECL_INITIAL (cst_decl)) == INTEGER_CST
- || TREE_CODE (DECL_INITIAL (cst_decl)) == REAL_CST
- || TREE_CODE (DECL_INITIAL (cst_decl)) == FIXED_CST)
+ if (TREE_CODE (rhs) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == FUNCTION_DECL
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (rhs, 0))) == METHOD_TYPE)
{
- args->jump_functions[arg_num].type = IPA_CONST_REF;
- args->jump_functions[arg_num].value.constant = cst_decl;
+ method = TREE_OPERAND (rhs, 0);
+ if (delta)
+ {
+ fill_member_ptr_cst_jump_function (jfunc, method, delta);
+ return;
+ }
}
+ else
+ return;
+ }
+
+ if (!delta && fld == delta_field)
+ {
+ if (TREE_CODE (rhs) == INTEGER_CST)
+ {
+ delta = rhs;
+ if (method)
+ {
+ fill_member_ptr_cst_jump_function (jfunc, method, delta);
+ return;
+ }
+ }
+ else
+ return;
+ }
+ }
+
+ return;
+}
+
+/* Go through the arguments of the call in CALL_STMT and for every member
+ pointer within tries determine whether it is a constant. If it is, create a
+ corresponding constant jump function in FUNCTIONS which is an array of jump
+ functions associated with the call. */
+static void
+compute_cst_member_ptr_arguments (struct ipa_jump_func *functions,
+ tree call_stmt)
+{
+ call_expr_arg_iterator iter;
+ int num = 0;
+ tree call = get_call_expr_in (call_stmt);
+ tree arg, method_field, delta_field;
+
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
+ {
+ if (functions[num].type == IPA_UNKNOWN
+ && type_like_member_ptr_p (TREE_TYPE (arg), &method_field,
+ &delta_field))
+ determine_cst_member_ptr (call_stmt, arg, method_field,
+ delta_field, &functions[num]);
+
+ num++;
+ }
+}
+
+/* Compute jump function for all arguments of callsite CS and insert the
+ information in the jump_functions array in the ipa_edge_args corresponding
+ to this callsite. */
+void
+ipa_compute_jump_functions (struct cgraph_edge *cs)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (cs->caller);
+ struct ipa_edge_args *arguments = IPA_EDGE_REF (cs);
+ tree call;
+
+ if (ipa_get_cs_argument_count (arguments) == 0 || arguments->jump_functions)
+ return;
+ arguments->jump_functions = XCNEWVEC (struct ipa_jump_func,
+ ipa_get_cs_argument_count (arguments));
+ call = get_call_expr_in (cs->call_stmt);
+
+ /* We will deal with constants and SSA scalars first: */
+ compute_scalar_jump_functions (info, arguments->jump_functions, call);
+
+ /* Let's check whether there are any potential member pointers and if so,
+ whether we can determine their functions as pass_through. */
+ if (!compute_pass_through_member_ptrs (info, arguments->jump_functions, call))
+ return;
+
+ /* Finally, let's check whether we actually pass a new constant membeer
+ pointer here... */
+ compute_cst_member_ptr_arguments (arguments->jump_functions, cs->call_stmt);
+}
+
+/* If RHS looks like a rhs of a statement loading pfn from a member pointer
+ formal parameter, return the parameter, otherwise return NULL. */
+static tree
+ipa_get_member_ptr_load_param (tree rhs)
+{
+ tree rec, fld;
+ tree ptr_field;
+
+ if (TREE_CODE (rhs) != COMPONENT_REF)
+ return NULL_TREE;
+
+ rec = TREE_OPERAND (rhs, 0);
+ if (TREE_CODE (rec) != PARM_DECL
+ || !type_like_member_ptr_p (TREE_TYPE (rec), &ptr_field, NULL))
+ return NULL_TREE;
+
+ fld = TREE_OPERAND (rhs, 1);
+ if (fld == ptr_field)
+ return rec;
+ else
+ return NULL_TREE;
+}
+
+/* If STMT looks like a statement loading a value from a member pointer formal
+ parameter, this function retuns that parameter. */
+static tree
+ipa_get_stmt_member_ptr_load_param (tree stmt)
+{
+ tree rhs;
+
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ return NULL_TREE;
+
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ return ipa_get_member_ptr_load_param (rhs);
+}
+
+/* Returns true iff T is an SSA_NAME defined by a statement. */
+static bool
+ipa_is_ssa_with_stmt_def (tree t)
+{
+ if (TREE_CODE (t) == SSA_NAME
+ && !SSA_NAME_IS_DEFAULT_DEF (t))
+ return true;
+ else
+ return false;
+}
+
+/* Creates a new note describing a call to a parameter number FORMAL_ID and
+ attaches it to the linked list of INFO. It also sets the called flag of the
+ parameter. STMT is the corresponding call statement. */
+static void
+ipa_note_param_call (struct ipa_node_params *info, int formal_id,
+ tree stmt)
+{
+ struct ipa_param_call_note *note;
+ basic_block bb = bb_for_stmt (stmt);
+
+ info->param_flags[formal_id].called = 1;
+
+ note = XCNEW (struct ipa_param_call_note);
+ note->formal_id = formal_id;
+ note->stmt = stmt;
+ note->count = bb->count;
+ note->frequency = compute_call_stmt_bb_frequency (bb);
+
+ note->next = info->param_calls;
+ info->param_calls = note;
+
+ return;
+}
+
+/* Analyze the CALL (which itself must be a part of statement STMT) and examine
+ uses of formal parameters of the caller (described by INFO). Currently it
+ checks whether the call calls a pointer that is a formal parameter and if
+ so, the parameter is marked with the called flag and a note describing the
+ call is created. This is very simple for ordinary pointers represented in
+ SSA but not-so-nice when it comes to member pointers. The ugly part of this
+ function does nothing more than tries to match the pattern of such a call.
+ An example of such a pattern is the gimple dump below, the call is on the
+ last line:
+
+ <bb 2>:
+ f$__delta_5 = f.__delta;
+ f$__pfn_24 = f.__pfn;
+ D.2496_3 = (int) f$__pfn_24;
+ D.2497_4 = D.2496_3 & 1;
+ if (D.2497_4 != 0)
+ goto <bb 3>;
+ else
+ goto <bb 4>;
+
+ <bb 3>:
+ D.2500_7 = (unsigned int) f$__delta_5;
+ D.2501_8 = &S + D.2500_7;
+ D.2502_9 = (int (*__vtbl_ptr_type) (void) * *) D.2501_8;
+ D.2503_10 = *D.2502_9;
+ D.2504_12 = f$__pfn_24 + -1;
+ D.2505_13 = (unsigned int) D.2504_12;
+ D.2506_14 = D.2503_10 + D.2505_13;
+ D.2507_15 = *D.2506_14;
+ iftmp.11_16 = (String:: *) D.2507_15;
+
+ <bb 4>:
+ # iftmp.11_1 = PHI <iftmp.11_16(3), f$__pfn_24(2)>
+ D.2500_19 = (unsigned int) f$__delta_5;
+ D.2508_20 = &S + D.2500_19;
+ D.2493_21 = iftmp.11_1 (D.2508_20, 4);
+
+ Such patterns are results of simple calls to a member pointer:
+
+ int doprinting (int (MyString::* f)(int) const)
+ {
+ MyString S ("somestring");
+
+ return (S.*f)(4);
+ }
+*/
+
+static void
+ipa_analyze_call_uses (struct ipa_node_params *info, tree call, tree stmt)
+{
+ tree target = CALL_EXPR_FN (call);
+ tree var, def;
+ tree n1, n2;
+ tree d1, d2;
+ tree rec, rec2;
+ tree branch, cond;
+ int index;
+
+ basic_block bb, virt_bb, join;
+
+ if (TREE_CODE (target) != SSA_NAME)
+ return;
+
+ var = SSA_NAME_VAR (target);
+ if (SSA_NAME_IS_DEFAULT_DEF (target))
+ {
+ /* assuming TREE_CODE (var) == PARM_DECL */
+ index = ipa_get_param_decl_index (info, var);
+ if (index >= 0)
+ ipa_note_param_call (info, index, stmt);
+ return;
+ }
+
+ /* Now we need to try to match the complex pattern of calling a member
+ pointer. */
+
+ if (!POINTER_TYPE_P (TREE_TYPE (target))
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (target))) != METHOD_TYPE)
+ return;
+
+ def = SSA_NAME_DEF_STMT (target);
+ if (TREE_CODE (def) != PHI_NODE)
+ return;
+
+ if (PHI_NUM_ARGS (def) != 2)
+ return;
+
+ /* First, we need to check whether one of these is a load from a member
+ pointer that is a parameter to this function. */
+ n1 = PHI_ARG_DEF (def, 0);
+ n2 = PHI_ARG_DEF (def, 1);
+ if (!ipa_is_ssa_with_stmt_def (n1) || !ipa_is_ssa_with_stmt_def (n2))
+ return;
+ d1 = SSA_NAME_DEF_STMT (n1);
+ d2 = SSA_NAME_DEF_STMT (n2);
+
+ if ((rec = ipa_get_stmt_member_ptr_load_param (d1)))
+ {
+ if (ipa_get_stmt_member_ptr_load_param (d2))
+ return;
+
+ bb = bb_for_stmt (d1);
+ virt_bb = bb_for_stmt (d2);
+ }
+ else if ((rec = ipa_get_stmt_member_ptr_load_param (d2)))
+ {
+ bb = bb_for_stmt (d2);
+ virt_bb = bb_for_stmt (d1);
+ }
+ else
+ return;
+
+ /* Second, we need to check that the basic blocks are laid out in the way
+ corresponding to the pattern. */
+
+ join = bb_for_stmt (def);
+ if (!single_pred_p (virt_bb) || !single_succ_p (virt_bb)
+ || single_pred (virt_bb) != bb
+ || single_succ (virt_bb) != join)
+ return;
+
+ /* Third, let's see that the branching is done depending on the least
+ significant bit of the pfn. */
+
+ branch = last_stmt (bb);
+ if (TREE_CODE (branch) != COND_EXPR)
+ return;
+
+ cond = TREE_OPERAND (branch, 0);
+ if (TREE_CODE (cond) != NE_EXPR
+ || !integer_zerop (TREE_OPERAND (cond, 1)))
+ return;
+ cond = TREE_OPERAND (cond, 0);
+
+ if (!ipa_is_ssa_with_stmt_def (cond))
+ return;
+
+ cond = SSA_NAME_DEF_STMT (cond);
+ if (TREE_CODE (cond) != GIMPLE_MODIFY_STMT)
+ return;
+ cond = GIMPLE_STMT_OPERAND (cond, 1);
+ if (TREE_CODE (cond) != BIT_AND_EXPR
+ || !integer_onep (TREE_OPERAND (cond, 1)))
+ return;
+ cond = TREE_OPERAND (cond, 0);
+ if (!ipa_is_ssa_with_stmt_def (cond))
+ return;
+
+ cond = SSA_NAME_DEF_STMT (cond);
+ if (TREE_CODE (cond) != GIMPLE_MODIFY_STMT)
+ return;
+ cond = GIMPLE_STMT_OPERAND (cond, 1);
+
+ if (TREE_CODE (cond) == NOP_EXPR)
+ {
+ cond = TREE_OPERAND (cond, 0);
+ if (!ipa_is_ssa_with_stmt_def (cond))
+ return;
+ cond = SSA_NAME_DEF_STMT (cond);
+ if (TREE_CODE (cond) != GIMPLE_MODIFY_STMT)
+ return;
+ cond = GIMPLE_STMT_OPERAND (cond, 1);
+ }
+
+ rec2 = ipa_get_member_ptr_load_param (cond);
+ if (rec != rec2)
+ return;
+
+ index = ipa_get_param_decl_index (info, rec);
+ if (index >= 0 && !ipa_is_ith_param_modified (info, index))
+ ipa_note_param_call (info, index, stmt);
+
+ return;
+}
+
+/* Analyze the statement STMT with respect to formal parameters (described in
+ INFO) and their uses. Currently it only checks whether formal parameters
+ are called. */
+static void
+ipa_analyze_stmt_uses (struct ipa_node_params *info, tree stmt)
+{
+ tree call = get_call_expr_in (stmt);
+
+ if (call)
+ ipa_analyze_call_uses (info, call, stmt);
+}
+
+/* Scan the function body of NODE and inspect the uses of formal parameters.
+ Store the findings in various structures of the associated ipa_node_params
+ structure, such as parameter flags, notes etc. */
+void
+ipa_analyze_params_uses (struct cgraph_node *node)
+{
+ tree decl = node->decl;
+ basic_block bb;
+ struct function *func;
+ block_stmt_iterator bsi;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+
+ if (ipa_get_param_count (info) == 0 || info->uses_analysis_done
+ || !DECL_SAVED_TREE (decl))
+ return;
+ if (!info->param_flags)
+ info->param_flags = XCNEWVEC (struct ipa_param_flags,
+ ipa_get_param_count (info));
+
+ func = DECL_STRUCT_FUNCTION (decl);
+ FOR_EACH_BB_FN (bb, func)
+ {
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ tree stmt = bsi_stmt (bsi);
+ ipa_analyze_stmt_uses (info, stmt);
}
- else
- args->jump_functions[arg_num].type = IPA_UNKNOWN;
- arg_num++;
}
+
+ info->uses_analysis_done = 1;
+}
+
+/* Update the jump functions assocated with call graph edge E when the call
+ graph edge CS is being inlined, assuming that E->caller is already (possibly
+ indirectly) inlined into CS->callee and that E has not been inlined. */
+static void
+update_jump_functions_after_inlining (struct cgraph_edge *cs,
+ struct cgraph_edge *e)
+{
+ struct ipa_edge_args *top = IPA_EDGE_REF (cs);
+ struct ipa_edge_args *args = IPA_EDGE_REF (e);
+ int count = ipa_get_cs_argument_count (args);
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ struct ipa_jump_func *src, *dst = ipa_get_ith_jump_func (args, i);
+
+ if (dst->type != IPA_PASS_THROUGH)
+ continue;
+
+ /* We must check range due to calls with variable number of arguments: */
+ if (dst->value.formal_id >= (unsigned) ipa_get_cs_argument_count (top))
+ {
+ dst->type = IPA_BOTTOM;
+ continue;
+ }
+
+ src = ipa_get_ith_jump_func (top, dst->value.formal_id);
+ *dst = *src;
+ }
+}
+
+/* Print out a debug message to file F that we have discovered that an indirect
+ call descibed by NT is in fact a call of a known constant function descibed
+ by JFUNC. NODE is the node where the call is. */
+static void
+print_edge_addition_message (FILE *f, struct ipa_param_call_note *nt,
+ struct ipa_jump_func *jfunc,
+ struct cgraph_node *node)
+{
+ fprintf (f, "ipa-prop: Discovered an indirect call to a known target (");
+ if (jfunc->type == IPA_CONST_MEMBER_PTR)
+ {
+ print_node_brief (f, "", jfunc->value.member_cst.pfn, 0);
+ print_node_brief (f, ", ", jfunc->value.member_cst.delta, 0);
+ }
+ else
+ print_node_brief(f, "", jfunc->value.constant, 0);
+
+ fprintf (f, ") in %s: ", cgraph_node_name (node));
+ print_generic_stmt (f, nt->stmt, 2);
+}
+
+/* Update the param called notes associated with NODE when CS is being inlined,
+ assuming NODE is (potentially indirectly) inlined into CS->callee.
+ Moreover, if the callee is discovered to be constant, create a new cgraph
+ edge for it. Newly discovered indirect edges will be added to NEW_EDGES,
+ unless it is NULL. */
+static void
+update_call_notes_after_inlining (struct cgraph_edge *cs,
+ struct cgraph_node *node,
+ VEC (cgraph_edge_p, heap) *new_edges)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ struct ipa_edge_args *top = IPA_EDGE_REF (cs);
+ struct ipa_param_call_note *nt;
+
+ for (nt = info->param_calls; nt; nt = nt->next)
+ {
+ struct ipa_jump_func *jfunc;
+
+ if (nt->processed)
+ continue;
+
+ /* We must check range due to calls with variable number of arguments: */
+ if (nt->formal_id >= (unsigned) ipa_get_cs_argument_count (top))
+ {
+ nt->processed = true;
+ continue;
+ }
+
+ jfunc = ipa_get_ith_jump_func (top, nt->formal_id);
+ if (jfunc->type == IPA_PASS_THROUGH)
+ nt->formal_id = jfunc->value.formal_id;
+ else if (jfunc->type == IPA_CONST || jfunc->type == IPA_CONST_MEMBER_PTR)
+ {
+ struct cgraph_node *callee;
+ struct cgraph_edge *new_indirect_edge;
+ tree decl;
+
+ nt->processed = true;
+ if (jfunc->type == IPA_CONST_MEMBER_PTR)
+ decl = jfunc->value.member_cst.pfn;
+ else
+ decl = jfunc->value.constant;
+
+ if (TREE_CODE (decl) != FUNCTION_DECL)
+ continue;
+ callee = cgraph_node (decl);
+ if (!callee || !callee->local.inlinable)
+ continue;
+
+ if (dump_file)
+ print_edge_addition_message (dump_file, nt, jfunc, node);
+
+ new_indirect_edge = cgraph_create_edge (node, callee, nt->stmt,
+ nt->count, nt->frequency,
+ nt->loop_nest);
+ new_indirect_edge->indirect_call = 1;
+ ipa_check_create_edge_args ();
+ if (new_edges)
+ VEC_safe_push (cgraph_edge_p, heap, new_edges, new_indirect_edge);
+ }
+ }
+}
+
+/* Recursively traverse subtree of NODE (including node) made of inlined
+ cgraph_edges when CS has been inlined and invoke
+ update_call_notes_after_inlining on all nodes and
+ update_jump_functions_after_inlining on all non-inlined edges that lead out
+ of this subtree. Newly discovered indirect edges will be added to
+ NEW_EDGES, unless it is NULL. */
+static void
+propagate_info_to_inlined_callees (struct cgraph_edge *cs,
+ struct cgraph_node *node,
+ VEC (cgraph_edge_p, heap) *new_edges)
+{
+ struct cgraph_edge *e;
+
+ update_call_notes_after_inlining (cs, node, new_edges);
+
+ for (e = node->callees; e; e = e->next_callee)
+ if (!e->inline_failed)
+ propagate_info_to_inlined_callees (cs, e->callee, new_edges);
+ else
+ update_jump_functions_after_inlining (cs, e);
+}
+
+/* Update jump functions and call note functions on inlining the call site CS.
+ CS is expected to lead to a node already cloned by
+ cgraph_clone_inline_nodes. Newly discovered indirect edges will be added to
+ NEW_EDGES, unless it is NULL. */
+void
+ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
+ VEC (cgraph_edge_p, heap) *new_edges)
+{
+ propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
}
/* Frees all dynamically allocated structures that the argument info points
@@ -371,8 +1053,15 @@ ipa_free_node_params_substructures (struct ipa_node_params *info)
free (info->ipcp_lattices);
if (info->param_decls)
free (info->param_decls);
- if (info->modified_flags)
- free (info->modified_flags);
+ if (info->param_flags)
+ free (info->param_flags);
+
+ while (info->param_calls)
+ {
+ struct ipa_param_call_note *note = info->param_calls;
+ info->param_calls = note->next;
+ free (note);
+ }
memset (info, 0, sizeof (*info));
}
@@ -451,6 +1140,7 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
void *data)
{
struct ipa_node_params *old_info, *new_info;
+ struct ipa_param_call_note *note;
int param_count;
ipa_check_create_node_params ();
@@ -464,12 +1154,24 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
sizeof (struct ipcp_lattice) * param_count);
new_info->param_decls = (tree *)
duplicate_array (old_info->param_decls, sizeof (tree) * param_count);
- new_info->modified_flags = (bool *)
- duplicate_array (old_info->modified_flags, sizeof (bool) * param_count);
+ new_info->param_flags = (struct ipa_param_flags *)
+ duplicate_array (old_info->param_flags,
+ sizeof (struct ipa_param_flags) * param_count);
new_info->ipcp_orig_node = old_info->ipcp_orig_node;
new_info->count_scale = old_info->count_scale;
+ for (note = old_info->param_calls; note; note = note->next)
+ {
+ struct ipa_param_call_note *nn;
+
+ nn = (struct ipa_param_call_note *)
+ xcalloc (1, sizeof (struct ipa_param_call_note));
+ memcpy (nn, note, sizeof (struct ipa_param_call_note));
+ nn->next = new_info->param_calls;
+ new_info->param_calls = nn;
+ }
+
data = data; /* Suppressing compiler warning. */
}
@@ -510,6 +1212,19 @@ ipa_unregister_cgraph_hooks (void)
void
free_all_ipa_structures_after_ipa_cp (void)
{
+ if (!flag_indirect_inlining)
+ {
+ ipa_free_all_edge_args ();
+ ipa_free_all_node_params ();
+ ipa_unregister_cgraph_hooks ();
+ }
+}
+
+/* Free all ipa_node_params and all ipa_edge_args structures if they are no
+ longer needed after indirect inlining. */
+void
+free_all_ipa_structures_after_iinln (void)
+{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipa_unregister_cgraph_hooks ();
@@ -545,33 +1260,37 @@ ipa_print_all_tree_maps (FILE * f)
}
}
-/* Print modified_flags data structures of all functions in the
- callgraph to F. */
+/* Print param_flags data structures of the NODE to F. */
void
-ipa_print_all_params_modified (FILE * f)
+ipa_print_node_param_flags (FILE * f, struct cgraph_node *node)
{
int i, count;
- bool temp;
- struct cgraph_node *node;
+ struct ipa_node_params *info;
- fprintf (f, "\nMODIFY PRINT\n");
- for (node = cgraph_nodes; node; node = node->next)
+ if (!node->analyzed)
+ return;
+ info = IPA_NODE_REF (node);
+ fprintf (f, "PARAM FLAGS of function %s: \n", cgraph_node_name (node));
+ count = ipa_get_param_count (info);
+ for (i = 0; i < count; i++)
{
- struct ipa_node_params *info;
-
- if (!node->analyzed)
- continue;
- info = IPA_NODE_REF (node);
- fprintf (f, "function %s :: \n", cgraph_node_name (node));
- count = ipa_get_param_count (info);
- for (i = 0; i < count; i++)
- {
- temp = info->modified_flags[i];
- if (temp)
- fprintf (f, " param [%d] true \n", i);
- else
- fprintf (f, " param [%d] false \n", i);
- }
+ fprintf (f, " param %d flags:", i);
+ if (ipa_is_ith_param_modified (info, i))
+ fprintf (f, " modified");
+ if (ipa_is_ith_param_called (info, i))
+ fprintf (f, " called");
+ fprintf (f, "\n");
}
}
+/* Print param_flags data structures of all functions in the
+ callgraph to F. */
+void
+ipa_print_all_param_flags (FILE * f)
+{
+ struct cgraph_node *node;
+
+ fprintf (f, "\nIPA PARAM FLAGS DUMP\n");
+ for (node = cgraph_nodes; node; node = node->next)
+ ipa_print_node_param_flags (f, node);
+}
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 2dd83326018..7d44da1813c 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "vec.h"
+#include "cgraph.h"
/* The following definitions and interfaces are used by
interprocedural analyses. */
@@ -32,21 +33,23 @@ along with GCC; see the file COPYING3. If not see
Constant - a constant is passed as an actual argument.
Unknown - neither of the above.
Integer and real constants are represented as IPA_CONST and Fortran
- constants are represented as IPA_CONST_REF. */
+ constants are represented as IPA_CONST_REF. Finally, IPA_CONST_MEMBER_PTR
+ stands for C++ member pointers constants. */
enum jump_func_type
{
- IPA_UNKNOWN,
+ IPA_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
IPA_CONST,
IPA_CONST_REF,
+ IPA_CONST_MEMBER_PTR,
IPA_PASS_THROUGH
};
/* 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:
- TOP - unknown.
- BOTTOM - non constant.
- CONSTANT_TYPE - constant value.
+ IPA_TOP - unknown,
+ IPA_BOTTOM - non constant,
+ IPA_CONST_VALUE - simple scalar constant,
Cval of formal f will have a constant value if all callsites to this
function have the same constant value passed to f.
Integer and real constants are represented as IPA_CONST and Fortran
@@ -59,14 +62,24 @@ enum ipa_lattice_type
IPA_TOP
};
-/* Represents a value of a jump function.
- value represents a constant.
- formal_id is used only in jump function context and represents
- pass-through parameter (the formal of caller is passed as argument). */
+/* Structure holding a C++ member pointer constant. Holds a pointer to the
+ method and delta offset. */
+struct ipa_member_ptr_cst
+{
+ tree pfn;
+ tree delta;
+};
+
+/* Represents a value of a jump function. formal_id is used only in jump
+ function context and represents pass-through parameter (the formal parameter
+ of the caller is passed as argument). constant represents the actual
+ constant in constant jump functions and member_cst holds constant c++ member
+ functions. */
union jump_func_value
{
unsigned int formal_id;
tree constant;
+ struct ipa_member_ptr_cst member_cst;
};
/* A jump function for a callsite represents the values passed as actual
@@ -101,10 +114,43 @@ struct ipa_replace_map
bool ref_p;
};
+/* ipa_param_flags contains various flags that describe how the associated
+ parameter is treated within a function. */
+struct ipa_param_flags
+{
+ /* Whether the value parameter has been modified within the function. */
+ unsigned modified : 1;
+ /* Whether the parameter has been used as a call destination. */
+ unsigned called : 1;
+};
+
+/* Each instance of the following structure describes a statement that calls a
+ function parameter. Those referring to statements within the same function
+ are linked in a list. */
+struct ipa_param_call_note
+{
+ /* Linked list's next */
+ struct ipa_param_call_note *next;
+ /* Statement that contains the call to the parameter above. */
+ tree stmt;
+ /* Index of the parameter that is called. */
+ unsigned int formal_id;
+ /* Expected number of executions: calculated in profile.c. */
+ gcov_type count;
+ /* Expected frequency of executions within the function. see cgraph_edge in
+ cgraph.h for more on this. */
+ int frequency;
+ /* Depth of loop nest, 1 means no loop nest. */
+ int loop_nest;
+ /* Set when we have already found the target to be a compile time constant
+ and turned this into an edge or when the note was found unusable for some
+ reason. */
+ bool processed;
+};
+
/* 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,
@@ -115,8 +161,10 @@ struct ipa_node_params
struct ipcp_lattice *ipcp_lattices;
/* Mapping each parameter to its PARM_DECL tree. */
tree *param_decls;
- /* Indicating which parameter is modified in its function. */
- bool *modified_flags;
+ /* Various flags describing individual parameters. */
+ struct ipa_param_flags *param_flags;
+ /* List of structures enumerating calls to a formal parameter. */
+ struct ipa_param_call_note *param_calls;
/* 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;
@@ -130,6 +178,10 @@ struct ipa_node_params
/* Whether this function is called with variable number of actual
arguments. */
unsigned called_with_var_arguments : 1;
+ /* Whether the modification analysis has already been performed. */
+ unsigned modification_analysis_done : 1;
+ /* Whether the param uses analysis has already been performed. */
+ unsigned uses_analysis_done : 1;
};
/* ipa_node_params access functions. Please use these to access fields that
@@ -164,7 +216,16 @@ ipa_get_ith_param (struct ipa_node_params *info, int i)
static inline bool
ipa_is_ith_param_modified (struct ipa_node_params *info, int i)
{
- return info->modified_flags[i];
+ return info->param_flags[i].modified;
+}
+
+/* Returns the called flag corresponding o the ith paramterer. Note there is
+ no setter method as the goal is to set all flags when building the array in
+ ipa_detect_called_params. */
+static inline bool
+ipa_is_ith_param_called (struct ipa_node_params *info, int i)
+{
+ return info->param_flags[i].called;
}
/* Flag this node as having callers with variable number of arguments. */
@@ -255,6 +316,7 @@ void ipa_free_node_params_substructures (struct ipa_node_params *);
void ipa_free_all_node_params (void);
void ipa_free_all_edge_args (void);
void free_all_ipa_structures_after_ipa_cp (void);
+void free_all_ipa_structures_after_iinln (void);
void ipa_register_cgraph_hooks (void);
/* This function ensures the array of node param infos is big enough to
@@ -318,9 +380,15 @@ void ipa_count_arguments (struct cgraph_edge *);
void ipa_count_formal_params (struct cgraph_node *);
void ipa_create_param_decls_array (struct cgraph_node *);
void ipa_detect_param_modifications (struct cgraph_node *);
+void ipa_analyze_params_uses (struct cgraph_node *);
+void ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
+ VEC (cgraph_edge_p, heap) *new_edges);
/* Debugging interface. */
void ipa_print_all_tree_maps (FILE *);
-void ipa_print_all_params_modified (FILE *);
+void ipa_print_node_param_flags (FILE * f, struct cgraph_node *node);
+void ipa_print_all_param_flags (FILE *);
+void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
+void ipa_print_all_jump_functions (FILE * f);
#endif /* IPA_PROP_H */
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 3b2cdaee2a1..578c48d3030 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -771,7 +771,7 @@ static_execute (void)
static bool
gate_pure_const (void)
{
- return (flag_unit_at_a_time != 0 && flag_ipa_pure_const
+ return (flag_ipa_pure_const
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index 75aed2f52f6..872a4b4dc34 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -1314,7 +1314,7 @@ static_execute (void)
static bool
gate_reference (void)
{
- return (flag_unit_at_a_time != 0 && flag_ipa_reference
+ return (flag_ipa_reference
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c
index 229d8b2e9a5..81e6ddb635b 100644
--- a/gcc/ipa-type-escape.c
+++ b/gcc/ipa-type-escape.c
@@ -2192,7 +2192,7 @@ type_escape_execute (void)
static bool
gate_type_escape_vars (void)
{
- return (flag_unit_at_a_time != 0 && flag_ipa_type_escape
+ return (flag_ipa_type_escape
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index fd98969a355..7fb266d850c 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * java/decl.c: Include cgraph.h
+ (end_java_method): Remove non-unit-at-a-time code.
+ (java_mark_decl_local): Likewise; sanity check that we don't touch
+ finalized nodes.
+
2008-07-15 Jan Hubicka <jh@suse.cz>
* lang.c (java_init_options): Enable unit-at-a-time by default.
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index d249157371d..1768109414d 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -49,6 +49,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "version.h"
#include "tree-iterator.h"
#include "langhooks.h"
+#include "cgraph.h"
#if defined (DEBUG_JAVA_BINDING_LEVELS)
extern void indent (void);
@@ -1797,14 +1798,6 @@ end_java_method (void)
finish_method (fndecl);
- if (! flag_unit_at_a_time)
- {
- /* Nulling these fields when we no longer need them saves
- memory. */
- DECL_SAVED_TREE (fndecl) = NULL;
- DECL_STRUCT_FUNCTION (fndecl) = NULL;
- DECL_INITIAL (fndecl) = NULL_TREE;
- }
current_function_decl = NULL_TREE;
}
@@ -1854,15 +1847,12 @@ java_mark_decl_local (tree decl)
{
DECL_EXTERNAL (decl) = 0;
- /* If we've already constructed DECL_RTL, give encode_section_info
- a second chance, now that we've changed the flags. */
- /* ??? Ideally, we'd have flag_unit_at_a_time set, and not have done
- anything that would have referenced DECL_RTL so far. But at the
- moment we force flag_unit_at_a_time off due to excessive memory
- consumption when compiling large jar files. Which probably means
- that we need to re-order how we process jar files... */
- if (DECL_RTL_SET_P (decl))
- make_decl_rtl (decl);
+#ifdef ENABLE_CHECKING
+ /* Double check that we didn't pass the function to the callgraph early. */
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ gcc_assert (!cgraph_node (decl)->local.finalized);
+#endif
+ gcc_assert (!DECL_RTL_SET_P (decl));
}
/* Given appropriate target support, G++ will emit hidden aliases for native
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 1d11b4f2e00..dde1b76573c 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -535,8 +535,6 @@ java_post_options (const char **pfilename)
/* Use tree inlining. */
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* An absolute requirement: if we're not using indirect dispatch, we
must always verify everything. */
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 50bedc14c71..12291d5604f 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,7 @@
+2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * objc-act.c: Fix comment typos.
+
2008-07-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* objc-act.c (objc_start_class_interface,
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 5230f556e5f..44c8648a781 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -801,7 +801,7 @@ objc_build_struct (tree klass, tree fields, tree super_name)
&& TREE_CODE (TREE_CHAIN (field)) == FIELD_DECL)
field = TREE_CHAIN (field);
- /* For ObjC ABI purposes, the "packed" size of a base class is the
+ /* For ObjC ABI purposes, the "packed" size of a base class is
the sum of the offset and the size (in bits) of the last field
in the class. */
DECL_SIZE (base)
@@ -1525,7 +1525,7 @@ synth_module_prologue (void)
const struct gcc_debug_hooks *const save_hooks = debug_hooks;
/* Suppress outputting debug symbols, because
- dbxout_init hasn'r been called yet. */
+ dbxout_init hasn't been called yet. */
write_symbols = NO_DEBUG;
debug_hooks = &do_nothing_debug_hooks;
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index 213e9497dcf..a14b8c203d5 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -128,6 +128,23 @@ function var_type(flags)
return "const char *"
}
+# Return the type of variable that should be associated with the given flags
+# for use within a structure. Simple variables are changed to unsigned char
+# type instead of int to save space.
+function var_type_struct(flags)
+{
+ if (flag_set_p("UInteger", flags))
+ return "int "
+ else if (!flag_set_p("Joined.*", flags)) {
+ if (flag_set_p(".*Mask.*", flags))
+ return "int "
+ else
+ return "unsigned char "
+ }
+ else
+ return "const char *"
+}
+
# Given that an option has flags FLAGS, return an initializer for the
# "var_cond" and "var_value" fields of its cl_options[] entry.
function var_set(flags)
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 79fe800018b..d53ba69aa76 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -28,6 +28,7 @@
BEGIN {
n_opts = 0
n_langs = 0
+ n_target_save = 0
quote = "\042"
comma = ","
FS=SUBSEP
@@ -41,6 +42,11 @@ BEGIN {
langs[n_langs] = $2
n_langs++;
}
+ else if ($1 == "TargetSave") {
+ # Make sure the declarations are put in source order
+ target_save_decl[n_target_save] = $2
+ n_target_save++
+ }
else {
name = opt_args("Mask", $1)
if (name == "") {
@@ -64,10 +70,17 @@ print "#include " quote "intl.h" quote
print ""
print "#ifdef GCC_DRIVER"
print "int target_flags;"
+print "#else"
+print "#include " quote "flags.h" quote
+print "#include " quote "target.h" quote
print "#endif /* GCC_DRIVER */"
print ""
+have_save = 0;
for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("Save", flags[i]))
+ have_save = 1;
+
name = var_name(flags[i]);
if (name == "")
continue;
@@ -210,4 +223,310 @@ for (i = 0; i < n_opts; i++) {
}
print "};"
+
+print "";
+print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)"
+print "";
+print "/* Save optimization variables into a structure. */"
+print "void";
+print "cl_optimization_save (struct cl_optimization *ptr)";
+print "{";
+
+n_opt_char = 2;
+n_opt_short = 0;
+n_opt_int = 0;
+n_opt_other = 0;
+var_opt_char[0] = "optimize";
+var_opt_char[1] = "optimize_size";
+var_opt_range["optimize"] = "0, 255";
+var_opt_range["optimize_size"] = "0, 255";
+
+# Sort by size to mimic how the structure is laid out to be friendlier to the
+# cache.
+
+for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("Optimization", flags[i])) {
+ name = var_name(flags[i])
+ if(name == "")
+ continue;
+
+ if(name in var_opt_seen)
+ continue;
+
+ var_opt_seen[name]++;
+ otype = var_type_struct(flags[i]);
+ if (otype ~ "^((un)?signed +)?int *$")
+ var_opt_int[n_opt_int++] = name;
+
+ else if (otype ~ "^((un)?signed +)?short *$")
+ var_opt_short[n_opt_short++] = name;
+
+ else if (otype ~ "^((un)?signed +)?char *$") {
+ var_opt_char[n_opt_char++] = name;
+ if (otype ~ "^unsigned +char *$")
+ var_opt_range[name] = "0, 255"
+ else if (otype ~ "^signed +char *$")
+ var_opt_range[name] = "-128, 127"
+ }
+ else
+ var_opt_other[n_opt_other++] = name;
+ }
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ name = var_opt_char[i];
+ if (var_opt_range[name] != "")
+ print " gcc_assert (IN_RANGE (" name ", " var_opt_range[name] "));";
+}
+
+print "";
+for (i = 0; i < n_opt_other; i++) {
+ print " ptr->" var_opt_other[i] " = " var_opt_other[i] ";";
+}
+
+for (i = 0; i < n_opt_int; i++) {
+ print " ptr->" var_opt_int[i] " = " var_opt_int[i] ";";
+}
+
+for (i = 0; i < n_opt_short; i++) {
+ print " ptr->" var_opt_short[i] " = " var_opt_short[i] ";";
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ print " ptr->" var_opt_char[i] " = " var_opt_char[i] ";";
+}
+
+print "}";
+
+print "";
+print "/* Restore optimization options from a structure. */";
+print "void";
+print "cl_optimization_restore (struct cl_optimization *ptr)";
+print "{";
+
+for (i = 0; i < n_opt_other; i++) {
+ print " " var_opt_other[i] " = ptr->" var_opt_other[i] ";";
+}
+
+for (i = 0; i < n_opt_int; i++) {
+ print " " var_opt_int[i] " = ptr->" var_opt_int[i] ";";
+}
+
+for (i = 0; i < n_opt_short; i++) {
+ print " " var_opt_short[i] " = ptr->" var_opt_short[i] ";";
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ print " " var_opt_char[i] " = ptr->" var_opt_char[i] ";";
+}
+
+print "}";
+
+print "";
+print "/* Print optimization options from a structure. */";
+print "void";
+print "cl_optimization_print (FILE *file,";
+print " int indent_to,";
+print " struct cl_optimization *ptr)";
+print "{";
+
+print " fputs (\"\\n\", file);";
+for (i = 0; i < n_opt_other; i++) {
+ print " if (ptr->" var_opt_other[i] ")";
+ print " fprintf (file, \"%*s%s (0x%lx)\\n\",";
+ print " indent_to, \"\",";
+ print " \"" var_opt_other[i] "\",";
+ print " (unsigned long)ptr->" var_opt_other[i] ");";
+ print "";
+}
+
+for (i = 0; i < n_opt_int; i++) {
+ print " if (ptr->" var_opt_int[i] ")";
+ print " fprintf (file, \"%*s%s (0x%x)\\n\",";
+ print " indent_to, \"\",";
+ print " \"" var_opt_int[i] "\",";
+ print " ptr->" var_opt_int[i] ");";
+ print "";
+}
+
+for (i = 0; i < n_opt_short; i++) {
+ print " if (ptr->" var_opt_short[i] ")";
+ print " fprintf (file, \"%*s%s (0x%x)\\n\",";
+ print " indent_to, \"\",";
+ print " \"" var_opt_short[i] "\",";
+ print " ptr->" var_opt_short[i] ");";
+ print "";
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ print " if (ptr->" var_opt_char[i] ")";
+ print " fprintf (file, \"%*s%s (0x%x)\\n\",";
+ print " indent_to, \"\",";
+ print " \"" var_opt_char[i] "\",";
+ print " ptr->" var_opt_char[i] ");";
+ print "";
+}
+
+print "}";
+
+print "";
+print "/* Save selected option variables into a structure. */"
+print "void";
+print "cl_target_option_save (struct cl_target_option *ptr)";
+print "{";
+
+n_target_char = 0;
+n_target_short = 0;
+n_target_int = 0;
+n_target_other = 0;
+
+if (have_save) {
+ for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("Save", flags[i])) {
+ name = var_name(flags[i])
+ if(name == "")
+ name = "target_flags";
+
+ if(name in var_save_seen)
+ continue;
+
+ var_save_seen[name]++;
+ otype = var_type_struct(flags[i])
+ if (otype ~ "^((un)?signed +)?int *$")
+ var_target_int[n_target_int++] = name;
+
+ else if (otype ~ "^((un)?signed +)?short *$")
+ var_target_short[n_target_short++] = name;
+
+ else if (otype ~ "^((un)?signed +)?char *$") {
+ var_target_char[n_target_char++] = name;
+ if (otype ~ "^unsigned +char *$")
+ var_target_range[name] = "0, 255"
+ else if (otype ~ "^signed +char *$")
+ var_target_range[name] = "-128, 127"
+ }
+ else
+ var_target_other[n_target_other++] = name;
+ }
+ }
+} else {
+ var_target_int[n_target_int++] = "target_flags";
+}
+
+have_assert = 0;
+for (i = 0; i < n_target_char; i++) {
+ name = var_target_char[i];
+ if (var_target_range[name] != "") {
+ have_assert = 1;
+ print " gcc_assert (IN_RANGE (" name ", " var_target_range[name] "));";
+ }
+}
+
+if (have_assert)
+ print "";
+
+print " if (targetm.target_option.save)";
+print " targetm.target_option.save (ptr);";
+print "";
+
+for (i = 0; i < n_target_other; i++) {
+ print " ptr->" var_target_other[i] " = " var_target_other[i] ";";
+}
+
+for (i = 0; i < n_target_int; i++) {
+ print " ptr->" var_target_int[i] " = " var_target_int[i] ";";
+}
+
+for (i = 0; i < n_target_short; i++) {
+ print " ptr->" var_target_short[i] " = " var_target_short[i] ";";
+}
+
+for (i = 0; i < n_target_char; i++) {
+ print " ptr->" var_target_char[i] " = " var_target_char[i] ";";
+}
+
+print "}";
+
+print "";
+print "/* Restore selected current options from a structure. */";
+print "void";
+print "cl_target_option_restore (struct cl_target_option *ptr)";
+print "{";
+
+for (i = 0; i < n_target_other; i++) {
+ print " " var_target_other[i] " = ptr->" var_target_other[i] ";";
+}
+
+for (i = 0; i < n_target_int; i++) {
+ print " " var_target_int[i] " = ptr->" var_target_int[i] ";";
+}
+
+for (i = 0; i < n_target_short; i++) {
+ print " " var_target_short[i] " = ptr->" var_target_short[i] ";";
+}
+
+for (i = 0; i < n_target_char; i++) {
+ print " " var_target_char[i] " = ptr->" var_target_char[i] ";";
+}
+
+# This must occur after the normal variables in case the code depends on those
+# variables.
+print "";
+print " if (targetm.target_option.restore)";
+print " targetm.target_option.restore (ptr);";
+
+print "}";
+
+print "";
+print "/* Print optimization options from a structure. */";
+print "void";
+print "cl_target_option_print (FILE *file,";
+print " int indent,";
+print " struct cl_target_option *ptr)";
+print "{";
+
+print " fputs (\"\\n\", file);";
+for (i = 0; i < n_target_other; i++) {
+ print " if (ptr->" var_target_other[i] ")";
+ print " fprintf (file, \"%*s%s (0x%lx)\\n\",";
+ print " indent, \"\",";
+ print " \"" var_target_other[i] "\",";
+ print " (unsigned long)ptr->" var_target_other[i] ");";
+ print "";
+}
+
+for (i = 0; i < n_target_int; i++) {
+ print " if (ptr->" var_target_int[i] ")";
+ print " fprintf (file, \"%*s%s (0x%x)\\n\",";
+ print " indent, \"\",";
+ print " \"" var_target_int[i] "\",";
+ print " ptr->" var_target_int[i] ");";
+ print "";
+}
+
+for (i = 0; i < n_target_short; i++) {
+ print " if (ptr->" var_target_short[i] ")";
+ print " fprintf (file, \"%*s%s (0x%x)\\n\",";
+ print " indent, \"\",";
+ print " \"" var_target_short[i] "\",";
+ print " ptr->" var_target_short[i] ");";
+ print "";
+}
+
+for (i = 0; i < n_target_char; i++) {
+ print " if (ptr->" var_target_char[i] ")";
+ print " fprintf (file, \"%*s%s (0x%x)\\n\",";
+ print " indent, \"\",";
+ print " \"" var_target_char[i] "\",";
+ print " ptr->" var_target_char[i] ");";
+ print "";
+}
+
+print "";
+print " if (targetm.target_option.print)";
+print " targetm.target_option.print (file, indent, ptr);";
+
+print "}";
+print "#endif";
+
}
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk
index 9aa18a12ad9..a67e5b77a8b 100644
--- a/gcc/opth-gen.awk
+++ b/gcc/opth-gen.awk
@@ -26,6 +26,7 @@
BEGIN {
n_opts = 0
n_langs = 0
+ n_target_save = 0
n_extra_masks = 0
quote = "\042"
comma = ","
@@ -38,6 +39,11 @@ BEGIN {
langs[n_langs] = $2
n_langs++;
}
+ else if ($1 == "TargetSave") {
+ # Make sure the declarations are put in source order
+ target_save_decl[n_target_save] = $2
+ n_target_save++
+ }
else {
name = opt_args("Mask", $1)
if (name == "") {
@@ -64,15 +70,180 @@ print "extern int target_flags;"
print "extern int target_flags_explicit;"
print ""
+have_save = 0;
+
for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("Save", flags[i]))
+ have_save = 1;
+
name = var_name(flags[i]);
if (name == "")
continue;
+ if (name in var_seen)
+ continue;
+
+ var_seen[name] = 1;
print "extern " var_type(flags[i]) name ";"
}
print ""
+# All of the optimization switches gathered together so they can be saved and restored.
+# This will allow attribute((cold)) to turn on space optimization.
+
+# Change the type of normal switches from int to unsigned char to save space.
+# Also, order the structure so that pointer fields occur first, then int
+# fields, and then char fields to provide the best packing.
+
+print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)"
+print ""
+print "/* Structure to save/restore optimization and target specific options. */";
+print "struct cl_optimization GTY(())";
+print "{";
+
+n_opt_char = 2;
+n_opt_short = 0;
+n_opt_int = 0;
+n_opt_other = 0;
+var_opt_char[0] = "unsigned char optimize";
+var_opt_char[1] = "unsigned char optimize_size";
+
+for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("Optimization", flags[i])) {
+ name = var_name(flags[i])
+ if(name == "")
+ continue;
+
+ if(name in var_opt_seen)
+ continue;
+
+ var_opt_seen[name]++;
+ otype = var_type_struct(flags[i]);
+ if (otype ~ "^((un)?signed +)?int *$")
+ var_opt_int[n_opt_int++] = otype name;
+
+ else if (otype ~ "^((un)?signed +)?short *$")
+ var_opt_short[n_opt_short++] = otype name;
+
+ else if (otype ~ "^((un)?signed +)?char *$")
+ var_opt_char[n_opt_char++] = otype name;
+
+ else
+ var_opt_other[n_opt_other++] = otype name;
+ }
+}
+
+for (i = 0; i < n_opt_other; i++) {
+ print " " var_opt_other[i] ";";
+}
+
+for (i = 0; i < n_opt_int; i++) {
+ print " " var_opt_int[i] ";";
+}
+
+for (i = 0; i < n_opt_short; i++) {
+ print " " var_opt_short[i] ";";
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ print " " var_opt_char[i] ";";
+}
+
+print "};";
+print "";
+
+# Target and optimization save/restore/print functions.
+print "/* Structure to save/restore selected target specific options. */";
+print "struct cl_target_option GTY(())";
+print "{";
+
+n_target_char = 0;
+n_target_short = 0;
+n_target_int = 0;
+n_target_other = 0;
+
+for (i = 0; i < n_target_save; i++) {
+ if (target_save_decl[i] ~ "^((un)?signed +)?int +[_a-zA-Z0-9]+$")
+ var_target_int[n_target_int++] = target_save_decl[i];
+
+ else if (target_save_decl[i] ~ "^((un)?signed +)?short +[_a-zA-Z0-9]+$")
+ var_target_short[n_target_short++] = target_save_decl[i];
+
+ else if (target_save_decl[i] ~ "^((un)?signed +)?char +[_a-zA-Z0-9]+$")
+ var_target_char[n_target_char++] = target_save_decl[i];
+
+ else
+ var_target_other[n_target_other++] = target_save_decl[i];
+}
+
+if (have_save) {
+ for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("Save", flags[i])) {
+ name = var_name(flags[i])
+ if(name == "")
+ name = "target_flags";
+
+ if(name in var_save_seen)
+ continue;
+
+ var_save_seen[name]++;
+ otype = var_type_struct(flags[i])
+ if (otype ~ "^((un)?signed +)?int *$")
+ var_target_int[n_target_int++] = otype name;
+
+ else if (otype ~ "^((un)?signed +)?short *$")
+ var_target_short[n_target_short++] = otype name;
+
+ else if (otype ~ "^((un)?signed +)?char *$")
+ var_target_char[n_target_char++] = otype name;
+
+ else
+ var_target_other[n_target_other++] = otype name;
+ }
+ }
+} else {
+ var_target_int[n_target_int++] = "int target_flags";
+}
+
+for (i = 0; i < n_target_other; i++) {
+ print " " var_target_other[i] ";";
+}
+
+for (i = 0; i < n_target_int; i++) {
+ print " " var_target_int[i] ";";
+}
+
+for (i = 0; i < n_target_short; i++) {
+ print " " var_target_short[i] ";";
+}
+
+for (i = 0; i < n_target_char; i++) {
+ print " " var_target_char[i] ";";
+}
+
+print "};";
+print "";
+print "";
+print "/* Save optimization variables into a structure. */"
+print "extern void cl_optimization_save (struct cl_optimization *);";
+print "";
+print "/* Restore optimization variables from a structure. */";
+print "extern void cl_optimization_restore (struct cl_optimization *);";
+print "";
+print "/* Print optimization variables from a structure. */";
+print "extern void cl_optimization_print (FILE *, int, struct cl_optimization *);";
+print "";
+print "/* Save selected option variables into a structure. */"
+print "extern void cl_target_option_save (struct cl_target_option *);";
+print "";
+print "/* Restore selected option variables from a structure. */"
+print "extern void cl_target_option_restore (struct cl_target_option *);";
+print "";
+print "/* Print target option variables from a structure. */";
+print "extern void cl_target_option_print (FILE *, int, struct cl_target_option *);";
+print "#endif";
+print "";
+
for (i = 0; i < n_opts; i++) {
name = opt_args("Mask", flags[i])
vname = var_name(flags[i])
diff --git a/gcc/opts.c b/gcc/opts.c
index 7e8e96c4dad..2a88ce2d138 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -333,11 +333,6 @@ bool use_gnu_debug_info_extensions;
/* The default visibility for all symbols (unless overridden) */
enum symbol_visibility default_visibility = VISIBILITY_DEFAULT;
-/* Disable unit-at-a-time for frontends that might be still broken in this
- respect. */
-
-bool no_unit_at_a_time_default;
-
/* Global visibility options. */
struct visibility_flags visibility_options;
@@ -809,12 +804,36 @@ handle_options (unsigned int argc, const char **argv, unsigned int lang_mask)
void
decode_options (unsigned int argc, const char **argv)
{
- unsigned int i, lang_mask;
+ static bool first_time_p = true;
+ static int initial_max_aliased_vops;
+ static int initial_avg_aliased_vops;
+ static int initial_min_crossjump_insns;
+ static int initial_max_fields_for_field_sensitive;
+ static unsigned int initial_lang_mask;
- /* Perform language-specific options initialization. */
- lang_mask = lang_hooks.init_options (argc, argv);
+ unsigned int i, lang_mask;
+ int opt1;
+ int opt2;
+ int opt3;
+ int opt1_max;
- lang_hooks.initialize_diagnostics (global_dc);
+ if (first_time_p)
+ {
+ /* Perform language-specific options initialization. */
+ initial_lang_mask = lang_mask = lang_hooks.init_options (argc, argv);
+
+ lang_hooks.initialize_diagnostics (global_dc);
+
+ /* Save initial values of parameters we reset. */
+ initial_max_aliased_vops = MAX_ALIASED_VOPS;
+ initial_avg_aliased_vops = AVG_ALIASED_VOPS;
+ initial_min_crossjump_insns
+ = compiler_params[PARAM_MIN_CROSSJUMP_INSNS].value;
+ initial_max_fields_for_field_sensitive
+ = compiler_params[PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE].value;
+ }
+ else
+ lang_mask = initial_lang_mask;
/* Scan to see what optimization level has been specified. That will
determine the default value of many flags. */
@@ -848,151 +867,197 @@ decode_options (unsigned int argc, const char **argv)
}
}
}
+
+ if (!flag_unit_at_a_time)
+ {
+ flag_section_anchors = 0;
+ flag_toplevel_reorder = 0;
+ }
+ if (!flag_toplevel_reorder)
+ {
+ if (flag_section_anchors == 1)
+ error ("Section anchors must be disabled when toplevel reorder is disabled.");
+ flag_section_anchors = 0;
+ }
+ /* Originally we just set the variables if a particular optimization level,
+ but with the advent of being able to change the optimization level for a
+ function, we need to reset optimizations. */
if (!optimize)
{
flag_merge_constants = 0;
- }
- if (!no_unit_at_a_time_default)
- {
- flag_unit_at_a_time = 1;
- if (!optimize)
+ /* We disable toplevel reordering at -O0 to disable transformations that
+ might be surprising to end users and to get -fno-toplevel-reorder
+ tested, but we keep section anchors. */
+ if (flag_toplevel_reorder == 2)
flag_toplevel_reorder = 0;
}
+ else
+ flag_merge_constants = 1;
- if (optimize >= 1)
- {
- flag_defer_pop = 1;
+ /* -O1 optimizations. */
+ opt1 = (optimize >= 1);
+ flag_defer_pop = opt1;
#ifdef DELAY_SLOTS
- flag_delayed_branch = 1;
+ flag_delayed_branch = opt1;
#endif
#ifdef CAN_DEBUG_WITHOUT_FP
- flag_omit_frame_pointer = 1;
+ flag_omit_frame_pointer = opt1;
#endif
- flag_guess_branch_prob = 1;
- flag_cprop_registers = 1;
- flag_if_conversion = 1;
- flag_if_conversion2 = 1;
- flag_ipa_pure_const = 1;
- flag_ipa_reference = 1;
- flag_split_wide_types = 1;
- flag_tree_ccp = 1;
- flag_tree_dce = 1;
- flag_tree_dom = 1;
- flag_tree_dse = 1;
- flag_tree_ter = 1;
- flag_tree_sra = 1;
- flag_tree_copyrename = 1;
- flag_tree_fre = 1;
- flag_tree_copy_prop = 1;
- flag_tree_sink = 1;
-
- if (!optimize_size)
- {
- /* Loop header copying usually increases size of the code. This used
- not to be true, since quite often it is possible to verify that
- the condition is satisfied in the first iteration and therefore
- to eliminate it. Jump threading handles these cases now. */
- flag_tree_ch = 1;
- }
- }
-
- if (optimize >= 2)
- {
- flag_inline_small_functions = 1;
- flag_thread_jumps = 1;
- flag_crossjumping = 1;
- flag_optimize_sibling_calls = 1;
- flag_forward_propagate = 1;
- flag_cse_follow_jumps = 1;
- flag_gcse = 1;
- flag_expensive_optimizations = 1;
- flag_rerun_cse_after_loop = 1;
- flag_caller_saves = 1;
- flag_peephole2 = 1;
+ flag_guess_branch_prob = opt1;
+ flag_cprop_registers = opt1;
+ flag_if_conversion = opt1;
+ flag_if_conversion2 = opt1;
+ flag_ipa_pure_const = opt1;
+ flag_ipa_reference = opt1;
+ flag_split_wide_types = opt1;
+ flag_tree_ccp = opt1;
+ flag_tree_dce = opt1;
+ flag_tree_dom = opt1;
+ flag_tree_dse = opt1;
+ flag_tree_ter = opt1;
+ flag_tree_sra = opt1;
+ flag_tree_copyrename = opt1;
+ flag_tree_fre = opt1;
+ flag_tree_copy_prop = opt1;
+ flag_tree_sink = opt1;
+ flag_tree_ch = opt1;
+
+ /* -O2 optimizations. */
+ opt2 = (optimize >= 2);
+ flag_inline_small_functions = opt2;
+ flag_indirect_inlining = opt2;
+ flag_thread_jumps = opt2;
+ flag_crossjumping = opt2;
+ flag_optimize_sibling_calls = opt2;
+ flag_forward_propagate = opt2;
+ flag_cse_follow_jumps = opt2;
+ flag_gcse = opt2;
+ flag_expensive_optimizations = opt2;
+ flag_rerun_cse_after_loop = opt2;
+ flag_caller_saves = opt2;
+ flag_peephole2 = opt2;
#ifdef INSN_SCHEDULING
- flag_schedule_insns = 1;
- flag_schedule_insns_after_reload = 1;
+ flag_schedule_insns = opt2;
+ flag_schedule_insns_after_reload = opt2;
#endif
- flag_regmove = 1;
- flag_strict_aliasing = 1;
- flag_strict_overflow = 1;
- flag_delete_null_pointer_checks = 1;
- flag_reorder_blocks = 1;
- flag_reorder_functions = 1;
- flag_tree_store_ccp = 1;
- flag_tree_vrp = 1;
+ flag_regmove = opt2;
+ flag_strict_aliasing = opt2;
+ flag_strict_overflow = opt2;
+ flag_delete_null_pointer_checks = opt2;
+ flag_reorder_blocks = opt2;
+ flag_reorder_functions = opt2;
+ flag_tree_store_ccp = opt2;
+ flag_tree_vrp = opt2;
+ flag_tree_builtin_call_dce = opt2;
+ flag_tree_pre = opt2;
flag_tree_switch_conversion = 1;
- if (!optimize_size)
- {
- /* Conditional DCE generates bigger code. */
- flag_tree_builtin_call_dce = 1;
- /* PRE tends to generate bigger code. */
- flag_tree_pre = 1;
- }
-
/* Allow more virtual operators to increase alias precision. */
- set_param_value ("max-aliased-vops", 500);
- /* Track fields in field-sensitive alias analysis. */
- set_param_value ("max-fields-for-field-sensitive", 100);
- }
+ set_param_value ("max-aliased-vops",
+ (opt2) ? 500 : initial_max_aliased_vops);
- if (optimize >= 3)
- {
- flag_predictive_commoning = 1;
- flag_inline_functions = 1;
- flag_unswitch_loops = 1;
- flag_gcse_after_reload = 1;
- flag_tree_vectorize = 1;
+ /* Track fields in field-sensitive alias analysis. */
+ set_param_value ("max-fields-for-field-sensitive",
+ (opt2) ? 100 : initial_max_fields_for_field_sensitive);
- /* Allow even more virtual operators. */
- set_param_value ("max-aliased-vops", 1000);
- set_param_value ("avg-aliased-vops", 3);
- }
+ /* -O3 optimizations. */
+ opt3 = (optimize >= 3);
+ flag_predictive_commoning = opt3;
+ flag_inline_functions = opt3;
+ flag_unswitch_loops = opt3;
+ flag_gcse_after_reload = opt3;
+ flag_tree_vectorize = opt3;
- if (optimize < 2 || optimize_size)
+ /* Allow even more virtual operators. Max-aliased-vops was set above for
+ -O2, so don't reset it unless we are at -O3. */
+ if (opt3)
+ set_param_value ("max-aliased-vops", 1000);
+
+ set_param_value ("avg-aliased-vops", (opt3) ? 3 : initial_avg_aliased_vops);
+
+ /* Just -O1/-O0 optimizations. */
+ opt1_max = (optimize <= 1);
+ align_loops = opt1_max;
+ align_jumps = opt1_max;
+ align_labels = opt1_max;
+ align_functions = opt1_max;
+
+ if (optimize_size)
{
+ /* Loop header copying usually increases size of the code. This used not to
+ be true, since quite often it is possible to verify that the condition is
+ satisfied in the first iteration and therefore to eliminate it. Jump
+ threading handles these cases now. */
+ flag_tree_ch = 0;
+
+ /* Conditional DCE generates bigger code. */
+ flag_tree_builtin_call_dce = 0;
+
+ /* PRE tends to generate bigger code. */
+ flag_tree_pre = 0;
+
+ /* These options are set with -O3, so reset for -Os */
+ flag_predictive_commoning = 0;
+ flag_inline_functions = 0;
+ flag_unswitch_loops = 0;
+ flag_gcse_after_reload = 0;
+ flag_tree_vectorize = 0;
+
+ /* Don't reorder blocks when optimizing for size because extra jump insns may
+ be created; also barrier may create extra padding.
+
+ More correctly we should have a block reordering mode that tried to
+ minimize the combined size of all the jumps. This would more or less
+ automatically remove extra jumps, but would also try to use more short
+ jumps instead of long jumps. */
+ flag_reorder_blocks = 0;
+ flag_reorder_blocks_and_partition = 0;
+
+ /* Inlining of functions reducing size is a good idea regardless of them
+ being declared inline. */
+ flag_inline_functions = 1;
+
+ /* Don't align code. */
align_loops = 1;
align_jumps = 1;
align_labels = 1;
align_functions = 1;
- /* Don't reorder blocks when optimizing for size because extra
- jump insns may be created; also barrier may create extra padding.
-
- More correctly we should have a block reordering mode that tried
- to minimize the combined size of all the jumps. This would more
- or less automatically remove extra jumps, but would also try to
- use more short jumps instead of long jumps. */
- flag_reorder_blocks = 0;
- flag_reorder_blocks_and_partition = 0;
- }
+ /* Unroll/prefetch switches that may be set on the command line, and tend to
+ generate bigger code. */
+ flag_unroll_loops = 0;
+ flag_unroll_all_loops = 0;
+ flag_prefetch_loop_arrays = 0;
- if (optimize_size)
- {
- /* Inlining of functions reducing size is a good idea regardless
- of them being declared inline. */
- flag_inline_functions = 1;
+ /* Basic optimization options. */
+ optimize_size = 1;
+ if (optimize > 2)
+ optimize = 2;
/* We want to crossjump as much as possible. */
set_param_value ("min-crossjump-insns", 1);
}
+ else
+ set_param_value ("min-crossjump-insns", initial_min_crossjump_insns);
- /* Initialize whether `char' is signed. */
- flag_signed_char = DEFAULT_SIGNED_CHAR;
- /* Set this to a special "uninitialized" value. The actual default is set
- after target options have been processed. */
- flag_short_enums = 2;
-
- /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
- modify it. */
- target_flags = targetm.default_target_flags;
-
- /* Some targets have ABI-specified unwind tables. */
- flag_unwind_tables = targetm.unwind_tables_default;
+ if (first_time_p)
+ {
+ /* Initialize whether `char' is signed. */
+ flag_signed_char = DEFAULT_SIGNED_CHAR;
+ /* Set this to a special "uninitialized" value. The actual default is
+ set after target options have been processed. */
+ flag_short_enums = 2;
+
+ /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
+ modify it. */
+ target_flags = targetm.default_target_flags;
+
+ /* Some targets have ABI-specified unwind tables. */
+ flag_unwind_tables = targetm.unwind_tables_default;
+ }
#ifdef OPTIMIZATION_OPTIONS
/* Allow default optimizations to be specified on a per-machine basis. */
@@ -1001,15 +1066,18 @@ decode_options (unsigned int argc, const char **argv)
handle_options (argc, argv, lang_mask);
- if (flag_pie)
- flag_pic = flag_pie;
- if (flag_pic && !flag_pie)
- flag_shlib = 1;
+ if (first_time_p)
+ {
+ if (flag_pie)
+ flag_pic = flag_pie;
+ if (flag_pic && !flag_pie)
+ flag_shlib = 1;
- if (flag_no_inline == 2)
- flag_no_inline = 0;
- else
- flag_really_no_inline = flag_no_inline;
+ if (flag_no_inline == 2)
+ flag_no_inline = 0;
+ else
+ flag_really_no_inline = flag_no_inline;
+ }
/* Set flag_no_inline before the post_options () hook. The C front
ends use it to determine tree inlining defaults. FIXME: such
@@ -1034,16 +1102,6 @@ decode_options (unsigned int argc, const char **argv)
if (flag_really_no_inline == 2)
flag_really_no_inline = flag_no_inline;
- /* Inlining of functions called just once will only work if we can look
- at the complete translation unit. */
- if (flag_inline_functions_called_once && !flag_unit_at_a_time)
- {
- flag_inline_functions_called_once = 0;
- warning (OPT_Wdisabled_optimization,
- "-funit-at-a-time is required for inlining of functions "
- "that are only called once");
- }
-
/* The optimization to partition hot and cold basic blocks into separate
sections of the .o and executable files does not work (currently)
with exception handling. This is because there is no support for
@@ -1082,6 +1140,14 @@ decode_options (unsigned int argc, const char **argv)
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
+
+ /* Save the current optimization options if this is the first call. */
+ if (first_time_p)
+ {
+ optimization_default_node = build_optimization_node ();
+ optimization_current_node = optimization_default_node;
+ first_time_p = false;
+ }
}
#define LEFT_COLUMN 27
@@ -2074,6 +2140,18 @@ fast_math_flags_set_p (void)
&& !flag_errno_math);
}
+/* Return true iff flags are set as if -ffast-math but using the flags stored
+ in the struct cl_optimization structure. */
+bool
+fast_math_flags_struct_set_p (struct cl_optimization *opt)
+{
+ return (!opt->flag_trapping_math
+ && opt->flag_unsafe_math_optimizations
+ && opt->flag_finite_math_only
+ && !opt->flag_signed_zeros
+ && !opt->flag_errno_math);
+}
+
/* Handle a debug output -g switch. EXTENDED is true or false to support
extended output (2 is special and means "-ggdb" was given). */
static void
diff --git a/gcc/opts.h b/gcc/opts.h
index 2f543407de0..62ad89aa5a5 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -64,7 +64,6 @@ extern const struct cl_option cl_options[];
extern const unsigned int cl_options_count;
extern const char *const lang_names[];
extern const unsigned int cl_lang_count;
-extern bool no_unit_at_a_time_default;
#define CL_PARAMS (1 << 18) /* Fake entry. Used to display --param info with --help. */
#define CL_WARNING (1 << 19) /* Enables an (optional) warning message. */
diff --git a/gcc/passes.c b/gcc/passes.c
index e1d019fa9fd..53d2985e9e4 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -180,7 +180,7 @@ rest_of_decl_compilation (tree decl,
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them.
- We do output all variables when unit-at-a-time is active and rely on
+ We do output all variables and rely on
callgraph code to defer them except for forward declarations
(see gcc.c-torture/compile/920624-1.c) */
if ((at_end
@@ -523,9 +523,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_inline_parameters);
*p = NULL;
- /* Interprocedural optimization passes.
- All these passes are ignored in -fno-unit-at-a-time
- except for subpasses of early_local_passes. */
+ /* Interprocedural optimization passes. */
p = &all_ipa_passes;
NEXT_PASS (pass_ipa_function_and_variable_visibility);
NEXT_PASS (pass_ipa_early_inline);
@@ -542,12 +540,13 @@ init_optimization_passes (void)
NEXT_PASS (pass_cleanup_cfg);
NEXT_PASS (pass_init_datastructures);
NEXT_PASS (pass_expand_omp);
+
+ NEXT_PASS (pass_referenced_vars);
+ NEXT_PASS (pass_reset_cc_flags);
+ NEXT_PASS (pass_build_ssa);
NEXT_PASS (pass_all_early_optimizations);
{
struct opt_pass **p = &pass_all_early_optimizations.pass.sub;
- NEXT_PASS (pass_referenced_vars);
- NEXT_PASS (pass_reset_cc_flags);
- NEXT_PASS (pass_build_ssa);
NEXT_PASS (pass_early_warn_uninitialized);
NEXT_PASS (pass_rebuild_cgraph_edges);
NEXT_PASS (pass_early_inline);
@@ -574,8 +573,8 @@ init_optimization_passes (void)
NEXT_PASS (pass_tail_recursion);
NEXT_PASS (pass_convert_switch);
NEXT_PASS (pass_profile);
- NEXT_PASS (pass_release_ssa_names);
}
+ NEXT_PASS (pass_release_ssa_names);
NEXT_PASS (pass_rebuild_cgraph_edges);
}
NEXT_PASS (pass_ipa_increase_alignment);
@@ -592,7 +591,6 @@ init_optimization_passes (void)
/* These passes are run after IPA passes on every function that is being
output to the assembler file. */
p = &all_passes;
- NEXT_PASS (pass_O0_always_inline);
NEXT_PASS (pass_all_optimizations);
{
struct opt_pass **p = &pass_all_optimizations.pass.sub;
@@ -712,11 +710,12 @@ init_optimization_passes (void)
NEXT_PASS (pass_tail_calls);
NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_uncprop);
- NEXT_PASS (pass_del_ssa);
- NEXT_PASS (pass_nrv);
- NEXT_PASS (pass_mark_used_blocks);
- NEXT_PASS (pass_cleanup_cfg_post_optimizing);
}
+ NEXT_PASS (pass_del_ssa);
+ NEXT_PASS (pass_nrv);
+ NEXT_PASS (pass_mark_used_blocks);
+ NEXT_PASS (pass_cleanup_cfg_post_optimizing);
+
NEXT_PASS (pass_warn_function_noreturn);
NEXT_PASS (pass_free_datastructures);
NEXT_PASS (pass_mudflap_2);
@@ -1226,8 +1225,6 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
pass_fini_dump_file (pass);
current_pass = NULL;
- /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
- in_gimple_form = false;
}
static bool
@@ -1327,8 +1324,6 @@ execute_one_pass (struct opt_pass *pass)
|| pass->type != RTL_PASS);
current_pass = NULL;
- /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
- in_gimple_form = false;
return true;
}
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 3b34f89d41c..ed31861624a 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -369,8 +369,14 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
fputs (" suppress-debug", file);
- if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
- fputs (DECL_DECLARED_INLINE_P (node) ? " inline" : " autoinline", file);
+ if (TREE_CODE (node) == FUNCTION_DECL
+ && DECL_FUNCTION_SPECIFIC_TARGET (node))
+ fputs (" function-specific-target", file);
+ if (TREE_CODE (node) == FUNCTION_DECL
+ && DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node))
+ fputs (" function-specific-opt", file);
+ if (TREE_CODE (node) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (node))
+ fputs (" autoinline", file);
if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
fputs (" built-in", file);
if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
@@ -931,6 +937,14 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
}
break;
+ case OPTIMIZATION_NODE:
+ cl_optimization_print (file, indent + 4, TREE_OPTIMIZATION (node));
+ break;
+
+ case TARGET_OPTION_NODE:
+ cl_target_option_print (file, indent + 4, TREE_TARGET_OPTION (node));
+ break;
+
default:
if (EXCEPTIONAL_CLASS_P (node))
lang_hooks.print_xnode (file, node, indent);
diff --git a/gcc/recog.c b/gcc/recog.c
index 6d8b7eaec74..cd47155ad4e 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1686,16 +1686,14 @@ asm_operand_ok (rtx op, const char *constraint)
result = 1;
}
#ifdef EXTRA_CONSTRAINT_STR
+ else if (EXTRA_MEMORY_CONSTRAINT (c, constraint))
+ /* Every memory operand can be reloaded to fit. */
+ result = result || memory_operand (op, VOIDmode);
+ else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint))
+ /* Every address operand can be reloaded to fit. */
+ result = result || address_operand (op, VOIDmode);
else if (EXTRA_CONSTRAINT_STR (op, c, constraint))
result = 1;
- else if (EXTRA_MEMORY_CONSTRAINT (c, constraint)
- /* Every memory operand can be reloaded to fit. */
- && memory_operand (op, VOIDmode))
- result = 1;
- else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint)
- /* Every address operand can be reloaded to fit. */
- && address_operand (op, VOIDmode))
- result = 1;
#endif
break;
}
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 6ce066c64ff..cd64b386e9e 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -762,6 +762,51 @@
TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS \
}
+/* Function specific option attribute support. */
+#ifndef TARGET_OPTION_VALID_ATTRIBUTE_P
+#define TARGET_OPTION_VALID_ATTRIBUTE_P NULL
+#endif
+
+#ifndef TARGET_OPTION_SAVE
+#define TARGET_OPTION_SAVE NULL
+#endif
+
+#ifndef TARGET_OPTION_RESTORE
+#define TARGET_OPTION_RESTORE NULL
+#endif
+
+#ifndef TARGET_OPTION_PRINT
+#define TARGET_OPTION_PRINT NULL
+#endif
+
+#ifndef TARGET_OPTION_PRAGMA_PARSE
+#define TARGET_OPTION_PRAGMA_PARSE NULL
+#endif
+
+#ifndef TARGET_OPTION_CAN_INLINE_P
+#define TARGET_OPTION_CAN_INLINE_P default_target_option_can_inline_p
+#endif
+
+#ifndef TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION
+#define TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION false
+#endif
+
+#ifndef TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION
+#define TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION false
+#endif
+
+#define TARGET_OPTION_HOOKS \
+ { \
+ TARGET_OPTION_VALID_ATTRIBUTE_P, \
+ TARGET_OPTION_SAVE, \
+ TARGET_OPTION_RESTORE, \
+ TARGET_OPTION_PRINT, \
+ TARGET_OPTION_PRAGMA_PARSE, \
+ TARGET_OPTION_CAN_INLINE_P, \
+ TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION, \
+ TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION, \
+ }
+
/* The whole shebang. */
#define TARGET_INITIALIZER \
{ \
@@ -858,6 +903,7 @@
TARGET_C, \
TARGET_CXX, \
TARGET_EMUTLS, \
+ TARGET_OPTION_HOOKS, \
TARGET_EXTRA_LIVE_ON_ENTRY, \
TARGET_UNWIND_TABLES_DEFAULT, \
TARGET_HAVE_NAMED_SECTIONS, \
diff --git a/gcc/target.h b/gcc/target.h
index 87436188956..33e2f9bd837 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -970,6 +970,40 @@ struct gcc_target
bool debug_form_tls_address;
} emutls;
+ struct target_option_hooks {
+ /* Function to validate the attribute((option(...))) strings or NULL. If
+ the option is validated, it is assumed that DECL_FUNCTION_SPECIFIC will
+ be filled in in the function decl node. */
+ bool (*valid_attribute_p) (tree, tree, tree, int);
+
+ /* Function to save any extra target state in the target options
+ structure. */
+ void (*save) (struct cl_target_option *);
+
+ /* Function to restore any extra target state from the target options
+ structure. */
+ void (*restore) (struct cl_target_option *);
+
+ /* Function to print any extra target state from the target options
+ structure. */
+ void (*print) (FILE *, int, struct cl_target_option *);
+
+ /* Function to parse arguments to be validated for #pragma option, and to
+ change the state if the options are valid. If the arguments are NULL,
+ use the default target options. Return true if the options are valid,
+ and set the current state. */
+ bool (*pragma_parse) (tree);
+
+ /* Function to determine if one function can inline another function. */
+ bool (*can_inline_p) (tree, tree);
+
+ /* Whether the cold attribute changes the optimization level. */
+ bool cold_attribute_sets_optimization;
+
+ /* Whether the hot attribute changes the optimization level. */
+ bool hot_attribute_sets_optimization;
+ } target_option;
+
/* For targets that need to mark extra registers as live on entry to
the function, they should define this target hook and set their
bits in the bitmap passed in. */
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 4064ad47411..4e9b9ad0675 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -709,4 +709,38 @@ default_hard_regno_scratch_ok (unsigned int regno ATTRIBUTE_UNUSED)
return true;
}
+bool
+default_target_option_valid_attribute_p (tree ARG_UNUSED (fndecl),
+ tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags))
+{
+ return false;
+}
+
+bool
+default_target_option_can_inline_p (tree caller, tree callee)
+{
+ bool ret = false;
+ tree callee_opts = DECL_FUNCTION_SPECIFIC_TARGET (callee);
+ tree caller_opts = DECL_FUNCTION_SPECIFIC_TARGET (caller);
+
+ /* If callee has no option attributes, then it is ok to inline */
+ if (!callee_opts)
+ ret = true;
+
+ /* If caller has no option attributes, but callee does then it is not ok to
+ inline */
+ else if (!caller_opts)
+ ret = false;
+
+ /* If both caller and callee have attributes, assume that if the pointer is
+ different, the the two functions have different target options since
+ build_target_option_node uses a hash table for the options. */
+ else
+ ret = (callee_opts == caller_opts);
+
+ return ret;
+}
+
#include "gt-targhooks.h"
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 4ad0fc86805..efb487c0d8b 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -97,5 +97,6 @@ extern int default_reloc_rw_mask (void);
extern tree default_mangle_decl_assembler_name (tree, tree);
extern tree default_emutls_var_fields (tree, tree *);
extern tree default_emutls_var_init (tree, tree, tree);
-
extern bool default_hard_regno_scratch_ok (unsigned int);
+extern bool default_target_option_valid_attribute_p (tree, tree, tree, int);
+extern bool default_target_option_can_inline_p (tree, tree);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1114de11d77..f6e24218824 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,163 @@
+2008-07-26 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/36934
+ * gfortran.dg/allocatable_module_1.f90: New test case.
+
+2008-07-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36936
+ * gcc.target/i386/cmov8.c: New.
+ * gcc.target/i386/funcspec-10.c: Likewise.
+ * gcc.target/i386/funcspec-11.c: Likewise.
+
+2008-07-25 Joseph Myers <joseph@codesourcery.com>
+
+ * lib/target-supports.exp (check_effective_target_arm_thumb1_ok):
+ New.
+ * g++.dg/inherit/thunk8.C: Use it.
+
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/winline-4.c: Remove.
+ * gcc.dg/pch/valid-3.hs: Remove.
+ * gcc.dg/pch/valid-3.c: Remove.
+ * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning
+ * g++.old-deja/g++.jason/report.C: Likewise.
+ * testsuite/g++.dg/warn/pr23075.C: We get returning void warning
+ instead of control flow warning.
+
+2008-07-24 Daniel Kraft <d@domob.eu>
+
+ PR fortran/33141
+ * gfortran.dg/intrinsic_shadow_1.f03: New test for -Wintrinsic-shadow.
+ * gfortran.dg/intrinsic_shadow_2.f03: Ditto.
+ * gfortran.dg/intrinsic_shadow_3.f03: Ditto.
+ * gfortran.dg/intrinsic_std_1.f90: New test for -Wintrinsics-std.
+ * gfortran.dg/intrinsic_std_2.f90: Ditto.
+ * gfortran.dg/intrinsic_std_3.f90: Ditto.
+ * gfortran.dg/intrinsic_std_4.f90: Ditto.
+ * gfortran.dg/warn_std_1.f90: Removed option -Wnonstd-intrinsics.
+ * gfortran.dg/warn_std_2.f90: Replaced -Wnonstd-intrinsics by
+ -Wintrinsics-std and adapted expected errors/warnings.
+ * gfortran.dg/warn_std_3.f90: Ditto.
+ * gfortran.dg/c_sizeof_2.f90: Adapted expected error/warning message.
+ * gfortran.dg/gamma_2.f90: Ditto.
+ * gfortran.dg/selected_char_kind_3.f90: Ditto.
+ * gfortran.dg/fmt_g0_2.f08: Call with -fall-intrinsics to allow abort.
+
+2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/29952
+ * gfortran.dg/array_temporaries_1.f90: New test case.
+
+2008-07-23 Ian Lance Taylor <iant@google.com>
+
+ * gcc.target/i386/20080723-1.c: New test.
+
+2008-07-24 Ben Elliston <bje@au.ibm.com>
+
+ * gcc.target/spu/vector.c: New test.
+ * gcc.target/spu/vector-ansi.c: Likewise.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * gcc.dg/Wdeclaration-after-statement-3.c: New.
+ * gcc/testsuite/gcc.dg/Wpointer-arith.c: New.
+
+2008-07-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/36852
+ * gfortran.dg/namelist_52.f90: New test.
+
+2008-07-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * lib/target-supports.exp (check_effective_target_spu_auto_overlay):
+ New procedure.
+ * lib/compat.exp (compat-execute): Use it to test whether toolchain
+ supports automatic overlay generation for the SPU.
+
+2008-07-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/29835
+ * gfortran.dg/fmt_error_3.f90: New test.
+ * gfortran.dg/fmt_error_4.f90: New test.
+ * gfortran.dg/fmt_error_5.f90: New test.
+
+2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28079
+ * gcc.dg/cpp/line6.c: New.
+
+2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * gfortran.dg/fmt_g0_3.f08: Fix typo in expected error message.
+
+2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36871
+ PR c++/36872
+ * g++.dg/ext/has_nothrow_copy.C: Rename to...
+ * g++.dg/ext/has_nothrow_copy-1.C: ... this.
+ * g++.dg/ext/has_nothrow_copy-2.C: New.
+ * g++.dg/ext/has_nothrow_copy-3.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-4.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-5.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-6.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-7.C: Likewise.
+
+2008-07-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/36773
+ * gfortran.dg/zero_sized_5.f90: New test case.
+
+2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36870
+ * g++.dg/ext/has_nothrow_assign_odr.C: New.
+ * g++.dg/ext/has_nothrow_copy_odr.C: Likewise.
+ * g++.dg/ext/has_nothrow_constructor_odr.C: Likewise.
+ * g++.dg/ext/has_nothrow_assign.C: Adjust.
+ * g++.dg/ext/has_nothrow_copy.C: Likewise.
+ * g++.dg/ext/has_nothrow_constructor.C: Likewise.
+
+2008-07-17 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ PR target/36822
+ * gcc.target/s390/pr36822.c: New testcase.
+
+2008-07-21 Hans-Peter Nilsson <hp@axis.com>
+
+ PR middle-end/36143
+ * g++.dg/tree-ssa/pr19637.C: XFAIL.
+
+ PR rtl-optimization/33642
+ * gcc.c-torture/compile/pr11832.c: Skip for CRIS.
+ * gcc.c-torture/compile/pr33009.c: Likewise.
+
+ PR middle-end/36509
+ * gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: XFAIL.
+
+2008-07-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/36879
+ * gcc.c-torture/execute/20080719-1.c: New testcase.
+
+2008-07-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.dg/tree-ssa/data-dep-1.c: XFAIL.
+
+2008-07-20 Daniel Berlin <dberlin@dberlin.org>
+
+ * gcc.dg/tree-ssa/ssa-fre-7.c: XFAIL.
+ * gcc.dg/tree-ssa/ssa-fre-8.c: Ditto.
+ * gcc.dg/tree-ssa/ssa-fre-9.c: Ditto.
+ * gcc.dg/tree-ssa/ssa-fre-13.c: Ditto.
+ * gcc.dg/tree-ssa/ssa-fre-14.c: Ditto.
+ * gcc.dg/tree-ssa/ssa-fre-17.c: Ditto.
+ * gcc.dg/tree-ssa/ssa-pre-15.c: Ditto.
+ * gcc.dg/tree-ssa/loadpre1.c: PASS.
+
2008-07-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36877
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted1.C b/gcc/testsuite/g++.dg/cpp0x/defaulted1.C
new file mode 100644
index 00000000000..e8fe37eb39a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted1.C
@@ -0,0 +1,43 @@
+// Positive test for defaulted/deleted fns
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+ int i;
+ A() = default;
+ A(const A&) = delete;
+ A& operator=(const A&) = default;
+ ~A();
+};
+
+A::~A() = default;
+
+void f() = delete;
+
+struct B
+{
+ int i;
+ B() = default;
+};
+
+int main()
+{
+ A a1, a2;
+ B b = {1};
+ a1 = a2;
+}
+
+// fns defaulted in class defn are trivial
+struct C
+{
+ C() = default;
+ C(const C&) = default;
+ C& operator=(const C&) = default;
+ ~C() = default;
+};
+
+union U
+{
+ C c;
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
new file mode 100644
index 00000000000..ea06d92530f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
@@ -0,0 +1,66 @@
+// Negative test for defaulted/deleted fns.
+// { dg-options "-std=c++0x" }
+
+void f(); // { dg-error "previous" }
+void f() = delete; // { dg-error "deleted" }
+
+struct A
+{
+ A() { } // { dg-error "previous" }
+ void f() = default; // { dg-error "default" }
+};
+
+A::A() = default; // { dg-error "redefinition" }
+
+void g() {} // { dg-error "previous" }
+void g() = delete; // { dg-error "redefinition" }
+
+struct B
+{
+ B() = default;
+};
+
+const B b; // { dg-error "uninitialized const" }
+
+struct C
+{
+ virtual void f() = delete; // { dg-error "overriding deleted" }
+};
+
+struct D: public C
+{
+ virtual void f(); // { dg-error "non-deleted function" }
+};
+
+struct E
+{
+ const B b;
+ E() { } // { dg-error "uninitialized" }
+};
+
+struct F
+{
+ F() = default;
+ F(const F&) = delete; // { dg-error "deleted" }
+};
+
+struct G
+{
+ G();
+};
+
+// ctor defaulted after class defn is not trivial
+G::G() = default;
+
+union U
+{
+ G g; // { dg-error "constructor" }
+};
+
+int main()
+{
+ F f;
+ F f2(f); // { dg-error "used" }
+ B* b = new const B; // { dg-error "uninitialized const" }
+}
+
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C b/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
index 525cac7aa48..73a904eac25 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
@@ -136,19 +136,13 @@ int main()
assert (PTEST (C));
assert (NTEST (C[]));
assert (PTEST (D));
-#ifndef __PIC__
- assert (PTEST (E));
-#endif
+ assert (NTEST (E));
assert (NTEST (E1));
assert (PTEST (F));
assert (PTEST (G));
-#ifndef __PIC__
- assert (PTEST (H));
-#endif
+ assert (NTEST (H));
assert (NTEST (H1));
-#ifndef __PIC__
- assert (PTEST (I));
-#endif
+ assert (NTEST (I));
assert (NTEST (I1));
assert (PTEST (J));
assert (NTEST (const K));
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
new file mode 100644
index 00000000000..c38d76d44a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
@@ -0,0 +1,16 @@
+// PR c++/36870
+// { dg-do "run" }
+#include <cassert>
+
+struct S { const S& operator= (const S&); };
+
+bool f ();
+
+int main ()
+{
+ assert (__has_nothrow_assign (S) == f ());
+}
+
+const S& S::operator= (const S&) { }
+
+bool f () { return __has_nothrow_assign (S); }
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C
index 7e747bcd11e..60e9be8d0be 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C
@@ -97,9 +97,7 @@ int main()
assert (PTEST (C));
assert (PTEST (C[]));
assert (PTEST (D));
-#ifndef __PIC__
- assert (PTEST (E));
-#endif
+ assert (NTEST (E));
assert (NTEST (E1));
assert (NTEST (F));
assert (NTEST (G));
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
new file mode 100644
index 00000000000..775e74a2631
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
@@ -0,0 +1,16 @@
+// PR c++/36870
+// { dg-do "run" }
+#include <cassert>
+
+struct S { S (); };
+
+bool f ();
+
+int main ()
+{
+ assert (__has_nothrow_constructor (S) == f ());
+}
+
+S::S () { }
+
+bool f () { return __has_nothrow_constructor (S); }
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C
index 6843d51b4c4..e8507cf582c 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C
@@ -126,19 +126,13 @@ int main()
assert (PTEST (C));
assert (NTEST (C[]));
assert (PTEST (D));
-#ifndef __PIC__
- assert (PTEST (E));
-#endif
+ assert (NTEST (E));
assert (NTEST (E1));
assert (PTEST (F));
assert (PTEST (G));
-#ifndef __PIC__
- assert (PTEST (H));
-#endif
+ assert (NTEST (H));
assert (NTEST (H1));
-#ifndef __PIC__
- assert (PTEST (I));
-#endif
+ assert (NTEST (I));
assert (NTEST (I1));
assert (PTEST (J));
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C
new file mode 100644
index 00000000000..276b11d574c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C
@@ -0,0 +1,12 @@
+// PR c++/36871
+// { dg-do "run" }
+#include <cassert>
+
+struct A { template <class T> A (T) throw (int); };
+struct B { B (B&) throw (); template <class T> B (T) throw (int); };
+
+int main ()
+{
+ assert (__has_nothrow_copy (A));
+ assert (__has_nothrow_copy (B));
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C
new file mode 100644
index 00000000000..2fbcf8c8096
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C
@@ -0,0 +1,13 @@
+// PR c++/36871
+// { dg-do "run" }
+#include <cassert>
+
+struct F {
+ F (const F&) throw () { }
+ template <class T> F (T) throw () { }
+};
+
+int main ()
+{
+ assert (__has_nothrow_copy (F));
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C
new file mode 100644
index 00000000000..4bd7475ea7c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C
@@ -0,0 +1,13 @@
+// PR c++/36872
+// { dg-do "run" }
+#include <cassert>
+
+struct S {
+ S (const S&) throw ();
+ S (...) throw (int);
+};
+
+int main ()
+{
+ assert (__has_nothrow_copy (S));
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C
new file mode 100644
index 00000000000..051675c4d00
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C
@@ -0,0 +1,13 @@
+// PR c++/36872
+// { dg-do "run" }
+#include <cassert>
+
+struct S {
+ S (const S&) throw ();
+ S (int) throw (int);
+};
+
+int main ()
+{
+ assert (__has_nothrow_copy (S));
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C
new file mode 100644
index 00000000000..4330edd2941
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C
@@ -0,0 +1,12 @@
+// { dg-do "run" }
+#include <cassert>
+
+struct S {
+ S (S&) throw ();
+ S (const S&, int) throw (int);
+};
+
+int main ()
+{
+ assert (__has_nothrow_copy (S));
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C
new file mode 100644
index 00000000000..a85224c3abc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C
@@ -0,0 +1,13 @@
+// { dg-do "run" }
+// { dg-options "-std=c++0x" }
+#include <cassert>
+
+struct S {
+ S (const S&) throw ();
+ S (S&&) throw (int);
+};
+
+int main ()
+{
+ assert (__has_nothrow_copy (S));
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C
new file mode 100644
index 00000000000..499a11e25be
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C
@@ -0,0 +1,16 @@
+// PR c++/36870
+// { dg-do "run" }
+#include <cassert>
+
+struct S { S (const S&); };
+
+bool f ();
+
+int main ()
+{
+ assert (__has_nothrow_copy (S) == f ());
+}
+
+S::S (const S&) { }
+
+bool f () { return __has_nothrow_copy (S); }
diff --git a/gcc/testsuite/g++.dg/inherit/thunk8.C b/gcc/testsuite/g++.dg/inherit/thunk8.C
index f7761349f8e..ef645356898 100644
--- a/gcc/testsuite/g++.dg/inherit/thunk8.C
+++ b/gcc/testsuite/g++.dg/inherit/thunk8.C
@@ -3,7 +3,7 @@
Make sure that won't happen anymore. */
/* { dg-do compile } */
-/* { dg-require-effective-target arm32 } */
+/* { dg-require-effective-target arm_thumb1_ok } */
/* { dg-options "-mthumb -fPIC" } */
struct A {
diff --git a/gcc/testsuite/g++.dg/ipa/iinline-1.C b/gcc/testsuite/g++.dg/ipa/iinline-1.C
new file mode 100644
index 00000000000..be3be71f96a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/iinline-1.C
@@ -0,0 +1,47 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void non_existent (const char *, int);
+
+class String
+{
+private:
+ const char *data;
+
+public:
+ String (const char *d) : data(d)
+ {}
+
+ int funcOne (int delim) const;
+ int printStuffTwice (int delim) const;
+};
+
+
+int String::funcOne (int delim) const
+{
+ int i;
+ for (i = 0; i < delim; i++)
+ non_existent(data, i);
+
+ return 1;
+}
+
+int docalling (int (String::* f)(int delim) const)
+{
+ String S ("muhehehe");
+
+ return (S.*f)(4);
+}
+
+int main (int argc, char *argv[])
+{
+ int i;
+ i = docalling (&String::funcOne);
+ non_existent ("done", i);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "String::funcOne\[^\\n\]*inline copy in int main" "inline" } } */
+/* { dg-final { cleanup-tree-dump "inline" } } */
diff --git a/gcc/testsuite/g++.dg/parse/crash27.C b/gcc/testsuite/g++.dg/parse/crash27.C
index 069436666d3..217928781d3 100644
--- a/gcc/testsuite/g++.dg/parse/crash27.C
+++ b/gcc/testsuite/g++.dg/parse/crash27.C
@@ -1,5 +1,4 @@
// Bug: 23225
void Dispatcher()
- (__builtin_offsetof (ArgsType, largeMsgLen))
- /* { dg-error "function " "function" { target *-*-* } 4 } */
+ (__builtin_offsetof (ArgsType, largeMsgLen)) // { dg-error "initialize|end of input" }
diff --git a/gcc/testsuite/g++.dg/parse/error15.C b/gcc/testsuite/g++.dg/parse/error15.C
index 5903a585e97..5d30b554369 100644
--- a/gcc/testsuite/g++.dg/parse/error15.C
+++ b/gcc/testsuite/g++.dg/parse/error15.C
@@ -35,4 +35,4 @@ struct C
typename N::A f7; // { dg-error "15: error: invalid use of template-name 'N::A' without an argument list" }
};
-// { dg-bogus "bogus excess errors in declaration" "bogus excess errors in declaration" { xfail *-*-* } 17 }
+// { dg-bogus "bogus excess errors in declaration" "bogus excess errors in declaration" { target *-*-* } 17 }
diff --git a/gcc/testsuite/g++.dg/template/crash60.C b/gcc/testsuite/g++.dg/template/crash60.C
index 9e1d88b2432..c579775917e 100644
--- a/gcc/testsuite/g++.dg/template/crash60.C
+++ b/gcc/testsuite/g++.dg/template/crash60.C
@@ -5,5 +5,5 @@ struct A
template<int> void foo(X); // { dg-error "declared" }
};
-template<int> void f()(0); // { dg-error "initialized" }
+template<int> void f()(0); // { dg-error "initialize" }
diff --git a/gcc/testsuite/g++.dg/template/crash7.C b/gcc/testsuite/g++.dg/template/crash7.C
index 5b17928f5bb..ae07d91e739 100644
--- a/gcc/testsuite/g++.dg/template/crash7.C
+++ b/gcc/testsuite/g++.dg/template/crash7.C
@@ -6,8 +6,10 @@
// nested type.
template <typename> struct A
-{ // { dg-error "candidates" }
+{ // { not-dg-error "candidates" }
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
-A<void> a; // { dg-error "instantiated|no match" }
+A<void> a; // { not-dg-error "instantiated|no match" }
+// We currently don't give the "no match" error because we don't add the
+// invalid constructor template to TYPE_METHODS.
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr19637.C b/gcc/testsuite/g++.dg/tree-ssa/pr19637.C
index 2d1dcceba42..cf70e404123 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr19637.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr19637.C
@@ -29,5 +29,6 @@ int foo_void_offset(void)
return reinterpret_cast<Foo *>(&i[0])->i[0];
}
-/* { dg-final { scan-tree-dump-times "return 1;" 3 "dom1" } } */
+/* Regarding the xfail, see PR36143. */
+/* { dg-final { scan-tree-dump-times "return 1;" 3 "dom1" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc/testsuite/g++.dg/warn/pr23075.C b/gcc/testsuite/g++.dg/warn/pr23075.C
index 1521b658139..e5b1b483d76 100644
--- a/gcc/testsuite/g++.dg/warn/pr23075.C
+++ b/gcc/testsuite/g++.dg/warn/pr23075.C
@@ -6,4 +6,4 @@ int
foo (void)
{
return; // { dg-error "with no value" }
-} // { dg-bogus "control reaches end" }
+} // { dg-warning "no return statement" }
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
index 9e72fb5cbb0..74df601554e 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
@@ -10,4 +10,4 @@ public:
A &f(A &a) {// { dg-error "" } new decl.*
std::cout << "Blah\n";
-}
+} // { dg-error "no return statement" }
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/report.C b/gcc/testsuite/g++.old-deja/g++.jason/report.C
index e2d805e082c..f4e02a4dc35 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/report.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/report.C
@@ -56,7 +56,7 @@ bar2 baz (X::Y y) // { dg-error "" } in this context
bar2 wa [5];
wa[0] = baz(f);
undef2 (1); // { dg-error "" } implicit declaration
-}
+} // { dg-error "no return statement" }
int ninny ()
{
@@ -71,4 +71,4 @@ int ninny ()
int darg (char X::*p)
{
undef3 (1); // { dg-error "" } implicit declaration
-}
+} // { dg-error "no return statement" }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/error2.C b/gcc/testsuite/g++.old-deja/g++.pt/error2.C
index 2f777afdc70..40f7a7cb67f 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/error2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/error2.C
@@ -2,7 +2,7 @@
// Origin: Carl Nygard <cnygard@bellatlantic.net>
template <class RT>
-class Test { // { dg-error "" } in instantiation
+class Test {
public:
Test(const RT& c = RT()) {} // { dg-error "" } reference to void
};
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr11832.c b/gcc/testsuite/gcc.c-torture/compile/pr11832.c
index 88469ff6940..60017d3fb88 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr11832.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr11832.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* Currently ICEs for MIPS and PowerPC; see PR33642. */
-/* { dg-xfail-if "PR33642" { mips*-*-* powerpc*-*-linux* } { "*" } { "" } } */
+/* Currently ICEs for MIPS, CRIS and PowerPC; see PR33642. */
+/* { dg-xfail-if "PR33642" { mips*-*-* powerpc*-*-linux* cris-*-* crisv32-*-* } { "*" } { "" } } */
/* Currently ICEs for (x86 && ilp32 && pic). */
/* { dg-xfail-if "PR33642/36240" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */
/* { dg-prune-output ".*internal compiler error.*" }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr33009.c b/gcc/testsuite/gcc.c-torture/compile/pr33009.c
index 79a4b62a3a6..026162c2e70 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr33009.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr33009.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* Currently ICEs for MIPS and PowerPC; see PR33642. */
-/* { dg-xfail-if "PR33642" { mips*-*-* powerpc*-*-linux* } { "*" } { "" } } */
+/* Currently ICEs for MIPS, CRIS and PowerPC; see PR33642. */
+/* { dg-xfail-if "PR33642" { mips*-*-* powerpc*-*-linux* cris-*-* crisv32-*-* } { "*" } { "" } } */
/* Currently ICEs for (x86 && ilp32 && pic). */
/* { dg-xfail-if "PR33642/36240" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */
/* { dg-prune-output ".*internal compiler error.*" }
diff --git a/gcc/testsuite/gcc.c-torture/execute/20080719-1.c b/gcc/testsuite/gcc.c-torture/execute/20080719-1.c
new file mode 100644
index 00000000000..694abcbf985
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20080719-1.c
@@ -0,0 +1,65 @@
+typedef unsigned int u32;
+
+static const u32 deadfish = 0xdeadf155;
+
+static const u32 cfb_tab8_be[] = {
+ 0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
+ 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
+ 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
+ 0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+};
+
+static const u32 cfb_tab8_le[] = {
+ 0x00000000,0xff000000,0x00ff0000,0xffff0000,
+ 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+ 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+ 0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
+};
+
+static const u32 cfb_tab16_be[] = {
+ 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
+};
+
+static const u32 cfb_tab16_le[] = {
+ 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
+};
+
+static const u32 cfb_tab32[] = {
+ 0x00000000, 0xffffffff
+};
+
+
+
+
+
+
+const u32 *xxx(int bpp)
+{
+ const u32 *tab;
+
+if (0) return &deadfish;
+
+ switch (bpp) {
+ case 8:
+ tab = cfb_tab8_be;
+ break;
+ case 16:
+ tab = cfb_tab16_be;
+ break;
+ case 32:
+ default:
+ tab = cfb_tab32;
+ break;
+ }
+
+ return tab;
+}
+
+int main(void)
+{
+ const u32 *a = xxx(8);
+ int b = a[0];
+ if (b != cfb_tab8_be[0])
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c b/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c
new file mode 100644
index 00000000000..63b2bac5de8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c
@@ -0,0 +1,24 @@
+/* PR 35058: -Werror= works only with some warnings. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic -Werror=declaration-after-statement" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i; /* { dg-error "" "declaration-after-statement" } */
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 }; /* { dg-error "" "declaration-after-statement" } */
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/Wpointer-arith.c b/gcc/testsuite/gcc.dg/Wpointer-arith.c
new file mode 100644
index 00000000000..d7a19079cc4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wpointer-arith.c
@@ -0,0 +1,10 @@
+/* PR 35058: -Werror= works only with some warnings. */
+/* { dg-do compile } */
+/* { dg-options "-Werror=pointer-arith" } */
+void *a;
+
+void *test(){
+ int x=5;
+ if(a) a++; /* { dg-error "wrong type argument to increment" } */
+ return a+x; /* { dg-error "pointer of type" } */
+}
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c
index 7780fa6fcd6..73719157411 100644
--- a/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c
@@ -11,9 +11,9 @@ int foo() {
float* r;
if (flag) {
- q = (float*) &x; /* { dg-warning "type-punn" } */
+ q = (float*) &x; /* { dg-warning "type-punn" "" { xfail *-*-* } } */
} else {
- q = (float*) &y; /* { dg-warning "type-punn" } */
+ q = (float*) &y; /* { dg-warning "type-punn" "" { xfail *-*-* } } */
}
*q = 1.0;
diff --git a/gcc/testsuite/gcc.dg/cpp/line6.c b/gcc/testsuite/gcc.dg/cpp/line6.c
new file mode 100644
index 00000000000..c59ea3af7f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/line6.c
@@ -0,0 +1,7 @@
+/* PR 28079 */
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+#line 18446744073709551616 /* { dg-warning "line number out of range" } */
+
+#line 12312312312435 /* { dg-warning "line number out of range" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/ipa/iinline-1.c b/gcc/testsuite/gcc.dg/ipa/iinline-1.c
new file mode 100644
index 00000000000..da548f46648
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/iinline-1.c
@@ -0,0 +1,26 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void non_existent(int);
+
+static void hooray ()
+{
+ non_existent (1);
+}
+
+static void hiphip (void (*f)())
+{
+ non_existent (2);
+ f ();
+}
+
+int main (int argc, int *argv[])
+{
+ hiphip (hooray);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in main" "inline" } } */
+/* { dg-final { cleanup-tree-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/modif-1.c b/gcc/testsuite/gcc.dg/ipa/modif-1.c
new file mode 100644
index 00000000000..7d160cb7e74
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/modif-1.c
@@ -0,0 +1,44 @@
+/* Verify that modification analysis detects modfications. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+struct whatever
+{
+ int first;
+ unsigned second;
+};
+
+void func1 (struct whatever w);
+void func2 (struct whatever *pw);
+void func3 (int i);
+void func4 (int *pi);
+
+void the_test (struct whatever u, struct whatever v,
+ struct whatever w, struct whatever x,
+ int i, int j, int k, int l)
+{
+ struct whatever *pw = &w;
+ int *pk = &k;
+
+ j = l+3;
+ v.first = 9;
+
+ func1 (u);
+ func1 (v);
+ func2 (pw);
+ func2 (&x);
+ func3 (i);
+ func3 (j);
+ func4 (pk);
+ func4 (&l);
+}
+
+/* { dg-final { scan-ipa-dump-not "param 0 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump "param 1 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump "param 2 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump "param 3 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump-not "param 4 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump "param 5 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump "param 6 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { scan-ipa-dump "param 7 flags:\[^\\n\]*modified" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/pch/valid-3.c b/gcc/testsuite/gcc.dg/pch/valid-3.c
deleted file mode 100644
index c7884f993a0..00000000000
--- a/gcc/testsuite/gcc.dg/pch/valid-3.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-options "-I. -Winvalid-pch -fno-unit-at-a-time" } */
-
-#include "valid-3.h"/* { dg-warning "settings for -funit-at-a-time do not match" } */
-/* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
-/* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
-int x;
diff --git a/gcc/testsuite/gcc.dg/pch/valid-3.hs b/gcc/testsuite/gcc.dg/pch/valid-3.hs
deleted file mode 100644
index 2a0af94c9f7..00000000000
--- a/gcc/testsuite/gcc.dg/pch/valid-3.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-/* { dg-options "-I. -Winvalid-pch -funit-at-a-time" } */
-
-extern int x;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
index 5eb71d9be9e..92b60999495 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
@@ -25,5 +25,5 @@ int foo (int n, int m)
outermost "k" loop: the 4 comes from the instantiation of the
number of iterations of loop "j". */
-/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" } } */
+/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c
index d3264367db8..e26fa9302b4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c
@@ -14,5 +14,5 @@ int main(int *a, int argc)
e = *a;
return d + e;
}
-/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
index 3253afe2927..bb48c0a391b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
@@ -25,6 +25,6 @@ void foo(double (*q)[4], struct Foo *tmp1)
}
}
-/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
-/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" } } */
+/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
index d2d5e01bcc4..61c5e00b554 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
@@ -27,6 +27,6 @@ void foo(double (*q)[4])
}
}
-/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
-/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" } } */
+/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
index aced64977ea..68fbb454c76 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
@@ -18,6 +18,6 @@ int foo(int i, int j, int k)
return f.doms[0LL].dom;
}
-/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c
index bd81831eba8..d93a1a21456 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c
@@ -29,10 +29,10 @@ intflt foo(intflt j)
return a.u.k;
}
-/* { dg-final { scan-tree-dump-times "Inserted pretmp" 1 "fre" } } */
-/* { dg-final { scan-tree-dump-times "Replaced a.u.f with pretmp" 3 "fre" } } */
-/* { dg-final { scan-tree-dump-times "Replaced a.u.k with j" 1 "fre" } } */
-/* { dg-final { scan-tree-dump "= VIEW_CONVERT_EXPR<float>\\\(j_" "fre" } } */
-/* { dg-final { scan-tree-dump "return j" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "Inserted pretmp" 1 "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Replaced a.u.f with pretmp" 3 "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Replaced a.u.k with j" 1 "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "= VIEW_CONVERT_EXPR<float>\\\(j_" "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "return j" "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c
index 6e17bd531b3..1494dbbbd94 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c
@@ -28,6 +28,6 @@ intflt foo(int i, int b)
}
}
-/* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre" } } */
-/* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre" } } */
+/* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c
index 18595ed6fe5..24c4ae37167 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c
@@ -23,6 +23,6 @@ void __frame_state_for1 (volatile char *state_in)
}
}
-/* { dg-final { scan-tree-dump-times "Eliminated: 1" 2 "fre" } } */
-/* { dg-final { scan-tree-dump-times "Insertions: 1" 2 "fre" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 2 "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Insertions: 1" 2 "fre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c
index 518fda854e6..f080989d1de 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c
@@ -12,5 +12,5 @@ __SIZE_TYPE__ mystrlen (const char *s)
return strlen(s);
}
-/* { dg-final { scan-tree-dump "= 0;" "optimized" } } */
+/* { dg-final { scan-tree-dump "= 0;" "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/winline-4.c b/gcc/testsuite/gcc.dg/winline-4.c
deleted file mode 100644
index 5ce0a02202d..00000000000
--- a/gcc/testsuite/gcc.dg/winline-4.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-Winline -O1 -fno-unit-at-a-time" } */
-
-inline int q(void); /* { dg-warning "body not available" } */
-inline int t(void)
-{
- return q(); /* { dg-warning "called from here" } */
-}
-int q(void)
-{
-}
diff --git a/gcc/testsuite/gcc.target/i386/20080723-1.c b/gcc/testsuite/gcc.target/i386/20080723-1.c
new file mode 100644
index 00000000000..a2ed5bf86df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/20080723-1.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+static inline __attribute__((always_inline))
+void
+prefetch (void *x)
+{
+ asm volatile("prefetcht0 %0" : : "m" (*(unsigned long *)x));
+}
+
+struct hlist_head
+{
+ struct hlist_node *first;
+};
+
+struct hlist_node
+{
+ struct hlist_node *next;
+ unsigned long i_ino;
+};
+
+struct hlist_node * find_inode_fast(struct hlist_head *head, unsigned long ino)
+{
+ struct hlist_node *node;
+
+ for (node = head->first;
+ node && (prefetch (node->next), 1);
+ node = node->next)
+ {
+ if (node->i_ino == ino)
+ break;
+ }
+ return node ? node : 0;
+}
+
+struct hlist_node g2;
+struct hlist_node g1 = { &g2 };
+struct hlist_head h = { &g1 };
+
+int
+main()
+{
+ if (find_inode_fast (&h, 1) != 0)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/cmov8.c b/gcc/testsuite/gcc.target/i386/cmov8.c
new file mode 100644
index 00000000000..639fb62b0c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/cmov8.c
@@ -0,0 +1,13 @@
+/* PR target/36936 */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=i686" } */
+/* { dg-final { scan-assembler "cmov\[^8\]" } } */
+
+int
+foo (int x)
+{
+ if (x < 0)
+ x = 1;
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/i386/cold-1.c b/gcc/testsuite/gcc.target/i386/cold-1.c
new file mode 100644
index 00000000000..bcdc471eb58
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/cold-1.c
@@ -0,0 +1,13 @@
+/* Test whether using attribute((cold)) really turns on -Os. Do this test
+ by checking whether strcpy calls the library function rather than doing
+ the move inline. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=k8" } */
+/* { dg-final { scan-assembler "(jmp|call)\t(.*)strcpy" } } */
+
+void cold (char *) __attribute__((__cold__));
+
+void cold (char *a)
+{
+ __builtin_strcpy (a, "testing 1.2.3 testing 1.2.3");
+}
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-1.c b/gcc/testsuite/gcc.target/i386/funcspec-1.c
new file mode 100644
index 00000000000..1ee43a0bbb8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-1.c
@@ -0,0 +1,34 @@
+/* Test whether using target specific options, we can generate SSE2 code on
+ 32-bit, which does not generate SSE2 by default, but still generate 387 code
+ for a function that doesn't use attribute((option)). */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O3 -ftree-vectorize -march=i386" } */
+/* { dg-final { scan-assembler "addps\[ \t\]" } } */
+/* { dg-final { scan-assembler "fsubs\[ \t\]" } } */
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+static float a[SIZE] __attribute__((__aligned__(16)));
+static float b[SIZE] __attribute__((__aligned__(16)));
+static float c[SIZE] __attribute__((__aligned__(16)));
+
+void sse_addnums (void) __attribute__ ((__option__ ("sse2")));
+
+void
+sse_addnums (void)
+{
+ int i = 0;
+ for (; i < SIZE; ++i)
+ a[i] = b[i] + c[i];
+}
+
+void
+i387_subnums (void)
+{
+ int i = 0;
+ for (; i < SIZE; ++i)
+ a[i] = b[i] - c[i];
+}
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-10.c b/gcc/testsuite/gcc.target/i386/funcspec-10.c
new file mode 100644
index 00000000000..9446cdf8f35
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-10.c
@@ -0,0 +1,15 @@
+/* PR target/36936 */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=i686" } */
+/* { dg-final { scan-assembler-not "cmov" } } */
+
+extern int foo (int) __attribute__((__option__("arch=i386")));
+
+int
+foo (int x)
+{
+ if (x < 0)
+ x = 1;
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-11.c b/gcc/testsuite/gcc.target/i386/funcspec-11.c
new file mode 100644
index 00000000000..ec32e0c669e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-11.c
@@ -0,0 +1,15 @@
+/* PR target/36936 */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=i386" } */
+/* { dg-final { scan-assembler "cmov" } } */
+
+extern int foo (int) __attribute__((__option__("arch=i686")));
+
+int
+foo (int x)
+{
+ if (x < 0)
+ x = 1;
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-2.c b/gcc/testsuite/gcc.target/i386/funcspec-2.c
new file mode 100644
index 00000000000..eb6f48bae1f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-2.c
@@ -0,0 +1,99 @@
+/* Test whether using target specific options, we can generate SSE5 code. */
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -march=k8" } */
+
+extern void exit (int);
+
+#define SSE5_ATTR __attribute__((__option__("sse5,fused-madd")))
+extern float flt_mul_add (float a, float b, float c) SSE5_ATTR;
+extern float flt_mul_sub (float a, float b, float c) SSE5_ATTR;
+extern float flt_neg_mul_add (float a, float b, float c) SSE5_ATTR;
+extern float flt_neg_mul_sub (float a, float b, float c) SSE5_ATTR;
+
+extern double dbl_mul_add (double a, double b, double c) SSE5_ATTR;
+extern double dbl_mul_sub (double a, double b, double c) SSE5_ATTR;
+extern double dbl_neg_mul_add (double a, double b, double c) SSE5_ATTR;
+extern double dbl_neg_mul_sub (double a, double b, double c) SSE5_ATTR;
+
+float
+flt_mul_add (float a, float b, float c)
+{
+ return (a * b) + c;
+}
+
+double
+dbl_mul_add (double a, double b, double c)
+{
+ return (a * b) + c;
+}
+
+float
+flt_mul_sub (float a, float b, float c)
+{
+ return (a * b) - c;
+}
+
+double
+dbl_mul_sub (double a, double b, double c)
+{
+ return (a * b) - c;
+}
+
+float
+flt_neg_mul_add (float a, float b, float c)
+{
+ return (-(a * b)) + c;
+}
+
+double
+dbl_neg_mul_add (double a, double b, double c)
+{
+ return (-(a * b)) + c;
+}
+
+float
+flt_neg_mul_sub (float a, float b, float c)
+{
+ return (-(a * b)) - c;
+}
+
+double
+dbl_neg_mul_sub (double a, double b, double c)
+{
+ return (-(a * b)) - c;
+}
+
+float f[10] = { 2, 3, 4 };
+double d[10] = { 2, 3, 4 };
+
+int main ()
+{
+ f[3] = flt_mul_add (f[0], f[1], f[2]);
+ f[4] = flt_mul_sub (f[0], f[1], f[2]);
+ f[5] = flt_neg_mul_add (f[0], f[1], f[2]);
+ f[6] = flt_neg_mul_sub (f[0], f[1], f[2]);
+
+ d[3] = dbl_mul_add (d[0], d[1], d[2]);
+ d[4] = dbl_mul_sub (d[0], d[1], d[2]);
+ d[5] = dbl_neg_mul_add (d[0], d[1], d[2]);
+ d[6] = dbl_neg_mul_sub (d[0], d[1], d[2]);
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "fmaddss" } } */
+/* { dg-final { scan-assembler "fmaddsd" } } */
+/* { dg-final { scan-assembler "fmsubss" } } */
+/* { dg-final { scan-assembler "fmsubsd" } } */
+/* { dg-final { scan-assembler "fnmaddss" } } */
+/* { dg-final { scan-assembler "fnmaddsd" } } */
+/* { dg-final { scan-assembler "fnmsubss" } } */
+/* { dg-final { scan-assembler "fnmsubsd" } } */
+/* { dg-final { scan-assembler "call\t(.*)flt_mul_add" } } */
+/* { dg-final { scan-assembler "call\t(.*)flt_mul_sub" } } */
+/* { dg-final { scan-assembler "call\t(.*)flt_neg_mul_add" } } */
+/* { dg-final { scan-assembler "call\t(.*)flt_neg_mul_sub" } } */
+/* { dg-final { scan-assembler "call\t(.*)dbl_mul_add" } } */
+/* { dg-final { scan-assembler "call\t(.*)dbl_mul_sub" } } */
+/* { dg-final { scan-assembler "call\t(.*)dbl_neg_mul_add" } } */
+/* { dg-final { scan-assembler "call\t(.*)dbl_neg_mul_sub" } } */
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-3.c b/gcc/testsuite/gcc.target/i386/funcspec-3.c
new file mode 100644
index 00000000000..80ec23da09f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-3.c
@@ -0,0 +1,66 @@
+/* Test whether using target specific options, we can generate popcnt by
+ setting the architecture. */
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -march=k8" } */
+
+extern void exit (int);
+extern void abort (void);
+
+#define SSE4A_ATTR __attribute__((__option__("arch=amdfam10")))
+#define SSE42_ATTR __attribute__((__option__("sse4.2")))
+
+static int sse4a_pop_i (int a) SSE4A_ATTR;
+static long sse42_pop_l (long a) SSE42_ATTR;
+static int generic_pop_i (int a);
+static long generic_pop_l (long a);
+
+static
+int sse4a_pop_i (int a)
+{
+ return __builtin_popcount (a);
+}
+
+static
+long sse42_pop_l (long a)
+{
+ return __builtin_popcountl (a);
+}
+
+static
+int generic_pop_i (int a)
+{
+ return __builtin_popcount (a);
+}
+
+static
+long generic_pop_l (long a)
+{
+ return __builtin_popcountl (a);
+}
+
+int five = 5;
+long seven = 7;
+
+int main ()
+{
+ if (sse4a_pop_i (five) != 2)
+ abort ();
+
+ if (sse42_pop_l (seven) != 3L)
+ abort ();
+
+ if (generic_pop_i (five) != 2)
+ abort ();
+
+ if (generic_pop_l (seven) != 3L)
+ abort ();
+
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "popcntl" } } */
+/* { dg-final { scan-assembler "popcntq" } } */
+/* { dg-final { scan-assembler "call\t(.*)sse4a_pop_i" } } */
+/* { dg-final { scan-assembler "call\t(.*)sse42_pop_l" } } */
+/* { dg-final { scan-assembler "call\t(.*)popcountdi2" } } */
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-4.c b/gcc/testsuite/gcc.target/i386/funcspec-4.c
new file mode 100644
index 00000000000..71251c314bb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-4.c
@@ -0,0 +1,14 @@
+/* Test some error conditions with function specific options. */
+/* { dg-do compile } */
+
+/* no sse500 switch */
+extern void error1 (void) __attribute__((__option__("sse500"))); /* { dg-error "unknown" } */
+
+/* Multiple arch switches */
+extern void error2 (void) __attribute__((__option__("arch=core2,arch=k8"))); /* { dg-error "already specified" } */
+
+/* Unknown tune target */
+extern void error3 (void) __attribute__((__option__("tune=foobar"))); /* { dg-error "bad value" } */
+
+/* option on a variable */
+extern int error4 __attribute__((__option__("sse2"))); /* { dg-warning "ignored" } */
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-5.c b/gcc/testsuite/gcc.target/i386/funcspec-5.c
new file mode 100644
index 00000000000..d4204bb1411
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-5.c
@@ -0,0 +1,125 @@
+/* Test whether all of the 32-bit function specific options are accepted
+ without error. */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+
+extern void test_abm (void) __attribute__((__option__("abm")));
+extern void test_aes (void) __attribute__((__option__("aes")));
+extern void test_fused_madd (void) __attribute__((__option__("fused-madd")));
+extern void test_mmx (void) __attribute__((__option__("mmx")));
+extern void test_pclmul (void) __attribute__((__option__("pclmul")));
+extern void test_popcnt (void) __attribute__((__option__("popcnt")));
+extern void test_recip (void) __attribute__((__option__("recip")));
+extern void test_sse (void) __attribute__((__option__("sse")));
+extern void test_sse2 (void) __attribute__((__option__("sse2")));
+extern void test_sse3 (void) __attribute__((__option__("sse3")));
+extern void test_sse4 (void) __attribute__((__option__("sse4")));
+extern void test_sse4_1 (void) __attribute__((__option__("sse4.1")));
+extern void test_sse4_2 (void) __attribute__((__option__("sse4.2")));
+extern void test_sse4a (void) __attribute__((__option__("sse4a")));
+extern void test_sse5 (void) __attribute__((__option__("sse5")));
+extern void test_ssse3 (void) __attribute__((__option__("ssse3")));
+
+extern void test_no_abm (void) __attribute__((__option__("no-abm")));
+extern void test_no_aes (void) __attribute__((__option__("no-aes")));
+extern void test_no_fused_madd (void) __attribute__((__option__("no-fused-madd")));
+extern void test_no_mmx (void) __attribute__((__option__("no-mmx")));
+extern void test_no_pclmul (void) __attribute__((__option__("no-pclmul")));
+extern void test_no_popcnt (void) __attribute__((__option__("no-popcnt")));
+extern void test_no_recip (void) __attribute__((__option__("no-recip")));
+extern void test_no_sse (void) __attribute__((__option__("no-sse")));
+extern void test_no_sse2 (void) __attribute__((__option__("no-sse2")));
+extern void test_no_sse3 (void) __attribute__((__option__("no-sse3")));
+extern void test_no_sse4 (void) __attribute__((__option__("no-sse4")));
+extern void test_no_sse4_1 (void) __attribute__((__option__("no-sse4.1")));
+extern void test_no_sse4_2 (void) __attribute__((__option__("no-sse4.2")));
+extern void test_no_sse4a (void) __attribute__((__option__("no-sse4a")));
+extern void test_no_sse5 (void) __attribute__((__option__("no-sse5")));
+extern void test_no_ssse3 (void) __attribute__((__option__("no-ssse3")));
+
+extern void test_arch_i386 (void) __attribute__((__option__("arch=i386")));
+extern void test_arch_i486 (void) __attribute__((__option__("arch=i486")));
+extern void test_arch_i586 (void) __attribute__((__option__("arch=i586")));
+extern void test_arch_pentium (void) __attribute__((__option__("arch=pentium")));
+extern void test_arch_pentium_mmx (void) __attribute__((__option__("arch=pentium-mmx")));
+extern void test_arch_winchip_c6 (void) __attribute__((__option__("arch=winchip-c6")));
+extern void test_arch_winchip2 (void) __attribute__((__option__("arch=winchip2")));
+extern void test_arch_c3 (void) __attribute__((__option__("arch=c3")));
+extern void test_arch_c3_2 (void) __attribute__((__option__("arch=c3-2")));
+extern void test_arch_i686 (void) __attribute__((__option__("arch=i686")));
+extern void test_arch_pentiumpro (void) __attribute__((__option__("arch=pentiumpro")));
+extern void test_arch_pentium2 (void) __attribute__((__option__("arch=pentium2")));
+extern void test_arch_pentium3 (void) __attribute__((__option__("arch=pentium3")));
+extern void test_arch_pentium3m (void) __attribute__((__option__("arch=pentium3m")));
+extern void test_arch_pentium_m (void) __attribute__((__option__("arch=pentium-m")));
+extern void test_arch_pentium4 (void) __attribute__((__option__("arch=pentium4")));
+extern void test_arch_pentium4m (void) __attribute__((__option__("arch=pentium4m")));
+extern void test_arch_prescott (void) __attribute__((__option__("arch=prescott")));
+extern void test_arch_nocona (void) __attribute__((__option__("arch=nocona")));
+extern void test_arch_core2 (void) __attribute__((__option__("arch=core2")));
+extern void test_arch_geode (void) __attribute__((__option__("arch=geode")));
+extern void test_arch_k6 (void) __attribute__((__option__("arch=k6")));
+extern void test_arch_k6_2 (void) __attribute__((__option__("arch=k6-2")));
+extern void test_arch_k6_3 (void) __attribute__((__option__("arch=k6-3")));
+extern void test_arch_athlon (void) __attribute__((__option__("arch=athlon")));
+extern void test_arch_athlon_tbird (void) __attribute__((__option__("arch=athlon-tbird")));
+extern void test_arch_athlon_4 (void) __attribute__((__option__("arch=athlon-4")));
+extern void test_arch_athlon_xp (void) __attribute__((__option__("arch=athlon-xp")));
+extern void test_arch_athlon_mp (void) __attribute__((__option__("arch=athlon-mp")));
+extern void test_arch_k8 (void) __attribute__((__option__("arch=k8")));
+extern void test_arch_k8_sse3 (void) __attribute__((__option__("arch=k8-sse3")));
+extern void test_arch_opteron (void) __attribute__((__option__("arch=opteron")));
+extern void test_arch_opteron_sse3 (void) __attribute__((__option__("arch=opteron-sse3")));
+extern void test_arch_athlon64 (void) __attribute__((__option__("arch=athlon64")));
+extern void test_arch_athlon64_sse3 (void) __attribute__((__option__("arch=athlon64-sse3")));
+extern void test_arch_athlon_fx (void) __attribute__((__option__("arch=athlon-fx")));
+extern void test_arch_amdfam10 (void) __attribute__((__option__("arch=amdfam10")));
+extern void test_arch_barcelona (void) __attribute__((__option__("arch=barcelona")));
+extern void test_arch_foo (void) __attribute__((__option__("arch=foo"))); /* { dg-error "bad value" } */
+
+extern void test_tune_i386 (void) __attribute__((__option__("tune=i386")));
+extern void test_tune_i486 (void) __attribute__((__option__("tune=i486")));
+extern void test_tune_i586 (void) __attribute__((__option__("tune=i586")));
+extern void test_tune_pentium (void) __attribute__((__option__("tune=pentium")));
+extern void test_tune_pentium_mmx (void) __attribute__((__option__("tune=pentium-mmx")));
+extern void test_tune_winchip_c6 (void) __attribute__((__option__("tune=winchip-c6")));
+extern void test_tune_winchip2 (void) __attribute__((__option__("tune=winchip2")));
+extern void test_tune_c3 (void) __attribute__((__option__("tune=c3")));
+extern void test_tune_c3_2 (void) __attribute__((__option__("tune=c3-2")));
+extern void test_tune_i686 (void) __attribute__((__option__("tune=i686")));
+extern void test_tune_pentiumpro (void) __attribute__((__option__("tune=pentiumpro")));
+extern void test_tune_pentium2 (void) __attribute__((__option__("tune=pentium2")));
+extern void test_tune_pentium3 (void) __attribute__((__option__("tune=pentium3")));
+extern void test_tune_pentium3m (void) __attribute__((__option__("tune=pentium3m")));
+extern void test_tune_pentium_m (void) __attribute__((__option__("tune=pentium-m")));
+extern void test_tune_pentium4 (void) __attribute__((__option__("tune=pentium4")));
+extern void test_tune_pentium4m (void) __attribute__((__option__("tune=pentium4m")));
+extern void test_tune_prescott (void) __attribute__((__option__("tune=prescott")));
+extern void test_tune_nocona (void) __attribute__((__option__("tune=nocona")));
+extern void test_tune_core2 (void) __attribute__((__option__("tune=core2")));
+extern void test_tune_geode (void) __attribute__((__option__("tune=geode")));
+extern void test_tune_k6 (void) __attribute__((__option__("tune=k6")));
+extern void test_tune_k6_2 (void) __attribute__((__option__("tune=k6-2")));
+extern void test_tune_k6_3 (void) __attribute__((__option__("tune=k6-3")));
+extern void test_tune_athlon (void) __attribute__((__option__("tune=athlon")));
+extern void test_tune_athlon_tbird (void) __attribute__((__option__("tune=athlon-tbird")));
+extern void test_tune_athlon_4 (void) __attribute__((__option__("tune=athlon-4")));
+extern void test_tune_athlon_xp (void) __attribute__((__option__("tune=athlon-xp")));
+extern void test_tune_athlon_mp (void) __attribute__((__option__("tune=athlon-mp")));
+extern void test_tune_k8 (void) __attribute__((__option__("tune=k8")));
+extern void test_tune_k8_sse3 (void) __attribute__((__option__("tune=k8-sse3")));
+extern void test_tune_opteron (void) __attribute__((__option__("tune=opteron")));
+extern void test_tune_opteron_sse3 (void) __attribute__((__option__("tune=opteron-sse3")));
+extern void test_tune_athlon64 (void) __attribute__((__option__("tune=athlon64")));
+extern void test_tune_athlon64_sse3 (void) __attribute__((__option__("tune=athlon64-sse3")));
+extern void test_tune_athlon_fx (void) __attribute__((__option__("tune=athlon-fx")));
+extern void test_tune_amdfam10 (void) __attribute__((__option__("tune=amdfam10")));
+extern void test_tune_barcelona (void) __attribute__((__option__("tune=barcelona")));
+extern void test_tune_generic (void) __attribute__((__option__("tune=generic")));
+extern void test_tune_foo (void) __attribute__((__option__("tune=foo"))); /* { dg-error "bad value" } */
+
+extern void test_fpmath_sse (void) __attribute__((__option__("sse2,fpmath=sse")));
+extern void test_fpmath_387 (void) __attribute__((__option__("sse2,fpmath=387")));
+extern void test_fpmath_sse_387 (void) __attribute__((__option__("sse2,fpmath=sse+387")));
+extern void test_fpmath_387_sse (void) __attribute__((__option__("sse2,fpmath=387+sse")));
+extern void test_fpmath_both (void) __attribute__((__option__("sse2,fpmath=both")));
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c
new file mode 100644
index 00000000000..0c915975894
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c
@@ -0,0 +1,71 @@
+/* Test whether all of the 64-bit function specific options are accepted
+ without error. */
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+
+extern void test_abm (void) __attribute__((__option__("abm")));
+extern void test_aes (void) __attribute__((__option__("aes")));
+extern void test_fused_madd (void) __attribute__((__option__("fused-madd")));
+extern void test_mmx (void) __attribute__((__option__("mmx")));
+extern void test_pclmul (void) __attribute__((__option__("pclmul")));
+extern void test_popcnt (void) __attribute__((__option__("popcnt")));
+extern void test_recip (void) __attribute__((__option__("recip")));
+extern void test_sse (void) __attribute__((__option__("sse")));
+extern void test_sse2 (void) __attribute__((__option__("sse2")));
+extern void test_sse3 (void) __attribute__((__option__("sse3")));
+extern void test_sse4 (void) __attribute__((__option__("sse4")));
+extern void test_sse4_1 (void) __attribute__((__option__("sse4.1")));
+extern void test_sse4_2 (void) __attribute__((__option__("sse4.2")));
+extern void test_sse4a (void) __attribute__((__option__("sse4a")));
+extern void test_sse5 (void) __attribute__((__option__("sse5")));
+extern void test_ssse3 (void) __attribute__((__option__("ssse3")));
+
+extern void test_no_abm (void) __attribute__((__option__("no-abm")));
+extern void test_no_aes (void) __attribute__((__option__("no-aes")));
+extern void test_no_fused_madd (void) __attribute__((__option__("no-fused-madd")));
+extern void test_no_mmx (void) __attribute__((__option__("no-mmx")));
+extern void test_no_pclmul (void) __attribute__((__option__("no-pclmul")));
+extern void test_no_popcnt (void) __attribute__((__option__("no-popcnt")));
+extern void test_no_recip (void) __attribute__((__option__("no-recip")));
+extern void test_no_sse (void) __attribute__((__option__("no-sse")));
+extern void test_no_sse2 (void) __attribute__((__option__("no-sse2")));
+extern void test_no_sse3 (void) __attribute__((__option__("no-sse3")));
+extern void test_no_sse4 (void) __attribute__((__option__("no-sse4")));
+extern void test_no_sse4_1 (void) __attribute__((__option__("no-sse4.1")));
+extern void test_no_sse4_2 (void) __attribute__((__option__("no-sse4.2")));
+extern void test_no_sse4a (void) __attribute__((__option__("no-sse4a")));
+extern void test_no_sse5 (void) __attribute__((__option__("no-sse5")));
+extern void test_no_ssse3 (void) __attribute__((__option__("no-ssse3")));
+
+extern void test_arch_nocona (void) __attribute__((__option__("arch=nocona")));
+extern void test_arch_core2 (void) __attribute__((__option__("arch=core2")));
+extern void test_arch_k8 (void) __attribute__((__option__("arch=k8")));
+extern void test_arch_k8_sse3 (void) __attribute__((__option__("arch=k8-sse3")));
+extern void test_arch_opteron (void) __attribute__((__option__("arch=opteron")));
+extern void test_arch_opteron_sse3 (void) __attribute__((__option__("arch=opteron-sse3")));
+extern void test_arch_athlon64 (void) __attribute__((__option__("arch=athlon64")));
+extern void test_arch_athlon64_sse3 (void) __attribute__((__option__("arch=athlon64-sse3")));
+extern void test_arch_athlon_fx (void) __attribute__((__option__("arch=athlon-fx")));
+extern void test_arch_amdfam10 (void) __attribute__((__option__("arch=amdfam10")));
+extern void test_arch_barcelona (void) __attribute__((__option__("arch=barcelona")));
+extern void test_arch_foo (void) __attribute__((__option__("arch=foo"))); /* { dg-error "bad value" } */
+
+extern void test_tune_nocona (void) __attribute__((__option__("tune=nocona")));
+extern void test_tune_core2 (void) __attribute__((__option__("tune=core2")));
+extern void test_tune_k8 (void) __attribute__((__option__("tune=k8")));
+extern void test_tune_k8_sse3 (void) __attribute__((__option__("tune=k8-sse3")));
+extern void test_tune_opteron (void) __attribute__((__option__("tune=opteron")));
+extern void test_tune_opteron_sse3 (void) __attribute__((__option__("tune=opteron-sse3")));
+extern void test_tune_athlon64 (void) __attribute__((__option__("tune=athlon64")));
+extern void test_tune_athlon64_sse3 (void) __attribute__((__option__("tune=athlon64-sse3")));
+extern void test_tune_athlon_fx (void) __attribute__((__option__("tune=athlon-fx")));
+extern void test_tune_amdfam10 (void) __attribute__((__option__("tune=amdfam10")));
+extern void test_tune_barcelona (void) __attribute__((__option__("tune=barcelona")));
+extern void test_tune_generic (void) __attribute__((__option__("tune=generic")));
+extern void test_tune_foo (void) __attribute__((__option__("tune=foo"))); /* { dg-error "bad value" } */
+
+extern void test_fpmath_sse (void) __attribute__((__option__("sse2,fpmath=sse")));
+extern void test_fpmath_387 (void) __attribute__((__option__("sse2,fpmath=387")));
+extern void test_fpmath_sse_387 (void) __attribute__((__option__("sse2,fpmath=sse+387")));
+extern void test_fpmath_387_sse (void) __attribute__((__option__("sse2,fpmath=387+sse")));
+extern void test_fpmath_both (void) __attribute__((__option__("sse2,fpmath=both")));
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-7.c b/gcc/testsuite/gcc.target/i386/funcspec-7.c
new file mode 100644
index 00000000000..a65ae251978
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-7.c
@@ -0,0 +1,13 @@
+/* Test whether using target specific options, we can generate the reciprocal
+ square root instruction. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=k8 -mno-recip -mfpmath=sse -ffast-math" } */
+
+float do_recip (float a) __attribute__((__option__("recip")));
+float do_normal (float a);
+
+float do_recip (float a) { return 1.0f / __builtin_sqrtf (a); }
+float do_normal (float a) { return 1.0f / __builtin_sqrtf (a); }
+
+/* { dg-final { scan-assembler "sqrtss" } } */
+/* { dg-final { scan-assembler "rsqrtss" } } */
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-8.c b/gcc/testsuite/gcc.target/i386/funcspec-8.c
new file mode 100644
index 00000000000..115f60866a2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-8.c
@@ -0,0 +1,161 @@
+/* Test whether using target specific options, we can use the x86 builtin
+ functions in functions with the appropriate function specific options. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=k8 -mfpmath=sse" } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef int __m128w __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#ifdef __SSE3__
+#error "-msse3 should not be set for this test"
+#endif
+
+__m128d sse3_hsubpd (__m128d a, __m128d b) __attribute__((__option__("sse3")));
+__m128d generic_hsubpd (__m128d a, __m128d b);
+
+__m128d
+sse3_hsubpd (__m128d a, __m128d b)
+{
+ return __builtin_ia32_hsubpd (a, b);
+}
+
+__m128d
+generic_hsubpd (__m128d a, __m128d b)
+{
+ return __builtin_ia32_hsubpd (a, b); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __SSSE3__
+#error "-mssse3 should not be set for this test"
+#endif
+
+__m128w ssse3_psignd128 (__m128w a, __m128w b) __attribute__((__option__("ssse3")));
+__m128w generic_psignd (__m128w ab, __m128w b);
+
+__m128w
+ssse3_psignd128 (__m128w a, __m128w b)
+{
+ return __builtin_ia32_psignd128 (a, b);
+}
+
+__m128w
+generic_psignd128 (__m128w a, __m128w b)
+{
+ return __builtin_ia32_psignd128 (a, b); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __SSE4_1__
+#error "-msse4.1 should not be set for this test"
+#endif
+
+__m128d sse4_1_blendvpd (__m128d a, __m128d b, __m128d c) __attribute__((__option__("sse4.1")));
+__m128d generic_blendvpd (__m128d a, __m128d b, __m128d c);
+
+__m128d
+sse4_1_blendvpd (__m128d a, __m128d b, __m128d c)
+{
+ return __builtin_ia32_blendvpd (a, b, c);
+}
+
+__m128d
+generic_blendvpd (__m128d a, __m128d b, __m128d c)
+{
+ return __builtin_ia32_blendvpd (a, b, c); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __SSE4_2__
+#error "-msse4.2 should not be set for this test"
+#endif
+
+__m128i sse4_2_pcmpgtq (__m128i a, __m128i b) __attribute__((__option__("sse4.2")));
+__m128i generic_pcmpgtq (__m128i ab, __m128i b);
+
+__m128i
+sse4_2_pcmpgtq (__m128i a, __m128i b)
+{
+ return __builtin_ia32_pcmpgtq (a, b);
+}
+
+__m128i
+generic_pcmpgtq (__m128i a, __m128i b)
+{
+ return __builtin_ia32_pcmpgtq (a, b); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __SSE4A__
+#error "-msse4a should not be set for this test"
+#endif
+
+__m128i sse4_2_insertq (__m128i a, __m128i b) __attribute__((__option__("sse4a")));
+__m128i generic_insertq (__m128i ab, __m128i b);
+
+__m128i
+sse4_2_insertq (__m128i a, __m128i b)
+{
+ return __builtin_ia32_insertq (a, b);
+}
+
+__m128i
+generic_insertq (__m128i a, __m128i b)
+{
+ return __builtin_ia32_insertq (a, b); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __SSE5__
+#error "-msse5 should not be set for this test"
+#endif
+
+__m128d sse5_fmaddpd (__m128d a, __m128d b, __m128d c) __attribute__((__option__("sse5")));
+__m128d generic_fmaddpd (__m128d a, __m128d b, __m128d c);
+
+__m128d
+sse5_fmaddpd (__m128d a, __m128d b, __m128d c)
+{
+ return __builtin_ia32_fmaddpd (a, b, c);
+}
+
+__m128d
+generic_fmaddpd (__m128d a, __m128d b, __m128d c)
+{
+ return __builtin_ia32_fmaddpd (a, b, c); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __AES__
+#error "-maes should not be set for this test"
+#endif
+
+__m128i aes_aesimc128 (__m128i a) __attribute__((__option__("aes")));
+__m128i generic_aesimc128 (__m128i a);
+
+__m128i
+aes_aesimc128 (__m128i a)
+{
+ return __builtin_ia32_aesimc128 (a);
+}
+
+__m128i
+generic_aesimc128 (__m128i a)
+{
+ return __builtin_ia32_aesimc128 (a); /* { dg-error "needs isa option" } */
+}
+
+#ifdef __PCLMUL__
+#error "-mpclmul should not be set for this test"
+#endif
+
+__m128i pclmul_pclmulqdq128 (__m128i a, __m128i b) __attribute__((__option__("pclmul")));
+__m128i generic_pclmulqdq128 (__m128i a, __m128i b);
+
+__m128i
+pclmul_pclmulqdq128 (__m128i a, __m128i b)
+{
+ return __builtin_ia32_pclmulqdq128 (a, b, 5);
+}
+
+__m128i
+generic_pclmulqdq128 (__m128i a, __m128i b)
+{
+ return __builtin_ia32_pclmulqdq128 (a, b, 5); /* { dg-error "needs isa option" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-9.c b/gcc/testsuite/gcc.target/i386/funcspec-9.c
new file mode 100644
index 00000000000..e6d19013101
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/funcspec-9.c
@@ -0,0 +1,36 @@
+/* Test whether using target specific options, we can generate SSE5 code. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=k8 -mfpmath=sse -msse2" } */
+
+extern void exit (int);
+
+#ifdef __SSE5__
+#warning "__SSE5__ should not be defined before #pragma GCC option."
+#endif
+
+#pragma GCC option (push)
+#pragma GCC option ("sse5,fused-madd")
+
+#ifndef __SSE5__
+#warning "__SSE5__ should have be defined after #pragma GCC option."
+#endif
+
+float
+flt_mul_add (float a, float b, float c)
+{
+ return (a * b) + c;
+}
+
+#pragma GCC option (pop)
+#ifdef __SSE5__
+#warning "__SSE5__ should not be defined after #pragma GCC pop option."
+#endif
+
+double
+dbl_mul_add (double a, double b, double c)
+{
+ return (a * b) + c;
+}
+
+/* { dg-final { scan-assembler "fmaddss" } } */
+/* { dg-final { scan-assembler "addsd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/hot-1.c b/gcc/testsuite/gcc.target/i386/hot-1.c
new file mode 100644
index 00000000000..608f52fd6eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/hot-1.c
@@ -0,0 +1,33 @@
+/* Test whether using attribute((hot)) really turns on -O3. Do this test
+ by checking whether we vectorize a simple loop. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
+/* { dg-final { scan-assembler "addps" } } */
+/* { dg-final { scan-assembler "subss" } } */
+
+#define SIZE 1024
+float a[SIZE] __attribute__((__aligned__(32)));
+float b[SIZE] __attribute__((__aligned__(32)));
+float c[SIZE] __attribute__((__aligned__(32)));
+
+/* This should vectorize. */
+void hot (void) __attribute__((__hot__));
+
+void
+hot (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}
+
+/* This should not vectorize. */
+void
+not_hot (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
diff --git a/gcc/testsuite/gcc.target/i386/opt-1.c b/gcc/testsuite/gcc.target/i386/opt-1.c
new file mode 100644
index 00000000000..28e2ef38c34
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/opt-1.c
@@ -0,0 +1,35 @@
+/* Test the attribute((optimize)) really works. Do this test by checking
+ whether we vectorize a simple loop. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
+/* { dg-final { scan-assembler "prefetcht0" } } */
+/* { dg-final { scan-assembler "addps" } } */
+/* { dg-final { scan-assembler "subss" } } */
+
+#define SIZE 10240
+float a[SIZE] __attribute__((__aligned__(32)));
+float b[SIZE] __attribute__((__aligned__(32)));
+float c[SIZE] __attribute__((__aligned__(32)));
+
+/* This should vectorize. */
+void opt3 (void) __attribute__((__optimize__(3,"unroll-all-loops,-fprefetch-loop-arrays")));
+
+void
+opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}
+
+/* This should not vectorize. */
+void
+not_opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/opt-2.c b/gcc/testsuite/gcc.target/i386/opt-2.c
new file mode 100644
index 00000000000..8d6ba6fe925
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/opt-2.c
@@ -0,0 +1,38 @@
+/* Test the attribute((optimize)) really works. Do this test by checking
+ whether we vectorize a simple loop. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
+/* { dg-final { scan-assembler "prefetcht0" } } */
+/* { dg-final { scan-assembler "addps" } } */
+/* { dg-final { scan-assembler "subss" } } */
+
+#define SIZE 10240
+float a[SIZE] __attribute__((__aligned__(32)));
+float b[SIZE] __attribute__((__aligned__(32)));
+float c[SIZE] __attribute__((__aligned__(32)));
+
+/* This should vectorize. */
+#pragma GCC optimize push
+#pragma GCC optimize (3, "unroll-all-loops", "-fprefetch-loop-arrays")
+
+void
+opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}
+
+#pragma GCC optimize pop
+
+/* This should not vectorize. */
+void
+not_opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
new file mode 100644
index 00000000000..a9b10333157
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -0,0 +1,171 @@
+/* Same as sse-14, except converted to use #pragma GCC option. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Werror-implicit-function-declaration" } */
+
+#include <mm_malloc.h>
+
+/* Test that the intrinsics compile without optimization. All of them are
+ defined as inline functions in {,x,e,p,t,s,w,a,b}mmintrin.h and mm3dnow.h
+ that reference the proper builtin functions. Defining away "extern" and
+ "__inline" results in all of them being compiled as proper functions. */
+
+#define extern
+#define __inline
+
+#define _CONCAT(x,y) x ## y
+
+#define test_1(func, type, op1_type, imm) \
+ type _CONCAT(_,func) (op1_type A, int const I) \
+ { return func (A, imm); }
+
+#define test_1x(func, type, op1_type, imm1, imm2) \
+ type _CONCAT(_,func) (op1_type A, int const I, int const L) \
+ { return func (A, imm1, imm2); }
+
+#define test_2(func, type, op1_type, op2_type, imm) \
+ type _CONCAT(_,func) (op1_type A, op2_type B, int const I) \
+ { return func (A, B, imm); }
+
+#define test_2x(func, type, op1_type, op2_type, imm1, imm2) \
+ type _CONCAT(_,func) (op1_type A, op2_type B, int const I, int const L) \
+ { return func (A, B, imm1, imm2); }
+
+#define test_4(func, type, op1_type, op2_type, op3_type, op4_type, imm) \
+ type _CONCAT(_,func) (op1_type A, op2_type B, \
+ op3_type C, op4_type D, int const I) \
+ { return func (A, B, C, D, imm); }
+
+
+#ifndef DIFFERENT_PRAGMAS
+#pragma GCC option ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse5,aes,pclmul")
+#endif
+
+/* Following intrinsics require immediate arguments. They
+ are defined as macros for non-optimized compilations. */
+
+/* mmintrin.h (MMX). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("mmx")
+#endif
+#include <mmintrin.h>
+
+/* mm3dnow.h (3DNOW). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("3dnow")
+#endif
+#include <mm3dnow.h>
+
+/* xmmintrin.h (SSE). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("sse")
+#endif
+#include <xmmintrin.h>
+test_2 (_mm_shuffle_ps, __m128, __m128, __m128, 1)
+test_1 (_mm_extract_pi16, int, __m64, 1)
+test_1 (_m_pextrw, int, __m64, 1)
+test_2 (_mm_insert_pi16, __m64, __m64, int, 1)
+test_2 (_m_pinsrw, __m64, __m64, int, 1)
+test_1 (_mm_shuffle_pi16, __m64, __m64, 1)
+test_1 (_m_pshufw, __m64, __m64, 1)
+test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA)
+
+/* emmintrin.h (SSE2). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("sse2")
+#endif
+#include <emmintrin.h>
+test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
+test_1 (_mm_srli_si128, __m128i, __m128i, 1)
+test_1 (_mm_slli_si128, __m128i, __m128i, 1)
+test_1 (_mm_extract_epi16, int, __m128i, 1)
+test_2 (_mm_insert_epi16, __m128i, __m128i, int, 1)
+test_1 (_mm_shufflehi_epi16, __m128i, __m128i, 1)
+test_1 (_mm_shufflelo_epi16, __m128i, __m128i, 1)
+test_1 (_mm_shuffle_epi32, __m128i, __m128i, 1)
+
+/* pmmintrin.h (SSE3). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("sse3")
+#endif
+#include <pmmintrin.h>
+
+/* tmmintrin.h (SSSE3). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("ssse3")
+#endif
+#include <tmmintrin.h>
+test_2 (_mm_alignr_epi8, __m128i, __m128i, __m128i, 1)
+test_2 (_mm_alignr_pi8, __m64, __m64, __m64, 1)
+
+/* ammintrin.h (SSE4A). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("sse4a")
+#endif
+#include <ammintrin.h>
+test_1x (_mm_extracti_si64, __m128i, __m128i, 1, 1)
+test_2x (_mm_inserti_si64, __m128i, __m128i, __m128i, 1, 1)
+
+/* smmintrin.h (SSE4.1). */
+/* nmmintrin.h (SSE4.2). */
+/* Note, nmmintrin.h includes smmintrin.h, and smmintrin.h checks for the
+ #ifdef. So just set the option to SSE4.2. */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("sse4.2")
+#endif
+#include <nmmintrin.h>
+test_2 (_mm_blend_epi16, __m128i, __m128i, __m128i, 1)
+test_2 (_mm_blend_ps, __m128, __m128, __m128, 1)
+test_2 (_mm_blend_pd, __m128d, __m128d, __m128d, 1)
+test_2 (_mm_dp_ps, __m128, __m128, __m128, 1)
+test_2 (_mm_dp_pd, __m128d, __m128d, __m128d, 1)
+test_2 (_mm_insert_ps, __m128, __m128, __m128, 1)
+test_1 (_mm_extract_ps, int, __m128, 1)
+test_2 (_mm_insert_epi8, __m128i, __m128i, int, 1)
+test_2 (_mm_insert_epi32, __m128i, __m128i, int, 1)
+#ifdef __x86_64__
+test_2 (_mm_insert_epi64, __m128i, __m128i, long long, 1)
+#endif
+test_1 (_mm_extract_epi8, int, __m128i, 1)
+test_1 (_mm_extract_epi32, int, __m128i, 1)
+#ifdef __x86_64__
+test_1 (_mm_extract_epi64, long long, __m128i, 1)
+#endif
+test_2 (_mm_mpsadbw_epu8, __m128i, __m128i, __m128i, 1)
+test_2 (_mm_cmpistrm, __m128i, __m128i, __m128i, 1)
+test_2 (_mm_cmpistri, int, __m128i, __m128i, 1)
+test_4 (_mm_cmpestrm, __m128i, __m128i, int, __m128i, int, 1)
+test_4 (_mm_cmpestri, int, __m128i, int, __m128i, int, 1)
+test_2 (_mm_cmpistra, int, __m128i, __m128i, 1)
+test_2 (_mm_cmpistrc, int, __m128i, __m128i, 1)
+test_2 (_mm_cmpistro, int, __m128i, __m128i, 1)
+test_2 (_mm_cmpistrs, int, __m128i, __m128i, 1)
+test_2 (_mm_cmpistrz, int, __m128i, __m128i, 1)
+test_4 (_mm_cmpestra, int, __m128i, int, __m128i, int, 1)
+test_4 (_mm_cmpestrc, int, __m128i, int, __m128i, int, 1)
+test_4 (_mm_cmpestro, int, __m128i, int, __m128i, int, 1)
+test_4 (_mm_cmpestrs, int, __m128i, int, __m128i, int, 1)
+test_4 (_mm_cmpestrz, int, __m128i, int, __m128i, int, 1)
+
+/* bmmintrin.h (SSE5). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("sse5")
+#endif
+#include <bmmintrin.h>
+test_1 (_mm_roti_epi8, __m128i, __m128i, 1)
+test_1 (_mm_roti_epi16, __m128i, __m128i, 1)
+test_1 (_mm_roti_epi32, __m128i, __m128i, 1)
+test_1 (_mm_roti_epi64, __m128i, __m128i, 1)
+
+/* wmmintrin.h (AES/PCLMUL). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC option ("aes,pclmul")
+#endif
+#include <wmmintrin.h>
+test_1 (_mm_aeskeygenassist_si128, __m128i, __m128i, 1)
+test_2 (_mm_clmulepi64_si128, __m128i, __m128i, __m128i, 1)
+
+/* mmintrin-common.h */
+test_1 (_mm_round_pd, __m128d, __m128d, 1)
+test_1 (_mm_round_ps, __m128, __m128, 1)
+test_2 (_mm_round_sd, __m128d, __m128d, __m128d, 1)
+test_2 (_mm_round_ss, __m128, __m128, __m128, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c
new file mode 100644
index 00000000000..27b601452a5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-23.c
@@ -0,0 +1,108 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8" } */
+
+#include <mm_malloc.h>
+
+/* Test that the intrinsics compile with optimization. All of them are
+ defined as inline functions in {,x,e,p,t,s,w,a,b}mmintrin.h and mm3dnow.h
+ that reference the proper builtin functions. Defining away "extern" and
+ "__inline" results in all of them being compiled as proper functions. */
+
+#define extern
+#define __inline
+
+/* Following intrinsics require immediate arguments. */
+
+/* ammintrin.h */
+#define __builtin_ia32_extrqi(X, I, L) __builtin_ia32_extrqi(X, 1, 1)
+#define __builtin_ia32_insertqi(X, Y, I, L) __builtin_ia32_insertqi(X, Y, 1, 1)
+
+/* wmmintrin.h */
+#define __builtin_ia32_aeskeygenassist128(X, C) __builtin_ia32_aeskeygenassist128(X, 1)
+#define __builtin_ia32_pclmulqdq128(X, Y, I) __builtin_ia32_pclmulqdq128(X, Y, 1)
+
+/* mmintrin-common.h */
+#define __builtin_ia32_roundpd(V, M) __builtin_ia32_roundpd(V, 1)
+#define __builtin_ia32_roundsd(D, V, M) __builtin_ia32_roundsd(D, V, 1)
+#define __builtin_ia32_roundps(V, M) __builtin_ia32_roundps(V, 1)
+#define __builtin_ia32_roundss(D, V, M) __builtin_ia32_roundss(D, V, 1)
+
+/* smmintrin.h */
+#define __builtin_ia32_pblendw128(X, Y, M) __builtin_ia32_pblendw128 (X, Y, 1)
+#define __builtin_ia32_blendps(X, Y, M) __builtin_ia32_blendps(X, Y, 1)
+#define __builtin_ia32_blendpd(X, Y, M) __builtin_ia32_blendpd(X, Y, 1)
+#define __builtin_ia32_dpps(X, Y, M) __builtin_ia32_dpps(X, Y, 1)
+#define __builtin_ia32_dppd(X, Y, M) __builtin_ia32_dppd(X, Y, 1)
+#define __builtin_ia32_insertps128(D, S, N) __builtin_ia32_insertps128(D, S, 1)
+#define __builtin_ia32_vec_ext_v4sf(X, N) __builtin_ia32_vec_ext_v4sf(X, 1)
+#define __builtin_ia32_vec_set_v16qi(D, S, N) __builtin_ia32_vec_set_v16qi(D, S, 1)
+#define __builtin_ia32_vec_set_v4si(D, S, N) __builtin_ia32_vec_set_v4si(D, S, 1)
+#define __builtin_ia32_vec_set_v2di(D, S, N) __builtin_ia32_vec_set_v2di(D, S, 1)
+#define __builtin_ia32_vec_ext_v16qi(X, N) __builtin_ia32_vec_ext_v16qi(X, 1)
+#define __builtin_ia32_vec_ext_v4si(X, N) __builtin_ia32_vec_ext_v4si(X, 1)
+#define __builtin_ia32_vec_ext_v2di(X, N) __builtin_ia32_vec_ext_v2di(X, 1)
+#define __builtin_ia32_mpsadbw128(X, Y, M) __builtin_ia32_mpsadbw128(X, Y, 1)
+#define __builtin_ia32_pcmpistrm128(X, Y, M) \
+ __builtin_ia32_pcmpistrm128(X, Y, 1)
+#define __builtin_ia32_pcmpistri128(X, Y, M) \
+ __builtin_ia32_pcmpistri128(X, Y, 1)
+#define __builtin_ia32_pcmpestrm128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestrm128(X, LX, Y, LY, 1)
+#define __builtin_ia32_pcmpestri128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestri128(X, LX, Y, LY, 1)
+#define __builtin_ia32_pcmpistria128(X, Y, M) \
+ __builtin_ia32_pcmpistria128(X, Y, 1)
+#define __builtin_ia32_pcmpistric128(X, Y, M) \
+ __builtin_ia32_pcmpistric128(X, Y, 1)
+#define __builtin_ia32_pcmpistrio128(X, Y, M) \
+ __builtin_ia32_pcmpistrio128(X, Y, 1)
+#define __builtin_ia32_pcmpistris128(X, Y, M) \
+ __builtin_ia32_pcmpistris128(X, Y, 1)
+#define __builtin_ia32_pcmpistriz128(X, Y, M) \
+ __builtin_ia32_pcmpistriz128(X, Y, 1)
+#define __builtin_ia32_pcmpestria128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestria128(X, LX, Y, LY, 1)
+#define __builtin_ia32_pcmpestric128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestric128(X, LX, Y, LY, 1)
+#define __builtin_ia32_pcmpestrio128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestrio128(X, LX, Y, LY, 1)
+#define __builtin_ia32_pcmpestris128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestris128(X, LX, Y, LY, 1)
+#define __builtin_ia32_pcmpestriz128(X, LX, Y, LY, M) \
+ __builtin_ia32_pcmpestriz128(X, LX, Y, LY, 1)
+
+/* tmmintrin.h */
+#define __builtin_ia32_palignr128(X, Y, N) __builtin_ia32_palignr128(X, Y, 8)
+#define __builtin_ia32_palignr(X, Y, N) __builtin_ia32_palignr(X, Y, 8)
+
+/* emmintrin.h */
+#define __builtin_ia32_psrldqi128(A, B) __builtin_ia32_psrldqi128(A, 8)
+#define __builtin_ia32_pslldqi128(A, B) __builtin_ia32_pslldqi128(A, 8)
+#define __builtin_ia32_pshufhw(A, N) __builtin_ia32_pshufhw(A, 0)
+#define __builtin_ia32_pshuflw(A, N) __builtin_ia32_pshuflw(A, 0)
+#define __builtin_ia32_pshufd(A, N) __builtin_ia32_pshufd(A, 0)
+#define __builtin_ia32_vec_set_v8hi(A, D, N) \
+ __builtin_ia32_vec_set_v8hi(A, D, 0)
+#define __builtin_ia32_vec_ext_v8hi(A, N) __builtin_ia32_vec_ext_v8hi(A, 0)
+#define __builtin_ia32_shufpd(A, B, N) __builtin_ia32_shufpd(A, B, 0)
+
+/* xmmintrin.h */
+#define __builtin_prefetch(P, A, I) __builtin_prefetch(P, A, _MM_HINT_NTA)
+#define __builtin_ia32_pshufw(A, N) __builtin_ia32_pshufw(A, 0)
+#define __builtin_ia32_vec_set_v4hi(A, D, N) \
+ __builtin_ia32_vec_set_v4hi(A, D, 0)
+#define __builtin_ia32_vec_ext_v4hi(A, N) __builtin_ia32_vec_ext_v4hi(A, 0)
+#define __builtin_ia32_shufps(A, B, N) __builtin_ia32_shufps(A, B, 0)
+
+/* bmmintrin.h */
+#define __builtin_ia32_protbi(A, B) __builtin_ia32_protbi(A,1)
+#define __builtin_ia32_protwi(A, B) __builtin_ia32_protwi(A,1)
+#define __builtin_ia32_protdi(A, B) __builtin_ia32_protdi(A,1)
+#define __builtin_ia32_protqi(A, B) __builtin_ia32_protqi(A,1)
+
+
+#pragma GCC option ("3dnow,sse4,sse5,aes,pclmul")
+#include <wmmintrin.h>
+#include <bmmintrin.h>
+#include <smmintrin.h>
+#include <mm3dnow.h>
diff --git a/gcc/testsuite/gcc.target/s390/pr36822.c b/gcc/testsuite/gcc.target/s390/pr36822.c
new file mode 100644
index 00000000000..a427d2e1eb1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr36822.c
@@ -0,0 +1,16 @@
+/* This used to ICE on s390 due to bug in the definition of the 'R'
+ constraint which replaced the 'm' constraint (together with 'T')
+ while adding z10 support. */
+
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int boo()
+{
+ struct {
+ unsigned char pad[4096];
+ unsigned long long bar;
+ } *foo;
+ asm volatile( "" : "=m" (*(unsigned long long*)(foo->bar))
+ : "a" (&foo->bar));
+}
diff --git a/gcc/testsuite/gcc.target/spu/vector-ansi.c b/gcc/testsuite/gcc.target/spu/vector-ansi.c
new file mode 100644
index 00000000000..3c086169947
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/vector-ansi.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-ansi" } */
+
+/* This is done by spu_internals.h, but we not include it here to keep
+ down the dependencies. */
+
+#ifndef __VECTOR_KEYWORD_SUPPORTED__
+#define vector __vector
+#endif
+
+/* __vector is expanded unconditionally by the preprocessor. */
+__vector int vi;
+__vector unsigned char vuc;
+__vector signed char vsc;
+__vector unsigned short vus;
+__vector signed short vss;
+__vector unsigned int vui;
+__vector signed int vsi;
+__vector unsigned long long ull;
+__vector signed long long sll;
+__vector float vf;
+__vector double vd;
+
+/* vector is expanded by the define above, regardless of context. */
+vector int vi;
+vector unsigned char vuc;
+vector signed char vsc;
+vector unsigned short vus;
+vector signed short vss;
+vector unsigned int vui;
+vector signed int vsi;
+vector unsigned long long ull;
+vector signed long long sll;
+vector float vf;
+vector double vd;
diff --git a/gcc/testsuite/gcc.target/spu/vector.c b/gcc/testsuite/gcc.target/spu/vector.c
new file mode 100644
index 00000000000..237f93b7e58
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/vector.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#ifndef __VECTOR_KEYWORD_SUPPORTED__
+#error __VECTOR_KEYWORD_SUPPORTED__ is not defined
+#endif
+
+/* __vector is expanded unconditionally. */
+__vector int vi;
+__vector unsigned char vuc;
+__vector signed char vsc;
+__vector unsigned short vus;
+__vector signed short vss;
+__vector unsigned int vui;
+__vector signed int vsi;
+__vector unsigned long long ull;
+__vector signed long long sll;
+__vector float vf;
+__vector double vd;
+
+/* vector is expanded conditionally, based on the context. */
+vector int vi;
+vector unsigned char vuc;
+vector signed char vsc;
+vector unsigned short vus;
+vector signed short vss;
+vector unsigned int vui;
+vector signed int vsi;
+vector unsigned long long ull;
+vector signed long long sll;
+vector float vf;
+vector double vd;
diff --git a/gcc/testsuite/gfortran.dg/allocatable_module_1.f90 b/gcc/testsuite/gfortran.dg/allocatable_module_1.f90
new file mode 100644
index 00000000000..47f10008efa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocatable_module_1.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! PR 36934 - this used to give a spurious error and segfault with a
+! patch that wasn't complete
+! Test case contributed by Philip Mason
+
+module fred1
+real, allocatable :: default_clocks(:)
+end module fred1
+
+module fred2
+real, allocatable :: locks(:)
+end module fred2
+
+program fred
+use fred1
+use fred2
+end program fred
+! { dg-final { cleanup-modules "fred1 fred2" } }
diff --git a/gcc/testsuite/gfortran.dg/array_temporaries_1.f90 b/gcc/testsuite/gfortran.dg/array_temporaries_1.f90
new file mode 100644
index 00000000000..64fc59046f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_temporaries_1.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-Warray-temporaries" }
+
+subroutine bar(a)
+ real, dimension(2) :: a
+end
+
+program main
+ integer, parameter :: n=3
+ integer :: i
+ real, dimension(n) :: a, b
+
+ a = 0.2
+ i = 2
+ a(i:i+1) = a(1:2) ! { dg-warning "Creating array temporary" }
+ a = cshift(a,1) ! { dg-warning "Creating array temporary" }
+ b = cshift(a,1)
+ call bar(a(1:3:2)) ! { dg-warning "Creating array temporary" }
+end program main
diff --git a/gcc/testsuite/gfortran.dg/c_sizeof_2.f90 b/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
index f6c3077f83d..6e32cb34687 100644
--- a/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
+++ b/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
@@ -2,8 +2,7 @@
! { dg-options "-std=f2003 -Wall" }
! Support F2008's c_sizeof()
!
-integer(4) :: i, j(10)
-i = c_sizeof(i) ! { dg-error "not included in the selected standard" }
-i = c_sizeof(j) ! { dg-error "not included in the selected standard" }
+integer(4) :: i
+i = c_sizeof(i) ! { dg-warning "Fortran 2008" }
end
diff --git a/gcc/testsuite/gfortran.dg/fmt_error_3.f90 b/gcc/testsuite/gfortran.dg/fmt_error_3.f90
new file mode 100644
index 00000000000..257f876ed80
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_error_3.f90
@@ -0,0 +1,36 @@
+! { dg-do compile }
+
+! PR fortran/29835
+! Check for improved format error messages with correct locus and more detailed
+! "unexpected element" messages.
+
+SUBROUTINE format_labels
+ IMPLICIT NONE
+
+1 FORMAT (A, &
+ A, &
+ Q, & ! { dg-error "Unexpected element 'Q'" }
+ A)
+
+2 FORMAT (A, &
+ I, & ! { dg-error "Nonnegative width" }
+ A)
+
+END SUBROUTINE format_labels
+
+SUBROUTINE format_strings
+ IMPLICIT NONE
+ CHARACTER(len=32), PARAMETER :: str = "hello"
+ INTEGER :: x
+
+ PRINT '(A, Q, A)', & ! { dg-error "Unexpected element 'Q'" }
+ str, str, str ! { dg-bogus "Unexpected element" }
+
+ PRINT '(A, ' // & ! { dg-error "Nonnegative width" }
+ ' I, ' // &
+ ' A)', str, str, str ! { dg-bogus "Nonnegative width" }
+
+ READ '(Q)', & ! { dg-error "Unexpected element 'Q'" }
+ x ! { dg-bogus "Unexpected element" }
+
+END SUBROUTINE format_strings
diff --git a/gcc/testsuite/gfortran.dg/fmt_error_4.f90 b/gcc/testsuite/gfortran.dg/fmt_error_4.f90
new file mode 100644
index 00000000000..2310573bd1f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_error_4.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! { dg-shouldfail "runtime error" }
+
+! PR fortran/29835
+! Check for improved format error messages with correct locus and more detailed
+! "unexpected element" messages.
+
+! Now with runtime supplied format strings
+SUBROUTINE format_runtime (fmtstr)
+ IMPLICIT NONE
+ CHARACTER(len=*) :: fmtstr
+ CHARACTER(len=32), PARAMETER :: str = "hello"
+
+ PRINT fmtstr, str, str, str
+END SUBROUTINE format_runtime
+
+PROGRAM main
+ IMPLICIT NONE
+ CALL format_runtime ('(A, Q, A)')
+END PROGRAM main
+
+! { dg-output "Unexpected element 'Q'.*(\n|\r\n|\r)\\(A, Q, A\\)(\n|\r\n|\r) \\^" }
diff --git a/gcc/testsuite/gfortran.dg/fmt_error_5.f90 b/gcc/testsuite/gfortran.dg/fmt_error_5.f90
new file mode 100644
index 00000000000..18de68e0719
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_error_5.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! { dg-shouldfail "runtime error" }
+
+! PR fortran/29835
+! Check for improved format error messages with correct locus and more detailed
+! "unexpected element" messages.
+
+! Now with runtime supplied format strings
+SUBROUTINE format_runtime (fmtstr)
+ IMPLICIT NONE
+ CHARACTER(len=*) :: fmtstr
+ INTEGER :: x
+
+ PRINT fmtstr, x
+END SUBROUTINE format_runtime
+
+PROGRAM main
+ IMPLICIT NONE
+ CALL format_runtime ('(Q)')
+END PROGRAM main
+
+! { dg-output "Unexpected element 'Q'.*(\n|\r\n|\r)\\(Q\\)(\n|\r\n|\r) \\^" }
diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_2.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
index c19e3f2dca4..3567561802b 100644
--- a/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
+++ b/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
@@ -1,5 +1,5 @@
! { dg-do run }
-! { dg-options "-std=f95 -pedantic" }
+! { dg-options "-std=f95 -pedantic -fall-intrinsics" }
! { dg-shouldfail "Zero width in format descriptor" }
! PR36420 Fortran 2008: g0 edit descriptor
! Test case provided by Jerry DeLisle <jvdelisle@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_3.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_3.f08
index a84b1f10847..b0b8139a3f3 100644
--- a/gcc/testsuite/gfortran.dg/fmt_g0_3.f08
+++ b/gcc/testsuite/gfortran.dg/fmt_g0_3.f08
@@ -3,5 +3,5 @@
! Test case provided by Jerry DeLisle <jvdelisle@gcc.gnu.org>
character(25) :: string = "(g0,g0,g0)"
character(33) :: buffer
- write(buffer, '(g0,g0,g0)') ':',12340,':' ! { dg-error "Fortran F2008:" }
+ write(buffer, '(g0,g0,g0)') ':',12340,':' ! { dg-error "Fortran 2008:" }
end
diff --git a/gcc/testsuite/gfortran.dg/gamma_2.f90 b/gcc/testsuite/gfortran.dg/gamma_2.f90
index 6e8cefa6858..5b0e922cb92 100644
--- a/gcc/testsuite/gfortran.dg/gamma_2.f90
+++ b/gcc/testsuite/gfortran.dg/gamma_2.f90
@@ -8,11 +8,11 @@
! PR fortran/32980
!
subroutine foo()
-intrinsic :: gamma
-intrinsic :: dgamma
-intrinsic :: lgamma
-intrinsic :: algama
-intrinsic :: dlgama
+intrinsic :: gamma ! { dg-error "Fortran 2008" }
+intrinsic :: dgamma ! { dg-error "extension" }
+intrinsic :: lgamma ! { dg-error "extension" }
+intrinsic :: algama ! { dg-error "extension" }
+intrinsic :: dlgama ! { dg-error "extension" }
integer, parameter :: sp = kind(1.0)
integer, parameter :: dp = kind(1.0d0)
@@ -20,13 +20,13 @@ integer, parameter :: dp = kind(1.0d0)
real(sp) :: rsp = 1.0_sp
real(dp) :: rdp = 1.0_dp
-rsp = gamma(rsp) ! FIXME "is not included in the selected standard"
-rdp = gamma(rdp) ! FIXME "is not included in the selected standard"
-rdp = dgamma(rdp) ! { dg-error "is not included in the selected standard" }
+rsp = gamma(rsp)
+rdp = gamma(rdp)
+rdp = dgamma(rdp)
-rsp = lgamma(rsp) ! { dg-error "is not included in the selected standard" }
-rdp = lgamma(rdp) ! { dg-error "is not included in the selected standard" }
-rsp = algama(rsp) ! { dg-error "is not included in the selected standard" }
-rdp = dlgama(rdp) ! { dg-error "is not included in the selected standard" }
+rsp = lgamma(rsp)
+rdp = lgamma(rdp)
+rsp = algama(rsp)
+rdp = dlgama(rdp)
end subroutine foo
end
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_shadow_1.f03 b/gcc/testsuite/gfortran.dg/intrinsic_shadow_1.f03
new file mode 100644
index 00000000000..776d0f692d9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_shadow_1.f03
@@ -0,0 +1,57 @@
+! { dg-do compile }
+! { dg-options "-std=f2003 -Wintrinsic-shadow" }
+
+! PR fortran/33141
+! Check that the expected warnings are emitted if a user-procedure has the same
+! name as an intrinsic, but only if it is matched by the current -std=*.
+
+MODULE testmod
+ IMPLICIT NONE
+
+CONTAINS
+
+ ! ASIN is an intrinsic
+ REAL FUNCTION asin (arg) ! { dg-warning "shadow the intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+ END FUNCTION asin
+
+ ! ASINH is one but not in F2003
+ REAL FUNCTION asinh (arg) ! { dg-bogus "shadow the intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+ END FUNCTION asinh
+
+END MODULE testmod
+
+! ACOS is an intrinsic
+REAL FUNCTION acos (arg) ! { dg-warning "of an intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+END FUNCTION acos
+
+! ACOSH not for F2003
+REAL FUNCTION acosh (arg) ! { dg-bogus "of an intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+END FUNCTION acosh
+
+! A subroutine with the same name as an intrinsic subroutine
+SUBROUTINE random_number (arg) ! { dg-warning "of an intrinsic" }
+ IMPLICIT NONE
+ REAL, INTENT(OUT) :: arg
+END SUBROUTINE random_number
+
+! But a subroutine with the name of an intrinsic function is ok.
+SUBROUTINE atan (arg) ! { dg-bogus "of an intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+END SUBROUTINE atan
+
+! As should be a function with the name of an intrinsic subroutine.
+REAL FUNCTION random_seed () ! { dg-bogus "of an intrinsic" }
+END FUNCTION random_seed
+
+! We do only compile, so no main program needed.
+
+! { dg-final { cleanup-modules "testmod" } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_shadow_2.f03 b/gcc/testsuite/gfortran.dg/intrinsic_shadow_2.f03
new file mode 100644
index 00000000000..5c046166d76
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_shadow_2.f03
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! { dg-options "-std=f2003 -Wintrinsic-shadow -fall-intrinsics" }
+
+! PR fortran/33141
+! Check that the expected warnings are emitted if a user-procedure has the same
+! name as an intrinsic, with -fall-intrinsics even regardless of std=*.
+
+MODULE testmod
+ IMPLICIT NONE
+
+CONTAINS
+
+ ! ASINH is one but not in F2003
+ REAL FUNCTION asinh (arg) ! { dg-warning "shadow the intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+ END FUNCTION asinh
+
+END MODULE testmod
+
+! ACOSH not for F2003
+REAL FUNCTION acosh (arg) ! { dg-warning "of an intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+END FUNCTION acosh
+
+! We do only compile, so no main program needed.
+
+! { dg-final { cleanup-modules "testmod" } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_shadow_3.f03 b/gcc/testsuite/gfortran.dg/intrinsic_shadow_3.f03
new file mode 100644
index 00000000000..069a99b3433
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_shadow_3.f03
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! { dg-options "-Wno-intrinsic-shadow -fall-intrinsics" }
+
+! PR fortran/33141
+! Check that the "intrinsic shadow" warnings are not emitted if the warning
+! is negated.
+
+MODULE testmod
+ IMPLICIT NONE
+
+CONTAINS
+
+ REAL FUNCTION asin (arg) ! { dg-bogus "shadow the intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+ END FUNCTION asin
+
+END MODULE testmod
+
+REAL FUNCTION acos (arg) ! { dg-bogus "of an intrinsic" }
+ IMPLICIT NONE
+ REAL :: arg
+END FUNCTION acos
+
+! We do only compile, so no main program needed.
+
+! { dg-final { cleanup-modules "testmod" } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
new file mode 100644
index 00000000000..efb1dce5456
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
@@ -0,0 +1,48 @@
+! { dg-do compile }
+! { dg-options "-std=f95 -Wintrinsics-std -fdump-tree-original" }
+
+! PR fortran/33141
+! Check for the expected behaviour when an intrinsic function/subroutine is
+! called that is not available in the defined standard or that is a GNU
+! extension:
+! There should be a warning emitted on the call, and the reference should be
+! treated like an external call.
+! For declaring a non-standard intrinsic INTRINSIC, a hard error should be
+! generated, of course.
+
+SUBROUTINE no_implicit
+ IMPLICIT NONE
+ REAL :: asinh ! { dg-warning "Fortran 2008" }
+
+ ! abort is a GNU extension
+ CALL abort () ! { dg-warning "extension" }
+
+ ! ASINH is an intrinsic of F2008
+ ! The warning should be issued in the declaration above where it is declared
+ ! EXTERNAL.
+ WRITE (*,*) ASINH (1.) ! { dg-bogus "Fortran 2008" }
+END SUBROUTINE no_implicit
+
+SUBROUTINE implicit_type
+ ! acosh has implicit type
+
+ WRITE (*,*) ACOSH (1.) ! { dg-warning "Fortran 2008" }
+ WRITE (*,*) ACOSH (1.) ! { dg-bogus "Fortran 2008" }
+END SUBROUTINE implicit_type
+
+SUBROUTINE specification_expression
+ CHARACTER(KIND=selected_char_kind("ascii")) :: x
+! { dg-error "specification function" "" { target "*-*-*" } 34 }
+! { dg-warning "Fortran 2003" "" { target "*-*-*" } 34 }
+END SUBROUTINE specification_expression
+
+SUBROUTINE intrinsic_decl
+ IMPLICIT NONE
+ INTRINSIC :: atanh ! { dg-error "Fortran 2008" }
+ INTRINSIC :: abort ! { dg-error "extension" }
+END SUBROUTINE intrinsic_decl
+
+! Scan that really external functions are called.
+! { dg-final { scan-tree-dump " abort " "original" } }
+! { dg-final { scan-tree-dump " asinh " "original" } }
+! { dg-final { scan-tree-dump " acosh " "original" } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_2.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_2.f90
new file mode 100644
index 00000000000..6112d906d42
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_std_2.f90
@@ -0,0 +1,15 @@
+! { dg-do link }
+! { dg-options "-std=f95 -Wintrinsics-std -fall-intrinsics" }
+
+! PR fortran/33141
+! Check that -fall-intrinsics makes all intrinsics available.
+
+PROGRAM main
+ IMPLICIT NONE
+
+ ! abort is a GNU extension
+ CALL abort () ! { dg-bogus "extension" }
+
+ ! ASINH is an intrinsic of F2008
+ WRITE (*,*) ASINH (1.) ! { dg-bogus "Fortran 2008" }
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_3.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_3.f90
new file mode 100644
index 00000000000..15a424b1c91
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_std_3.f90
@@ -0,0 +1,15 @@
+! { dg-do link }
+! { dg-options "-std=gnu -Wintrinsics-std" }
+
+! PR fortran/33141
+! -std=gnu should allow every intrinsic.
+
+PROGRAM main
+ IMPLICIT NONE
+
+ ! abort is a GNU extension
+ CALL abort () ! { dg-bogus "extension" }
+
+ ! ASINH is an intrinsic of F2008
+ WRITE (*,*) ASINH (1.) ! { dg-bogus "Fortran 2008" }
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_4.f90
new file mode 100644
index 00000000000..e83ed4c884d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_std_4.f90
@@ -0,0 +1,46 @@
+! { dg-do run }
+! { dg-options "-std=f95 -Wno-intrinsics-std" }
+
+! PR fortran/33141
+! Check that calls to intrinsics not in the current standard are "allowed" and
+! linked to external procedures with that name.
+! Addionally, this checks that -Wno-intrinsics-std turns off the warning.
+
+SUBROUTINE abort ()
+ IMPLICIT NONE
+ WRITE (*,*) "Correct"
+END SUBROUTINE abort
+
+REAL FUNCTION asinh (arg)
+ IMPLICIT NONE
+ REAL :: arg
+
+ WRITE (*,*) "Correct"
+ asinh = arg
+END FUNCTION asinh
+
+SUBROUTINE implicit_none
+ IMPLICIT NONE
+ REAL :: asinh ! { dg-bogus "Fortran 2008" }
+ REAL :: x
+
+ ! Both times our version above should be called
+ CALL abort () ! { dg-bogus "extension" }
+ x = ASINH (1.) ! { dg-bogus "Fortran 2008" }
+END SUBROUTINE implicit_none
+
+SUBROUTINE implicit_type
+ ! ASINH has implicit type here
+ REAL :: x
+
+ ! Our version should be called
+ x = ASINH (1.) ! { dg-bogus "Fortran 2008" }
+END SUBROUTINE implicit_type
+
+PROGRAM main
+ ! This should give a total of three "Correct"s
+ CALL implicit_none ()
+ CALL implicit_type ()
+END PROGRAM main
+
+! { dg-output "Correct\.*Correct\.*Correct" }
diff --git a/gcc/testsuite/gfortran.dg/namelist_52.f90 b/gcc/testsuite/gfortran.dg/namelist_52.f90
new file mode 100644
index 00000000000..6e31382927f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_52.f90
@@ -0,0 +1,32 @@
+! { dg-do run }
+! PR36582 Namelist I/O error: Bogus "Cannot match namelist object"
+! Test case derived from PR.
+module mod1
+
+type screen_io_type
+integer :: begin
+end type screen_io_type
+
+type adjoint_type
+type(screen_io_type) :: screen_io_fs_ntime
+character(12) :: solver_type
+end type adjoint_type
+
+type(adjoint_type) :: adjoint
+namelist/info_adjoint/adjoint
+
+end module mod1
+
+program gfortran_error_2
+use mod1
+adjoint%solver_type = "abcdefghijkl"
+open(31,status='scratch')
+write(31, '(a)') "&info_adjoint"
+write(31, '(a)') "adjoint%solver_type = 'direct'"
+write(31, '(a)') "adjoint%screen_io_fs_ntime%begin = 42"
+write(31, '(a)') "/"
+rewind(31)
+read(31,nml=info_adjoint)
+if (adjoint%solver_type /= 'direct') call abort
+if (adjoint%screen_io_fs_ntime%begin /= 42) call abort
+end program gfortran_error_2
diff --git a/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90 b/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
index 5cc7b112496..a7b7ae7d895 100644
--- a/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
+++ b/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
@@ -1,10 +1,10 @@
! { dg-do compile }
-! { dg-options "-std=f95 -pedantic -Wall" }
+! { dg-options "-std=f95 -pedantic -Wall -Wno-intrinsics-std" }
!
! Check that SELECTED_CHAR_KIND is rejected with -std=f95
!
implicit none
- character(kind=selected_char_kind("ascii")) :: s ! { dg-error "is not included in the selected standard" }
+ character(kind=selected_char_kind("ascii")) :: s ! { dg-error "must be an intrinsic or a specification function" }
s = "" ! { dg-error "has no IMPLICIT type" }
print *, s
end
diff --git a/gcc/testsuite/gfortran.dg/warn_std_1.f90 b/gcc/testsuite/gfortran.dg/warn_std_1.f90
index 4d709a12cdf..b0e4b5d4148 100644
--- a/gcc/testsuite/gfortran.dg/warn_std_1.f90
+++ b/gcc/testsuite/gfortran.dg/warn_std_1.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-Wnonstd-intrinsics -std=gnu" }
+! { dg-options "-std=gnu" }
!
! PR fortran/32778 - pedantic warning: intrinsics that
! are GNU extensions not part of -std=gnu
diff --git a/gcc/testsuite/gfortran.dg/warn_std_2.f90 b/gcc/testsuite/gfortran.dg/warn_std_2.f90
index 0a8c509d5c6..325fc8cb6e1 100644
--- a/gcc/testsuite/gfortran.dg/warn_std_2.f90
+++ b/gcc/testsuite/gfortran.dg/warn_std_2.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-Wnonstd-intrinsics -std=f95" }
+! { dg-options "-std=f95 -Wintrinsics-std" }
!
! PR fortran/32778 - pedantic warning: intrinsics that
! are GNU extensions not part of -std=gnu
@@ -11,15 +11,15 @@ CHARACTER(len=255) :: tmp
REAL(8) :: x
! GNU extension, check overload of F77 standard intrinsic
-x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-error "is not included in the selected standard" }
+x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-warning "extension" }
! GNU extension
-CALL flush() ! { dg-error "is not included in the selected standard" }
+CALL flush() ! { dg-warning "extension" }
! F95
tmp = ADJUSTL(" gfortran ")
! F2003
-CALL GET_COMMAND (tmp) ! { dg-error "is not included in the selected standard" }
+CALL GET_COMMAND (tmp) ! { dg-warning "Fortran 2003" }
END
diff --git a/gcc/testsuite/gfortran.dg/warn_std_3.f90 b/gcc/testsuite/gfortran.dg/warn_std_3.f90
index 0d0a0f149bd..89fe257389b 100644
--- a/gcc/testsuite/gfortran.dg/warn_std_3.f90
+++ b/gcc/testsuite/gfortran.dg/warn_std_3.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-Wnonstd-intrinsics -std=f2003" }
+! { dg-options "-std=f2003 -Wintrinsics-std" }
!
! PR fortran/32778 - pedantic warning: intrinsics that
! are GNU extensions not part of -std=gnu
@@ -11,10 +11,10 @@ CHARACTER(len=255) :: tmp
REAL(8) :: x
! GNU extension, check overload of F77 standard intrinsic
-x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-error "is not included in the selected standard" }
+x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-warning "extension" }
! GNU extension
-CALL flush() ! { dg-error "is not included in the selected standard" }
+CALL flush() ! { dg-warning "extension" }
! F95
tmp = ADJUSTL(" gfortran ")
diff --git a/gcc/testsuite/gfortran.dg/zero_sized_5.f90 b/gcc/testsuite/gfortran.dg/zero_sized_5.f90
new file mode 100644
index 00000000000..30ca8bf8199
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/zero_sized_5.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! These used to segfault.
+program main
+ real, dimension(1,0) :: a, b, c
+ integer, dimension(0) :: j
+ a = 0
+ c = 0
+ b = cshift (a,1)
+ b = cshift (a,j)
+ b = eoshift (a,1)
+ b = eoshift (a,(/1/))
+ b = eoshift (a,1,boundary=c(1,:))
+ b = eoshift (a, j, boundary=c(1,:))
+
+end program main
diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index ee7cff56fbe..e8ca8fc7987 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -280,7 +280,7 @@ proc compat-execute { src1 sid use_alt } {
# On the SPU, most of the compat test cases exceed local store size.
# Use automatic overlay support to make them fit.
- if { [istarget spu-*-elf*] } {
+ if { [check_effective_target_spu_auto_overlay] } {
set extra_flags_1 "$extra_flags_1 -Wl,--auto-overlay"
set extra_flags_1 "$extra_flags_1 -ffunction-sections"
set extra_flags_2 "$extra_flags_2 -ffunction-sections"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 011e5904ba0..f56b3f4f212 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1249,6 +1249,17 @@ proc check_effective_target_arm_neon_ok { } {
}
}
+# Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be
+# used.
+
+proc check_effective_target_arm_thumb1_ok { } {
+ return [check_no_compiler_messages arm_thumb1_ok assembly {
+ #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
+ #error FOO
+ #endif
+ } "-mthumb"]
+}
+
# Return 1 if the target supports executing NEON instructions, 0
# otherwise. Cache the result.
@@ -1390,6 +1401,19 @@ proc check_effective_target_powerpc_altivec { } {
}
}
+# Return 1 if this is a SPU target with a toolchain that
+# supports automatic overlay generation.
+
+proc check_effective_target_spu_auto_overlay { } {
+ if { [istarget spu*-*-elf*] } {
+ return [check_no_compiler_messages spu_auto_overlay executable {
+ int main (void) { }
+ } "-Wl,--auto-overlay" ]
+ } else {
+ return 0
+ }
+}
+
# The VxWorks SPARC simulator accepts only EM_SPARC executables and
# chokes on EM_SPARC32PLUS or EM_SPARCV9 executables. Return 1 if the
# test environment appears to run executables on such a simulator.
diff --git a/gcc/toplev.c b/gcc/toplev.c
index a35c105160e..6ba0c83ac49 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -202,11 +202,6 @@ tree current_function_decl;
if none. */
const char * current_function_func_begin_label;
-/* Temporarily suppress certain warnings.
- This is set while reading code from a system header file. */
-
-int in_system_header = 0;
-
/* Nonzero means to collect statistics which might be expensive
and to print them when we are done. */
int flag_detailed_statistics = 0;
@@ -830,7 +825,7 @@ check_global_declaration_1 (tree decl)
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
{
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
- pedwarn ("%q+F used but never defined", decl);
+ pedwarn (0, "%q+F used but never defined", decl);
else
warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl);
/* This symbol is effectively an "extern" declaration now. */
@@ -1707,9 +1702,6 @@ process_options (void)
if (flag_asynchronous_unwind_tables)
flag_unwind_tables = 1;
- if (!flag_unit_at_a_time)
- flag_section_anchors = 0;
-
if (flag_value_profile_transformations)
flag_profile_values = 1;
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 2668fac72a8..f1e4fe500f6 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_TOPLEV_H
#define GCC_TOPLEV_H
+#include "input.h"
/* If non-NULL, return one past-the-end of the matching SUBPART of
the WHOLE string. */
@@ -58,10 +59,14 @@ extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
extern void warning0 (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
/* Pass one of the OPT_W* from options.h as the first parameter. */
extern void warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void warning_at (location_t, int, const char *, ...)
+ ATTRIBUTE_GCC_DIAG(3,4);
extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void pedwarn (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+extern void pedwarn0 (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+/* Pass one of the OPT_W* from options.h as the first parameter. */
+extern void pedwarn (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void permerror (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
@@ -79,6 +84,7 @@ extern void announce_function (tree);
extern void error_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void warning_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void warn_deprecated_use (tree);
+extern bool parse_optimize_options (tree, bool);
#ifdef BUFSIZ
extern void output_quoted_string (FILE *, const char *);
@@ -155,6 +161,7 @@ extern void decode_d_option (const char *);
/* Return true iff flags are set as if -ffast-math. */
extern bool fast_math_flags_set_p (void);
+extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
/* Return log2, or -1 if not exact. */
extern int exact_log2 (unsigned HOST_WIDE_INT);
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 341a1de749d..5b747e84f66 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -7200,7 +7200,7 @@ execute_warn_function_return (void)
location = EXPR_LOCATION (last);
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
- warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", &location);
+ warning_at (location, OPT_Wreturn_type, "control reaches end of non-void function");
TREE_NO_WARNING (cfun->decl) = 1;
break;
}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index c0f4c880f7f..103f504c2d9 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -90,13 +90,6 @@ along with GCC; see the file COPYING3. If not see
See the CALL_EXPR handling case in copy_body_r (). */
-/* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
-int flag_inline_trees = 0;
-
/* To Do:
o In order to make inlining-on-trees work, we pessimized
@@ -951,7 +944,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
pointer_set_insert (id->statements_to_fold, stmt);
/* We're duplicating a CALL_EXPR. Find any corresponding
callgraph edges and update or duplicate them. */
- if (call && (decl = get_callee_fndecl (call)))
+ if (call)
{
struct cgraph_node *node;
struct cgraph_edge *edge;
@@ -962,7 +955,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
edge = cgraph_edge (id->src_node, orig_stmt);
if (edge)
cgraph_clone_edge (edge, id->dst_node, stmt,
- REG_BR_PROB_BASE, 1, edge->frequency, true);
+ REG_BR_PROB_BASE, 1,
+ edge->frequency, true);
break;
case CB_CGE_MOVE_CLONES:
@@ -971,8 +965,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
node = node->next_clone)
{
edge = cgraph_edge (node, orig_stmt);
- gcc_assert (edge);
- cgraph_set_call_stmt (edge, stmt);
+ if (edge)
+ cgraph_set_call_stmt (edge, stmt);
}
/* FALLTHRU */
@@ -2064,7 +2058,6 @@ inlinable_function_p (tree fn)
/* We only warn for functions declared `inline' by the user. */
do_warning = (warn_inline
- && DECL_INLINE (fn)
&& DECL_DECLARED_INLINE_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn));
@@ -2099,24 +2092,6 @@ inlinable_function_p (tree fn)
if (!DECL_SAVED_TREE (fn))
return false;
- /* If we're not inlining at all, then we cannot inline this function. */
- else if (!flag_inline_trees)
- inlinable = false;
-
- /* Only try to inline functions if DECL_INLINE is set. This should be
- true for all functions declared `inline', and for all other functions
- as well with -finline-functions.
-
- Don't think of disregarding DECL_INLINE when flag_inline_trees == 2;
- it's the front-end that must set DECL_INLINE in this case, because
- dwarf2out loses if a function that does not have DECL_INLINE set is
- inlined anyway. That is why we have both DECL_INLINE and
- DECL_DECLARED_INLINE_P. */
- /* FIXME: When flag_inline_trees dies, the check for flag_unit_at_a_time
- here should be redundant. */
- else if (!DECL_INLINE (fn) && !flag_unit_at_a_time)
- inlinable = false;
-
else if (inline_forbidden_p (fn))
{
/* See if we should warn about uninlinable functions. Previously,
@@ -2580,6 +2555,20 @@ add_lexical_block (tree current_block, tree new_block)
BLOCK_SUPERCONTEXT (new_block) = current_block;
}
+/* Fetch callee declaration from the call graph edge going from NODE and
+ associated with STMR call statement. Return NULL_TREE if not found. */
+static tree
+get_indirect_callee_fndecl (struct cgraph_node *node, tree stmt)
+{
+ struct cgraph_edge *cs;
+
+ cs = cgraph_edge (node, stmt);
+ if (cs)
+ return cs->callee->decl;
+
+ return NULL_TREE;
+}
+
/* If *TP is a CALL_EXPR, replace it with its inline expansion. */
static bool
@@ -2621,7 +2610,11 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
If we cannot, then there is no hope of inlining the function. */
fn = get_callee_fndecl (t);
if (!fn)
- goto egress;
+ {
+ fn = get_indirect_callee_fndecl (id->dst_node, stmt);
+ if (!fn)
+ goto egress;
+ }
/* Turn forward declarations into real ones. */
fn = cgraph_node (fn)->decl;
@@ -2655,7 +2648,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
where previous inlining turned indirect call into direct call by
constant propagating arguments. In all other cases we hit a bug
(incorrect node sharing is most common reason for missing edges. */
- gcc_assert (dest->needed || !flag_unit_at_a_time);
+ gcc_assert (dest->needed);
cgraph_create_edge (id->dst_node, dest, stmt,
bb->count, CGRAPH_FREQ_BASE,
bb->loop_depth)->inline_failed
@@ -2672,9 +2665,15 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
inlining. */
if (!cgraph_inline_p (cg_edge, &reason))
{
+ /* If this call was originally indirect, we do not want to emit any
+ inlining related warnings or sorry messages because there are no
+ guarantees regarding those. */
+ if (cg_edge->indirect_call)
+ goto egress;
+
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
- && (!flag_unit_at_a_time || cgraph_global_info_ready))
+ && cgraph_global_info_ready)
{
sorry ("inlining failed in call to %q+F: %s", fn, reason);
sorry ("called from here");
@@ -2684,7 +2683,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
&& strlen (reason)
&& !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
- && (!flag_unit_at_a_time || cgraph_global_info_ready))
+ && cgraph_global_info_ready)
{
warning (OPT_Winline, "inlining failed in call to %q+F: %s",
fn, reason);
@@ -3683,3 +3682,34 @@ build_duplicate_type (tree type)
return type;
}
+
+/* Return whether it is safe to inline a function because it used different
+ target specific options or different optimization options. */
+bool
+tree_can_inline_p (tree caller, tree callee)
+{
+ /* Don't inline a function with a higher optimization level than the
+ caller, or with different space constraints (hot/cold functions). */
+ tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (caller);
+ tree callee_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee);
+
+ if (caller_tree != callee_tree)
+ {
+ struct cl_optimization *caller_opt
+ = TREE_OPTIMIZATION ((caller_tree)
+ ? caller_tree
+ : optimization_default_node);
+
+ struct cl_optimization *callee_opt
+ = TREE_OPTIMIZATION ((callee_tree)
+ ? callee_tree
+ : optimization_default_node);
+
+ if ((caller_opt->optimize > callee_opt->optimize)
+ || (caller_opt->optimize_size != callee_opt->optimize_size))
+ return false;
+ }
+
+ /* Allow the backend to decide if inlining is ok. */
+ return targetm.target_option.can_inline_p (caller, callee);
+}
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index a69afd00f99..ab03f7a20ad 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -150,17 +150,11 @@ int estimate_move_cost (tree type);
int estimate_num_insns (tree expr, eni_weights *);
bool tree_versionable_function_p (tree);
void tree_function_versioning (tree, tree, varray_type, bool);
+bool tree_can_inline_p (tree, tree);
extern tree remap_decl (tree decl, copy_body_data *id);
extern tree remap_type (tree type, copy_body_data *id);
extern HOST_WIDE_INT estimated_stack_frame_size (void);
-/* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
-extern int flag_inline_trees;
-
#endif /* GCC_TREE_INLINE_H */
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index cdf6c3fd9e6..f277be91d0c 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -226,12 +226,18 @@ tree_nrv (void)
return 0;
}
+static bool
+gate_pass_return_slot (void)
+{
+ return optimize > 0;
+}
+
struct gimple_opt_pass pass_nrv =
{
{
GIMPLE_PASS,
"nrv", /* name */
- NULL, /* gate */
+ gate_pass_return_slot, /* gate */
tree_nrv, /* execute */
NULL, /* sub */
NULL, /* next */
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 35feaa1be5b..820df4c2ce0 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -115,7 +115,7 @@ execute_early_local_optimizations (void)
cgraph state so newly inserted functions are also early optimized.
However we execute early local optimizations for lately inserted
functions, in that case don't reset cgraph state back to IPA_SSA. */
- if (flag_unit_at_a_time && cgraph_state < CGRAPH_STATE_IPA_SSA)
+ if (cgraph_state < CGRAPH_STATE_IPA_SSA)
cgraph_state = CGRAPH_STATE_IPA_SSA;
return 0;
}
@@ -341,20 +341,12 @@ execute_init_datastructures (void)
return 0;
}
-/* Gate: initialize or not the SSA datastructures. */
-
-static bool
-gate_init_datastructures (void)
-{
- return (optimize >= 1);
-}
-
struct gimple_opt_pass pass_init_datastructures =
{
{
GIMPLE_PASS,
NULL, /* name */
- gate_init_datastructures, /* gate */
+ NULL, /* gate */
execute_init_datastructures, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -399,7 +391,7 @@ tree_rest_of_compilation (tree fndecl)
timevar_push (TV_EXPAND);
- gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
+ gcc_assert (cgraph_global_info_ready);
node = cgraph_node (fndecl);
@@ -456,20 +448,17 @@ tree_rest_of_compilation (tree fndecl)
}
}
- if (!flag_inline_trees)
+ DECL_SAVED_TREE (fndecl) = NULL;
+ if (DECL_STRUCT_FUNCTION (fndecl) == 0
+ && !cgraph_node (fndecl)->origin)
{
- DECL_SAVED_TREE (fndecl) = NULL;
- if (DECL_STRUCT_FUNCTION (fndecl) == 0
- && !cgraph_node (fndecl)->origin)
- {
- /* Stop pointing to the local nodes about to be freed.
- But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition.
- For a nested function, this is done in c_pop_function_context.
- If rest_of_compilation set this to 0, leave it 0. */
- if (DECL_INITIAL (fndecl) != 0)
- DECL_INITIAL (fndecl) = error_mark_node;
- }
+ /* Stop pointing to the local nodes about to be freed.
+ But DECL_INITIAL must remain nonzero so we know this
+ was an actual function definition.
+ For a nested function, this is done in c_pop_function_context.
+ If rest_of_compilation set this to 0, leave it 0. */
+ if (DECL_INITIAL (fndecl) != 0)
+ DECL_INITIAL (fndecl) = error_mark_node;
}
input_location = saved_loc;
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index c695863e553..8d50aacebf0 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -504,7 +504,6 @@ extern struct rtl_opt_pass pass_final;
extern struct rtl_opt_pass pass_rtl_seqabstr;
extern struct gimple_opt_pass pass_release_ssa_names;
extern struct gimple_opt_pass pass_early_inline;
-extern struct gimple_opt_pass pass_O0_always_inline;
extern struct gimple_opt_pass pass_inline_parameters;
extern struct gimple_opt_pass pass_all_early_optimizations;
extern struct gimple_opt_pass pass_update_address_taken;
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 9aac154b436..405f0d8553d 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -311,11 +311,8 @@ tree_gen_ic_func_profiler (void)
tree stmt1, stmt2;
tree tree_uid, cur_func;
- if (flag_unit_at_a_time)
- {
- if (!c_node->needed)
- return;
- }
+ if (!c_node->needed)
+ return;
tree_init_edge_profiler ();
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 3aa79feddd6..2fec08dae8d 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -3714,17 +3714,7 @@ may_be_aliased (tree var)
if (!TREE_STATIC (var))
return false;
- /* If we're in unit-at-a-time mode, then we must have seen all
- occurrences of address-of operators, and so we can trust
- TREE_ADDRESSABLE. Otherwise we can only be sure the variable
- isn't addressable if it's local to the current function. */
- if (flag_unit_at_a_time)
- return false;
-
- if (decl_function_context (var) == current_function_decl)
- return false;
-
- return true;
+ return false;
}
/* The following is based on code in add_stmt_operand to ensure that the
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index 388437d44bb..a96029aa7c5 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -1297,6 +1297,24 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
}
}
+/* Returns a hash code for P. */
+
+static hashval_t
+hash_ssa_name_by_var (const void *p)
+{
+ const_tree n = (const_tree) p;
+ return (hashval_t) htab_hash_pointer (SSA_NAME_VAR (n));
+}
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+eq_ssa_name_by_var (const void *p1, const void *p2)
+{
+ const_tree n1 = (const_tree) p1;
+ const_tree n2 = (const_tree) p2;
+ return SSA_NAME_VAR (n1) == SSA_NAME_VAR (n2);
+}
/* Reduce the number of copies by coalescing variables in the function. Return
a partition map with the resulting coalesces. */
@@ -1310,10 +1328,42 @@ coalesce_ssa_name (void)
coalesce_list_p cl;
bitmap used_in_copies = BITMAP_ALLOC (NULL);
var_map map;
+ unsigned int i;
+ static htab_t ssa_name_hash;
cl = create_coalesce_list ();
map = create_outofssa_var_map (cl, used_in_copies);
+ /* We need to coalesce all names originating same SSA_NAME_VAR
+ so debug info remains undisturbed. */
+ if (!optimize)
+ {
+ ssa_name_hash = htab_create (10, hash_ssa_name_by_var,
+ eq_ssa_name_by_var, NULL);
+ for (i = 1; i < num_ssa_names; i++)
+ {
+ tree a = ssa_name (i);
+
+ if (a && SSA_NAME_VAR (a) && !DECL_ARTIFICIAL (SSA_NAME_VAR (a)))
+ {
+ tree *slot = (tree *) htab_find_slot (ssa_name_hash, a, INSERT);
+
+ if (!*slot)
+ *slot = a;
+ else
+ {
+ add_coalesce (cl, SSA_NAME_VERSION (a), SSA_NAME_VERSION (*slot),
+ MUST_COALESCE_COST - 1);
+ bitmap_set_bit (used_in_copies, SSA_NAME_VERSION (a));
+ bitmap_set_bit (used_in_copies, SSA_NAME_VERSION (*slot));
+ }
+ }
+ }
+ htab_delete (ssa_name_hash);
+ }
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ dump_var_map (dump_file, map);
+
/* Don't calculate live ranges for variables not in the coalesce list. */
partition_view_bitmap (map, used_in_copies, true);
BITMAP_FREE (used_in_copies);
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index c277980ed86..a5f75963da0 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -582,7 +582,8 @@ remove_unused_locals (void)
var_ann_t ann;
bitmap global_unused_vars = NULL;
- mark_scope_block_unused (DECL_INITIAL (current_function_decl));
+ if (optimize)
+ mark_scope_block_unused (DECL_INITIAL (current_function_decl));
/* Assume all locals are unused. */
FOR_EACH_REFERENCED_VAR (t, rvi)
var_ann (t)->used = false;
@@ -661,7 +662,8 @@ remove_unused_locals (void)
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
- && bitmap_bit_p (global_unused_vars, DECL_UID (var)))
+ && bitmap_bit_p (global_unused_vars, DECL_UID (var))
+ && (optimize || DECL_ARTIFICIAL (var)))
*cell = TREE_CHAIN (*cell);
else
cell = &TREE_CHAIN (*cell);
@@ -681,9 +683,11 @@ remove_unused_locals (void)
&& TREE_CODE (t) != RESULT_DECL
&& !(ann = var_ann (t))->used
&& !ann->symbol_mem_tag
- && !TREE_ADDRESSABLE (t))
+ && !TREE_ADDRESSABLE (t)
+ && (optimize || DECL_ARTIFICIAL (t)))
remove_referenced_var (t);
- remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
+ if (optimize)
+ remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
}
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6121437b245..7c4cd3d6805 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5559,8 +5559,7 @@ delete_points_to_sets (void)
static bool
gate_ipa_pta (void)
{
- return (flag_unit_at_a_time != 0
- && flag_ipa_pta
+ return (flag_ipa_pta
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index a93001a985b..e02867520c8 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "tree-dump.h"
#include "tree-ssa-live.h"
+#include "flags.h"
/* Temporary Expression Replacement (TER)
@@ -364,6 +365,8 @@ is_replaceable_p (tree stmt)
tree call_expr;
use_operand_p use_p;
tree def, use_stmt;
+ location_t locus1, locus2;
+ tree block1, block2;
/* Only consider modify stmts. */
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
@@ -386,6 +389,36 @@ is_replaceable_p (tree stmt)
if (bb_for_stmt (use_stmt) != bb_for_stmt (stmt))
return false;
+ if (GIMPLE_STMT_P (stmt))
+ {
+ locus1 = GIMPLE_STMT_LOCUS (stmt);
+ block1 = GIMPLE_STMT_BLOCK (stmt);
+ }
+ else
+ {
+ locus1 = *EXPR_LOCUS (stmt);
+ block1 = TREE_BLOCK (stmt);
+ }
+ if (GIMPLE_STMT_P (use_stmt))
+ {
+ locus2 = GIMPLE_STMT_LOCUS (use_stmt);
+ block2 = GIMPLE_STMT_BLOCK (use_stmt);
+ }
+ if (TREE_CODE (use_stmt) == PHI_NODE)
+ {
+ locus2 = 0;
+ block2 = NULL_TREE;
+ }
+ else
+ {
+ locus2 = *EXPR_LOCUS (use_stmt);
+ block2 = TREE_BLOCK (use_stmt);
+ }
+
+ if (!optimize
+ && ((locus1 && locus1 != locus2) || (block1 && block1 != block2)))
+ return false;
+
/* Used in this block, but at the TOP of the block, not the end. */
if (TREE_CODE (use_stmt) == PHI_NODE)
return false;
@@ -394,6 +427,10 @@ is_replaceable_p (tree stmt)
if (!(ZERO_SSA_OPERANDS (stmt, SSA_OP_VDEF)))
return false;
+ /* Without alias info we can't move around loads. */
+ if (stmt_ann (stmt)->references_memory && !optimize)
+ return false;
+
/* Float expressions must go through memory if float-store is on. */
if (flag_float_store
&& FLOAT_TYPE_P (TREE_TYPE (GENERIC_TREE_OPERAND (stmt, 1))))
@@ -412,7 +449,6 @@ is_replaceable_p (tree stmt)
/* Leave any stmt with volatile operands alone as well. */
if (stmt_ann (stmt)->has_volatile_ops)
return false;
-
return true;
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 7f567b57a2e..2ac1c1184ee 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1385,7 +1385,7 @@ warn_uninit (tree t, const char *gmsgid, void *data)
locus = (context != NULL && EXPR_HAS_LOCATION (context)
? EXPR_LOCUS (context)
: &DECL_SOURCE_LOCATION (var));
- warning (OPT_Wuninitialized, gmsgid, locus, var);
+ warning_at (*locus, OPT_Wuninitialized, gmsgid, var);
xloc = expand_location (*locus);
floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl));
if (xloc.file != floc.file
@@ -1416,10 +1416,10 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
/* We only do data flow with SSA_NAMEs, so that's all we
can warn about. */
if (data->always_executed)
- warn_uninit (t, "%H%qD is used uninitialized in this function",
+ warn_uninit (t, "%qD is used uninitialized in this function",
data->stmt);
else
- warn_uninit (t, "%H%qD may be used uninitialized in this function",
+ warn_uninit (t, "%qD may be used uninitialized in this function",
data->stmt);
*walk_subtrees = 0;
break;
@@ -1458,7 +1458,7 @@ warn_uninitialized_phi (tree phi)
{
tree op = PHI_ARG_DEF (phi, i);
if (TREE_CODE (op) == SSA_NAME)
- warn_uninit (op, "%H%qD may be used uninitialized in this function",
+ warn_uninit (op, "%qD may be used uninitialized in this function",
NULL);
}
}
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 36c87f9bd51..2205c1a8b71 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -474,7 +474,8 @@ build_one_array (tree swtch, int num, tree arr_index_type, tree phi, tree tidx)
DECL_ARTIFICIAL (decl) = 1;
TREE_CONSTANT (decl) = 1;
add_referenced_var (decl);
- assemble_variable (decl, 0, 0, 0);
+ varpool_mark_needed_node (varpool_node (decl));
+ varpool_finalize_decl (decl);
mark_sym_for_renaming (decl);
name = make_ssa_name (SSA_NAME_VAR (PHI_RESULT (phi)), NULL_TREE);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 404531f4504..62f314795ae 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3456,7 +3456,9 @@ infer_value_range (tree stmt, tree op, enum tree_code *comp_code_p, tree *val_p)
/* We can only assume that a pointer dereference will yield
non-NULL if -fdelete-null-pointer-checks is enabled. */
- if (flag_delete_null_pointer_checks && POINTER_TYPE_P (TREE_TYPE (op)))
+ if (flag_delete_null_pointer_checks
+ && POINTER_TYPE_P (TREE_TYPE (op))
+ && TREE_CODE (stmt) != ASM_EXPR)
{
unsigned num_uses, num_loads, num_stores;
diff --git a/gcc/tree.c b/gcc/tree.c
index 6441ae6ef33..0af11893883 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -175,6 +175,16 @@ static GTY (()) tree int_cst_node;
static GTY ((if_marked ("ggc_marked_p"), param_is (union tree_node)))
htab_t int_cst_hash_table;
+/* Hash table for optimization flags and target option flags. Use the same
+ hash table for both sets of options. Nodes for building the current
+ optimization and target option nodes. The assumption is most of the time
+ the options created will already be in the hash table, so we avoid
+ allocating and freeing up a node repeatably. */
+static GTY (()) tree cl_optimization_node;
+static GTY (()) tree cl_target_option_node;
+static GTY ((if_marked ("ggc_marked_p"), param_is (union tree_node)))
+ htab_t cl_option_hash_table;
+
/* General tree->tree mapping structure for use in hash tables. */
@@ -196,6 +206,8 @@ static int type_hash_eq (const void *, const void *);
static hashval_t type_hash_hash (const void *);
static hashval_t int_cst_hash_hash (const void *);
static int int_cst_hash_eq (const void *, const void *);
+static hashval_t cl_option_hash_hash (const void *);
+static int cl_option_hash_eq (const void *, const void *);
static void print_type_hash_statistics (void);
static void print_debug_expr_statistics (void);
static void print_value_expr_statistics (void);
@@ -273,6 +285,12 @@ init_ttree (void)
int_cst_node = make_node (INTEGER_CST);
+ cl_option_hash_table = htab_create_ggc (64, cl_option_hash_hash,
+ cl_option_hash_eq, NULL);
+
+ cl_optimization_node = make_node (OPTIMIZATION_NODE);
+ cl_target_option_node = make_node (TARGET_OPTION_NODE);
+
tree_contains_struct[FUNCTION_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[TYPE_DECL][TS_DECL_NON_COMMON] = 1;
@@ -505,6 +523,8 @@ tree_code_size (enum tree_code code)
case STATEMENT_LIST: return sizeof (struct tree_statement_list);
case BLOCK: return sizeof (struct tree_block);
case CONSTRUCTOR: return sizeof (struct tree_constructor);
+ case OPTIMIZATION_NODE: return sizeof (struct tree_optimization_option);
+ case TARGET_OPTION_NODE: return sizeof (struct tree_target_option);
default:
return lang_hooks.tree_size (code);
@@ -663,8 +683,6 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
break;
case tcc_declaration:
- if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
- DECL_IN_SYSTEM_HEADER (t) = in_system_header;
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
if (code == FUNCTION_DECL)
@@ -2429,6 +2447,8 @@ tree_node_structure (const_tree t)
case CONSTRUCTOR: return TS_CONSTRUCTOR;
case TREE_BINFO: return TS_BINFO;
case OMP_CLAUSE: return TS_OMP_CLAUSE;
+ case OPTIMIZATION_NODE: return TS_OPTIMIZATION;
+ case TARGET_OPTION_NODE: return TS_TARGET_OPTION;
default:
gcc_unreachable ();
@@ -3564,6 +3584,7 @@ expand_location (source_location loc)
xloc.file = NULL;
xloc.line = 0;
xloc.column = 0;
+ xloc.sysp = 0;
}
else
{
@@ -3571,6 +3592,7 @@ expand_location (source_location loc)
xloc.file = map->to_file;
xloc.line = SOURCE_LINE (map, loc);
xloc.column = SOURCE_COLUMN (map, loc);
+ xloc.sysp = map->sysp != 0;
};
return xloc;
}
@@ -8942,4 +8964,132 @@ block_nonartificial_location (tree block)
return ret;
}
+/* These are the hash table functions for the hash table of OPTIMIZATION_NODEq
+ nodes. */
+
+/* Return the hash code code X, an OPTIMIZATION_NODE or TARGET_OPTION code. */
+
+static hashval_t
+cl_option_hash_hash (const void *x)
+{
+ const_tree const t = (const_tree) x;
+ const char *p;
+ size_t i;
+ size_t len = 0;
+ hashval_t hash = 0;
+
+ if (TREE_CODE (t) == OPTIMIZATION_NODE)
+ {
+ p = (const char *)TREE_OPTIMIZATION (t);
+ len = sizeof (struct cl_optimization);
+ }
+
+ else if (TREE_CODE (t) == TARGET_OPTION_NODE)
+ {
+ p = (const char *)TREE_TARGET_OPTION (t);
+ len = sizeof (struct cl_target_option);
+ }
+
+ else
+ gcc_unreachable ();
+
+ /* assume most opt flags are just 0/1, some are 2-3, and a few might be
+ something else. */
+ for (i = 0; i < len; i++)
+ if (p[i])
+ hash = (hash << 4) ^ ((i << 2) | p[i]);
+
+ return hash;
+}
+
+/* Return nonzero if the value represented by *X (an OPTIMIZATION or
+ TARGET_OPTION tree node) is the same as that given by *Y, which is the
+ same. */
+
+static int
+cl_option_hash_eq (const void *x, const void *y)
+{
+ const_tree const xt = (const_tree) x;
+ const_tree const yt = (const_tree) y;
+ const char *xp;
+ const char *yp;
+ size_t len;
+
+ if (TREE_CODE (xt) != TREE_CODE (yt))
+ return 0;
+
+ if (TREE_CODE (xt) == OPTIMIZATION_NODE)
+ {
+ xp = (const char *)TREE_OPTIMIZATION (xt);
+ yp = (const char *)TREE_OPTIMIZATION (yt);
+ len = sizeof (struct cl_optimization);
+ }
+
+ else if (TREE_CODE (xt) == TARGET_OPTION_NODE)
+ {
+ xp = (const char *)TREE_TARGET_OPTION (xt);
+ yp = (const char *)TREE_TARGET_OPTION (yt);
+ len = sizeof (struct cl_target_option);
+ }
+
+ else
+ gcc_unreachable ();
+
+ return (memcmp (xp, yp, len) == 0);
+}
+
+/* Build an OPTIMIZATION_NODE based on the current options. */
+
+tree
+build_optimization_node (void)
+{
+ tree t;
+ void **slot;
+
+ /* Use the cache of optimization nodes. */
+
+ cl_optimization_save (TREE_OPTIMIZATION (cl_optimization_node));
+
+ slot = htab_find_slot (cl_option_hash_table, cl_optimization_node, INSERT);
+ t = (tree) *slot;
+ if (!t)
+ {
+ /* Insert this one into the hash table. */
+ t = cl_optimization_node;
+ *slot = t;
+
+ /* Make a new node for next time round. */
+ cl_optimization_node = make_node (OPTIMIZATION_NODE);
+ }
+
+ return t;
+}
+
+/* Build a TARGET_OPTION_NODE based on the current options. */
+
+tree
+build_target_option_node (void)
+{
+ tree t;
+ void **slot;
+
+ /* Use the cache of optimization nodes. */
+
+ cl_target_option_save (TREE_TARGET_OPTION (cl_target_option_node));
+
+ slot = htab_find_slot (cl_option_hash_table, cl_target_option_node, INSERT);
+ t = (tree) *slot;
+ if (!t)
+ {
+ /* Insert this one into the hash table. */
+ t = cl_target_option_node;
+ *slot = t;
+
+ /* Make a new node for next time round. */
+ cl_target_option_node = make_node (TARGET_OPTION_NODE);
+ }
+
+ return t;
+}
+
#include "gt-tree.h"
diff --git a/gcc/tree.def b/gcc/tree.def
index 48b2f1cbde1..26e72c44bd3 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -1194,6 +1194,13 @@ DEFTREECODE (VEC_INTERLEAVE_LOW_EXPR, "vec_interleavelow_expr", tcc_binary, 2)
all conditional branches leading to execution paths executing the
PREDICT_EXPR will get predicted by the specified predictor. */
DEFTREECODE (PREDICT_EXPR, "predict_expr", tcc_unary, 1)
+
+/* OPTIMIZATION_NODE. Node to store the optimization options. */
+DEFTREECODE (OPTIMIZATION_NODE, "optimization_node", tcc_exceptional, 0)
+
+/* TARGET_OPTION_NODE. Node to store the target specific options. */
+DEFTREECODE (TARGET_OPTION_NODE, "target_option_node", tcc_exceptional, 0)
+
/*
Local variables:
mode:c
diff --git a/gcc/tree.h b/gcc/tree.h
index 103f802c806..0ffd91bc40b 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "vec.h"
#include "double-int.h"
#include "alias.h"
+#include "options.h"
/* Codes of tree nodes */
@@ -3051,7 +3052,7 @@ struct tree_parm_decl GTY(())
/* Nonzero for a given ..._DECL node means that no warnings should be
generated just because this node is unused. */
#define DECL_IN_SYSTEM_HEADER(NODE) \
- (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.in_system_header_flag)
+ (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
/* Used to indicate that this DECL has weak linkage. */
#define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
@@ -3179,7 +3180,6 @@ struct tree_decl_with_vis GTY(())
unsigned shadowed_for_var_p : 1;
/* Don't belong to VAR_DECL exclusively. */
- unsigned in_system_header_flag : 1;
unsigned weak_flag:1;
unsigned seen_in_bind_expr : 1;
unsigned comdat_flag : 1;
@@ -3191,7 +3191,7 @@ struct tree_decl_with_vis GTY(())
/* Belongs to VAR_DECL exclusively. */
ENUM_BITFIELD(tls_model) tls_model : 3;
- /* 11 unused bits. */
+ /* 12 unused bits. */
};
/* In a VAR_DECL that's static,
@@ -3409,6 +3409,16 @@ struct tree_decl_non_common GTY(())
#define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
#define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
+/* In FUNCTION_DECL, the function specific target options to use when compiling
+ this function. */
+#define DECL_FUNCTION_SPECIFIC_TARGET(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_target)
+
+/* In FUNCTION_DECL, the function specific optimization options to use when
+ compiling this function. */
+#define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_optimization)
+
/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
arguments/result/saved_tree fields by front ends. It was either inherit
FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
@@ -3420,6 +3430,10 @@ struct tree_function_decl GTY(())
struct function *f;
+ /* Function specific options that are used by this function. */
+ tree function_specific_target; /* target options */
+ tree function_specific_optimization; /* optimization options */
+
/* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
DECL_FUNCTION_CODE. Otherwise unused.
??? The bitfield needs to be able to hold all target function
@@ -3492,6 +3506,39 @@ struct tree_statement_list
struct tree_statement_list_node *tail;
};
+
+/* Optimization options used by a function. */
+
+struct tree_optimization_option GTY(())
+{
+ struct tree_common common;
+
+ /* The optimization options used by the user. */
+ struct cl_optimization opts;
+};
+
+#define TREE_OPTIMIZATION(NODE) \
+ (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
+
+/* Return a tree node that encapsulates the current optimization options. */
+extern tree build_optimization_node (void);
+
+/* Target options used by a function. */
+
+struct tree_target_option GTY(())
+{
+ struct tree_common common;
+
+ /* The optimization options used by the user. */
+ struct cl_target_option opts;
+};
+
+#define TREE_TARGET_OPTION(NODE) \
+ (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts)
+
+/* Return a tree node that encapsulates the current target options. */
+extern tree build_target_option_node (void);
+
/* Define the overall contents of a tree node.
It may be any of the structures declared above
@@ -3536,6 +3583,8 @@ union tree_node GTY ((ptr_alias (union lang_tree_node),
struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
struct tree_memory_partition_tag GTY ((tag ("TS_MEMORY_PARTITION_TAG"))) mpt;
+ struct tree_optimization_option GTY ((tag ("TS_OPTIMIZATION"))) optimization;
+ struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option;
};
/* Standard named or nameless data types of the C compiler. */
@@ -3683,6 +3732,15 @@ enum tree_index
TI_SAT_UDA_TYPE,
TI_SAT_UTA_TYPE,
+ TI_OPTIMIZATION_DEFAULT,
+ TI_OPTIMIZATION_CURRENT,
+ TI_OPTIMIZATION_COLD,
+ TI_OPTIMIZATION_HOT,
+ TI_TARGET_OPTION_DEFAULT,
+ TI_TARGET_OPTION_CURRENT,
+ TI_CURRENT_OPTION_PRAGMA,
+ TI_CURRENT_OPTIMIZE_PRAGMA,
+
TI_MAX
};
@@ -3850,6 +3908,22 @@ extern GTY(()) tree global_trees[TI_MAX];
#define main_identifier_node global_trees[TI_MAIN_IDENTIFIER]
#define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
+/* Optimization options (OPTIMIZATION_NODE) to use for default, current, cold,
+ and hot functions. */
+#define optimization_default_node global_trees[TI_OPTIMIZATION_DEFAULT]
+#define optimization_current_node global_trees[TI_OPTIMIZATION_CURRENT]
+#define optimization_cold_node global_trees[TI_OPTIMIZATION_COLD]
+#define optimization_hot_node global_trees[TI_OPTIMIZATION_HOT]
+
+/* Default/current target options (TARGET_OPTION_NODE). */
+#define target_option_default_node global_trees[TI_TARGET_OPTION_DEFAULT]
+#define target_option_current_node global_trees[TI_TARGET_OPTION_CURRENT]
+
+/* Default tree list option(), optimize() pragmas to be linked into the
+ attribute list. */
+#define current_option_pragma global_trees[TI_CURRENT_OPTION_PRAGMA]
+#define current_optimize_pragma global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
+
/* An enumeration of the standard C integer types. These must be
ordered so that shorter types appear before longer ones, and so
that signed types appear before unsigned ones, for the correct
diff --git a/gcc/treestruct.def b/gcc/treestruct.def
index cdf52704ebd..0f3dbbdfb2a 100644
--- a/gcc/treestruct.def
+++ b/gcc/treestruct.def
@@ -63,3 +63,6 @@ DEFTREESTRUCT(TS_CONSTRUCTOR, "constructor")
DEFTREESTRUCT(TS_MEMORY_TAG, "memory tag")
DEFTREESTRUCT(TS_OMP_CLAUSE, "omp clause")
DEFTREESTRUCT(TS_MEMORY_PARTITION_TAG, "memory partition tag")
+DEFTREESTRUCT(TS_OPTIMIZATION, "optimization options")
+DEFTREESTRUCT(TS_TARGET_OPTION, "target options")
+
diff --git a/gcc/varasm.c b/gcc/varasm.c
index ad2421298ba..941716f73bd 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2228,7 +2228,7 @@ contains_pointers_p (tree type)
}
}
-/* In unit-at-a-time mode, we delay assemble_external processing until
+/* We delay assemble_external processing until
the compilation unit is finalized. This is the best we can do for
right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
it all the way to final. See PR 17982 for further discussion. */
@@ -5380,7 +5380,7 @@ assemble_alias (tree decl, tree target)
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad of memory. */
- if (!flag_unit_at_a_time || cgraph_global_info_ready)
+ if (cgraph_global_info_ready)
target_decl = find_decl_and_mark_needed (decl, target);
else
target_decl= NULL;
diff --git a/gcc/varpool.c b/gcc/varpool.c
index c2410f664f5..daa0c15259d 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -61,7 +61,7 @@ struct varpool_node *varpool_nodes;
maintained in forward order. GTY is needed to make it friendly to
PCH.
- During unit-at-a-time compilation we construct the queue of needed variables
+ During compilation we construct the queue of needed variables
twice: first time it is during cgraph construction, second time it is at the
end of compilation in VARPOOL_REMOVE_UNREFERENCED_DECLS so we can avoid
optimized out variables being output.
@@ -214,17 +214,13 @@ varpool_reset_queue (void)
/* Determine if variable DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
- configury, or (if not doing unit-at-a-time) to something we haven't
- seen yet. */
+ configury */
bool
decide_is_variable_needed (struct varpool_node *node, tree decl)
{
/* If the user told us it is used, then it must be so. */
if (node->externally_visible || node->force_output)
return true;
- if (!flag_unit_at_a_time
- && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- return true;
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
@@ -257,7 +253,7 @@ decide_is_variable_needed (struct varpool_node *node, tree decl)
/* When not reordering top level variables, we have to assume that
we are going to keep everything. */
- if (flag_unit_at_a_time && flag_toplevel_reorder)
+ if (flag_toplevel_reorder)
return false;
/* We want to emit COMDAT variables only when absolutely necessary. */
@@ -280,7 +276,7 @@ varpool_finalize_decl (tree decl)
if this function has already run. */
if (node->finalized)
{
- if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
+ if (cgraph_global_info_ready)
varpool_assemble_pending_decls ();
return;
}
@@ -295,7 +291,7 @@ varpool_finalize_decl (tree decl)
there. */
else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
varpool_mark_needed_node (node);
- if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
+ if (cgraph_global_info_ready)
varpool_assemble_pending_decls ();
}
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 9b3b53e25de..cb1de791edc 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,31 @@
+2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28079
+ * directives.c (strtolinenum): Handle overflow.
+ (do_line): Give a warning if line number overflowed.
+ (do_linemarker): Update call to strtolinenum.
+
+2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * include/line-map.h (linenum_type): New typedef.
+ (struct line_map): Use it.
+ (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
+ (SOURCE_COLUMN): Likewise.
+ * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
+ source_location values in a variable of type linenum_type.
+ * directives.c (struct if_stack): Use linenum_type.
+ (strtoul_for_line): Rename as strtolinenum.
+ (do_line): Use linenum_type.
+ (do_linemarker): Use linenum_type and strtolinenum.
+ (_cpp_do_file_change): Use linenum_t.
+ * line-map.c (linemap_add): Likewise.
+ (linemap_line_start): Likewise.
+ * traditional.c (struct fun_macro): 'line' is a source_location.
+ * errors.c (print_location): Use linenum_type.
+ * directives-only.c (_cpp_preprocess_dir_only): Likewise.
+ * internal.h (CPP_INCREMENT_LINE): Likewise.
+ * lex.c (_cpp_skip_block_comment): Use source_location.
+
2008-07-14 Ben Elliston <bje@au.ibm.com>
* include/cpplib.h (NODE_CONDITIONAL): New.
diff --git a/libcpp/directives-only.c b/libcpp/directives-only.c
index d50cebbdae3..addd9a755dc 100644
--- a/libcpp/directives-only.c
+++ b/libcpp/directives-only.c
@@ -42,7 +42,8 @@ _cpp_preprocess_dir_only (cpp_reader *pfile,
const unsigned char *cur, *base, *next_line, *rlimit;
cppchar_t c, last_c;
unsigned flags;
- int lines, col;
+ linenum_type lines;
+ int col;
source_location loc;
restart:
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 370f4ff5b0d..9e0744b23d9 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -32,7 +32,7 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
struct if_stack
{
struct if_stack *next;
- unsigned int line; /* Line where condition started. */
+ linenum_type line; /* Line where condition started. */
const cpp_hashnode *mi_cmacro;/* macro name for #ifndef around entire file */
bool skip_elses; /* Can future #else / #elif be skipped? */
bool was_skipping; /* If were skipping on entry. */
@@ -102,7 +102,7 @@ static char *glue_header_name (cpp_reader *);
static const char *parse_include (cpp_reader *, int *, const cpp_token ***);
static void push_conditional (cpp_reader *, int, int, const cpp_hashnode *);
static unsigned int read_flag (cpp_reader *, unsigned int);
-static int strtoul_for_line (const uchar *, unsigned int, unsigned long *);
+static bool strtolinenum (const uchar *, size_t, linenum_type *, bool *);
static void do_diagnostic (cpp_reader *, int, int);
static cpp_hashnode *lex_macro_node (cpp_reader *, bool);
static int undefine_macros (cpp_reader *, cpp_hashnode *, void *);
@@ -837,23 +837,30 @@ read_flag (cpp_reader *pfile, unsigned int last)
}
/* Subroutine of do_line and do_linemarker. Convert a number in STR,
- of length LEN, to binary; store it in NUMP, and return 0 if the
- number was well-formed, 1 if not. Temporary, hopefully. */
-static int
-strtoul_for_line (const uchar *str, unsigned int len, long unsigned int *nump)
+ of length LEN, to binary; store it in NUMP, and return false if the
+ number was well-formed, true if not. WRAPPED is set to true if the
+ number did not fit into 'unsigned long'. */
+static bool
+strtolinenum (const uchar *str, size_t len, linenum_type *nump, bool *wrapped)
{
- unsigned long reg = 0;
+ linenum_type reg = 0;
+ linenum_type reg_prev = 0;
+
uchar c;
+ *wrapped = false;
while (len--)
{
c = *str++;
if (!ISDIGIT (c))
- return 1;
+ return true;
reg *= 10;
reg += c - '0';
+ if (reg < reg_prev)
+ *wrapped = true;
+ reg_prev = reg;
}
*nump = reg;
- return 0;
+ return false;
}
/* Interpret #line command.
@@ -871,16 +878,17 @@ do_line (cpp_reader *pfile)
unsigned char map_sysp = map->sysp;
const cpp_token *token;
const char *new_file = map->to_file;
- unsigned long new_lineno;
+ linenum_type new_lineno;
/* C99 raised the minimum limit on #line numbers. */
- unsigned int cap = CPP_OPTION (pfile, c99) ? 2147483647 : 32767;
+ linenum_type cap = CPP_OPTION (pfile, c99) ? 2147483647 : 32767;
+ bool wrapped;
/* #line commands expand macros. */
token = cpp_get_token (pfile);
if (token->type != CPP_NUMBER
- || strtoul_for_line (token->val.str.text, token->val.str.len,
- &new_lineno))
+ || strtolinenum (token->val.str.text, token->val.str.len,
+ &new_lineno, &wrapped))
{
if (token->type == CPP_EOF)
cpp_error (pfile, CPP_DL_ERROR, "unexpected end of file after #line");
@@ -891,8 +899,10 @@ do_line (cpp_reader *pfile)
return;
}
- if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap))
+ if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap || wrapped))
cpp_error (pfile, CPP_DL_PEDWARN, "line number out of range");
+ else if (wrapped)
+ cpp_error (pfile, CPP_DL_WARNING, "line number out of range");
token = cpp_get_token (pfile);
if (token->type == CPP_STRING)
@@ -925,10 +935,11 @@ do_linemarker (cpp_reader *pfile)
const struct line_map *map = &line_table->maps[line_table->used - 1];
const cpp_token *token;
const char *new_file = map->to_file;
- unsigned long new_lineno;
+ linenum_type new_lineno;
unsigned int new_sysp = map->sysp;
enum lc_reason reason = LC_RENAME;
int flag;
+ bool wrapped;
/* Back up so we can get the number again. Putting this in
_cpp_handle_directive risks two calls to _cpp_backup_tokens in
@@ -938,8 +949,8 @@ do_linemarker (cpp_reader *pfile)
/* #line commands expand macros. */
token = cpp_get_token (pfile);
if (token->type != CPP_NUMBER
- || strtoul_for_line (token->val.str.text, token->val.str.len,
- &new_lineno))
+ || strtolinenum (token->val.str.text, token->val.str.len,
+ &new_lineno, &wrapped))
{
/* Unlike #line, there does not seem to be a way to get an EOF
here. So, it should be safe to always spell the token. */
@@ -999,7 +1010,7 @@ do_linemarker (cpp_reader *pfile)
and zero otherwise. */
void
_cpp_do_file_change (cpp_reader *pfile, enum lc_reason reason,
- const char *to_file, unsigned int file_line,
+ const char *to_file, linenum_type file_line,
unsigned int sysp)
{
const struct line_map *map = linemap_add (pfile->line_table, reason, sysp,
diff --git a/libcpp/errors.c b/libcpp/errors.c
index 5e8e637276d..e3d56292848 100644
--- a/libcpp/errors.c
+++ b/libcpp/errors.c
@@ -42,7 +42,7 @@ print_location (cpp_reader *pfile, source_location line, unsigned int col)
else
{
const struct line_map *map;
- unsigned int lin;
+ linenum_type lin;
map = linemap_lookup (pfile->line_table, line);
linemap_print_containing_files (pfile->line_table, map);
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 3378315238f..81e888bc20f 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -34,6 +34,9 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
(e.g. a #line directive in C). */
enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME};
+/* The type of line numbers. */
+typedef unsigned int linenum_type;
+
/* A logical line/column number, i.e. an "index" into a line_map. */
/* Long-term, we want to use this to replace struct location_s (in input.h),
and effectively typedef source_location location_t. */
@@ -57,7 +60,7 @@ typedef void *(*line_map_realloc) (void *, size_t);
struct line_map GTY(())
{
const char *to_file;
- unsigned int to_line;
+ linenum_type to_line;
source_location start_location;
int included_from;
ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
@@ -119,7 +122,7 @@ extern void linemap_check_files_exited (struct line_maps *);
the highest_location). */
extern source_location linemap_line_start
-(struct line_maps *set, unsigned int to_line, unsigned int max_column_hint);
+(struct line_maps *set, linenum_type to_line, unsigned int max_column_hint);
/* Add a mapping of logical source line to physical source file and
line number.
@@ -134,7 +137,7 @@ extern source_location linemap_line_start
maps, so any stored line_map pointers should not be used. */
extern const struct line_map *linemap_add
(struct line_maps *, enum lc_reason, unsigned int sysp,
- const char *to_file, unsigned int to_line);
+ const char *to_file, linenum_type to_line);
/* Given a logical line, returns the map from which the corresponding
(source file, line) pair can be deduced. */
@@ -148,11 +151,11 @@ extern void linemap_print_containing_files (struct line_maps *,
const struct line_map *);
/* Converts a map and a source_location to source line. */
-#define SOURCE_LINE(MAP, LINE) \
- ((((LINE) - (MAP)->start_location) >> (MAP)->column_bits) + (MAP)->to_line)
+#define SOURCE_LINE(MAP, LOC) \
+ ((((LOC) - (MAP)->start_location) >> (MAP)->column_bits) + (MAP)->to_line)
-#define SOURCE_COLUMN(MAP, LINE) \
- (((LINE) - (MAP)->start_location) & ((1 << (MAP)->column_bits) - 1))
+#define SOURCE_COLUMN(MAP, LOC) \
+ (((LOC) - (MAP)->start_location) & ((1 << (MAP)->column_bits) - 1))
/* Returns the last source line within a map. This is the (last) line
of the #include, or other directive, that caused a map change. */
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 4fb4e431b81..c5bf35eab84 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -68,7 +68,7 @@ struct cset_converter
#define CPP_INCREMENT_LINE(PFILE, COLS_HINT) do { \
const struct line_maps *line_table = PFILE->line_table; \
const struct line_map *map = &line_table->maps[line_table->used-1]; \
- unsigned int line = SOURCE_LINE (map, line_table->highest_line); \
+ linenum_type line = SOURCE_LINE (map, line_table->highest_line); \
linemap_line_start (PFILE->line_table, line + 1, COLS_HINT); \
} while (0)
@@ -585,7 +585,7 @@ extern int _cpp_do__Pragma (cpp_reader *);
extern void _cpp_init_directives (cpp_reader *);
extern void _cpp_init_internal_pragmas (cpp_reader *);
extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *,
- unsigned int, unsigned int);
+ linenum_type, unsigned int);
extern void _cpp_pop_buffer (cpp_reader *);
/* In directives.c */
diff --git a/libcpp/lex.c b/libcpp/lex.c
index c1e009da06b..2eb66bd6342 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -384,7 +384,7 @@ static int
skip_line_comment (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
- unsigned int orig_line = pfile->line_table->highest_line;
+ source_location orig_line = pfile->line_table->highest_line;
while (*buffer->cur != '\n')
buffer->cur++;
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 2c6d2510e61..964a7cd9a77 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -85,7 +85,7 @@ linemap_free (struct line_maps *set)
const struct line_map *
linemap_add (struct line_maps *set, enum lc_reason reason,
- unsigned int sysp, const char *to_file, unsigned int to_line)
+ unsigned int sysp, const char *to_file, linenum_type to_line)
{
struct line_map *map;
source_location start_location = set->highest_location + 1;
@@ -182,13 +182,13 @@ linemap_add (struct line_maps *set, enum lc_reason reason,
}
source_location
-linemap_line_start (struct line_maps *set, unsigned int to_line,
+linemap_line_start (struct line_maps *set, linenum_type to_line,
unsigned int max_column_hint)
{
struct line_map *map = &set->maps[set->used - 1];
source_location highest = set->highest_location;
source_location r;
- unsigned int last_line = SOURCE_LINE (map, set->highest_line);
+ linenum_type last_line = SOURCE_LINE (map, set->highest_line);
int line_delta = to_line - last_line;
bool add_map = false;
if (line_delta < 0
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 1563d780d6f..9a470ef460b 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -118,7 +118,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
{
const struct line_map *map;
const uchar *result = NULL;
- unsigned int number = 1;
+ linenum_type number = 1;
switch (node->value.builtin)
{
@@ -200,11 +200,10 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
/* If __LINE__ is embedded in a macro, it must expand to the
line of the macro's invocation, not its definition.
Otherwise things like assert() will not work properly. */
- if (CPP_OPTION (pfile, traditional))
- number = pfile->line_table->highest_line;
- else
- number = pfile->cur_token[-1].src_loc;
- number = SOURCE_LINE (map, number);
+ number = SOURCE_LINE (map,
+ CPP_OPTION (pfile, traditional)
+ ? pfile->line_table->highest_line
+ : pfile->cur_token[-1].src_loc);
break;
/* __STDC__ has the value 1 under normal circumstances.
diff --git a/libcpp/traditional.c b/libcpp/traditional.c
index 1a384253a90..d23fffe72ca 100644
--- a/libcpp/traditional.c
+++ b/libcpp/traditional.c
@@ -60,7 +60,7 @@ struct fun_macro
size_t offset;
/* The line the macro name appeared on. */
- unsigned int line;
+ source_location line;
/* Zero-based index of argument being currently lexed. */
unsigned int argc;
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index c845606c803..2459b539096 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,55 @@
+2008-07-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/36852
+ * io/list_read.c: If variable rank is zero, do not adjust the found
+ namelist object pointer.
+
+2008-07-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/29835
+ * io/format.c (struct format_data): New member error_element.
+ (unexpected_element): Added '%c' to message.
+ (next_char): Keep track of last parsed character in fmt->error_element.
+ (format_error): If the message is unexpected_element, output the
+ offending character, too.
+
+2008-07-22 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/36890
+ * io/file_pos.c: Declare READ_CHUNK as signed to avoid
+ signed/unsigned comparison warning in formatted_backspace.
+
+2008-07-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/36773
+ * intrinsics/cshift0.c (cshift0): Return early if size of array
+ is zero.
+ * intrinsics/eoshift0.c (eoshift0): Return early if size of
+ return array is zero.
+ * intrinsics/eoshift2.c (eoshift2): Likewise.
+ * m4/eoshift1.m4 (eoshift1): Return early if size of array
+ is zero.
+ * m4/eoshift3.m4 (eoshift3): Likewise.
+ * m4/eoshift2.m4 (eoshift2): Return early if size of return
+ array is zero.
+ * m4/eoshift4.m4 (eoshift2): Return early if size of return
+ array is zero.
+ * generated/cshift1_16.c: Regenerated.
+ * generated/cshift1_4.c: Regenerated.
+ * generated/cshift1_8.c: Regenerated.
+ * generated/eoshift1_16.c: Regenerated.
+ * generated/eoshift1_4.c: Regenerated.
+ * generated/eoshift1_8.c: Regenerated.
+ * generated/eoshift3_16.c: Regenerated.
+ * generated/eoshift3_4.c: Regenerated.
+ * generated/eoshift3_8.c: Regenerated.
+
+2008-07-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/36857
+ * io/write_float.def: Comment out locale dependent code and fix general
+ comments.
+
2008-07-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36341
diff --git a/libgfortran/generated/cshift1_16.c b/libgfortran/generated/cshift1_16.c
index 2943c3ed86d..06e27468e85 100644
--- a/libgfortran/generated/cshift1_16.c
+++ b/libgfortran/generated/cshift1_16.c
@@ -67,6 +67,7 @@ cshift1 (gfc_array_char * const restrict ret,
index_type n;
int which;
GFC_INTEGER_16 sh;
+ index_type arraysize;
if (pwhich)
which = *pwhich - 1;
@@ -76,11 +77,13 @@ cshift1 (gfc_array_char * const restrict ret,
if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+ arraysize = size0 ((array_t *)array);
+
if (ret->data == NULL)
{
int i;
- ret->data = internal_malloc_size (size * size0 ((array_t *)array));
+ ret->data = internal_malloc_size (size * arraysize);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -95,6 +98,9 @@ cshift1 (gfc_array_char * const restrict ret,
}
}
+ if (arraysize == 0)
+ return;
+
extent[0] = 1;
count[0] = 0;
n = 0;
diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c
index 3f4f9e0bf25..3be3c3c15a6 100644
--- a/libgfortran/generated/cshift1_4.c
+++ b/libgfortran/generated/cshift1_4.c
@@ -67,6 +67,7 @@ cshift1 (gfc_array_char * const restrict ret,
index_type n;
int which;
GFC_INTEGER_4 sh;
+ index_type arraysize;
if (pwhich)
which = *pwhich - 1;
@@ -76,11 +77,13 @@ cshift1 (gfc_array_char * const restrict ret,
if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+ arraysize = size0 ((array_t *)array);
+
if (ret->data == NULL)
{
int i;
- ret->data = internal_malloc_size (size * size0 ((array_t *)array));
+ ret->data = internal_malloc_size (size * arraysize);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -95,6 +98,9 @@ cshift1 (gfc_array_char * const restrict ret,
}
}
+ if (arraysize == 0)
+ return;
+
extent[0] = 1;
count[0] = 0;
n = 0;
diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c
index 4d246e54d95..b444a691acc 100644
--- a/libgfortran/generated/cshift1_8.c
+++ b/libgfortran/generated/cshift1_8.c
@@ -67,6 +67,7 @@ cshift1 (gfc_array_char * const restrict ret,
index_type n;
int which;
GFC_INTEGER_8 sh;
+ index_type arraysize;
if (pwhich)
which = *pwhich - 1;
@@ -76,11 +77,13 @@ cshift1 (gfc_array_char * const restrict ret,
if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+ arraysize = size0 ((array_t *)array);
+
if (ret->data == NULL)
{
int i;
- ret->data = internal_malloc_size (size * size0 ((array_t *)array));
+ ret->data = internal_malloc_size (size * arraysize);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -95,6 +98,9 @@ cshift1 (gfc_array_char * const restrict ret,
}
}
+ if (arraysize == 0)
+ return;
+
extent[0] = 1;
count[0] = 0;
n = 0;
diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c
index 63b75bdbd6b..fd145c12e6e 100644
--- a/libgfortran/generated/eoshift1_16.c
+++ b/libgfortran/generated/eoshift1_16.c
@@ -102,6 +102,11 @@ eoshift1 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
n = 0;
for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c
index 58ce7e9f5dd..d78c40a1113 100644
--- a/libgfortran/generated/eoshift1_4.c
+++ b/libgfortran/generated/eoshift1_4.c
@@ -102,6 +102,11 @@ eoshift1 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
n = 0;
for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c
index 0e9c2f1442a..06d55323369 100644
--- a/libgfortran/generated/eoshift1_8.c
+++ b/libgfortran/generated/eoshift1_8.c
@@ -102,6 +102,11 @@ eoshift1 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
n = 0;
for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
diff --git a/libgfortran/generated/eoshift3_16.c b/libgfortran/generated/eoshift3_16.c
index 214f3783d4f..66a507773ac 100644
--- a/libgfortran/generated/eoshift3_16.c
+++ b/libgfortran/generated/eoshift3_16.c
@@ -103,6 +103,11 @@ eoshift3 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
extent[0] = 1;
diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c
index e96ef2504b0..3579cffd483 100644
--- a/libgfortran/generated/eoshift3_4.c
+++ b/libgfortran/generated/eoshift3_4.c
@@ -103,6 +103,11 @@ eoshift3 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
extent[0] = 1;
diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c
index dc39b94eb97..de969a0c92b 100644
--- a/libgfortran/generated/eoshift3_8.c
+++ b/libgfortran/generated/eoshift3_8.c
@@ -103,6 +103,11 @@ eoshift3 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
extent[0] = 1;
diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c
index 76ce97e0f10..ac26e86cf5f 100644
--- a/libgfortran/intrinsics/cshift0.c
+++ b/libgfortran/intrinsics/cshift0.c
@@ -97,10 +97,43 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
index_type len;
index_type n;
int whichloop;
+ index_type arraysize;
if (which < 1 || which > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
+ arraysize = size0 ((array_t *) array);
+
+ if (ret->data == NULL)
+ {
+ int i;
+
+ ret->offset = 0;
+ ret->dtype = array->dtype;
+ for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
+ {
+ ret->dim[i].lbound = 0;
+ ret->dim[i].ubound = array->dim[i].ubound - array->dim[i].lbound;
+
+ if (i == 0)
+ ret->dim[i].stride = 1;
+ else
+ ret->dim[i].stride = (ret->dim[i-1].ubound + 1)
+ * ret->dim[i-1].stride;
+ }
+
+ if (arraysize > 0)
+ ret->data = internal_malloc_size (size * arraysize);
+ else
+ {
+ ret->data = internal_malloc_size (1);
+ return;
+ }
+ }
+
+ if (arraysize == 0)
+ return;
+
which = which - 1;
sstride[0] = 0;
rstride[0] = 0;
@@ -142,34 +175,6 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
soffset = size;
len = 0;
- if (ret->data == NULL)
- {
- int i;
- index_type arraysize = size0 ((array_t *)array);
-
- ret->offset = 0;
- ret->dtype = array->dtype;
- for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
- {
- ret->dim[i].lbound = 0;
- ret->dim[i].ubound = array->dim[i].ubound - array->dim[i].lbound;
-
- if (i == 0)
- ret->dim[i].stride = 1;
- else
- ret->dim[i].stride = (ret->dim[i-1].ubound + 1)
- * ret->dim[i-1].stride;
- }
-
- if (arraysize > 0)
- ret->data = internal_malloc_size (size * arraysize);
- else
- {
- ret->data = internal_malloc_size (1);
- return;
- }
- }
-
for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
{
if (dim == which)
diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c
index ac7a0ba85b6..fd216b1084b 100644
--- a/libgfortran/intrinsics/eoshift0.c
+++ b/libgfortran/intrinsics/eoshift0.c
@@ -84,6 +84,11 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
which = which - 1;
diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c
index 239d9714a99..aa66a8dfe00 100644
--- a/libgfortran/intrinsics/eoshift2.c
+++ b/libgfortran/intrinsics/eoshift2.c
@@ -63,6 +63,7 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
index_type dim;
index_type len;
index_type n;
+ index_type arraysize;
/* The compiler cannot figure out that these are set, initialize
them to avoid warnings. */
@@ -70,11 +71,13 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
soffset = 0;
roffset = 0;
+ arraysize = size0 ((array_t *) array);
+
if (ret->data == NULL)
{
int i;
- ret->data = internal_malloc_size (size * size0 ((array_t *)array));
+ ret->data = internal_malloc_size (size * arraysize);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -88,6 +91,14 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
+
+ if (arraysize == 0 && filler == NULL)
+ return;
which = which - 1;
diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c
index f4864884f33..89c67365429 100644
--- a/libgfortran/io/file_pos.c
+++ b/libgfortran/io/file_pos.c
@@ -39,7 +39,7 @@ Boston, MA 02110-1301, USA. */
record, and we have to sift backwards to find the newline before
that or the start of the file, whichever comes first. */
-static const unsigned int READ_CHUNK = 4096;
+static const int READ_CHUNK = 4096;
static void
formatted_backspace (st_parameter_filepos *fpp, gfc_unit *u)
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index cf299c161a4..02ce2913bd2 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -50,6 +50,7 @@ typedef struct format_data
{
char *format_string, *string;
const char *error;
+ char error_element;
format_token saved_token;
int value, format_string_len, reversion_ok;
fnode *avail;
@@ -67,7 +68,7 @@ static const fnode colon_node = { FMT_COLON, 0, NULL, NULL, {{ 0, 0, 0 }}, 0,
static const char posint_required[] = "Positive width required in format",
period_required[] = "Period required in format",
nonneg_required[] = "Nonnegative width required in format",
- unexpected_element[] = "Unexpected element in format",
+ unexpected_element[] = "Unexpected element '%c' in format\n",
unexpected_end[] = "Unexpected end of format string",
bad_string[] = "Unterminated character constant in format",
bad_hollerith[] = "Hollerith constant extends past the end of the format",
@@ -89,7 +90,7 @@ next_char (format_data *fmt, int literal)
return -1;
fmt->format_string_len--;
- c = toupper (*fmt->format_string++);
+ fmt->error_element = c = toupper (*fmt->format_string++);
}
while ((c == ' ' || c == '\t') && !literal);
@@ -948,7 +949,10 @@ format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
if (f != NULL)
fmt->format_string = f->source;
- sprintf (buffer, "%s\n", message);
+ if (message == unexpected_element)
+ sprintf (buffer, message, fmt->error_element);
+ else
+ sprintf (buffer, "%s\n", message);
j = fmt->format_string - dtp->format;
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index ba8de9750e1..34e2ac0698a 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2791,7 +2791,7 @@ get_name:
if (nl->type == GFC_DTYPE_DERIVED)
nml_touch_nodes (nl);
- if (component_flag)
+ if (component_flag && nl->var_rank > 0)
nl = first_nl;
/* Make sure no extraneous qualifiers are there. */
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 090bd712eb4..ed4c45f6277 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -99,32 +99,13 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
if (d < 0)
internal_error (&dtp->common, "Unspecified precision");
- /* Use sprintf to print the number in the format +D.DDDDe+ddd
- For an N digit exponent, this gives us (MIN_FIELD_WIDTH-5)-N digits
- after the decimal point, plus another one before the decimal point. */
-
sign = calculate_sign (dtp, sign_bit);
-
- /* # The result will always contain a decimal point, even if no
- * digits follow it
- *
- * - The converted value is to be left adjusted on the field boundary
- *
- * + A sign (+ or -) always be placed before a number
- *
- * MIN_FIELD_WIDTH minimum field width
- *
- * * (ndigits-1) is used as the precision
- *
- * e format: [-]d.ddde±dd where there is one digit before the
- * decimal-point character and the number of digits after it is
- * equal to the precision. The exponent always contains at least two
- * digits; if the value is zero, the exponent is 00.
- */
-
- /* Check the given string has punctuation in the correct places. */
- if (d != 0 && (buffer[2] != '.' || buffer[ndigits + 2] != 'e'))
- internal_error (&dtp->common, "printf is broken");
+
+ /* The following code checks the given string has punctuation in the correct
+ places. Uncomment if needed for debugging.
+ if (d != 0 && ((buffer[2] != '.' && buffer[2] != ',')
+ || buffer[ndigits + 2] != 'e'))
+ internal_error (&dtp->common, "printf is broken"); */
/* Read the exponent back in. */
e = atoi (&buffer[ndigits + 3]) + 1;
@@ -702,8 +683,30 @@ OUTPUT_FLOAT_FMT_G(16)
#undef OUTPUT_FLOAT_FMT_G
+
/* Define a macro to build code for write_float. */
+ /* Note: Before output_float is called, sprintf is used to print to buffer the
+ number in the format +D.DDDDe+ddd. For an N digit exponent, this gives us
+ (MIN_FIELD_WIDTH-5)-N digits after the decimal point, plus another one
+ before the decimal point.
+
+ # The result will always contain a decimal point, even if no
+ digits follow it
+
+ - The converted value is to be left adjusted on the field boundary
+
+ + A sign (+ or -) always be placed before a number
+
+ MIN_FIELD_WIDTH minimum field width
+
+ * (ndigits-1) is used as the precision
+
+ e format: [-]d.ddde±dd where there is one digit before the
+ decimal-point character and the number of digits after it is
+ equal to the precision. The exponent always contains at least two
+ digits; if the value is zero, the exponent is 00. */
+
#ifdef HAVE_SNPRINTF
#define DTOA \
diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4
index 28fae596bd4..861debeed2c 100644
--- a/libgfortran/m4/cshift1.m4
+++ b/libgfortran/m4/cshift1.m4
@@ -68,6 +68,7 @@ cshift1 (gfc_array_char * const restrict ret,
index_type n;
int which;
'atype_name` sh;
+ index_type arraysize;
if (pwhich)
which = *pwhich - 1;
@@ -77,11 +78,13 @@ cshift1 (gfc_array_char * const restrict ret,
if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument ''`DIM''` is out of range in call to ''`CSHIFT''`");
+ arraysize = size0 ((array_t *)array);
+
if (ret->data == NULL)
{
int i;
- ret->data = internal_malloc_size (size * size0 ((array_t *)array));
+ ret->data = internal_malloc_size (size * arraysize);
ret->offset = 0;
ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -96,6 +99,9 @@ cshift1 (gfc_array_char * const restrict ret,
}
}
+ if (arraysize == 0)
+ return;
+
extent[0] = 1;
count[0] = 0;
n = 0;
diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4
index 8ce24eff0f5..01ca57ec68d 100644
--- a/libgfortran/m4/eoshift1.m4
+++ b/libgfortran/m4/eoshift1.m4
@@ -103,6 +103,11 @@ eoshift1 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
n = 0;
for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4
index 081ff927277..6a6929ca0c7 100644
--- a/libgfortran/m4/eoshift3.m4
+++ b/libgfortran/m4/eoshift3.m4
@@ -104,6 +104,11 @@ eoshift3 (gfc_array_char * const restrict ret,
ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride;
}
}
+ else
+ {
+ if (size0 ((array_t *) ret) == 0)
+ return;
+ }
extent[0] = 1;
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index b77e66df94c..bf52f9eb491 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * maint-tool (deps): Output config.h instead of stamp-h.
+ * Makefile.in: Rebuild deps.
+ (maintainer-clean-subdir): Depend on stamp-h rather than config.h.
+ Reverts 2007-07-11 change.
+
2008-06-19 Eric Blake <ebb9@byu.net>
Adjust strsignal to POSIX 200x prototype.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 40a1d47718b..e18aff75363 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -475,13 +475,13 @@ stamp-h: $(srcdir)/config.in config.status Makefile
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
-# Depending on stamp-h makes sure that config.status has been re-run
+# Depending on config.h makes sure that config.status has been re-run
# if needed. This prevents problems with parallel builds, in case
# subdirectories need to run config.status also.
all-subdir check-subdir installcheck-subdir info-subdir \
install-info-subdir clean-info-subdir dvi-subdir pdf-subdir install-subdir \
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
-maintainer-clean-subdir: stamp-h
+maintainer-clean-subdir: config.h
@subdirs='$(SUBDIRS)'; \
target=`echo $@ | sed -e 's/-subdir//'`; \
for dir in $$subdirs ; do \
@@ -498,40 +498,41 @@ $(CONFIGURED_OFILES): stamp-picdir
# The dependencies in the remainder of this file are automatically
# generated by "make maint-deps". Manual edits will be lost.
-./_doprnt.o: $(srcdir)/_doprnt.c stamp-h $(INCDIR)/ansidecl.h \
+./_doprnt.o: $(srcdir)/_doprnt.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/_doprnt.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/_doprnt.c $(OUTPUT_OPTION)
-./alloca.o: $(srcdir)/alloca.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./alloca.o: $(srcdir)/alloca.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/alloca.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION)
-./argv.o: $(srcdir)/argv.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./argv.o: $(srcdir)/argv.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION)
-./asprintf.o: $(srcdir)/asprintf.c stamp-h $(INCDIR)/ansidecl.h \
+./asprintf.o: $(srcdir)/asprintf.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/asprintf.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/asprintf.c $(OUTPUT_OPTION)
-./atexit.o: $(srcdir)/atexit.c stamp-h
+./atexit.o: $(srcdir)/atexit.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/atexit.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION)
-./basename.o: $(srcdir)/basename.c stamp-h $(INCDIR)/ansidecl.h \
+./basename.o: $(srcdir)/basename.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \
@@ -550,7 +551,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/bcopy.c $(OUTPUT_OPTION)
-./bsearch.o: $(srcdir)/bsearch.c stamp-h $(INCDIR)/ansidecl.h
+./bsearch.o: $(srcdir)/bsearch.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/bsearch.c -o pic/$@; \
else true; fi
@@ -568,20 +569,21 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/calloc.c $(OUTPUT_OPTION)
-./choose-temp.o: $(srcdir)/choose-temp.c stamp-h $(INCDIR)/ansidecl.h \
+./choose-temp.o: $(srcdir)/choose-temp.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/choose-temp.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/choose-temp.c $(OUTPUT_OPTION)
-./clock.o: $(srcdir)/clock.c stamp-h
+./clock.o: $(srcdir)/clock.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/clock.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/clock.c $(OUTPUT_OPTION)
-./concat.o: $(srcdir)/concat.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./concat.o: $(srcdir)/concat.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/concat.c -o pic/$@; \
else true; fi
@@ -593,7 +595,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/copysign.c $(OUTPUT_OPTION)
-./cp-demangle.o: $(srcdir)/cp-demangle.c stamp-h $(INCDIR)/ansidecl.h \
+./cp-demangle.o: $(srcdir)/cp-demangle.c config.h $(INCDIR)/ansidecl.h \
$(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \
$(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -601,7 +603,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/cp-demangle.c $(OUTPUT_OPTION)
-./cp-demint.o: $(srcdir)/cp-demint.c stamp-h $(INCDIR)/ansidecl.h \
+./cp-demint.o: $(srcdir)/cp-demint.c config.h $(INCDIR)/ansidecl.h \
$(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -609,7 +611,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/cp-demint.c $(OUTPUT_OPTION)
-./cplus-dem.o: $(srcdir)/cplus-dem.c stamp-h $(INCDIR)/ansidecl.h \
+./cplus-dem.o: $(srcdir)/cplus-dem.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -617,14 +619,14 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)
-./dyn-string.o: $(srcdir)/dyn-string.c stamp-h $(INCDIR)/ansidecl.h \
+./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/dyn-string.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION)
-./fdmatch.o: $(srcdir)/fdmatch.c stamp-h $(INCDIR)/ansidecl.h \
+./fdmatch.o: $(srcdir)/fdmatch.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; \
@@ -637,93 +639,94 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/ffs.c $(OUTPUT_OPTION)
-./fibheap.o: $(srcdir)/fibheap.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \
- $(INCDIR)/libiberty.h
+./fibheap.o: $(srcdir)/fibheap.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/fibheap.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fibheap.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
-./filename_cmp.o: $(srcdir)/filename_cmp.c stamp-h $(INCDIR)/filenames.h \
+./filename_cmp.o: $(srcdir)/filename_cmp.c config.h $(INCDIR)/filenames.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/filename_cmp.c $(OUTPUT_OPTION)
-./floatformat.o: $(srcdir)/floatformat.c stamp-h $(INCDIR)/ansidecl.h \
+./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/floatformat.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/floatformat.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/floatformat.c $(OUTPUT_OPTION)
-./fnmatch.o: $(srcdir)/fnmatch.c stamp-h $(INCDIR)/fnmatch.h \
+./fnmatch.o: $(srcdir)/fnmatch.c config.h $(INCDIR)/fnmatch.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fnmatch.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/fnmatch.c $(OUTPUT_OPTION)
-./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c stamp-h $(INCDIR)/ansidecl.h \
+./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fopen_unlocked.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/fopen_unlocked.c $(OUTPUT_OPTION)
-./getcwd.o: $(srcdir)/getcwd.c stamp-h
+./getcwd.o: $(srcdir)/getcwd.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getcwd.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getcwd.c $(OUTPUT_OPTION)
-./getopt.o: $(srcdir)/getopt.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h
+./getopt.o: $(srcdir)/getopt.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getopt.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getopt.c $(OUTPUT_OPTION)
-./getopt1.o: $(srcdir)/getopt1.c stamp-h $(INCDIR)/getopt.h
+./getopt1.o: $(srcdir)/getopt1.c config.h $(INCDIR)/getopt.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getopt1.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getopt1.c $(OUTPUT_OPTION)
-./getpagesize.o: $(srcdir)/getpagesize.c stamp-h
+./getpagesize.o: $(srcdir)/getpagesize.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getpagesize.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getpagesize.c $(OUTPUT_OPTION)
-./getpwd.o: $(srcdir)/getpwd.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./getpwd.o: $(srcdir)/getpwd.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getpwd.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getpwd.c $(OUTPUT_OPTION)
-./getruntime.o: $(srcdir)/getruntime.c stamp-h $(INCDIR)/ansidecl.h \
+./getruntime.o: $(srcdir)/getruntime.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getruntime.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getruntime.c $(OUTPUT_OPTION)
-./gettimeofday.o: $(srcdir)/gettimeofday.c stamp-h $(INCDIR)/ansidecl.h \
+./gettimeofday.o: $(srcdir)/gettimeofday.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/gettimeofday.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/gettimeofday.c $(OUTPUT_OPTION)
-./hashtab.o: $(srcdir)/hashtab.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
- $(INCDIR)/libiberty.h
+./hashtab.o: $(srcdir)/hashtab.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/hashtab.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/hashtab.c $(OUTPUT_OPTION)
-./hex.o: $(srcdir)/hex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./hex.o: $(srcdir)/hex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/hex.c -o pic/$@; \
@@ -742,7 +745,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/insque.c $(OUTPUT_OPTION)
-./lbasename.o: $(srcdir)/lbasename.c stamp-h $(INCDIR)/ansidecl.h \
+./lbasename.o: $(srcdir)/lbasename.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -750,28 +753,28 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/lbasename.c $(OUTPUT_OPTION)
-./lrealpath.o: $(srcdir)/lrealpath.c stamp-h $(INCDIR)/ansidecl.h \
+./lrealpath.o: $(srcdir)/lrealpath.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/lrealpath.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/lrealpath.c $(OUTPUT_OPTION)
-./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c stamp-h \
+./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c config.h \
$(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/make-relative-prefix.c $(OUTPUT_OPTION)
-./make-temp-file.o: $(srcdir)/make-temp-file.c stamp-h $(INCDIR)/ansidecl.h \
+./make-temp-file.o: $(srcdir)/make-temp-file.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/make-temp-file.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/make-temp-file.c $(OUTPUT_OPTION)
-./md5.o: $(srcdir)/md5.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
+./md5.o: $(srcdir)/md5.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/md5.c -o pic/$@; \
else true; fi
@@ -813,7 +816,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/memset.c $(OUTPUT_OPTION)
-./mkstemps.o: $(srcdir)/mkstemps.c stamp-h $(INCDIR)/ansidecl.h
+./mkstemps.o: $(srcdir)/mkstemps.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/mkstemps.c -o pic/$@; \
else true; fi
@@ -825,41 +828,41 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/msdos.c $(OUTPUT_OPTION)
-./objalloc.o: $(srcdir)/objalloc.c stamp-h $(INCDIR)/ansidecl.h \
+./objalloc.o: $(srcdir)/objalloc.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/objalloc.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/objalloc.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/objalloc.c $(OUTPUT_OPTION)
-./obstack.o: $(srcdir)/obstack.c stamp-h $(INCDIR)/obstack.h
+./obstack.o: $(srcdir)/obstack.c config.h $(INCDIR)/obstack.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/obstack.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/obstack.c $(OUTPUT_OPTION)
-./partition.o: $(srcdir)/partition.c stamp-h $(INCDIR)/ansidecl.h \
+./partition.o: $(srcdir)/partition.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(INCDIR)/partition.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/partition.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/partition.c $(OUTPUT_OPTION)
-./pex-common.o: $(srcdir)/pex-common.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-common.o: $(srcdir)/pex-common.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-common.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-common.c $(OUTPUT_OPTION)
-./pex-djgpp.o: $(srcdir)/pex-djgpp.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-djgpp.o: $(srcdir)/pex-djgpp.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-djgpp.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-djgpp.c $(OUTPUT_OPTION)
-./pex-msdos.o: $(srcdir)/pex-msdos.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-msdos.o: $(srcdir)/pex-msdos.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -867,42 +870,42 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/pex-msdos.c $(OUTPUT_OPTION)
-./pex-one.o: $(srcdir)/pex-one.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-one.o: $(srcdir)/pex-one.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-one.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION)
-./pex-unix.o: $(srcdir)/pex-unix.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-unix.o: $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-unix.c $(OUTPUT_OPTION)
-./pex-win32.o: $(srcdir)/pex-win32.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-win32.o: $(srcdir)/pex-win32.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-win32.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-win32.c $(OUTPUT_OPTION)
-./pexecute.o: $(srcdir)/pexecute.c stamp-h $(INCDIR)/ansidecl.h \
+./pexecute.o: $(srcdir)/pexecute.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pexecute.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pexecute.c $(OUTPUT_OPTION)
-./physmem.o: $(srcdir)/physmem.c stamp-h $(INCDIR)/ansidecl.h \
+./physmem.o: $(srcdir)/physmem.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/physmem.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/physmem.c $(OUTPUT_OPTION)
-./putenv.o: $(srcdir)/putenv.c stamp-h $(INCDIR)/ansidecl.h
+./putenv.o: $(srcdir)/putenv.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/putenv.c -o pic/$@; \
else true; fi
@@ -914,14 +917,14 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/random.c $(OUTPUT_OPTION)
-./regex.o: $(srcdir)/regex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \
+./regex.o: $(srcdir)/regex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \
$(INCDIR)/xregex2.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/regex.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/regex.c $(OUTPUT_OPTION)
-./rename.o: $(srcdir)/rename.c stamp-h $(INCDIR)/ansidecl.h
+./rename.o: $(srcdir)/rename.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/rename.c -o pic/$@; \
else true; fi
@@ -940,13 +943,13 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)
-./setenv.o: $(srcdir)/setenv.c stamp-h $(INCDIR)/ansidecl.h
+./setenv.o: $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/setenv.c $(OUTPUT_OPTION)
-./sha1.o: $(srcdir)/sha1.c stamp-h $(INCDIR)/sha1.h
+./sha1.o: $(srcdir)/sha1.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/sha1.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/sha1.c -o pic/$@; \
else true; fi
@@ -964,20 +967,21 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/snprintf.c $(OUTPUT_OPTION)
-./sort.o: $(srcdir)/sort.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./sort.o: $(srcdir)/sort.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/sort.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/sort.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/sort.c $(OUTPUT_OPTION)
-./spaces.o: $(srcdir)/spaces.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./spaces.o: $(srcdir)/spaces.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/spaces.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/spaces.c $(OUTPUT_OPTION)
-./splay-tree.o: $(srcdir)/splay-tree.c stamp-h $(INCDIR)/ansidecl.h \
+./splay-tree.o: $(srcdir)/splay-tree.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/splay-tree.c -o pic/$@; \
@@ -1014,7 +1018,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strdup.c $(OUTPUT_OPTION)
-./strerror.o: $(srcdir)/strerror.c stamp-h $(INCDIR)/ansidecl.h \
+./strerror.o: $(srcdir)/strerror.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strerror.c -o pic/$@; \
@@ -1045,7 +1049,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strrchr.c $(OUTPUT_OPTION)
-./strsignal.o: $(srcdir)/strsignal.c stamp-h $(INCDIR)/ansidecl.h \
+./strsignal.o: $(srcdir)/strsignal.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strsignal.c -o pic/$@; \
@@ -1064,13 +1068,13 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strtod.c $(OUTPUT_OPTION)
-./strtol.o: $(srcdir)/strtol.c stamp-h $(INCDIR)/safe-ctype.h
+./strtol.o: $(srcdir)/strtol.c config.h $(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strtol.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/strtol.c $(OUTPUT_OPTION)
-./strtoul.o: $(srcdir)/strtoul.c stamp-h $(INCDIR)/ansidecl.h \
+./strtoul.o: $(srcdir)/strtoul.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strtoul.c -o pic/$@; \
@@ -1090,14 +1094,14 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/tmpnam.c $(OUTPUT_OPTION)
-./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c stamp-h \
+./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c config.h \
$(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/unlink-if-ordinary.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/unlink-if-ordinary.c $(OUTPUT_OPTION)
-./vasprintf.o: $(srcdir)/vasprintf.c stamp-h $(INCDIR)/ansidecl.h \
+./vasprintf.o: $(srcdir)/vasprintf.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/vasprintf.c -o pic/$@; \
@@ -1122,7 +1126,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/vprintf.c $(OUTPUT_OPTION)
-./vsnprintf.o: $(srcdir)/vsnprintf.c stamp-h $(INCDIR)/ansidecl.h \
+./vsnprintf.o: $(srcdir)/vsnprintf.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/vsnprintf.c -o pic/$@; \
@@ -1135,54 +1139,54 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/vsprintf.c $(OUTPUT_OPTION)
-./waitpid.o: $(srcdir)/waitpid.c stamp-h $(INCDIR)/ansidecl.h
+./waitpid.o: $(srcdir)/waitpid.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/waitpid.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/waitpid.c $(OUTPUT_OPTION)
-./xatexit.o: $(srcdir)/xatexit.c stamp-h $(INCDIR)/ansidecl.h \
+./xatexit.o: $(srcdir)/xatexit.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xatexit.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xatexit.c $(OUTPUT_OPTION)
-./xexit.o: $(srcdir)/xexit.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./xexit.o: $(srcdir)/xexit.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xexit.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION)
-./xmalloc.o: $(srcdir)/xmalloc.c stamp-h $(INCDIR)/ansidecl.h \
+./xmalloc.o: $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xmalloc.c $(OUTPUT_OPTION)
-./xmemdup.o: $(srcdir)/xmemdup.c stamp-h $(INCDIR)/ansidecl.h \
+./xmemdup.o: $(srcdir)/xmemdup.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xmemdup.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xmemdup.c $(OUTPUT_OPTION)
-./xstrdup.o: $(srcdir)/xstrdup.c stamp-h $(INCDIR)/ansidecl.h \
+./xstrdup.o: $(srcdir)/xstrdup.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xstrdup.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xstrdup.c $(OUTPUT_OPTION)
-./xstrerror.o: $(srcdir)/xstrerror.c stamp-h $(INCDIR)/ansidecl.h \
+./xstrerror.o: $(srcdir)/xstrerror.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xstrerror.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION)
-./xstrndup.o: $(srcdir)/xstrndup.c stamp-h $(INCDIR)/ansidecl.h \
+./xstrndup.o: $(srcdir)/xstrndup.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xstrndup.c -o pic/$@; \
diff --git a/libiberty/maint-tool b/libiberty/maint-tool
index a460b5570e5..e6e87070d37 100644
--- a/libiberty/maint-tool
+++ b/libiberty/maint-tool
@@ -226,6 +226,7 @@ sub deps {
$mine{$f} = "\$(INCDIR)/$f";
$deps{$f} = join(' ', &deps_for("$incdir/$f"));
}
+ $mine{'config.h'} = "config.h";
opendir(INC, $srcdir);
while ($f = readdir INC) {
@@ -233,8 +234,7 @@ sub deps {
$mine{$f} = "\$(srcdir)/$f";
$deps{$f} = join(' ', &deps_for("$srcdir/$f"));
}
-
- $mine{'config.h'} = "stamp-h";
+ $mine{'config.h'} = "config.h";
open(IN, "$srcdir/Makefile.in");
open(OUT, ">$srcdir/Makefile.tmp");
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 26529750fad..ab9183c4115 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,135 @@
+2008-07-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/36924
+ Revert:
+ 2008-07-23 Chris Fairles <chris.fairles@gmail.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Define GLIBCXX_LIBS.
+ Holds the lib that defines clock_gettime (-lrt or -lposix4).
+ * src/Makefile.am: Use it.
+ * configure: Regenerate.
+ * configure.in: Likewise.
+ * Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * libsup++/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * doc/Makefile.in: Likewise.
+
+2008-07-23 Chris Fairles <chris.fairles@gmail.com>
+
+ * include/std/condition_variable: Update to N2691 WD.
+ * include/std/mutex: Likewise.
+ * testsuite/30_threads/mutex/cons/assign_neg.cc: Adjust line numbers.
+ * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise.
+ * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise.
+ * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise.
+
+2008-07-23 Chris Fairles <chris.fairles@gmail.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Define GLIBCXX_LIBS.
+ Holds the lib that defines clock_gettime (-lrt or -lposix4).
+ * src/Makefile.am: Use it.
+ * configure: Regenerate.
+ * configure.in: Likewise.
+ * Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * libsup++/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * doc/Makefile.in: Likewise.
+
+2008-07-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/ext/sso_string_base.h
+ (__sso_string_base<>::__sso_string_base(std::initializer_list<_CharT>,
+ const _Alloc&)): Remove.
+ * include/ext/rc_string_base.h
+ (__rc_string_base<>::__rc_string_base(std::initializer_list<_CharT>,
+ const _Alloc&)): Likewise.
+ * include/ext/vstring.h
+ (__versa_string<>::__versa_string(std::initializer_list<_CharT>,
+ const _Alloc&)): Adjust.
+
+2008-07-21 Jason Merrill <jason@redhat.com>
+
+ Add initializer_list support as per N2679.
+ * include/debug/unordered_map: Add initializer_list support.
+ * include/debug/safe_association.h: Likewise.
+ * include/debug/unordered_set: Likewise.
+ * include/debug/vector: Likewise.
+ * include/debug/deque: Likewise.
+ * include/debug/map.h: Likewise.
+ * include/debug/set.h: Likewise.
+ * include/debug/string: Likewise.
+ * include/debug/list: Likewise.
+ * include/debug/multimap.h: Likewise.
+ * include/tr1_impl/unordered_map: Likewise.
+ * include/tr1_impl/hashtable: Likewise.
+ * include/tr1_impl/unordered_set: Likewise.
+ * include/tr1_impl/regex: Likewise.
+ * include/std/valarray: Likewise.
+ * include/std/unordered_map: Likewise.
+ * include/std/unordered_set: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/basic_string.h: Likewise.
+ * include/bits/basic_string.tcc: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_bvector.h: Likewise.
+ * include/ext/vstring.h: Likewise.
+ * include/ext/rc_string_base.h: Likewise.
+ * include/ext/sso_string_base.h: Likewise.
+ * src/Makefile.am (w?string-inst): Build with -std=gnu++0x.
+ * src/Makefile.in: Likewise.
+ * config/abi/pre/gnu.ver: Add new w?string exports.
+ * testsuite/21_strings/basic_string/init-list.cc: New test.
+ * testsuite/23_containers/vector/init-list.cc: New test.
+ * testsuite/23_containers/deque/init-list.cc: New test.
+ * testsuite/23_containers/list/init-list.cc: New test.
+ * testsuite/23_containers/map/init-list.cc: New test.
+ * testsuite/23_containers/multimap/init-list.cc: New test.
+ * testsuite/23_containers/set/init-list.cc: New test.
+ * testsuite/23_containers/multiset/init-list.cc: New test.
+ * testsuite/23_containers/unordered_map/init-list.cc: New test.
+ * testsuite/23_containers/unordered_multimap/init-list.cc: New test.
+ * testsuite/23_containers/unordered_set/init-list.cc: New test.
+ * testsuite/23_containers/unordered_multiset/init-list.cc: New test.
+ * testsuite/26_numerics/valarray/init-list.cc: New test.
+ * testsuite/28_regex/init-list.cc: New test.
+ * testsuite/ext/vstring/init-list.cc: New test.
+ * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_1_neg.cc: Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_2_neg.cc: Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
+ Update error lineno.
+
+2008-07-21 Mark Mitchell <mark@codesourcery.com>
+
+ * config/os/gnu-linux/arm-eabi-extra.ver: New file.
+ * configure.host: Use it for arm*-*-linux-*eabi.
+
2008-07-19 Paolo Carlini <paolo.carlini@oracle.com>
* include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index ced293a0dd1..7b31a1cfa47 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -147,9 +147,12 @@ GLIBCXX_3.4 {
# Names not in an 'extern' block are mangled names.
# std::string
- _ZNSsC*;
+ _ZNSsC[12][EI][PRjmvN]*;
_ZNSsD*;
- _ZNSs[0-9][a-z]*;
+ _ZNSs[0-58-9][a-z]*;
+ _ZNSs[67][a-z]*E[PRcjmv]*;
+ _ZNSs7[a-z]*EES2_[NPRjm]*;
+ _ZNSs7[a-z]*EES2_S[12]*;
_ZNSs12_Alloc_hiderC*;
_ZNSs12_M_leak_hardEv;
_ZNSs12_S_constructE[jm]cRKSaIcE;
@@ -172,9 +175,9 @@ GLIBCXX_3.4 {
_ZNSs4_Rep20_S_empty_rep_storageE;
_ZNSs4_Rep11_S_max_sizeE;
_ZNSs4_Rep11_S_terminalE;
- _ZNSsaSE*;
+ _ZNSsaSE[PRc]*;
_ZNSsixE*;
- _ZNSspLE*;
+ _ZNSspLE[PRc]*;
_ZNKSs[0-9][a-z]*;
_ZNKSs[0-9][0-9][a-z]*;
_ZNKSs[a-z]*;
@@ -189,9 +192,12 @@ GLIBCXX_3.4 {
_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_E*;
# std::wstring
- _ZNSbIwSt11char_traitsIwESaIwEEC*;
+ _ZNSbIwSt11char_traitsIwESaIwEEC[12][EI][PRjmvN]*;
_ZNSbIwSt11char_traitsIwESaIwEED*;
- _ZNSbIwSt11char_traitsIwESaIwEE[0-9][a-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][a-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[67][a-z]*E[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_[NPRjm]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_S[56]*;
_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC*;
_ZNSbIwSt11char_traitsIwESaIwEE12_M_leak_hardEv;
_ZNSbIwSt11char_traitsIwESaIwEE12_S_constructE[jm]wRKS1_;
@@ -214,9 +220,9 @@ GLIBCXX_3.4 {
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep11_S_max_sizeE;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep11_S_terminalE;
- _ZNSbIwSt11char_traitsIwESaIwEEaSE*;
+ _ZNSbIwSt11char_traitsIwESaIwEEaSE[PRw]*;
_ZNSbIwSt11char_traitsIwESaIwEEixE*;
- _ZNSbIwSt11char_traitsIwESaIwEEpLE*;
+ _ZNSbIwSt11char_traitsIwESaIwEEpLE[PRw]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-9][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[a-z]*;
@@ -889,6 +895,24 @@ GLIBCXX_3.4.11 {
_ZNSt6chrono12system_clock12is_monotonicE;
_ZNSt6chrono12system_clock3nowEv;
+ # string/wstring initializer_list overloads
+ _ZNSs6appendESt16initializer_listIcE;
+ _ZNSs6assignESt16initializer_listIcE;
+ _ZNSs6insertEN9__gnu_cxx17__normal_iteratorIPcSsEESt16initializer_listIcE;
+ _ZNSs7replaceEN9__gnu_cxx17__normal_iteratorIPcSsEES2_St16initializer_listIcE;
+ _ZNSsC1ESt16initializer_listIcERKSaIcE;
+ _ZNSsC2ESt16initializer_listIcERKSaIcE;
+ _ZNSsaSESt16initializer_listIcE;
+ _ZNSspLESt16initializer_listIcE;
+ _ZNSbIwSt11char_traitsIwESaIwEE6appendESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEE6assignESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEE6insertEN9__gnu_cxx17__normal_iteratorIPwS2_EESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEE7replaceEN9__gnu_cxx17__normal_iteratorIPwS2_EES6_St16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEEC1ESt16initializer_listIwERKS1_;
+ _ZNSbIwSt11char_traitsIwESaIwEEC2ESt16initializer_listIwERKS1_;
+ _ZNSbIwSt11char_traitsIwESaIwEEaSESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEEpLESt16initializer_listIwE;
+
} GLIBCXX_3.4.10;
# Symbols in the support library (libsupc++) have their own tag.
diff --git a/libstdc++-v3/config/os/gnu-linux/arm-eabi-extra.ver b/libstdc++-v3/config/os/gnu-linux/arm-eabi-extra.ver
new file mode 100644
index 00000000000..5c7dc19e6e0
--- /dev/null
+++ b/libstdc++-v3/config/os/gnu-linux/arm-eabi-extra.ver
@@ -0,0 +1,18 @@
+# Appended to version file.
+
+CXXABI_ARM_1.3.3 {
+ # ARM ABI helper functions provided in libsupc++.
+ __aeabi_atexit;
+ __aeabi_vec_ctor_nocookie_nodtor;
+ __aeabi_vec_ctor_cookie_nodtor;
+ __aeabi_vec_cctor_nocookie_nodtor;
+ __aeabi_vec_new_cookie_noctor;
+ __aeabi_vec_new_nocookie;
+ __aeabi_vec_new_cookie_nodtor;
+ __aeabi_vec_new_cookie;
+ __aeabi_vec_dtor;
+ __aeabi_vec_dtor_cookie;
+ __aeabi_vec_delete;
+ __aeabi_vec_delete3;
+ __aeabi_vec_delete3_nodtor;
+};
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index f2c75db7195..e368a99926d 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -308,6 +308,11 @@ case "${host}" in
abi_baseline_pair=${try_cpu}-linux-gnu
fi
esac
+ case "${host}" in
+ arm*-*-linux-*eabi)
+ port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
+ ;;
+ esac
;;
powerpc*-*-darwin*)
port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 19c79d11cf7..de4cf80234d 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -45,6 +45,7 @@
#include <ext/atomicity.h>
#include <debug/debug.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -477,6 +478,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Construct string from an initializer list.
+ * @param l std::initializer_list of characters.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Construct string as copy of a range.
* @param beg Start of range.
@@ -523,6 +533,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param l std::initializer_list.
+ */
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
// Iterators:
/**
* Returns a read/write iterator that points to the first character in
@@ -794,6 +817,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a string to this string.
* @param str The string to append.
@@ -849,6 +883,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
basic_string&
append(size_type __n, _CharT __c);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a range of characters.
* @param first Iterator referencing the first character to append.
@@ -957,6 +1002,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert multiple characters.
* @param p Iterator referencing location in string to insert at.
@@ -989,6 +1045,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert value of a string.
* @param pos1 Iterator referencing location in string to insert at.
@@ -1434,6 +1502,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__k1.base(), __k2 - __k1);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
private:
template<class _Integer>
basic_string&
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 49b649446d3..3201e361830 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -235,6 +235,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
: _M_dataplus(_S_construct(__beg, __end, __a), __a)
{ }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__l.begin(), __l.end(), __a), __a)
+ { }
+#endif
+
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 045f20378a6..ad0ed87a115 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -62,6 +62,8 @@
#ifndef _STL_BVECTOR_H
#define _STL_BVECTOR_H 1
+#include <initializer_list>
+
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
typedef unsigned long _Bit_type;
@@ -529,6 +531,14 @@ template<typename _Alloc>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
vector(vector&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ vector(initializer_list<bool> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize_range(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
template<typename _InputIterator>
@@ -566,6 +576,13 @@ template<typename _Alloc>
this->swap(__x);
return *this;
}
+
+ vector&
+ operator=(initializer_list<bool> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
#endif
// assign(), a generalized assignment member function. Two
@@ -584,6 +601,12 @@ template<typename _Alloc>
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<bool> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
iterator
begin()
{ return this->_M_impl._M_start; }
@@ -777,6 +800,11 @@ template<typename _Alloc>
insert(iterator __position, size_type __n, const bool& __x)
{ _M_fill_insert(__position, __n, __x); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void insert(iterator __p, initializer_list<bool> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
void
pop_back()
{ --this->_M_impl._M_finish; }
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index b778f15a075..070fc078909 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -65,6 +65,7 @@
#include <bits/concept_check.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
@@ -740,6 +741,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
deque(deque&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %deque from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator object.
+ *
+ * Create a %deque consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is l.size()) and do no memory reallocation.
+ */
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
/**
@@ -801,6 +821,24 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
@@ -837,6 +875,23 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
@@ -1253,6 +1308,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
iterator
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer list into the %deque.
+ * @param p An iterator into the %deque.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %deque before the location
+ * specified by @a p. This is known as "list insert."
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
#endif
/**
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 08fb89ef117..b38fa55cf79 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -63,6 +63,7 @@
#define _STL_LIST_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
@@ -541,6 +542,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
list(list&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %list from an initializer_list
+ * @param l An initializer_list of value_type.
+ * @param a An allocator object.
+ *
+ * Create a %list consisting of copies of the elements in the
+ * initializer_list @a l. This is linear in l.size().
+ */
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
#endif
/**
@@ -597,6 +611,20 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %List initializer list assignment operator.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
@@ -634,6 +662,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer_list to a %list.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
@@ -951,6 +992,23 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
iterator
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts the contents of an initializer_list into %list
+ * before specified iterator.
+ * @param p An iterator into the %list.
+ * @param l An initializer_list of value_type.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %list before the location
+ * specified by @a p.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
#endif
/**
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index cd85b9ab75d..b402b8292c5 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -186,6 +186,23 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
map(map&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %map from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ *
+ * Create a %map consisting of copies of the elements in the
+ * initializer_list @a l.
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__c, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
/**
@@ -259,6 +276,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Map list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %map with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %map and
+ * that the resulting %map's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/// Get a copy of the memory allocation object.
@@ -476,7 +512,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* inserted.
*
* Complexity similar to that of the range constructor.
- *
*/
void
insert(std::initializer_list<value_type> __list)
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index ade2750170f..0834c95cfd6 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -63,6 +63,7 @@
#define _STL_MULTIMAP_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
@@ -183,6 +184,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
multimap(multimap&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multimap from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * the initializer_list. This is linear in N if the list is already
+ * sorted, and NlogN otherwise (where N is @a __l.size()).
+ */
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
/**
@@ -256,6 +273,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Multimap list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multimap with copies of the elements
+ * in the initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multimap and
+ * that the resulting %multimap's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/// Get a copy of the memory allocation object.
@@ -444,6 +480,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of std::pairs into the %multimap.
+ * @param list A std::initializer_list<value_type> of pairs to be
+ * inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
/**
* @brief Erases an element from a %multimap.
* @param position An iterator pointing to the element to be erased.
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 2cdbdfe4cf3..2fea83f847c 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -63,6 +63,7 @@
#define _STL_MULTISET_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
@@ -196,6 +197,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
multiset(multiset&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multiset from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * the list. This is linear in N if the list is already sorted,
+ * and NlogN otherwise (where N is @a l.size()).
+ */
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
/**
@@ -228,6 +245,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Multiset list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multiset with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multiset and
+ * that the resulting %multiset's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
// accessors:
@@ -406,6 +442,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %multiset.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
/**
* @brief Erases an element from a %multiset.
* @param position An iterator pointing to the element to be erased.
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index 2ef51de858f..98c74e9a27c 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -63,6 +63,7 @@
#define _STL_SET_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
@@ -203,6 +204,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
set(set&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %set from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %set consisting of copies of the elements in the list.
+ * This is linear in N if the list is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
/**
@@ -235,6 +252,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Set list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %set with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %set and
+ * that the resulting %set's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
// accessors:
@@ -418,6 +454,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_unique(__first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %set.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
/**
* @brief Erases an element from a %set.
* @param position An iterator pointing to the element to be erased.
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index aa874089d52..9ccd9b8ca23 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -65,6 +65,7 @@
#include <bits/stl_iterator_base_funcs.h>
#include <bits/functexcept.h>
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
@@ -262,6 +263,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
vector(vector&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %vector from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator.
+ *
+ * Create a %vector consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is @a l.size()) and do no memory reallocation.
+ */
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
/**
@@ -327,6 +347,24 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Vector list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
@@ -364,6 +402,23 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %vector.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
/// Get a copy of the memory allocation object.
using _Base::get_allocator;
@@ -766,6 +821,23 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
iterator
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer_list into the %vector.
+ * @param position An iterator into the %vector.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %vector before the location
+ * specified by @a position.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
#endif
/**
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index c37381f084f..845e0dcaaf2 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -94,6 +94,10 @@ namespace __debug
deque(deque&& __x)
: _Base(std::forward<deque>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
#endif
~deque() { }
@@ -115,6 +119,14 @@ namespace __debug
swap(__x);
return *this;
}
+
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
#endif
template<class _InputIterator>
@@ -133,6 +145,15 @@ namespace __debug
this->_M_invalidate_all();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
@@ -318,6 +339,13 @@ namespace __debug
iterator
insert(iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
#endif
void
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index 7ab0bddff99..312aeebef92 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -123,6 +123,10 @@ namespace __debug
list(list&& __x)
: _Base(std::forward<list>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
#endif
~list() { }
@@ -144,6 +148,21 @@ namespace __debug
swap(__x);
return *this;
}
+
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
#endif
template<class _InputIterator>
@@ -331,6 +350,13 @@ namespace __debug
iterator
insert(iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p, __l);
+ }
#endif
void
diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h
index 16575644da2..8232c742a63 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -98,6 +98,11 @@ namespace __debug
map(map&& __x)
: _Base(std::forward<map>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
#endif
~map() { }
@@ -119,6 +124,14 @@ namespace __debug
swap(__x);
return *this;
}
+
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -198,6 +211,12 @@ namespace __debug
__res.second);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
iterator
insert(iterator __position, const value_type& __x)
{
diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h
index 72f4411685b..b7c5ee7181c 100644
--- a/libstdc++-v3/include/debug/multimap.h
+++ b/libstdc++-v3/include/debug/multimap.h
@@ -99,6 +99,11 @@ namespace __debug
multimap(multimap&& __x)
: _Base(std::forward<multimap>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
#endif
~multimap() { }
@@ -120,6 +125,14 @@ namespace __debug
swap(__x);
return *this;
}
+
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
using _Base::get_allocator;
@@ -185,6 +198,12 @@ namespace __debug
insert(const value_type& __x)
{ return iterator(_Base::insert(__x), this); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
iterator
insert(iterator __position, const value_type& __x)
{
diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h
index ffe5b51548f..f108531638e 100644
--- a/libstdc++-v3/include/debug/multiset.h
+++ b/libstdc++-v3/include/debug/multiset.h
@@ -96,6 +96,11 @@ namespace __debug
multiset(multiset&& __x)
: _Base(std::forward<multiset>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
#endif
~multiset() { }
@@ -117,6 +122,14 @@ namespace __debug
swap(__x);
return *this;
}
+
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
using _Base::get_allocator;
@@ -197,6 +210,12 @@ namespace __debug
_Base::insert(__first, __last);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
void
erase(iterator __position)
{
diff --git a/libstdc++-v3/include/debug/safe_association.h b/libstdc++-v3/include/debug/safe_association.h
index 42c050050b8..a413b01f872 100644
--- a/libstdc++-v3/include/debug/safe_association.h
+++ b/libstdc++-v3/include/debug/safe_association.h
@@ -105,6 +105,14 @@ namespace __gnu_debug
__l, __n, __hf, __eql, __a)
{ }
+ _Safe_association(std::initializer_list<value_type> __l,
+ size_type __n,
+ const hasher& __hf,
+ const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a)
+ { }
+
_Safe_association(const _Base& __x) : _Base(__x) { }
_Safe_association(_Safe_association&& __x)
@@ -152,6 +160,10 @@ namespace __gnu_debug
_Base::insert(__first.base(), __last.base());
}
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
const_iterator
find(const key_type& __key) const
{ return const_iterator(_Base::find(__key), this); }
diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h
index 3115610d1e1..00711cd321d 100644
--- a/libstdc++-v3/include/debug/set.h
+++ b/libstdc++-v3/include/debug/set.h
@@ -96,6 +96,11 @@ namespace __debug
set(set&& __x)
: _Base(std::forward<set>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
#endif
~set() { }
@@ -117,6 +122,14 @@ namespace __debug
swap(__x);
return *this;
}
+
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
using _Base::get_allocator;
@@ -202,6 +215,12 @@ namespace __debug
_Base::insert(__first, __last);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
void
erase(iterator __position)
{
diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string
index 070ca1fe58b..68882fed581 100644
--- a/libstdc++-v3/include/debug/string
+++ b/libstdc++-v3/include/debug/string
@@ -115,6 +115,12 @@ namespace __gnu_debug
: _Base(__gnu_debug::__check_valid_range(__begin, __end), __end, __a)
{ }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+ : _Base(__l, __a)
+ { }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
~basic_string() { }
basic_string&
@@ -142,6 +148,16 @@ namespace __gnu_debug
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
// 21.3.2 iterators:
iterator
begin()
@@ -259,6 +275,16 @@ namespace __gnu_debug
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ {
+ _M_base() += __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
append(const basic_string& __str)
{
@@ -372,6 +398,16 @@ namespace __gnu_debug
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
insert(size_type __pos1, const basic_string& __str)
{
@@ -441,6 +477,15 @@ namespace __gnu_debug
this->_M_invalidate_all();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
erase(size_type __pos = 0, size_type __n = _Base::npos)
{
@@ -564,6 +609,17 @@ namespace __gnu_debug
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
size_type
copy(_CharT* __s, size_type __n, size_type __pos = 0) const
{
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index 590d4a3478f..79590f56755 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -40,6 +40,7 @@
#else
# include <c++0x_warning.h>
#endif
+#include <initializer_list>
#include <debug/safe_association.h>
#include <debug/safe_iterator.h>
@@ -64,6 +65,7 @@ namespace __debug
public:
typedef typename _Safe_assoc::size_type size_type;
+ typedef typename _Safe_assoc::value_type value_type;
typedef typename _Safe_assoc::hasher hasher;
typedef typename _Safe_assoc::key_equal key_equal;
typedef typename _Safe_assoc::allocator_type allocator_type;
@@ -91,6 +93,13 @@ namespace __debug
unordered_map(unordered_map&& __x)
: _Safe_assoc(std::forward<_Safe_assoc>(__x)), _Safe_base() { }
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Safe_assoc(__l, __n, __hf, __eql, __a) { }
+
unordered_map&
operator=(unordered_map&& __x)
{
@@ -100,6 +109,14 @@ namespace __debug
return *this;
}
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_map&& __x)
{
@@ -164,6 +181,7 @@ namespace __debug
public:
typedef typename _Safe_assoc::size_type size_type;
+ typedef typename _Safe_assoc::value_type value_type;
typedef typename _Safe_assoc::hasher hasher;
typedef typename _Safe_assoc::key_equal key_equal;
typedef typename _Safe_assoc::allocator_type allocator_type;
@@ -185,6 +203,13 @@ namespace __debug
: _Safe_assoc(__f, __l, __n, __hf, __eql, __a)
{ }
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Safe_assoc(__l, __n, __hf, __eql, __a) { }
+
unordered_multimap(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { }
@@ -200,6 +225,14 @@ namespace __debug
return *this;
}
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_multimap&& __x)
{
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index b4b9be8a140..4c5d4d5ce34 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -41,6 +41,7 @@
# include <c++0x_warning.h>
#endif
+#include <initializer_list>
#include <debug/safe_association.h>
#include <debug/safe_iterator.h>
@@ -65,6 +66,7 @@ namespace __debug
public:
typedef typename _Safe_assoc::size_type size_type;
+ typedef typename _Safe_assoc::value_type value_type;
typedef typename _Safe_assoc::hasher hasher;
typedef typename _Safe_assoc::key_equal key_equal;
typedef typename _Safe_assoc::allocator_type allocator_type;
@@ -86,6 +88,13 @@ namespace __debug
: _Safe_assoc(__f, __l, __n, __hf, __eql, __a)
{ }
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Safe_assoc(__l, __n, __hf, __eql, __a) { }
+
unordered_set(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { }
@@ -101,6 +110,14 @@ namespace __debug
return *this;
}
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_set&& __x)
{
@@ -162,6 +179,7 @@ namespace __debug
public:
typedef typename _Safe_assoc::size_type size_type;
+ typedef typename _Safe_assoc::value_type value_type;
typedef typename _Safe_assoc::hasher hasher;
typedef typename _Safe_assoc::key_equal key_equal;
typedef typename _Safe_assoc::allocator_type allocator_type;
@@ -183,6 +201,13 @@ namespace __debug
: _Safe_assoc(__f, __l, __n, __hf, __eql, __a)
{ }
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Safe_assoc(__l, __n, __hf, __eql, __a) { }
+
unordered_multiset(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { }
@@ -198,6 +223,14 @@ namespace __debug
return *this;
}
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_multiset&& __x)
{
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index f0c63a6ad76..a00419200d0 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -106,6 +106,11 @@ namespace __debug
this->_M_swap(__x);
__x._M_guaranteed_capacity = 0;
}
+
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base(),
+ _M_guaranteed_capacity(__l.size()) { }
#endif
~vector() { }
@@ -128,6 +133,15 @@ namespace __debug
swap(__x);
return *this;
}
+
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
#endif
template<typename _InputIterator>
@@ -148,6 +162,16 @@ namespace __debug
_M_update_guaranteed_capacity();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
@@ -367,6 +391,10 @@ namespace __debug
iterator>::__type
insert(iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
#endif
void
diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h
index 0d3224cea10..213e3cf1c97 100644
--- a/libstdc++-v3/include/ext/rc_string_base.h
+++ b/libstdc++-v3/include/ext/rc_string_base.h
@@ -308,7 +308,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#ifdef __GXX_EXPERIMENTAL_CXX0X__
__rc_string_base(__rc_string_base&& __rcs)
: _M_dataplus(__rcs._M_get_allocator(), __rcs._M_data())
- { __rcs._M_data(_S_empty_rep._M_refcopy()); }
+ { __rcs._M_data(_S_empty_rep._M_refcopy()); }
#endif
__rc_string_base(size_type __n, _CharT __c, const _Alloc& __a);
diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h
index 9c8c1bc79d6..73c6a1b2df0 100644
--- a/libstdc++-v3/include/ext/sso_string_base.h
+++ b/libstdc++-v3/include/ext/sso_string_base.h
@@ -1,6 +1,6 @@
// Short-string-optimized versatile string base -*- C++ -*-
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index 0e74bfa8cb2..ea1652db54e 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -36,6 +36,7 @@
#pragma GCC system_header
+#include <initializer_list>
#include <ext/vstring_util.h>
#include <ext/rc_string_base.h>
#include <ext/sso_string_base.h>
@@ -156,6 +157,15 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
*/
__versa_string(__versa_string&& __str)
: __vstring_base(std::forward<__vstring_base>(__str)) { }
+
+ /**
+ * @brief Construct string from an initializer list.
+ * @param l std::initializer_list of characters.
+ * @param a Allocator to use (default is default allocator).
+ */
+ __versa_string(std::initializer_list<_CharT> __l,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__l.begin(), __l.end(), __a) { }
#endif
/**
@@ -257,6 +267,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
this->swap(__str);
return *this;
}
+
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param l std::initializer_list.
+ */
+ __versa_string&
+ operator=(std::initializer_list<_CharT> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
@@ -623,6 +644,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a string to this string.
* @param str The string to append.
@@ -690,6 +722,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
append(size_type __n, _CharT __c)
{ return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a range of characters.
* @param first Iterator referencing the first character to append.
@@ -807,6 +850,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ assign(std::initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert multiple characters.
* @param p Iterator referencing location in string to insert at.
@@ -839,6 +893,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, std::initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert value of a string.
* @param pos1 Iterator referencing location in string to insert at.
@@ -1295,6 +1361,25 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__k1.base(), __k2 - __k1);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string& replace(iterator __i1, iterator __i2,
+ std::initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
private:
template<class _Integer>
__versa_string&
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 911bf240b48..b5fd1fd209e 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -589,7 +589,7 @@ namespace std
#endif
static time_point
- now();
+ now();
// Map to C API
static std::time_t
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 1dfb7789499..1a7a7cd1f37 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -44,8 +44,14 @@
namespace std
{
- // XXX
- class system_time;
+ namespace chrono
+ {
+ template<typename _Rep, typename _Period>
+ struct duration;
+
+ template<typename _Clock, typename _Duration>
+ struct time_point;
+ }
/// condition_variable
class condition_variable
@@ -78,22 +84,27 @@ namespace std
wait(__lock);
}
- template<typename _Duration>
- bool
- timed_wait(unique_lock<mutex>& __lock, const _Duration& __rtime);
-
- bool
- timed_wait(unique_lock<mutex>& __lock, const system_time& __atime);
-
- template<typename _Predicate>
- bool
- timed_wait(unique_lock<mutex>& __lock, const system_time& __atime,
- _Predicate pred);
-
- template<typename _Duration, typename _Predicate>
+ template<typename _Clock, typename _Duration>
bool
- timed_wait(unique_lock<mutex>& __lock, const _Duration& __rtime,
- _Predicate pred);
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime);
+
+ template<typename _Clock, typename _Duration, typename _Predicate>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p);
+
+ template<typename _Rep, typename _Period>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime);
+
+ template<typename _Rep, typename _Period, typename _Predicate>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime,
+ _Predicate __p);
native_handle_type
native_handle() { return _M_cond; }
@@ -132,21 +143,27 @@ namespace std
void
wait(_Lock& __lock, _Predicate __p);
- template<typename _Lock>
- bool
- timed_wait(_Lock& __lock, const system_time& __atime);
-
- template<typename _Lock, typename _Duration>
- bool
- timed_wait(_Lock& __lock, const _Duration& __rtime);
-
- template<typename _Lock, typename _Predicate>
+ template<typename _Lock, typename _Clock, typename _Duration>
bool
- timed_wait(_Lock& __lock, const system_time& __atime, _Predicate __p);
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime);
- template<typename _Lock, typename _Duration, typename _Predicate>
+ template<typename _Lock, typename _Clock,
+ typename _Duration, typename _Predicate>
bool
- timed_wait(_Lock& __lock, const _Duration& __rtime, _Predicate __p);
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p);
+
+ template<typename _Lock, typename _Rep, typename _Period>
+ bool
+ wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime);
+
+ template<typename _Lock, typename _Rep,
+ typename _Period, typename _Predicate>
+ bool
+ wait_for(_Lock& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p);
native_handle_type
native_handle() { return _M_cond; }
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index e4ba94def11..779394a5891 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -48,8 +48,14 @@
namespace std
{
- // XXX
- class system_time;
+ namespace chrono
+ {
+ template<typename _Rep, typename _Period>
+ struct duration;
+
+ template<typename _Clock, typename _Duration>
+ struct time_point;
+ }
/// mutex
class mutex
@@ -74,22 +80,22 @@ namespace std
int __e = __gthread_mutex_lock(&_M_mutex);
// EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
- if (__e)
- __throw_system_error(__e);
+ if (__e)
+ __throw_system_error(__e);
}
bool
try_lock()
{
- // XXX EINVAL, EAGAIN, EBUSY
- return !__gthread_mutex_trylock(&_M_mutex);
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_mutex_trylock(&_M_mutex);
}
void
unlock()
{
// XXX EINVAL, EAGAIN, EPERM
- __gthread_mutex_unlock(&_M_mutex);
+ __gthread_mutex_unlock(&_M_mutex);
}
native_handle_type
@@ -102,7 +108,6 @@ namespace std
mutex& operator=(const mutex&);
};
-
/// recursive_mutex
class recursive_mutex
{
@@ -126,8 +131,8 @@ namespace std
int __e = __gthread_recursive_mutex_lock(&_M_mutex);
// EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
- if (__e)
- __throw_system_error(__e);
+ if (__e)
+ __throw_system_error(__e);
}
bool
@@ -145,7 +150,8 @@ namespace std
}
native_handle_type
- native_handle() { return _M_mutex; }
+ native_handle()
+ { return _M_mutex; }
private:
native_handle_type _M_mutex;
@@ -154,9 +160,65 @@ namespace std
recursive_mutex& operator=(const recursive_mutex&);
};
+ /// timed_mutex
+ class timed_mutex
+ {
+ public:
+ typedef __gthread_mutex_t native_handle_type;
+
+ void lock();
+ bool try_lock();
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime);
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime);
+
+ void unlock();
- // class timed_mutex;
- // class recursive_timed_mutex;
+ native_handle_type
+ native_handle()
+ { return _M_mutex; }
+
+ private:
+ native_handle_type _M_mutex;
+
+ timed_mutex(const timed_mutex&);
+ timed_mutex& operator=(const timed_mutex&);
+ };
+
+ /// recursive_timed_mutex
+ class recursive_timed_mutex
+ {
+ public:
+ typedef __gthread_mutex_t native_handle_type;
+
+ void lock();
+ bool try_lock();
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime);
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime);
+
+ void unlock();
+
+ native_handle_type
+ native_handle()
+ { return _M_mutex; }
+
+ private:
+ native_handle_type _M_mutex;
+
+ recursive_timed_mutex(const recursive_timed_mutex&);
+ recursive_timed_mutex& operator=(const recursive_timed_mutex&);
+ };
/// Do not acquire ownership of the mutex.
struct defer_lock_t { };
@@ -211,19 +273,24 @@ namespace std
public:
typedef _Mutex mutex_type;
- unique_lock() : _M_device(NULL), _M_owns(false) { }
+ unique_lock()
+ : _M_device(NULL), _M_owns(false)
+ { }
- explicit unique_lock(mutex_type& __m) : _M_device(&__m)
+ explicit unique_lock(mutex_type& __m)
+ : _M_device(&__m)
{
lock();
_M_owns = true;
}
unique_lock(mutex_type& __m, defer_lock_t)
- : _M_device(&__m), _M_owns(false) { }
+ : _M_device(&__m), _M_owns(false)
+ { }
unique_lock(mutex_type& __m, try_to_lock_t)
- : _M_device(&__m), _M_owns(_M_device->try_lock()) { }
+ : _M_device(&__m), _M_owns(_M_device->try_lock())
+ { }
unique_lock(mutex_type& __m, adopt_lock_t)
: _M_device(&__m), _M_owns(true)
@@ -231,10 +298,13 @@ namespace std
// XXX calling thread owns mutex
}
- unique_lock(mutex_type& __m, const system_time& abs_time);
+ template<typename _Clock, typename _Duration>
+ unique_lock(mutex_type& __m,
+ const chrono::time_point<_Clock, _Duration>& __atime);
- template<typename _Duration>
- unique_lock(mutex_type& __m, const _Duration& rel_time);
+ template<typename _Rep, typename _Period>
+ unique_lock(mutex_type& __m,
+ const chrono::duration<_Rep, _Period>& __rtime);
~unique_lock()
{
@@ -246,7 +316,6 @@ namespace std
unique_lock& operator=(unique_lock&&);
-
void
lock()
{
@@ -276,12 +345,13 @@ namespace std
throw lock_error();
}
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime);
- template<typename _Duration>
- bool timed_lock(const _Duration& rel_time);
-
- bool
- timed_lock(const system_time& abs_time);
+ template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime);
void
swap(unique_lock&& __u);
@@ -296,9 +366,11 @@ namespace std
}
bool
- owns_lock() const { return _M_owns; }
+ owns_lock() const
+ { return _M_owns; }
- operator bool () const { return owns_lock(); }
+ operator bool () const
+ { return owns_lock(); }
mutex_type*
mutex() const
diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map
index e338ef7805c..2b7d328f387 100644
--- a/libstdc++-v3/include/std/unordered_map
+++ b/libstdc++-v3/include/std/unordered_map
@@ -46,6 +46,7 @@
#include <utility>
#include <type_traits>
+#include <initializer_list>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set
index 13b412b1eb5..1cabae987cc 100644
--- a/libstdc++-v3/include/std/unordered_set
+++ b/libstdc++-v3/include/std/unordered_set
@@ -46,6 +46,7 @@
#include <utility>
#include <type_traits>
+#include <initializer_list>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray
index 31799c04cce..b0fa5124805 100644
--- a/libstdc++-v3/include/std/valarray
+++ b/libstdc++-v3/include/std/valarray
@@ -45,6 +45,7 @@
#include <cmath>
#include <algorithm>
#include <debug/debug.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -144,6 +145,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/// Construct an array with the same size and values in @a ia.
valarray(const indirect_array<_Tp>&);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// Construct an array with an initializer_list of values.
+ valarray(initializer_list<_Tp>);
+#endif
+
template<class _Dom>
valarray(const _Expr<_Dom, _Tp>& __e);
@@ -209,6 +215,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
valarray<_Tp>& operator=(const indirect_array<_Tp>&);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assign elements to an initializer_list.
+ *
+ * Assign elements of array to values in @a l. Results are undefined
+ * if @a l does not have the same size as this array.
+ *
+ * @param l initializer_list to get values from.
+ */
+ valarray& operator=(initializer_list<_Tp>);
+#endif
+
template<class _Dom> valarray<_Tp>&
operator= (const _Expr<_Dom, _Tp>&);
@@ -615,6 +633,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
(__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(initializer_list<_Tp> __l)
+ : _M_size(__l.size()), _M_data(__valarray_get_storage<_Tp>(__l.size()))
+ { std::__valarray_copy_construct (__l.begin(), __l.end(), _M_data); }
+#endif
+
template<typename _Tp> template<class _Dom>
inline
valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
@@ -638,6 +664,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(initializer_list<_Tp> __l)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __l.size());
+ std::__valarray_copy(__l.begin(), __l.size(), _M_data);
+ }
+#endif
+
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator=(const _Tp& __t)
diff --git a/libstdc++-v3/include/tr1_impl/hashtable b/libstdc++-v3/include/tr1_impl/hashtable
index 55056ef3da8..33857a43ab3 100644
--- a/libstdc++-v3/include/tr1_impl/hashtable
+++ b/libstdc++-v3/include/tr1_impl/hashtable
@@ -434,6 +434,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
void
insert(_InputIterator __first, _InputIterator __last);
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
iterator
erase(iterator);
diff --git a/libstdc++-v3/include/tr1_impl/regex b/libstdc++-v3/include/tr1_impl/regex
index f99e0067850..d5e80b1b065 100644
--- a/libstdc++-v3/include/tr1_impl/regex
+++ b/libstdc++-v3/include/tr1_impl/regex
@@ -730,6 +730,13 @@ namespace regex_constants
: _M_flags(__f), _M_pattern(__first, __last), _M_mark_count(0)
{ _M_compile(); }
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ basic_regex(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__l.begin(), __l.end()), _M_mark_count(0)
+ { _M_compile(); }
+#endif
+
/**
* @brief Destroys a basic regular expression.
*/
@@ -854,6 +861,13 @@ namespace regex_constants
flag_type __flags = regex_constants::ECMAScript)
{ return this->assign(string_type(__first, __last), __flags); }
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ basic_regex&
+ assign(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ { return this->assign(__l.begin(), __l.end(), __f); }
+#endif
+
// [7.8.4] const operations
/**
* @brief Gets the number of marked subexpressions within the regular
diff --git a/libstdc++-v3/include/tr1_impl/unordered_map b/libstdc++-v3/include/tr1_impl/unordered_map
index bb69479f277..4f914495ddb 100644
--- a/libstdc++-v3/include/tr1_impl/unordered_map
+++ b/libstdc++-v3/include/tr1_impl/unordered_map
@@ -179,6 +179,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
typedef __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
@@ -205,6 +206,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
unordered_map(unordered_map&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_map&
operator=(unordered_map&& __x)
{
@@ -213,6 +222,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
this->swap(__x);
return *this;
}
+
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
@@ -227,6 +244,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
typedef __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
@@ -254,6 +272,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
unordered_multimap(unordered_multimap&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_multimap&
operator=(unordered_multimap&& __x)
{
@@ -262,6 +288,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
this->swap(__x);
return *this;
}
+
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
diff --git a/libstdc++-v3/include/tr1_impl/unordered_set b/libstdc++-v3/include/tr1_impl/unordered_set
index 80b1ec5f003..5640ebe1f77 100644
--- a/libstdc++-v3/include/tr1_impl/unordered_set
+++ b/libstdc++-v3/include/tr1_impl/unordered_set
@@ -175,6 +175,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
typedef __unordered_set<_Value, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
@@ -201,6 +202,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
unordered_set(unordered_set&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_set&
operator=(unordered_set&& __x)
{
@@ -209,6 +218,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
this->swap(__x);
return *this;
}
+
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
@@ -223,6 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
typedef __unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
@@ -250,6 +268,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
unordered_multiset(unordered_multiset&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_multiset&
operator=(unordered_multiset&& __x)
{
@@ -258,6 +284,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
this->swap(__x);
return *this;
}
+
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index d41f3ebf290..6ea357f2ce9 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -273,6 +273,16 @@ atomic.lo: atomic.cc
atomic.o: atomic.cc
$(CXXCOMPILE) -x c++ -std=gnu++0x -c $<
+string-inst.lo: string-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+string-inst.o: string-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
+wstring-inst.lo: wstring-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+wstring-inst.o: wstring-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
chrono.lo: chrono.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
chrono.o: chrono.cc
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 27c9b70c0be..b674061d3a8 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -867,6 +867,16 @@ atomic.lo: atomic.cc
atomic.o: atomic.cc
$(CXXCOMPILE) -x c++ -std=gnu++0x -c $<
+string-inst.lo: string-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+string-inst.o: string-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
+wstring-inst.lo: wstring-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+wstring-inst.o: wstring-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
chrono.lo: chrono.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
chrono.o: chrono.cc
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc b/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc
new file mode 100644
index 00000000000..71e03f1d626
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <string>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01(void)
+{
+ bool test = true;
+
+ string s1 = { 'a', 'b', 'c' };
+ VERIFY(s1 == "abc");
+
+ s1 = { 'd', 'e', 'f' };
+ VERIFY(s1 == "def");
+
+ s1 += { 'g', 'h', 'i' };
+ VERIFY(s1 == "defghi");
+
+ s1.append({ 'j', 'k', 'l' });
+ VERIFY(s1 == "defghijkl");
+
+ s1.assign({ 'm', 'n', 'o' });
+ VERIFY(s1 == "mno");
+
+ // There aren't actually overloads of insert and replace taking size_type
+ // and initializer_list, but test the usage anyway.
+ s1.insert(2, { 'p', 'q', 'r' });
+ VERIFY(s1 == "mnpqro");
+
+ s1.replace(2, 3, { 's', 't', 'u' });
+ VERIFY(s1 == "mnstuo");
+
+ string::iterator i1, i2;
+
+ i1 = s1.begin()+2;
+ s1.insert(i1, { 'v', 'w', 'x' });
+ VERIFY(s1 == "mnvwxstuo");
+
+ i1 = s1.begin()+2;
+ i2 = i1+6;
+ s1.replace(i1, i2, { 'y', 'z' });
+ VERIFY(s1 == "mnyzo");
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/init-list.cc b/libstdc++-v3/testsuite/23_containers/deque/init-list.cc
new file mode 100644
index 00000000000..715ff948732
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/deque/init-list.cc
@@ -0,0 +1,69 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <deque>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::deque<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ ok &= (c[0] == 2);
+ ok &= (c[1] == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 7, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 3, 0) && ok;
+ ok &= (c[7] == 234);
+ }
+ ok = check_construct_destroy("Insert init-list", 3, 13) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ ok &= (c[0] == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
index 2cb464cb86c..242fc98a030 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1436 }
+// { dg-error "no matching" "" { target *-*-* } 1504 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
index 57c865f34c0..2664aac468d 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1375 }
+// { dg-error "no matching" "" { target *-*-* } 1443 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
index a46674c52dc..66b76b79a49 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1375 }
+// { dg-error "no matching" "" { target *-*-* } 1443 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
index 3ae748ca316..cff5332deb5 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1520 }
+// { dg-error "no matching" "" { target *-*-* } 1588 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/list/init-list.cc b/libstdc++-v3/testsuite/23_containers/list/init-list.cc
new file mode 100644
index 00000000000..0dd5ac919cd
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/list/init-list.cc
@@ -0,0 +1,74 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <list>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::list<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ Container::iterator i = c.begin();
+ ok &= (*i++ == 2);
+ ok &= (*i++ == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ Container::iterator i = c.begin();
+ ++i; ++i; ++i; ++i; ++i; ++i; ++i;
+ c.insert(i, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 3, 0) && ok;
+ ok &= (*--i == 1);
+ ok &= (*--i == 42);
+ }
+ ok = check_construct_destroy("Insert init-list", 3, 13) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ Container::iterator i = c.begin();
+ ok &= (*i++ == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
index 8eeff630927..23c541a8d29 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1325 }
+// { dg-error "no matching" "" { target *-*-* } 1383 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
index 06b71622421..479c416590f 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1294 }
+// { dg-error "no matching" "" { target *-*-* } 1352 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
index bfe871077d7..3fd79856a5e 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1294 }
+// { dg-error "no matching" "" { target *-*-* } 1352 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
index d75ed067e24..9b5e13a6e25 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1294 }
+// { dg-error "no matching" "" { target *-*-* } 1352 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/map/init-list.cc b/libstdc++-v3/testsuite/23_containers/map/init-list.cc
new file mode 100644
index 00000000000..637303e1ac9
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/map/init-list.cc
@@ -0,0 +1,63 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ map<int,double> m({ { 1, 1.0 }, { 2, 2.0 }, { 42, 237.0 } });
+ VERIFY(m.size() == 3);
+ VERIFY(m[1] == 1.0);
+ VERIFY(m[2] == 2.0);
+ VERIFY(m[42] == 237.0);
+
+ m = { {5, 55.0}, { 6, 66.0 } };
+ VERIFY(m.size() == 2);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+
+ m.insert({ { 7, 77.0 }, { 8, 88.0 } });
+ VERIFY(m.size() == 4);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+ VERIFY(m[7] == 77.0);
+ VERIFY(m[8] == 88.0);
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/init-list.cc b/libstdc++-v3/testsuite/23_containers/multimap/init-list.cc
new file mode 100644
index 00000000000..6043cc17905
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/multimap/init-list.cc
@@ -0,0 +1,72 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef multimap<int,double> Container;
+ typedef Container::iterator iterator;
+ typedef pair<iterator,iterator> itpair;
+ Container m({ { 1, 1.0 }, { 1, 2.0 }, { 1, 237.0 } });
+ VERIFY(m.size() == 3);
+ itpair ip = m.equal_range(1);
+ VERIFY(distance(ip.first, ip.second) == 3);
+ iterator i = ip.first;
+ VERIFY((*i++).second == 1.0);
+ VERIFY((*i++).second == 2.0);
+ VERIFY((*i++).second == 237.0);
+
+ m = { {5, 55.0}, { 5, 66.0 }, { 42, 4242.0 } };
+ VERIFY(m.size() == 3);
+ ip = m.equal_range(5);
+ VERIFY(distance(ip.first, ip.second) == 2);
+ i = ip.first;
+ VERIFY((*i++).second == 55.0);
+ VERIFY((*i++).second == 66.0);
+
+ m.insert({ { 7, 77.0 }, { 7, 88.0 } });
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(7) == 2);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/init-list.cc b/libstdc++-v3/testsuite/23_containers/multiset/init-list.cc
new file mode 100644
index 00000000000..9b34f227286
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/multiset/init-list.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ multiset<int> m({ 1, 5, 5, 37 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 37, 37, 102 };
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42, 42 });
+ VERIFY(m.size() == 7);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 2);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/set/init-list.cc b/libstdc++-v3/testsuite/23_containers/set/init-list.cc
new file mode 100644
index 00000000000..256ecb38aba
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/set/init-list.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ set<int> m({ 1, 5, 37 });
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 102 };
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc
new file mode 100644
index 00000000000..983bf2da3b7
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc
@@ -0,0 +1,63 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ unordered_map<int,double> m({ { 1, 1.0 }, { 2, 2.0 }, { 42, 237.0 } });
+ VERIFY(m.size() == 3);
+ VERIFY(m[1] == 1.0);
+ VERIFY(m[2] == 2.0);
+ VERIFY(m[42] == 237.0);
+
+ m = { {5, 55.0}, { 6, 66.0 } };
+ VERIFY(m.size() == 2);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+
+ m.insert({ { 7, 77.0 }, { 8, 88.0 } });
+ VERIFY(m.size() == 4);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+ VERIFY(m[7] == 77.0);
+ VERIFY(m[8] == 88.0);
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/init-list.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/init-list.cc
new file mode 100644
index 00000000000..ba35b38d85b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/init-list.cc
@@ -0,0 +1,77 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+// XFAIL this test until debug mode container is fixed.
+// { dg-excess-errors "" }
+
+#include <set>
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef unordered_multimap<int,double> Container;
+ typedef Container::const_iterator iterator;
+ typedef pair<iterator,iterator> itpair;
+
+ Container m({ { 1, 1.0 }, { 1, 2.0 }, { 1, 237.0 } });
+ VERIFY(m.size() == 3);
+ itpair ip = m.equal_range(1);
+ VERIFY(distance(ip.first, ip.second) == 3);
+ set<double> s = { 1.0, 2.0, 237.0 };
+ for (iterator i = ip.first; i != ip.second; ++i)
+ s.erase (i->second);
+ VERIFY(s.empty());
+
+ m = { {5, 55.0}, { 5, 66.0 }, { 42, 4242.0 } };
+ VERIFY(m.size() == 3);
+ ip = m.equal_range(5);
+ VERIFY(distance(ip.first, ip.second) == 2);
+ s = { 55.0, 66.0 };
+ for (iterator i = ip.first; i != ip.second; ++i)
+ s.erase (i->second);
+ VERIFY(s.empty());
+
+ m.insert({ { 7, 77.0 }, { 7, 88.0 } });
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(7) == 2);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/init-list.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/init-list.cc
new file mode 100644
index 00000000000..22d9a49b59f
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/init-list.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ unordered_multiset<int> m({ 1, 5, 5, 37 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 37, 37, 102 };
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42, 42 });
+ VERIFY(m.size() == 7);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 2);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/init-list.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/init-list.cc
new file mode 100644
index 00000000000..8a4b05deebd
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/init-list.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ unordered_set<int> m({ 1, 5, 37 });
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 102 };
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/init-list.cc b/libstdc++-v3/testsuite/23_containers/vector/init-list.cc
new file mode 100644
index 00000000000..9a3b52c27da
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/vector/init-list.cc
@@ -0,0 +1,69 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::vector<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ ok &= (c[0] == 2);
+ ok &= (c[1] == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 7, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 13, 10) && ok;
+ ok &= (c[7] == 234);
+ }
+ ok = check_construct_destroy("Insert init-list", 13, 23) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ ok &= (c[0] == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
index 64c6a98dfb5..c5e445fa6db 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 986 }
+// { dg-error "no matching" "" { target *-*-* } 1058 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
index 34e602da583..dd115afd520 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 926 }
+// { dg-error "no matching" "" { target *-*-* } 998 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
index f1af46c43a2..50e51cb8f3f 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 926 }
+// { dg-error "no matching" "" { target *-*-* } 998 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
index a95f57857d8..31642d75c5d 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1027 }
+// { dg-error "no matching" "" { target *-*-* } 1099 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/26_numerics/valarray/init-list.cc b/libstdc++-v3/testsuite/26_numerics/valarray/init-list.cc
new file mode 100644
index 00000000000..3f4ed5bab3a
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/valarray/init-list.cc
@@ -0,0 +1,58 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <valarray>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ valarray<int> m({ 1, 5, 37 });
+ VERIFY(m.size() == 3);
+ VERIFY(m[0] == 1);
+ VERIFY(m[1] == 5);
+ VERIFY(m[2] == 37);
+
+ m = { 28, 37, 102 };
+ VERIFY(m.size() == 3);
+ VERIFY(m[0] == 28);
+ VERIFY(m[1] == 37);
+ VERIFY(m[2] == 102);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/28_regex/init-list.cc b/libstdc++-v3/testsuite/28_regex/init-list.cc
new file mode 100644
index 00000000000..6852507ee0e
--- /dev/null
+++ b/libstdc++-v3/testsuite/28_regex/init-list.cc
@@ -0,0 +1,58 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01(void)
+{
+ bool test = true;
+
+ regex r = { 'a', 'b', 'c' };
+ cmatch res;
+ // Enable when regex class actually implemented.
+ // VERIFY(regex_match ("abc", res, r));
+ VERIFY(!regex_match ("ab", res, r));
+
+ r = { 'd', 'e', 'f' };
+ // Enable when regex class actually implemented.
+ // VERIFY(regex_match ("def", res, r));
+ VERIFY(!regex_match ("abc", res, r));
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc
index f365d1167c1..8c66bb53cd7 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc
@@ -39,4 +39,4 @@ void test01()
m1 = m2;
}
// { dg-error "within this context" "" { target *-*-* } 39 }
-// { dg-error "is private" "" { target *-*-* } 102 }
+// { dg-error "is private" "" { target *-*-* } 108 }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc
index d0a91025b54..666506a36b1 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc
@@ -38,4 +38,4 @@ void test01()
mutex_type m2(m1);
}
// { dg-error "within this context" "" { target *-*-* } 38 }
-// { dg-error "is private" "" { target *-*-* } 101 }
+// { dg-error "is private" "" { target *-*-* } 107 }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc
index 2e057104ec4..b7e27847667 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc
@@ -39,4 +39,4 @@ void test01()
m1 = m2;
}
// { dg-error "within this context" "" { target *-*-* } 39 }
-// { dg-error "is private" "" { target *-*-* } 154 }
+// { dg-error "is private" "" { target *-*-* } 160 }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc
index a98e73333e5..2d20cb98c3d 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc
@@ -38,4 +38,4 @@ void test01()
mutex_type m2(m1);
}
// { dg-error "within this context" "" { target *-*-* } 38 }
-// { dg-error "is private" "" { target *-*-* } 153 }
+// { dg-error "is private" "" { target *-*-* } 159 }
diff --git a/libstdc++-v3/testsuite/ext/vstring/init-list.cc b/libstdc++-v3/testsuite/ext/vstring/init-list.cc
new file mode 100644
index 00000000000..27da6828193
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/vstring/init-list.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+int test01(void)
+{
+ bool test = true;
+
+ __gnu_cxx::__vstring s1 = { 'a', 'b', 'c' };
+ VERIFY(s1 == "abc");
+
+ s1 = { 'd', 'e', 'f' };
+ VERIFY(s1 == "def");
+
+ s1 += { 'g', 'h', 'i' };
+ VERIFY(s1 == "defghi");
+
+ s1.append({ 'j', 'k', 'l' });
+ VERIFY(s1 == "defghijkl");
+
+ s1.assign({ 'm', 'n', 'o' });
+ VERIFY(s1 == "mno");
+
+ // There aren't actually overloads of insert and replace taking size_type
+ // and initializer_list, but test the usage anyway.
+ s1.insert(2, { 'p', 'q', 'r' });
+ VERIFY(s1 == "mnpqro");
+
+ s1.replace(2, 3, { 's', 't', 'u' });
+ VERIFY(s1 == "mnstuo");
+
+ __gnu_cxx::__vstring::iterator i1, i2;
+
+ i1 = s1.begin()+2;
+ s1.insert(i1, { 'v', 'w', 'x' });
+ VERIFY(s1 == "mnvwxstuo");
+
+ i1 = s1.begin()+2;
+ i2 = i1+6;
+ s1.replace(i1, i2, { 'y', 'z' });
+ VERIFY(s1 == "mnyzo");
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+ return 0;
+}