aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-18 21:46:14 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-18 21:46:14 +0000
commita8702389d8d7459a0e91be43f0c2453003242701 (patch)
tree07c41cc4d440ba9267d734cb55277c003cefb805
parent29e31c57db3181664d1e0e6b6fc54bcb9e8eaf2b (diff)
Merge from mainline
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/dataflow-branch@124836 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog30
-rw-r--r--MAINTAINERS9
-rw-r--r--Makefile.def12
-rw-r--r--Makefile.in591
-rw-r--r--Makefile.tpl14
-rw-r--r--contrib/ChangeLog4
-rwxr-xr-xcontrib/gennews4
-rw-r--r--gcc/ChangeLog1008
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in23
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/misc.c2
-rw-r--r--gcc/basic-block.h17
-rw-r--r--gcc/builtin-types.def4
-rw-r--r--gcc/builtins.c308
-rw-r--r--gcc/builtins.def7
-rw-r--r--gcc/c-common.c199
-rw-r--r--gcc/c-common.h12
-rw-r--r--gcc/c-cppbuiltin.c3
-rw-r--r--gcc/c-decl.c10
-rw-r--r--gcc/c-format.c2
-rw-r--r--gcc/c-incpath.c19
-rw-r--r--gcc/c-objc-common.h2
-rw-r--r--gcc/c-opts.c4
-rw-r--r--gcc/c-typeck.c26
-rw-r--r--gcc/c.opt4
-rw-r--r--gcc/cfghooks.c30
-rw-r--r--gcc/cfgloop.c158
-rw-r--r--gcc/cfgloop.h74
-rw-r--r--gcc/cfgloopanal.c14
-rw-r--r--gcc/cfgloopmanip.c37
-rw-r--r--gcc/cgraphunit.c76
-rw-r--r--gcc/collect2.c71
-rw-r--r--gcc/combine.c10
-rw-r--r--gcc/config.gcc8
-rw-r--r--gcc/config.in6
-rw-r--r--gcc/config/bfin/bfin-protos.h8
-rw-r--r--gcc/config/bfin/bfin.c97
-rw-r--r--gcc/config/bfin/bfin.h25
-rw-r--r--gcc/config/bfin/bfin.md227
-rw-r--r--gcc/config/i386/i386.c7
-rw-r--r--gcc/config/i386/i386.h11
-rw-r--r--gcc/config/i386/i386.opt16
-rw-r--r--gcc/config/i386/libgcc-x86_64-glibc.ver61
-rw-r--r--gcc/config/i386/mingw32.h10
-rw-r--r--gcc/config/i386/sfp-machine.h56
-rw-r--r--gcc/config/i386/sse.md109
-rw-r--r--gcc/config/i386/t-fprules-softfp646
-rw-r--r--gcc/config/i386/t-linux643
-rw-r--r--gcc/config/i386/vxworks.h4
-rw-r--r--gcc/config/m32c/jump.md26
-rw-r--r--gcc/config/m32c/m32c-protos.h1
-rw-r--r--gcc/config/m32c/m32c.c118
-rw-r--r--gcc/config/m32c/muldiv.md31
-rw-r--r--gcc/config/m32c/shift.md10
-rw-r--r--gcc/config/m68k/m68k-protos.h2
-rw-r--r--gcc/config/m68k/m68k.c70
-rw-r--r--gcc/config/m68k/m68k.h13
-rw-r--r--gcc/config/m68k/m68k.md22
-rw-r--r--gcc/config/mips/mips-dspr2.md30
-rw-r--r--gcc/config/mips/mips.c90
-rw-r--r--gcc/config/mips/mips.h14
-rw-r--r--gcc/config/mips/mips.md10
-rw-r--r--gcc/config/pa/pa.c15
-rw-r--r--gcc/config/pa/pa.md66
-rw-r--r--gcc/config/rs6000/rs6000.c209
-rw-r--r--gcc/config/s390/s390.md184
-rw-r--r--gcc/config/soft-fp/README9
-rw-r--r--gcc/config/soft-fp/double.h14
-rw-r--r--gcc/config/soft-fp/extended.h54
-rw-r--r--gcc/config/soft-fp/extendxftf2.c53
-rw-r--r--gcc/config/soft-fp/fixdfti.c45
-rw-r--r--gcc/config/soft-fp/fixsfti.c45
-rw-r--r--gcc/config/soft-fp/fixtfti.c45
-rw-r--r--gcc/config/soft-fp/fixunsdfti.c45
-rw-r--r--gcc/config/soft-fp/fixunssfti.c45
-rw-r--r--gcc/config/soft-fp/fixunstfti.c45
-rw-r--r--gcc/config/soft-fp/floattidf.c45
-rw-r--r--gcc/config/soft-fp/floattisf.c45
-rw-r--r--gcc/config/soft-fp/floattitf.c45
-rw-r--r--gcc/config/soft-fp/floatundidf.c5
-rw-r--r--gcc/config/soft-fp/floatundisf.c5
-rw-r--r--gcc/config/soft-fp/floatunsidf.c5
-rw-r--r--gcc/config/soft-fp/floatunsisf.c5
-rw-r--r--gcc/config/soft-fp/floatuntidf.c45
-rw-r--r--gcc/config/soft-fp/floatuntisf.c45
-rw-r--r--gcc/config/soft-fp/floatuntitf.c45
-rw-r--r--gcc/config/soft-fp/op-2.h4
-rw-r--r--gcc/config/soft-fp/op-4.h4
-rw-r--r--gcc/config/soft-fp/op-common.h40
-rw-r--r--gcc/config/soft-fp/quad.h18
-rw-r--r--gcc/config/soft-fp/trunctfxf2.c53
-rw-r--r--gcc/config/sparc/sparc-protos.h1
-rw-r--r--gcc/config/sparc/sparc.c74
-rw-r--r--gcc/config/sparc/sparc.h3
-rw-r--r--gcc/config/sparc/sparc.md32
-rw-r--r--gcc/config/sparc/t-vxworks5
-rw-r--r--gcc/config/sparc/vxworks.h64
-rw-r--r--gcc/config/xtensa/xtensa.c13
-rw-r--r--gcc/config/xtensa/xtensa.md82
-rwxr-xr-xgcc/configure24
-rw-r--r--gcc/configure.ac18
-rw-r--r--gcc/convert.c4
-rw-r--r--gcc/cp/ChangeLog7065
-rw-r--r--gcc/cp/ChangeLog-20053521
-rw-r--r--gcc/cp/ChangeLog-20063495
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h3
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/decl2.c6
-rw-r--r--gcc/cp/mangle.c18
-rw-r--r--gcc/cp/parser.c47
-rw-r--r--gcc/cp/rtti.c4
-rw-r--r--gcc/cp/semantics.c4
-rw-r--r--gcc/cp/typeck.c51
-rw-r--r--gcc/crtstuff.c50
-rw-r--r--gcc/doc/c-tree.texi23
-rw-r--r--gcc/doc/extend.texi93
-rw-r--r--gcc/doc/invoke.texi112
-rw-r--r--gcc/doc/md.texi42
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/dominance.c203
-rw-r--r--gcc/emit-rtl.c33
-rw-r--r--gcc/except.c12
-rw-r--r--gcc/explow.c2
-rw-r--r--gcc/expmed.c4
-rw-r--r--gcc/expr.c103
-rw-r--r--gcc/flags.h9
-rw-r--r--gcc/fold-const.c36
-rw-r--r--gcc/fortran/ChangeLog244
-rw-r--r--gcc/fortran/Make-lang.in4
-rw-r--r--gcc/fortran/array.c2
-rw-r--r--gcc/fortran/check.c84
-rw-r--r--gcc/fortran/decl.c73
-rw-r--r--gcc/fortran/expr.c1
-rw-r--r--gcc/fortran/f95-lang.c13
-rw-r--r--gcc/fortran/gfortran.h35
-rw-r--r--gcc/fortran/gfortran.texi7
-rw-r--r--gcc/fortran/interface.c28
-rw-r--r--gcc/fortran/intrinsic.c76
-rw-r--r--gcc/fortran/intrinsic.h3
-rw-r--r--gcc/fortran/intrinsic.texi146
-rw-r--r--gcc/fortran/iresolve.c44
-rw-r--r--gcc/fortran/match.h1
-rw-r--r--gcc/fortran/primary.c15
-rw-r--r--gcc/fortran/resolve.c118
-rw-r--r--gcc/fortran/simplify.c95
-rw-r--r--gcc/fortran/symbol.c12
-rw-r--r--gcc/fortran/target-memory.c451
-rw-r--r--gcc/fortran/target-memory.h37
-rw-r--r--gcc/fortran/trans-array.c76
-rw-r--r--gcc/fortran/trans-decl.c40
-rw-r--r--gcc/fortran/trans-expr.c25
-rw-r--r--gcc/fortran/trans-intrinsic.c13
-rw-r--r--gcc/fortran/trans-io.c269
-rw-r--r--gcc/fortran/trans-stmt.c108
-rw-r--r--gcc/fortran/trans-types.c15
-rw-r--r--gcc/fortran/trans-types.h1
-rw-r--r--gcc/fortran/trans.c97
-rw-r--r--gcc/fortran/trans.h13
-rw-r--r--gcc/function.h2
-rw-r--r--gcc/gcc.c68
-rw-r--r--gcc/gcse.c2
-rw-r--r--gcc/genautomata.c4
-rw-r--r--gcc/gengtype.c2
-rw-r--r--gcc/genopinit.c10
-rw-r--r--gcc/gimplify.c19
-rw-r--r--gcc/haifa-sched.c126
-rw-r--r--gcc/ifcvt.c2
-rw-r--r--gcc/ipa-inline.c7
-rw-r--r--gcc/ipa-type-escape.c7
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/expr.c2
-rw-r--r--gcc/java/java-tree.h1
-rw-r--r--gcc/java/lang.c2
-rw-r--r--gcc/java/typeck.c8
-rw-r--r--gcc/lambda-code.c5
-rw-r--r--gcc/langhooks-def.h1
-rw-r--r--gcc/langhooks.h4
-rw-r--r--gcc/libgcc-std.ver3
-rw-r--r--gcc/longlong.h47
-rw-r--r--gcc/loop-init.c5
-rw-r--r--gcc/loop-invariant.c12
-rw-r--r--gcc/loop-unroll.c35
-rw-r--r--gcc/modulo-sched.c2
-rw-r--r--gcc/optabs.c42
-rw-r--r--gcc/optabs.h27
-rw-r--r--gcc/opts.c22
-rw-r--r--gcc/passes.c9
-rw-r--r--gcc/reload.c18
-rw-r--r--gcc/sched-ebb.c17
-rw-r--r--gcc/sched-int.h12
-rw-r--r--gcc/sched-rgn.c110
-rw-r--r--gcc/stmt.c6
-rw-r--r--gcc/testsuite/ChangeLog390
-rw-r--r--gcc/testsuite/g++.dg/abi/forced.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp/_Pragma1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/first-global.C2
-rw-r--r--gcc/testsuite/g++.dg/other/nested-extern-1.C17
-rw-r--r--gcc/testsuite/g++.dg/other/nested-extern-2.C18
-rw-r--r--gcc/testsuite/g++.dg/other/nested-extern.cc1
-rw-r--r--gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C1
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid5.C13
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr31146.C7
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-7.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C21
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-1.C10
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-const.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C10
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C16
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-union.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C10
-rw-r--r--gcc/testsuite/g++.dg/warn/multiple-overflow-warn-3.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/empty.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline8.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/static11.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr31797.c31
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr31953.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20070517-1.c41
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/memchr-lib.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/memchr.c38
-rw-r--r--gcc/testsuite/gcc.dg/20070507-1.c103
-rw-r--r--gcc/testsuite/gcc.dg/Wno-c++-compat.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wshadow-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c10
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c14
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c18
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c10
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c23
-rw-r--r--gcc/testsuite/gcc.dg/alias-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/alias-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/array-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/builtins-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/cpp/if-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/include2.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mac-dir-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/paste11.c8
-rw-r--r--gcc/testsuite/gcc.dg/cpp/paste13.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/paste5.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/paste6.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/paste8.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/skipping2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/comment.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/literals-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c31
-rw-r--r--gcc/testsuite/gcc.dg/dfp/func-mixed.c36
-rw-r--r--gcc/testsuite/gcc.dg/dfp/operator-assignment.c4
-rw-r--r--gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c14
-rw-r--r--gcc/testsuite/gcc.dg/dse.c32
-rw-r--r--gcc/testsuite/gcc.dg/fltconst-1.c16
-rw-r--r--gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c6
-rw-r--r--gcc/testsuite/gcc.dg/inline-15.c4
-rw-r--r--gcc/testsuite/gcc.dg/invalid-call-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pch/pch.exp1
-rw-r--r--gcc/testsuite/gcc.dg/pr27953.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr30957-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/pr31344.c25
-rw-r--r--gcc/testsuite/gcc.dg/pr31847.c15
-rw-r--r--gcc/testsuite/gcc.dg/reg-vol-struct-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/special/gcsec-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-math-2.c56
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-math-4.c255
-rw-r--r--gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c1
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-29.c21
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-30.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21559.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c119
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c9
-rw-r--r--[-rwxr-xr-x]gcc/testsuite/gcc.dg/vect/pr22480.c0
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-102.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-103.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-104.c4
-rw-r--r--[-rwxr-xr-x]gcc/testsuite/gcc.dg/vect/vect-106.c0
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c40
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c38
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c38
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/pr31628.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr31854.c10
-rw-r--r--gcc/testsuite/gcc.target/m68k/interrupt_thread-1.c43
-rw-r--r--gcc/testsuite/gcc.target/m68k/interrupt_thread-2.c23
-rw-r--r--gcc/testsuite/gcc.target/m68k/interrupt_thread-3.c7
-rw-r--r--gcc/testsuite/gcc.target/m68k/m68k.exp2
-rw-r--r--gcc/testsuite/gcc.target/mips/msub-1.c19
-rw-r--r--gcc/testsuite/gcc.target/mips/msub-2.c19
-rw-r--r--gcc/testsuite/gcc.target/mips/msub-3.c19
-rw-r--r--gcc/testsuite/gcc.target/mips/msub-4.c19
-rw-r--r--gcc/testsuite/gcc.target/mips/msubu-1.c22
-rw-r--r--gcc/testsuite/gcc.target/mips/msubu-2.c22
-rw-r--r--gcc/testsuite/gcc.target/mips/msubu-3.c22
-rw-r--r--gcc/testsuite/gcc.target/mips/msubu-4.c22
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr18096-1.c2
-rw-r--r--gcc/testsuite/gfortran.dg/actual_array_result_1.f9071
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/assumed_dummy_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/besxy.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/bounds_check_fail_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/char_initialiser_actual.f902
-rw-r--r--gcc/testsuite/gfortran.dg/char_length_3.f9049
-rw-r--r--gcc/testsuite/gfortran.dg/char_length_4.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/char_pointer_assign_3.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/char_result_2.f905
-rw-r--r--gcc/testsuite/gfortran.dg/char_type_len_2.f908
-rw-r--r--gcc/testsuite/gfortran.dg/default_numeric_type_1.f903
-rw-r--r--gcc/testsuite/gfortran.dg/do_3.F90110
-rw-r--r--gcc/testsuite/gfortran.dg/entry_10.f9036
-rw-r--r--gcc/testsuite/gfortran.dg/erf.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_zero_precision.f9076
-rw-r--r--gcc/testsuite/gfortran.dg/fseek.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/host_assoc_function_1.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/inquire_iolength.f902
-rw-r--r--gcc/testsuite/gfortran.dg/iostat_4.f909
-rw-r--r--gcc/testsuite/gfortran.dg/large_unit_1.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/large_unit_2.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/min_max_conformance.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/module_naming_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_29.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/nested_modules_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/new_line.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/oldstyle_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/operator_2.f901
-rw-r--r--gcc/testsuite/gfortran.dg/parameter_array_dummy.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/parameter_array_element_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/parameter_array_init_1.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/parameter_array_init_2.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/real_const_3.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/recursive_reference_1.f908
-rw-r--r--gcc/testsuite/gfortran.dg/recursive_reference_2.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/shift-alloc.f902
-rw-r--r--gcc/testsuite/gfortran.dg/substr_4.f69
-rw-r--r--gcc/testsuite/gfortran.dg/transfer_simplify_1.f9087
-rw-r--r--gcc/testsuite/gfortran.dg/transfer_simplify_2.f90155
-rw-r--r--gcc/testsuite/gfortran.dg/unf_io_convert_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/unf_read_corrupted_2.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/used_types_11.f901
-rw-r--r--gcc/testsuite/gfortran.dg/zero_array_components_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/zero_length_1.f9018
-rw-r--r--gcc/testsuite/gnat.dg/opt1.adb29
-rw-r--r--gcc/testsuite/gnat.dg/opt1.ads13
-rw-r--r--gcc/timevar.c7
-rw-r--r--gcc/toplev.c32
-rw-r--r--gcc/tree-cfg.c6
-rw-r--r--gcc/tree-cfgcleanup.c4
-rw-r--r--gcc/tree-chrec.c7
-rw-r--r--gcc/tree-chrec.h3
-rw-r--r--gcc/tree-data-ref.c1944
-rw-r--r--gcc/tree-data-ref.h168
-rw-r--r--gcc/tree-dump.c2
-rw-r--r--gcc/tree-flow.h4
-rw-r--r--gcc/tree-inline.c3
-rw-r--r--gcc/tree-loop-linear.c12
-rw-r--r--gcc/tree-object-size.c4
-rw-r--r--gcc/tree-pass.h14
-rw-r--r--gcc/tree-pretty-print.c26
-rw-r--r--gcc/tree-scalar-evolution.c34
-rw-r--r--gcc/tree-scalar-evolution.h1
-rw-r--r--gcc/tree-ssa-alias-warnings.c991
-rw-r--r--gcc/tree-ssa-alias.c6
-rw-r--r--gcc/tree-ssa-dce.c2
-rw-r--r--gcc/tree-ssa-dom.c50
-rw-r--r--gcc/tree-ssa-dse.c80
-rw-r--r--gcc/tree-ssa-forwprop.c11
-rw-r--r--gcc/tree-ssa-loop-im.c16
-rw-r--r--gcc/tree-ssa-loop-manip.c2
-rw-r--r--gcc/tree-ssa-loop-niter.c4
-rw-r--r--gcc/tree-ssa-loop.c20
-rw-r--r--gcc/tree-ssa-pre.c8
-rw-r--r--gcc/tree-ssa-threadupdate.c676
-rw-r--r--gcc/tree-ssa.c4
-rw-r--r--gcc/tree-vect-analyze.c7
-rw-r--r--gcc/tree-vect-generic.c5
-rw-r--r--gcc/tree-vect-transform.c315
-rw-r--r--gcc/tree-vectorizer.c83
-rw-r--r--gcc/tree-vectorizer.h3
-rw-r--r--gcc/tree-vrp.c55
-rw-r--r--gcc/tree.c12
-rw-r--r--gcc/tree.def19
-rw-r--r--gcc/treelang/ChangeLog5
-rw-r--r--gcc/treelang/treetree.c11
-rw-r--r--gcc/varasm.c15
-rw-r--r--include/ChangeLog4
-rw-r--r--include/libiberty.h4
-rw-r--r--libcpp/ChangeLog7
-rw-r--r--libcpp/expr.c23
-rw-r--r--libffi/ChangeLog23
-rwxr-xr-xlibffi/configure64
-rw-r--r--libffi/configure.ac12
-rw-r--r--libffi/fficonfig.h.in3
-rw-r--r--libffi/src/m68k/ffi.c214
-rw-r--r--libffi/src/m68k/ffitarget.h3
-rw-r--r--libffi/src/m68k/sysv.S138
-rw-r--r--libgcc/ChangeLog4
-rw-r--r--libgcc/config.host2
-rw-r--r--libgfortran/ChangeLog73
-rw-r--r--libgfortran/gfortran.map7
-rw-r--r--libgfortran/intrinsics/move_alloc.c14
-rw-r--r--libgfortran/intrinsics/string_intrinsics.c2
-rw-r--r--libgfortran/intrinsics/system.c3
-rw-r--r--libgfortran/io/intrinsics.c28
-rw-r--r--libgfortran/io/io.h3
-rw-r--r--libgfortran/io/lock.c4
-rw-r--r--libgfortran/io/transfer.c33
-rw-r--r--libgfortran/io/unix.c14
-rw-r--r--libgfortran/libgfortran.h32
-rw-r--r--libgfortran/runtime/environ.c16
-rw-r--r--libgfortran/runtime/error.c16
-rw-r--r--libgfortran/runtime/memory.c40
-rw-r--r--libgomp/ChangeLog7
-rw-r--r--libgomp/config/linux/proc.c179
-rw-r--r--libgomp/configure.tgt3
-rw-r--r--libiberty/ChangeLog18
-rw-r--r--libiberty/Makefile.in3
-rw-r--r--libiberty/argv.c56
-rw-r--r--libiberty/cp-demangle.c22
-rw-r--r--libiberty/filename_cmp.c6
-rw-r--r--libiberty/testsuite/demangle-expected16
-rw-r--r--libjava/ChangeLog186
-rw-r--r--libjava/Makefile.am1
-rw-r--r--libjava/Makefile.in10
-rw-r--r--libjava/classpath/ChangeLog25
-rw-r--r--libjava/classpath/gnu/classpath/jdwp/Jdwp.java81
-rw-r--r--libjava/classpath/gnu/classpath/jdwp/event/Event.java39
-rw-r--r--libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java3
-rw-r--r--libjava/classpath/gnu/classpath/jdwp/transport/JdwpConnection.java16
-rw-r--r--libjava/classpath/gnu/javax/management/Server.java21
-rw-r--r--libjava/classpath/javax/swing/text/html/HTMLEditorKit.java2
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.classbin804 -> 804 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.classbin5777 -> 6780 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.classbin1160 -> 1210 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.classbin4017 -> 4063 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/Event.classbin1598 -> 2006 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.classbin8228 -> 8121 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.classbin5043 -> 5120 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/jvmti/ExceptionEvent.classbin1534 -> 0 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.classbin898 -> 898 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.classbin1219 -> 1219 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.classbin1282 -> 1282 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server.classbin23419 -> 24096 bytes
-rw-r--r--libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.classbin567 -> 567 bytes
-rw-r--r--libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.classbin2645 -> 2656 bytes
-rw-r--r--libjava/classpath/lib/java/lang/PosixProcess.classbin4197 -> 4098 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.classbin10214 -> 10381 bytes
-rw-r--r--libjava/classpath/resource/javax/swing/text/html/default.css (renamed from libjava/classpath/javax/swing/text/html/default.css)0
-rw-r--r--libjava/gnu/classpath/jdwp/Jdwp.h4
-rw-r--r--libjava/gnu/classpath/jdwp/VMFrame.h2
-rw-r--r--libjava/gnu/classpath/jdwp/VMFrame.java4
-rw-r--r--libjava/gnu/classpath/jdwp/VMVirtualMachine.h1
-rw-r--r--libjava/gnu/classpath/jdwp/VMVirtualMachine.java3
-rw-r--r--libjava/gnu/classpath/jdwp/event/Event.h7
-rw-r--r--libjava/gnu/classpath/jdwp/natVMMethod.cc7
-rw-r--r--libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc131
-rw-r--r--libjava/gnu/classpath/jdwp/transport/JdwpConnection.h2
-rw-r--r--libjava/gnu/gcj/jvmti/ExceptionEvent.h44
-rw-r--r--libjava/gnu/gcj/jvmti/ExceptionEvent.java96
-rw-r--r--libjava/gnu/gcj/jvmti/natExceptionEvent.cc59
-rw-r--r--libjava/gnu/gcj/util/natGCInfo.cc2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h6
-rw-r--r--libjava/gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc4
-rw-r--r--libjava/gnu/javax/management/Server.h3
-rw-r--r--libjava/include/java-interp.h3
-rw-r--r--libjava/include/java-stack.h7
-rw-r--r--libjava/include/jvmti-int.h2
-rw-r--r--libjava/include/posix-threads.h8
-rw-r--r--libjava/interpret-run.cc43
-rw-r--r--libjava/interpret.cc218
-rw-r--r--libjava/java/lang/PosixProcess$ProcessManager.h32
-rw-r--r--libjava/java/lang/PosixProcess.h7
-rw-r--r--libjava/java/lang/PosixProcess.java151
-rw-r--r--libjava/java/lang/natPosixProcess.cc157
-rw-r--r--libjava/java/lang/natString.cc8
-rw-r--r--libjava/jni.cc3
-rw-r--r--libjava/posix-threads.cc22
-rwxr-xr-xlibjava/scripts/makemake.tcl3
-rw-r--r--libjava/sources.am2
-rw-r--r--libjava/sun/misc/natUnsafe.cc3
-rw-r--r--libstdc++-v3/ChangeLog424
-rw-r--r--libstdc++-v3/acinclude.m44
-rw-r--r--libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver10
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver8
-rw-r--r--libstdc++-v3/config/locale/darwin/ctype_members.cc1
-rw-r--r--libstdc++-v3/config/locale/generic/c_locale.cc93
-rw-r--r--libstdc++-v3/config/locale/generic/c_locale.h16
-rw-r--r--libstdc++-v3/config/locale/generic/codecvt_members.cc1
-rw-r--r--libstdc++-v3/config/locale/generic/collate_members.cc4
-rw-r--r--libstdc++-v3/config/locale/generic/ctype_members.cc1
-rw-r--r--libstdc++-v3/config/locale/generic/messages_members.h6
-rw-r--r--libstdc++-v3/config/locale/generic/time_members.cc19
-rw-r--r--libstdc++-v3/config/locale/generic/time_members.h7
-rw-r--r--libstdc++-v3/config/locale/gnu/c++locale_internal.h2
-rw-r--r--libstdc++-v3/config/locale/gnu/c_locale.h13
-rw-r--r--libstdc++-v3/config/locale/gnu/messages_members.cc18
-rw-r--r--libstdc++-v3/config/locale/gnu/messages_members.h17
-rw-r--r--libstdc++-v3/config/locale/gnu/monetary_members.cc30
-rw-r--r--libstdc++-v3/config/locale/gnu/time_members.cc21
-rw-r--r--libstdc++-v3/config/locale/gnu/time_members.h7
-rw-r--r--libstdc++-v3/config/os/gnu-linux/ctype_noninline.h46
-rw-r--r--libstdc++-v3/config/os/mingw32/os_defines.h2
-rw-r--r--libstdc++-v3/config/os/tpf/ctype_noninline.h29
-rwxr-xr-xlibstdc++-v3/configure12
-rw-r--r--libstdc++-v3/docs/html/abi.html21
-rw-r--r--libstdc++-v3/include/Makefile.am2
-rw-r--r--libstdc++-v3/include/Makefile.in2
-rw-r--r--libstdc++-v3/include/bits/allocator.h2
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc12
-rw-r--r--libstdc++-v3/include/bits/char_traits.h17
-rw-r--r--libstdc++-v3/include/bits/codecvt.h3
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc82
-rw-r--r--libstdc++-v3/include/bits/istream.tcc107
-rw-r--r--libstdc++-v3/include/bits/locale_classes.h8
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h15
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc29
-rw-r--r--libstdc++-v3/include/bits/locale_facets_nonio.h3
-rw-r--r--libstdc++-v3/include/bits/ostream.tcc78
-rw-r--r--libstdc++-v3/include/bits/ostream_insert.h6
-rw-r--r--libstdc++-v3/include/bits/postypes.h6
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h66
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h88
-rw-r--r--libstdc++-v3/include/bits/stl_auto_ptr.h (renamed from libstdc++-v3/include/bits/stl_memory.h)78
-rw-r--r--libstdc++-v3/include/bits/stl_construct.h4
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_types.h6
-rw-r--r--libstdc++-v3/include/bits/stl_raw_storage_iter.h15
-rw-r--r--libstdc++-v3/include/bits/stl_tempbuf.h70
-rw-r--r--libstdc++-v3/include/bits/stl_uninitialized.h23
-rw-r--r--libstdc++-v3/include/bits/valarray_array.h12
-rw-r--r--libstdc++-v3/include/debug/deque2
-rw-r--r--libstdc++-v3/include/ext/algorithm6
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp2
-rw-r--r--libstdc++-v3/include/ext/pod_char_traits.h4
-rw-r--r--libstdc++-v3/include/ext/rope82
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h50
-rw-r--r--libstdc++-v3/include/ext/vstring.tcc12
-rw-r--r--libstdc++-v3/include/std/bitset9
-rw-r--r--libstdc++-v3/include/std/complex24
-rw-r--r--libstdc++-v3/include/std/fstream2
-rw-r--r--libstdc++-v3/include/std/memory9
-rw-r--r--libstdc++-v3/include/std/stdexcept20
-rw-r--r--libstdc++-v3/include/std/type_traits55
-rw-r--r--libstdc++-v3/include/tr1/cmath13
-rw-r--r--libstdc++-v3/include/tr1/hypergeometric.tcc4
-rw-r--r--libstdc++-v3/include/tr1/type_traitsfwd.h2
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am5
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in29
-rw-r--r--libstdc++-v3/libsupc++/atexit_arm.cc44
-rw-r--r--libstdc++-v3/libsupc++/cxxabi-forced.h51
-rw-r--r--libstdc++-v3/libsupc++/cxxabi.h20
-rw-r--r--libstdc++-v3/libsupc++/eh_exception.cc6
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc25
-rw-r--r--libstdc++-v3/libsupc++/vec.cc8
-rw-r--r--libstdc++-v3/src/compatibility.cc10
-rw-r--r--libstdc++-v3/src/ctype.cc1
-rw-r--r--libstdc++-v3/src/ios.cc4
-rw-r--r--libstdc++-v3/src/ios_init.cc2
-rw-r--r--libstdc++-v3/src/istream.cc40
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc12
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc24
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/bad_exception/23591_thread-1.c (renamed from libstdc++-v3/testsuite/19_diagnostics/23591_thread-1.c)0
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/logic_error/what-1.cc59
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/logic_error/what-2.cc51
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-1.cc59
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-2.cc51
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-3.cc (renamed from libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc)50
-rw-r--r--libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc (renamed from libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs.cc)7
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc63
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc7
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc (renamed from libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs.cc)7
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc63
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc5
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc5
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc (renamed from libstdc++-v3/testsuite/21_strings/char_traits/typedefs/char/1.cc)17
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc6
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc43
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/5.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/6.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/5.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/6.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/5.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/6.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/char/19955.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/5.cc1
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/14220.cc6
-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/25_algorithms/copy/streambuf_iterators/char/2.cc3
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc3
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/unique_copy/2.cc3
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/char/1.cc (renamed from libstdc++-v3/testsuite/26_numerics/complex/complex_inserters_extractors.cc)4
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/wchar_t/1.cc137
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc74
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/4.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/4.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/fpos/mbstate_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/codecvt/1.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/codecvt/char-1.cc4
-rw-r--r--libstdc++-v3/testsuite/ext/codecvt/char-2.cc4
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc4
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_filebuf/char/2.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/1.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc3
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp17
-rw-r--r--libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc1
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_abi.cc1
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_io.h5
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_iterators.h4
657 files changed, 24160 insertions, 12680 deletions
diff --git a/ChangeLog b/ChangeLog
index 4df1da1cd9b..c13d92bf07b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2007-05-16 Paolo Bonzini <bonzini@gnu.org>
+
+ * Makefile.def (bootstrap_stage): Replace stage_make_flags with
+ stage_cflags.
+ * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS):
+ Remove CFLAGS/LIBCFLAGS.
+ (configure-stage[+id+]-[+prefix+][+module+],
+ all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+].
+ * Makefile.in: Regenerate.
+
+2007-05-15 Diego Novillo <dnovillo@google.com>
+
+ * MAINTAINERS: Update e-mail address.
+
+2007-05-15 Revital Eres <eres@il.ibm.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2007-05-14 Roberto Costa <robsettantasei@gmail.com>
+
+ * MAINTAINERS (Write After Approval): Updated my address.
+
+2007-05-14 Thomas Neumann <tneumann@users.sourceforge.net>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2007-05-11 Silvius Rus <rus@google.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
2007-04-23 Tom Tromey <tromey@redhat.com>
* MAINTAINERS: Added myself as non-algorithmic libcpp maintainer.
diff --git a/MAINTAINERS b/MAINTAINERS
index ed12e26af21..606042c077c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -204,7 +204,7 @@ option handling Neil Booth neil@daikokuya.co.uk
testsuite Janis Johnson janis187@us.ibm.com
middle-end Roger Sayle roger@eyesopen.com
middle-end Ian Lance Taylor ian@airs.com
-tree-ssa Diego Novillo dnovillo@redhat.com
+tree-ssa Diego Novillo dnovillo@google.com
tree-ssa Andrew MacLeod amacleod@redhat.com
PRE Daniel Berlin dberlin@dberlin.org
code sinking Daniel Berlin dberlin@dberlin.org
@@ -216,7 +216,7 @@ linear loop transforms Daniel Berlin dberlin@dberlin.org
profile feedback Jan Hubicka jh@suse.cz
type-safe vectors Nathan Sidwell nathan@codesourcery.com
alias analysis Daniel Berlin dberlin@dberlin.org
-alias analysis Diego Novillo dnovillo@redhat.com
+alias analysis Diego Novillo dnovillo@google.com
reload Ulrich Weigand uweigand@de.ibm.com
dfp.c, related Ben Elliston bje@au.ibm.com
RTL optimizers Eric Botcazou ebotcazou@libertysurf.fr
@@ -271,11 +271,12 @@ William Cohen wcohen@redhat.com
Josh Conner jconner@apple.com
R. Kelley Cook kcook@gcc.gnu.org
Christian Cornelssen ccorn@cs.tu-berlin.de
-Roberto Costa roberto.costa@st.com
+Roberto Costa robsettantasei@gmail.com
Ian Dall ian@beware.dropbear.id.au
David Daney ddaney@avtrex.com
Benoit Dupont de Dinechin benoit.dupont-de-dinechin@st.com
Mohan Embar gnustuff@thisiscool.com
+Revital Eres eres@il.ibm.com
Marc Espie espie@cvs.openbsd.org
Rafael Ávila de Espíndola rafael.espindola@gmail.com
Ansgar Esztermann ansgar@thphy.uni-duesseldorf.de
@@ -346,6 +347,7 @@ Alan Modra amodra@bigpond.net.au
Catherine Moore clm@redhat.com
Dirk Mueller dmueller@suse.de
Adam Nemet anemet@caviumnetworks.com
+Thomas Neumann tneumann@users.sourceforge.net
Dan Nicolaescu dann@ics.uci.edu
Dorit Nuzman dorit@il.ibm.com
David O'Brien obrien@FreeBSD.org
@@ -369,6 +371,7 @@ Gavin Romig-Koch gavin@redhat.com
Ira Rosen irar@il.ibm.com
Maciej W. Rozycki macro@linux-mips.org
Douglas Rupp rupp@gnat.com
+Silvius Rus rus@google.com
Matthew Sachs msachs@apple.com
Svein Seldal svein@dev.seldal.com
Thiemo Seufer ths@networkno.de
diff --git a/Makefile.def b/Makefile.def
index 986b1eda0ee..6436272ae9c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -506,31 +506,31 @@ bootstrap_stage = {
// compiler probably has never heard of them.
stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ;
- stage_make_flags='CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)"' ; };
+ stage_cflags='$(STAGE1_CFLAGS)' ; };
bootstrap_stage = {
id=2 ; prev=1 ;
bootstrap_target=bootstrap2 ;
stage_configure_flags="@stage2_werror_flag@" ;
- stage_make_flags="" ; };
+ stage_cflags="$(BOOT_CFLAGS)" ; };
bootstrap_stage = {
id=3 ; prev=2 ; lean=1 ;
compare_target=compare ;
bootstrap_target=bootstrap ;
cleanstrap_target=cleanstrap ;
stage_configure_flags="@stage2_werror_flag@" ;
- stage_make_flags="" ; };
+ stage_cflags="$(BOOT_CFLAGS)" ; };
bootstrap_stage = {
id=4 ; prev=3 ; lean=2 ;
compare_target=compare3 ;
bootstrap_target=bootstrap4 ;
stage_configure_flags="@stage2_werror_flag@" ;
- stage_make_flags="" ; };
+ stage_cflags="$(BOOT_CFLAGS)" ; };
bootstrap_stage = {
id=profile ; prev=1 ;
stage_configure_flags="@stage2_werror_flag@" ;
- stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"' ; };
+ stage_cflags='$(BOOT_CFLAGS) -fprofile-generate' ; };
bootstrap_stage = {
id=feedback ; prev=profile ;
bootstrap_target=profiledbootstrap ;
stage_configure_flags="@stage2_werror_flag@" ;
- stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-use"' ; };
+ stage_cflags='$(BOOT_CFLAGS) -fprofile-use' ; };
diff --git a/Makefile.in b/Makefile.in
index 4c6625e1372..034b2aa9d64 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -188,7 +188,6 @@ POSTSTAGE1_HOST_EXPORTS = \
$$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ \
-B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
- CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
# Target libraries are put under this directory:
@@ -552,8 +551,6 @@ X11_FLAGS_TO_PASS = \
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
- CFLAGS="$(BOOT_CFLAGS)" \
- LIBCFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
"`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
@@ -4784,6 +4781,8 @@ configure-stage1-bfd:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
cd $(HOST_SUBDIR)/bfd || exit 1; \
@@ -4813,6 +4812,8 @@ configure-stage2-bfd:
test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
cd $(HOST_SUBDIR)/bfd || exit 1; \
@@ -4842,6 +4843,8 @@ configure-stage3-bfd:
test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
cd $(HOST_SUBDIR)/bfd || exit 1; \
@@ -4871,6 +4874,8 @@ configure-stage4-bfd:
test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
cd $(HOST_SUBDIR)/bfd || exit 1; \
@@ -4900,6 +4905,8 @@ configure-stageprofile-bfd:
test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
cd $(HOST_SUBDIR)/bfd || exit 1; \
@@ -4929,6 +4936,8 @@ configure-stagefeedback-bfd:
test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
cd $(HOST_SUBDIR)/bfd || exit 1; \
@@ -4982,7 +4991,8 @@ all-stage1-bfd: configure-stage1-bfd
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/bfd && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-bfd)
maybe-clean-stage1-bfd: clean-stage1-bfd
@@ -4996,7 +5006,7 @@ clean-stage1-bfd:
fi; \
cd $(HOST_SUBDIR)/bfd && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif bfd-bootstrap
@@ -5015,7 +5025,8 @@ all-stage2-bfd: configure-stage2-bfd
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/bfd && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-bfd)
maybe-clean-stage2-bfd: clean-stage2-bfd
@@ -5030,7 +5041,7 @@ clean-stage2-bfd:
cd $(HOST_SUBDIR)/bfd && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif bfd-bootstrap
@@ -5049,7 +5060,8 @@ all-stage3-bfd: configure-stage3-bfd
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/bfd && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-bfd)
maybe-clean-stage3-bfd: clean-stage3-bfd
@@ -5064,7 +5076,7 @@ clean-stage3-bfd:
cd $(HOST_SUBDIR)/bfd && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif bfd-bootstrap
@@ -5083,7 +5095,8 @@ all-stage4-bfd: configure-stage4-bfd
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/bfd && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-bfd)
maybe-clean-stage4-bfd: clean-stage4-bfd
@@ -5098,7 +5111,7 @@ clean-stage4-bfd:
cd $(HOST_SUBDIR)/bfd && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif bfd-bootstrap
@@ -5117,7 +5130,8 @@ all-stageprofile-bfd: configure-stageprofile-bfd
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/bfd && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-bfd)
maybe-clean-stageprofile-bfd: clean-stageprofile-bfd
@@ -5132,7 +5146,7 @@ clean-stageprofile-bfd:
cd $(HOST_SUBDIR)/bfd && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif bfd-bootstrap
@@ -5151,7 +5165,8 @@ all-stagefeedback-bfd: configure-stagefeedback-bfd
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/bfd && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-bfd)
maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd
@@ -5166,7 +5181,7 @@ clean-stagefeedback-bfd:
cd $(HOST_SUBDIR)/bfd && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif bfd-bootstrap
@@ -5572,6 +5587,8 @@ configure-stage1-opcodes:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
cd $(HOST_SUBDIR)/opcodes || exit 1; \
@@ -5601,6 +5618,8 @@ configure-stage2-opcodes:
test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
cd $(HOST_SUBDIR)/opcodes || exit 1; \
@@ -5630,6 +5649,8 @@ configure-stage3-opcodes:
test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
cd $(HOST_SUBDIR)/opcodes || exit 1; \
@@ -5659,6 +5680,8 @@ configure-stage4-opcodes:
test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
cd $(HOST_SUBDIR)/opcodes || exit 1; \
@@ -5688,6 +5711,8 @@ configure-stageprofile-opcodes:
test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
cd $(HOST_SUBDIR)/opcodes || exit 1; \
@@ -5717,6 +5742,8 @@ configure-stagefeedback-opcodes:
test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
cd $(HOST_SUBDIR)/opcodes || exit 1; \
@@ -5770,7 +5797,8 @@ all-stage1-opcodes: configure-stage1-opcodes
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/opcodes && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-opcodes)
maybe-clean-stage1-opcodes: clean-stage1-opcodes
@@ -5784,7 +5812,7 @@ clean-stage1-opcodes:
fi; \
cd $(HOST_SUBDIR)/opcodes && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif opcodes-bootstrap
@@ -5803,7 +5831,8 @@ all-stage2-opcodes: configure-stage2-opcodes
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/opcodes && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-opcodes)
maybe-clean-stage2-opcodes: clean-stage2-opcodes
@@ -5818,7 +5847,7 @@ clean-stage2-opcodes:
cd $(HOST_SUBDIR)/opcodes && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif opcodes-bootstrap
@@ -5837,7 +5866,8 @@ all-stage3-opcodes: configure-stage3-opcodes
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/opcodes && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-opcodes)
maybe-clean-stage3-opcodes: clean-stage3-opcodes
@@ -5852,7 +5882,7 @@ clean-stage3-opcodes:
cd $(HOST_SUBDIR)/opcodes && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif opcodes-bootstrap
@@ -5871,7 +5901,8 @@ all-stage4-opcodes: configure-stage4-opcodes
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/opcodes && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-opcodes)
maybe-clean-stage4-opcodes: clean-stage4-opcodes
@@ -5886,7 +5917,7 @@ clean-stage4-opcodes:
cd $(HOST_SUBDIR)/opcodes && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif opcodes-bootstrap
@@ -5905,7 +5936,8 @@ all-stageprofile-opcodes: configure-stageprofile-opcodes
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/opcodes && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-opcodes)
maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes
@@ -5920,7 +5952,7 @@ clean-stageprofile-opcodes:
cd $(HOST_SUBDIR)/opcodes && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif opcodes-bootstrap
@@ -5939,7 +5971,8 @@ all-stagefeedback-opcodes: configure-stagefeedback-opcodes
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/opcodes && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-opcodes)
maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes
@@ -5954,7 +5987,7 @@ clean-stagefeedback-opcodes:
cd $(HOST_SUBDIR)/opcodes && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif opcodes-bootstrap
@@ -6360,6 +6393,8 @@ configure-stage1-binutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
cd $(HOST_SUBDIR)/binutils || exit 1; \
@@ -6389,6 +6424,8 @@ configure-stage2-binutils:
test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
cd $(HOST_SUBDIR)/binutils || exit 1; \
@@ -6418,6 +6455,8 @@ configure-stage3-binutils:
test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
cd $(HOST_SUBDIR)/binutils || exit 1; \
@@ -6447,6 +6486,8 @@ configure-stage4-binutils:
test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
cd $(HOST_SUBDIR)/binutils || exit 1; \
@@ -6476,6 +6517,8 @@ configure-stageprofile-binutils:
test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
cd $(HOST_SUBDIR)/binutils || exit 1; \
@@ -6505,6 +6548,8 @@ configure-stagefeedback-binutils:
test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
cd $(HOST_SUBDIR)/binutils || exit 1; \
@@ -6558,7 +6603,8 @@ all-stage1-binutils: configure-stage1-binutils
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/binutils && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-binutils)
maybe-clean-stage1-binutils: clean-stage1-binutils
@@ -6572,7 +6618,7 @@ clean-stage1-binutils:
fi; \
cd $(HOST_SUBDIR)/binutils && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif binutils-bootstrap
@@ -6591,7 +6637,8 @@ all-stage2-binutils: configure-stage2-binutils
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/binutils && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-binutils)
maybe-clean-stage2-binutils: clean-stage2-binutils
@@ -6606,7 +6653,7 @@ clean-stage2-binutils:
cd $(HOST_SUBDIR)/binutils && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif binutils-bootstrap
@@ -6625,7 +6672,8 @@ all-stage3-binutils: configure-stage3-binutils
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/binutils && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-binutils)
maybe-clean-stage3-binutils: clean-stage3-binutils
@@ -6640,7 +6688,7 @@ clean-stage3-binutils:
cd $(HOST_SUBDIR)/binutils && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif binutils-bootstrap
@@ -6659,7 +6707,8 @@ all-stage4-binutils: configure-stage4-binutils
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/binutils && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-binutils)
maybe-clean-stage4-binutils: clean-stage4-binutils
@@ -6674,7 +6723,7 @@ clean-stage4-binutils:
cd $(HOST_SUBDIR)/binutils && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif binutils-bootstrap
@@ -6693,7 +6742,8 @@ all-stageprofile-binutils: configure-stageprofile-binutils
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/binutils && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-binutils)
maybe-clean-stageprofile-binutils: clean-stageprofile-binutils
@@ -6708,7 +6758,7 @@ clean-stageprofile-binutils:
cd $(HOST_SUBDIR)/binutils && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif binutils-bootstrap
@@ -6727,7 +6777,8 @@ all-stagefeedback-binutils: configure-stagefeedback-binutils
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/binutils && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-binutils)
maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils
@@ -6742,7 +6793,7 @@ clean-stagefeedback-binutils:
cd $(HOST_SUBDIR)/binutils && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif binutils-bootstrap
@@ -12650,6 +12701,8 @@ configure-stage1-gas:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
cd $(HOST_SUBDIR)/gas || exit 1; \
@@ -12679,6 +12732,8 @@ configure-stage2-gas:
test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
cd $(HOST_SUBDIR)/gas || exit 1; \
@@ -12708,6 +12763,8 @@ configure-stage3-gas:
test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
cd $(HOST_SUBDIR)/gas || exit 1; \
@@ -12737,6 +12794,8 @@ configure-stage4-gas:
test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
cd $(HOST_SUBDIR)/gas || exit 1; \
@@ -12766,6 +12825,8 @@ configure-stageprofile-gas:
test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
cd $(HOST_SUBDIR)/gas || exit 1; \
@@ -12795,6 +12856,8 @@ configure-stagefeedback-gas:
test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
cd $(HOST_SUBDIR)/gas || exit 1; \
@@ -12848,7 +12911,8 @@ all-stage1-gas: configure-stage1-gas
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gas && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-gas)
maybe-clean-stage1-gas: clean-stage1-gas
@@ -12862,7 +12926,7 @@ clean-stage1-gas:
fi; \
cd $(HOST_SUBDIR)/gas && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif gas-bootstrap
@@ -12881,7 +12945,8 @@ all-stage2-gas: configure-stage2-gas
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gas && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-gas)
maybe-clean-stage2-gas: clean-stage2-gas
@@ -12896,7 +12961,7 @@ clean-stage2-gas:
cd $(HOST_SUBDIR)/gas && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif gas-bootstrap
@@ -12915,7 +12980,8 @@ all-stage3-gas: configure-stage3-gas
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gas && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-gas)
maybe-clean-stage3-gas: clean-stage3-gas
@@ -12930,7 +12996,7 @@ clean-stage3-gas:
cd $(HOST_SUBDIR)/gas && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif gas-bootstrap
@@ -12949,7 +13015,8 @@ all-stage4-gas: configure-stage4-gas
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gas && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-gas)
maybe-clean-stage4-gas: clean-stage4-gas
@@ -12964,7 +13031,7 @@ clean-stage4-gas:
cd $(HOST_SUBDIR)/gas && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif gas-bootstrap
@@ -12983,7 +13050,8 @@ all-stageprofile-gas: configure-stageprofile-gas
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gas && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-gas)
maybe-clean-stageprofile-gas: clean-stageprofile-gas
@@ -12998,7 +13066,7 @@ clean-stageprofile-gas:
cd $(HOST_SUBDIR)/gas && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif gas-bootstrap
@@ -13017,7 +13085,8 @@ all-stagefeedback-gas: configure-stagefeedback-gas
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gas && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-gas)
maybe-clean-stagefeedback-gas: clean-stagefeedback-gas
@@ -13032,7 +13101,7 @@ clean-stagefeedback-gas:
cd $(HOST_SUBDIR)/gas && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif gas-bootstrap
@@ -13438,6 +13507,8 @@ configure-stage1-gcc:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
cd $(HOST_SUBDIR)/gcc || exit 1; \
@@ -13467,6 +13538,8 @@ configure-stage2-gcc:
test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
cd $(HOST_SUBDIR)/gcc || exit 1; \
@@ -13496,6 +13569,8 @@ configure-stage3-gcc:
test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
cd $(HOST_SUBDIR)/gcc || exit 1; \
@@ -13525,6 +13600,8 @@ configure-stage4-gcc:
test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
cd $(HOST_SUBDIR)/gcc || exit 1; \
@@ -13554,6 +13631,8 @@ configure-stageprofile-gcc:
test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
cd $(HOST_SUBDIR)/gcc || exit 1; \
@@ -13583,6 +13662,8 @@ configure-stagefeedback-gcc:
test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
cd $(HOST_SUBDIR)/gcc || exit 1; \
@@ -13636,7 +13717,8 @@ all-stage1-gcc: configure-stage1-gcc
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gcc && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \
$(TARGET-stage1-gcc)
maybe-clean-stage1-gcc: clean-stage1-gcc
@@ -13650,7 +13732,7 @@ clean-stage1-gcc:
fi; \
cd $(HOST_SUBDIR)/gcc && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean
+ $(EXTRA_GCC_FLAGS) clean
@endif gcc-bootstrap
@@ -13669,7 +13751,8 @@ all-stage2-gcc: configure-stage2-gcc
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gcc && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
$(TARGET-stage2-gcc)
maybe-clean-stage2-gcc: clean-stage2-gcc
@@ -13684,7 +13767,7 @@ clean-stage2-gcc:
cd $(HOST_SUBDIR)/gcc && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- $(EXTRA_GCC_FLAGS) clean
+ $(EXTRA_GCC_FLAGS) clean
@endif gcc-bootstrap
@@ -13703,7 +13786,8 @@ all-stage3-gcc: configure-stage3-gcc
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gcc && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
$(TARGET-stage3-gcc)
maybe-clean-stage3-gcc: clean-stage3-gcc
@@ -13718,7 +13802,7 @@ clean-stage3-gcc:
cd $(HOST_SUBDIR)/gcc && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- $(EXTRA_GCC_FLAGS) clean
+ $(EXTRA_GCC_FLAGS) clean
@endif gcc-bootstrap
@@ -13737,7 +13821,8 @@ all-stage4-gcc: configure-stage4-gcc
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gcc && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
$(TARGET-stage4-gcc)
maybe-clean-stage4-gcc: clean-stage4-gcc
@@ -13752,7 +13837,7 @@ clean-stage4-gcc:
cd $(HOST_SUBDIR)/gcc && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- $(EXTRA_GCC_FLAGS) clean
+ $(EXTRA_GCC_FLAGS) clean
@endif gcc-bootstrap
@@ -13771,7 +13856,8 @@ all-stageprofile-gcc: configure-stageprofile-gcc
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gcc && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
$(TARGET-stageprofile-gcc)
maybe-clean-stageprofile-gcc: clean-stageprofile-gcc
@@ -13786,7 +13872,7 @@ clean-stageprofile-gcc:
cd $(HOST_SUBDIR)/gcc && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean
+ $(EXTRA_GCC_FLAGS) clean
@endif gcc-bootstrap
@@ -13805,7 +13891,8 @@ all-stagefeedback-gcc: configure-stagefeedback-gcc
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gcc && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
$(TARGET-stagefeedback-gcc)
maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc
@@ -13820,7 +13907,7 @@ clean-stagefeedback-gcc:
cd $(HOST_SUBDIR)/gcc && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean
+ $(EXTRA_GCC_FLAGS) clean
@endif gcc-bootstrap
@@ -15074,6 +15161,8 @@ configure-stage1-gmp:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/gmp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \
cd $(HOST_SUBDIR)/gmp || exit 1; \
@@ -15103,6 +15192,8 @@ configure-stage2-gmp:
test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/gmp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \
cd $(HOST_SUBDIR)/gmp || exit 1; \
@@ -15132,6 +15223,8 @@ configure-stage3-gmp:
test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/gmp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \
cd $(HOST_SUBDIR)/gmp || exit 1; \
@@ -15161,6 +15254,8 @@ configure-stage4-gmp:
test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/gmp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \
cd $(HOST_SUBDIR)/gmp || exit 1; \
@@ -15190,6 +15285,8 @@ configure-stageprofile-gmp:
test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/gmp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \
cd $(HOST_SUBDIR)/gmp || exit 1; \
@@ -15219,6 +15316,8 @@ configure-stagefeedback-gmp:
test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/gmp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \
cd $(HOST_SUBDIR)/gmp || exit 1; \
@@ -15272,7 +15371,8 @@ all-stage1-gmp: configure-stage1-gmp
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gmp && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-gmp)
maybe-clean-stage1-gmp: clean-stage1-gmp
@@ -15286,7 +15386,7 @@ clean-stage1-gmp:
fi; \
cd $(HOST_SUBDIR)/gmp && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif gmp-bootstrap
@@ -15305,7 +15405,8 @@ all-stage2-gmp: configure-stage2-gmp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gmp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-gmp)
maybe-clean-stage2-gmp: clean-stage2-gmp
@@ -15320,7 +15421,7 @@ clean-stage2-gmp:
cd $(HOST_SUBDIR)/gmp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif gmp-bootstrap
@@ -15339,7 +15440,8 @@ all-stage3-gmp: configure-stage3-gmp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gmp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-gmp)
maybe-clean-stage3-gmp: clean-stage3-gmp
@@ -15354,7 +15456,7 @@ clean-stage3-gmp:
cd $(HOST_SUBDIR)/gmp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif gmp-bootstrap
@@ -15373,7 +15475,8 @@ all-stage4-gmp: configure-stage4-gmp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gmp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-gmp)
maybe-clean-stage4-gmp: clean-stage4-gmp
@@ -15388,7 +15491,7 @@ clean-stage4-gmp:
cd $(HOST_SUBDIR)/gmp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif gmp-bootstrap
@@ -15407,7 +15510,8 @@ all-stageprofile-gmp: configure-stageprofile-gmp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gmp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-gmp)
maybe-clean-stageprofile-gmp: clean-stageprofile-gmp
@@ -15422,7 +15526,7 @@ clean-stageprofile-gmp:
cd $(HOST_SUBDIR)/gmp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif gmp-bootstrap
@@ -15441,7 +15545,8 @@ all-stagefeedback-gmp: configure-stagefeedback-gmp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/gmp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-gmp)
maybe-clean-stagefeedback-gmp: clean-stagefeedback-gmp
@@ -15456,7 +15561,7 @@ clean-stagefeedback-gmp:
cd $(HOST_SUBDIR)/gmp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif gmp-bootstrap
@@ -15856,6 +15961,8 @@ configure-stage1-mpfr:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/mpfr ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \
cd $(HOST_SUBDIR)/mpfr || exit 1; \
@@ -15885,6 +15992,8 @@ configure-stage2-mpfr:
test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/mpfr ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \
cd $(HOST_SUBDIR)/mpfr || exit 1; \
@@ -15914,6 +16023,8 @@ configure-stage3-mpfr:
test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/mpfr ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \
cd $(HOST_SUBDIR)/mpfr || exit 1; \
@@ -15943,6 +16054,8 @@ configure-stage4-mpfr:
test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/mpfr ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \
cd $(HOST_SUBDIR)/mpfr || exit 1; \
@@ -15972,6 +16085,8 @@ configure-stageprofile-mpfr:
test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/mpfr ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \
cd $(HOST_SUBDIR)/mpfr || exit 1; \
@@ -16001,6 +16116,8 @@ configure-stagefeedback-mpfr:
test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/mpfr ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \
cd $(HOST_SUBDIR)/mpfr || exit 1; \
@@ -16054,7 +16171,8 @@ all-stage1-mpfr: configure-stage1-mpfr
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/mpfr && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-mpfr)
maybe-clean-stage1-mpfr: clean-stage1-mpfr
@@ -16068,7 +16186,7 @@ clean-stage1-mpfr:
fi; \
cd $(HOST_SUBDIR)/mpfr && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif mpfr-bootstrap
@@ -16087,7 +16205,8 @@ all-stage2-mpfr: configure-stage2-mpfr
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/mpfr && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-mpfr)
maybe-clean-stage2-mpfr: clean-stage2-mpfr
@@ -16102,7 +16221,7 @@ clean-stage2-mpfr:
cd $(HOST_SUBDIR)/mpfr && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif mpfr-bootstrap
@@ -16121,7 +16240,8 @@ all-stage3-mpfr: configure-stage3-mpfr
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/mpfr && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-mpfr)
maybe-clean-stage3-mpfr: clean-stage3-mpfr
@@ -16136,7 +16256,7 @@ clean-stage3-mpfr:
cd $(HOST_SUBDIR)/mpfr && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif mpfr-bootstrap
@@ -16155,7 +16275,8 @@ all-stage4-mpfr: configure-stage4-mpfr
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/mpfr && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-mpfr)
maybe-clean-stage4-mpfr: clean-stage4-mpfr
@@ -16170,7 +16291,7 @@ clean-stage4-mpfr:
cd $(HOST_SUBDIR)/mpfr && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif mpfr-bootstrap
@@ -16189,7 +16310,8 @@ all-stageprofile-mpfr: configure-stageprofile-mpfr
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/mpfr && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-mpfr)
maybe-clean-stageprofile-mpfr: clean-stageprofile-mpfr
@@ -16204,7 +16326,7 @@ clean-stageprofile-mpfr:
cd $(HOST_SUBDIR)/mpfr && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif mpfr-bootstrap
@@ -16223,7 +16345,8 @@ all-stagefeedback-mpfr: configure-stagefeedback-mpfr
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/mpfr && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-mpfr)
maybe-clean-stagefeedback-mpfr: clean-stagefeedback-mpfr
@@ -16238,7 +16361,7 @@ clean-stagefeedback-mpfr:
cd $(HOST_SUBDIR)/mpfr && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif mpfr-bootstrap
@@ -18758,6 +18881,8 @@ configure-stage1-intl:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
cd $(HOST_SUBDIR)/intl || exit 1; \
@@ -18787,6 +18912,8 @@ configure-stage2-intl:
test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
cd $(HOST_SUBDIR)/intl || exit 1; \
@@ -18816,6 +18943,8 @@ configure-stage3-intl:
test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
cd $(HOST_SUBDIR)/intl || exit 1; \
@@ -18845,6 +18974,8 @@ configure-stage4-intl:
test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
cd $(HOST_SUBDIR)/intl || exit 1; \
@@ -18874,6 +19005,8 @@ configure-stageprofile-intl:
test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
cd $(HOST_SUBDIR)/intl || exit 1; \
@@ -18903,6 +19036,8 @@ configure-stagefeedback-intl:
test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
cd $(HOST_SUBDIR)/intl || exit 1; \
@@ -18956,7 +19091,8 @@ all-stage1-intl: configure-stage1-intl
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/intl && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-intl)
maybe-clean-stage1-intl: clean-stage1-intl
@@ -18970,7 +19106,7 @@ clean-stage1-intl:
fi; \
cd $(HOST_SUBDIR)/intl && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif intl-bootstrap
@@ -18989,7 +19125,8 @@ all-stage2-intl: configure-stage2-intl
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/intl && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-intl)
maybe-clean-stage2-intl: clean-stage2-intl
@@ -19004,7 +19141,7 @@ clean-stage2-intl:
cd $(HOST_SUBDIR)/intl && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif intl-bootstrap
@@ -19023,7 +19160,8 @@ all-stage3-intl: configure-stage3-intl
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/intl && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-intl)
maybe-clean-stage3-intl: clean-stage3-intl
@@ -19038,7 +19176,7 @@ clean-stage3-intl:
cd $(HOST_SUBDIR)/intl && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif intl-bootstrap
@@ -19057,7 +19195,8 @@ all-stage4-intl: configure-stage4-intl
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/intl && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-intl)
maybe-clean-stage4-intl: clean-stage4-intl
@@ -19072,7 +19211,7 @@ clean-stage4-intl:
cd $(HOST_SUBDIR)/intl && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif intl-bootstrap
@@ -19091,7 +19230,8 @@ all-stageprofile-intl: configure-stageprofile-intl
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/intl && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-intl)
maybe-clean-stageprofile-intl: clean-stageprofile-intl
@@ -19106,7 +19246,7 @@ clean-stageprofile-intl:
cd $(HOST_SUBDIR)/intl && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif intl-bootstrap
@@ -19125,7 +19265,8 @@ all-stagefeedback-intl: configure-stagefeedback-intl
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/intl && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-intl)
maybe-clean-stagefeedback-intl: clean-stagefeedback-intl
@@ -19140,7 +19281,7 @@ clean-stagefeedback-intl:
cd $(HOST_SUBDIR)/intl && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif intl-bootstrap
@@ -20379,6 +20520,8 @@ configure-stage1-ld:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
cd $(HOST_SUBDIR)/ld || exit 1; \
@@ -20408,6 +20551,8 @@ configure-stage2-ld:
test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
cd $(HOST_SUBDIR)/ld || exit 1; \
@@ -20437,6 +20582,8 @@ configure-stage3-ld:
test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
cd $(HOST_SUBDIR)/ld || exit 1; \
@@ -20466,6 +20613,8 @@ configure-stage4-ld:
test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
cd $(HOST_SUBDIR)/ld || exit 1; \
@@ -20495,6 +20644,8 @@ configure-stageprofile-ld:
test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
cd $(HOST_SUBDIR)/ld || exit 1; \
@@ -20524,6 +20675,8 @@ configure-stagefeedback-ld:
test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
cd $(HOST_SUBDIR)/ld || exit 1; \
@@ -20577,7 +20730,8 @@ all-stage1-ld: configure-stage1-ld
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/ld && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-ld)
maybe-clean-stage1-ld: clean-stage1-ld
@@ -20591,7 +20745,7 @@ clean-stage1-ld:
fi; \
cd $(HOST_SUBDIR)/ld && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif ld-bootstrap
@@ -20610,7 +20764,8 @@ all-stage2-ld: configure-stage2-ld
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/ld && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-ld)
maybe-clean-stage2-ld: clean-stage2-ld
@@ -20625,7 +20780,7 @@ clean-stage2-ld:
cd $(HOST_SUBDIR)/ld && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif ld-bootstrap
@@ -20644,7 +20799,8 @@ all-stage3-ld: configure-stage3-ld
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/ld && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-ld)
maybe-clean-stage3-ld: clean-stage3-ld
@@ -20659,7 +20815,7 @@ clean-stage3-ld:
cd $(HOST_SUBDIR)/ld && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif ld-bootstrap
@@ -20678,7 +20834,8 @@ all-stage4-ld: configure-stage4-ld
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/ld && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-ld)
maybe-clean-stage4-ld: clean-stage4-ld
@@ -20693,7 +20850,7 @@ clean-stage4-ld:
cd $(HOST_SUBDIR)/ld && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif ld-bootstrap
@@ -20712,7 +20869,8 @@ all-stageprofile-ld: configure-stageprofile-ld
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/ld && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-ld)
maybe-clean-stageprofile-ld: clean-stageprofile-ld
@@ -20727,7 +20885,7 @@ clean-stageprofile-ld:
cd $(HOST_SUBDIR)/ld && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif ld-bootstrap
@@ -20746,7 +20904,8 @@ all-stagefeedback-ld: configure-stagefeedback-ld
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/ld && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-ld)
maybe-clean-stagefeedback-ld: clean-stagefeedback-ld
@@ -20761,7 +20920,7 @@ clean-stagefeedback-ld:
cd $(HOST_SUBDIR)/ld && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif ld-bootstrap
@@ -21167,6 +21326,8 @@ configure-stage1-libcpp:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
cd $(HOST_SUBDIR)/libcpp || exit 1; \
@@ -21196,6 +21357,8 @@ configure-stage2-libcpp:
test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
cd $(HOST_SUBDIR)/libcpp || exit 1; \
@@ -21225,6 +21388,8 @@ configure-stage3-libcpp:
test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
cd $(HOST_SUBDIR)/libcpp || exit 1; \
@@ -21254,6 +21419,8 @@ configure-stage4-libcpp:
test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
cd $(HOST_SUBDIR)/libcpp || exit 1; \
@@ -21283,6 +21450,8 @@ configure-stageprofile-libcpp:
test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
cd $(HOST_SUBDIR)/libcpp || exit 1; \
@@ -21312,6 +21481,8 @@ configure-stagefeedback-libcpp:
test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
cd $(HOST_SUBDIR)/libcpp || exit 1; \
@@ -21365,7 +21536,8 @@ all-stage1-libcpp: configure-stage1-libcpp
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libcpp && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-libcpp)
maybe-clean-stage1-libcpp: clean-stage1-libcpp
@@ -21379,7 +21551,7 @@ clean-stage1-libcpp:
fi; \
cd $(HOST_SUBDIR)/libcpp && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif libcpp-bootstrap
@@ -21398,7 +21570,8 @@ all-stage2-libcpp: configure-stage2-libcpp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libcpp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-libcpp)
maybe-clean-stage2-libcpp: clean-stage2-libcpp
@@ -21413,7 +21586,7 @@ clean-stage2-libcpp:
cd $(HOST_SUBDIR)/libcpp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libcpp-bootstrap
@@ -21432,7 +21605,8 @@ all-stage3-libcpp: configure-stage3-libcpp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libcpp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-libcpp)
maybe-clean-stage3-libcpp: clean-stage3-libcpp
@@ -21447,7 +21621,7 @@ clean-stage3-libcpp:
cd $(HOST_SUBDIR)/libcpp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libcpp-bootstrap
@@ -21466,7 +21640,8 @@ all-stage4-libcpp: configure-stage4-libcpp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libcpp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-libcpp)
maybe-clean-stage4-libcpp: clean-stage4-libcpp
@@ -21481,7 +21656,7 @@ clean-stage4-libcpp:
cd $(HOST_SUBDIR)/libcpp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libcpp-bootstrap
@@ -21500,7 +21675,8 @@ all-stageprofile-libcpp: configure-stageprofile-libcpp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libcpp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-libcpp)
maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp
@@ -21515,7 +21691,7 @@ clean-stageprofile-libcpp:
cd $(HOST_SUBDIR)/libcpp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif libcpp-bootstrap
@@ -21534,7 +21710,8 @@ all-stagefeedback-libcpp: configure-stagefeedback-libcpp
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libcpp && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-libcpp)
maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp
@@ -21549,7 +21726,7 @@ clean-stagefeedback-libcpp:
cd $(HOST_SUBDIR)/libcpp && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif libcpp-bootstrap
@@ -21955,6 +22132,8 @@ configure-stage1-libdecnumber:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/libdecnumber ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \
cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
@@ -21984,6 +22163,8 @@ configure-stage2-libdecnumber:
test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/libdecnumber ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \
cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
@@ -22013,6 +22194,8 @@ configure-stage3-libdecnumber:
test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/libdecnumber ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \
cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
@@ -22042,6 +22225,8 @@ configure-stage4-libdecnumber:
test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/libdecnumber ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \
cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
@@ -22071,6 +22256,8 @@ configure-stageprofile-libdecnumber:
test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/libdecnumber ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \
cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
@@ -22100,6 +22287,8 @@ configure-stagefeedback-libdecnumber:
test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/libdecnumber ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \
cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
@@ -22153,7 +22342,8 @@ all-stage1-libdecnumber: configure-stage1-libdecnumber
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libdecnumber && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-libdecnumber)
maybe-clean-stage1-libdecnumber: clean-stage1-libdecnumber
@@ -22167,7 +22357,7 @@ clean-stage1-libdecnumber:
fi; \
cd $(HOST_SUBDIR)/libdecnumber && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif libdecnumber-bootstrap
@@ -22186,7 +22376,8 @@ all-stage2-libdecnumber: configure-stage2-libdecnumber
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libdecnumber && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-libdecnumber)
maybe-clean-stage2-libdecnumber: clean-stage2-libdecnumber
@@ -22201,7 +22392,7 @@ clean-stage2-libdecnumber:
cd $(HOST_SUBDIR)/libdecnumber && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libdecnumber-bootstrap
@@ -22220,7 +22411,8 @@ all-stage3-libdecnumber: configure-stage3-libdecnumber
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libdecnumber && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-libdecnumber)
maybe-clean-stage3-libdecnumber: clean-stage3-libdecnumber
@@ -22235,7 +22427,7 @@ clean-stage3-libdecnumber:
cd $(HOST_SUBDIR)/libdecnumber && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libdecnumber-bootstrap
@@ -22254,7 +22446,8 @@ all-stage4-libdecnumber: configure-stage4-libdecnumber
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libdecnumber && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-libdecnumber)
maybe-clean-stage4-libdecnumber: clean-stage4-libdecnumber
@@ -22269,7 +22462,7 @@ clean-stage4-libdecnumber:
cd $(HOST_SUBDIR)/libdecnumber && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libdecnumber-bootstrap
@@ -22288,7 +22481,8 @@ all-stageprofile-libdecnumber: configure-stageprofile-libdecnumber
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libdecnumber && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-libdecnumber)
maybe-clean-stageprofile-libdecnumber: clean-stageprofile-libdecnumber
@@ -22303,7 +22497,7 @@ clean-stageprofile-libdecnumber:
cd $(HOST_SUBDIR)/libdecnumber && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif libdecnumber-bootstrap
@@ -22322,7 +22516,8 @@ all-stagefeedback-libdecnumber: configure-stagefeedback-libdecnumber
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libdecnumber && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-libdecnumber)
maybe-clean-stagefeedback-libdecnumber: clean-stagefeedback-libdecnumber
@@ -22337,7 +22532,7 @@ clean-stagefeedback-libdecnumber:
cd $(HOST_SUBDIR)/libdecnumber && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif libdecnumber-bootstrap
@@ -23167,6 +23362,8 @@ configure-stage1-libiberty:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
cd $(HOST_SUBDIR)/libiberty || exit 1; \
@@ -23196,6 +23393,8 @@ configure-stage2-libiberty:
test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
cd $(HOST_SUBDIR)/libiberty || exit 1; \
@@ -23225,6 +23424,8 @@ configure-stage3-libiberty:
test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
cd $(HOST_SUBDIR)/libiberty || exit 1; \
@@ -23254,6 +23455,8 @@ configure-stage4-libiberty:
test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
cd $(HOST_SUBDIR)/libiberty || exit 1; \
@@ -23283,6 +23486,8 @@ configure-stageprofile-libiberty:
test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
cd $(HOST_SUBDIR)/libiberty || exit 1; \
@@ -23312,6 +23517,8 @@ configure-stagefeedback-libiberty:
test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
cd $(HOST_SUBDIR)/libiberty || exit 1; \
@@ -23365,7 +23572,8 @@ all-stage1-libiberty: configure-stage1-libiberty
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libiberty && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-libiberty)
maybe-clean-stage1-libiberty: clean-stage1-libiberty
@@ -23379,7 +23587,7 @@ clean-stage1-libiberty:
fi; \
cd $(HOST_SUBDIR)/libiberty && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif libiberty-bootstrap
@@ -23398,7 +23606,8 @@ all-stage2-libiberty: configure-stage2-libiberty
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libiberty && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-libiberty)
maybe-clean-stage2-libiberty: clean-stage2-libiberty
@@ -23413,7 +23622,7 @@ clean-stage2-libiberty:
cd $(HOST_SUBDIR)/libiberty && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libiberty-bootstrap
@@ -23432,7 +23641,8 @@ all-stage3-libiberty: configure-stage3-libiberty
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libiberty && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-libiberty)
maybe-clean-stage3-libiberty: clean-stage3-libiberty
@@ -23447,7 +23657,7 @@ clean-stage3-libiberty:
cd $(HOST_SUBDIR)/libiberty && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libiberty-bootstrap
@@ -23466,7 +23676,8 @@ all-stage4-libiberty: configure-stage4-libiberty
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libiberty && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-libiberty)
maybe-clean-stage4-libiberty: clean-stage4-libiberty
@@ -23481,7 +23692,7 @@ clean-stage4-libiberty:
cd $(HOST_SUBDIR)/libiberty && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif libiberty-bootstrap
@@ -23500,7 +23711,8 @@ all-stageprofile-libiberty: configure-stageprofile-libiberty
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libiberty && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-libiberty)
maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty
@@ -23515,7 +23727,7 @@ clean-stageprofile-libiberty:
cd $(HOST_SUBDIR)/libiberty && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif libiberty-bootstrap
@@ -23534,7 +23746,8 @@ all-stagefeedback-libiberty: configure-stagefeedback-libiberty
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/libiberty && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-libiberty)
maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty
@@ -23549,7 +23762,7 @@ clean-stagefeedback-libiberty:
cd $(HOST_SUBDIR)/libiberty && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif libiberty-bootstrap
@@ -33686,6 +33899,8 @@ configure-stage1-zlib:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
cd $(HOST_SUBDIR)/zlib || exit 1; \
@@ -33715,6 +33930,8 @@ configure-stage2-zlib:
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
cd $(HOST_SUBDIR)/zlib || exit 1; \
@@ -33744,6 +33961,8 @@ configure-stage3-zlib:
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
cd $(HOST_SUBDIR)/zlib || exit 1; \
@@ -33773,6 +33992,8 @@ configure-stage4-zlib:
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
cd $(HOST_SUBDIR)/zlib || exit 1; \
@@ -33802,6 +34023,8 @@ configure-stageprofile-zlib:
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
cd $(HOST_SUBDIR)/zlib || exit 1; \
@@ -33831,6 +34054,8 @@ configure-stagefeedback-zlib:
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
cd $(HOST_SUBDIR)/zlib || exit 1; \
@@ -33884,7 +34109,8 @@ all-stage1-zlib: configure-stage1-zlib
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
cd $(HOST_SUBDIR)/zlib && \
- $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-zlib)
maybe-clean-stage1-zlib: clean-stage1-zlib
@@ -33898,7 +34124,7 @@ clean-stage1-zlib:
fi; \
cd $(HOST_SUBDIR)/zlib && \
$(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif zlib-bootstrap
@@ -33917,7 +34143,8 @@ all-stage2-zlib: configure-stage2-zlib
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/zlib && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage2-zlib)
maybe-clean-stage2-zlib: clean-stage2-zlib
@@ -33932,7 +34159,7 @@ clean-stage2-zlib:
cd $(HOST_SUBDIR)/zlib && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif zlib-bootstrap
@@ -33951,7 +34178,8 @@ all-stage3-zlib: configure-stage3-zlib
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/zlib && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage3-zlib)
maybe-clean-stage3-zlib: clean-stage3-zlib
@@ -33966,7 +34194,7 @@ clean-stage3-zlib:
cd $(HOST_SUBDIR)/zlib && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif zlib-bootstrap
@@ -33985,7 +34213,8 @@ all-stage4-zlib: configure-stage4-zlib
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/zlib && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stage4-zlib)
maybe-clean-stage4-zlib: clean-stage4-zlib
@@ -34000,7 +34229,7 @@ clean-stage4-zlib:
cd $(HOST_SUBDIR)/zlib && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- clean
+ clean
@endif zlib-bootstrap
@@ -34019,7 +34248,8 @@ all-stageprofile-zlib: configure-stageprofile-zlib
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/zlib && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stageprofile-zlib)
maybe-clean-stageprofile-zlib: clean-stageprofile-zlib
@@ -34034,7 +34264,7 @@ clean-stageprofile-zlib:
cd $(HOST_SUBDIR)/zlib && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif zlib-bootstrap
@@ -34053,7 +34283,8 @@ all-stagefeedback-zlib: configure-stagefeedback-zlib
$(HOST_EXPORTS) \
$(POSTSTAGE1_HOST_EXPORTS) \
cd $(HOST_SUBDIR)/zlib && \
- $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \
$(TARGET-stagefeedback-zlib)
maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib
@@ -34068,7 +34299,7 @@ clean-stagefeedback-zlib:
cd $(HOST_SUBDIR)/zlib && \
$(MAKE) $(FLAGS_TO_PASS) \
$(POSTSTAGE1_FLAGS_TO_PASS) \
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif zlib-bootstrap
@@ -39155,6 +39386,8 @@ configure-stage1-target-libgcc:
fi; \
test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
$(NORMAL_TARGET_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 1 in $(TARGET_SUBDIR)/libgcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \
cd $(TARGET_SUBDIR)/libgcc || exit 1; \
@@ -39196,6 +39429,8 @@ configure-stage2-target-libgcc:
test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
$(NORMAL_TARGET_EXPORTS) \
\
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 2 in $(TARGET_SUBDIR)/libgcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \
cd $(TARGET_SUBDIR)/libgcc || exit 1; \
@@ -39237,6 +39472,8 @@ configure-stage3-target-libgcc:
test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
$(NORMAL_TARGET_EXPORTS) \
\
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 3 in $(TARGET_SUBDIR)/libgcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \
cd $(TARGET_SUBDIR)/libgcc || exit 1; \
@@ -39278,6 +39515,8 @@ configure-stage4-target-libgcc:
test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
$(NORMAL_TARGET_EXPORTS) \
\
+ CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \
echo Configuring stage 4 in $(TARGET_SUBDIR)/libgcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \
cd $(TARGET_SUBDIR)/libgcc || exit 1; \
@@ -39319,6 +39558,8 @@ configure-stageprofile-target-libgcc:
test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
$(NORMAL_TARGET_EXPORTS) \
\
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \
echo Configuring stage profile in $(TARGET_SUBDIR)/libgcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \
cd $(TARGET_SUBDIR)/libgcc || exit 1; \
@@ -39360,6 +39601,8 @@ configure-stagefeedback-target-libgcc:
test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
$(NORMAL_TARGET_EXPORTS) \
\
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \
+ LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \
echo Configuring stage feedback in $(TARGET_SUBDIR)/libgcc ; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \
cd $(TARGET_SUBDIR)/libgcc || exit 1; \
@@ -39413,7 +39656,8 @@ all-stage1-target-libgcc: configure-stage1-target-libgcc
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
cd $(TARGET_SUBDIR)/libgcc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \
$(TARGET-stage1-target-libgcc)
maybe-clean-stage1-target-libgcc: clean-stage1-target-libgcc
@@ -39427,7 +39671,7 @@ clean-stage1-target-libgcc:
fi; \
cd $(TARGET_SUBDIR)/libgcc && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) \
- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean
+ clean
@endif target-libgcc-bootstrap
@@ -39446,7 +39690,8 @@ all-stage2-target-libgcc: configure-stage2-target-libgcc
$(NORMAL_TARGET_EXPORTS) \
\
cd $(TARGET_SUBDIR)/libgcc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \
$(TARGET-stage2-target-libgcc)
maybe-clean-stage2-target-libgcc: clean-stage2-target-libgcc
@@ -39461,7 +39706,7 @@ clean-stage2-target-libgcc:
cd $(TARGET_SUBDIR)/libgcc && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) \
\
- clean
+ clean
@endif target-libgcc-bootstrap
@@ -39480,7 +39725,8 @@ all-stage3-target-libgcc: configure-stage3-target-libgcc
$(NORMAL_TARGET_EXPORTS) \
\
cd $(TARGET_SUBDIR)/libgcc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \
$(TARGET-stage3-target-libgcc)
maybe-clean-stage3-target-libgcc: clean-stage3-target-libgcc
@@ -39495,7 +39741,7 @@ clean-stage3-target-libgcc:
cd $(TARGET_SUBDIR)/libgcc && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) \
\
- clean
+ clean
@endif target-libgcc-bootstrap
@@ -39514,7 +39760,8 @@ all-stage4-target-libgcc: configure-stage4-target-libgcc
$(NORMAL_TARGET_EXPORTS) \
\
cd $(TARGET_SUBDIR)/libgcc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \
$(TARGET-stage4-target-libgcc)
maybe-clean-stage4-target-libgcc: clean-stage4-target-libgcc
@@ -39529,7 +39776,7 @@ clean-stage4-target-libgcc:
cd $(TARGET_SUBDIR)/libgcc && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) \
\
- clean
+ clean
@endif target-libgcc-bootstrap
@@ -39548,7 +39795,8 @@ all-stageprofile-target-libgcc: configure-stageprofile-target-libgcc
$(NORMAL_TARGET_EXPORTS) \
\
cd $(TARGET_SUBDIR)/libgcc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \
$(TARGET-stageprofile-target-libgcc)
maybe-clean-stageprofile-target-libgcc: clean-stageprofile-target-libgcc
@@ -39563,7 +39811,7 @@ clean-stageprofile-target-libgcc:
cd $(TARGET_SUBDIR)/libgcc && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) \
\
- CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean
+ clean
@endif target-libgcc-bootstrap
@@ -39582,7 +39830,8 @@ all-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc
$(NORMAL_TARGET_EXPORTS) \
\
cd $(TARGET_SUBDIR)/libgcc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" \
$(TARGET-stagefeedback-target-libgcc)
maybe-clean-stagefeedback-target-libgcc: clean-stagefeedback-target-libgcc
@@ -39597,7 +39846,7 @@ clean-stagefeedback-target-libgcc:
cd $(TARGET_SUBDIR)/libgcc && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) \
\
- CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean
+ clean
@endif target-libgcc-bootstrap
diff --git a/Makefile.tpl b/Makefile.tpl
index 1502ecf264c..e6438a50b10 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -191,7 +191,6 @@ POSTSTAGE1_HOST_EXPORTS = \
$$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ \
-B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
- CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \
LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
# Target libraries are put under this directory:
@@ -456,8 +455,6 @@ X11_FLAGS_TO_PASS = \
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
- CFLAGS="$(BOOT_CFLAGS)" \
- LIBCFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
"`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
@@ -824,6 +821,8 @@ configure-stage[+id+]-[+prefix+][+module+]:
[+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
[+exports+][+ IF prev +] \
[+poststage1_exports+][+ ENDIF prev +] \
+ CFLAGS="[+stage_cflags+]"; export CFLAGS; \
+ LIBCFLAGS="[+stage_cflags+]"; export LIBCFLAGS; \
echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
cd [+subdir+]/[+module+] || exit 1; \
@@ -880,9 +879,10 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
[+exports+][+ IF prev +] \
[+poststage1_exports+][+ ENDIF prev +] \
cd [+subdir+]/[+module+] && \
- $(MAKE) [+args+] [+ IF prev
- +][+poststage1_args+][+ ENDIF prev
- +] [+stage_make_flags+] [+extra_make_flags+] \
+ $(MAKE) [+args+] \
+ CFLAGS="[+stage_cflags+]" LIBCFLAGS="[+stage_cflags+]" [+
+ IF prev +][+poststage1_args+][+ ENDIF prev
+ +] [+extra_make_flags+] \
$(TARGET-stage[+id+]-[+prefix+][+module+])
maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
@@ -897,7 +897,7 @@ clean-stage[+id+]-[+prefix+][+module+]:
cd [+subdir+]/[+module+] && \
$(MAKE) [+args+] [+ IF prev +] \
[+poststage1_args+] [+ ENDIF prev +] \
- [+stage_make_flags+] [+extra_make_flags+] clean
+ [+extra_make_flags+] clean
@endif [+prefix+][+module+]-bootstrap
[+ ENDFOR bootstrap_stage +]
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 81d486a9274..a3376b1b9fb 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-13 Mark Mitchell <mark@codesourcery.com>
+
+ * gennews (files): Reference GCC 4.2 web pages.
+
2007-04-04 Zack Weinberg <zack@mrtock.ucsd.edu>
* texi2pod.pl: Correct handling of @itemize with no argument.
diff --git a/contrib/gennews b/contrib/gennews
index 7a2a0c5f45e..233d36e6fbc 100755
--- a/contrib/gennews
+++ b/contrib/gennews
@@ -22,7 +22,9 @@
# Boston, MA 02110-1301, USA.
website=http://gcc.gnu.org/
-files="gcc-4.1/index.html gcc-4.1/changes.html
+files="
+ gcc-4.2/index.html gcc-4.2/changes.html
+ gcc-4.1/index.html gcc-4.1/changes.html
gcc-4.0/index.html gcc-4.0/changes.html
gcc-3.4/index.html gcc-3.4/changes.html
gcc-3.3/index.html gcc-3.3/changes.html
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 637315c203b..630e06dffb6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,988 @@
+2007-05-18 DJ Delorie <dj@redhat.com>
+
+ * config/mips/mips.c (mips_offset_within_alignment_p): New.
+ (mips_symbolic_constant_p): Call it for TPREL and DTPREL symbols.
+
+2007-05-18 Uros Bizjak <ubizjak@gmail.com>
+
+ * longlong.h (__x86_64__): Add definitions for add_ssaaaa,
+ sub_ddmmss, umul_ppmm, udiv_qrnnd, count_leading_zeros and
+ count_trailing_zeros.
+ (__i386__): Implement count_leading_zeros using __builtin_clz().
+ Implement count_trailing_zeros usign __builtin_ctz().
+
+2007-05-18 Richard Sandiford <richard@codesourcery.com>
+
+ * config/i386/vxworks.h (ASM_PREFERRED_EH_DATA_FORMAT): Undefine.
+
+2007-05-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/31344
+ * expr.c (emit_move_change_mode): Change mode of push operands here.
+
+2007-05-17 Ian Lance Taylor <iant@google.com>
+
+ PR tree-optimization/31953
+ * tree-vrp.c (set_value_range_to_value): Add equiv parameter.
+ Change all callers.
+ (set_value_range_to_null): Call set_value_range_to_value.
+ (extract_range_from_comparison): Likewise.
+
+2007-05-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * toplev.c (print_version): Output GMP/MPFR version info.
+
+ * builtins.c (CASE_MATHFN_REENT): New macro.
+ (mathfn_built_in): Use it.
+ * builtins.def (BUILT_IN_GAMMA_R, BUILT_IN_GAMMAF_R,
+ BUILT_IN_GAMMAL_R, BUILT_IN_LGAMMA_R, BUILT_IN_LGAMMAF_R,
+ BUILT_IN_LGAMMAL_R): New.
+ * doc/extend.texi: Document new builtins.
+
+ PR middle-end/31796
+ * builtins.c (do_mpfr_remquo): New.
+ (fold_builtin_2): Handle BUILT_IN_DREM/BUILT_IN_REMAINDER.
+ (fold_builtin_3): Handle BUILT_IN_REMQUO.
+
+ PR middle-end/30251
+ * builtins.c (fold_builtin_1): Handle y0, y1.
+ (fold_builtin_2): Handle yn.
+
+ PR middle-end/30251
+ * builtins.c (do_mpfr_bessel_n): New.
+ (fold_builtin_1): Handle BUILT_IN_J0 and BUILT_IN_J1.
+ (fold_builtin_2): Handle BUILT_IN_JN.
+
+2007-05-17 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/31965
+ * config/i386/mingw32.h (_INTEGRAL_MAX_BITS): Define builtin as
+ TYPE_PRECISION (intmax_type_node).
+
+2007-05-17 Steve Ellcey <sje@cup.hp.com>
+
+ PR target/31850
+ * reload.c (subst_reloads): Remove checking.
+
+2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR rtl-optimization/31691
+ * combine.c (simplify_set): Build a new src pattern instead of
+ substituting its operands in the COMPARE case.
+
+2007-05-17 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-vrp.c (finalize_jump_threads): Do not care about dominance info.
+ (execute_vrp): Preserve loops through jump threading.
+ * tree-ssa-threadupdate.c (thread_single_edge,
+ dbds_continue_enumeration_p, determine_bb_domination_status,
+ thread_through_loop_header): New functions.
+ (create_edge_and_update_destination_phis,
+ create_edge_and_update_destination_phis): Set loops for the new blocks.
+ (prune_undesirable_thread_requests): Removed.
+ (redirect_edges): Do not pretend that redirect_edge_and_branch can
+ create new blocks.
+ (thread_block): Do not call prune_undesirable_thread_requests.
+ Update loops.
+ (mark_threaded_blocks): Select edges to thread here.
+ (thread_through_all_blocks): Take may_peel_loop_headers argument.
+ Thread edges through loop headers independently.
+ * cfgloopmanip.c (create_preheader, mfb_keep_just): Export.
+ * tree-pass.h (TODO_mark_first_instance): New.
+ (first_pass_instance): Declare.
+ * cfghooks.c (duplicate_block): Put the block to the original loop
+ if copy is not specified.
+ * tree-ssa-dom.c (tree_ssa_dominator_optimize): Preserve loops through
+ jump threading. Pass may_peel_loop_headers to
+ thread_through_all_blocks according to first_pass_instance.
+ * cfgloop.h (create_preheader): Declare.
+ * tree-flow.h (thread_through_all_blocks): Declaration changed.
+ * basic-block.h (mfb_keep_just, mfb_kj_edge): Declare.
+ * passes.c (first_pass_instance): New variable.
+ (next_pass_1): Set TODO_mark_first_instance.
+ (execute_todo): Set first_pass_instance.
+
+2007-05-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR tree-optimization/24659
+ * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
+ OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
+ OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
+ OTI_vec_pack_ufix_trunc.
+ (vec_unpacks_float_hi_optab): Define new macro.
+ (vec_unpacks_float_lo_optab): Ditto.
+ (vec_unpacku_float_hi_optab): Ditto.
+ (vec_unpacku_float_lo_optab): Ditto.
+ (vec_pack_sfix_trunc_optab): Ditto.
+ (vec_pack_ufix_trunc_optab): Ditto.
+ * genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
+ and vec_pack_[s|u]fix_trunc_optab using
+ vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
+ * tree-vectorizer.c (supportable_widening_operation): Handle
+ FLOAT_EXPR and CONVERT_EXPR. Update comment.
+ (supportable_narrowing_operation): New function.
+ * tree-vectorizer.h (supportable_narrowing_operation): Prototype.
+ * tree-vect-transform.c (vectorizable_conversion): Handle
+ (nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
+ (vect_gen_widened_results_half): Move before vectorizable_conversion.
+ (vectorizable_type_demotion): Call supportable_narrowing_operation()
+ to check for target support.
+ * optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
+ for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
+ for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
+ for VEC_PACK_FIX_TRUNC_EXPR.
+ (expand_binop): Special case mode of the result for
+ vec_pack_[u|s]fix_trunc_optab.
+ (init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
+ vec_pack_[u|s]fix_trunc_optab.
+
+ * tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
+ VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
+ * tree-pretty-print.c (dump_generic_node): Handle
+ VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
+ VEC_PACK_FIX_TRUNC_EXPR.
+ (op_prio): Ditto.
+ * expr.c (expand_expr_real_1): Ditto.
+ * tree-inline.c (estimate_num_insns_1): Ditto.
+ * tree-vect-generic.c (expand_vector_operations_1): Ditto.
+
+ * config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
+ (vec_unpacks_float_lo_v8hi): Ditto.
+ (vec_unpacku_float_hi_v8hi): Ditto.
+ (vec_unpacku_float_lo_v8hi): Ditto.
+ (vec_unpacks_float_hi_v4si): Ditto.
+ (vec_unpacks_float_lo_v4si): Ditto.
+ (vec_pack_sfix_trunc_v2df): Ditto.
+
+ * doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
+ Document.
+ [VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
+ [VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
+ * doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
+ [vec_pack_ufix_trunc]: Ditto.
+ [vec_unpacks_float_hi]: Ditto.
+ [vec_unpacks_float_lo]: Ditto.
+ [vec_unpacku_float_hi]: Ditto.
+ [vec_unpacku_float_lo]: Ditto.
+
+2007-05-16 Uros Bizjak <ubizjak@gmail.com>
+
+ * soft-fp/README: Update for new files.
+ * soft-fp/floattisf.c: New file.
+ * soft-fp/floattidf.c: New file.
+ * soft-fp/floattitf.c: New file.
+ * soft-fp/floatuntisf.c: New file.
+ * soft-fp/floatuntidf.c: New file.
+ * soft-fp/floatuntitf.c: New file.
+ * soft-fp/fixsfti.c: New file.
+ * soft-fp/fixdfti.c: New file.
+ * soft-fp/fixtfti.c: New file.
+ * soft-fp/fixunssfti.c: New file.
+ * soft-fp/fixunsdfti.c: New file.
+ * soft-fp/fixunstfti.c: New file.
+ * soft-fp/extendxftf.c: New file.
+ * soft-fp/trunctfxf.c: New file.
+
+ * libgcc-std.ver (__extendxftf2): Added to GCC_4.3.0 section.
+ (__trunctfxf2): Ditto.
+
+ * config/i386/libgcc-x86_64-glibc.ver (__addtf3, __divtf3, __eqtf2,
+ __extenddftf2, __extendsftf2, __fixtfdi, __fixtfsi, __fixtfti,
+ __fixunstfdi, __fixunstfsi, __fixunstfti, __floatditf, __floatsitf,
+ __floattitf, __floatunditf, __floatunsitf, __floatuntitf, __getf2,
+ __letf2, __multf3, __negtf2, __subtf3, __trunctfdf2, __trunctfsf2,
+ __unordtf2): Exclude and add to GCC_4.3.0 section for x86_64 targets.
+
+ * config/i386/t-fprules-softfp64: New file.
+ * config/i386/sfp-machine.h: New file.
+ * config.gcc (x86_64-*-linux*, x86_64-*-kfreebsd*-gnu,
+ x86_64-*-knetbsd*-gnu): Add i386/t-fprules-softfp64
+ and soft-fp/t-softfp to tmake_file.
+ (i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu,
+ i[34567]86-*-knetbsd*-gnu): Ditto for --enable-targets=all.
+
+ * config/i386/t-linux64 (softfp_wrap_start): New.
+ (softfp_wrap_end): New.
+ * config/i386/i386.c (ix86_scalar_mode_supported): TFmode is
+ supported for TARGET_64BIT.
+
+2007-05-16 Rafael Avila de Espindola <espindola@google.com>
+
+ * c-common.c (c_common_signed_or_unsigned_type): Emulate
+ c_common_unsigned_type behavior.
+
+2007-05-16 Paolo Bonzini <bonzini@gnu.org>
+
+ * config/i386/i386.c (legitimize_tls_address): Mark __tls_get_addr
+ calls as pure.
+
+2007-05-16 Eric Christopher <echristo@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register
+ saving after stack push. Set sp_offset whenever we push.
+ (rs6000_emit_epilogue): Move altivec register restore before
+ stack push.
+
+2007-05-16 Richard Sandiford <richard@codesourcery.com>
+
+ * configure.ac: Allow sysroots to be relocated under $prefix as
+ well as $exec_prefix.
+ * configure: Regenerate.
+
+2007-05-16 Richard Sandiford <richard@codesourcery.com>
+
+ Revert:
+
+ 2007-05-12 Richard Sandiford <richard@codesourcery.com>
+
+ * configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
+ (gcc_tooldir): Likewise.
+ * configure: Regenerate.
+ * Makefile.in (libsubdir_to_prefix): New variable, based on the
+ old configure.ac gcc_tooldir setting.
+ (prefix_to_exec_prefix): New variable.
+ (DRIVER_DEFINES): Use $(libsubdir_to_prefix)$(prefix_to_exec_prefix)
+ rather than $(unlibsubdir)/../ to derive TOOLDIR_BASE_PREFIX.
+
+2007-05-14 Janis Johnson <janis187@us.ibm.com>
+
+ * c-typeck.c (build_binary_op): Return early for error.
+
+2007-05-15 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-ssa-loop-niter.c (record_estimate): Use GGC_NEW to allocate
+ struct nb_iter_bound.
+ (free_numbers_of_iterations_estimates_loop): Use ggc_free.
+ * gengtype.c (open_base_files): Add cfhloop.h to the list of includes.
+ * cfgloopmanip.c (place_new_loop): Vector larray is gc-allocated.
+ * tree-scalar-evolution.c: Include gt-tree-scalar-evolution.h.
+ (struct scev_info_str, scalar_evolution_info): Add GTY markers.
+ (new_scev_info_str): Use GGC_NEW to allocate struct scev_info_str.
+ (del_scev_info): Use ggc_free.
+ (scev_initialize): Allocate scalar_evolution_info in gc memory.
+ * loop-init.c: Include ggc.h.
+ (loop_optimizer_init): Use GGC_CNEW to allocate struct loops.
+ (loop_optimizer_finalize): Use ggc_free.
+ * tree-ssa-loop.c (pass_tree_unswitch, pass_vectorize,
+ pass_linear_transfom, pass_empty_loop, pass_complete_unroll,
+ pass_iv_optimize): Add TODO_ggc_collect.
+ * function.h (struct function): Remove skip marker from x_current_loops.
+ * cfgloop.c: Include ggc.h.
+ (flow_loops_free, flow_loop_free): Free the loop descriptions in gc
+ memory.
+ (establish_preds): Vector superloops is gc allocated.
+ (alloc_loop): Allocate loop using GGC_CNEW. Allocate head of
+ loop->exits list.
+ (flow_loops_find): Vector larray is gc allocated.
+ (loop_exit_free): Use ggc_free.
+ (rescan_loop_exit): Use GGC_NEW to allocate struct loop_exit. Reflect
+ that head of exits list is now not a part of struct loop.
+ (record_loop_exits): Allocate exits table in gc memory.
+ (get_loop_exit_edges, verify_loop_structure, single_exit): Reflect that
+ head of exits list is now not a part of struct loop.
+ * cfgloop.h (struct lpt_decision, struct nb_iter_bound,
+ struct loop_exit): Add GTY marker.
+ (struct loop): Add GTY marker. Make superloops vector gc allocated.
+ Add skip marker to aux field. Make head of exits list a separate
+ object.
+ (struct loops): Add GTY marker. Make larray vector gc allocated.
+ Add param marker to exits table.
+ (get_loops): Type changed.
+ * Makefile.in (tree-scalar-evolution.o): Add gt-tree-scalar-evolution.h
+ dependency.
+ (cfgloop.o, loop-init.o): Add ggc.h dependency.
+ (GTFILES): Add cfgloop.h and tree-scalar-evolution.c.
+ * basic-block.h (struct basic_block_def): Remove skip marker from
+ loop_father field.
+
+2007-05-14 Uros Bizjak <ubizjak@gmail.com>
+
+ * builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead
+ of 0 in the call to expand_expr().
+ (expand_builtin_mathfn_3): Ditto.
+ (expand_builtin_interclass_mathfn): Ditto.
+ (expand_builtin_cexpi): Ditto.
+ (expand_builtin_int_roundingfn): Ditto.
+ (expand_builtin_int_roundingfn_2): Ditto.
+ (expand_builtin_pow): Ditto.
+ (expand_builtin_powi): Ditto.
+ (expand_builtin_bswap): Ditto.
+ (expand_builtin_unop): Ditto.
+ (expand_builtin_fabs): Ditto.
+ (get_builtin_sync_mem): Use NULL_RTX instead of NULL in
+ the call to expand_expr().
+ (expand_builtin_sync_operation): Ditto.
+ (expand_builtin_compare_and_swap): Ditto.
+ (expand_builtin_lock_test_and_set): Ditto.
+ * except.c (expand_builtin_eh_return_data_regno): Use EXPAND_NORMAL
+ instead of 0 in the call to expand_expr().
+ (expand_builtin_extract_return_addr): Ditto.
+ (expand_builtin_eh_return): Ditto.
+ (expand_eh_return): Ditto.
+ * explow.c (expr_size): Ditto.
+ * expr.c (optimize_bitfield_assignment_op): Ditto.
+ (expand_assignement): Ditto.
+ (store_expr): Ditto.
+ (store_field): Ditto.
+ (expand_expr_addr_expr_1): Use NULL_RTX instead of NULL in
+ the call to expand_expr().
+ (expand_expr_real_1) [COMPLEX_CST]: Use EXPAND_NORMAL instead of 0
+ in the call to expand_expr().
+ [CONSTRUCTOR, PLUS_EXPR, MINUS_EXPR, NEGATE_EXPR, ABS_EXPR,
+ BIT_NOT_EXPR, LSHIFT_EXPR, LT_EXPR, TRUTH_NOT_EXPR]: Ditto.
+ [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO]: Use expand_normal() instead
+ of expand_expr().
+ * optabs.c (expand_vec_shift_expr): Ditto.
+ (expand_vec_cond_expr): Ditto.
+ (vector_compare_rtx): Use EXPAND_STACK_PARM instead of 1 in the
+ call to expand_expr().
+ * stmt.c (expand_return): Use EXPAND_NORMAL instead of 0
+ in the call to expand_expr().
+
+2007-05-14 Dave Korn <dave.korn@artimi.com>
+
+ * genautomata.c (gen_regexp_el): Allocate correct size for regexp.
+
+2007-05-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * c-common.c (warnings_for_convert_and_check): Use unsigned_type_for
+ instead of c_common_unsigned_type.
+ (c_common_unsigned_type): Remove.
+ (shorten_compare): Use c_common_signed_or_unsigned_type instead of
+ c_common_unsigned_type.
+ (c_common_nodes_and_builtins): Use unsigned_type_for instead of
+ c_common_unsigned_type.
+ * c-common.h (c_common_unsigned_type): Remove.
+ * c-decl.c (grokdeclarator): Use unsigned_type_for instead of
+ c_common_unsigned_type.
+ * c-format.c (check_format_types): Use unsigned_type_for instead of
+ c_common_unsigned_type.
+ * c-objc-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+ * c-typeck.c (convert_for_assignment): Use unsigned_type_for instead of
+ c_common_unsigned_type.
+ * convert.c (convert_to_integer): Use unsigned_type_for instead of
+ lang_hooks.types.unsigned_type.
+ * expmed.c (make_tree): Use unsigned_type_for instead of
+ lang_hooks.types.unsigned_type.
+ * fold-const.c (fold_negate_expr): Use unsigned_type_for instead of
+ lang_hooks.types.unsigned_type.
+ (build_range_check): Likewise.
+ (fold_unary): Likewise.
+ (fold_binary): Likewise.
+ (fold_ternary): Likewise.
+ * langhooks-def.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+ * langhooks.h (lang_hooks_for_types): Remove unsigned_type.
+ * tree.c (get_unsigned_type): New.
+ (unsigned_type_for): Use get_unsigned_type instead of
+ lang_hooks.types.unsigned_type.
+
+2007-05-14 Kazu Hirata <kazu@codesourcery.com>
+
+ * config/m68k/m68k-protos.h: Rename m68k_interrupt_function_p
+ to m68k_get_function_kind. Update its prototype.
+ * config/m68k/m68k.c (m68k_attribute_table): Add an entry for
+ interrupt_thread.
+ (m68k_interrupt_function_p): Return enum m68k_function_type
+ instead of bool. Rename to m68k_get_function_kind.
+ (m68k_handle_fndecl_attribute): Reject interrupt_thread if the
+ target is not fido.
+ (m68k_compute_frame_layout): Don't mark any register for save
+ if an interrupt_thread attribute is specified.
+ (m68k_hard_regno_rename_ok): Update a use of
+ m68k_interrupt_function_p.
+ * config/m68k/m68k.h (EPILOGUE_USES): Update a use of
+ m68k_interrupt_function_p.
+ (m68k_function_type): New.
+ * config/m68k/m68k.md (*return): Output a 'sleep' instruction
+ for a function with an interrupt_thread attribute.
+ * doc/extend.texi: Document the interrupt_thread attribute.
+
+2007-05-13 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR tree-optimization/31911
+ * tree-ssa-pre.c (phi_translate): Make sure to cache results even
+ if they didn't change the expression.
+
+2007-05-13 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-scalar-evolution.c (resolve_mixers): Exported.
+ * tree-scalar-evolution.h (resolve_mixers): Declare.
+ * tree-data-ref.c (object_analysis, ptr_decl_may_alias_p,
+ ptr_ptr_may_alias_p, may_alias_p, record_ptr_differ_p,
+ record_record_differ_p, record_array_differ_p, array_ptr_differ_p,
+ base_object_differ_p, base_addr_differ_p, analyze_array_indexes,
+ init_array_ref, init_pointer_ref, analyze_indirect_ref,
+ strip_conversion, analyze_offset_expr, address_analysis,
+ object_analysis, analyze_offset): Removed.
+ (dr_analyze_innermost, dr_analyze_indices, dr_analyze_alias,
+ split_constant_offset, canonicalize_base_object_address,
+ object_address_invariant_in_loop_p, disjoint_objects_p,
+ dr_may_alias_p, dr_address_invariant_p): New functions.
+ (create_data_ref): Use dr_analyze_innermost, dr_analyze_indices
+ and dr_analyze_alias.
+ (initialize_data_dependence_relation): Use dr_may_alias_p
+ and object_address_invariant_in_loop_p.
+ (compute_self_dependence): Handle the case when DDR_ARE_DEPENDENT (ddr)
+ is chrec_dont_know.
+ (find_data_references_in_stmt): Restrict the analysis of data references
+ to the given loop nest.
+ (find_data_references_in_loop): Made static. Pass loop nest to
+ find_data_references_in_stmt.
+ (compute_data_dependences_for_loop): Use DR_VOPS.
+ (free_data_ref): Free DR_VOPS.
+ * tree-data-ref.h (struct first_location_in_loop): Replaced by ...
+ (struct innermost_loop_behavior): ... new.
+ (struct base_object_info): Replaced by ...
+ (struct indices): ... new.
+ (struct dr_alias): New.
+ (enum data_ref_type): Removed.
+ (struct data_reference): Consist of struct innermost_loop_behavior,
+ struct indices and struct dr_alias.
+ (DR_SET_ACCESS_FNS, DR_FREE_ACCESS_FNS): Removed.
+ (DR_MEMTAG): Renamed to ...
+ (DR_SYMBOL_TAG): ... this.
+ (find_data_references_in_loop): Declaration removed.
+ * tree-vect-analyze.c (vect_compute_data_ref_alignment): Use DR_INIT
+ instead of DR_OFFSET_MISALIGNMENT. DR_ALIGNED_TO is never NULL.
+ (vect_analyze_data_refs): Use DR_SYMBOL_TAG instead of DR_MEMTAG.
+ * tree-vect-transform.c (vect_create_data_ref_ptr): Ditto.
+
+2007-05-13 Revital Eres <eres@il.ibm.com>
+
+ * tree-ssa-dse.c (get_use_of_stmt_lhs): New function
+ which walks virtual def-use chains to find redundant stores.
+ (dse_optimize_stmt): Call it.
+
+2007-05-12 Steven Bosscher <steven@gcc.gnu.org>
+
+ * gcse.c (gcse_main): Do jump bypassing in CPROP2.
+ * passes.c (init_optimization_passes): Move pass_jump_bypass
+ after loop2.
+
+ * basic-block.h (bb_has_eh_pred): Fix style issue.
+
+2007-05-12 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR rtl-optimization/31848
+ * loop-invariant.c (move_invariant_reg): If we move an insn
+ with a REG_EQUAL note, and that insn is not always executed,
+ remove the REG_EQUAL note.
+
+2007-05-12 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/31797
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not
+ propagate into a stmt that has volatile ops.
+
+2007-05-12 Richard Sandiford <richard@codesourcery.com>
+
+ * configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
+ (gcc_tooldir): Likewise.
+ * configure: Regenerate.
+ * Makefile.in (libsubdir_to_prefix): New variable, based on the
+ old configure.ac gcc_tooldir setting.
+ (prefix_to_exec_prefix): New variable.
+ (DRIVER_DEFINES): Use $(libsubdir_to_prefix)$(prefix_to_exec_prefix)
+ rather than $(unlibsubdir)/../ to derive TOOLDIR_BASE_PREFIX.
+
+2007-05-11 Silvius Rus <rus@google.com>
+
+ * Makefile.in (OBJS-common): Add tree-ssa-alias-warnings.o.
+ * c-common.c (strict_aliasing_warning): Modify -Wstrict-aliasing logic.
+ * c-common.h (strict_aliasing_warning): Change return type.
+ * c-opts.c (c_common_handle_option): Add call to set_Wstrict_aliasing.
+ * c-typeck.c (build_indirect_ref): Add call to strict_aliasing_warning.
+ (build_c_cast): Condition call to strict_aliasing_warning.
+ * doc/invoke.texi: Update description of -Wstrict-aliasing[=n].
+ * flags.h (set_Wstrict_aliasing): Declare.
+ * opts.c (set_Wstrict_alising): Define, add call to.
+ * tree-flow.h (strict_aliasing_warning_backend): Declare.
+ * tree-ssa-alias-warnings.c: New file.
+ * tree-ssa-alias.c (compute_may_aliases): Add call to
+ strict_aliasing_warning_backend.
+
+2007-05-11 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-loop-linear.c (gather_interchange_stats, try_interchange_loops):
+ Use loop_depth and loop_outer accessor functions.
+ * tree-ssa-loop-im.c (outermost_invariant_loop, set_level,
+ determine_invariantness_stmt, move_computations_stmt): Ditto.
+ * cfgloopmanip.c (fix_bb_placement, fix_loop_placement, remove_path,
+ add_loop, loopify, unloop, fix_loop_structure): Ditto.
+ * tree-ssa-loop-manip.c (find_uses_to_rename_use): Ditto.
+ * tree-scalar-evolution.c (interpret_loop_phi,
+ compute_scalar_evolution_in_loop, analyze_scalar_evolution_in_loop,
+ instantiate_parameters_1, scev_const_prop): Ditto.
+ * cfghooks.c (make_forwarder_block): Ditto.
+ * cfgloopanal.c (mark_irreducible_loops, mark_loop_exit_edges): Ditto.
+ * modulo-sched.c (loop_canon_p): Ditto.
+ * tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg,
+ slpeel_can_duplicate_loop_p): Ditto.
+ * lambda-code.c (invariant_in_loop_and_outer_loops): Ditto.
+ * tree-cfg.c (tree_duplicate_sese_region): Ditto.
+ * cfgloop.c (flow_loop_dump, flow_loop_nodes_find, rescan_loop_exit,
+ cancel_loop, verify_loop_structure): Ditto.
+ (flow_loop_nested_p, superloop_at_depth, flow_loop_free,
+ add_bb_to_loop, remove_bb_from_loops, find_common_loop): Use the
+ superloops vector instead of "pred" array.
+ (establish_preds): Take father loop as an argument. Initialize the
+ superloops vector.
+ (flow_loop_tree_node_add): Pass father loop to establish_preds. Do not
+ initialize loop->outer.
+ (flow_loop_tree_node_remove): Truncate the superloops vector.
+ * cfgloop.h (struct loop): Removed field "outer", fields "depth" and
+ "pred" merged to "superloops" vector.
+ (loop_depth, loop_outer): New.
+ (fel_init): Use loop_outer.
+
+2007-05-11 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c: Include gt-cgraphunit.h
+ (static_ctors, static_dtors): New static vars.
+ (record_cdtor_fn, build_cdtor, cgraph_build_cdtor_fns): New functions,
+ based on implementation in c-common.c
+ (cgraph_finalize_function): Call record_cdtor_fn.
+ (cgraph_optimize): Call cgraph_build_cdtor_fns.
+ * decl.c (finish_function): Do not call c_record_cdtor_fn.
+ (c_write_global_declarations): Do not call c_build_cdtor_fns.
+ * c-common.c (static_ctors, static_dtors, c_record_cdtor_fn,
+ build_cdtor, c_build_cdtor_fns): Remove.
+ * c-common.h (static_ctors, static_dtors, c_record_cdtor_fn,
+ c_build_cdtor_fns): Remove prototype.
+
+2007-05-11 Paolo Carlini <pcarlini@suse.de>
+
+ PR other/31852
+ * builtin-types.def: Add BT_FN_PTR_CONST_PTR_INT_SIZE.
+ * builtins.def: Add BUILT_IN_MEMCHR, use the latter.
+ * builtins.c (fold_builtin_memchr): New.
+ (expand_builtin_memchr): Call the latter.
+ (expand_builtin, fold_builtin_3): Deal with BUILT_IN_MEMCHR.
+ * doc/extend.texi ([Other built-in functions provided by GCC]):
+ Document memchr.
+
+2007-05-11 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.md (GPR0_REGNUM, FPR0_REGNUM, FPR2_REGNUM,
+ PFPO_CONVERT, PFPO_OP_TYPE_SF, PFPO_OP_TYPE_DF, PFPO_OP_TYPE_TF,
+ PFPO_OP_TYPE_SD, PFPO_OP_TYPE_DD, PFPO_OP_TYPE_TD, PFPO_OP0_TYPE_SHIFT,
+ PFPO_OP1_TYPE_SHIFT): Constants added.
+ (DFP_ALL): Mode macro defined.
+ ("*trunc<BFP:mode><DFP_ALL:mode>2", "*trunc<DFP_ALL:mode><BFP:mode>2",
+ "*extend<BFP:mode><DFP_ALL:mode>2", "*extend<DFP_ALL:mode><BFP:mode>2"):
+ Insn definitions added.
+ ("trunc<BFP:mode><DFP_ALL:mode>2", "trunc<DFP_ALL:mode><BFP:mode>2",
+ "extend<BFP:mode><DFP_ALL:mode>2", "extend<DFP_ALL:mode><BFP:mode>2"):
+ Expanders added.
+
+2007-05-10 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/31885
+ * tree-chrec.c (chrec_contains_undetermined): Do not consider NULL_TREE
+ to be undetermined.
+ (automatically_generated_chrec_p): Return false for NULL.
+
+2007-05-08 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.h (MOVE_RATIO): Define.
+
+2007-05-10 Richard Sandiford <richard@codesourcery.com>
+
+ * config.gcc (sparc-wrs-vxworks): New target.
+ * config/sparc/vxworks.h, config/sparc/t-vxworks: New files.
+ * config/sparc/sparc-protos.h (sparc_emit_call_insn): Declare.
+ * config/sparc/sparc.h: Include vxworks-dummy.h.
+ (PRINT_OPERAND_ADDRESS): Extend SYMBOL_REF handling to
+ include LABEL_REFs too.
+ * config/sparc/sparc.c (sparc_expand_move): Don't assume that
+ _GLOBAL_OFFSET_TABLE_ - label_ref is a link-time constant on
+ VxWorks.
+ (legitimize_pic_address): Handle LABEL_REFs like SYMBOL_REFs
+ on VxWorks.
+ (load_pic_register): Use gen_vxworks_load_got for VxWorks.
+ (sparc_emit_call_insn): New function.
+ (sparc_function_ok_for_sibcall): Restrict sibcalls to locally-binding
+ functions when generating VxWorks PIC.
+ * config/sparc/sparc.md (vxworks_load_got): New pattern.
+ (call, call_value): Use sparc_emit_call_insn instead of
+ emit_call_insn.
+
+2007-05-09 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_output_literal): Don't use #if.
+
+2007-05-09 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_output_literal): Mask out high bits
+ for floating-point values if HOST_BITS_PER_LONG > 32. Use split_double
+ instead of operand_subword.
+
+2007-05-08 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.h (LOCAL_ALIGNMENT): Define.
+ * config/bfin/bfin.c (bfin_local_alignment): New function.
+ * config/bfin/bfin-protos.h (bfin_local_alignment): Declare it.
+
+2007-05-08 Chao-ying Fu <fu@mips.com>
+
+ * doc/md.texi (msub@var{m}@var{n}4, usub@var{m}@var{n}4): Document.
+ * optabs.h (OTI_smsub_widen, OTI_umsub_widen): New optab_indexes.
+ (smsub_widen_optab, umsub_widen_optab): Define.
+ * optabs.c (init_optabs): Initialize smsub_widen_optab and
+ umsub_widen_optab.
+ * genopinit.c (optabs): Fill in smsub_widen_optab and
+ umsub_widen_optab.
+ * expr.c (expand_expr_real_1): Try to use smsub_widen_optab
+ and umsub_widen_optab to implement multiply-subtract sequences.
+ * config/mips/mips.md (*msac<u>_di): Rename to...
+ (<u>msubsidi4): ...this. Extend condition to include
+ GENERATE_MADD_MSUB and TARGET_DSPR2. Change the constraint
+ of operand 0 to "ka" and use the three-operand form of msub<u>
+ for TARGET_DSPR2.
+ * config/mips/mips-dspr2.md (mips_msub, mips_msubu): Convert
+ to define_expands.
+
+2007-05-08 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR rtl-optimization/28011
+ * reload.c (push_reload): Set dont_share if IN appears in OUT
+ also when IN is a PLUS rtx.
+ (reg_overlap_mentioned_for_reload_p): Return true if X and IN
+ are same PLUS rtx.
+
+2007-05-08 Kazu Hirata <kazu@codesourcery.com>
+
+ * emit-rtl.c (unshare_all_rtl_1): Don't copy DECL_RTL. Don't
+ call unshare_all_decls.
+ (unshare_all_rtl): Adjust the call to unshare_all_rtl_1.
+ (unshare_all_decls): Remove.
+
+2007-05-08 Simon Martin <simartin@users.sourceforge.net>
+
+ PR 31847
+ * tree-dump.c (dump_options): Don't use TDF_DIAGNOSTIC in "*-all" tree
+ dumps.
+
+2007-05-08 Sandra Loosemore <sandra@codesourcery.com>
+ Nigel Stephens <nigel@mips.com>
+
+ * config/mips/mips.h (MAX_FPRS_PER_FMT): Renamed from FP_INC.
+ Update comments and all uses.
+ (MIN_FPRS_PER_FMT): Define.
+ * config/mips/mips.c (function_arg): Fix to correctly handle
+ the -mips32r2 -mfp64 -mabi=32 case.
+ (override_options): Enable use of odd-numbered registers for
+ SFmode values on MIPS32.
+ (mips_save_reg_p): Save whole floating-point register pair if
+ either half is used.
+ (compute_frame_size): Fix comment.
+
+2007-05-08 Jie Zhang <jie.zhang@analog.com>
+
+ * config/bfin/bfin-protos.h (bfin_expand_epilogue): Add a third
+ argument of type bool.
+ * config/bfin/bfin.c (add_to_reg): Add epilogue_p as a fourth
+ argument. Safely select temporary P register according to it.
+ (do_link): Change call site of add_to_reg accordingly.
+ (do_unlink): Add epilogue_p as a fourth argument and pass it
+ to add_to_reg.
+ (expand_interrupt_handler_epilogue): Change call of do_unlink
+ accordingly.
+ (bfin_expand_prologue): Add a third argument sibcall_p.
+ * config/bfin/bfin.md (epilogue): Change call of
+ bfin_expand_epilogue accordingly.
+ (sibcall_epilogue): Likewise.
+ (eh_return_internal): Likewise.
+
+ * config/bfin/bfin-protos.h (enum bfin_cpu): Add
+ BFIN_CPU_BF534, BFIN_CPU_BF536 and BFIN_CPU_BF561.
+ * config/bfin/bfin.c (bfin_handle_option): Handle
+ -mcpu=bf534, -mcpu=bf536 and -mcpu=bf561.
+ * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS):
+ Support bf534, bf536 and bf561.
+ * doc/invoke.texi (Blackfin Options): Document -mcpu and -msim.
+
+2007-05-08 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/31854
+ * config/i386/i386.c (ix86_function_regparm): Process local
+ functions only when TREE_CODE (decl) equals FUNCTION_DECL.
+
+2007-05-07 Mike Stump <mrs@apple.com>
+
+ * doc/invoke.texi (Warning Options): Document that -Wempty-body
+ also checks for and while statements in C++.
+
+2007-05-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc.c (at_file_supplied): New variable.
+ (main): Set it if we expanded argv.
+ (do_spec_1): Pass an @-file to the linker if we were called with
+ an @-file argument and HAVE_GNU_LD.
+ * collect2.c (at_file_supplied): New variable.
+ (response_file): New variable.
+ (collect_exit): Unlink response_file if necessary.
+ (handler): Likewise.
+ (do_wait): Likewise.
+ (main): Set at_file_supplied if we expanded argv.
+ (collect_execute): Pass an @-file to subprocesses if we were called
+ with an @-file argument.
+ * configure.ac: Add define for HAVE_GNU_LD.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+2007-05-07 Naveen.H.S <naveen.hs@kpitcummins.com>
+
+ * config/m32c/muldiv.md (mulhisi3_c): Limit the mode of the 2nd
+ operand to HI mode.
+ (mulsi3): New.
+ (divsi3): New.
+ (udivsi3): New.
+
+2007-05-07 Jayant Sonar <jayants@kpitcummins.com>
+
+ * config/m32c/m32c.c (SYMBOL_FLAG_FUNCVEC_FUNCTION): Define.
+ (TARGET_ENCODE_SECTION_INFO): Re-define.
+ (m32c_encode_section_info): New
+ (function_vector_handler): New
+ (current_function_special_page_vector): New
+ (m32c_special_page_vector_p): New.
+ * config/m32c/m32c-protos.h (m32c_special_page_vector_p):
+ Prototype.
+ * config/m32c/jump.md: Added instruction JSRS for functions
+ with attribute "function_vector".
+ * doc/extend.texi (function_vector): Added description
+ for M16C, M32C targets.
+
+2007-05-07 DJ Delorie <dj@redhat.com>
+
+ PR 31794
+ * config/m32c/shift.md (ashlpsi3_i, ashrpsi3_i, ashlpsi3,
+ ashrpsi3, lshrpsi3): Update shift count constraint.
+
+2007-05-07 Danny Smith <dannysmith@users.sourceforge.net>
+ Nathan Froyd <froydnj@codesourcery.com>
+
+ PR 22133
+ * c-incpath.c (add_path): Strip trailing path separators.
+
+2007-05-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-dom.c (tree_ssa_dominator_optimize): Reset cfg_altered.
+ Free dominance info before purging EH edges.
+ (eliminate_degenerate_phis): Likewise.
+ (propagate_rhs_into_lhs): Set cfg_altered to true instead of 1.
+
+2007-05-07 Jan Hubicka <jh@suse.cz>
+
+ * gimplify.c (gimplify_expr): Do not crash when folding
+ (void *)(int)&a + 4.
+
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR driver/31694
+ * c-opts.c (lang_fortran): Make it non static.
+ * c-common.h (lang_fortran): New prototype.
+ * c-cppbuiltin.c (c_cpp_builtins): Create a __GFORTRAN__ if the
+ -lang-fortran option was passed by the driver.
+
+2007-05-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * timevar.c (timevar_print): Test ENABLE_ASSERT_CHECKING instead
+ of ASSERT_CHECKING. Tweak message.
+
+2007-05-06 Revital Eres <eres@il.ibm.com>
+
+ PR 30957
+ * loop-unroll.c (insert_var_expansion_initialization):
+ Initialize the expansions with -zero instead of +zero.
+
+2007-05-05 Aurelien Jarno <aurelien@aurel32.net>
+
+ * config/pa/pa.md: Split tgd_load, tld_load and tie_load
+ into pic and non-pic versions. Mark r19 as used for
+ tgd_load_pic, tld_load_pic and tie_load_pic. Mark r27 as used
+ for tgd_load, tld_load and tie_load .
+ * config/pa/pa.c (legitimize_tls_address): Emit pic or non-pic
+ version of tgd_load, tld_load and tie_load depending on the
+ value of flag_pic.
+
+2007-05-04 Ulrich Drepper <drepper@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * crtstuff.c (HIDDEN_DTOR_LIST_END): New macro.
+ (__do_global_dtors_aux): Use more paranoid loop to run
+ destructors if HIDDEN_DTOR_LIST_END.
+ (__DTOR_END__): Export as a hidden symbol when HIDDEN_DTOR_LIST_END.
+
+2007-05-04 Jakub Jelinek <jakub@redhat.com>
+
+ * varasm.c (align_variable): Don't increase alignment for
+ DECL_THREAD_LOCAL_P variables above BITS_PER_WORD through
+ DATA_ALIGNMENT or CONSTANT_ALIGNMENT.
+
+2007-05-04 Josh Conner <jconner@apple.com>
+
+ * basic-block.h (cdi_direction): Assign values to all enumeration
+ constants.
+ (dom_computed): Remove.
+ (dom_info_state): New.
+ (set_dom_info_availability): New.
+ * tree-ssa-loop-im.c (determine_invariantness): Initialize
+ walk_data.dom_direction.
+ * cfghooks.c (delete_basic_block): Use dom_info_available_p()
+ instead of dom_computed[].
+ (split_edge): Likewise.
+ (create_basic_block): Likewise.
+ (merge_blocks): Likewise.
+ * ifcvt.c (find_if_header): Likewise.
+ * tree-cfgcleanup.c (cleanup_tree_cfg): Likewise.
+ * tree-ssa-dce.c (remove_dead_stmt): Likewise.
+ * tree-ssa.c (verify_ssa): Likewise.
+ * tree-cfg.c (tree_verify_flow_info): Likewise.
+ (remove_edge_and_dominated_blocks): Likewise.
+ * dominance.c (dom_computed): Make static.
+ (calc_dfs_tree_nonrec): Change third param to a bool.
+ (calc_dfs_tree): Change second param to a bool.
+ (calc_idioms): Change second param to a bool. Use
+ dom_convert_dir_to_idx.
+ (init_dom_info): Validate dir before using.
+ (dom_convert_dir_to_idx): New.
+ (calculate_dominance_info): Use dom_convert_dir_to_idx. New
+ variable 'reverse' used for calling calc_dfs_tree and calc_idoms.
+ (free_dominance_info): Use dom_convert_dir_to_idx.
+ (get_immediate_dominator): Likewise.
+ (set_immediate_dominator): Likewise.
+ (get_dominated_by): Likewise.
+ (redirect_immediate_dominators): Likewise.
+ (nearest_common_denominator): Likewise.
+ (dominated_by_p): Likewise.
+ (bb_dom_dfs_in): Likewise.
+ (bb_dom_dfs_out): Likewise.
+ (recount_dominator): Likewise.
+ (iterate_fix_dominators): Likewise.
+ (add_to_dominance_info): Likewise.
+ (delete_from_dominance_info): Likewise.
+ (first_dom_son): Likewise.
+ (next_dom_son): Likewise.
+ (dom_info_available_p): Likewise.
+ (dom_info_state): New.
+ (set_dom_info_availability): New.
+
+2007-05-04 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.md ("fix_trunc<mode>di2", "fix_trunc<mode>si2"):
+ Expander removed.
+ ("fix_trunc<DSF:mode><GPR:mode>2"): Expander added.
+
+2007-05-04 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.md (adddi3, adddi_carry): Delete.
+ (subdi3, subdi_carry): Delete.
+
+2007-05-04 Jan Hubicka <jh@suse.cz>
+ Richard Guenther <rguenther@suse.de>
+
+ * opts.c (decode_options): Do not fiddle with inlining
+ parameters in case of optimizing for size.
+ * ipa-inline.c (cgraph_decide_recursive_inlining): When optimizing
+ for size do nothing.
+ (cgraph_decide_inlining_of_small_function): When optimizing for
+ size never inline functions increasing caller size.
+ (cgraph_early_inlining): Inline for size when optimizing for size.
+
+2007-04-18 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.md (<optab>di3): Now a define_expand which expands
+ logical operations piecewise.
+ (<optab>di_zesidi_di, <optab>di_sesidi_di, negdi2, one_cmpldi2,
+ zero_extendsidi2, subdi_di_zesidi, subdi_zesidi_di, subdi_di_sesidi,
+ subdi_sesidi_di): Delete.
+ (add_with_carry): Produce carry in CC instead of a DREG to shorten
+ the generated sequence. Allow three-reg add in constraints. Rewrite
+ the rtl expression for carry to avoid zero_extend of a constant.
+ (sub_with_carry): New pattern.
+ (adddi3, subdi3): Change into define_expand. For subtract, generate a
+ different sequence not involving jumps.
+ (notbi): Now a named pattern.
+
+2007-05-04 Bradley Lucier <lucier@math.purdue.edu>
+
+ * doc/invoke.texi (i386 and x86-64 Options) [-mpc32, -mpc64, -mpc80]:
+ Add the note about a significant loss of accuracy of some
+ mathematical routines when these options are used.
+
+2007-05-04 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
+
+ * haifa-sched.c (rtx_vec_t): New typedef.
+ (contributes_to_priority_p): Extract piece of priority () into new
+ static function.
+ (priority): Use the function. Add assertion.
+ (rank_for_schedule, set_priorities): Add assertion to check that
+ insn's priority is initialized.
+ (clear_priorities, calc_priorities): Change signature. Make it update
+ all relevant insns. Update all callers ('add_to_speculative_block ()'
+ and 'create_block_check_twin ()').
+ * sched-int.h (struct haifa_insn_data): Remove field 'priority_known'.
+ Add new field 'priority_status'.
+ (INSN_PRIORITY_STATUS): New macro.
+ (INSN_PRIORITY_KNOWN): Change to use INSN_PRIORITY_STATUS.
+
+2007-05-04 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
+
+ * sched-ebb.c (debug_ebb_dependencies): New static function.
+ (init_ready_list): Use it.
+
+ * sched-rgn.c (debug_dependencies): Split into 'debug_dependencies ()'
+ with changed signature and 'debug_rgn_dependencies ()'.
+ (debug_rgn_dependencies): New static function.
+ (init_ready_list): Use it.
+
+ * sched-int.h (debug_dependencies): Declare.
+
+2007-05-04 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * libgcc-std.ver (__ffssi2): Added to GCC_4.3.0 section.
+
+2007-05-04 Dirk Mueller <dmueller@suse.de>
+
+ * c.opt(Wmain,ffreestanding): Enable for C++,ObjC++.
+
+2007-05-03 Jan Hubicka <jh@suse.cz>
+
+ * fold-const.c (fold_unary): Convert (T1)(X op Y) into ((T1)X op (T1)Y),
+ for pointer type in more cases than before.
+
+ * gimplify.c (gimplify_expr): Fold (void *)&a + 4.
+
+ * tree-object-size.c (plus_expr_object_size): When operand size is
+ unknown, return unknown.
+
+2007-05-03 Dirk Mueller <dmueller@suse.de>
+
+ * doc/invoke.texi (-m386,-m486,-mpentium,-mpentiumpro): Remove.
+
+ * config/i386/i386.h (CC1_CPU_SPEC): Remove handling for deprecated
+ options.
+
+ * config/i386/i386.opt (m386,m486,mpentium,mpentiumpro): Remove.
+
+2007-05-03 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/sourcebuild.texi (Test Directives) Clarify dg-excess-errors.
+
+2007-05-03 Joseph Myers <joseph@codesourcery.com>
+
+ * config/soft-fp/double.h, config/soft-fp/extended.h,
+ config/soft-fp/floatundidf.c, config/soft-fp/floatundisf.c,
+ config/soft-fp/floatunsidf.c, config/soft-fp/floatunsisf.c,
+ config/soft-fp/op-2.h, config/soft-fp/op-4.h,
+ config/soft-fp/op-common.h, config/soft-fp/quad.h: Update from
+ glibc CVS.
+
2007-05-03 Ian Lance Taylor <iant@google.com>
- * config/rs6000/rs6000.c (rs6000_override_options): Don't se
+ * config/rs6000/rs6000.c (rs6000_override_options): Don't set
MASK_PPC_GFXOPT for 8540 or 8548.
2007-05-03 Uros Bizjak <ubizjak@gmail.com>
@@ -31,8 +1013,8 @@
PR tree-optimization/31699
* tree-vect-analyze.c (vect_update_misalignment_for_peel): Remove wrong
code.
- (vect_enhance_data_refs_alignment): Compute peel amount using
- TYPE_VECTOR_SUBPARTS instead of vf.
+ (vect_enhance_data_refs_alignment): Compute peel amount using
+ TYPE_VECTOR_SUBPARTS instead of vf.
* tree-vect-transform.c (vect_gen_niters_for_prolog_loop): Likewise.
2007-05-02 Brooks Moses <brooks.moses@codesourcery.com>
@@ -248,7 +1230,7 @@
PR middle-end/22156
Temporarily revert:
2007-04-06 Andreas Tobler <a.tobler@schweiz.org>
- * tree-sra.c (sra_build_elt_assignment): Initialize min/maxshift.
+ * tree-sra.c (sra_build_elt_assignment): Initialize min/maxshift.
2007-04-05 Alexandre Oliva <aoliva@redhat.com>
* tree-sra.c (try_instantiate_multiple_fields): Needlessly
initialize align to silence bogus warning.
@@ -460,17 +1442,17 @@
PR tree-optimization/30965
PR tree-optimization/30978
* Makefile.in (tree-ssa-forwprop.o): Depend on $(FLAGS_H).
- * tree-ssa-forwprop.c (forward_propagate_into_cond_1): Remove.
- (find_equivalent_equality_comparison): Likewise.
- (simplify_cond): Likewise.
- (get_prop_source_stmt): New helper.
- (get_prop_dest_stmt): Likewise.
+ * tree-ssa-forwprop.c (forward_propagate_into_cond_1): Remove.
+ (find_equivalent_equality_comparison): Likewise.
+ (simplify_cond): Likewise.
+ (get_prop_source_stmt): New helper.
+ (get_prop_dest_stmt): Likewise.
(can_propagate_from): Likewise.
(remove_prop_source_from_use): Likewise.
- (combine_cond_expr_cond): Likewise.
- (forward_propagate_comparison): New function.
- (forward_propagate_into_cond): Rewrite to use fold for
- tree combining.
+ (combine_cond_expr_cond): Likewise.
+ (forward_propagate_comparison): New function.
+ (forward_propagate_into_cond): Rewrite to use fold for
+ tree combining.
(tree_ssa_forward_propagate_single_use_vars): Call
forward_propagate_comparison to propagate comparisons.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index dbd2157a6dc..c4161af7ebe 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20070502
+20070518
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 0486d9f0439..9a5c7e2be1d 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1114,6 +1114,7 @@ OBJS-common = \
tree-sra.o \
tree-ssa-address.o \
tree-ssa-alias.o \
+ tree-ssa-alias-warnings.o \
tree-ssa-ccp.o \
tree-ssa-coalesce.o \
tree-ssa-copy.o \
@@ -2113,6 +2114,11 @@ tree-ssa-loop-im.o : tree-ssa-loop-im.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-ssa-math-opts.o : tree-ssa-math-opts.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(TIMEVAR_H) tree-pass.h $(TM_H) $(FLAGS_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-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) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(TREE_INLINE_H) $(FLAGS_H) \
$(FUNCTION_H) $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \
@@ -2161,7 +2167,8 @@ tree-chrec.o: tree-chrec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
tree-scalar-evolution.o: tree-scalar-evolution.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(REAL_H) $(RTL_H) \
$(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
- $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h
+ $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h \
+ gt-tree-scalar-evolution.h
tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
@@ -2380,7 +2387,8 @@ 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) \
$(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
+ $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) ipa-prop.h \
+ gt-cgraphunit.h
cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(TREE_GIMPLE_H) \
$(TREE_FLOW_H) tree-pass.h
@@ -2557,7 +2565,8 @@ cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(DF_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) \
$(OBSTACK_H) output.h
@@ -2575,7 +2584,7 @@ loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \
coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H)
-loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
+loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \
coretypes.h $(TM_H) $(OBSTACK_H) tree-pass.h $(TIMEVAR_H) $(FLAGS_H) $(DF_H)
loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
@@ -2973,7 +2982,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/coverage.c $(srcdir)/rtl.h \
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
$(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
- $(srcdir)/ipa-reference.h $(srcdir)/output.h \
+ $(srcdir)/ipa-reference.h $(srcdir)/output.h $(srcdir)/cfgloop.h \
$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
$(srcdir)/reload.h \
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
@@ -2987,7 +2996,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/cfglayout.h \
$(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
- $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
+ $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h $(srcdir)/tree-scalar-evolution.c \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
$(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
$(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
@@ -2998,7 +3007,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \
$(srcdir)/tree-ssa-structalias.c \
$(srcdir)/omp-low.c $(srcdir)/varpool.c \
- $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c \
+ $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \
@all_gtfiles@
GTFILES_H = $(subst /,-, $(subst $(srcdir)/,gt-, $(subst .c,.h, \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e85a5a0d98b..fc5337d6de9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * misc.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+
2007-05-02 Pascal Obry <obry@adacore.com>
* gnatchop.adb (Write_Source_Reference_Pragma): Change implementation
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 7d4ffdec509..db39179ad32 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -159,8 +159,6 @@ static tree gnat_type_max_size (tree);
#define LANG_HOOKS_TYPE_FOR_SIZE gnat_type_for_size
#undef LANG_HOOKS_SIGNED_TYPE
#define LANG_HOOKS_SIGNED_TYPE gnat_signed_type
-#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE gnat_unsigned_type
#undef LANG_HOOKS_ATTRIBUTE_TABLE
#define LANG_HOOKS_ATTRIBUTE_TABLE gnat_internal_attribute_table
#undef LANG_HOOKS_BUILTIN_FUNCTION
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index c383906794d..2291ec27689 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -222,7 +222,7 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
PTR GTY ((skip (""))) aux;
/* Innermost loop containing the block. */
- struct loop * GTY ((skip (""))) loop_father;
+ struct loop *loop_father;
/* The dominance and postdominance information node. */
struct et_node * GTY ((skip (""))) dom[2];
@@ -895,8 +895,8 @@ extern void reorder_basic_blocks (void);
enum cdi_direction
{
- CDI_DOMINATORS,
- CDI_POST_DOMINATORS
+ CDI_DOMINATORS = 1,
+ CDI_POST_DOMINATORS = 2
};
enum dom_state
@@ -906,8 +906,8 @@ enum dom_state
DOM_OK /* Everything is ok. */
};
-extern enum dom_state dom_computed[2];
-
+extern enum dom_state dom_info_state (enum cdi_direction);
+extern void set_dom_info_availability (enum cdi_direction, enum dom_state);
extern bool dom_info_available_p (enum cdi_direction);
extern void calculate_dominance_info (enum cdi_direction);
extern void free_dominance_info (enum cdi_direction);
@@ -1118,7 +1118,8 @@ extern bool rtx_equiv_p (rtx *, rtx, int, struct equiv_info *);
extern bool condjump_equiv_p (struct equiv_info *, bool);
/* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */
-static inline bool bb_has_eh_pred (basic_block bb)
+static inline bool
+bb_has_eh_pred (basic_block bb)
{
edge e;
edge_iterator ei;
@@ -1131,4 +1132,8 @@ static inline bool bb_has_eh_pred (basic_block bb)
return false;
}
+/* In cfgloopmanip.c. */
+extern edge mfb_kj_edge;
+bool mfb_keep_just (edge);
+
#endif /* GCC_BASIC_BLOCK_H */
diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def
index e16fd7ab18c..bab6b9deaf5 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
@@ -371,6 +371,8 @@ DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_I16, BT_I16, BT_VOLATILE_PTR,
BT_I16, BT_I16)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR,
BT_PTR, BT_UINT)
+DEF_FUNCTION_TYPE_3 (BT_FN_PTR_CONST_PTR_INT_SIZE, BT_PTR,
+ BT_CONST_PTR, BT_INT, BT_SIZE)
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR,
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 4f34f23aa3c..95e956e6ee3 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -105,6 +105,7 @@ static rtx expand_builtin_next_arg (void);
static rtx expand_builtin_va_start (tree);
static rtx expand_builtin_va_end (tree);
static rtx expand_builtin_va_copy (tree);
+static rtx expand_builtin_memchr (tree, rtx, enum machine_mode);
static rtx expand_builtin_memcmp (tree, rtx, enum machine_mode);
static rtx expand_builtin_strcmp (tree, rtx, enum machine_mode);
static rtx expand_builtin_strncmp (tree, rtx, enum machine_mode);
@@ -172,6 +173,7 @@ static tree fold_builtin_int_roundingfn (tree, tree);
static tree fold_builtin_bitop (tree, tree);
static tree fold_builtin_memory_op (tree, tree, tree, tree, bool, int);
static tree fold_builtin_strchr (tree, tree, tree);
+static tree fold_builtin_memchr (tree, tree, tree, tree);
static tree fold_builtin_memcmp (tree, tree, tree);
static tree fold_builtin_strcmp (tree, tree);
static tree fold_builtin_strncmp (tree, tree, tree);
@@ -229,6 +231,12 @@ static tree do_mpfr_arg2 (tree, tree, tree,
static tree do_mpfr_arg3 (tree, tree, tree, tree,
int (*)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t));
static tree do_mpfr_sincos (tree, tree, tree);
+#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
+static tree do_mpfr_bessel_n (tree, tree, tree,
+ int (*)(mpfr_ptr, long, mpfr_srcptr, mp_rnd_t),
+ const REAL_VALUE_TYPE *, bool);
+static tree do_mpfr_remquo (tree, tree, tree);
+#endif
/* Return true if NODE should be considered for inline expansion regardless
of the optimization level. This means whenever a function is invoked with
@@ -1643,6 +1651,11 @@ expand_builtin_classify_type (tree exp)
case BUILT_IN_MATHFN: case BUILT_IN_MATHFN##F: case BUILT_IN_MATHFN##L: \
fcode = BUILT_IN_MATHFN; fcodef = BUILT_IN_MATHFN##F ; \
fcodel = BUILT_IN_MATHFN##L ; break;
+/* Similar to above, but appends _R after any F/L suffix. */
+#define CASE_MATHFN_REENT(BUILT_IN_MATHFN) \
+ case BUILT_IN_MATHFN##_R: case BUILT_IN_MATHFN##F_R: case BUILT_IN_MATHFN##L_R: \
+ fcode = BUILT_IN_MATHFN##_R; fcodef = BUILT_IN_MATHFN##F_R ; \
+ fcodel = BUILT_IN_MATHFN##L_R ; break;
/* Return mathematic function equivalent to FN but operating directly
on TYPE, if available. If we can't do the conversion, return zero. */
@@ -1682,6 +1695,7 @@ mathfn_built_in (tree type, enum built_in_function fn)
CASE_MATHFN (BUILT_IN_FMOD)
CASE_MATHFN (BUILT_IN_FREXP)
CASE_MATHFN (BUILT_IN_GAMMA)
+ CASE_MATHFN_REENT (BUILT_IN_GAMMA) /* GAMMA_R */
CASE_MATHFN (BUILT_IN_HUGE_VAL)
CASE_MATHFN (BUILT_IN_HYPOT)
CASE_MATHFN (BUILT_IN_ILOGB)
@@ -1694,6 +1708,7 @@ mathfn_built_in (tree type, enum built_in_function fn)
CASE_MATHFN (BUILT_IN_LDEXP)
CASE_MATHFN (BUILT_IN_LFLOOR)
CASE_MATHFN (BUILT_IN_LGAMMA)
+ CASE_MATHFN_REENT (BUILT_IN_LGAMMA) /* LGAMMA_R */
CASE_MATHFN (BUILT_IN_LLCEIL)
CASE_MATHFN (BUILT_IN_LLFLOOR)
CASE_MATHFN (BUILT_IN_LLRINT)
@@ -1880,7 +1895,7 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
exp = build_call_expr (fndecl, 1, arg);
}
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
start_sequence ();
@@ -2133,7 +2148,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget)
exp = build_call_expr (fndecl, 1, arg);
}
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
start_sequence ();
@@ -2245,7 +2260,7 @@ expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget)
exp = build_call_expr (fndecl, 1, arg);
}
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
if (mode != GET_MODE (op0))
op0 = convert_to_mode (mode, op0, 0);
@@ -2337,7 +2352,7 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
op1 = gen_reg_rtx (mode);
op2 = gen_reg_rtx (mode);
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
/* Compute into op1 and op2. */
expand_twoval_unop (sincos_optab, op0, op2, op1, 0);
@@ -2408,14 +2423,14 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
/* Make sure not to fold the cexp call again. */
call = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
return expand_expr (build_call_nary (ctype, call, 1, narg),
- target, VOIDmode, 0);
+ target, VOIDmode, EXPAND_NORMAL);
}
/* Now build the proper return type. */
return expand_expr (build2 (COMPLEX_EXPR, build_complex_type (type),
make_tree (TREE_TYPE (arg), op2),
make_tree (TREE_TYPE (arg), op1)),
- target, VOIDmode, 0);
+ target, VOIDmode, EXPAND_NORMAL);
}
/* Expand a call to one of the builtin rounding functions gcc defines
@@ -2475,7 +2490,7 @@ expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget)
exp = build_call_expr (fndecl, 1, arg);
}
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
start_sequence ();
@@ -2604,7 +2619,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target, rtx subtarget)
exp = build_call_expr (fndecl, 1, arg);
}
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
start_sequence ();
@@ -2871,7 +2886,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
&& !optimize_size
&& powi_cost (n) <= POWI_MAX_MULTS)))
{
- op = expand_expr (arg0, subtarget, VOIDmode, 0);
+ op = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL);
if (n != 1)
{
op = force_reg (mode, op);
@@ -2900,7 +2915,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
op = expand_builtin (call_expr, NULL_RTX, subtarget, mode, 0);
if (n != 1)
{
- op2 = expand_expr (narg0, subtarget, VOIDmode, 0);
+ op2 = expand_expr (narg0, subtarget, VOIDmode, EXPAND_NORMAL);
op2 = force_reg (mode, op2);
op2 = expand_powi (op2, mode, abs (n / 2));
op = expand_simple_binop (mode, MULT, op, op2, NULL_RTX,
@@ -2944,7 +2959,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
0, OPTAB_LIB_WIDEN);
if (n != 1)
{
- op2 = expand_expr (narg0, subtarget, VOIDmode, 0);
+ op2 = expand_expr (narg0, subtarget, VOIDmode, EXPAND_NORMAL);
op2 = force_reg (mode, op2);
op2 = expand_powi (op2, mode, abs (n / 3));
op = expand_simple_binop (mode, MULT, op, op2, NULL_RTX,
@@ -2998,7 +3013,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
|| (! optimize_size
&& powi_cost (n) <= POWI_MAX_MULTS)))
{
- op0 = expand_expr (arg0, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL);
op0 = force_reg (mode, op0);
return expand_powi (op0, mode, n);
}
@@ -3012,10 +3027,10 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
if (target == NULL_RTX)
target = gen_reg_rtx (mode);
- op0 = expand_expr (arg0, subtarget, mode, 0);
+ op0 = expand_expr (arg0, subtarget, mode, EXPAND_NORMAL);
if (GET_MODE (op0) != mode)
op0 = convert_to_mode (mode, op0, 0);
- op1 = expand_expr (arg1, 0, mode2, 0);
+ op1 = expand_expr (arg1, NULL_RTX, mode2, EXPAND_NORMAL);
if (GET_MODE (op1) != mode2)
op1 = convert_to_mode (mode2, op1, 0);
@@ -3976,6 +3991,26 @@ expand_builtin_bzero (tree exp)
const0_rtx, VOIDmode, exp);
}
+/* Expand a call to the memchr builtin. Return NULL_RTX if we failed the
+ caller should emit a normal call, otherwise try to get the result
+ in TARGET, if convenient (and in mode MODE if that's convenient). */
+
+static rtx
+expand_builtin_memchr (tree exp, rtx target, enum machine_mode mode)
+{
+ if (validate_arglist (exp, POINTER_TYPE, INTEGER_TYPE,
+ INTEGER_TYPE, VOID_TYPE))
+ {
+ tree type = TREE_TYPE (exp);
+ tree result = fold_builtin_memchr (CALL_EXPR_ARG (exp, 0),
+ CALL_EXPR_ARG (exp, 1),
+ CALL_EXPR_ARG (exp, 2), type);
+ if (result)
+ return expand_expr (result, target, mode, EXPAND_NORMAL);
+ }
+ return NULL_RTX;
+}
+
/* Expand expression EXP, which is a call to the memcmp built-in function.
Return NULL_RTX if we failed and the
caller should emit a normal call, otherwise try to get the result in
@@ -5015,7 +5050,7 @@ expand_builtin_bswap (tree exp, rtx target, rtx subtarget)
arg = CALL_EXPR_ARG (exp, 0);
mode = TYPE_MODE (TREE_TYPE (arg));
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
target = expand_unop (mode, bswap_optab, op0, target, 1);
@@ -5039,7 +5074,8 @@ expand_builtin_unop (enum machine_mode target_mode, tree exp, rtx target,
return NULL_RTX;
/* Compute the argument. */
- op0 = expand_expr (CALL_EXPR_ARG (exp, 0), subtarget, VOIDmode, 0);
+ op0 = expand_expr (CALL_EXPR_ARG (exp, 0), subtarget,
+ VOIDmode, EXPAND_NORMAL);
/* Compute op, into TARGET if possible.
Set TARGET to wherever the result comes back. */
target = expand_unop (TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 0))),
@@ -5118,7 +5154,7 @@ expand_builtin_fabs (tree exp, rtx target, rtx subtarget)
arg = CALL_EXPR_ARG (exp, 0);
mode = TYPE_MODE (TREE_TYPE (arg));
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
return expand_abs (mode, op0, target, 0, safe_from_p (target, arg, 1));
}
@@ -5742,7 +5778,7 @@ get_builtin_sync_mem (tree loc, enum machine_mode mode)
{
rtx addr, mem;
- addr = expand_expr (loc, NULL, Pmode, EXPAND_SUM);
+ addr = expand_expr (loc, NULL_RTX, Pmode, EXPAND_SUM);
/* Note that we explicitly do not want any alias information for this
memory, so that we kill all other live memories. Otherwise we don't
@@ -5775,7 +5811,7 @@ expand_builtin_sync_operation (enum machine_mode mode, tree exp,
/* Expand the operands. */
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
- val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL, mode, EXPAND_NORMAL);
+ val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL_RTX, mode, EXPAND_NORMAL);
/* If VAL is promoted to a wider mode, convert it back to MODE. Take care
of CONST_INTs, where we know the old_mode only from the call argument. */
old_mode = GET_MODE (val);
@@ -5805,7 +5841,8 @@ expand_builtin_compare_and_swap (enum machine_mode mode, tree exp,
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
- old_val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL, mode, EXPAND_NORMAL);
+ old_val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL_RTX,
+ mode, EXPAND_NORMAL);
/* If VAL is promoted to a wider mode, convert it back to MODE. Take care
of CONST_INTs, where we know the old_mode only from the call argument. */
old_mode = GET_MODE (old_val);
@@ -5813,7 +5850,8 @@ expand_builtin_compare_and_swap (enum machine_mode mode, tree exp,
old_mode = TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 1)));
old_val = convert_modes (mode, old_mode, old_val, 1);
- new_val = expand_expr (CALL_EXPR_ARG (exp, 2), NULL, mode, EXPAND_NORMAL);
+ new_val = expand_expr (CALL_EXPR_ARG (exp, 2), NULL_RTX,
+ mode, EXPAND_NORMAL);
/* If VAL is promoted to a wider mode, convert it back to MODE. Take care
of CONST_INTs, where we know the old_mode only from the call argument. */
old_mode = GET_MODE (new_val);
@@ -5842,7 +5880,7 @@ expand_builtin_lock_test_and_set (enum machine_mode mode, tree exp,
/* Expand the operands. */
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
- val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL, mode, EXPAND_NORMAL);
+ val = expand_expr (CALL_EXPR_ARG (exp, 1), NULL_RTX, mode, EXPAND_NORMAL);
/* If VAL is promoted to a wider mode, convert it back to MODE. Take care
of CONST_INTs, where we know the old_mode only from the call argument. */
old_mode = GET_MODE (val);
@@ -6343,6 +6381,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
return target;
break;
+ case BUILT_IN_MEMCHR:
+ target = expand_builtin_memchr (exp, target, mode);
+ if (target)
+ return target;
+ break;
+
case BUILT_IN_BCMP:
case BUILT_IN_MEMCMP:
target = expand_builtin_memcmp (exp, target, mode);
@@ -8652,6 +8696,48 @@ fold_builtin_strncpy (tree fndecl, tree dest, tree src, tree len, tree slen)
build_call_expr (fn, 3, dest, src, len));
}
+/* Fold function call to builtin memchr. ARG1, ARG2 and LEN are the
+ arguments to the call, and TYPE is its return type.
+ Return NULL_TREE if no simplification can be made. */
+
+static tree
+fold_builtin_memchr (tree arg1, tree arg2, tree len, tree type)
+{
+ if (!validate_arg (arg1, POINTER_TYPE)
+ || !validate_arg (arg2, INTEGER_TYPE)
+ || !validate_arg (len, INTEGER_TYPE))
+ return NULL_TREE;
+ else
+ {
+ const char *p1;
+
+ if (TREE_CODE (arg2) != INTEGER_CST
+ || !host_integerp (len, 1))
+ return NULL_TREE;
+
+ p1 = c_getstr (arg1);
+ if (p1 && compare_tree_int (len, strlen (p1) + 1) <= 0)
+ {
+ char c;
+ const char *r;
+ tree tem;
+
+ if (target_char_cast (arg2, &c))
+ return NULL_TREE;
+
+ r = memchr (p1, c, tree_low_cst (len, 1));
+
+ if (r == NULL)
+ return build_int_cst (TREE_TYPE (arg1), 0);
+
+ tem = fold_build2 (PLUS_EXPR, TREE_TYPE (arg1), arg1,
+ build_int_cst (TREE_TYPE (arg1), r - p1));
+ return fold_convert (type, tem);
+ }
+ return NULL_TREE;
+ }
+}
+
/* Fold function call to builtin memcmp with arguments ARG1 and ARG2.
Return NULL_TREE if no simplification can be made. */
@@ -9691,6 +9777,32 @@ fold_builtin_1 (tree fndecl, tree arg0, bool ignore)
&dconstm1, NULL, false);
break;
+#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
+ CASE_FLT_FN (BUILT_IN_J0):
+ if (validate_arg (arg0, REAL_TYPE))
+ return do_mpfr_arg1 (arg0, type, mpfr_j0,
+ NULL, NULL, 0);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_J1):
+ if (validate_arg (arg0, REAL_TYPE))
+ return do_mpfr_arg1 (arg0, type, mpfr_j1,
+ NULL, NULL, 0);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_Y0):
+ if (validate_arg (arg0, REAL_TYPE))
+ return do_mpfr_arg1 (arg0, type, mpfr_y0,
+ &dconst0, NULL, false);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_Y1):
+ if (validate_arg (arg0, REAL_TYPE))
+ return do_mpfr_arg1 (arg0, type, mpfr_y1,
+ &dconst0, NULL, false);
+ break;
+#endif
+
CASE_FLT_FN (BUILT_IN_NAN):
case BUILT_IN_NAND32:
case BUILT_IN_NAND64:
@@ -9801,6 +9913,27 @@ fold_builtin_2 (tree fndecl, tree arg0, tree arg1, bool ignore)
switch (fcode)
{
+#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
+ CASE_FLT_FN (BUILT_IN_JN):
+ if (validate_arg (arg0, INTEGER_TYPE)
+ && validate_arg (arg1, REAL_TYPE))
+ return do_mpfr_bessel_n (arg0, arg1, type, mpfr_jn, NULL, 0);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_YN):
+ if (validate_arg (arg0, INTEGER_TYPE)
+ && validate_arg (arg1, REAL_TYPE))
+ return do_mpfr_bessel_n (arg0, arg1, type, mpfr_yn,
+ &dconst0, false);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_DREM):
+ CASE_FLT_FN (BUILT_IN_REMAINDER):
+ if (validate_arg (arg0, REAL_TYPE)
+ && validate_arg(arg1, REAL_TYPE))
+ return do_mpfr_arg2 (arg0, arg1, type, mpfr_remainder);
+ break;
+#endif
CASE_FLT_FN (BUILT_IN_ATAN2):
if (validate_arg (arg0, REAL_TYPE)
@@ -9957,6 +10090,15 @@ fold_builtin_3 (tree fndecl, tree arg0, tree arg1, tree arg2, bool ignore)
return do_mpfr_arg3 (arg0, arg1, arg2, type, mpfr_fma);
break;
+#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
+ CASE_FLT_FN (BUILT_IN_REMQUO):
+ if (validate_arg (arg0, REAL_TYPE)
+ && validate_arg(arg1, REAL_TYPE)
+ && validate_arg(arg2, POINTER_TYPE))
+ return do_mpfr_remquo (arg0, arg1, arg2);
+ break;
+#endif
+
case BUILT_IN_MEMSET:
return fold_builtin_memset (arg0, arg1, arg2, type, ignore);
@@ -9981,6 +10123,9 @@ fold_builtin_3 (tree fndecl, tree arg0, tree arg1, tree arg2, bool ignore)
case BUILT_IN_STRNCMP:
return fold_builtin_strncmp (arg0, arg1, arg2);
+ case BUILT_IN_MEMCHR:
+ return fold_builtin_memchr (arg0, arg1, arg2, type);
+
case BUILT_IN_BCMP:
case BUILT_IN_MEMCMP:
return fold_builtin_memcmp (arg0, arg1, arg2);;
@@ -12427,3 +12572,122 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp)
}
return result;
}
+
+#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
+/* If argument ARG1 is an INTEGER_CST and ARG2 is a REAL_CST, call the
+ two-argument mpfr order N Bessel function FUNC on them and return
+ the resulting value as a tree with type TYPE. The mpfr precision
+ is set to the precision of TYPE. We assume that function FUNC
+ returns zero if the result could be calculated exactly within the
+ requested precision. */
+static tree
+do_mpfr_bessel_n (tree arg1, tree arg2, tree type,
+ int (*func)(mpfr_ptr, long, mpfr_srcptr, mp_rnd_t),
+ const REAL_VALUE_TYPE *min, bool inclusive)
+{
+ tree result = NULL_TREE;
+
+ STRIP_NOPS (arg1);
+ STRIP_NOPS (arg2);
+
+ /* To proceed, MPFR must exactly represent the target floating point
+ format, which only happens when the target base equals two. */
+ if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
+ && host_integerp (arg1, 0)
+ && TREE_CODE (arg2) == REAL_CST && !TREE_OVERFLOW (arg2))
+ {
+ const HOST_WIDE_INT n = tree_low_cst(arg1, 0);
+ const REAL_VALUE_TYPE *const ra = &TREE_REAL_CST (arg2);
+
+ if (n == (long)n
+ && !real_isnan (ra) && !real_isinf (ra)
+ && (!min || real_compare (inclusive ? GE_EXPR: GT_EXPR , ra, min)))
+ {
+ const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ int inexact;
+ mpfr_t m;
+
+ mpfr_init2 (m, prec);
+ mpfr_from_real (m, ra, GMP_RNDN);
+ mpfr_clear_flags ();
+ inexact = func (m, n, m, GMP_RNDN);
+ result = do_mpfr_ckconv (m, type, inexact);
+ mpfr_clear (m);
+ }
+ }
+
+ return result;
+}
+
+/* If arguments ARG0 and ARG1 are REAL_CSTs, call mpfr_remquo() to set
+ the pointer *(ARG_QUO) and return the result. The type is taken
+ from the type of ARG0 and is used for setting the precision of the
+ calculation and results. */
+
+static tree
+do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo)
+{
+ tree const type = TREE_TYPE (arg0);
+ tree result = NULL_TREE;
+
+ STRIP_NOPS (arg0);
+ STRIP_NOPS (arg1);
+
+ /* To proceed, MPFR must exactly represent the target floating point
+ format, which only happens when the target base equals two. */
+ if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
+ && TREE_CODE (arg0) == REAL_CST && !TREE_OVERFLOW (arg0)
+ && TREE_CODE (arg1) == REAL_CST && !TREE_OVERFLOW (arg1))
+ {
+ const REAL_VALUE_TYPE *const ra0 = TREE_REAL_CST_PTR (arg0);
+ const REAL_VALUE_TYPE *const ra1 = TREE_REAL_CST_PTR (arg1);
+
+ if (!real_isnan (ra0) && !real_isinf (ra0)
+ && !real_isnan (ra1) && !real_isinf (ra1))
+ {
+ const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ tree result_rem;
+ long integer_quo;
+ mpfr_t m0, m1;
+
+ mpfr_inits2 (prec, m0, m1, NULL);
+ mpfr_from_real (m0, ra0, GMP_RNDN);
+ mpfr_from_real (m1, ra1, GMP_RNDN);
+ mpfr_clear_flags ();
+ mpfr_remquo (m0, &integer_quo, m0, m1, GMP_RNDN);
+ /* Remquo is independent of the rounding mode, so pass
+ inexact=0 to do_mpfr_ckconv(). */
+ result_rem = do_mpfr_ckconv (m0, type, /*inexact=*/ 0);
+ mpfr_clears (m0, m1, NULL);
+ if (result_rem)
+ {
+ /* MPFR calculates quo in the host's long so it may
+ return more bits in quo than the target int can hold
+ if sizeof(host long) > sizeof(target int). This can
+ happen even for native compilers in LP64 mode. In
+ these cases, modulo the quo value with the largest
+ number that the target int can hold while leaving one
+ bit for the sign. */
+ if (sizeof (integer_quo) * CHAR_BIT > INT_TYPE_SIZE)
+ integer_quo %= (long)(1UL << (INT_TYPE_SIZE - 1));
+
+ /* Dereference the quo pointer argument. */
+ arg_quo = build_fold_indirect_ref (arg_quo);
+ /* Proceed iff a valid pointer type was passed in. */
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (arg_quo)) == integer_type_node)
+ {
+ /* Set the value. */
+ tree result_quo = fold_build2 (MODIFY_EXPR,
+ TREE_TYPE (arg_quo), arg_quo,
+ build_int_cst (NULL, integer_quo));
+ TREE_SIDE_EFFECTS (result_quo) = 1;
+ /* Combine the quo assignment with the rem. */
+ result = non_lvalue (fold_build2 (COMPOUND_EXPR, type,
+ result_quo, result_rem));
+ }
+ }
+ }
+ }
+ return result;
+}
+#endif
diff --git a/gcc/builtins.def b/gcc/builtins.def
index e0652c85233..7289fa6f9a8 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -258,6 +258,9 @@ DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPL, "frexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_I
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_STORE)
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA_R, "gamma_r", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF_R, "gammaf_r", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL_R, "gammal_r", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VAL, "huge_val", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALF, "huge_valf", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALL, "huge_vall", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
@@ -294,6 +297,9 @@ DEF_GCC_BUILTIN (BUILT_IN_LFLOORL, "lfloorl", BT_FN_LONG_LONGDOUBLE, ATTR
DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_STORE)
DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_LGAMMA_R, "lgamma_r", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_LGAMMAF_R, "lgammaf_r", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_LGAMMAL_R, "lgammal_r", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
DEF_GCC_BUILTIN (BUILT_IN_LLCEIL, "llceil", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_LLCEILF, "llceilf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_LLCEILL, "llceill", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
@@ -502,6 +508,7 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_BCMP, "bcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZ
DEF_EXT_LIB_BUILTIN (BUILT_IN_BCOPY, "bcopy", BT_FN_VOID_CONST_PTR_PTR_SIZE, ATTR_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
+DEF_LIB_BUILTIN (BUILT_IN_MEMCHR, "memchr", BT_FN_PTR_CONST_PTR_INT_SIZE, ATTR_PURE_NOTHROW_NONNULL)
DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL)
DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL)
DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL)
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 4e92ae6073d..6aa5e642c9b 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -670,11 +670,6 @@ const struct attribute_spec c_common_format_attribute_table[] =
{ NULL, 0, 0, false, false, false, NULL }
};
-/* Functions called automatically at the beginning and end of execution. */
-
-tree static_ctors;
-tree static_dtors;
-
/* Push current bindings for the function name VAR_DECLS. */
void
@@ -1019,35 +1014,67 @@ warn_logical_operator (enum tree_code code, tree arg1, tree
strict aliasing mode is in effect. OTYPE is the original
TREE_TYPE of EXPR, and TYPE the type we're casting to. */
-void
+bool
strict_aliasing_warning (tree otype, tree type, tree expr)
{
- if (flag_strict_aliasing && warn_strict_aliasing
- && POINTER_TYPE_P (type) && POINTER_TYPE_P (otype)
- && TREE_CODE (expr) == ADDR_EXPR
+ if (!(flag_strict_aliasing && POINTER_TYPE_P (type)
+ && POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type))))
+ return false;
+
+ if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR
&& (DECL_P (TREE_OPERAND (expr, 0))
- || handled_component_p (TREE_OPERAND (expr, 0)))
- && !VOID_TYPE_P (TREE_TYPE (type)))
+ || handled_component_p (TREE_OPERAND (expr, 0))))
{
/* Casting the address of an object to non void pointer. Warn
if the cast breaks type based aliasing. */
- if (!COMPLETE_TYPE_P (TREE_TYPE (type)))
- warning (OPT_Wstrict_aliasing, "type-punning to incomplete type "
- "might break strict-aliasing rules");
+ if (!COMPLETE_TYPE_P (TREE_TYPE (type)) && warn_strict_aliasing == 2)
+ {
+ warning (OPT_Wstrict_aliasing, "type-punning to incomplete type "
+ "might break strict-aliasing rules");
+ return true;
+ }
else
{
- HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0)));
+ /* warn_strict_aliasing >= 3. This includes the default (3).
+ Only warn if the cast is dereferenced immediately. */
+ HOST_WIDE_INT set1 =
+ get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0)));
HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type));
if (!alias_sets_conflict_p (set1, set2))
- warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
- "pointer will break strict-aliasing rules");
- else if (warn_strict_aliasing > 1
- && !alias_sets_might_conflict_p (set1, set2))
- warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
- "pointer might break strict-aliasing rules");
+ {
+ warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
+ "pointer will break strict-aliasing rules");
+ return true;
+ }
+ else if (warn_strict_aliasing == 2
+ && !alias_sets_might_conflict_p (set1, set2))
+ {
+ warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
+ "pointer might break strict-aliasing rules");
+ return true;
+ }
}
}
+ else
+ if ((warn_strict_aliasing == 1) && !VOID_TYPE_P (TREE_TYPE (otype)))
+ {
+ /* At this level, warn for any conversions, even if an address is
+ not taken in the same statement. This will likely produce many
+ false positives, but could be useful to pinpoint problems that
+ are not revealed at higher levels. */
+ HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (otype));
+ HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type));
+ if (!COMPLETE_TYPE_P(type)
+ || !alias_sets_might_conflict_p (set1, set2))
+ {
+ warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
+ "pointer might break strict-aliasing rules");
+ return true;
+ }
+ }
+
+ return false;
}
/* Print a warning about if (); or if () .. else; constructs
@@ -1303,7 +1330,7 @@ warnings_for_convert_and_check (tree type, tree expr, tree result)
else if (warn_conversion)
conversion_warning (type, expr);
}
- else if (!int_fits_type_p (expr, c_common_unsigned_type (type)))
+ else if (!int_fits_type_p (expr, unsigned_type_for (type)))
warning (OPT_Woverflow,
"overflow in implicit constant conversion");
/* No warning for converting 0x80000000 to int. */
@@ -1998,39 +2025,6 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
return 0;
}
-/* Return an unsigned type the same as TYPE in other respects. */
-tree
-c_common_unsigned_type (tree type)
-{
- tree type1 = TYPE_MAIN_VARIANT (type);
- if (type1 == signed_char_type_node || type1 == char_type_node)
- return unsigned_char_type_node;
- if (type1 == integer_type_node)
- return unsigned_type_node;
- if (type1 == short_integer_type_node)
- return short_unsigned_type_node;
- if (type1 == long_integer_type_node)
- return long_unsigned_type_node;
- if (type1 == long_long_integer_type_node)
- return long_long_unsigned_type_node;
- if (type1 == widest_integer_literal_type_node)
- return widest_unsigned_literal_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
- if (type1 == intTI_type_node)
- return unsigned_intTI_type_node;
-#endif
- if (type1 == intDI_type_node)
- return unsigned_intDI_type_node;
- if (type1 == intSI_type_node)
- return unsigned_intSI_type_node;
- if (type1 == intHI_type_node)
- return unsigned_intHI_type_node;
- if (type1 == intQI_type_node)
- return unsigned_intQI_type_node;
-
- return c_common_signed_or_unsigned_type (1, type);
-}
-
/* Return a signed type the same as TYPE in other respects. */
tree
@@ -2071,10 +2065,43 @@ c_common_signed_type (tree type)
tree
c_common_signed_or_unsigned_type (int unsignedp, tree type)
{
+ tree type1;
if (!INTEGRAL_TYPE_P (type)
|| TYPE_UNSIGNED (type) == unsignedp)
return type;
+ /* This block of code emulates the behavior of the old
+ c_common_unsigned_type. In particular, it returns
+ long_unsigned_type_node if passed a long, even when a int would
+ have the same size. This is necessary for warnings to work
+ correctly in archs where sizeof(int) == sizeof(long) */
+
+ type1 = TYPE_MAIN_VARIANT (type);
+ if (type1 == signed_char_type_node || type1 == char_type_node || type1 == unsigned_char_type_node)
+ return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+ if (type1 == integer_type_node || type1 == unsigned_type_node)
+ return unsignedp ? unsigned_type_node : integer_type_node;
+ if (type1 == short_integer_type_node || type1 == short_unsigned_type_node)
+ return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+ if (type1 == long_integer_type_node || type1 == long_unsigned_type_node)
+ return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+ if (type1 == long_long_integer_type_node || type1 == long_long_unsigned_type_node)
+ return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
+ if (type1 == widest_integer_literal_type_node || type1 == widest_unsigned_literal_type_node)
+ return unsignedp ? widest_unsigned_literal_type_node : widest_integer_literal_type_node;
+#if HOST_BITS_PER_WIDE_INT >= 64
+ if (type1 == intTI_type_node || type1 == unsigned_intTI_type_node)
+ return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
+#endif
+ if (type1 == intDI_type_node || type1 == unsigned_intDI_type_node)
+ return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+ if (type1 == intSI_type_node || type1 == unsigned_intSI_type_node)
+ return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+ if (type1 == intHI_type_node || type1 == unsigned_intHI_type_node)
+ return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+ if (type1 == intQI_type_node || type1 == unsigned_intQI_type_node)
+ return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
/* For ENUMERAL_TYPEs in C++, must check the mode of the types, not
the precision; they have precision set to match their range, but
may use a wider mode to match an ABI. If we change modes, we may
@@ -2473,7 +2500,8 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
default:
break;
}
- type = c_common_unsigned_type (type);
+ /* unsigned_type_for doesn't support C bit fields */
+ type = c_common_signed_or_unsigned_type (1, type);
}
if (TREE_CODE (primop0) != INTEGER_CST)
@@ -3640,7 +3668,7 @@ c_common_nodes_and_builtins (void)
else
{
signed_wchar_type_node = c_common_signed_type (wchar_type_node);
- unsigned_wchar_type_node = c_common_unsigned_type (wchar_type_node);
+ unsigned_wchar_type_node = unsigned_type_for (wchar_type_node);
}
/* This is for wide string constants. */
@@ -3658,7 +3686,7 @@ c_common_nodes_and_builtins (void)
default_function_type = build_function_type (integer_type_node, NULL_TREE);
ptrdiff_type_node
= TREE_TYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE)));
- unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node);
+ unsigned_ptrdiff_type_node = unsigned_type_for (ptrdiff_type_node);
lang_hooks.decls.pushdecl
(build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"),
@@ -6994,61 +7022,6 @@ warn_for_unused_label (tree label)
}
}
-/* If FNDECL is a static constructor or destructor, add it to the list
- of functions to be called by the file scope initialization
- function. */
-
-void
-c_record_cdtor_fn (tree fndecl)
-{
- if (targetm.have_ctors_dtors)
- return;
-
- if (DECL_STATIC_CONSTRUCTOR (fndecl))
- static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors);
- if (DECL_STATIC_DESTRUCTOR (fndecl))
- static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors);
-}
-
-/* Synthesize a function which calls all the global ctors or global
- dtors in this file. This is only used for targets which do not
- support .ctors/.dtors sections. FIXME: Migrate into cgraph. */
-static void
-build_cdtor (int method_type, tree cdtors)
-{
- tree body = 0;
-
- if (!cdtors)
- return;
-
- for (; cdtors; cdtors = TREE_CHAIN (cdtors))
- append_to_statement_list (build_function_call (TREE_VALUE (cdtors), 0),
- &body);
-
- cgraph_build_static_cdtor (method_type, body, DEFAULT_INIT_PRIORITY);
-}
-
-/* Generate functions to call static constructors and destructors
- for targets that do not support .ctors/.dtors sections. These
- functions have magic names which are detected by collect2. */
-
-void
-c_build_cdtor_fns (void)
-{
- if (!targetm.have_ctors_dtors)
- {
- build_cdtor ('I', static_ctors);
- static_ctors = NULL_TREE;
- build_cdtor ('D', static_dtors);
- static_dtors = NULL_TREE;
- }
- else
- {
- gcc_assert (!static_ctors);
- gcc_assert (!static_dtors);
- }
-}
-
#ifndef TARGET_HAS_TARGETCM
struct gcc_targetcm targetcm = TARGETCM_INITIALIZER;
#endif
diff --git a/gcc/c-common.h b/gcc/c-common.h
index d4afaec4535..71a958db93a 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -254,6 +254,8 @@ extern c_language_kind c_language;
#define c_dialect_cxx() (c_language & clk_cxx)
#define c_dialect_objc() (c_language & clk_objc)
+extern bool lang_fortran;
+
/* Information about a statement tree. */
struct stmt_tree_s GTY(()) {
@@ -665,7 +667,6 @@ extern int c_common_handle_option (size_t code, const char *arg, int value);
extern bool c_common_missing_argument (const char *opt, size_t code);
extern tree c_common_type_for_mode (enum machine_mode, int);
extern tree c_common_type_for_size (unsigned int, int);
-extern tree c_common_unsigned_type (tree);
extern tree c_common_signed_type (tree);
extern tree c_common_signed_or_unsigned_type (int, tree);
extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
@@ -680,7 +681,7 @@ extern void binary_op_error (enum tree_code);
extern tree fix_string_type (tree);
struct varray_head_tag;
extern void constant_expression_warning (tree);
-extern void strict_aliasing_warning (tree, tree, tree);
+extern bool strict_aliasing_warning (tree, tree, tree);
extern void empty_if_body_warning (tree, tree);
extern void warnings_for_convert_and_check (tree, tree, tree);
extern tree convert_and_check (tree, tree);
@@ -1003,11 +1004,4 @@ extern tree c_omp_remap_decl (tree, bool);
#define GCC_DIAG_STYLE __gcc_cdiag__
#endif
-/* Functions called automatically at the beginning and end of execution. */
-extern GTY (()) tree static_ctors;
-extern GTY (()) tree static_dtors;
-
-extern void c_record_cdtor_fn (tree);
-extern void c_build_cdtor_fns (void);
-
#endif /* ! GCC_C_COMMON_H */
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index c36b038bc77..cc19ce5dd7d 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -569,6 +569,9 @@ c_cpp_builtins (cpp_reader *pfile)
if (flag_openmp)
cpp_define (pfile, "_OPENMP=200505");
+ if (lang_fortran)
+ cpp_define (pfile, "__GFORTRAN__=1");
+
builtin_define_type_sizeof ("__SIZEOF_INT__", integer_type_node);
builtin_define_type_sizeof ("__SIZEOF_LONG__", long_integer_type_node);
builtin_define_type_sizeof ("__SIZEOF_LONG_LONG__",
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 3af18571794..db8412cc010 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4086,7 +4086,7 @@ grokdeclarator (const struct c_declarator *declarator,
"signed". */
if (bitfield && !flag_signed_bitfields && !declspecs->explicit_signed_p
&& TREE_CODE (type) == INTEGER_TYPE)
- type = c_common_unsigned_type (type);
+ type = unsigned_type_for (type);
/* Figure out the type qualifiers for the declaration. There are
two ways a declaration can become qualified. One is something
@@ -6799,10 +6799,6 @@ finish_function (void)
info for the epilogue. */
cfun->function_end_locus = input_location;
- /* Keep track of functions declared with the "constructor" and
- "destructor" attribute. */
- c_record_cdtor_fn (fndecl);
-
/* Finalize the ELF visibility for the function. */
c_determine_visibility (fndecl);
@@ -7923,10 +7919,6 @@ c_write_global_declarations (void)
c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t)));
c_write_global_declarations_1 (BLOCK_VARS (ext_block));
- /* Call functions declared with the "constructor" or "destructor"
- attribute. */
- c_build_cdtor_fns ();
-
/* We're done parsing; proceed to optimize and emit assembly.
FIXME: shouldn't be the front end's responsibility to call this. */
cgraph_optimize ();
diff --git a/gcc/c-format.c b/gcc/c-format.c
index a64e30984ee..92e4ee61b0c 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -2249,7 +2249,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& TREE_CODE (cur_type) == INTEGER_TYPE
&& (!pedantic || i == 0 || (i == 1 && char_type_flag))
&& (TYPE_UNSIGNED (wanted_type)
- ? wanted_type == c_common_unsigned_type (cur_type)
+ ? wanted_type == unsigned_type_for (cur_type)
: wanted_type == c_common_signed_type (cur_type)))
continue;
/* Likewise, "signed char", "unsigned char" and "char" are
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index 3e819cec838..8b6512c8e0f 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -389,13 +389,18 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
cpp_dir *p;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Convert all backslashes to slashes. The native CRT stat()
- function does not recognize a directory that ends in a backslash
- (unless it is a drive root dir, such "c:\"). Forward slashes,
- trailing or otherwise, cause no problems for stat(). */
- char* c;
- for (c = path; *c; c++)
- if (*c == '\\') *c = '/';
+ /* Remove unnecessary trailing slashes. On some versions of MS
+ Windows, trailing _forward_ slashes cause no problems for stat().
+ On newer versions, stat() does not recognise a directory that ends
+ in a '\\' or '/', unless it is a drive root dir, such as "c:/",
+ where it is obligatory. */
+ int pathlen = strlen (path);
+ char* end = path + pathlen - 1;
+ /* Preserve the lead '/' or lead "c:/". */
+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1);
+
+ for (; end > start && IS_DIR_SEPARATOR (*end); end--)
+ *end = 0;
#endif
p = XNEW (cpp_dir);
diff --git a/gcc/c-objc-common.h b/gcc/c-objc-common.h
index 78438ad9ef8..9b923b54375 100644
--- a/gcc/c-objc-common.h
+++ b/gcc/c-objc-common.h
@@ -104,8 +104,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
#undef LANG_HOOKS_SIGNED_TYPE
#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
-#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index e378f377a0c..ed832afa788 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -73,7 +73,7 @@ static bool deps_seen;
static bool verbose;
/* If -lang-fortran seen. */
-static bool lang_fortran = false;
+bool lang_fortran = false;
/* Dependency output file. */
static const char *deps_file;
@@ -400,7 +400,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
if (c_dialect_cxx ())
warn_sign_compare = value;
warn_switch = value;
- warn_strict_aliasing = value;
+ set_Wstrict_aliasing (value);
warn_address = value;
warn_strict_overflow = value;
warn_array_bounds = value;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index a3cd563e531..2bf767776ba 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1876,6 +1876,19 @@ build_indirect_ref (tree ptr, const char *errorstring)
if (TREE_CODE (type) == POINTER_TYPE)
{
+ if (TREE_CODE (pointer) == CONVERT_EXPR
+ || TREE_CODE (pointer) == NOP_EXPR
+ || TREE_CODE (pointer) == VIEW_CONVERT_EXPR)
+ {
+ /* If a warning is issued, mark it to avoid duplicates from
+ the backend. This only needs to be done at
+ warn_strict_aliasing > 2. */
+ if (warn_strict_aliasing > 2)
+ if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (pointer, 0)),
+ type, TREE_OPERAND (pointer, 0)))
+ TREE_NO_WARNING (pointer) = 1;
+ }
+
if (TREE_CODE (pointer) == ADDR_EXPR
&& (TREE_TYPE (TREE_OPERAND (pointer, 0))
== TREE_TYPE (type)))
@@ -3574,7 +3587,8 @@ build_c_cast (tree type, tree expr)
warning (OPT_Wint_to_pointer_cast, "cast to pointer from integer "
"of different size");
- strict_aliasing_warning (otype, type, expr);
+ if (warn_strict_aliasing <= 2)
+ strict_aliasing_warning (otype, type, expr);
/* If pedantic, warn for conversions between function and object
pointer types, except for converting a null pointer constant
@@ -4081,8 +4095,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr)
|| (target_cmp = comp_target_types (type, rhstype))
|| is_opaque_pointer
- || (c_common_unsigned_type (mvl)
- == c_common_unsigned_type (mvr)))
+ || (unsigned_type_for (mvl)
+ == unsigned_type_for (mvr)))
{
if (pedantic
&& ((VOID_TYPE_P (ttl) && TREE_CODE (ttr) == FUNCTION_TYPE)
@@ -8134,7 +8148,11 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);
if (shorten || common || short_compare)
- result_type = c_common_type (type0, type1);
+ {
+ result_type = c_common_type (type0, type1);
+ if (result_type == error_mark_node)
+ return error_mark_node;
+ }
/* For certain operations (which identify themselves by shorten != 0)
if both args were extended from the same smaller type,
diff --git a/gcc/c.opt b/gcc/c.opt
index 61aaf82fef4..0635fdca13c 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -271,7 +271,7 @@ C ObjC C++ ObjC++ Var(warn_long_long) Init(1) Warning
Do not warn about using \"long long\" when -pedantic
Wmain
-C ObjC Warning
+C ObjC C++ ObjC++ Warning
Warn about suspicious declarations of \"main\"
Wmissing-braces
@@ -551,7 +551,7 @@ C++ ObjC++
Scope of for-init-statement variables is local to the loop
ffreestanding
-C ObjC
+C ObjC C++ ObjC++
Do not assume that standard C libraries and \"main\" exist
fgnu-keywords
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 1fa3aa76498..7f544c3ee3c 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -486,9 +486,9 @@ delete_basic_block (basic_block bb)
while (EDGE_COUNT (bb->succs) != 0)
remove_edge (EDGE_SUCC (bb, 0));
- if (dom_computed[CDI_DOMINATORS])
+ if (dom_info_available_p (CDI_DOMINATORS))
delete_from_dominance_info (CDI_DOMINATORS, bb);
- if (dom_computed[CDI_POST_DOMINATORS])
+ if (dom_info_available_p (CDI_POST_DOMINATORS))
delete_from_dominance_info (CDI_POST_DOMINATORS, bb);
/* Remove the basic block from the array. */
@@ -527,10 +527,10 @@ split_edge (edge e)
single_succ_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP;
}
- if (dom_computed[CDI_DOMINATORS])
+ if (dom_info_available_p (CDI_DOMINATORS))
set_immediate_dominator (CDI_DOMINATORS, ret, single_pred (ret));
- if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ if (dom_info_state (CDI_DOMINATORS) >= DOM_NO_FAST_QUERY)
{
/* There are two cases:
@@ -586,9 +586,9 @@ create_basic_block (void *head, void *end, basic_block after)
ret = cfg_hooks->create_basic_block (head, end, after);
- if (dom_computed[CDI_DOMINATORS])
+ if (dom_info_available_p (CDI_DOMINATORS))
add_to_dominance_info (CDI_DOMINATORS, ret);
- if (dom_computed[CDI_POST_DOMINATORS])
+ if (dom_info_available_p (CDI_POST_DOMINATORS))
add_to_dominance_info (CDI_POST_DOMINATORS, ret);
return ret;
@@ -676,12 +676,12 @@ merge_blocks (basic_block a, basic_block b)
/* B hasn't quite yet ceased to exist. Attempt to prevent mishap. */
b->preds = b->succs = NULL;
- if (dom_computed[CDI_DOMINATORS])
+ if (dom_info_available_p (CDI_DOMINATORS))
redirect_immediate_dominators (CDI_DOMINATORS, b, a);
- if (dom_computed[CDI_DOMINATORS])
+ if (dom_info_available_p (CDI_DOMINATORS))
delete_from_dominance_info (CDI_DOMINATORS, b);
- if (dom_computed[CDI_POST_DOMINATORS])
+ if (dom_info_available_p (CDI_POST_DOMINATORS))
delete_from_dominance_info (CDI_POST_DOMINATORS, b);
expunge_block (b);
@@ -767,7 +767,7 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
}
/* In case we split loop latch, update it. */
- for (ploop = loop; ploop; ploop = ploop->outer)
+ for (ploop = loop; ploop; ploop = loop_outer (ploop))
if (ploop->latch == dummy)
ploop->latch = bb;
}
@@ -923,9 +923,15 @@ duplicate_block (basic_block bb, edge e, basic_block after)
set_bb_original (new_bb, bb);
set_bb_copy (bb, new_bb);
- /* Add the new block to the prescribed loop. */
+ /* Add the new block to the copy of the loop of BB, or directly to the loop
+ of BB if the loop is not being copied. */
if (current_loops != NULL)
- add_bb_to_loop (new_bb, bb->loop_father->copy);
+ {
+ struct loop *cloop = bb->loop_father;
+ if (cloop->copy)
+ cloop = cloop->copy;
+ add_bb_to_loop (new_bb, cloop);
+ }
return new_bb;
}
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 5e2083e9c25..3bf1b6927d4 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -34,9 +34,9 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "tree-flow.h"
#include "pointer-set.h"
#include "output.h"
+#include "ggc.h"
static void flow_loops_cfg_dump (FILE *);
-static void establish_preds (struct loop *);
/* Dump loop related CFG information. */
@@ -65,8 +65,10 @@ flow_loops_cfg_dump (FILE *file)
bool
flow_loop_nested_p (const struct loop *outer, const struct loop *loop)
{
- return (loop->depth > outer->depth
- && loop->pred[outer->depth] == outer);
+ unsigned odepth = loop_depth (outer);
+
+ return (loop_depth (loop) > odepth
+ && VEC_index (loop_p, loop->superloops, odepth) == outer);
}
/* Returns the loop such that LOOP is nested DEPTH (indexed from zero)
@@ -75,12 +77,14 @@ flow_loop_nested_p (const struct loop *outer, const struct loop *loop)
struct loop *
superloop_at_depth (struct loop *loop, unsigned depth)
{
- gcc_assert (depth <= (unsigned) loop->depth);
+ unsigned ldepth = loop_depth (loop);
+
+ gcc_assert (depth <= ldepth);
- if (depth == (unsigned) loop->depth)
+ if (depth == ldepth)
return loop;
- return loop->pred[depth];
+ return VEC_index (loop_p, loop->superloops, depth);
}
/* Returns the list of the latch edges of LOOP. */
@@ -133,7 +137,8 @@ flow_loop_dump (const struct loop *loop, FILE *file,
}
fprintf (file, ";; depth %d, outer %ld\n",
- loop->depth, (long) (loop->outer ? loop->outer->num : -1));
+ loop_depth (loop), (long) (loop_outer (loop)
+ ? loop_outer (loop)->num : -1));
fprintf (file, ";; nodes:");
bbs = get_loop_body (loop);
@@ -170,26 +175,27 @@ flow_loops_dump (FILE *file, void (*loop_dump_aux) (const struct loop *, FILE *,
}
/* Free data allocated for LOOP. */
+
void
flow_loop_free (struct loop *loop)
{
struct loop_exit *exit, *next;
- if (loop->pred)
- free (loop->pred);
+ VEC_free (loop_p, gc, loop->superloops);
/* Break the list of the loop exit records. They will be freed when the
corresponding edge is rescanned or removed, and this avoids
accessing the (already released) head of the list stored in the
loop structure. */
- for (exit = loop->exits.next; exit != &loop->exits; exit = next)
+ for (exit = loop->exits->next; exit != loop->exits; exit = next)
{
next = exit->next;
exit->next = exit;
exit->prev = exit;
}
-
- free (loop);
+
+ ggc_free (loop->exits);
+ ggc_free (loop);
}
/* Free all the memory allocated for LOOPS. */
@@ -211,8 +217,7 @@ flow_loops_free (struct loops *loops)
flow_loop_free (loop);
}
- VEC_free (loop_p, heap, loops->larray);
- loops->larray = NULL;
+ VEC_free (loop_p, gc, loops->larray);
}
}
@@ -226,9 +231,10 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
int num_nodes = 1;
edge latch;
edge_iterator latch_ei;
+ unsigned depth = loop_depth (loop);
header->loop_father = loop;
- header->loop_depth = loop->depth;
+ header->loop_depth = depth;
FOR_EACH_EDGE (latch, latch_ei, loop->header->preds)
{
@@ -239,7 +245,7 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
num_nodes++;
VEC_safe_push (basic_block, heap, stack, latch->src);
latch->src->loop_father = loop;
- latch->src->loop_depth = loop->depth;
+ latch->src->loop_depth = depth;
while (!VEC_empty (basic_block, stack))
{
@@ -256,7 +262,7 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
if (ancestor->loop_father != loop)
{
ancestor->loop_father = loop;
- ancestor->loop_depth = loop->depth;
+ ancestor->loop_depth = depth;
num_nodes++;
VEC_safe_push (basic_block, heap, stack, ancestor);
}
@@ -268,21 +274,27 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
return num_nodes;
}
+/* Records the vector of superloops of the loop LOOP, whose immediate
+ superloop is FATHER. */
+
static void
-establish_preds (struct loop *loop)
+establish_preds (struct loop *loop, struct loop *father)
{
- struct loop *ploop, *father = loop->outer;
+ loop_p ploop;
+ unsigned depth = loop_depth (father) + 1;
+ unsigned i;
- loop->depth = father->depth + 1;
+ /* Remember the current loop depth if it is the largest seen so far. */
+ cfun->max_loop_depth = MAX (cfun->max_loop_depth, (int) depth);
- if (loop->pred)
- free (loop->pred);
- loop->pred = XNEWVEC (struct loop *, loop->depth);
- memcpy (loop->pred, father->pred, sizeof (struct loop *) * father->depth);
- loop->pred[father->depth] = father;
+ VEC_truncate (loop_p, loop->superloops, 0);
+ VEC_reserve (loop_p, gc, loop->superloops, depth);
+ for (i = 0; VEC_iterate (loop_p, father->superloops, i, ploop); i++)
+ VEC_quick_push (loop_p, loop->superloops, ploop);
+ VEC_quick_push (loop_p, loop->superloops, father);
for (ploop = loop->inner; ploop; ploop = ploop->next)
- establish_preds (ploop);
+ establish_preds (ploop, loop);
}
/* Add LOOP to the loop hierarchy tree where FATHER is father of the
@@ -294,9 +306,8 @@ flow_loop_tree_node_add (struct loop *father, struct loop *loop)
{
loop->next = father->inner;
father->inner = loop;
- loop->outer = father;
- establish_preds (loop);
+ establish_preds (loop, father);
}
/* Remove LOOP from the loop hierarchy tree. */
@@ -306,21 +317,19 @@ flow_loop_tree_node_remove (struct loop *loop)
{
struct loop *prev, *father;
- father = loop->outer;
- loop->outer = NULL;
+ father = loop_outer (loop);
/* Remove loop from the list of sons. */
if (father->inner == loop)
father->inner = loop->next;
else
{
- for (prev = father->inner; prev->next != loop; prev = prev->next);
+ for (prev = father->inner; prev->next != loop; prev = prev->next)
+ continue;
prev->next = loop->next;
}
- loop->depth = -1;
- free (loop->pred);
- loop->pred = NULL;
+ VEC_truncate (loop_p, loop->superloops, 0);
}
/* Allocates and returns new loop structure. */
@@ -328,9 +337,11 @@ flow_loop_tree_node_remove (struct loop *loop)
struct loop *
alloc_loop (void)
{
- struct loop *loop = XCNEW (struct loop);
+ struct loop *loop = GGC_CNEW (struct loop);
+
+ loop->exits = GGC_CNEW (struct loop_exit);
+ loop->exits->next = loop->exits->prev = loop->exits;
- loop->exits.next = loop->exits.prev = &loop->exits;
return loop;
}
@@ -406,7 +417,7 @@ flow_loops_find (struct loops *loops)
}
/* Allocate loop structures. */
- loops->larray = VEC_alloc (loop_p, heap, num_loops + 1);
+ loops->larray = VEC_alloc (loop_p, gc, num_loops + 1);
/* Dummy loop containing whole function. */
root = alloc_loop ();
@@ -950,7 +961,7 @@ loop_exit_free (void *ex)
exit->next->prev = exit->prev;
exit->prev->next = exit->next;
- free (exit);
+ ggc_free (exit);
}
}
@@ -987,13 +998,13 @@ rescan_loop_exit (edge e, bool new_edge, bool removed)
cloop = find_common_loop (e->src->loop_father, e->dest->loop_father);
for (aloop = e->src->loop_father;
aloop != cloop;
- aloop = aloop->outer)
+ aloop = loop_outer (aloop))
{
- exit = XNEW (struct loop_exit);
+ exit = GGC_NEW (struct loop_exit);
exit->e = e;
- exit->next = aloop->exits.next;
- exit->prev = &aloop->exits;
+ exit->next = aloop->exits->next;
+ exit->prev = aloop->exits;
exit->next->prev = exit;
exit->prev->next = exit;
@@ -1039,10 +1050,11 @@ record_loop_exits (void)
current_loops->state |= LOOPS_HAVE_RECORDED_EXITS;
gcc_assert (current_loops->exits == NULL);
- current_loops->exits = htab_create (2 * number_of_loops (),
- loop_exit_hash,
- loop_exit_eq,
- loop_exit_free);
+ current_loops->exits = htab_create_alloc (2 * number_of_loops (),
+ loop_exit_hash,
+ loop_exit_eq,
+ loop_exit_free,
+ ggc_calloc, ggc_free);
FOR_EACH_BB (bb)
{
@@ -1112,7 +1124,7 @@ get_loop_exit_edges (const struct loop *loop)
scan the body of the loop. */
if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
{
- for (exit = loop->exits.next; exit->e; exit = exit->next)
+ for (exit = loop->exits->next; exit->e; exit = exit->next)
VEC_safe_push (edge, heap, edges, exit->e);
}
else
@@ -1154,16 +1166,17 @@ num_loop_branches (const struct loop *loop)
void
add_bb_to_loop (basic_block bb, struct loop *loop)
{
- int i;
+ unsigned i;
+ loop_p ploop;
edge_iterator ei;
edge e;
gcc_assert (bb->loop_father == NULL);
bb->loop_father = loop;
- bb->loop_depth = loop->depth;
+ bb->loop_depth = loop_depth (loop);
loop->num_nodes++;
- for (i = 0; i < loop->depth; i++)
- loop->pred[i]->num_nodes++;
+ for (i = 0; VEC_iterate (loop_p, loop->superloops, i, ploop); i++)
+ ploop->num_nodes++;
FOR_EACH_EDGE (e, ei, bb->succs)
{
@@ -1181,13 +1194,14 @@ remove_bb_from_loops (basic_block bb)
{
int i;
struct loop *loop = bb->loop_father;
+ loop_p ploop;
edge_iterator ei;
edge e;
gcc_assert (loop != NULL);
loop->num_nodes--;
- for (i = 0; i < loop->depth; i++)
- loop->pred[i]->num_nodes--;
+ for (i = 0; VEC_iterate (loop_p, loop->superloops, i, ploop); i++)
+ ploop->num_nodes--;
bb->loop_father = NULL;
bb->loop_depth = 0;
@@ -1205,18 +1219,23 @@ remove_bb_from_loops (basic_block bb)
struct loop *
find_common_loop (struct loop *loop_s, struct loop *loop_d)
{
+ unsigned sdepth, ddepth;
+
if (!loop_s) return loop_d;
if (!loop_d) return loop_s;
- if (loop_s->depth < loop_d->depth)
- loop_d = loop_d->pred[loop_s->depth];
- else if (loop_s->depth > loop_d->depth)
- loop_s = loop_s->pred[loop_d->depth];
+ sdepth = loop_depth (loop_s);
+ ddepth = loop_depth (loop_d);
+
+ if (sdepth < ddepth)
+ loop_d = VEC_index (loop_p, loop_d->superloops, sdepth);
+ else if (sdepth > ddepth)
+ loop_s = VEC_index (loop_p, loop_s->superloops, ddepth);
while (loop_s != loop_d)
{
- loop_s = loop_s->outer;
- loop_d = loop_d->outer;
+ loop_s = loop_outer (loop_s);
+ loop_d = loop_outer (loop_d);
}
return loop_s;
}
@@ -1243,13 +1262,14 @@ cancel_loop (struct loop *loop)
{
basic_block *bbs;
unsigned i;
+ struct loop *outer = loop_outer (loop);
gcc_assert (!loop->inner);
/* Move blocks up one level (they should be removed as soon as possible). */
bbs = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
- bbs[i]->loop_father = loop->outer;
+ bbs[i]->loop_father = outer;
delete_loop (loop);
}
@@ -1288,7 +1308,7 @@ verify_loop_structure (void)
sizes[0] = 2;
FOR_EACH_BB (bb)
- for (loop = bb->loop_father; loop; loop = loop->outer)
+ for (loop = bb->loop_father; loop; loop = loop_outer (loop))
sizes[loop->num]++;
FOR_EACH_LOOP (li, loop, LI_INCLUDE_ROOT)
@@ -1422,7 +1442,7 @@ verify_loop_structure (void)
/* Check the recorded loop exits. */
FOR_EACH_LOOP (li, loop, 0)
{
- if (loop->exits.e != NULL)
+ if (!loop->exits || loop->exits->e != NULL)
{
error ("corrupted head of the exits list of loop %d",
loop->num);
@@ -1432,7 +1452,7 @@ verify_loop_structure (void)
{
/* Check that the list forms a cycle, and all elements except
for the head are nonnull. */
- for (mexit = &loop->exits, exit = mexit->next, i = 0;
+ for (mexit = loop->exits, exit = mexit->next, i = 0;
exit->e && exit != mexit;
exit = exit->next)
{
@@ -1440,7 +1460,7 @@ verify_loop_structure (void)
mexit = mexit->next;
}
- if (exit != &loop->exits)
+ if (exit != loop->exits)
{
error ("corrupted exits list of loop %d", loop->num);
err = 1;
@@ -1449,7 +1469,7 @@ verify_loop_structure (void)
if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
{
- if (loop->exits.next != &loop->exits)
+ if (loop->exits->next != loop->exits)
{
error ("nonempty exits list of loop %d, but exits are not recorded",
loop->num);
@@ -1487,7 +1507,7 @@ verify_loop_structure (void)
for (loop = bb->loop_father;
loop != e->dest->loop_father;
- loop = loop->outer)
+ loop = loop_outer (loop))
{
eloops--;
sizes[loop->num]++;
@@ -1511,7 +1531,7 @@ verify_loop_structure (void)
FOR_EACH_LOOP (li, loop, 0)
{
eloops = 0;
- for (exit = loop->exits.next; exit->e; exit = exit->next)
+ for (exit = loop->exits->next; exit->e; exit = exit->next)
eloops++;
if (eloops != sizes[loop->num])
{
@@ -1566,12 +1586,12 @@ loop_exit_edge_p (const struct loop *loop, edge e)
edge
single_exit (const struct loop *loop)
{
- struct loop_exit *exit = loop->exits.next;
+ struct loop_exit *exit = loop->exits->next;
if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
return NULL;
- if (exit->e && exit->next == &loop->exits)
+ if (exit->e && exit->next == loop->exits)
return exit->e;
else
return NULL;
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 61d3ec2b005..ef88a472f73 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -39,7 +39,7 @@ enum lpt_dec
LPT_UNROLL_STUPID
};
-struct lpt_decision
+struct lpt_decision GTY (())
{
enum lpt_dec decision;
unsigned times;
@@ -47,7 +47,7 @@ struct lpt_decision
/* The structure describing a bound on number of iterations of a loop. */
-struct nb_iter_bound
+struct nb_iter_bound GTY ((chain_next ("%h.next")))
{
/* The statement STMT is executed at most ... */
tree stmt;
@@ -72,10 +72,10 @@ struct nb_iter_bound
/* Description of the loop exit. */
-struct loop_exit
+struct loop_exit GTY (())
{
/* The exit edge. */
- edge e;
+ struct edge_def *e;
/* Previous and next exit in the list of the exits of the loop. */
struct loop_exit *prev;
@@ -85,17 +85,22 @@ struct loop_exit
struct loop_exit *next_e;
};
+typedef struct loop *loop_p;
+DEF_VEC_P (loop_p);
+DEF_VEC_ALLOC_P (loop_p, heap);
+DEF_VEC_ALLOC_P (loop_p, gc);
+
/* Structure to hold information for each natural loop. */
-struct loop
+struct loop GTY ((chain_next ("%h.next")))
{
/* Index into loops array. */
int num;
/* Basic block of loop header. */
- basic_block header;
+ struct basic_block_def *header;
/* Basic block of loop latch. */
- basic_block latch;
+ struct basic_block_def *latch;
/* For loop unrolling/peeling decision. */
struct lpt_decision lpt_decision;
@@ -109,14 +114,8 @@ struct loop
/* Number of blocks contained within the loop. */
unsigned num_nodes;
- /* The loop nesting depth. */
- int depth;
-
- /* Superloops of the loop. */
- struct loop **pred;
-
- /* The outer (parent) loop or NULL if outermost loop. */
- struct loop *outer;
+ /* Superloops of the loop, starting with the outermost loop. */
+ VEC (loop_p, gc) *superloops;
/* The first inner (child) loop or NULL if innermost loop. */
struct loop *inner;
@@ -128,7 +127,7 @@ struct loop
struct loop *copy;
/* Auxiliary info specific to a pass. */
- void *aux;
+ PTR GTY ((skip (""))) aux;
/* The number of times the latch of the loop is executed.
This is an INTEGER_CST or an expression containing symbolic
@@ -160,7 +159,7 @@ struct loop
struct nb_iter_bound *bounds;
/* Head of the cyclic list of the exits of the loop. */
- struct loop_exit exits;
+ struct loop_exit *exits;
};
/* Flags for state of loop structure. */
@@ -178,23 +177,19 @@ enum
| LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
#define AVOID_CFG_MODIFICATIONS (LOOPS_MAY_HAVE_MULTIPLE_LATCHES)
-typedef struct loop *loop_p;
-DEF_VEC_P (loop_p);
-DEF_VEC_ALLOC_P (loop_p, heap);
-
/* Structure to hold CFG information about natural loops within a function. */
-struct loops
+struct loops GTY (())
{
/* State of loops. */
int state;
/* Array of the loops. */
- VEC (loop_p, heap) *larray;
+ VEC (loop_p, gc) *larray;
/* Maps edges to the list of their descriptions as loop exits. Edges
whose sources or destinations have loop_father == NULL (which may
happen during the cfg manipulations) should not appear in EXITS. */
- htab_t exits;
+ htab_t GTY((param_is (struct loop_exit))) exits;
/* Pointer to root of loop hierarchy tree. */
struct loop *tree_root;
@@ -257,6 +252,7 @@ enum
CP_SIMPLE_PREHEADERS = 1
};
+basic_block create_preheader (struct loop *, int);
extern void create_preheaders (int);
extern void force_single_succ_latches (void);
@@ -409,9 +405,31 @@ get_loop (unsigned num)
return VEC_index (loop_p, current_loops->larray, num);
}
+/* Returns the number of superloops of LOOP. */
+
+static inline unsigned
+loop_depth (const struct loop *loop)
+{
+ return VEC_length (loop_p, loop->superloops);
+}
+
+/* Returns the immediate superloop of LOOP, or NULL if LOOP is the outermost
+ loop. */
+
+static inline struct loop *
+loop_outer (const struct loop *loop)
+{
+ unsigned n = VEC_length (loop_p, loop->superloops);
+
+ if (n == 0)
+ return NULL;
+
+ return VEC_index (loop_p, loop->superloops, n - 1);
+}
+
/* Returns the list of loops in current_loops. */
-static inline VEC (loop_p, heap) *
+static inline VEC (loop_p, gc) *
get_loops (void)
{
if (!current_loops)
@@ -518,10 +536,10 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
aloop = aloop->inner)
continue;
}
- else if (!aloop->outer)
+ else if (!loop_outer (aloop))
break;
else
- aloop = aloop->outer;
+ aloop = loop_outer (aloop);
}
}
else
@@ -538,7 +556,7 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
else
{
while (aloop != NULL && aloop->next == NULL)
- aloop = aloop->outer;
+ aloop = loop_outer (aloop);
if (aloop == NULL)
break;
aloop = aloop->next;
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index 7baa30a4899..54d00ce574c 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -276,7 +276,8 @@ mark_irreducible_loops (void)
int num = current_loops ? number_of_loops () : 1;
int *queue1 = XNEWVEC (int, last_basic_block + num);
int *queue2 = XNEWVEC (int, last_basic_block + num);
- int nq, depth;
+ int nq;
+ unsigned depth;
struct loop *cloop, *loop;
loop_iterator li;
@@ -321,12 +322,13 @@ mark_irreducible_loops (void)
if (!flow_bb_inside_loop_p (act->loop_father, e->dest))
{
- depth = find_common_loop (act->loop_father,
- e->dest->loop_father)->depth + 1;
- if (depth == act->loop_father->depth)
+ depth = 1 + loop_depth (find_common_loop (act->loop_father,
+ e->dest->loop_father));
+ if (depth == loop_depth (act->loop_father))
cloop = act->loop_father;
else
- cloop = act->loop_father->pred[depth];
+ cloop = VEC_index (loop_p, act->loop_father->superloops,
+ depth);
src = LOOP_REPR (cloop);
}
@@ -612,7 +614,7 @@ mark_loop_exit_edges (void)
FOR_EACH_EDGE (e, ei, bb->succs)
{
- if (bb->loop_father->outer
+ if (loop_outer (bb->loop_father)
&& loop_exit_edge_p (bb->loop_father, e))
e->flags |= EDGE_LOOP_EXIT;
else
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 0e876e566e1..1fadbb4356d 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -41,7 +41,6 @@ static int find_path (edge, basic_block **);
static void fix_loop_placements (struct loop *, bool *);
static bool fix_bb_placement (basic_block);
static void fix_bb_placements (basic_block, bool *);
-static basic_block create_preheader (struct loop *, int);
static void unloop (struct loop *, bool *);
#define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
@@ -102,7 +101,7 @@ fix_bb_placement (basic_block bb)
act = e->dest->loop_father;
if (act->header == e->dest)
- act = act->outer;
+ act = loop_outer (act);
if (flow_loop_nested_p (loop, act))
loop = act;
@@ -138,9 +137,9 @@ fix_loop_placement (struct loop *loop)
father = act;
}
- if (father != loop->outer)
+ if (father != loop_outer (loop))
{
- for (act = loop->outer; act != father; act = act->outer)
+ for (act = loop_outer (loop); act != father; act = loop_outer (act))
act->num_nodes -= loop->num_nodes;
flow_loop_tree_node_remove (loop);
flow_loop_tree_node_add (father, loop);
@@ -305,7 +304,7 @@ remove_path (edge e)
we belong to. In this case first unloop the loops, then proceed
normally. We may assume that e->dest is not a header of any loop,
as it now has exactly one predecessor. */
- while (e->src->loop_father->outer
+ while (loop_outer (e->src->loop_father)
&& dominated_by_p (CDI_DOMINATORS,
e->src->loop_father->latch, e->dest))
unloop (e->src->loop_father, &irred_invalidated);
@@ -399,7 +398,7 @@ static void
place_new_loop (struct loop *loop)
{
loop->num = number_of_loops ();
- VEC_safe_push (loop_p, heap, current_loops->larray, loop);
+ VEC_safe_push (loop_p, gc, current_loops->larray, loop);
}
/* Given LOOP structure with filled header and latch, find the body of the
@@ -434,7 +433,7 @@ add_loop (struct loop *loop, struct loop *outer)
/* If we find a direct subloop of OUTER, move it to LOOP. */
subloop = bbs[i]->loop_father;
- if (subloop->outer == outer
+ if (loop_outer (subloop) == outer
&& subloop->header == bbs[i])
{
flow_loop_tree_node_remove (subloop);
@@ -477,7 +476,7 @@ loopify (edge latch_edge, edge header_edge,
unsigned n_dom_bbs, i;
sbitmap seen;
struct loop *loop = alloc_loop ();
- struct loop *outer = succ_bb->loop_father->outer;
+ struct loop *outer = loop_outer (succ_bb->loop_father);
int freq;
gcov_type cnt;
edge e;
@@ -592,7 +591,7 @@ unloop (struct loop *loop, bool *irred_invalidated)
if (body[i]->loop_father == loop)
{
remove_bb_from_loops (body[i]);
- add_bb_to_loop (body[i], loop->outer);
+ add_bb_to_loop (body[i], loop_outer (loop));
}
free(body);
@@ -600,7 +599,7 @@ unloop (struct loop *loop, bool *irred_invalidated)
{
ploop = loop->inner;
flow_loop_tree_node_remove (ploop);
- flow_loop_tree_node_add (loop->outer, ploop);
+ flow_loop_tree_node_add (loop_outer (loop), ploop);
}
/* Remove the loop and free its data. */
@@ -627,9 +626,9 @@ fix_loop_placements (struct loop *loop, bool *irred_invalidated)
{
struct loop *outer;
- while (loop->outer)
+ while (loop_outer (loop))
{
- outer = loop->outer;
+ outer = loop_outer (loop);
if (!fix_loop_placement (loop))
break;
@@ -1085,8 +1084,8 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
MFB_KJ_EDGE to the entry part. E is the edge for that we should decide
whether to redirect it. */
-static edge mfb_kj_edge;
-static bool
+edge mfb_kj_edge;
+bool
mfb_keep_just (edge e)
{
return e != mfb_kj_edge;
@@ -1097,7 +1096,7 @@ mfb_keep_just (edge e)
entry; otherwise we also force preheader block to have only one successor.
The function also updates dominators. */
-static basic_block
+basic_block
create_preheader (struct loop *loop, int flags)
{
edge e, fallthru;
@@ -1393,7 +1392,7 @@ fix_loop_structure (bitmap changed_bbs)
FOR_EACH_BB (bb)
{
if (changed_bbs)
- bb->aux = (void *) (size_t) bb->loop_father->depth;
+ bb->aux = (void *) (size_t) loop_depth (bb->loop_father);
bb->loop_father = current_loops->tree_root;
}
@@ -1416,7 +1415,7 @@ fix_loop_structure (bitmap changed_bbs)
{
ploop = loop->inner;
flow_loop_tree_node_remove (ploop);
- flow_loop_tree_node_add (loop->outer, ploop);
+ flow_loop_tree_node_add (loop_outer (loop), ploop);
}
/* Remove the loop and free its data. */
@@ -1439,7 +1438,7 @@ fix_loop_structure (bitmap changed_bbs)
FOR_EACH_LOOP (li, loop, 0)
{
ploop = superloop[loop->num];
- if (ploop != loop->outer)
+ if (ploop != loop_outer (loop))
{
flow_loop_tree_node_remove (loop);
flow_loop_tree_node_add (ploop, loop);
@@ -1452,7 +1451,7 @@ fix_loop_structure (bitmap changed_bbs)
{
FOR_EACH_BB (bb)
{
- if ((void *) (size_t) bb->loop_father->depth != bb->aux)
+ if ((void *) (size_t) loop_depth (bb->loop_father) != bb->aux)
bitmap_set_bit (changed_bbs, bb->index);
bb->aux = NULL;
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 13079a2b803..7a043d0edea 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -168,6 +168,75 @@ static void cgraph_output_pending_asms (void);
static FILE *cgraph_dump_file;
+static GTY (()) tree static_ctors;
+static GTY (()) tree static_dtors;
+
+/* When target does not have ctors and dtors, we call all constructor
+ and destructor by special initialization/destruction functio
+ recognized by collect2.
+
+ When we are going to build this function, collect all constructors and
+ destructors and turn them into normal functions. */
+
+static void
+record_cdtor_fn (tree fndecl)
+{
+ if (targetm.have_ctors_dtors)
+ return;
+
+ if (DECL_STATIC_CONSTRUCTOR (fndecl))
+ {
+ static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors);
+ DECL_STATIC_CONSTRUCTOR (fndecl) = 0;
+ cgraph_mark_reachable_node (cgraph_node (fndecl));
+ }
+ if (DECL_STATIC_DESTRUCTOR (fndecl))
+ {
+ static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors);
+ DECL_STATIC_DESTRUCTOR (fndecl) = 0;
+ cgraph_mark_reachable_node (cgraph_node (fndecl));
+ }
+}
+
+/* Synthesize a function which calls all the global ctors or global
+ dtors in this file. This is only used for targets which do not
+ support .ctors/.dtors sections. */
+static void
+build_cdtor (int method_type, tree cdtors)
+{
+ tree body = 0;
+
+ if (!cdtors)
+ return;
+
+ for (; cdtors; cdtors = TREE_CHAIN (cdtors))
+ append_to_statement_list (build_function_call_expr (TREE_VALUE (cdtors), 0),
+ &body);
+
+ cgraph_build_static_cdtor (method_type, body, DEFAULT_INIT_PRIORITY);
+}
+
+/* Generate functions to call static constructors and destructors
+ for targets that do not support .ctors/.dtors sections. These
+ functions have magic names which are detected by collect2. */
+
+static void
+cgraph_build_cdtor_fns (void)
+{
+ if (!targetm.have_ctors_dtors)
+ {
+ build_cdtor ('I', static_ctors);
+ static_ctors = NULL_TREE;
+ build_cdtor ('D', static_dtors);
+ static_dtors = NULL_TREE;
+ }
+ else
+ {
+ gcc_assert (!static_ctors);
+ gcc_assert (!static_dtors);
+ }
+}
+
/* 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 havn't
@@ -458,6 +527,7 @@ cgraph_finalize_function (tree decl, bool nested)
node->decl = decl;
node->local.finalized = true;
node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL;
+ record_cdtor_fn (node->decl);
if (node->nested)
lower_nested_functions (decl);
gcc_assert (!node->nested);
@@ -1222,6 +1292,10 @@ cgraph_optimize (void)
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
+
+ /* Call functions declared with the "constructor" or "destructor"
+ attribute. */
+ cgraph_build_cdtor_fns ();
if (!flag_unit_at_a_time)
{
cgraph_assemble_pending_functions ();
@@ -1572,3 +1646,5 @@ save_inline_function_body (struct cgraph_node *node)
#endif
return first_clone;
}
+
+#include "gt-cgraphunit.h"
diff --git a/gcc/collect2.c b/gcc/collect2.c
index c6c1f3f4a2c..1ef174f534e 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1,7 +1,7 @@
/* Collect static initialization info into data structures that can be
traversed by C++ initialization and finalization routines.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
Contributed by Chris Smith (csmith@convex.com).
Heavily modified by Michael Meissner (meissner@cygnus.com),
Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
@@ -202,6 +202,9 @@ static struct head exports; /* list of exported symbols */
#endif
static struct head frame_tables; /* list of frame unwind info tables */
+static bool at_file_supplied; /* Whether to use @file arguments */
+static char *response_file; /* Name of any current response file */
+
struct obstack temporary_obstack;
char * temporary_firstobj;
@@ -302,6 +305,9 @@ collect_exit (int status)
if (status != 0 && output_file != 0 && output_file[0])
maybe_unlink (output_file);
+ if (response_file)
+ maybe_unlink (response_file);
+
exit (status);
}
@@ -393,6 +399,9 @@ handler (int signo)
maybe_unlink (export_file);
#endif
+ if (response_file)
+ maybe_unlink (response_file);
+
signal (signo, SIG_DFL);
raise (signo);
}
@@ -793,7 +802,15 @@ main (int argc, char **argv)
char **object_lst;
const char **object;
int first_file;
- int num_c_args = argc+9;
+ int num_c_args;
+ char **old_argv;
+
+ old_argv = argv;
+ expandargv (&argc, &argv);
+ if (argv != old_argv)
+ at_file_supplied = 1;
+
+ num_c_args = argc + 9;
no_demangle = !! getenv ("COLLECT_NO_DEMANGLE");
@@ -1513,6 +1530,12 @@ do_wait (const char *prog, struct pex_obj *pex)
error ("%s returned %d exit status", prog, ret);
collect_exit (ret);
}
+
+ if (response_file)
+ {
+ unlink (response_file);
+ response_file = NULL;
+ }
}
@@ -1525,6 +1548,47 @@ collect_execute (const char *prog, char **argv, const char *outname,
struct pex_obj *pex;
const char *errmsg;
int err;
+ char *response_arg = NULL;
+ char *response_argv[3] ATTRIBUTE_UNUSED;
+
+ if (HAVE_GNU_LD && at_file_supplied && argv[0] != NULL)
+ {
+ /* If using @file arguments, create a temporary file and put the
+ contents of argv into it. Then change argv to an array corresponding
+ to a single argument @FILE, where FILE is the temporary filename. */
+
+ char **current_argv = argv + 1;
+ char *argv0 = argv[0];
+ int status;
+ FILE *f;
+
+ /* Note: we assume argv contains at least one element; this is
+ checked above. */
+
+ response_file = make_temp_file ("");
+
+ f = fopen (response_file, "w");
+
+ if (f == NULL)
+ fatal ("could not open response file %s", response_file);
+
+ status = writeargv (current_argv, f);
+
+ if (status)
+ fatal ("could not write to response file %s", response_file);
+
+ status = fclose (f);
+
+ if (EOF == status)
+ fatal ("could not close response file %s", response_file);
+
+ response_arg = concat ("@", response_file, NULL);
+ response_argv[0] = argv0;
+ response_argv[1] = response_arg;
+ response_argv[2] = NULL;
+
+ argv = response_argv;
+ }
if (vflag || debug)
{
@@ -1568,6 +1632,9 @@ collect_execute (const char *prog, char **argv, const char *outname,
fatal (errmsg);
}
+ if (response_arg)
+ free (response_arg);
+
return pex;
}
diff --git a/gcc/combine.c b/gcc/combine.c
index 70ab71b4043..515b14ca6cd 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5674,14 +5674,14 @@ simplify_set (rtx x)
}
else if (GET_MODE (op0) == compare_mode && op1 == const0_rtx)
{
- SUBST(SET_SRC (x), op0);
+ SUBST (SET_SRC (x), op0);
src = SET_SRC (x);
}
- else
+ /* Otherwise, update the COMPARE if needed. */
+ else if (XEXP (src, 0) != op0 || XEXP (src, 1) != op1)
{
- /* Otherwise, update the COMPARE if needed. */
- SUBST (XEXP (src, 0), op0);
- SUBST (XEXP (src, 1), op1);
+ SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1));
+ src = SET_SRC (x);
}
}
else
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 31b10d4b5e1..bf1d0b1f137 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1127,7 +1127,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
if test x$enable_targets = xall; then
tm_file="${tm_file} i386/x86-64.h i386/linux64.h"
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
- tmake_file="${tmake_file} i386/t-linux64"
+ tmake_file="${tmake_file} i386/t-linux64 i386/t-fprules-softfp64 soft-fp/t-softfp"
need_64bit_hwint=yes
# FIXME: -m64 for i[34567]86-*-* should be allowed just
# like -m32 for x86_64-*-*.
@@ -1159,7 +1159,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;;
x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
esac
- tmake_file="${tmake_file} i386/t-linux64 i386/t-crtpc i386/t-crtfm t-dfprules"
+ tmake_file="${tmake_file} i386/t-linux64 i386/t-crtpc i386/t-crtfm i386/t-fprules-softfp64 soft-fp/t-softfp t-dfprules"
;;
i[34567]86-*-gnu*)
;;
@@ -2370,6 +2370,10 @@ sparc-*-sysv4*)
extra_parts="crtbegin.o crtend.o"
use_fixproto=yes
;;
+sparc-wrs-vxworks)
+ tm_file="${tm_file} elfos.h svr4.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
+ tmake_file="${tmake_file} sparc/t-vxworks"
+ ;;
sparc64-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h"
extra_options="${extra_options} sparc/little-endian.opt"
diff --git a/gcc/config.in b/gcc/config.in
index 7e60a3ef347..7864d8c066f 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -869,6 +869,12 @@
#endif
+/* Define if using GNU ld. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GNU_LD
+#endif
+
+
/* Define if you have the iconv() function. */
#ifndef USED_FOR_TARGET
#undef HAVE_ICONV
diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h
index 99151fa9bfd..525ecd32558 100644
--- a/gcc/config/bfin/bfin-protos.h
+++ b/gcc/config/bfin/bfin-protos.h
@@ -29,7 +29,10 @@ typedef enum bfin_cpu
BFIN_CPU_BF531,
BFIN_CPU_BF532,
BFIN_CPU_BF533,
- BFIN_CPU_BF537
+ BFIN_CPU_BF534,
+ BFIN_CPU_BF536,
+ BFIN_CPU_BF537,
+ BFIN_CPU_BF561
} bfin_cpu_t;
/* Value of -mcpu= */
@@ -83,13 +86,14 @@ extern void override_options (void);
extern void asm_conditional_branch (rtx, rtx *, int, int);
extern rtx bfin_gen_compare (rtx, Mmode);
+extern int bfin_local_alignment (tree, int);
extern int bfin_return_in_memory (tree);
extern void initialize_trampoline (rtx, rtx, rtx);
extern bool bfin_legitimate_address_p (Mmode, rtx, int);
extern rtx bfin_va_arg (tree, tree);
extern void bfin_expand_prologue (void);
-extern void bfin_expand_epilogue (int, int);
+extern void bfin_expand_epilogue (int, int, bool);
extern int push_multiple_operation (rtx, Mmode);
extern int pop_multiple_operation (rtx, Mmode);
extern void output_push_multiple (rtx, rtx *);
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index f52cfecddee..062689afdf6 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -569,12 +569,14 @@ frame_related_constant_load (rtx reg, HOST_WIDE_INT constant, bool related)
RTX_FRAME_RELATED_P (insn) = 1;
}
-/* Generate efficient code to add a value to a P register. We can use
- P1 as a scratch register. Set RTX_FRAME_RELATED_P on the generated
- insns if FRAME is nonzero. */
+/* Generate efficient code to add a value to a P register.
+ Set RTX_FRAME_RELATED_P on the generated insns if FRAME is nonzero.
+ EPILOGUE_P is zero if this function is called for prologue,
+ otherwise it's nonzero. And it's less than zero if this is for
+ sibcall epilogue. */
static void
-add_to_reg (rtx reg, HOST_WIDE_INT value, int frame)
+add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p)
{
if (value == 0)
return;
@@ -584,9 +586,41 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame)
in one instruction. */
if (value > 120 || value < -120)
{
- rtx tmpreg = gen_rtx_REG (SImode, REG_P1);
+ rtx tmpreg;
+ rtx tmpreg2;
rtx insn;
+ tmpreg2 = NULL_RTX;
+
+ /* For prologue or normal epilogue, P1 can be safely used
+ as the temporary register. For sibcall epilogue, we try to find
+ a call used P register, which will be restored in epilogue.
+ If we cannot find such a P register, we have to use one I register
+ to help us. */
+
+ if (epilogue_p >= 0)
+ tmpreg = gen_rtx_REG (SImode, REG_P1);
+ else
+ {
+ int i;
+ for (i = REG_P0; i <= REG_P5; i++)
+ if ((regs_ever_live[i] && ! call_used_regs[i])
+ || (!TARGET_FDPIC
+ && i == PIC_OFFSET_TABLE_REGNUM
+ && (current_function_uses_pic_offset_table
+ || (TARGET_ID_SHARED_LIBRARY
+ && ! current_function_is_leaf))))
+ break;
+ if (i <= REG_P5)
+ tmpreg = gen_rtx_REG (SImode, i);
+ else
+ {
+ tmpreg = gen_rtx_REG (SImode, REG_P1);
+ tmpreg2 = gen_rtx_REG (SImode, REG_I0);
+ emit_move_insn (tmpreg2, tmpreg);
+ }
+ }
+
if (frame)
frame_related_constant_load (tmpreg, value, TRUE);
else
@@ -595,6 +629,9 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame)
insn = emit_insn (gen_addsi3 (reg, reg, tmpreg));
if (frame)
RTX_FRAME_RELATED_P (insn) = 1;
+
+ if (tmpreg2 != NULL_RTX)
+ emit_move_insn (tmpreg, tmpreg2);
}
else
do
@@ -702,14 +739,17 @@ do_link (rtx spreg, HOST_WIDE_INT frame_size, bool all)
rtx insn = emit_insn (pat);
RTX_FRAME_RELATED_P (insn) = 1;
}
- add_to_reg (spreg, -frame_size, 1);
+ add_to_reg (spreg, -frame_size, 1, 0);
}
}
-/* Like do_link, but used for epilogues to deallocate the stack frame. */
+/* Like do_link, but used for epilogues to deallocate the stack frame.
+ EPILOGUE_P is zero if this function is called for prologue,
+ otherwise it's nonzero. And it's less than zero if this is for
+ sibcall epilogue. */
static void
-do_unlink (rtx spreg, HOST_WIDE_INT frame_size, bool all)
+do_unlink (rtx spreg, HOST_WIDE_INT frame_size, bool all, int epilogue_p)
{
frame_size += arg_area_size ();
@@ -719,7 +759,7 @@ do_unlink (rtx spreg, HOST_WIDE_INT frame_size, bool all)
{
rtx postinc = gen_rtx_MEM (Pmode, gen_rtx_POST_INC (Pmode, spreg));
- add_to_reg (spreg, frame_size, 0);
+ add_to_reg (spreg, frame_size, 0, epilogue_p);
if (must_save_fp_p ())
{
rtx fpreg = gen_rtx_REG (Pmode, REG_FP);
@@ -842,7 +882,7 @@ expand_interrupt_handler_epilogue (rtx spreg, e_funkind fkind)
insns. */
MEM_VOLATILE_P (postinc) = 1;
- do_unlink (spreg, get_frame_size (), all);
+ do_unlink (spreg, get_frame_size (), all, 1);
if (lookup_attribute ("nesting", attrs))
{
@@ -968,7 +1008,7 @@ bfin_expand_prologue (void)
{
if (lim != p2reg)
emit_move_insn (p2reg, lim);
- add_to_reg (p2reg, offset, 0);
+ add_to_reg (p2reg, offset, 0, 0);
lim = p2reg;
}
emit_insn (gen_compare_lt (bfin_cc_rtx, spreg, lim));
@@ -987,13 +1027,15 @@ bfin_expand_prologue (void)
/* Generate RTL for the epilogue of the current function. NEED_RETURN is zero
if this is for a sibcall. EH_RETURN is nonzero if we're expanding an
- eh_return pattern. */
+ eh_return pattern. SIBCALL_P is true if this is a sibcall epilogue,
+ false otherwise. */
void
-bfin_expand_epilogue (int need_return, int eh_return)
+bfin_expand_epilogue (int need_return, int eh_return, bool sibcall_p)
{
rtx spreg = gen_rtx_REG (Pmode, REG_SP);
e_funkind fkind = funkind (TREE_TYPE (current_function_decl));
+ int e = sibcall_p ? -1 : 1;
if (fkind != SUBROUTINE)
{
@@ -1001,7 +1043,7 @@ bfin_expand_epilogue (int need_return, int eh_return)
return;
}
- do_unlink (spreg, get_frame_size (), false);
+ do_unlink (spreg, get_frame_size (), false, e);
expand_epilogue_reg_restore (spreg, false, false);
@@ -2077,8 +2119,17 @@ bfin_handle_option (size_t code, const char *arg, int value)
bfin_cpu_type = BFIN_CPU_BF532;
else if (strcmp (arg, "bf533") == 0)
bfin_cpu_type = BFIN_CPU_BF533;
+ else if (strcmp (arg, "bf534") == 0)
+ bfin_cpu_type = BFIN_CPU_BF534;
+ else if (strcmp (arg, "bf536") == 0)
+ bfin_cpu_type = BFIN_CPU_BF536;
else if (strcmp (arg, "bf537") == 0)
bfin_cpu_type = BFIN_CPU_BF537;
+ else if (strcmp (arg, "bf561") == 0)
+ {
+ warning (0, "bf561 support is incomplete yet.");
+ bfin_cpu_type = BFIN_CPU_BF561;
+ }
else
return false;
return true;
@@ -2994,6 +3045,24 @@ bfin_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp)
return false;
}
+/* Compute the alignment for a local variable.
+ TYPE is the data type, and ALIGN is the alignment that
+ the object would ordinarily have. The value of this macro is used
+ instead of that alignment to align the object. */
+
+int
+bfin_local_alignment (tree type, int align)
+{
+ /* Increasing alignment for (relatively) big types allows the builtin
+ memcpy can use 32 bit loads/stores. */
+ if (TYPE_SIZE (type)
+ && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+ && (TREE_INT_CST_LOW (TYPE_SIZE (type)) > 8
+ || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 32)
+ return 32;
+ return align;
+}
+
/* Implement TARGET_SCHED_ISSUE_RATE. */
static int
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index c600af395d6..b78ecb2c84a 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -59,9 +59,18 @@ extern int target_flags;
case BFIN_CPU_BF533: \
builtin_define ("__ADSPBF533__"); \
break; \
+ case BFIN_CPU_BF534: \
+ builtin_define ("__ADSPBF534__"); \
+ break; \
+ case BFIN_CPU_BF536: \
+ builtin_define ("__ADSPBF536__"); \
+ break; \
case BFIN_CPU_BF537: \
builtin_define ("__ADSPBF537__"); \
break; \
+ case BFIN_CPU_BF561: \
+ builtin_define ("__ADSPBF561__"); \
+ break; \
} \
\
if (TARGET_FDPIC) \
@@ -218,6 +227,18 @@ extern const char *bfin_library_id_string;
/*#define DATA_ALIGNMENT(TYPE, BASIC-ALIGN) for arrays.. */
+/* If defined, a C expression to compute the alignment for a local
+ variable. TYPE is the data type, and ALIGN is the alignment that
+ the object would ordinarily have. The value of this macro is used
+ instead of that alignment to align the object.
+
+ If this macro is not defined, then ALIGN is used.
+
+ One use of this macro is to increase alignment of medium-size
+ data to make it all fit in fewer cache lines. */
+
+#define LOCAL_ALIGNMENT(TYPE, ALIGN) bfin_local_alignment ((TYPE), (ALIGN))
+
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
(TREE_CODE (EXP) == STRING_CST \
@@ -913,6 +934,10 @@ do { \
in one reasonably fast instruction. */
#define MOVE_MAX UNITS_PER_WORD
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movmem or libcall instead. */
+
+#define MOVE_RATIO 5
/* STORAGE LAYOUT: target machine storage layout
Define this macro as a C expression which is nonzero if accessing
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index 217c26d7d15..630694a0f9c 100644
--- a/gcc/config/bfin/bfin.md
+++ b/gcc/config/bfin/bfin.md
@@ -885,67 +885,26 @@
(ior "%H1")
(xor "%H1")])
-(define_insn "<optab>di3"
+;; Keep this pattern around to avoid generating NO_CONFLICT blocks.
+(define_expand "<optab>di3"
[(set (match_operand:DI 0 "register_operand" "=d")
(any_logical:DI (match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "register_operand" "d")))]
+ (match_operand:DI 2 "general_operand" "d")))]
""
- "%0 = %1 <op> %2;\\n\\t%H0 = %H1 <op> %H2;"
- [(set_attr "length" "4")
- (set_attr "seq_insns" "multi")])
-
-(define_insn "*<optab>di_zesidi_di"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (any_logical:DI (zero_extend:DI
- (match_operand:SI 2 "register_operand" "d"))
- (match_operand:DI 1 "register_operand" "d")))]
- ""
- "%0 = %1 <op> %2;\\n\\t%H0 = <high_result>;"
- [(set_attr "length" "4")
- (set_attr "seq_insns" "multi")])
-
-(define_insn "*<optab>di_sesdi_di"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (any_logical:DI (sign_extend:DI
- (match_operand:SI 2 "register_operand" "d"))
- (match_operand:DI 1 "register_operand" "0")))
- (clobber (match_scratch:SI 3 "=&d"))]
- ""
- "%0 = %1 <op> %2;\\n\\t%3 = %2;\\n\\t%3 >>>= 31;\\n\\t%H0 = %H1 <op> %3;"
- [(set_attr "length" "8")
- (set_attr "seq_insns" "multi")])
-
-(define_insn "negdi2"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (neg:DI (match_operand:DI 1 "register_operand" "d")))
- (clobber (match_scratch:SI 2 "=&d"))
- (clobber (reg:CC REG_CC))]
- ""
- "%2 = 0; %2 = %2 - %1; cc = ac0; cc = !cc; %2 = cc;\\n\\t%0 = -%1; %H0 = -%H1; %H0 = %H0 - %2;"
- [(set_attr "length" "16")
- (set_attr "seq_insns" "multi")])
-
-(define_insn "one_cmpldi2"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (not:DI (match_operand:DI 1 "register_operand" "d")))]
- ""
- "%0 = ~%1;\\n\\t%H0 = ~%H1;"
- [(set_attr "length" "4")
- (set_attr "seq_insns" "multi")])
-
-;; DImode zero and sign extend patterns
-
-(define_insn_and_split "zero_extendsidi2"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (zero_extend:DI (match_operand:SI 1 "register_operand" "d")))]
- ""
- "#"
- "reload_completed"
- [(set (match_dup 3) (const_int 0))]
{
- split_di (operands, 1, operands + 2, operands + 3);
- if (REGNO (operands[0]) != REGNO (operands[1]))
- emit_move_insn (operands[2], operands[1]);
+ rtx hi_half[3], lo_half[3];
+ enum insn_code icode = CODE_FOR_<optab>si3;
+ if (!reg_overlap_mentioned_p (operands[0], operands[1])
+ && !reg_overlap_mentioned_p (operands[0], operands[2]))
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
+ split_di (operands, 3, lo_half, hi_half);
+ if (!(*insn_data[icode].operand[2].predicate) (lo_half[2], SImode))
+ lo_half[2] = force_reg (SImode, lo_half[2]);
+ emit_insn (GEN_FCN (icode) (lo_half[0], lo_half[1], lo_half[2]));
+ if (!(*insn_data[icode].operand[2].predicate) (hi_half[2], SImode))
+ hi_half[2] = force_reg (SImode, hi_half[2]);
+ emit_insn (GEN_FCN (icode) (hi_half[0], hi_half[1], hi_half[2]));
+ DONE;
})
(define_insn "zero_extendqidi2"
@@ -1008,94 +967,94 @@
(define_insn "add_with_carry"
[(set (match_operand:SI 0 "register_operand" "=d,d")
- (plus:SI (match_operand:SI 1 "register_operand" "%0,0")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,d")
(match_operand:SI 2 "nonmemory_operand" "Ks7,d")))
- (set (match_operand:SI 3 "register_operand" "=d,d")
- (truncate:SI
- (lshiftrt:DI (plus:DI (zero_extend:DI (match_dup 1))
- (zero_extend:DI (match_dup 2)))
- (const_int 32))))
- (clobber (reg:CC 34))]
+ (set (match_operand:BI 3 "register_operand" "=C,C")
+ (ltu:BI (not:SI (match_dup 1)) (match_dup 2)))]
""
"@
- %0 += %2; cc = ac0; %3 = cc;
- %0 = %0 + %2; cc = ac0; %3 = cc;"
+ %0 += %2; cc = ac0;
+ %0 = %1 + %2; cc = ac0;"
[(set_attr "type" "alu0")
- (set_attr "length" "6")
+ (set_attr "length" "4")
(set_attr "seq_insns" "multi")])
-(define_insn "adddi3"
- [(set (match_operand:DI 0 "register_operand" "=&d,&d,&d")
- (plus:DI (match_operand:DI 1 "register_operand" "%0,0,0")
- (match_operand:DI 2 "nonmemory_operand" "Kn7,Ks7,d")))
- (clobber (match_scratch:SI 3 "=&d,&d,&d"))
- (clobber (reg:CC 34))]
+(define_insn "sub_with_carry"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (minus:SI (match_operand:SI 1 "register_operand" "%d")
+ (match_operand:SI 2 "nonmemory_operand" "d")))
+ (set (match_operand:BI 3 "register_operand" "=C")
+ (leu:BI (match_dup 2) (match_dup 1)))]
""
- "@
- %0 += %2; cc = ac0; %3 = cc; %H0 += -1; %H0 = %H0 + %3;
- %0 += %2; cc = ac0; %3 = cc; %H0 = %H0 + %3;
- %0 = %0 + %2; cc = ac0; %3 = cc; %H0 = %H0 + %H2; %H0 = %H0 + %3;"
+ "%0 = %1 - %2; cc = ac0;"
[(set_attr "type" "alu0")
- (set_attr "length" "10,8,10")
- (set_attr "seq_insns" "multi,multi,multi")])
-
-(define_insn "subdi3"
- [(set (match_operand:DI 0 "register_operand" "=&d")
- (minus:DI (match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "register_operand" "d")))
- (clobber (reg:CC 34))]
- ""
- "%0 = %1-%2;\\n\\tcc = ac0;\\n\\t%H0 = %H1-%H2;\\n\\tif cc jump 1f;\\n\\t%H0 += -1;\\n\\t1:"
- [(set_attr "length" "10")
- (set_attr "seq_insns" "multi")])
-
-(define_insn "*subdi_di_zesidi"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (minus:DI (match_operand:DI 1 "register_operand" "0")
- (zero_extend:DI
- (match_operand:SI 2 "register_operand" "d"))))
- (clobber (match_scratch:SI 3 "=&d"))
- (clobber (reg:CC 34))]
- ""
- "%0 = %1 - %2;\\n\\tcc = ac0;\\n\\tcc = ! cc;\\n\\t%3 = cc;\\n\\t%H0 = %H1 - %3;"
- [(set_attr "length" "10")
- (set_attr "seq_insns" "multi")])
-
-(define_insn "*subdi_zesidi_di"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (minus:DI (zero_extend:DI
- (match_operand:SI 2 "register_operand" "d"))
- (match_operand:DI 1 "register_operand" "0")))
- (clobber (match_scratch:SI 3 "=&d"))
- (clobber (reg:CC 34))]
- ""
- "%0 = %2 - %1;\\n\\tcc = ac0;\\n\\tcc = ! cc;\\n\\t%3 = cc;\\n\\t%3 = -%3;\\n\\t%H0 = %3 - %H1"
- [(set_attr "length" "12")
+ (set_attr "length" "4")
(set_attr "seq_insns" "multi")])
-(define_insn "*subdi_di_sesidi"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (minus:DI (match_operand:DI 1 "register_operand" "0")
- (sign_extend:DI
- (match_operand:SI 2 "register_operand" "d"))))
- (clobber (match_scratch:SI 3 "=&d"))
+(define_expand "adddi3"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "nonmemory_operand" "")))
+ (clobber (match_scratch:SI 3 ""))
(clobber (reg:CC 34))]
""
- "%0 = %1 - %2;\\n\\tcc = ac0;\\n\\t%3 = %2;\\n\\t%3 >>>= 31;\\n\\t%H0 = %H1 - %3;\\n\\tif cc jump 1f;\\n\\t%H0 += -1;\\n\\t1:"
- [(set_attr "length" "14")
- (set_attr "seq_insns" "multi")])
+{
+ rtx xops[8];
+ xops[0] = gen_lowpart (SImode, operands[0]);
+ xops[1] = simplify_gen_subreg (SImode, operands[0], DImode, 4);
+ xops[2] = gen_lowpart (SImode, operands[1]);
+ xops[3] = simplify_gen_subreg (SImode, operands[1], DImode, 4);
+ xops[4] = gen_lowpart (SImode, operands[2]);
+ xops[5] = simplify_gen_subreg (SImode, operands[2], DImode, 4);
+ xops[6] = gen_reg_rtx (SImode);
+ xops[7] = gen_rtx_REG (BImode, REG_CC);
+ if (!register_operand (xops[4], SImode)
+ && (GET_CODE (xops[4]) != CONST_INT
+ || !CONST_OK_FOR_K (INTVAL (xops[4]), "Ks7")))
+ xops[4] = force_reg (SImode, xops[4]);
+ if (!reg_overlap_mentioned_p (operands[0], operands[1])
+ && !reg_overlap_mentioned_p (operands[0], operands[2]))
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
+ emit_insn (gen_add_with_carry (xops[0], xops[2], xops[4], xops[7]));
+ emit_insn (gen_movbisi (xops[6], xops[7]));
+ if (!register_operand (xops[5], SImode)
+ && (GET_CODE (xops[5]) != CONST_INT
+ || !CONST_OK_FOR_K (INTVAL (xops[5]), "Ks7")))
+ xops[5] = force_reg (SImode, xops[5]);
+ if (xops[5] != const0_rtx)
+ emit_insn (gen_addsi3 (xops[1], xops[3], xops[5]));
+ else
+ emit_move_insn (xops[1], xops[3]);
+ emit_insn (gen_addsi3 (xops[1], xops[1], xops[6]));
+ DONE;
+})
-(define_insn "*subdi_sesidi_di"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (minus:DI (sign_extend:DI
- (match_operand:SI 2 "register_operand" "d"))
- (match_operand:DI 1 "register_operand" "0")))
- (clobber (match_scratch:SI 3 "=&d"))
+(define_expand "subdi3"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (minus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
(clobber (reg:CC 34))]
""
- "%0 = %2 - %1;\\n\\tcc = ac0;\\n\\t%3 = %2;\\n\\t%3 >>>= 31;\\n\\t%H0 = %3 - %H1;\\n\\tif cc jump 1f;\\n\\t%H0 += -1;\\n\\t1:"
- [(set_attr "length" "14")
- (set_attr "seq_insns" "multi")])
+{
+ rtx xops[8];
+ xops[0] = gen_lowpart (SImode, operands[0]);
+ xops[1] = simplify_gen_subreg (SImode, operands[0], DImode, 4);
+ xops[2] = gen_lowpart (SImode, operands[1]);
+ xops[3] = simplify_gen_subreg (SImode, operands[1], DImode, 4);
+ xops[4] = gen_lowpart (SImode, operands[2]);
+ xops[5] = simplify_gen_subreg (SImode, operands[2], DImode, 4);
+ xops[6] = gen_reg_rtx (SImode);
+ xops[7] = gen_rtx_REG (BImode, REG_CC);
+ if (!reg_overlap_mentioned_p (operands[0], operands[1])
+ && !reg_overlap_mentioned_p (operands[0], operands[2]))
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
+ emit_insn (gen_sub_with_carry (xops[0], xops[2], xops[4], xops[7]));
+ emit_insn (gen_notbi (xops[7], xops[7]));
+ emit_insn (gen_movbisi (xops[6], xops[7]));
+ emit_insn (gen_subsi3 (xops[1], xops[3], xops[5]));
+ emit_insn (gen_subsi3 (xops[1], xops[1], xops[6]));
+ DONE;
+})
;; Combined shift/add instructions
@@ -2659,7 +2618,7 @@
"%0 = CC;"
[(set_attr "length" "2")])
-(define_insn ""
+(define_insn "notbi"
[(set (match_operand:BI 0 "register_operand" "=C")
(eq:BI (match_operand:BI 1 "register_operand" " 0")
(const_int 0)))]
@@ -2709,12 +2668,12 @@
(define_expand "epilogue"
[(const_int 1)]
""
- "bfin_expand_epilogue (1, 0); DONE;")
+ "bfin_expand_epilogue (1, 0, 0); DONE;")
(define_expand "sibcall_epilogue"
[(const_int 1)]
""
- "bfin_expand_epilogue (0, 0); DONE;")
+ "bfin_expand_epilogue (0, 0, 1); DONE;")
(define_expand "eh_return"
[(unspec_volatile [(match_operand:SI 0 "register_operand" "")]
@@ -2734,7 +2693,7 @@
"#"
"reload_completed"
[(const_int 1)]
- "bfin_expand_epilogue (1, 1); DONE;")
+ "bfin_expand_epilogue (1, 1, 0); DONE;")
(define_insn "link"
[(set (mem:SI (plus:SI (reg:SI REG_SP) (const_int -4))) (reg:SI REG_RETS))
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a2a8dd1408e..c83970422ee 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2793,7 +2793,8 @@ ix86_function_regparm (tree type, tree decl)
return 2;
/* Use register calling convention for local functions when possible. */
- if (decl && flag_unit_at_a_time && !profile_flag)
+ if (decl && TREE_CODE (decl) == FUNCTION_DECL
+ && flag_unit_at_a_time && !profile_flag)
{
struct cgraph_local_info *i = cgraph_local_info (decl);
if (i && i->local)
@@ -7302,6 +7303,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov)
insns = get_insns ();
end_sequence ();
+ CONST_OR_PURE_CALL_P (insns) = 1;
emit_libcall_block (insns, dest, rax, x);
}
else if (TARGET_64BIT && TARGET_GNU2_TLS)
@@ -7332,6 +7334,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov)
note = gen_rtx_EXPR_LIST (VOIDmode, const0_rtx, NULL);
note = gen_rtx_EXPR_LIST (VOIDmode, ix86_tls_get_addr (), note);
+ CONST_OR_PURE_CALL_P (insns) = 1;
emit_libcall_block (insns, base, rax, note);
}
else if (TARGET_64BIT && TARGET_GNU2_TLS)
@@ -21166,6 +21169,8 @@ ix86_scalar_mode_supported_p (enum machine_mode mode)
{
if (DECIMAL_FLOAT_MODE_P (mode))
return true;
+ else if (mode == TFmode)
+ return TARGET_64BIT;
else
return default_scalar_mode_supported_p (mode);
}
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index d6a8ea05cd3..2bccf827965 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -426,17 +426,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#ifndef CC1_CPU_SPEC
#define CC1_CPU_SPEC_1 "\
-%{!mtune*: \
-%{m386:mtune=i386 \
-%n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead.\n} \
-%{m486:-mtune=i486 \
-%n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead.\n} \
-%{mpentium:-mtune=pentium \
-%n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead.\n} \
-%{mpentiumpro:-mtune=pentiumpro \
-%n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead.\n} \
%{mcpu=*:-mtune=%* \
-%n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n}} \
+%n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n} \
%<mcpu=* \
%{mintel-syntax:-masm=intel \
%n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.\n} \
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 9889ba17580..7362601a562 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -27,18 +27,10 @@ m32
Target RejectNegative Negative(m64) Report InverseMask(64BIT)
Generate 32bit i386 code
-m386
-Target RejectNegative Undocumented
-;; Deprecated
-
m3dnow
Target Report Mask(3DNOW)
Support 3DNow! built-in functions
-m486
-Target RejectNegative Undocumented
-;; Deprecated
-
m64
Target RejectNegative Negative(m32) Report Mask(64BIT)
Generate 64bit x86-64 code
@@ -155,14 +147,6 @@ mpc
Target RejectNegative Report Joined Var(ix87_precision_string)
Set 80387 floating-point precision (-mpc32, -mpc64, -mpc80)
-mpentium
-Target RejectNegative Undocumented
-;; Deprecated
-
-mpentiumpro
-Target RejectNegative Undocumented
-;; Deprecated
-
mpreferred-stack-boundary=
Target RejectNegative Joined Var(ix86_preferred_stack_boundary_string)
Attempt to keep stack aligned to this power of 2
diff --git a/gcc/config/i386/libgcc-x86_64-glibc.ver b/gcc/config/i386/libgcc-x86_64-glibc.ver
index 2ea321f933b..fa5d1a6dba2 100644
--- a/gcc/config/i386/libgcc-x86_64-glibc.ver
+++ b/gcc/config/i386/libgcc-x86_64-glibc.ver
@@ -23,3 +23,64 @@ GLIBC_2.0 {
__register_frame_info_table
}
%endif
+
+% 128 bit long double support was introduced with GCC 4.3.0.
+% These lines make the symbols to get a @@GCC_4.3.0 attached.
+
+%ifdef __x86_64__
+%exclude {
+ __addtf3
+ __divtf3
+ __eqtf2
+ __extenddftf2
+ __extendsftf2
+ __fixtfdi
+ __fixtfsi
+ __fixtfti
+ __fixunstfdi
+ __fixunstfsi
+ __fixunstfti
+ __floatditf
+ __floatsitf
+ __floattitf
+ __floatunditf
+ __floatunsitf
+ __floatuntitf
+ __getf2
+ __letf2
+ __multf3
+ __negtf2
+ __subtf3
+ __trunctfdf2
+ __trunctfsf2
+ __unordtf2
+}
+
+GCC_4.3.0 {
+ __addtf3
+ __divtf3
+ __eqtf2
+ __extenddftf2
+ __extendsftf2
+ __fixtfdi
+ __fixtfsi
+ __fixtfti
+ __fixunstfdi
+ __fixunstfsi
+ __fixunstfti
+ __floatditf
+ __floatsitf
+ __floattitf
+ __floatunditf
+ __floatunsitf
+ __floatuntitf
+ __getf2
+ __letf2
+ __multf3
+ __negtf2
+ __subtf3
+ __trunctfdf2
+ __trunctfsf2
+ __unordtf2
+}
+%endif
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index c608826be11..a39fbab3cde 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -27,7 +27,8 @@ Boston, MA 02110-1301, USA. */
#define TARGET_VERSION fprintf (stderr," (x86 MinGW)");
#endif
-/* See i386/crtdll.h for an alternative definition. */
+/* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
+ is for compatibility with native compiler. */
#define EXTRA_OS_CPP_BUILTINS() \
do \
{ \
@@ -36,17 +37,14 @@ Boston, MA 02110-1301, USA. */
builtin_define ("_WIN32"); \
builtin_define_std ("WIN32"); \
builtin_define_std ("WINNT"); \
+ builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \
+ TYPE_PRECISION (intmax_type_node));\
if (TARGET_64BIT_MS_ABI) \
{ \
builtin_define ("__MINGW64__"); \
- builtin_define_with_value("_INTEGRAL_MAX_BITS","64",0); \
builtin_define_std ("WIN64"); \
builtin_define_std ("_WIN64"); \
} \
- else \
- { \
- builtin_define_with_value("_INTEGRAL_MAX_BITS","32",0); \
- } \
} \
while (0)
diff --git a/gcc/config/i386/sfp-machine.h b/gcc/config/i386/sfp-machine.h
new file mode 100644
index 00000000000..d440e1d3266
--- /dev/null
+++ b/gcc/config/i386/sfp-machine.h
@@ -0,0 +1,56 @@
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE unsigned long
+#define _FP_WS_TYPE signed long
+#define _FP_I_TYPE long
+
+typedef int TItype __attribute__((mode(TI)));
+typedef unsigned int UTItype __attribute__((mode(TI)));
+
+#define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype))
+
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S _FP_QNANBIT_S
+#define _FP_NANFRAC_D _FP_QNANBIT_D
+#define _FP_NANFRAC_E _FP_QNANBIT_E, 0
+#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0
+#define _FP_NANSIGN_S 1
+#define _FP_NANSIGN_D 1
+#define _FP_NANSIGN_E 1
+#define _FP_NANSIGN_Q 1
+
+#define _FP_KEEPNANFRACP 1
+
+/* Here is something Intel misdesigned: the specs don't define
+ the case where we have two NaNs with same mantissas, but
+ different sign. Different operations pick up different NaNs.
+ */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if (_FP_FRAC_GT_##wc(X, Y) \
+ || (_FP_FRAC_EQ_##wc(X,Y) && (OP == '+' || OP == '*'))) \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ else \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+/* Define ALIASNAME as a strong alias for NAME. */
+# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+# define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 63f0eac53b6..aa581ac1443 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -2205,6 +2205,80 @@
(parallel [(const_int 0) (const_int 1)]))))]
"TARGET_SSE2")
+(define_expand "vec_unpacks_float_hi_v8hi"
+ [(match_operand:V4SF 0 "register_operand" "")
+ (match_operand:V8HI 1 "register_operand" "")]
+ "TARGET_SSE2"
+{
+ rtx tmp = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_vec_unpacks_hi_v8hi (tmp, operands[1]));
+ emit_insn (gen_sse2_cvtdq2ps (operands[0], tmp));
+ DONE;
+})
+
+(define_expand "vec_unpacks_float_lo_v8hi"
+ [(match_operand:V4SF 0 "register_operand" "")
+ (match_operand:V8HI 1 "register_operand" "")]
+ "TARGET_SSE2"
+{
+ rtx tmp = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_vec_unpacks_lo_v8hi (tmp, operands[1]));
+ emit_insn (gen_sse2_cvtdq2ps (operands[0], tmp));
+ DONE;
+})
+
+(define_expand "vec_unpacku_float_hi_v8hi"
+ [(match_operand:V4SF 0 "register_operand" "")
+ (match_operand:V8HI 1 "register_operand" "")]
+ "TARGET_SSE2"
+{
+ rtx tmp = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_vec_unpacku_hi_v8hi (tmp, operands[1]));
+ emit_insn (gen_sse2_cvtdq2ps (operands[0], tmp));
+ DONE;
+})
+
+(define_expand "vec_unpacku_float_lo_v8hi"
+ [(match_operand:V4SF 0 "register_operand" "")
+ (match_operand:V8HI 1 "register_operand" "")]
+ "TARGET_SSE2"
+{
+ rtx tmp = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_vec_unpacku_lo_v8hi (tmp, operands[1]));
+ emit_insn (gen_sse2_cvtdq2ps (operands[0], tmp));
+ DONE;
+})
+
+(define_expand "vec_unpacks_float_hi_v4si"
+ [(set (match_dup 2)
+ (vec_select:V4SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "")
+ (parallel [(const_int 2)
+ (const_int 3)
+ (const_int 2)
+ (const_int 3)])))
+ (set (match_operand:V2DF 0 "register_operand" "")
+ (float:V2DF
+ (vec_select:V2SI
+ (match_dup 2)
+ (parallel [(const_int 0) (const_int 1)]))))]
+ "TARGET_SSE2"
+{
+ operands[2] = gen_reg_rtx (V4SImode);
+})
+
+(define_expand "vec_unpacks_float_lo_v4si"
+ [(set (match_operand:V2DF 0 "register_operand" "")
+ (float:V2DF
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "")
+ (parallel [(const_int 0) (const_int 1)]))))]
+ "TARGET_SSE2")
+
(define_expand "vec_pack_trunc_v2df"
[(match_operand:V4SF 0 "register_operand" "")
(match_operand:V2DF 1 "nonimmediate_operand" "")
@@ -2222,6 +2296,25 @@
DONE;
})
+(define_expand "vec_pack_sfix_trunc_v2df"
+ [(match_operand:V4SI 0 "register_operand" "")
+ (match_operand:V2DF 1 "nonimmediate_operand" "")
+ (match_operand:V2DF 2 "nonimmediate_operand" "")]
+ "TARGET_SSE2"
+{
+ rtx r1, r2;
+
+ r1 = gen_reg_rtx (V4SImode);
+ r2 = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_sse2_cvttpd2dq (r1, operands[1]));
+ emit_insn (gen_sse2_cvttpd2dq (r2, operands[2]));
+ emit_insn (gen_sse2_punpcklqdq (gen_lowpart (V2DImode, operands[0]),
+ gen_lowpart (V2DImode, r1),
+ gen_lowpart (V2DImode, r2)));
+ DONE;
+})
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Parallel double-precision floating point element swizzling
@@ -3525,7 +3618,7 @@
"TARGET_SSE2"
{
rtx op1, op2, h1, l1, h2, l2, h3, l3;
-
+
op1 = gen_lowpart (V16QImode, operands[1]);
op2 = gen_lowpart (V16QImode, operands[2]);
h1 = gen_reg_rtx (V16QImode);
@@ -3534,7 +3627,7 @@
l2 = gen_reg_rtx (V16QImode);
h3 = gen_reg_rtx (V16QImode);
l3 = gen_reg_rtx (V16QImode);
-
+
emit_insn (gen_vec_interleave_highv16qi (h1, op1, op2));
emit_insn (gen_vec_interleave_lowv16qi (l1, op1, op2));
emit_insn (gen_vec_interleave_highv16qi (h2, l1, h1));
@@ -3544,7 +3637,7 @@
emit_insn (gen_vec_interleave_lowv16qi (operands[0], l3, h3));
DONE;
})
-
+
;; Reduce:
;; op1 = abcdefgh
;; op2 = ijklmnop
@@ -3560,14 +3653,14 @@
"TARGET_SSE2"
{
rtx op1, op2, h1, l1, h2, l2;
-
+
op1 = gen_lowpart (V8HImode, operands[1]);
op2 = gen_lowpart (V8HImode, operands[2]);
h1 = gen_reg_rtx (V8HImode);
l1 = gen_reg_rtx (V8HImode);
h2 = gen_reg_rtx (V8HImode);
l2 = gen_reg_rtx (V8HImode);
-
+
emit_insn (gen_vec_interleave_highv8hi (h1, op1, op2));
emit_insn (gen_vec_interleave_lowv8hi (l1, op1, op2));
emit_insn (gen_vec_interleave_highv8hi (h2, l1, h1));
@@ -3575,7 +3668,7 @@
emit_insn (gen_vec_interleave_lowv8hi (operands[0], l2, h2));
DONE;
})
-
+
;; Reduce:
;; op1 = abcd
;; op2 = efgh
@@ -3589,12 +3682,12 @@
"TARGET_SSE2"
{
rtx op1, op2, h1, l1;
-
+
op1 = gen_lowpart (V4SImode, operands[1]);
op2 = gen_lowpart (V4SImode, operands[2]);
h1 = gen_reg_rtx (V4SImode);
l1 = gen_reg_rtx (V4SImode);
-
+
emit_insn (gen_vec_interleave_highv4si (h1, op1, op2));
emit_insn (gen_vec_interleave_lowv4si (l1, op1, op2));
emit_insn (gen_vec_interleave_lowv4si (operands[0], l1, h1));
diff --git a/gcc/config/i386/t-fprules-softfp64 b/gcc/config/i386/t-fprules-softfp64
new file mode 100644
index 00000000000..0b0068f9053
--- /dev/null
+++ b/gcc/config/i386/t-fprules-softfp64
@@ -0,0 +1,6 @@
+softfp_float_modes := tf
+softfp_int_modes := si di ti
+softfp_extensions := sftf dftf xftf
+softfp_truncations := tfsf tfdf tfxf
+softfp_machine_header := i386/sfp-machine.h
+softfp_exclude_libgcc2 := n
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index f875126021e..7aa1b81bf7c 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -15,6 +15,9 @@ EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \
crtbeginT.o crtprec32.o crtprec64.o crtprec80.o \
crtfastmath.o
+softfp_wrap_start := '\#ifdef __x86_64__'
+softfp_wrap_end := '\#endif'
+
# The pushl in CTOR initialization interferes with frame pointer elimination.
# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,
# because then __FRAME_END__ might not be the last thing in .eh_frame
diff --git a/gcc/config/i386/vxworks.h b/gcc/config/i386/vxworks.h
index 9862cf23ff2..78d50791be5 100644
--- a/gcc/config/i386/vxworks.h
+++ b/gcc/config/i386/vxworks.h
@@ -73,3 +73,7 @@ Boston, MA 02110-1301, USA. */
/* No _mcount profiling on VxWorks. */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)
+
+/* We cannot use PC-relative accesses for VxWorks PIC because there is no
+ fixed gap between segments. */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
diff --git a/gcc/config/m32c/jump.md b/gcc/config/m32c/jump.md
index 4a358eac40f..f0983d1532d 100644
--- a/gcc/config/m32c/jump.md
+++ b/gcc/config/m32c/jump.md
@@ -69,7 +69,18 @@
""
"*
switch (which_alternative) {
- case 0: return \"jsr.a\t%0\";
+ case 0:
+ {
+ HOST_WIDE_INT func_vect_num =
+ current_function_special_page_vector(XEXP (operands[0], 0));
+ if (func_vect_num)
+ {
+ operands[3] = gen_rtx_CONST_INT (VOIDmode, func_vect_num);
+ return \"jsrs\t%3\";
+ }
+ else
+ return \"jsr.a\t%0\";
+ }
case 1: return TARGET_A16 ? \"push.w %a0 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a0\";
case 2: return \"jsri.a\t%a0\";
}"
@@ -84,7 +95,18 @@ switch (which_alternative) {
""
"*
switch (which_alternative) {
- case 0: return \"jsr.a\t%1\";
+ case 0:
+ {
+ HOST_WIDE_INT func_vect_num =
+ current_function_special_page_vector(XEXP (operands[1], 0));
+ if (func_vect_num)
+ {
+ operands[4] = gen_rtx_CONST_INT (VOIDmode, func_vect_num);
+ return \"jsrs\t%4\";
+ }
+ else
+ return \"jsr.a\t%1\";
+ }
case 1: return TARGET_A16 ? \"push.w %a1 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a1\";
case 2: return \"jsri.a\t%a1\";
}"
diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h
index 5735ee75867..5bbc67cbb32 100644
--- a/gcc/config/m32c/m32c-protos.h
+++ b/gcc/config/m32c/m32c-protos.h
@@ -112,6 +112,7 @@ void m32c_function_arg_advance (CUMULATIVE_ARGS *, MM, tree, int);
tree m32c_gimplify_va_arg_expr (tree, tree, tree *, tree *);
void m32c_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
bool m32c_promote_function_return (tree);
+int m32c_special_page_vector_p (tree);
#endif
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 5872c884930..f661c73841a 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -61,6 +61,7 @@ typedef enum
} Push_Pop_Type;
static tree interrupt_handler (tree *, tree, tree, int, bool *);
+static tree function_vector_handler (tree *, tree, tree, int, bool *);
static int interrupt_p (tree node);
static bool m32c_asm_integer (rtx, unsigned int, int);
static int m32c_comp_type_attributes (tree, tree);
@@ -75,6 +76,9 @@ static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *);
static rtx m32c_struct_value_rtx (tree, int);
static rtx m32c_subreg (enum machine_mode, rtx, enum machine_mode, int);
static int need_to_save (int);
+int current_function_special_page_vector (rtx);
+
+#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
#define streq(a,b) (strcmp ((a), (b)) == 0)
@@ -2721,10 +2725,104 @@ interrupt_handler (tree * node ATTRIBUTE_UNUSED,
return NULL_TREE;
}
+/* Returns TRUE if given tree has the "function_vector" attribute. */
+int
+m32c_special_page_vector_p (tree func)
+{
+ if (TREE_CODE (func) != FUNCTION_DECL)
+ return 0;
+
+ tree list = M32C_ATTRIBUTES (func);
+ while (list)
+ {
+ if (is_attribute_p ("function_vector", TREE_PURPOSE (list)))
+ return 1;
+ list = TREE_CHAIN (list);
+ }
+ return 0;
+}
+
+static tree
+function_vector_handler (tree * node ATTRIBUTE_UNUSED,
+ tree name ATTRIBUTE_UNUSED,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool * no_add_attrs ATTRIBUTE_UNUSED)
+{
+ if (TARGET_R8C)
+ {
+ /* The attribute is not supported for R8C target. */
+ warning (OPT_Wattributes,
+ "`%s' attribute is not supported for R8C target",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ else if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ /* The attribute must be applied to functions only. */
+ warning (OPT_Wattributes,
+ "`%s' attribute applies only to functions",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
+ {
+ /* The argument must be a constant integer. */
+ warning (OPT_Wattributes,
+ "`%s' attribute argument not an integer constant",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ else if (TREE_INT_CST_LOW (TREE_VALUE (args)) < 18
+ || TREE_INT_CST_LOW (TREE_VALUE (args)) > 255)
+ {
+ /* The argument value must be between 18 to 255. */
+ warning (OPT_Wattributes,
+ "`%s' attribute argument should be between 18 to 255",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ return NULL_TREE;
+}
+
+/* If the function is assigned the attribute 'function_vector', it
+ returns the function vector number, otherwise returns zero. */
+int
+current_function_special_page_vector (rtx x)
+{
+ int num;
+
+ if ((GET_CODE(x) == SYMBOL_REF)
+ && (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
+ {
+ tree t = SYMBOL_REF_DECL (x);
+
+ if (TREE_CODE (t) != FUNCTION_DECL)
+ return 0;
+
+ tree list = M32C_ATTRIBUTES (t);
+ while (list)
+ {
+ if (is_attribute_p ("function_vector", TREE_PURPOSE (list)))
+ {
+ num = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (list)));
+ return num;
+ }
+
+ list = TREE_CHAIN (list);
+ }
+
+ return 0;
+ }
+ else
+ return 0;
+}
+
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m32c_attribute_table
static const struct attribute_spec m32c_attribute_table[] = {
{"interrupt", 0, 0, false, false, false, interrupt_handler},
+ {"function_vector", 1, 1, true, false, false, function_vector_handler},
{0, 0, 0, 0, 0, 0, 0}
};
@@ -3751,6 +3849,23 @@ m32c_scc_pattern(rtx *operands, RTX_CODE code)
return buf;
}
+/* Encode symbol attributes of a SYMBOL_REF into its
+ SYMBOL_REF_FLAGS. */
+static void
+m32c_encode_section_info (tree decl, rtx rtl, int first)
+{
+ int extra_flags = 0;
+
+ default_encode_section_info (decl, rtl, first);
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && m32c_special_page_vector_p (decl))
+
+ extra_flags = SYMBOL_FLAG_FUNCVEC_FUNCTION;
+
+ if (extra_flags)
+ SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= extra_flags;
+}
+
/* Returns TRUE if the current function is a leaf, and thus we can
determine which registers an interrupt function really needs to
save. The logic below is mostly about finding the insn sequence
@@ -4164,6 +4279,9 @@ m32c_output_compare (rtx insn, rtx *operands)
return template + 1;
}
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO m32c_encode_section_info
+
/* The Global `targetm' Variable. */
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/m32c/muldiv.md b/gcc/config/m32c/muldiv.md
index 6913ea9a729..b6c6565baa5 100644
--- a/gcc/config/m32c/muldiv.md
+++ b/gcc/config/m32c/muldiv.md
@@ -82,7 +82,7 @@
(define_insn "mulhisi3_c"
[(set (match_operand:SI 0 "ra_operand" "=Rsi")
(mult:SI (sign_extend:SI (match_operand:HI 1 "mra_operand" "%0"))
- (match_operand 2 "immediate_operand" "i")))]
+ (match_operand:HI 2 "immediate_operand" "i")))]
""
"mul.w\t%2,%1"
[(set_attr "flags" "o")]
@@ -159,7 +159,14 @@
}"
)
-
+(define_insn "mulsi3"
+ [(set (match_operand:SI 0 "r0123_operand" "=R02,R02")
+ (mult:SI (match_operand:SI 1 "r0123_operand" "%0,0")
+ (match_operand:SI 2 "mra_operand" "RsiSd,?Rmm")))]
+ "TARGET_M32C"
+ "mul.l\t%2,%1"
+ [(set_attr "flags" "o")]
+)
(define_expand "divmodqi4"
[(set (match_dup 4)
@@ -260,3 +267,23 @@
"divu.w\t%2"
[(set_attr "flags" "o")]
)
+
+(define_insn "divsi3"
+ [(set (match_operand:SI 0 "r0123_operand" "=R02,R02")
+ (div:SI (match_operand:SI 1 "r0123_operand" "0,0")
+ (match_operand:SI 2 "mra_operand" "RsiSd,?Rmm")))]
+ "TARGET_M32C"
+ "div.l\t%2"
+ [(set_attr "flags" "o")]
+)
+
+(define_insn "udivsi3"
+ [(set (match_operand:SI 0 "r0123_operand" "=R02,R02")
+ (udiv:SI (match_operand:SI 1 "r0123_operand" "0,0")
+ (match_operand:SI 2 "mra_operand" "RsiSd,?Rmm")))]
+ "TARGET_M32C"
+ "divu.l\t%2"
+ [(set_attr "flags" "o")]
+)
+
+
diff --git a/gcc/config/m32c/shift.md b/gcc/config/m32c/shift.md
index 6679f38ffe7..6b8a4835883 100644
--- a/gcc/config/m32c/shift.md
+++ b/gcc/config/m32c/shift.md
@@ -175,7 +175,7 @@
(define_insn "ashlpsi3_i"
[(set (match_operand:PSI 0 "mra_operand" "=R02RaaSd*Rmm,R02RaaSd*Rmm")
(ashift:PSI (match_operand:PSI 1 "mra_operand" "0,0")
- (match_operand:QI 2 "mrai_operand" "In4,RqiSd")))
+ (match_operand:QI 2 "shiftcount_operand" "In4,RqiSd")))
(clobber (match_scratch:HI 3 "=X,R1w"))]
"TARGET_A24"
"@
@@ -187,7 +187,7 @@
(define_insn "ashrpsi3_i"
[(set (match_operand:PSI 0 "mra_operand" "=R02RaaSd*Rmm,R02RaaSd*Rmm")
(ashiftrt:PSI (match_operand:PSI 1 "mra_operand" "0,0")
- (neg:QI (match_operand:QI 2 "mrai_operand" "In4,RqiSd"))))
+ (neg:QI (match_operand:QI 2 "shiftcount_operand" "In4,RqiSd"))))
(clobber (match_scratch:HI 3 "=X,R1w"))]
"TARGET_A24"
"@
@@ -212,7 +212,7 @@
(define_expand "ashlpsi3"
[(parallel [(set (match_operand:PSI 0 "mra_operand" "")
(ashift:PSI (match_operand:PSI 1 "mra_operand" "")
- (match_operand:QI 2 "mrai_operand" "")))
+ (match_operand:QI 2 "shiftcount_operand" "")))
(clobber (match_scratch:HI 3 ""))])]
"TARGET_A24"
"if (m32c_prepare_shift (operands, 1, ASHIFT))
@@ -222,7 +222,7 @@
(define_expand "ashrpsi3"
[(parallel [(set (match_operand:PSI 0 "mra_operand" "")
(ashiftrt:PSI (match_operand:PSI 1 "mra_operand" "")
- (neg:QI (match_operand:QI 2 "mrai_operand" ""))))
+ (neg:QI (match_operand:QI 2 "shiftcount_operand" ""))))
(clobber (match_scratch:HI 3 ""))])]
"TARGET_A24"
"if (m32c_prepare_shift (operands, -1, ASHIFTRT))
@@ -232,7 +232,7 @@
(define_expand "lshrpsi3"
[(parallel [(set (match_operand:PSI 0 "mra_operand" "")
(lshiftrt:PSI (match_operand:PSI 1 "mra_operand" "")
- (neg:QI (match_operand:QI 2 "mrai_operand" ""))))
+ (neg:QI (match_operand:QI 2 "shiftcount_operand" ""))))
(clobber (match_scratch:HI 3 ""))])]
"TARGET_A24"
"if (m32c_prepare_shift (operands, -1, LSHIFTRT))
diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h
index b3b78a15adb..f5d6c3af76e 100644
--- a/gcc/config/m68k/m68k-protos.h
+++ b/gcc/config/m68k/m68k-protos.h
@@ -21,7 +21,7 @@ Boston, MA 02110-1301, USA. */
/* Define functions defined in aux-output.c and used in templates. */
#ifdef RTX_CODE
-extern bool m68k_interrupt_function_p (tree);
+extern enum m68k_function_kind m68k_get_function_kind (tree);
extern HOST_WIDE_INT m68k_initial_elimination_offset (int from, int to);
extern void split_di (rtx[], int, rtx[], rtx[]);
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index f9d9ca312e4..4ad7d86e7b0 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -224,6 +224,7 @@ static const struct attribute_spec m68k_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
{ "interrupt_handler", 0, 0, true, false, false, m68k_handle_fndecl_attribute },
+ { "interrupt_thread", 0, 0, true, false, false, m68k_handle_fndecl_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -634,10 +635,12 @@ m68k_cpp_cpu_family (const char *prefix)
return concat ("__m", prefix, "_family_", m68k_cpu_entry->family, NULL);
}
-/* Return nonzero if FUNC is an interrupt function as specified by the
- "interrupt_handler" attribute. */
-bool
-m68k_interrupt_function_p (tree func)
+/* Return m68k_fk_interrupt_handler if FUNC has an "interrupt_handler"
+ attribute and interrupt_thread if FUNC has an "interrupt_thread"
+ attribute. Otherwise, return m68k_fk_normal_function. */
+
+enum m68k_function_kind
+m68k_get_function_kind (tree func)
{
tree a;
@@ -645,7 +648,14 @@ m68k_interrupt_function_p (tree func)
return false;
a = lookup_attribute ("interrupt_handler", DECL_ATTRIBUTES (func));
- return (a != NULL_TREE);
+ if (a != NULL_TREE)
+ return m68k_fk_interrupt_handler;
+
+ a = lookup_attribute ("interrupt_thread", DECL_ATTRIBUTES (func));
+ if (a != NULL_TREE)
+ return m68k_fk_interrupt_thread;
+
+ return m68k_fk_normal_function;
}
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
@@ -663,6 +673,19 @@ m68k_handle_fndecl_attribute (tree *node, tree name,
*no_add_attrs = true;
}
+ if (m68k_get_function_kind (*node) != m68k_fk_normal_function)
+ {
+ error ("multiple interrupt attributes not allowed");
+ *no_add_attrs = true;
+ }
+
+ if (!TARGET_FIDOA
+ && !strcmp (IDENTIFIER_POINTER (name), "interrupt_thread"))
+ {
+ error ("interrupt_thread is available only on fido");
+ *no_add_attrs = true;
+ }
+
return NULL_TREE;
}
@@ -671,7 +694,10 @@ m68k_compute_frame_layout (void)
{
int regno, saved;
unsigned int mask;
- bool interrupt_handler = m68k_interrupt_function_p (current_function_decl);
+ enum m68k_function_kind func_kind =
+ m68k_get_function_kind (current_function_decl);
+ bool interrupt_handler = func_kind == m68k_fk_interrupt_handler;
+ bool interrupt_thread = func_kind == m68k_fk_interrupt_thread;
/* Only compute the frame once per function.
Don't cache information until reload has been completed. */
@@ -682,12 +708,15 @@ m68k_compute_frame_layout (void)
current_frame.size = (get_frame_size () + 3) & -4;
mask = saved = 0;
- for (regno = 0; regno < 16; regno++)
- if (m68k_save_reg (regno, interrupt_handler))
- {
- mask |= 1 << (regno - D0_REG);
- saved++;
- }
+
+ /* Interrupt thread does not need to save any register. */
+ if (!interrupt_thread)
+ for (regno = 0; regno < 16; regno++)
+ if (m68k_save_reg (regno, interrupt_handler))
+ {
+ mask |= 1 << (regno - D0_REG);
+ saved++;
+ }
current_frame.offset = saved * 4;
current_frame.reg_no = saved;
current_frame.reg_mask = mask;
@@ -696,12 +725,14 @@ m68k_compute_frame_layout (void)
mask = saved = 0;
if (TARGET_HARD_FLOAT)
{
- for (regno = 16; regno < 24; regno++)
- if (m68k_save_reg (regno, interrupt_handler))
- {
- mask |= 1 << (regno - FP0_REG);
- saved++;
- }
+ /* Interrupt thread does not need to save any register. */
+ if (!interrupt_thread)
+ for (regno = 16; regno < 24; regno++)
+ if (m68k_save_reg (regno, interrupt_handler))
+ {
+ mask |= 1 << (regno - FP0_REG);
+ saved++;
+ }
current_frame.foffset = saved * TARGET_FP_REG_SIZE;
current_frame.offset += current_frame.foffset;
}
@@ -4211,7 +4242,8 @@ m68k_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
saved by the prologue, even if they would normally be
call-clobbered. */
- if (m68k_interrupt_function_p (current_function_decl)
+ if ((m68k_get_function_kind (current_function_decl)
+ == m68k_fk_interrupt_handler)
&& !df_regs_ever_live_p (new_reg))
return 0;
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index baa5bcb6651..1b19b4c8095 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -903,8 +903,10 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define INCOMING_FRAME_SP_OFFSET 4
/* All registers are live on exit from an interrupt routine. */
-#define EPILOGUE_USES(REGNO) \
- (reload_completed && m68k_interrupt_function_p (current_function_decl))
+#define EPILOGUE_USES(REGNO) \
+ (reload_completed \
+ && (m68k_get_function_kind (current_function_decl) \
+ == m68k_fk_interrupt_handler))
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) \
@@ -1098,6 +1100,13 @@ enum fpu_type
FPUTYPE_COLDFIRE
};
+enum m68k_function_kind
+{
+ m68k_fk_normal_function,
+ m68k_fk_interrupt_handler,
+ m68k_fk_interrupt_thread
+};
+
/* Variables in m68k.c; see there for details. */
extern const char *m68k_library_id_string;
extern int m68k_last_compare_had_fp_operands;
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 78ddf58f71e..19abe624c29 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -6833,15 +6833,23 @@
[(return)]
""
{
- if (m68k_interrupt_function_p (current_function_decl))
- return "rte";
- else if (current_function_pops_args)
+ switch (m68k_get_function_kind (current_function_decl))
{
- operands[0] = GEN_INT (current_function_pops_args);
- return "rtd %0";
+ case m68k_fk_interrupt_handler:
+ return "rte";
+
+ case m68k_fk_interrupt_thread:
+ return "sleep";
+
+ default:
+ if (current_function_pops_args)
+ {
+ operands[0] = GEN_INT (current_function_pops_args);
+ return "rtd %0";
+ }
+ else
+ return "rts";
}
- else
- return "rts";
})
(define_insn "*m68k_store_multiple"
diff --git a/gcc/config/mips/mips-dspr2.md b/gcc/config/mips/mips-dspr2.md
index dd0aab553a1..20190085177 100644
--- a/gcc/config/mips/mips-dspr2.md
+++ b/gcc/config/mips/mips-dspr2.md
@@ -162,31 +162,13 @@
(match_operand:DI 1 "register_operand")))]
"TARGET_DSPR2 && !TARGET_64BIT")
-(define_insn "mips_msub"
- [(set (match_operand:DI 0 "register_operand" "=a")
- (minus:DI
- (match_operand:DI 1 "register_operand" "0")
- (mult:DI (sign_extend:DI
- (match_operand:SI 2 "register_operand" "d"))
- (sign_extend:DI
- (match_operand:SI 3 "register_operand" "d")))))]
- "TARGET_DSPR2 && !TARGET_64BIT"
- "msub\t%q0,%2,%3"
- [(set_attr "type" "imadd")
- (set_attr "mode" "SI")])
-
-(define_insn "mips_msubu"
- [(set (match_operand:DI 0 "register_operand" "=a")
+(define_expand "mips_msub<u>"
+ [(set (match_operand:DI 0 "register_operand")
(minus:DI
- (match_operand:DI 1 "register_operand" "0")
- (mult:DI (zero_extend:DI
- (match_operand:SI 2 "register_operand" "d"))
- (zero_extend:DI
- (match_operand:SI 3 "register_operand" "d")))))]
- "TARGET_DSPR2 && !TARGET_64BIT"
- "msubu\t%q0,%2,%3"
- [(set_attr "type" "imadd")
- (set_attr "mode" "SI")])
+ (match_operand:DI 1 "register_operand")
+ (mult:DI (any_extend:DI (match_operand:SI 2 "register_operand"))
+ (any_extend:DI (match_operand:SI 3 "register_operand")))))]
+ "TARGET_DSPR2 && !TARGET_64BIT")
(define_insn "mulv2hi3"
[(parallel
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index daca390e15b..27dfa440e38 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -412,6 +412,7 @@ static rtx mips_expand_builtin_bposge (enum mips_builtin_type, rtx);
static void mips_encode_section_info (tree, rtx, int);
static void mips_extra_live_on_entry (bitmap);
static int mips_mode_rep_extended (enum machine_mode, enum machine_mode);
+static bool mips_offset_within_alignment_p (rtx, HOST_WIDE_INT);
/* Structure to be filled in by compute_frame_size with register
save masks, and offsets for the current function. */
@@ -1350,6 +1351,28 @@ mips_classify_symbol (rtx x)
return SYMBOL_GENERAL;
}
+/* Returns true if OFFSET is within the range [0, ALIGN), where ALIGN
+ is the alignment (in bytes) of SYMBOL_REF X. */
+
+static bool
+mips_offset_within_alignment_p (rtx x, HOST_WIDE_INT offset)
+{
+ /* If for some reason we can't get the alignment for the
+ symbol, initializing this to one means we won't accept any
+ offset. */
+ HOST_WIDE_INT align = 1;
+ tree t;
+
+ /* Get the alignment of the symbol we're referring to. */
+ t = SYMBOL_REF_DECL (x);
+ if (t)
+ align = DECL_ALIGN_UNIT (t);
+
+ if (offset >= 0 && offset < align)
+ return true;
+ return false;
+}
+
/* Return true if X is a symbolic constant that can be calculated in
the same way as a bare symbol. If it is, store the type of the
symbol in *SYMBOL_TYPE. */
@@ -1361,7 +1384,10 @@ mips_symbolic_constant_p (rtx x, enum mips_symbol_type *symbol_type)
split_const (x, &x, &offset);
if (UNSPEC_ADDRESS_P (x))
- *symbol_type = UNSPEC_ADDRESS_TYPE (x);
+ {
+ *symbol_type = UNSPEC_ADDRESS_TYPE (x);
+ x = UNSPEC_ADDRESS (x);
+ }
else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
{
*symbol_type = mips_classify_symbol (x);
@@ -1416,14 +1442,18 @@ mips_symbolic_constant_p (rtx x, enum mips_symbol_type *symbol_type)
to GOT overflow. */
return SMALL_INT (offset);
+ case SYMBOL_TPREL:
+ case SYMBOL_DTPREL:
+ /* There is no carry between the HI and LO REL relocations, so the
+ offset is only valid if we know it won't lead to such a carry. */
+ return mips_offset_within_alignment_p (x, INTVAL (offset));
+
case SYMBOL_GOT_DISP:
case SYMBOL_GOTOFF_DISP:
case SYMBOL_GOTOFF_CALL:
case SYMBOL_GOTOFF_LOADGP:
case SYMBOL_TLSGD:
case SYMBOL_TLSLDM:
- case SYMBOL_DTPREL:
- case SYMBOL_TPREL:
case SYMBOL_GOTTPREL:
case SYMBOL_TLS:
case SYMBOL_HALF:
@@ -3528,7 +3558,7 @@ mips_emit_fcc_reload (rtx dest, rtx src, rtx scratch)
src = gen_rtx_REG (SFmode, true_regnum (src));
fp1 = gen_rtx_REG (SFmode, REGNO (scratch));
- fp2 = gen_rtx_REG (SFmode, REGNO (scratch) + FP_INC);
+ fp2 = gen_rtx_REG (SFmode, REGNO (scratch) + MAX_FPRS_PER_FMT);
emit_move_insn (copy_rtx (fp1), src);
emit_move_insn (copy_rtx (fp2), CONST0_RTX (SFmode));
@@ -3872,7 +3902,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (mips_abi != ABI_EABI || !info.fpr_p)
cum->num_gprs = info.reg_offset + info.reg_words;
else if (info.reg_words > 0)
- cum->num_fprs += FP_INC;
+ cum->num_fprs += MAX_FPRS_PER_FMT;
if (info.stack_words > 0)
cum->stack_words = info.stack_offset + info.stack_words;
@@ -4006,10 +4036,11 @@ function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (!info.fpr_p)
return gen_rtx_REG (mode, GP_ARG_FIRST + info.reg_offset);
- else if (info.reg_offset == 1)
- /* This code handles the special o32 case in which the second word
- of the argument structure is passed in floating-point registers. */
- return gen_rtx_REG (mode, FP_ARG_FIRST + FP_INC);
+ else if (mips_abi == ABI_32 && TARGET_DOUBLE_FLOAT && info.reg_offset > 0)
+ /* In o32, the second argument is always passed in $f14
+ for TARGET_DOUBLE_FLOAT, regardless of whether the
+ first argument was a word or doubleword. */
+ return gen_rtx_REG (mode, FP_ARG_FIRST + 2);
else
return gen_rtx_REG (mode, FP_ARG_FIRST + info.reg_offset);
}
@@ -4150,7 +4181,8 @@ mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
mode = TARGET_SINGLE_FLOAT ? SFmode : DFmode;
- for (i = local_cum.num_fprs; i < MAX_ARGS_IN_REGISTERS; i += FP_INC)
+ for (i = local_cum.num_fprs; i < MAX_ARGS_IN_REGISTERS;
+ i += MAX_FPRS_PER_FMT)
{
rtx ptr, mem;
@@ -5098,7 +5130,9 @@ override_options (void)
temp = ((regno & 1) == 0 || size <= UNITS_PER_WORD);
else if (FP_REG_P (regno))
- temp = ((regno % FP_INC) == 0)
+ temp = ((((regno % MAX_FPRS_PER_FMT) == 0)
+ || (MIN_FPRS_PER_FMT == 1
+ && size <= UNITS_PER_FPREG))
&& (((class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT
|| class == MODE_VECTOR_FLOAT)
&& size <= UNITS_PER_FPVALUE)
@@ -5112,7 +5146,7 @@ override_options (void)
&& size >= MIN_UNITS_PER_WORD
&& size <= UNITS_PER_FPREG)
/* Allow TFmode for CCmode reloads. */
- || (ISA_HAS_8CC && mode == TFmode));
+ || (ISA_HAS_8CC && mode == TFmode)));
else if (ACC_REG_P (regno))
temp = (INTEGRAL_MODE_P (mode)
@@ -6285,6 +6319,15 @@ mips_save_reg_p (unsigned int regno)
if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
return true;
+ /* Save both registers in an FPR pair if either one is used. This is
+ needed for the case when MIN_FPRS_PER_FMT == 1, which allows the odd
+ register to be used without the even register. */
+ if (FP_REG_P (regno)
+ && MAX_FPRS_PER_FMT == 2
+ && regs_ever_live[regno + 1]
+ && !call_used_regs[regno + 1])
+ return true;
+
/* We need to save the old frame pointer before setting up a new one. */
if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)
return true;
@@ -6437,15 +6480,15 @@ compute_frame_size (HOST_WIDE_INT size)
}
/* This loop must iterate over the same space as its companion in
- save_restore_insns. */
- for (regno = (FP_REG_LAST - FP_INC + 1);
+ mips_for_each_saved_reg. */
+ for (regno = (FP_REG_LAST - MAX_FPRS_PER_FMT + 1);
regno >= FP_REG_FIRST;
- regno -= FP_INC)
+ regno -= MAX_FPRS_PER_FMT)
{
if (mips_save_reg_p (regno))
{
- fp_reg_size += FP_INC * UNITS_PER_FPREG;
- fmask |= ((1 << FP_INC) - 1) << (regno - FP_REG_FIRST);
+ fp_reg_size += MAX_FPRS_PER_FMT * UNITS_PER_FPREG;
+ fmask |= ((1 << MAX_FPRS_PER_FMT) - 1) << (regno - FP_REG_FIRST);
}
}
@@ -6467,7 +6510,8 @@ compute_frame_size (HOST_WIDE_INT size)
cfun->machine->frame.fmask = fmask;
cfun->machine->frame.initialized = reload_completed;
cfun->machine->frame.num_gp = gp_reg_size / UNITS_PER_WORD;
- cfun->machine->frame.num_fp = fp_reg_size / (FP_INC * UNITS_PER_FPREG);
+ cfun->machine->frame.num_fp = (fp_reg_size
+ / (MAX_FPRS_PER_FMT * UNITS_PER_FPREG));
if (mask)
{
@@ -6490,7 +6534,7 @@ compute_frame_size (HOST_WIDE_INT size)
offset = (args_size + cprestore_size + var_size
+ gp_reg_rounded + fp_reg_size
- - FP_INC * UNITS_PER_FPREG);
+ - MAX_FPRS_PER_FMT * UNITS_PER_FPREG);
cfun->machine->frame.fp_sp_offset = offset;
cfun->machine->frame.fp_save_offset = offset - total_size;
}
@@ -6593,9 +6637,9 @@ mips_for_each_saved_reg (HOST_WIDE_INT sp_offset, mips_save_restore_fn fn)
compute_frame_size. */
offset = cfun->machine->frame.fp_sp_offset - sp_offset;
fpr_mode = (TARGET_SINGLE_FLOAT ? SFmode : DFmode);
- for (regno = (FP_REG_LAST - FP_INC + 1);
+ for (regno = (FP_REG_LAST - MAX_FPRS_PER_FMT + 1);
regno >= FP_REG_FIRST;
- regno -= FP_INC)
+ regno -= MAX_FPRS_PER_FMT)
if (BITSET_P (cfun->machine->frame.fmask, regno - FP_REG_FIRST))
{
mips_save_restore_reg (fpr_mode, regno, offset, fn);
@@ -7507,7 +7551,7 @@ mips_return_fpr_pair (enum machine_mode mode,
{
int inc;
- inc = (TARGET_NEWABI ? 2 : FP_INC);
+ inc = (TARGET_NEWABI ? 2 : MAX_FPRS_PER_FMT);
return gen_rtx_PARALLEL
(mode,
gen_rtvec (2,
@@ -7645,7 +7689,7 @@ mips_cannot_change_mode_class (enum machine_mode from,
registers, the first register always holds the low word.
We therefore can't allow FPRs to change between single-word
and multi-word modes. */
- if (FP_INC > 1 && reg_classes_intersect_p (FP_REGS, class))
+ if (MAX_FPRS_PER_FMT > 1 && reg_classes_intersect_p (FP_REGS, class))
return true;
}
else
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index e3c631e087e..fff2e660400 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1021,13 +1021,19 @@ extern const struct mips_rtx_cost_data *mips_cost;
/* For MIPS, width of a floating point register. */
#define UNITS_PER_FPREG (TARGET_FLOAT64 ? 8 : 4)
-/* If register $f0 holds a floating-point value, $f(0 + FP_INC) is
- the next available register. */
-#define FP_INC (TARGET_FLOAT64 || TARGET_SINGLE_FLOAT ? 1 : 2)
+/* The number of consecutive floating-point registers needed to store the
+ largest format supported by the FPU. */
+#define MAX_FPRS_PER_FMT (TARGET_FLOAT64 || TARGET_SINGLE_FLOAT ? 1 : 2)
+
+/* The number of consecutive floating-point registers needed to store the
+ smallest format supported by the FPU. */
+#define MIN_FPRS_PER_FMT \
+ (ISA_MIPS32 || ISA_MIPS32R2 || ISA_MIPS64 ? 1 : MAX_FPRS_PER_FMT)
/* The largest size of value that can be held in floating-point
registers and moved with a single instruction. */
-#define UNITS_PER_HWFPVALUE (TARGET_SOFT_FLOAT ? 0 : FP_INC * UNITS_PER_FPREG)
+#define UNITS_PER_HWFPVALUE \
+ (TARGET_SOFT_FLOAT ? 0 : MAX_FPRS_PER_FMT * UNITS_PER_FPREG)
/* The largest size of value that can be held in floating-point
registers. */
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 9b42f8a99ae..787786c129a 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -1649,16 +1649,18 @@
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
-(define_insn "*msac<u>_di"
- [(set (match_operand:DI 0 "register_operand" "=x")
+(define_insn "<u>msubsidi4"
+ [(set (match_operand:DI 0 "register_operand" "=ka")
(minus:DI
(match_operand:DI 3 "register_operand" "0")
(mult:DI
(any_extend:DI (match_operand:SI 1 "register_operand" "d"))
(any_extend:DI (match_operand:SI 2 "register_operand" "d")))))]
- "!TARGET_64BIT && ISA_HAS_MSAC"
+ "!TARGET_64BIT && (ISA_HAS_MSAC || GENERATE_MADD_MSUB || TARGET_DSPR2)"
{
- if (TARGET_MIPS5500)
+ if (TARGET_DSPR2)
+ return "msub<u>\t%q0,%1,%2";
+ else if (TARGET_MIPS5500 || GENERATE_MADD_MSUB)
return "msub<u>\t%1,%2";
else
return "msac<u>\t$0,%1,%2";
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 5f94f5fd5b5..cc6f220d126 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -733,7 +733,10 @@ legitimize_tls_address (rtx addr)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
tmp = gen_reg_rtx (Pmode);
- emit_insn (gen_tgd_load (tmp, addr));
+ if (flag_pic)
+ emit_insn (gen_tgd_load_pic (tmp, addr));
+ else
+ emit_insn (gen_tgd_load (tmp, addr));
ret = hppa_tls_call (tmp);
break;
@@ -741,7 +744,10 @@ legitimize_tls_address (rtx addr)
ret = gen_reg_rtx (Pmode);
tmp = gen_reg_rtx (Pmode);
start_sequence ();
- emit_insn (gen_tld_load (tmp, addr));
+ if (flag_pic)
+ emit_insn (gen_tld_load_pic (tmp, addr));
+ else
+ emit_insn (gen_tld_load (tmp, addr));
t1 = hppa_tls_call (tmp);
insn = get_insns ();
end_sequence ();
@@ -757,7 +763,10 @@ legitimize_tls_address (rtx addr)
tmp = gen_reg_rtx (Pmode);
ret = gen_reg_rtx (Pmode);
emit_insn (gen_tp_load (tp));
- emit_insn (gen_tie_load (tmp, addr));
+ if (flag_pic)
+ emit_insn (gen_tie_load_pic (tmp, addr));
+ else
+ emit_insn (gen_tie_load (tmp, addr));
emit_move_insn (ret, gen_rtx_PLUS (Pmode, tp, tmp));
break;
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index c6c6c935864..698579a4ba9 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -39,6 +39,9 @@
(UNSPEC_TLSLDBASE 7)
(UNSPEC_TLSIE 8)
(UNSPEC_TLSLE 9)
+ (UNSPEC_TLSGD_PIC 10)
+ (UNSPEC_TLSLDM_PIC 11)
+ (UNSPEC_TLSIE_PIC 12)
])
;; UNSPEC_VOLATILE:
@@ -10148,14 +10151,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(define_insn "tgd_load"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD))
- (clobber (reg:SI 1))]
+ (clobber (reg:SI 1))
+ (use (reg:SI 27))]
""
"*
{
- if (flag_pic)
- return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
- else
- return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
+ return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
+}"
+ [(set_attr "type" "multi")
+ (set_attr "length" "8")])
+
+(define_insn "tgd_load_pic"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD_PIC))
+ (clobber (reg:SI 1))
+ (use (reg:SI 19))]
+ ""
+ "*
+{
+ return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
}"
[(set_attr "type" "multi")
(set_attr "length" "8")])
@@ -10163,14 +10177,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(define_insn "tld_load"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM))
- (clobber (reg:SI 1))]
+ (clobber (reg:SI 1))
+ (use (reg:SI 27))]
""
"*
{
- if (flag_pic)
- return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
- else
- return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
+ return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
+}"
+ [(set_attr "type" "multi")
+ (set_attr "length" "8")])
+
+(define_insn "tld_load_pic"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM_PIC))
+ (clobber (reg:SI 1))
+ (use (reg:SI 19))]
+ ""
+ "*
+{
+ return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
}"
[(set_attr "type" "multi")
(set_attr "length" "8")])
@@ -10200,14 +10225,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(define_insn "tie_load"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE))
- (clobber (reg:SI 1))]
+ (clobber (reg:SI 1))
+ (use (reg:SI 27))]
""
"*
{
- if (flag_pic)
- return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
- else
- return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
+ return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
+}"
+ [(set_attr "type" "multi")
+ (set_attr "length" "8")])
+
+(define_insn "tie_load_pic"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE_PIC))
+ (clobber (reg:SI 1))
+ (use (reg:SI 19))]
+ ""
+ "*
+{
+ return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
}"
[(set_attr "type" "multi")
(set_attr "length" "8")])
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 4f9c4d85916..b3f664bede2 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -14841,77 +14841,6 @@ rs6000_emit_prologue (void)
sp_offset = info->total_size;
}
- /* Save AltiVec registers if needed. */
- if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0)
- {
- int i;
-
- /* There should be a non inline version of this, for when we
- are saving lots of vector registers. */
- for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
- if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
- {
- rtx areg, savereg, mem;
- int offset;
-
- offset = info->altivec_save_offset + sp_offset
- + 16 * (i - info->first_altivec_reg_save);
-
- savereg = gen_rtx_REG (V4SImode, i);
-
- areg = gen_rtx_REG (Pmode, 0);
- emit_move_insn (areg, GEN_INT (offset));
-
- /* AltiVec addressing mode is [reg+reg]. */
- mem = gen_frame_mem (V4SImode,
- gen_rtx_PLUS (Pmode, frame_reg_rtx, areg));
-
- insn = emit_move_insn (mem, savereg);
-
- rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
- areg, GEN_INT (offset));
- }
- }
-
- /* VRSAVE is a bit vector representing which AltiVec registers
- are used. The OS uses this to determine which vector
- registers to save on a context switch. We need to save
- VRSAVE on the stack frame, add whatever AltiVec registers we
- used in this function, and do the corresponding magic in the
- epilogue. */
-
- if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
- && info->vrsave_mask != 0)
- {
- rtx reg, mem, vrsave;
- int offset;
-
- /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12
- as frame_reg_rtx and r11 as the static chain pointer for
- nested functions. */
- reg = gen_rtx_REG (SImode, 0);
- vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
- if (TARGET_MACHO)
- emit_insn (gen_get_vrsave_internal (reg));
- else
- emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave));
-
- if (!WORLD_SAVE_P (info))
- {
- /* Save VRSAVE. */
- offset = info->vrsave_save_offset + sp_offset;
- mem = gen_frame_mem (SImode,
- gen_rtx_PLUS (Pmode, frame_reg_rtx,
- GEN_INT (offset)));
- insn = emit_move_insn (mem, reg);
- }
-
- /* Include the registers in the mask. */
- emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask)));
-
- insn = emit_insn (generate_set_vrsave (reg, info, 0));
- }
-
/* If we use the link register, get it into r0. */
if (!WORLD_SAVE_P (info) && info->lr_save_p)
{
@@ -15149,7 +15078,10 @@ rs6000_emit_prologue (void)
for which it was done previously. */
if (!WORLD_SAVE_P (info) && info->push_p
&& !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
- rs6000_emit_allocate_stack (info->total_size, FALSE);
+ {
+ rs6000_emit_allocate_stack (info->total_size, FALSE);
+ sp_offset = info->total_size;
+ }
/* Set frame pointer, if needed. */
if (frame_pointer_needed)
@@ -15159,6 +15091,78 @@ rs6000_emit_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
+ /* Save AltiVec registers if needed. Save here because the red zone does
+ not include AltiVec registers. */
+ if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0)
+ {
+ int i;
+
+ /* There should be a non inline version of this, for when we
+ are saving lots of vector registers. */
+ for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
+ if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
+ {
+ rtx areg, savereg, mem;
+ int offset;
+
+ offset = info->altivec_save_offset + sp_offset
+ + 16 * (i - info->first_altivec_reg_save);
+
+ savereg = gen_rtx_REG (V4SImode, i);
+
+ areg = gen_rtx_REG (Pmode, 0);
+ emit_move_insn (areg, GEN_INT (offset));
+
+ /* AltiVec addressing mode is [reg+reg]. */
+ mem = gen_frame_mem (V4SImode,
+ gen_rtx_PLUS (Pmode, frame_reg_rtx, areg));
+
+ insn = emit_move_insn (mem, savereg);
+
+ rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
+ areg, GEN_INT (offset));
+ }
+ }
+
+ /* VRSAVE is a bit vector representing which AltiVec registers
+ are used. The OS uses this to determine which vector
+ registers to save on a context switch. We need to save
+ VRSAVE on the stack frame, add whatever AltiVec registers we
+ used in this function, and do the corresponding magic in the
+ epilogue. */
+
+ if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
+ && info->vrsave_mask != 0)
+ {
+ rtx reg, mem, vrsave;
+ int offset;
+
+ /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12
+ as frame_reg_rtx and r11 as the static chain pointer for
+ nested functions. */
+ reg = gen_rtx_REG (SImode, 0);
+ vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
+ if (TARGET_MACHO)
+ emit_insn (gen_get_vrsave_internal (reg));
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave));
+
+ if (!WORLD_SAVE_P (info))
+ {
+ /* Save VRSAVE. */
+ offset = info->vrsave_save_offset + sp_offset;
+ mem = gen_frame_mem (SImode,
+ gen_rtx_PLUS (Pmode, frame_reg_rtx,
+ GEN_INT (offset)));
+ insn = emit_move_insn (mem, reg);
+ }
+
+ /* Include the registers in the mask. */
+ emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask)));
+
+ insn = emit_insn (generate_set_vrsave (reg, info, 0));
+ }
+
/* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */
if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0)
|| (DEFAULT_ABI == ABI_V4
@@ -15416,33 +15420,10 @@ rs6000_emit_epilogue (int sibcall)
return;
}
- /* If we have a frame pointer, a call to alloca, or a large stack
- frame, restore the old stack pointer using the backchain. Otherwise,
- we know what size to update it with. */
- if (use_backchain_to_restore_sp)
- {
- /* Under V.4, don't reset the stack pointer until after we're done
- loading the saved registers. */
- if (DEFAULT_ABI == ABI_V4)
- frame_reg_rtx = gen_rtx_REG (Pmode, 11);
-
- emit_move_insn (frame_reg_rtx,
- gen_rtx_MEM (Pmode, sp_reg_rtx));
- }
- else if (info->push_p)
- {
- if (DEFAULT_ABI == ABI_V4
- || current_function_calls_eh_return)
- sp_offset = info->total_size;
- else
- {
- emit_insn (TARGET_32BIT
- ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
- GEN_INT (info->total_size))
- : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
- GEN_INT (info->total_size)));
- }
- }
+ /* Set sp_offset based on the stack push from the prologue. */
+ if ((DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)
+ && info->total_size < 32767)
+ sp_offset = info->total_size;
/* Restore AltiVec registers if needed. */
if (TARGET_ALTIVEC_ABI && info->altivec_size != 0)
@@ -15483,6 +15464,36 @@ rs6000_emit_epilogue (int sibcall)
emit_insn (generate_set_vrsave (reg, info, 1));
}
+ sp_offset = 0;
+
+ /* If we have a frame pointer, a call to alloca, or a large stack
+ frame, restore the old stack pointer using the backchain. Otherwise,
+ we know what size to update it with. */
+ if (use_backchain_to_restore_sp)
+ {
+ /* Under V.4, don't reset the stack pointer until after we're done
+ loading the saved registers. */
+ if (DEFAULT_ABI == ABI_V4)
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+
+ emit_move_insn (frame_reg_rtx,
+ gen_rtx_MEM (Pmode, sp_reg_rtx));
+ }
+ else if (info->push_p)
+ {
+ if (DEFAULT_ABI == ABI_V4
+ || current_function_calls_eh_return)
+ sp_offset = info->total_size;
+ else
+ {
+ emit_insn (TARGET_32BIT
+ ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
+ GEN_INT (info->total_size))
+ : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
+ GEN_INT (info->total_size)));
+ }
+ }
+
/* Get the old lr if we saved it. */
if (info->lr_save_p)
{
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 4190535e62c..3fac610c543 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -137,6 +137,8 @@
;; Registers
;;
+; Registers with special meaning
+
(define_constants
[
; Sibling call register.
@@ -151,6 +153,37 @@
(TP_REGNUM 36)
])
+; Hardware register names
+
+(define_constants
+ [
+ ; General purpose registers
+ (GPR0_REGNUM 0)
+ ; Floating point registers.
+ (FPR0_REGNUM 16)
+ (FPR2_REGNUM 18)
+ ])
+
+;;
+;; PFPO GPR0 argument format
+;;
+
+(define_constants
+ [
+ ; PFPO operation type
+ (PFPO_CONVERT 0x1000000)
+ ; PFPO operand types
+ (PFPO_OP_TYPE_SF 0x5)
+ (PFPO_OP_TYPE_DF 0x6)
+ (PFPO_OP_TYPE_TF 0x7)
+ (PFPO_OP_TYPE_SD 0x8)
+ (PFPO_OP_TYPE_DD 0x9)
+ (PFPO_OP_TYPE_TD 0xa)
+ ; Bitposition of operand types
+ (PFPO_OP0_TYPE_SHIFT 16)
+ (PFPO_OP1_TYPE_SHIFT 8)
+ ])
+
;; Instruction operand type as used in the Principles of Operation.
;; Used to determine defaults for length and other attribute values.
@@ -221,6 +254,7 @@
(define_mode_macro FP [TF DF SF (TD "TARGET_HARD_DFP") (DD "TARGET_HARD_DFP")])
(define_mode_macro BFP [TF DF SF])
(define_mode_macro DFP [TD DD])
+(define_mode_macro DFP_ALL [TD DD SD])
(define_mode_macro DSF [DF SF])
(define_mode_macro SD_SF [SF SD])
(define_mode_macro DD_DF [DF DD])
@@ -3269,14 +3303,13 @@
DONE;
})
-(define_expand "fix_trunc<mode>di2"
- [(set (match_operand:DI 0 "register_operand" "")
- (fix:DI (match_operand:DSF 1 "nonimmediate_operand" "")))]
- "TARGET_64BIT && TARGET_HARD_FLOAT"
+(define_expand "fix_trunc<DSF:mode><GPR:mode>2"
+ [(set (match_operand:GPR 0 "register_operand" "")
+ (fix:GPR (match_operand:DSF 1 "register_operand" "")))]
+ "TARGET_HARD_FLOAT"
{
- operands[1] = force_reg (<MODE>mode, operands[1]);
- emit_insn (gen_fix_trunc<mode>di2_bfp (operands[0], operands[1],
- GEN_INT (5)));
+ emit_insn (gen_fix_trunc<DSF:mode><GPR:mode>2_bfp (operands[0], operands[1],
+ GEN_INT (5)));
DONE;
})
@@ -3331,19 +3364,6 @@
"TARGET_HARD_FLOAT"
"")
-;
-; fix_trunc(df|sf)si2 instruction pattern(s).
-;
-
-(define_expand "fix_trunc<mode>si2"
- [(set (match_operand:SI 0 "register_operand" "")
- (fix:SI (match_operand:DSF 1 "nonimmediate_operand" "")))]
- "TARGET_HARD_FLOAT"
-{
- operands[1] = force_reg (<MODE>mode, operands[1]);
- emit_insn (gen_fix_trunc<mode>si2_bfp (operands[0], operands[1], GEN_INT (5)));
- DONE;
-})
;
; float(si|di)(tf|df|sf|td|dd)2 instruction pattern(s).
@@ -3451,6 +3471,130 @@
[(set_attr "op_type" "RRF")
(set_attr "type" "fsimptf")])
+; Binary <-> Decimal floating point trunc patterns
+;
+
+(define_insn "*trunc<BFP:mode><DFP_ALL:mode>2"
+ [(set (reg:DFP_ALL FPR0_REGNUM)
+ (float_truncate:DFP_ALL (reg:BFP FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP"
+ "pfpo")
+
+(define_insn "*trunc<DFP_ALL:mode><BFP:mode>2"
+ [(set (reg:BFP FPR0_REGNUM)
+ (float_truncate:BFP (reg:DFP_ALL FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP"
+ "pfpo")
+
+(define_expand "trunc<BFP:mode><DFP_ALL:mode>2"
+ [(set (reg:BFP FPR2_REGNUM) (match_operand:BFP 1 "nonimmediate_operand" ""))
+ (set (reg:SI GPR0_REGNUM) (match_dup 2))
+ (parallel
+ [(set (reg:DFP_ALL FPR0_REGNUM)
+ (float_truncate:DFP_ALL (reg:BFP FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))])
+ (set (match_operand:DFP_ALL 0 "nonimmediate_operand" "")
+ (reg:DFP_ALL FPR0_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP
+ && GET_MODE_SIZE (<BFP:MODE>mode) > GET_MODE_SIZE (<DFP_ALL:MODE>mode)"
+{
+ HOST_WIDE_INT flags;
+
+ flags = (PFPO_CONVERT |
+ PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP0_TYPE_SHIFT |
+ PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP1_TYPE_SHIFT);
+
+ operands[2] = GEN_INT (flags);
+})
+
+(define_expand "trunc<DFP_ALL:mode><BFP:mode>2"
+ [(set (reg:DFP_ALL FPR2_REGNUM)
+ (match_operand:DFP_ALL 1 "nonimmediate_operand" ""))
+ (set (reg:SI GPR0_REGNUM) (match_dup 2))
+ (parallel
+ [(set (reg:BFP FPR0_REGNUM) (float_truncate:BFP (reg:DFP_ALL FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))])
+ (set (match_operand:BFP 0 "nonimmediate_operand" "") (reg:BFP FPR0_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP
+ && GET_MODE_SIZE (<DFP_ALL:MODE>mode) >= GET_MODE_SIZE (<BFP:MODE>mode)"
+{
+ HOST_WIDE_INT flags;
+
+ flags = (PFPO_CONVERT |
+ PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP0_TYPE_SHIFT |
+ PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP1_TYPE_SHIFT);
+
+ operands[2] = GEN_INT (flags);
+})
+
+;
+; Binary <-> Decimal floating point extend patterns
+;
+
+(define_insn "*extend<BFP:mode><DFP_ALL:mode>2"
+ [(set (reg:DFP_ALL FPR0_REGNUM) (float_extend:DFP_ALL (reg:BFP FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP"
+ "pfpo")
+
+(define_insn "*extend<DFP_ALL:mode><BFP:mode>2"
+ [(set (reg:BFP FPR0_REGNUM) (float_extend:BFP (reg:DFP_ALL FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP"
+ "pfpo")
+
+(define_expand "extend<BFP:mode><DFP_ALL:mode>2"
+ [(set (reg:BFP FPR2_REGNUM) (match_operand:BFP 1 "nonimmediate_operand" ""))
+ (set (reg:SI GPR0_REGNUM) (match_dup 2))
+ (parallel
+ [(set (reg:DFP_ALL FPR0_REGNUM)
+ (float_extend:DFP_ALL (reg:BFP FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))])
+ (set (match_operand:DFP_ALL 0 "nonimmediate_operand" "")
+ (reg:DFP_ALL FPR0_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP
+ && GET_MODE_SIZE (<BFP:MODE>mode) <= GET_MODE_SIZE (<DFP_ALL:MODE>mode)"
+{
+ HOST_WIDE_INT flags;
+
+ flags = (PFPO_CONVERT |
+ PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP0_TYPE_SHIFT |
+ PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP1_TYPE_SHIFT);
+
+ operands[2] = GEN_INT (flags);
+})
+
+(define_expand "extend<DFP_ALL:mode><BFP:mode>2"
+ [(set (reg:DFP_ALL FPR2_REGNUM)
+ (match_operand:DFP_ALL 1 "nonimmediate_operand" ""))
+ (set (reg:SI GPR0_REGNUM) (match_dup 2))
+ (parallel
+ [(set (reg:BFP FPR0_REGNUM) (float_extend:BFP (reg:DFP_ALL FPR2_REGNUM)))
+ (use (reg:SI GPR0_REGNUM))
+ (clobber (reg:CC CC_REGNUM))])
+ (set (match_operand:BFP 0 "nonimmediate_operand" "") (reg:BFP FPR0_REGNUM))]
+ "TARGET_HARD_FLOAT && TARGET_DFP
+ && GET_MODE_SIZE (<DFP_ALL:MODE>mode) < GET_MODE_SIZE (<BFP:MODE>mode)"
+{
+ HOST_WIDE_INT flags;
+
+ flags = (PFPO_CONVERT |
+ PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP0_TYPE_SHIFT |
+ PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP1_TYPE_SHIFT);
+
+ operands[2] = GEN_INT (flags);
+})
+
+
;;
;; ARITHMETIC OPERATIONS
;;
diff --git a/gcc/config/soft-fp/README b/gcc/config/soft-fp/README
index 870025cc53a..ea58753ec17 100644
--- a/gcc/config/soft-fp/README
+++ b/gcc/config/soft-fp/README
@@ -1,4 +1,5 @@
-Except for t-softfp, the files in this directory are part of the GNU C
-Library, not part of GCC. As described at
-<http://gcc.gnu.org/codingconventions.html>, changes should be made to
-the GNU C Library and the changed files then imported into GCC.
+Except for t-softfp, conversions involving TImode and conversions involving
+XFmode, the files in this directory are part of the GNU C Library, not part
+of GCC. As described at <http://gcc.gnu.org/codingconventions.html>, changes
+should be made to the GNU C Library and the changed files then imported
+into GCC.
diff --git a/gcc/config/soft-fp/double.h b/gcc/config/soft-fp/double.h
index c8f4420af85..b012d9d51be 100644
--- a/gcc/config/soft-fp/double.h
+++ b/gcc/config/soft-fp/double.h
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Double Precision
- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
Jakub Jelinek (jj@ultra.linux.cz),
@@ -168,13 +168,13 @@ union _FP_UNION_D
DFtype flt;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned sign : 1;
- unsigned exp : _FP_EXPBITS_D;
- unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_D;
+ _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
#else
- unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
- unsigned exp : _FP_EXPBITS_D;
- unsigned sign : 1;
+ _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+ unsigned exp : _FP_EXPBITS_D;
+ unsigned sign : 1;
#endif
} bits __attribute__((packed));
};
diff --git a/gcc/config/soft-fp/extended.h b/gcc/config/soft-fp/extended.h
index bbf39429e7f..e5f16debecb 100644
--- a/gcc/config/soft-fp/extended.h
+++ b/gcc/config/soft-fp/extended.h
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Extended Precision.
- Copyright (C) 1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek (jj@ultra.linux.cz).
@@ -94,12 +94,6 @@ union _FP_UNION_E
X##_f[1] = _flo.bits.frac1; \
X##_e = _flo.bits.exp; \
X##_s = _flo.bits.sign; \
- if (!X##_e && (X##_f[1] || X##_f[0]) \
- && !(X##_f[1] & _FP_IMPLBIT_E)) \
- { \
- X##_e++; \
- FP_SET_EXCEPTION(FP_EX_DENORM); \
- } \
} while (0)
#define FP_UNPACK_RAW_EP(X, val) \
@@ -112,12 +106,6 @@ union _FP_UNION_E
X##_f[1] = _flo->bits.frac1; \
X##_e = _flo->bits.exp; \
X##_s = _flo->bits.sign; \
- if (!X##_e && (X##_f[1] || X##_f[0]) \
- && !(X##_f[1] & _FP_IMPLBIT_E)) \
- { \
- X##_e++; \
- FP_SET_EXCEPTION(FP_EX_DENORM); \
- } \
} while (0)
#define FP_PACK_RAW_E(val, X) \
@@ -164,13 +152,13 @@ union _FP_UNION_E
#define FP_UNPACK_SEMIRAW_E(X,val) \
do { \
- _FP_UNPACK_RAW_E(X,val); \
+ FP_UNPACK_RAW_E(X,val); \
_FP_UNPACK_SEMIRAW(E,4,X); \
} while (0)
#define FP_UNPACK_SEMIRAW_EP(X,val) \
do { \
- _FP_UNPACK_RAW_EP(X,val); \
+ FP_UNPACK_RAW_EP(X,val); \
_FP_UNPACK_SEMIRAW(E,4,X); \
} while (0)
@@ -189,13 +177,13 @@ union _FP_UNION_E
#define FP_PACK_SEMIRAW_E(val,X) \
do { \
_FP_PACK_SEMIRAW(E,4,X); \
- _FP_PACK_RAW_E(val,X); \
+ FP_PACK_RAW_E(val,X); \
} while (0)
#define FP_PACK_SEMIRAW_EP(val,X) \
do { \
_FP_PACK_SEMIRAW(E,4,X); \
- _FP_PACK_RAW_EP(val,X); \
+ FP_PACK_RAW_EP(val,X); \
} while (0)
#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X)
@@ -277,14 +265,14 @@ union _FP_UNION_E
XFtype flt;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
- unsigned sign : 1;
- unsigned exp : _FP_EXPBITS_E;
- unsigned long frac : _FP_W_TYPE_SIZE;
+ _FP_W_TYPE pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_E;
+ _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
#else
- unsigned long frac : _FP_W_TYPE_SIZE;
- unsigned exp : _FP_EXPBITS_E;
- unsigned sign : 1;
+ _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
+ unsigned exp : _FP_EXPBITS_E;
+ unsigned sign : 1;
#endif
} bits;
};
@@ -299,11 +287,6 @@ union _FP_UNION_E
X##_f1 = 0; \
X##_e = _flo.bits.exp; \
X##_s = _flo.bits.sign; \
- if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
- { \
- X##_e++; \
- FP_SET_EXCEPTION(FP_EX_DENORM); \
- } \
} while (0)
#define FP_UNPACK_RAW_EP(X, val) \
@@ -315,11 +298,6 @@ union _FP_UNION_E
X##_f1 = 0; \
X##_e = _flo->bits.exp; \
X##_s = _flo->bits.sign; \
- if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
- { \
- X##_e++; \
- FP_SET_EXCEPTION(FP_EX_DENORM); \
- } \
} while (0)
#define FP_PACK_RAW_E(val, X) \
@@ -365,13 +343,13 @@ union _FP_UNION_E
#define FP_UNPACK_SEMIRAW_E(X,val) \
do { \
- _FP_UNPACK_RAW_E(X,val); \
+ FP_UNPACK_RAW_E(X,val); \
_FP_UNPACK_SEMIRAW(E,2,X); \
} while (0)
#define FP_UNPACK_SEMIRAW_EP(X,val) \
do { \
- _FP_UNPACK_RAW_EP(X,val); \
+ FP_UNPACK_RAW_EP(X,val); \
_FP_UNPACK_SEMIRAW(E,2,X); \
} while (0)
@@ -390,13 +368,13 @@ union _FP_UNION_E
#define FP_PACK_SEMIRAW_E(val,X) \
do { \
_FP_PACK_SEMIRAW(E,2,X); \
- _FP_PACK_RAW_E(val,X); \
+ FP_PACK_RAW_E(val,X); \
} while (0)
#define FP_PACK_SEMIRAW_EP(val,X) \
do { \
_FP_PACK_SEMIRAW(E,2,X); \
- _FP_PACK_RAW_EP(val,X); \
+ FP_PACK_RAW_EP(val,X); \
} while (0)
#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X)
diff --git a/gcc/config/soft-fp/extendxftf2.c b/gcc/config/soft-fp/extendxftf2.c
new file mode 100644
index 00000000000..af29a2ae9cc
--- /dev/null
+++ b/gcc/config/soft-fp/extendxftf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Return a converted to IEEE quad
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "extended.h"
+#include "quad.h"
+
+TFtype __extendxftf2(XFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_E(A);
+ FP_DECL_Q(R);
+ TFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_RAW_E(A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_EXTEND(Q,E,4,4,R,A);
+#else
+ FP_EXTEND(Q,E,2,2,R,A);
+#endif
+ FP_PACK_RAW_Q(r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/fixdfti.c b/gcc/config/soft-fp/fixdfti.c
new file mode 100644
index 00000000000..6d06514e22e
--- /dev/null
+++ b/gcc/config/soft-fp/fixdfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE double to 128bit signed integer
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "double.h"
+
+TItype __fixdfti(TFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_D(A);
+ UTItype r;
+
+ FP_UNPACK_RAW_D(A, a);
+ FP_TO_INT_D(r, A, TI_BITS, 1);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/fixsfti.c b/gcc/config/soft-fp/fixsfti.c
new file mode 100644
index 00000000000..779628eb403
--- /dev/null
+++ b/gcc/config/soft-fp/fixsfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE single to 128bit signed integer
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "single.h"
+
+TItype __fixsfti(SFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_S(A);
+ UTItype r;
+
+ FP_UNPACK_RAW_S(A, a);
+ FP_TO_INT_S(r, A, TI_BITS, 1);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/fixtfti.c b/gcc/config/soft-fp/fixtfti.c
new file mode 100644
index 00000000000..8311ea5a72c
--- /dev/null
+++ b/gcc/config/soft-fp/fixtfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE quad to 128bit signed integer
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+TItype __fixtfti(TFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A);
+ UTItype r;
+
+ FP_UNPACK_RAW_Q(A, a);
+ FP_TO_INT_Q(r, A, TI_BITS, 1);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/fixunsdfti.c b/gcc/config/soft-fp/fixunsdfti.c
new file mode 100644
index 00000000000..48c41d4ac99
--- /dev/null
+++ b/gcc/config/soft-fp/fixunsdfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE double to 128bit unsigned integer
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "double.h"
+
+UTItype __fixunsdfti(DFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_D(A);
+ UTItype r;
+
+ FP_UNPACK_RAW_D(A, a);
+ FP_TO_INT_D(r, A, TI_BITS, 0);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/fixunssfti.c b/gcc/config/soft-fp/fixunssfti.c
new file mode 100644
index 00000000000..89bcedbadc3
--- /dev/null
+++ b/gcc/config/soft-fp/fixunssfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE single to 128bit unsigned integer
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "single.h"
+
+UTItype __fixunssfti(SFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_S(A);
+ UTItype r;
+
+ FP_UNPACK_RAW_S(A, a);
+ FP_TO_INT_S(r, A, TI_BITS, 0);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/fixunstfti.c b/gcc/config/soft-fp/fixunstfti.c
new file mode 100644
index 00000000000..f62bd505c64
--- /dev/null
+++ b/gcc/config/soft-fp/fixunstfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE quad to 128bit unsigned integer
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+UTItype __fixunstfti(TFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A);
+ UTItype r;
+
+ FP_UNPACK_RAW_Q(A, a);
+ FP_TO_INT_Q(r, A, TI_BITS, 0);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/soft-fp/floattidf.c b/gcc/config/soft-fp/floattidf.c
new file mode 100644
index 00000000000..14b6ea36a7a
--- /dev/null
+++ b/gcc/config/soft-fp/floattidf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit signed integer to IEEE double
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "double.h"
+
+DFtype __floattidf(TItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_D(A);
+ DFtype a;
+
+ FP_FROM_INT_D(A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_D(a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/gcc/config/soft-fp/floattisf.c b/gcc/config/soft-fp/floattisf.c
new file mode 100644
index 00000000000..475cafa2770
--- /dev/null
+++ b/gcc/config/soft-fp/floattisf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit signed integer to IEEE single
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "single.h"
+
+SFtype __floattisf(TItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_S(A);
+ SFtype a;
+
+ FP_FROM_INT_S(A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_S(a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/gcc/config/soft-fp/floattitf.c b/gcc/config/soft-fp/floattitf.c
new file mode 100644
index 00000000000..12bbb2772c2
--- /dev/null
+++ b/gcc/config/soft-fp/floattitf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit signed integer to IEEE quad
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+TFtype __floattitf(TItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A);
+ TFtype a;
+
+ FP_FROM_INT_Q(A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_Q(a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/gcc/config/soft-fp/floatundidf.c b/gcc/config/soft-fp/floatundidf.c
index 2169a3f1988..af8e4a5aefe 100644
--- a/gcc/config/soft-fp/floatundidf.c
+++ b/gcc/config/soft-fp/floatundidf.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Convert a 64bit unsigned integer to IEEE double
- Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
@@ -32,8 +32,7 @@
#include "soft-fp.h"
#include "double.h"
-double
-__floatundidf(UDItype i)
+DFtype __floatundidf(UDItype i)
{
FP_DECL_EX;
FP_DECL_D(A);
diff --git a/gcc/config/soft-fp/floatundisf.c b/gcc/config/soft-fp/floatundisf.c
index 5f08764dc50..977f7dfc79f 100644
--- a/gcc/config/soft-fp/floatundisf.c
+++ b/gcc/config/soft-fp/floatundisf.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Convert a 64bit unsigned integer to IEEE single
- Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
@@ -32,8 +32,7 @@
#include "soft-fp.h"
#include "single.h"
-float
-__floatundisf(UDItype i)
+SFtype __floatundisf(UDItype i)
{
FP_DECL_EX;
FP_DECL_S(A);
diff --git a/gcc/config/soft-fp/floatunsidf.c b/gcc/config/soft-fp/floatunsidf.c
index 97b488ab68a..12d0f25bf0f 100644
--- a/gcc/config/soft-fp/floatunsidf.c
+++ b/gcc/config/soft-fp/floatunsidf.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Convert a 32bit unsigned integer to IEEE double
- Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
@@ -32,8 +32,7 @@
#include "soft-fp.h"
#include "double.h"
-double
-__floatunsidf(USItype i)
+DFtype __floatunsidf(USItype i)
{
FP_DECL_EX;
FP_DECL_D(A);
diff --git a/gcc/config/soft-fp/floatunsisf.c b/gcc/config/soft-fp/floatunsisf.c
index 2ec16ba7b7f..80c5d3d359f 100644
--- a/gcc/config/soft-fp/floatunsisf.c
+++ b/gcc/config/soft-fp/floatunsisf.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Convert a 32bit unsigned integer to IEEE single
- Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
@@ -32,8 +32,7 @@
#include "soft-fp.h"
#include "single.h"
-float
-__floatunsisf(USItype i)
+SFtype __floatunsisf(USItype i)
{
FP_DECL_EX;
FP_DECL_S(A);
diff --git a/gcc/config/soft-fp/floatuntidf.c b/gcc/config/soft-fp/floatuntidf.c
new file mode 100644
index 00000000000..db1fe1aacb6
--- /dev/null
+++ b/gcc/config/soft-fp/floatuntidf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit unsigned integer to IEEE double
+ Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "double.h"
+
+DFtype __floatuntidf(UTItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_D(A);
+ DFtype a;
+
+ FP_FROM_INT_D(A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_D(a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/gcc/config/soft-fp/floatuntisf.c b/gcc/config/soft-fp/floatuntisf.c
new file mode 100644
index 00000000000..11ad6430e25
--- /dev/null
+++ b/gcc/config/soft-fp/floatuntisf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit unsigned integer to IEEE single
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "single.h"
+
+SFtype __floatundisf(UTItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_S(A);
+ SFtype a;
+
+ FP_FROM_INT_S(A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_S(a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/gcc/config/soft-fp/floatuntitf.c b/gcc/config/soft-fp/floatuntitf.c
new file mode 100644
index 00000000000..8d669012644
--- /dev/null
+++ b/gcc/config/soft-fp/floatuntitf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit unsigned integer to IEEE quad
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "quad.h"
+
+TFtype __floatuntitf(UTItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A);
+ TFtype a;
+
+ FP_FROM_INT_Q(A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_Q(a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/gcc/config/soft-fp/op-2.h b/gcc/config/soft-fp/op-2.h
index 5c9bce4c179..3a3b3aa0691 100644
--- a/gcc/config/soft-fp/op-2.h
+++ b/gcc/config/soft-fp/op-2.h
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Basic two-word fraction declaration and manipulation.
- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
Jakub Jelinek (jj@ultra.linux.cz),
@@ -613,3 +613,5 @@
#define _FP_FRAC_COPY_1_2(D, S) (D##_f = S##_f0)
#define _FP_FRAC_COPY_2_1(D, S) ((D##_f0 = S##_f), (D##_f1 = 0))
+
+#define _FP_FRAC_COPY_2_2(D,S) _FP_FRAC_COPY_2(D,S)
diff --git a/gcc/config/soft-fp/op-4.h b/gcc/config/soft-fp/op-4.h
index 1b90535c56e..70b9fafbe5a 100644
--- a/gcc/config/soft-fp/op-4.h
+++ b/gcc/config/soft-fp/op-4.h
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Basic four-word fraction declaration and manipulation.
- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
Jakub Jelinek (jj@ultra.linux.cz),
@@ -684,3 +684,5 @@ do { \
D##_f[1] = S##_f1; \
D##_f[2] = D##_f[3] = 0; \
} while (0)
+
+#define _FP_FRAC_COPY_4_4(D,S) _FP_FRAC_COPY_4(D,S)
diff --git a/gcc/config/soft-fp/op-common.h b/gcc/config/soft-fp/op-common.h
index 0aa6e3e05d8..ef11b527b70 100644
--- a/gcc/config/soft-fp/op-common.h
+++ b/gcc/config/soft-fp/op-common.h
@@ -1153,7 +1153,8 @@ do { \
if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs \
|| (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \
< _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs) \
- || _FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \
+ || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
+ && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs)) \
abort(); \
D##_s = S##_s; \
_FP_FRAC_COPY_##dwc##_##swc(D, S); \
@@ -1168,6 +1169,14 @@ do { \
{ \
if (_FP_FRAC_ZEROP_##swc(S)) \
D##_e = 0; \
+ else if (_FP_EXPBIAS_##dfs \
+ < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \
+ { \
+ FP_SET_EXCEPTION(FP_EX_DENORM); \
+ _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs \
+ - _FP_FRACBITS_##sfs)); \
+ D##_e = 0; \
+ } \
else \
{ \
int _lz; \
@@ -1199,7 +1208,8 @@ do { \
#define FP_TRUNC(dfs,sfs,dwc,swc,D,S) \
do { \
if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs \
- || _FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \
+ || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1 \
+ && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs)) \
abort(); \
D##_s = S##_s; \
if (_FP_EXP_NORMAL(sfs, swc, S)) \
@@ -1211,8 +1221,11 @@ do { \
{ \
if (D##_e <= 0) \
{ \
- if (D##_e <= 1 - _FP_FRACBITS_##dfs) \
- _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \
+ if (D##_e < 1 - _FP_FRACBITS_##dfs) \
+ { \
+ _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \
+ _FP_FRAC_LOW_##swc(S) |= 1; \
+ } \
else \
{ \
_FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs; \
@@ -1234,11 +1247,24 @@ do { \
if (S##_e == 0) \
{ \
D##_e = 0; \
- _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
- if (!_FP_FRAC_ZEROP_##swc(S)) \
+ if (_FP_FRAC_ZEROP_##swc(S)) \
+ _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
+ else \
{ \
FP_SET_EXCEPTION(FP_EX_DENORM); \
- FP_SET_EXCEPTION(FP_EX_INEXACT); \
+ if (_FP_EXPBIAS_##sfs \
+ < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \
+ { \
+ _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \
+ - _FP_WFRACBITS_##dfs), \
+ _FP_WFRACBITS_##sfs); \
+ _FP_FRAC_COPY_##dwc##_##swc(D, S); \
+ } \
+ else \
+ { \
+ _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
+ _FP_FRAC_LOW_##dwc(D) |= 1; \
+ } \
} \
} \
else \
diff --git a/gcc/config/soft-fp/quad.h b/gcc/config/soft-fp/quad.h
index d7840ff0662..c22e944029f 100644
--- a/gcc/config/soft-fp/quad.h
+++ b/gcc/config/soft-fp/quad.h
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Quad Precision.
- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
Jakub Jelinek (jj@ultra.linux.cz),
@@ -176,15 +176,15 @@ union _FP_UNION_Q
} longs;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned sign : 1;
- unsigned exp : _FP_EXPBITS_Q;
- unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
- unsigned long frac0 : _FP_W_TYPE_SIZE;
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_Q;
+ _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+ _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
#else
- unsigned long frac0 : _FP_W_TYPE_SIZE;
- unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
- unsigned exp : _FP_EXPBITS_Q;
- unsigned sign : 1;
+ _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+ _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+ unsigned exp : _FP_EXPBITS_Q;
+ unsigned sign : 1;
#endif
} bits;
};
diff --git a/gcc/config/soft-fp/trunctfxf2.c b/gcc/config/soft-fp/trunctfxf2.c
new file mode 100644
index 00000000000..50d60bc5d53
--- /dev/null
+++ b/gcc/config/soft-fp/trunctfxf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Truncate IEEE quad into IEEE extended
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Uros Bizjak (ubizjak@gmail.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "soft-fp.h"
+#include "extended.h"
+#include "quad.h"
+
+XFtype __trunctfxf2(TFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A);
+ FP_DECL_E(R);
+ XFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q(A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC(E,Q,4,4,R,A);
+#else
+ FP_TRUNC(E,Q,2,2,R,A);
+#endif
+ FP_PACK_SEMIRAW_E(r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 4fb862cc908..c1b2813a3b3 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -73,6 +73,7 @@ extern int legitimate_address_p (enum machine_mode, rtx, int);
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
extern rtx legitimize_tls_address (rtx);
extern rtx legitimize_address (rtx, rtx, enum machine_mode);
+extern void sparc_emit_call_insn (rtx, rtx);
extern void sparc_defer_case_vector (rtx, rtx, int);
extern bool sparc_expand_move (enum machine_mode, rtx *);
extern void sparc_emit_set_const32 (rtx, rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 43ca4b96d97..3a31ec79e8a 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -981,17 +981,27 @@ sparc_expand_move (enum machine_mode mode, rtx *operands)
if (pic_address_needs_scratch (operands[1]))
operands[1] = legitimize_pic_address (operands[1], mode, 0);
- if (GET_CODE (operands[1]) == LABEL_REF && mode == SImode)
- {
- emit_insn (gen_movsi_pic_label_ref (operands[0], operands[1]));
- return true;
- }
+ /* VxWorks does not impose a fixed gap between segments; the run-time
+ gap can be different from the object-file gap. We therefore can't
+ assume X - _GLOBAL_OFFSET_TABLE_ is a link-time constant unless we
+ are absolutely sure that X is in the same segment as the GOT.
+ Unfortunately, the flexibility of linker scripts means that we
+ can't be sure of that in general, so assume that _G_O_T_-relative
+ accesses are never valid on VxWorks. */
+ if (GET_CODE (operands[1]) == LABEL_REF && !TARGET_VXWORKS_RTP)
+ {
+ if (mode == SImode)
+ {
+ emit_insn (gen_movsi_pic_label_ref (operands[0], operands[1]));
+ return true;
+ }
- if (GET_CODE (operands[1]) == LABEL_REF && mode == DImode)
- {
- gcc_assert (TARGET_ARCH64);
- emit_insn (gen_movdi_pic_label_ref (operands[0], operands[1]));
- return true;
+ if (mode == DImode)
+ {
+ gcc_assert (TARGET_ARCH64);
+ emit_insn (gen_movdi_pic_label_ref (operands[0], operands[1]));
+ return true;
+ }
}
if (symbolic_operand (operands[1], mode))
@@ -3213,7 +3223,9 @@ rtx
legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
rtx reg)
{
- if (GET_CODE (orig) == SYMBOL_REF)
+ if (GET_CODE (orig) == SYMBOL_REF
+ /* See the comment in sparc_expand_move. */
+ || (TARGET_VXWORKS_RTP && GET_CODE (orig) == LABEL_REF))
{
rtx pic_ref, address;
rtx insn;
@@ -3378,6 +3390,13 @@ load_pic_register (bool delay_pic_helper)
{
int orig_flag_pic = flag_pic;
+ if (TARGET_VXWORKS_RTP)
+ {
+ emit_insn (gen_vxworks_load_got ());
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
+ return;
+ }
+
/* If we haven't initialized the special PIC symbols, do so now. */
if (!pic_helper_symbol_name[0])
{
@@ -3406,6 +3425,29 @@ load_pic_register (bool delay_pic_helper)
since we may not fall out the bottom. */
emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
}
+
+/* Emit a call instruction with the pattern given by PAT. ADDR is the
+ address of the call target. */
+
+void
+sparc_emit_call_insn (rtx pat, rtx addr)
+{
+ rtx insn;
+
+ insn = emit_call_insn (pat);
+
+ /* The PIC register is live on entry to VxWorks PIC PLT entries. */
+ if (TARGET_VXWORKS_RTP
+ && flag_pic
+ && GET_CODE (addr) == SYMBOL_REF
+ && (SYMBOL_REF_DECL (addr)
+ ? !targetm.binds_local_p (SYMBOL_REF_DECL (addr))
+ : !SYMBOL_REF_LOCAL_P (addr)))
+ {
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
+ current_function_uses_pic_offset_table = 1;
+ }
+}
/* Return 1 if RTX is a MEM which is known to be aligned to at
least a DESIRED byte boundary. */
@@ -7772,13 +7814,19 @@ sparc_elf_asm_named_section (const char *name, unsigned int flags,
the sibling call right? Well, in the C++ case we can end up passing
the pointer to the struct return area to a constructor (which returns
void) and then nothing else happens. Such a sibling call would look
- valid without the added check here. */
+ valid without the added check here.
+
+ VxWorks PIC PLT entries require the global pointer to be initialized
+ on entry. We therefore can't emit sibling calls to them. */
static bool
sparc_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
return (decl
&& flag_delayed_branch
- && (TARGET_ARCH64 || ! current_function_returns_struct));
+ && (TARGET_ARCH64 || ! current_function_returns_struct)
+ && !(TARGET_VXWORKS_RTP
+ && flag_pic
+ && !targetm.binds_local_p (decl)));
}
/* libfunc renaming. */
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index db0e34e516d..1a4805bb7d3 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -22,6 +22,8 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
+#include "config/vxworks-dummy.h"
+
/* Note that some other tm.h files include this one and then override
whatever definitions are necessary. */
@@ -2409,6 +2411,7 @@ extern int sparc_indent_opcode;
else if (GET_CODE (index) == REG) \
fprintf (FILE, "+%s", reg_names[REGNO (index)]); \
else if (GET_CODE (index) == SYMBOL_REF \
+ || GET_CODE (index) == LABEL_REF \
|| GET_CODE (index) == CONST) \
fputc ('+', FILE), output_addr_const (FILE, index); \
else gcc_unreachable (); \
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 387b3405db5..6d5797dbe2b 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1874,6 +1874,22 @@
"flag_pic"
"or\t%1, %%lo(%a3-(%a2-.)), %0")
+;; Set up the PIC register for VxWorks.
+
+(define_expand "vxworks_load_got"
+ [(set (match_dup 0)
+ (high:SI (match_dup 1)))
+ (set (match_dup 0)
+ (mem:SI (lo_sum:SI (match_dup 0) (match_dup 1))))
+ (set (match_dup 0)
+ (mem:SI (lo_sum:SI (match_dup 0) (match_dup 2))))]
+ "TARGET_VXWORKS_RTP"
+{
+ operands[0] = pic_offset_table_rtx;
+ operands[1] = gen_rtx_SYMBOL_REF (SImode, VXWORKS_GOTT_BASE);
+ operands[2] = gen_rtx_SYMBOL_REF (SImode, VXWORKS_GOTT_INDEX);
+})
+
(define_expand "movdi"
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:DI 1 "general_operand" ""))]
@@ -6676,7 +6692,7 @@
{
rtx fn_rtx;
- gcc_assert (GET_MODE (operands[0]) == FUNCTION_MODE);
+ gcc_assert (MEM_P (operands[0]) && GET_MODE (operands[0]) == FUNCTION_MODE);
gcc_assert (GET_CODE (operands[3]) == CONST_INT);
@@ -6712,18 +6728,20 @@
/* We accept negative sizes for untyped calls. */
if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0)
- emit_call_insn
+ sparc_emit_call_insn
(gen_rtx_PARALLEL
(VOIDmode,
gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx),
operands[3],
- gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))));
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))),
+ XEXP (fn_rtx, 0));
else
- emit_call_insn
+ sparc_emit_call_insn
(gen_rtx_PARALLEL
(VOIDmode,
gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx),
- gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))));
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))),
+ XEXP (fn_rtx, 0));
finish_call:
@@ -6840,7 +6858,7 @@
rtx fn_rtx;
rtvec vec;
- gcc_assert (GET_MODE (operands[1]) == FUNCTION_MODE);
+ gcc_assert (MEM_P (operands[1]) && GET_MODE (operands[1]) == FUNCTION_MODE);
fn_rtx = operands[1];
@@ -6849,7 +6867,7 @@
gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx)),
gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)));
- emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec));
+ sparc_emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec), XEXP (fn_rtx, 0));
DONE;
})
diff --git a/gcc/config/sparc/t-vxworks b/gcc/config/sparc/t-vxworks
new file mode 100644
index 00000000000..2aabf1a43cd
--- /dev/null
+++ b/gcc/config/sparc/t-vxworks
@@ -0,0 +1,5 @@
+# Multilibs for VxWorks.
+
+MULTILIB_OPTIONS = mrtp fPIC
+MULTILIB_MATCHES = fPIC=fpic
+MULTILIB_EXCEPTIONS = fPIC
diff --git a/gcc/config/sparc/vxworks.h b/gcc/config/sparc/vxworks.h
new file mode 100644
index 00000000000..7faacea53ab
--- /dev/null
+++ b/gcc/config/sparc/vxworks.h
@@ -0,0 +1,64 @@
+/* Definitions of target machine for GNU compiler,
+ for SPARC targeting the VxWorks run time environment.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, 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 COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__sparc"); \
+ builtin_define ("CPU=SIMSPARCSOLARIS"); \
+ VXWORKS_OS_CPP_BUILTINS (); \
+ } \
+ while (0)
+
+#undef OVERRIDE_OPTIONS
+#define OVERRIDE_OPTIONS \
+ do \
+ { \
+ VXWORKS_OVERRIDE_OPTIONS; \
+ sparc_override_options (); \
+ } \
+ while (0)
+
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC VXWORKS_ADDITIONAL_CPP_SPEC
+
+#undef LIB_SPEC
+#define LIB_SPEC VXWORKS_LIB_SPEC
+#undef LINK_SPEC
+#define LINK_SPEC VXWORKS_LINK_SPEC
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fputs (" (SPARC/VxWorks)", stderr);
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER VXWORKS_FUNCTION_PROFILER
+
+/* Use standard numbered ctors/dtors sections. */
+#undef CTORS_SECTION_ASM_OP
+#undef DTORS_SECTION_ASM_OP
+
+/* We cannot use PC-relative accesses for VxWorks PIC because there is no
+ fixed gap between segments. */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 43bcc584856..c331a7f27ad 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1939,6 +1939,7 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
long value_long[2];
REAL_VALUE_TYPE r;
int size;
+ rtx first, second;
fprintf (file, "\t.literal .LC%u, ", (unsigned) labelno);
@@ -1952,11 +1953,18 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
{
case SFmode:
REAL_VALUE_TO_TARGET_SINGLE (r, value_long[0]);
+ if (HOST_BITS_PER_LONG > 32)
+ value_long[0] &= 0xffffffff;
fprintf (file, "0x%08lx\n", value_long[0]);
break;
case DFmode:
REAL_VALUE_TO_TARGET_DOUBLE (r, value_long);
+ if (HOST_BITS_PER_LONG > 32)
+ {
+ value_long[0] &= 0xffffffff;
+ value_long[1] &= 0xffffffff;
+ }
fprintf (file, "0x%08lx, 0x%08lx\n",
value_long[0], value_long[1]);
break;
@@ -1978,9 +1986,10 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
break;
case 8:
- output_addr_const (file, operand_subword (x, 0, 0, DImode));
+ split_double (x, &first, &second);
+ output_addr_const (file, first);
fputs (", ", file);
- output_addr_const (file, operand_subword (x, 1, 0, DImode));
+ output_addr_const (file, second);
fputs ("\n", file);
break;
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 6b48e86e1dc..12dae4d48f9 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -1,5 +1,5 @@
;; GCC machine description for Tensilica's Xtensa architecture.
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
;; Free Software Foundation, Inc.
;; Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
@@ -125,55 +125,6 @@
;; Addition.
-(define_expand "adddi3"
- [(set (match_operand:DI 0 "register_operand" "")
- (plus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "register_operand" "")))]
- ""
-{
- rtx srclo;
- rtx dstlo = gen_lowpart (SImode, operands[0]);
- rtx src1lo = gen_lowpart (SImode, operands[1]);
- rtx src2lo = gen_lowpart (SImode, operands[2]);
-
- rtx dsthi = gen_highpart (SImode, operands[0]);
- rtx src1hi = gen_highpart (SImode, operands[1]);
- rtx src2hi = gen_highpart (SImode, operands[2]);
-
- /* Either source can be used for overflow checking, as long as it's
- not clobbered by the first addition. */
- if (!rtx_equal_p (dstlo, src1lo))
- srclo = src1lo;
- else if (!rtx_equal_p (dstlo, src2lo))
- srclo = src2lo;
- else
- {
- srclo = gen_reg_rtx (SImode);
- emit_move_insn (srclo, src1lo);
- }
-
- emit_insn (gen_addsi3 (dstlo, src1lo, src2lo));
- emit_insn (gen_addsi3 (dsthi, src1hi, src2hi));
- emit_insn (gen_adddi_carry (dsthi, dstlo, srclo));
- DONE;
-})
-
-;; Represent the add-carry operation as an atomic operation instead of
-;; expanding it to a conditional branch. Otherwise, the edge
-;; profiling code breaks because inserting the count increment code
-;; causes a new jump insn to be added.
-
-(define_insn "adddi_carry"
- [(set (match_operand:SI 0 "register_operand" "+a")
- (plus:SI (ltu:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))
- (match_dup 0)))]
- ""
- "bgeu\t%1, %2, 0f\;addi\t%0, %0, 1\;0:"
- [(set_attr "type" "multi")
- (set_attr "mode" "SI")
- (set_attr "length" "6")])
-
(define_insn "addsi3"
[(set (match_operand:SI 0 "register_operand" "=D,D,a,a,a")
(plus:SI (match_operand:SI 1 "register_operand" "%d,d,r,r,r")
@@ -213,37 +164,6 @@
;; Subtraction.
-(define_expand "subdi3"
- [(set (match_operand:DI 0 "register_operand" "")
- (minus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "register_operand" "")))]
- ""
-{
- rtx dstlo = gen_lowpart (SImode, operands[0]);
- rtx src1lo = gen_lowpart (SImode, operands[1]);
- rtx src2lo = gen_lowpart (SImode, operands[2]);
-
- rtx dsthi = gen_highpart (SImode, operands[0]);
- rtx src1hi = gen_highpart (SImode, operands[1]);
- rtx src2hi = gen_highpart (SImode, operands[2]);
-
- emit_insn (gen_subsi3 (dsthi, src1hi, src2hi));
- emit_insn (gen_subdi_carry (dsthi, src1lo, src2lo));
- emit_insn (gen_subsi3 (dstlo, src1lo, src2lo));
- DONE;
-})
-
-(define_insn "subdi_carry"
- [(set (match_operand:SI 0 "register_operand" "+a")
- (minus:SI (match_dup 0)
- (ltu:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))))]
- ""
- "bgeu\t%1, %2, 0f\;addi\t%0, %0, -1\;0:"
- [(set_attr "type" "multi")
- (set_attr "mode" "SI")
- (set_attr "length" "6")])
-
(define_insn "subsi3"
[(set (match_operand:SI 0 "register_operand" "=a")
(minus:SI (match_operand:SI 1 "register_operand" "r")
diff --git a/gcc/configure b/gcc/configure
index 17e4fdc7663..a11f6755cb4 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1767,6 +1767,13 @@ _ACEOF
fi
+gnu_ld=`if test x"$gnu_ld_flag" = x"yes"; then echo 1; else echo 0; fi`
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GNU_LD $gnu_ld
+_ACEOF
+
+
echo "$as_me:$LINENO: checking whether a default linker was specified" >&5
echo $ECHO_N "checking whether a default linker was specified... $ECHO_C" >&6
if test x"${DEFAULT_LINKER+set}" = x"set"; then
@@ -7165,17 +7172,20 @@ if test "${with_sysroot+set}" = set; then
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
+ test_exec_prefix=$test_prefix
else
- test_prefix=$exec_prefix
+ test_exec_prefix=$exec_prefix
fi
case ${TARGET_SYSTEM_ROOT} in
"${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
'${exec_prefix}'|'${exec_prefix}/'*)
t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
TARGET_SYSTEM_ROOT_DEFINE="$t"
@@ -7665,7 +7675,7 @@ if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then
else
ac_prog_version=`$MAKEINFO --version 2>&1 |
sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
- echo "configure:7668: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:7678: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.[4-9]*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 9a7c563ec7b..295b8e78054 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -206,6 +206,9 @@ if test x"${DEFAULT_LINKER+set}" = x"set"; then
[Define to enable the use of a default linker.])
fi
+gnu_ld=`if test x"$gnu_ld_flag" = x"yes"; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(HAVE_GNU_LD, $gnu_ld, [Define if using GNU ld.])
+
AC_MSG_CHECKING([whether a default linker was specified])
if test x"${DEFAULT_LINKER+set}" = x"set"; then
if test x"$gnu_ld_flag" = x"no"; then
@@ -787,17 +790,20 @@ AC_ARG_WITH(sysroot,
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
+ test_exec_prefix=$test_prefix
else
- test_prefix=$exec_prefix
+ test_exec_prefix=$exec_prefix
fi
case ${TARGET_SYSTEM_ROOT} in
"${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
'${exec_prefix}'|'${exec_prefix}/'*)
t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
TARGET_SYSTEM_ROOT_DEFINE="$t"
diff --git a/gcc/convert.c b/gcc/convert.c
index 82b40bad0a7..1cfb05cfd3e 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -656,7 +656,7 @@ convert_to_integer (tree type, tree expr)
|| !TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg1)))
&& (ex_form == PLUS_EXPR
|| ex_form == MINUS_EXPR)))
- typex = lang_hooks.types.unsigned_type (typex);
+ typex = unsigned_type_for (typex);
else
typex = lang_hooks.types.signed_type (typex);
return convert (type,
@@ -678,7 +678,7 @@ convert_to_integer (tree type, tree expr)
/* Don't do unsigned arithmetic where signed was wanted,
or vice versa. */
if (TYPE_UNSIGNED (TREE_TYPE (expr)))
- typex = lang_hooks.types.unsigned_type (type);
+ typex = unsigned_type_for (type);
else
typex = lang_hooks.types.signed_type (type);
return convert (type,
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b2f34a3f92a..eb9656f4898 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,50 @@
+2007-05-14 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/29928
+ * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
+ type only if is a class type (5.2.8/4).
+
+2007-05-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+ * decl.c (grokdeclarator): Use unsigned_type_for instead of
+ c_common_unsigned_type.
+
+2007-05-11 Silvius Rus <rus@google.com>
+
+ * cp/typeck.c (build_indirect_ref): Add call to
+ strict_aliasing_warning.
+ (build_reinterpret_cast_1): Condition call to
+ strict_aliasing_warning.
+
+2007-05-11 Jan Hubicka <jh@suse.cz>
+
+ * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
+ * decl2.c (start_objects): ctors and dtors are no longer public.
+ (cp_write_global_declarations): Do not call c_build_cdtor_fns.
+
+2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * typeck.c (build_unary_op): Remove code that used to
+ handle non lvalue increments/decrements.
+
+2007-05-07 Mike Stump <mrs@apple.com>
+
+ * parser.c (check_empty_body): Add.
+ (cp_parser_iteration_statement): Add call to check_empty_body.
+
+2007-05-05 Geoffrey Keating <geoffk@apple.com>
+
+ PR 31775
+ * mangle.c (write_mangled_name): Mangle static variable names.
+ (write_unqualified_name): Use local-source-name for
+ namespace-scope static variables.
+
+2007-05-04 Dirk Mueller <dmueller@suse.de>
+
+ * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
+ not in effect.
+
2007-05-02 Seongbae Park <seongbae.park@gmail.com>
PR c++/31663
@@ -1087,7 +1134,7 @@ o2007-02-06 Mark Mitchell <mark@codesourcery.com>
* pt.c: Fix a comment typo.
-2006-01-02 Ian Lance Taylor <iant@google.com>
+2007-01-02 Ian Lance Taylor <iant@google.com>
* semantics.c (maybe_convert_cond): Optionally warn when using an
assignment as a condition.
@@ -1147,7019 +1194,3 @@ o2007-02-06 Mark Mitchell <mark@codesourcery.com>
canonical reduced type parameter.
(any_template_arguments_need_structural_equality_p): New.
-2006-12-31 Simon Martin <simartin@users.sourceforge.net>
-
- PR c++/29731
- * parser.c (cp_parser_primary_expression): Return error_mark_node when
- a statement-expression is found outside of a function body.
-
-2006-12-28 Kazu Hirata <kazu@codesourcery.com>
-
- * cp-tree.h (TYPE_NAMESPACE_SCOPE_P, TYPE_FUNCTION_SCOPE_P):
- Remove.
-
- * decl2.c: Fix a comment typo.
-
-2006-12-21 Andrew Pinski <pinskia@gmail.com>
-
- PR C++/30225
- * decl.c (cxx_builtin_function): Only copy the decl if adding
- it to the std namespace.
-
-2006-12-21 Andrew Pinski <pinskia@gmail.com>
-
- PR C++/30168
- * optimize.c (update_cloned_parm): Copy DECL_GIMPLE_REG_P also.
-
-2006-12-22 Kazu Hirata <kazu@codesourcery.com>
-
- * decl.c: Fix a coment typo.
-
-2006-12-18 Ian Lance Taylor <iant@google.com>
-
- * decl.c (start_preparsed_function): Add support for
- -Wmissing-declarations.
-
-2006-12-16 Simon Martin <simartin@users.sourceforge.net>
-
- PR c++/29475
- * cp-tree.h (struct deferred_access_check): New structure to represent a
- deferred access check. It replaces the previous representation as a tree.
- (get_deferred_access_checks): Return a vector of struct
- deferred_access_check instead of a tree list.
- (perform_access_checks): Take a vector of struct deferred_access_check
- instead of a tree list.
- * semantics.c (struct deferred_access): Store the deferred access checks
- as a vector of struct deferred_access_check instead of a tree list.
- (push_deferring_access_checks): Handle the change in struct
- deferred_access.
- (get_deferred_access_checks): Likewise.
- (pop_to_parent_deferring_access_checks): Likewise.
- (perform_or_defer_access_check): Likewise.
- (perform_access_checks): Take a vector of struct deferred_access_check
- instead of a tree list.
- * parser.c (struct tree_check): New structure to store various data
- associated with a CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID token.
- (struct cp_token): Changed the value field to be a union with a pointer to
- a struct tree_check for CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID
- tokens and a tree field for all other tokens.
- (eof_token): Adjusted due to the change in struct cp_token.
- (cp_lexer_get_preprocessor_token): Likewise.
- (cp_lexer_purge_token): Likewise.
- (cp_lexer_purge_tokens_after): Likewise.
- (cp_lexer_print_token): Likewise.
- (cp_parser_error): Likewise.
- (cp_parser_identifier): Likewise.
- (cp_parser_string_literal): Likewise.
- (cp_parser_primary_expression): Likewise.
- (cp_parser_unqualified_id): Likewise.
- (cp_parser_parenthesized_expression_list): Likewise.
- (cp_parser_storage_class_specifier_opt): Likewise.
- (cp_parser_function_specifier_opt): Likewise.
- (cp_parser_type_specifier): Likewise.
- (cp_parser_simple_type_specifier): Likewise.
- (cp_parser_initializer_list): Likewise.
- (cp_parser_member_specification_opt): Likewise.
- (cp_parser_attribute_list): Likewise.
- (cp_parser_objc_expression): Likewise.
- (cp_parser_objc_protocol_qualifiers): Likewise.
- (cp_parser_objc_selector): Likewise.
- (cp_parser_objc_declaration): Likewise.
- (cp_parser_objc_statement): Likewise.
- (cp_parser_omp_clause_name): Likewise.
- (cp_parser_omp_clause_default): Likewise.
- (cp_parser_omp_clause_schedule): Likewise.
- (cp_parser_omp_parallel): Likewise.
- (cp_parser_initial_pragma): Likewise.
- (pragma_lex): Likewise.
- (cp_parser_pre_parsed_nested_name_specifier): Likewise.
- (cp_parser_nested_name_specifier_opt): Likewise.
- Use cp_token::u::tree_check_value to save the token's value, the
- associated deferred checks and its qualifying scope.
- (cp_parser_template_id): Likewise.
- (cp_parser_template_declaration_after_export): Adjusted the call to
- get_deferred_access_checks.
- (cp_parser_init_declarator): Take the access checks as a vector of struct
- deferred_access_check instead of a tree list.
- (cp_parser_single_declaration): Likewise.
- (cp_parser_perform_template_parameter_access_checks): Likewise.
- (cp_parser_simple_declaration): Adjusted the call to
- cp_parser_init_declarator.
- (cp_parser_explicit_specialization): Adjusted the call to
- cp_parser_single_declaration.
-
-2006-12-13 Ian Lance Taylor <iant@google.com>
-
- PR c++/19564
- PR c++/19756
- * parser.c (cp_parser_expression_stack_entry): Add field
- lhs_type.
- (cp_parser_binary_expression): Track tree code of left hand side
- of expression. Use it when calling build_x_binary_op.
- (cp_parser_selection_statement): Add if_p parameter. Change all
- callers. Warn about ambiguous else.
- (cp_parser_statement): Add if_p parameter. Change all callers.
- (cp_parser_implicitly_scoped_statement): Likewise.
- * typeck.c (build_x_binary_op): Add parameters arg1_code and
- arg2_code. Change all callers. Call warn_about_parentheses.
- * cp-tree.h (build_x_binary_op): Update declaration.
-
-2006-12-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
-
- * decl.c (build_enumerator): Update error message to match C
- front-end.
-
-2006-12-11 Jan Hubicka <jh@suse.cz>
-
- * decl2.c (var_finalized_p): Update for renamed varpool functions.
-
-2006-12-09 Zack Weinberg <zackw@panix.com>
-
- * parser.c (yydebug, enum pragma_omp_clause): Delete.
-
-2006-12-07 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29732
- * cp-tree.h (DECL_USE_TEMPLATE): Mention partial specializations.
- (explicit_class_specialization_p): Declare.
- * pt.c (explicit_class_specialization_p): New function.
- * parser.c (cp_parser_init_declarator): Check correct number of
- template parameters for in-class function definitions.
- (cp_parser_check_declrator_template_parameters): Stop looking for
- template classes when we find an explicit specialization.
-
-2006-12-07 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/29980
- * cp_parser_elaborated_type_specifier: Check
- the return value of check_elaborated_type_specifier.
-
-2006-12-06 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29730
- * parser.c (cp_parser_init_declarator): Reject initialization of
- functions.
-
-2006-12-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29729
- * decl2.c (check_member_template): Move check for member
- templates in local classes to ...
- * parser.c (cp_parser_template_declaration_after_export):
- ... here.
-
- PR c++/29728
- * decl.c (check_array_designated_initializer): New function.
- (maybe_deduce_size_from_array_init): Use it.
- (reshape_init_array): Likewise.
-
-2006-12-05 Aldy Hernandez <aldyh@redhat.com>
-
- Merge from gimple-tuples-branch.
-
- 2006-10-05 Aldy Hernandez <aldyh@redhat.com>
-
- * cp-gimplify.c (cp_gimplify_expr): Adjust for GIMPLE_MODIFY_STMT.
- (cxx_omp_clause_apply_fn): Adjust for GIMPLE_MODIFY_STMT.
- (cxx_omp_clause_copy_ctor): Same.
- (cxx_omp_clause_assign_op): Same.
-
- 2006-09-28 Aldy Hernandez <aldyh@redhat.com>
-
- * cp-tree.h (union lang_tree_node): Gimple statements do not
- have a TREE_CHAIN.
- (TREE_INDIRECT_USING): Look in base.
-
-2006-12-04 Jan Hubicka <jh@suse.cz>
-
- * cp-objcp-common.c (cp_expr_size): Return NULL in the case
- size is undefined.
-
-2006-12-04 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29733
- * pt.c (tsubst_decl): Disallow variables of function type.
-
- PR c++/29632
- * call.c (add_builtin_candidate): Do not permit NULL pointer
- constants to be compared with template parameters.
-
-2006-12-04 Eric Botcazou <ebotcazou@adacore.com>
-
- * pt.c (for_each_template_parm_r) <INTEGER_TYPE>: New case.
- Call for_each_template_parm on TYPE_MIN_VALUE and TYPE_MAX_VALUE.
-
-2006-12-03 Richard Henderson <rth@redhat.com>
- Andrew Pinski <pinskia@gmail.com>
-
- PR C++/14329
- * error.c (cp_printer) <'D'>: Handle DECL_DEBUG_EXPR.
-
-2006-12-02 Andrew Pinski <andrew_pinski@playstation.sony.com>
-
- PR C++/30033
- * decl.c (cp_tree_node_structure): Handle STATIC_ASSERT.
-
-2006-12-02 Kazu Hirata <kazu@codesourcery.com>
-
- * name-lookup.c: Follow spelling conventions.
-
-2006-12-01 Geoffrey Keating <geoffk@apple.com>
-
- * decl.c (poplevel): Check DECL_INITIAL invariant.
- (duplicate_decls): Preserve DECL_INITIAL when eliminating
- a new definition in favour of an old declaration.
- (start_preparsed_function): Define and document value of
- DECL_INITIAL before and after routine.
- (finish_function): Check DECL_INITIAL invariant.
- * parser.c
- (cp_parser_function_definition_from_specifiers_and_declarator):
- Skip duplicate function definitions.
-
-2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/30022
- * typeck.c (type_after_usual_arithmetic_conversions):
- Fix assertion for vector types.
- (build_binary_op): Use temporary for inner type of vector types.
-
-2006-12-01 Ryan Mansfield <rmansfield@qnx.com>
-
- PR c++/29066
- * typeck.c (build_binary_op): Fix pointer to member function
- comparison for ptrmemfunc_vbit_in_delta targets.
-
-2006-12-01 Dirk Mueller <dmueller@suse.de>
-
- PR c++/18313
- * decl.c (grokdeclarator): Warn for type qualifiers on return
- type for non-dependent types.
- * pt.c (tsubst_function_type): Warn for type qualifiers on
- return type for dependent types.
-
-2006-11-30 Geoffrey Keating <geoffk@apple.com>
-
- * rtti.c (get_tinfo_decl): Handle return value from
- pushdecl_top_level_and_finish.
-
-2006-11-29 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/29022
- * parser.c (cp_parser_class_head): Move processing
- of any base classes to...
- (cp_parser_class_specifier) ...here. Take an extra
- tree* parameter for any base classes. Only process
- them if the opening brace was found.
-
-2006-11-28 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/29735
- * decl.c (grokfndecl): Check main's type after applying
- attributes, not before.
-
-2006-11-27 Mark Mitchell <mark@codesourcery.com>
-
- * class.c (build_vcall_offset_vtbl_entries): Do not add vcall
- entries for a primary construction virtual table.
-
-2006-11-26 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29886
- * parser.c (cp_parser): Add in_function_body.
- (cp_parser_new): Initialize it.
- (cp_parser_primary_expression): Use parser->in_function_body
- instead of at_function_scope_p.
- (cp_parser_asm_definition): Likewise.
- (cp_parser_direct_declarator): Likewise.
- (cp_parser_class_specifier): Clear parser->in_function_body.
- (cp_parser_constructor_declarator_p): Use parser->in_function_body
- instead of at_function_scope_p.
- (cp_parser_function_body_after_declarator): Set
- parser->in_function_body.
-
-2006-11-21 Douglas Gregor <doug.gregor@gmail.com>
-
- * cp-tree.def (STATIC_ASSERT): New.
- * cp-objcp-common.c (cp_tree_size): Handle STATIC_ASSERT.
- * error.c (dump_decl): Handle STATIC_ASSERT.
- * cp-tree.h (STATIC_ASSERT_CONDITION): New.
- (STATIC_ASSERT_MESSAGE): New.
- (STATIC_ASSERT_SOURCE_LOCATION): New.
- (struct tree_static_assert): New.
- (enum cp_tree_node_structure_enum): Add TS_CP_STATIC_ASSERT.
- (union lang_tree_node): Add static_assertion.
- (finish_static_assert): Declare.
- * cxx-pretty-print.c (pp_cxx_statement): Handle STATIC_ASSERT.
- (pp_cxx_declaration): Handle STATIC_ASSERT.
- * pt.c (instantiate_class_template): Handle
- STATIC_ASSERT members.
- (tsubst_expr): Handle STATIC_ASSERT statements.
- * semantics.c (finish_static_assert): New.
- * lex.c (D_CPP0X): New.
- (reswords): Add static_assert keyword.
- (init_reswords): If not flag_cpp0x, mask out C++0x keywords.
- * parser.c (cp_parser_block_declaration): Parse static
- assertions.
- (cp_parser_static_assert): New.
- (cp_parser_member_declaration): Parse static assertions.
-
-2006-11-21 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/29570
- * decl.c (cp_finish_decl): Check for value dependent brace enclosed
- scalar initializer.
-
- PR c++/29734
- * cp-tree.h (WANT_VECTOR): Define.
- (WANT_ARITH): Add WANT_VECTOR.
- * cvt.c (build_expr_type_conversion): Handle vector types.
- * typeck.c (build_unary_op): Add WANT_VECTOR to
- build_expr_type_conversion flags.
-
-2006-11-20 Simon Martin <simartin@users.sourceforge.net>
-
- PR c++/29475
- * cp-tree.h (enforce_access, perform_or_defer_access_check): Added an
- extra argument that represents the declaration to use to print
- potential error messages.
- * init.c (build_offset_ref): Adjusted the call to
- perform_or_defer_access_check.
- * class.c (alter_access, resolve_address_of_overloaded_function):
- Likewise.
- * decl.c (make_typename_type, make_unbound_class_template): Likewise.
- * search.c (lookup_member): Likewise.
- * friend.c (add_friend): Likewise.
- * parser.c (cp_parser_template_id,
- cp_parser_pre_parsed_nested_name_specifier): Likewise.
- * semantics.c (finish_non_static_data_member,
- check_accessibility_of_qualified_id, finish_id_expression): Likewise.
- (pop_to_parent_deferring_access_checks, perform_access_checks,
- perform_or_defer_access_check): Adjusted the call to enforce_access.
- * call.c (enforce_access): Use the new extra argument to build the
- error message.
- (build_op_delete_call): Adjusted the call to
- perform_or_defer_access_check.
- (build_over_call): Likewise.
-
-2006-11-16 Dirk Mueller <dmueller@suse.de>
-
- * name-lookup.c (begin_scope): Use GGC_CNEW instead of
- GGC_NEW and memset.
-
-2006-11-13 Roger Sayle <roger@eyesopen.com>
-
- * rtti.c (get_pseudo_ti_init): Ensure that the offset field of the
- base type info initializer has the correct type.
-
-2006-11-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29518
- * pt.c (coerce_template_parms): Do not skip_evaluation while
- substituting template arguments.
-
-2006-11-11 Richard Guenther <rguenther@suse.de>
-
- * typeck.c (build_unary_op): Remove handling of FIX_CEIL_EXPR,
- FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
-
-2006-11-03 Roger Sayle <roger@eyesopen.com>
-
- * call.c (build_op_delete_call): Test user-visible type against
- size_type_node, instead of against the internal type, sizetype.
- * class.c (type_requires_array_cookie): Likewise.
- * mangle.c (write_builtin_type) <INTEGER_TYPE>: Remove special
- handling of TYPE_IS_SIZETYPE.
- * typeck.c (type_after_usual_arithmetic_conversions): Remove
- special case handling of TYPE_IS_SIZETYPE.
- (comptypes): Likewise.
-
-2006-11-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * decl.c (get_atexit_node): Reference atexit, not __cxa_exit.
- if targetm.cxx.use_atexit_for cxa_atexit.
- (start_cleanup_fn): Likewise.
- (register_dtor_fn): Likewise.
-
-2006-09-25 Geoffrey Keating <geoffk@apple.com>
-
- * decl2.c (cp_write_global_declarations): Rename from
- cp_finish_file.
- * cp-lang.c (finish_file): Don't call cp_finish_file.
- * cp-tree.h (cp_write_global_declarations): Rename from
- cp_finish_file.
- * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Define to
- cp_write_global_declarations.
-
-2006-10-31 Geoffrey Keating <geoffk@apple.com>
-
- * name-lookup.c (get_anonymous_namespace_name): New.
- (push_namespace_with_attribs): Use get_anonymous_namespace_name.
- * decl2.c (start_objects): Update for rename of
- get_file_function_name_long.
-
-2006-10-30 Dirk Mueller <dmueller@suse.de>
-
- PR c++/28704
- * decl.c (grokdeclarator): Duplicate diagnostic message
- for easier translation.
- * decl.c (grokdeclarator): Fix line-wrapping.
-
-2006-10-30 Dirk Mueller <dmueller@suse.de>
-
- PR c++/6321
- * decl.c (grokfndecl): Use check_main_parameter_types.
-
-2006-10-30 Dirk Mueller <dmueller@suse.de>
-
- PR c++/28669
- * decl.c (grokfndecl): Duplicate warning message for
- easier translation.
-
-2006-10-30 Dirk Mueller <dmueller@suse.de>
-
- * typeck.c (build_unary_op): Fix indenting. Use G_().
-
-2006-10-29 Dirk Mueller <dmueller@suse.de>
-
- PR c++/29089
- * typeck.c (build_unary_op): Duplicate warning message
- for easier translation.
-
-2006-10-29 Dirk Mueller <dmueller@suse.de>
-
- PR c++/16307
- * typeck.c (build_array_ref): Warn for char subscriptions
- on pointers.
-
-2006-10-29 Kazu Hirata <kazu@codesourcery.com>
-
- * decl.c: Fix a comment typo.
-
-2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
-
- PR C++/29295
- * typeck.c (build_unary_op): Use same_type_p when comparing to
- boolean type.
-
-2006-10-29 Dirk Mueller <dmueller@suse.de>
-
- PR c++/29033
- * typeck.c (build_binary_op): Duplicate warning message
- for better translation.
-
-2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
-
- * decl.c (builtin_function_1): Move common code to
- add_builtin_function.
- (builtin_function): Rename to cxx_builtin_function.
- Change the signature.
- * call.c: Include langhooks.h.
- (build_java_interface_fn_ref): Replace calls to
- builtin_function with add_builtin_function.
- * Make-lang.in (cp/call.o): Depend on langhooks.h.
- * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as
- cxx_builtin_function.
- * cp-tree.h (builtin_function): Rename to cxx_builtin_function.
- Change the signature.
-
-2006-10-22 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20647
- * rtti.c (tinfo_base_init): The type info string is always global.
-
-2006-10-20 Lee Millward <lee.millward@codesourcery.com>
- Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28053
- * decl2.c (grokbitfield): Detect invalid non-integral
- types earlier when possible.
-
-2006-10-18 Mark Shinwell <shinwell@codesourcery.com>
-
- PR c++/26884
- * typeck2.c (digest_init): Raise error upon attempts to
- initialize arrays with variables.
-
-2006-10-17 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/27952
- * cp-tree.h (xref_basetypes): Return bool instead of void.
- * decl.c (xref_basetypes): Adjust definition. Return false
- if the class bases are invalid.
- * parser.c (cp_parser_class_head): Check the return value
- from xref_basetypes.
-
-2006-10-17 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28261
- * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Add
- comment.
-
- PR c++/28261
- * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): New
- function.
- (cp_parser_constructor_declarator_p): Use it.
- (cp_parser_check_type_definition): Return a value indicating
- whether or not the definition is valid.
- (cp_parser_enum_specifier): Skip invalid enum definitions.
-
-2006-10-17 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29039
- * typeck2.c (build_functional_cast): Don't zero-initialize
- non-PODs; instead, call their constructors.
- * method.c (synthesize_method): Always build mem-initializers, if
- we're synthesizing the default constructor.
-
-2006-10-17 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27270
- * decl.c (reshape_init_class): Move check for designated
- to ...
- * parser.c (cp_parser_initializer_list): ... here.
- * pt.c (tsubst_copy_and_build): Use finish_compound_literal.
-
-2006-10-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27270
- * typeck2.c (process_init_constructor_array): Reword comment.
- * pt.c (tsubst_copy_and_built): Call reshape_init before calling
- digest_init.
-
- PR c++/29408
- * parser.c (cp_parser_using_declaration): Stop parsing when
- something goes wrong with an access declaration.
-
- PR c++/29435
- * typeck.c (cxx_sizeof_or_alignof_type): Complete non-dependent
- types when their sizes are required. Refine test for VLAs.
-
- PR c++/28211
- * parser.c (cp_parser_template_argument): Don't consider "&var" a
- possible constant-expression.
- * pt.c (convert_nontype_argument): Refine handling of arguments of
- pointer type.
-
-2006-10-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28506
- * parser.c (function_declarator_p): New function.
- (cp_parser_init_declarator): Use it.
- (cp_parser_member_declaration): Likewise.
-
-2006-10-12 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29318
- * rtti.c (get_tinfo_decl): Refuse to create type info objects for
- variably modified types.
-
-2006-10-12 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/27961
- * decl.c (start_decl): Return error_mark_node if a
- function is initialized like a variable.
- (check_var_type): If a variable of field is declared void,
- set the type to error_mark_node.
- (grokdeclarator): Check the return type of check_var_type.
- * class.c (finish_struct_1): Robustify.
-
-2006-10-11 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29175
- * decl.c (check_initializer): Issue errors about trying to
- initialize arrays whose elements have variable size.
-
-2006-10-11 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/29024
- * cp-tree (struct cp_decl_specifier_seq): Rename to
- conflicting_specifiers_p
- * parser.c (cp_parser_set_storage_class): Set
- conflicting_specifiers_p for the input decl specifier
- if a typedef specifier is present. Rename uses of
- multiple_specifiers_p to conflicting_specifiers_p.
- (cp_parser_decl_specifier_seq) <RID_TYPEDEF>: If a storage
- class specifier has already been set for this declaration,
- set conflicting_specifiers_p to true on the decl_specs.
- * decl.c (grokdeclarator): Rename uses of
- multiple_specifiers_p to conflicting_specifiers_p.
-
-2006-10-10 Brooks Moses <bmoses@stanford.edu>
-
- * Make-lang.in: Added "c++.pdf" target support.
-
-2006-10-10 Richard Guenther <rguenther@suse.de>
-
- PR rtl-optimization/29323
- * decl.c (finish_function): Set TREE_NOTHROW only for
- functions that bind local.
-
-2006-10-09 Richard Henderson <rth@redhat.com>
-
- Revert emutls patch.
-
-2006-10-04 Richard Henderson <rth@redhat.com>
- Jakub Jelinek <jakub@redhat.com>
-
- * decl.c (grokvardecl): Don't error if !have_tls.
- (grokdeclarator): Likewise.
- * parser.c (cp_parser_omp_threadprivate): Likewise.
-
-2006-10-03 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29020
- * friend.c (do_friend): Improve comments; add assertion.
- * parser.c (cp_parser_nested_name_specifier_opt): Resolve
- typenames for qualified names used in declarations, even when
- caching qualified name lookup.
-
- PR c++/29138
- * decl2.c (grokfield): Don't handle access declarations here.
- * parser.c (cp_parser_using_declaration): Handle access
- declarations too.
- (cp_parser_block_declaration): Adjust calls to
- cp_parser_using_declaration.
- (cp_parser_member_declaration): Likewise. Use
- cp_parser_using_declaration to look for access_declarations.
-
-2006-10-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/29291
- * init.c (build_new): Check for invalid init.
-
-2006-10-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29226
- * typeck.c (cxx_sizeof_or_alignof_type): Tidy. In templates, do
- not try to actually evaluate sizeof for a VLA type.
-
-2006-10-01 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29105
- * pt.c (tsubst_baselink): Substituteinto the qualifying scope.
- * semantics.c (baselink_for_fns): Build a baselink, even when
- processing a template.
-
- PR c++/29080
- * parser.c (cp_parser_postfix_dot_deref_expression): Use
- BASELINK_ACCESS_BINFO as the qualifying scope when calling
- adjust_result_of_qualified_name_lookup.
-
-2006-09-25 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/27329
- PR c++/26938
- * cp-tree.h (redeclare_class_template): Adjust declaration
- to return bool instead of void.
- * pt.c (redeclare_class_template): Update definition.
- Return false on error.
- * decl.c (xref_tag): Return error_mark_node if
- redeclare_class_template returned false.
-
- PR c++/27667
- * cp-tree.h (begin_specialization): Return bool
- instead of void.
- * pt.c (check_specialization_scope): Likwise.
- Adjust comment. Return false if a specialization
- isn't permitted in the current scope.
- (begin_specialization): Use the return value of
- check_specialization_scope.
- * parser.c (cp_parser_explicit_specialization): If
- begin_specialization returned false, skip the rest
- of the specialization.
-
-2006-09-21 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/29016
- * typeck.c (build_unary_op): Don't form an ADDR_EXPR around a
- BASELINK.
-
-2006-09-21 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/28861
- * decl.c (shadow_tag): Return error_mark_node
- if maybe_process_partial_specialization failed.
-
- PR c++/28303
- * decl.c (grokdeclarator): Return error_mark_node on
- declaration with two or more data types.
-
-2006-09-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- PR target/27650
- * class.c (check_for_override): Remove dllimport from virtual
- methods.
-
-2006-09-18 Steven Bosscher <steven@gcc.gnu.org>
-
- PR c++/29087
- * parser.c (cp_parser_labeled_statement): Return nothing. Do
- not take in_statement_expr and in_compound as arguments. Rename
- to cp_parser_label_for_labeled_statement. Parse only the label,
- not the statement.
- (cp_parser_statement): Parse the statement of a labeled-statement
- from here, using tail recursion.
-
-2006-09-14 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/29002
- * init.c (build_zero_init): If we have an error mark node for
- the array size, return.
-
-2006-09-10 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28991
- * cp-objcp-common.c (cxx_staticp): New function.
- * cp-objcp-common.h (LANG_HOOOKS_STATICP): Use it.
- * cp-tree.h (cxx_staticp): New function.
-
-2006-09-09 Jason Merrill <jason@redhat.com>
-
- PR c++/28996
- * cvt.c (convert_to_void): Strip COMPONENT_REF to functions.
-
-2006-09-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28858
- * parser.c (cp_parser_skip_until_found): Rename to
- cp_parser_skip_to_end_of_template_parameter_list. Remove last two
- parameters. Track levels of '< ... >'. Stop at '{', '}', or ';'.
- Reorganize. Adjust comment.
- (cp_parser_template_declaration_after_export): Adjust call.
- (cp_parser_enclosed_template_argument_list): Likewise.
-
-2006-09-07 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/28906
- * init.c (build_new_1): Build a distinct type copy
- for the array type that was returned from
- build_cplus_array_type.
-
-2006-09-07 Jason Merrill <jason@redhat.com>
-
- PR c++/27371
- * cvt.c (convert_to_void): Enable previous change.
-
- PR c++/26957
- * method.c (use_thunk): Clear DECL_HAS_VALUE_EXPR_P on copied
- parms.
-
-2006-09-07 Simon Martin <simartin@users.sourceforge.net>
-
- PR c++/28284
- * pt.c (fold_non_dependent_expr): Make sure expr is not
- dereferenced if it is NULL.
-
-2006-09-06 Zak Kipling <zak@transversal.com>
-
- PR c++/26195
- * decl.c (make_rtl_for_nonlocal_decl),
- (start_preparsed_function): Don't use lbasename on
- input_filename when calling get_fileinfo.
- * semantics.c (begin_class_definition): Likewise.
- * lex.c (cxx_make_type): Likewise.
- (handle_pragma_interface): Call get_fileinfo on input_filename,
- not on the parameter to the directive.
-
-2006-09-06 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28903
- * pt.c (tsubst): Use fold_non_dependent_expr to fold array
- dimensions.
-
- PR c++/28886
- * pt.c (unify): Avoid unnecessary calls to fold_build2 for array
- dimensions.
-
-2006-09-06 Jason Merrill <jason@redhat.com>
-
- PR c++/27371
- * cvt.c (convert_to_void): Strip useless TARGET_EXPR.
- * cp-tree.h (TARGET_EXPR_IMPLICIT_P): New macro.
- * tree.c (build_cplus_new): Set it.
-
- PR c++/26696
- * cvt.c (convert_to_void): Replace a subexpression with no side
- effects with void_zero_node.
- * tree.c (is_overloaded_fn): Look through COMPONENT_REF.
- (get_first_fn): Ditto.
- * decl.c (grokdeclarator): No need to look through COMPONENT_REF.
-
-2006-09-05 Jason Merrill <jason@redhat.com>
-
- PR c++/26571
- * parser.c (cp_parser_diagnose_invalid_type_name): Handle the case
- where the name is a type used incorrectly.
-
- PR c++/26671
- * typeck.c (maybe_warn_about_returning_address_of_local): Look
- through COMPONENT_REF and ARRAY_REF.
-
- PR c++/26102
- * name-lookup.c (do_class_using_decl): Try to find the base even
- if bases_dependent_p.
- * pt.c (type_dependent_expression_p): A USING_DECL is dependent.
-
- PR c++/19809
- * pt.c (tsubst_friend_function): Set DECL_INITIAL before pushdecl.
-
-2006-09-04 Nathan Sidwell <nathan@codesourcery.com>
-
- PR 23287 Revert my 2006-09-01 patch.
- * parser.c: Reverted.
- * pt.c: Reverted.
-
-2006-09-02 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/27670
- PR c++/27493
- PR c++/27494
- PR c++/27397
- * parser.c (cp_parser_template_parameter_list): Add
- invalid template parameters to the parameter list as
- error_mark_node.
-
-2006-09-02 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/28878
- * except.c (build_throw): Only set current_function_returns_abnormally
- if cfun is not NULL.
-
- PR c++/26917
- * repo.c (repo_file): Remove.
- (open_repo_file, reopen_repo_file_for_write): Return fopened
- FILE * instead of setting global repo_file variable.
- (init_repo): Adjust caller.
- (finish_repo): Likewise. Return instead of goto out before
- reopen_repo_file_for_write has been called.
-
-2006-09-01 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/28705
- * semantics.c (finish_call_expr): Add assert.
- * name-lookup.c (lookup_arg_dependent): Check we found an overload
- or an object.
-
- PR c++/23287
- * parser.c (cp_parser_id_expression): Add member_p
- argument. Update all callers.
- (cp_parser_unqualified_id): Likewise. Lookup a destructor name in
- the object's scope, if valid.
- (cp_parser_global_scope_opt): Add object_scope_valid_p. Update
- callers.
- (cp_parser_postfix_dot_deref_expression): Set object_scope.
- * pt.c (tsubst_copy_and_build): Lookup dependent dtor name here.
-
-2006-08-30 Jason Merrill <jason@redhat.com>
-
- PR c++/26670
- * class.c (check_field_decls): Don't unset TYPE_PACKED until all
- the fields have been processed.
-
-2006-08-29 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/28349
- * call.c (build_x_va_arg): Remove the reference type
- from the type before creating the pointer type.
-
-2006-08-29 J"orn Rennecke <joern.rennecke@st.com>
-
- PR c++/28139
- * except.c (expand_start_catch_block): Use correct types for bitwise
- copy.
-
-2006-08-28 Jason Merrill <jason@redhat.com>
-
- PR c++/26670
- * class.c (check_field_decls): Unset TYPE_PACKED (t) if one of the
- fields can't be packed.
-
- PR c++/26577
- * cvt.c (convert_to_void): Don't automatically load from volatiles
- of TREE_ADDRESSABLE type.
-
-2006-08-28 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28860
- * cp-tree.h (maybe_process_partial_specialization): Return
- tree instead of void.
- * parser.c (cp_parser_class_head): Use return value of
- maybe_process_partial_specialization.
- * pt.c (maybe_process_partial_specialization): Return error_mark_node
- for broken specializations, TYPE otherwise. Check for template
- template parameters.
-
-2006-08-27 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28058
- * pt.c (register_specialization): Return error_mark_node for
- specialization-after-instantiation.
- * decl2.c (mark_used): Mark the main function used when one of its
- clones is used.
-
-2006-08-27 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/26573
- * class.c (check_field_decls): Don't issue error about
- local classes containing static data members.
-
-2006-08-26 Joseph S. Myers <joseph@codesourcery.com>
-
- PR c++/24009
- * parser.c (struct cp_token): Add input_file_stack_index.
- (eof_token): Update.
- (cp_lexer_get_preprocessor_token): Save input_file_stack_tick.
- (cp_lexer_set_source_position_from_token): Restore input file
- stack.
-
-2006-08-26 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/28736
- PR c++/28737
- PR c++/28738
- * pt.c (process_template_parm): Store invalid template
- parameters as a TREE_LIST with a TREE_VALUE of error_mark_node.
- (push_inline_template_parms_recursive): Check for template
- parameters having a TREE_VALUE of error_mark_node rather than
- check the parameter itself.
- (mangle_class_name_for_template): Likewise.
- (comp_template_parms): When comparing the individual template
- parameters, return 1 if either is error_mark_node.
- (current_template_args): Robustify.
- (redeclare_class_template): Likewise.
-
-2006-08-26 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28588
- * class.c (resolve_address_of_overloaded_function): Add
- access_path parameter. Perform access checks.
- (instantiate_type): Adjust call to
- resolve_address_of_overloaded_function. Remove unnecessary code.
- * tree.c (is_overloaded_fn): Document. Return 2 when there are
- acutally multiple functions.
- (really_overloaded_fn): Use is_overloaded_fn.
- * mangle.c (write_expression): Handle BASELINKs.
- * cp-tree.h (really_overloaded_fn): Return bool.
- (baselink_for_fns): Declare.
- * search.c (lookup_member): Check access for single static
- functions here.
- * pt.c (convert_nontype_argument_function): Handle BASELINKs.
- (tsubst_copy_and_build): Generate BASELINKs for template-ids.
- * semantics.c (finish_call_expr): Use baselink_for_fns.
- (baselink_for_fns): New function.
- (finish_id_expression): Use it.
- * parser.c (cp_parser_template_argument): Don't strip BASELINKs.
-
- PR c++/28595
- * pt.c (tsubst): Issue errors about attempts to create VLAs at
- template-instantiation time.
-
-2006-08-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28853
- * typeck2.c (cxx_incomplete_type_diagnostic): Handle template
- template parameters. Improve error message for template type
- parameters.
-
- PR c++/28852
- * cp-tree.h (grok_op_properties): Return bool instead of void.
- * decl.c (grokfndecl): Discard invalid operator declarations.
- (copy_fn_p): Revert change for PR 27547.
- (grok_op_properties): Return error status (true on success).
- * pt.c (tsubst_decl): Discard invalid operator declarations.
-
-2006-08-25 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28056
- * decl.c (grokdeclarator): Disallow declarations with qualified
- names in local scopes.
-
-2006-08-25 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/27787
- * decl.c (make_typename_type): Only try and resolve it when
- context is not dependent. Refactor.
- * decl2.c (check_classfn): Push to class scope before looking for
- the function.
-
-2006-08-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- PR driver/28528
- * g++spec.c (lang_specific_driver): Always check if we need to
- swallow a space-separated arg to '-x'.
- * lang-specs.h: Don't create ouput files for '-xc++-header'
- if -fsyntax-only.
-
-2006-08-23 Jason Merrill <jason@redhat.com>
-
- PR c++/27714
- * pt.c (push_template_decl_real): A friend template with class
- scope isn't primary.
-
-2006-08-23 Benjamin Smedberg <benjamin@smedbergs.us>
-
- PR c++/28687
- * rtti.c (build_dynamic_cast, build_dynamic_cast_1):
- Move -fno-rtti check to be more specific.
-
-2006-08-22 Jason Merrill <jason@redhat.com>
-
- PR c++/23372
- * call.c (build_over_call): Don't make a copy here if build_call
- will make one too.
-
-2006-08-22 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/28450
- * cp/init.c (build_zero_init): Handle VECTOR_TYPE and
- COMPLEX_TYPEs.
-
-2006-08-22 Simon Martin <simartin@users.sourceforge.net>
-
- PR c++/28420
- * parser.c (cp_parser_postfix_expression): Make sure that the
- saved value for parser->type_definition_forbidden_message is
- restored before returning to avoid an invalid free().
-
-2006-08-22 Jason Merrill <jason@redhat.com>
-
- PR c++/28659
- * typeck.c (merge_types): If either of the types have the right
- attributes, return that one.
-
- * tree.c (cp_build_type_attribute_variant): Make sure we aren't
- doing this to class types.
- * typeck.c (original_type): Deal with type quals properly.
-
-2006-08-21 Jason Merrill <jason@redhat.com>
-
- PR c++/27115
- * semantics.c (finish_stmt_expr_expr): Don't try to voidify here,
- just leave the expression as it is.
- (finish_stmt_expr): If the statement-expression has class type,
- wrap it in a TARGET_EXPR.
- * cp-gimplify.c (cp_gimplify_init_expr): Don't bother with
- CLEANUP_POINT_EXPR.
- * except.c (build_throw): Give the CLEANUP_POINT_EXPR void type.
-
-2006-08-21 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/26269
- * decl.c (duplicate_decls): Return early if either
- newdecl or olddecl is error_mark_node.
-
- PR c++/28505
- * decl.c (grokdeclarator): Return early after
- issuing diagnostic about an incomplete type.
-
- PR c++/28741
- * tree.c (decl_anon_ns_mem_p): Robustify.
- * decl2.c (determine_visibility): Likewise.
-
-2006-08-20 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28341
- * tree.c (cast_valid_in_integral_constant_expression_p): New
- function.
- * cp-tree.h (tsubst_copy_and_build): Adjust prototype.
- * pt.c (tsubst_expr): Add integral_constant_expression_p
- parameter.
- (fold_non_dependent_expr): Adjust callers of
- tsubst_{expr,copy_and_build}.
- (tsubst_friend_function): Likewise.
- (tsubst_template_arg): Likewise.
- (tsubst_default_argument): Likewise.
- (tsubst_decl): Likewise.
- (tsubst): Likewise.
- (tsubst_omp_clasuses): Likewise.
- (regenerate_decl_fromp_template): Likewise.
- (instantiate_decl): Likewise.
- (tsubst_initializer_list): Likewise.
- (tsubst_enum): Likewise.
- (tsubst_expr): Use RECUR throughout.
- (tsubst_copy_and_build): Change definition of RECUR. Do not allow
- invalid casts in integral constant expressions.
- * parser.c (cp_parser_postfix_expression): Use
- cast_valid_in_integral_constant_expression_p.
- (cp_parser_cast_expression): Likewise.
- (cp_parser_functional_cast): Likewise.
-
- PR c++/28346
- * pt.c (tsubst_qualified_id): Do not strip references from
- OFFSET_REFs.
-
-2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28606
- * parser.c (cp_parser_diagnose_invalid_type_name): Handle BIT_NOT_EXPR.
- Fix formatting.
- (cp_parser_parse_and_diagnose_invalid_type_name): Tighten condition
- for valid type-names.
- (cp_parser_unqualified_id): Fix error handling for destructors.
-
- PR c++/28710
- * decl.c (xref_tag): Improve error message. Return early on error.
-
- PR c++/28711
- * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Robustify.
-
-2006-08-17 Paolo Bonzini <bonzini@gnu.org>
-
- PR c++/28573
- * semantics.c (finish_offsetof): Add new argument to fold_offsetof.
-
-2006-08-16 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR c++/28302
- * typeck.c (build_unary_op <case BIT_NOT_EXPR:>): Don't call
- perform_integral_promotions for non integral type.
-
-2006-08-16 Jason Merrill <jason@redhat.com>
-
- PR c++/28385
- * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Ignore quals from template
- if arg is a function.
-
-2006-08-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28593
- * init.c (build_new): Return early on invalid placement.
-
-2006-08-15 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/28594
- * pt.c (process_template_parm): Robustify.
-
-2006-08-14 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/28288
- PR c++/14556
- * operators.def: Remove <?, ?>, <?=, and >?= operators.
- * parser.c: Remove CPP_MIN, CPP_MAX, CPP_MIN_EQ, and CPP_MAX_EQ.
- (cp_parser_warn_min_max): Remove.
-
-2006-08-11 Jason Merrill <jason@redhat.com>
-
- PR c++/28559
- * parser.c (cp_parser_elaborated_type_specifier): Also ignore
- attributes applied to a TYPENAME_TYPE.
-
-2006-08-09 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/28637
- * pt.c (coerce_template_parms): Copy across the
- invalid template arguments to the new template inner arguments.
- (retrieve_specialization): Robustify.
-
- PR c++/28638
- * pt.c (coerce_template_template_parms): Robustify.
-
- PR c++/28639
- * error.c (dump_template_parms): Robustify.
-
- PR c++/28640
- * pt.c (redeclare_class_template): Robustify.
-
- PR c++/28641
- * pt.c (type_unification_real): Robustify.
-
-2006-08-03 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/28347
- * decl.c (start_decl): Return error_mark_node if a
- diagnostic was issed for an invalid typedef initialization.
-
-2006-08-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27508
- * parser.c (cp_parser_unqualified_id): Check for invalid scopes
- when parsing destructor names.
-
- PR c++/28274
- * decl.c (duplicate_decls): Call check_default_args here.
- (start_preparsed_function): Do not call check_default_args.
- * name-lookup.c (pushdecl_maybe_friend): Only call
- check_default_args if duplicate_decls got bypassed.
-
-2006-08-02 Richard Guenther <rguenther@suse.de>
-
- PR c++/28479
- Revert
- 2006-07-05 Richard Guenther <rguenther@suse.de>
- Andrew Pinski <pinskia@gcc.gnu.org>
-
- PR c++/27084
- * cp-objcp-common.c (cxx_types_compatible_p): Ignore
- top level qualifiers for pointer type comparisons.
-
-2006-08-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28557
- * pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
-
-2006-07-31 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28523
- * tree.c (stabilize_expr): Tweak documentation. Add assertion.
- (stabilize_call): Tweak documentation.
- (stabilize_init): Only call stabilize_call for calls.
-
-2006-08-01 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/28432
- * decl2.c (check_classfn): Remove early return.
- * search.c (lookup_member): Return NULL with bad type.
-
-2006-08-01 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/28256
- * decl.c (check_initializer): Check for 1 initializer on scalar types.
-
-2006-08-01 Daniel Jacobowitz <dan@codesourcery.com>
-
- PR debug/23336
- * pt.c (tsubst_copy_and_build): Mark used enum types.
- * semantics.c (finish_id_expression): Likewise.
-
-2006-07-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/6634
- * decl.c (grokdeclarator): Check whether "long" or "short" was
- specified for non-integral types.
-
-2006-07-28 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies.
-
-2006-07-28 Lee Millward <lee.millward@codesourcery.com>
-
- PR c++/27668
- PR c++/27962
- * pt.c (process_template_parm) Store invalid template
- parameters as error_mark_node in the paramater list.
- (push_inline_template_parms_recursive): Handle invalid
- template parameters.
- (comp_template_parms): Likewise.
- (check_default_tmpl_arg): Likewise.
- (coerce_template_template_parms): Likewise.
- (mangle_class_name_for_template): Likewise.
- (tsubst_template_parms): Likewise.
- * error.c (dump_template_argument_list): Likewise.
-
-2006-07-28 Kazu Hirata <kazu@codesourcery.com>
-
- * cp-tree.h: Fix a comment typo.
-
-2006-07-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27572
- * decl.c (grokdeclarator): Return error_mark_node after invalid
- typedef.
-
-2006-07-23 Daniel Jacobowitz <dan@codesourcery.com>
-
- PR c++/28460
- * decl.c (grokvardecl): Use FROB_CONTEXT.
- * pt.c (register_specialization): Likewise.
-
-2006-07-23 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28025
- * cp-tree.h (LOOKUP_HIDDEN): New macro. Reformat comments.
- * name-lookup.c (unqualified_namespace_lookup): There is no way to
- have a hidden name in non-namespace scopes.
- * pt.c (tsubst_friend_class): Look for hidden names.
- * decl.c (lookup_and_check_tag): Fix typo in comment.
-
- * semantics.c (finish_compound_literal): Fix typo in comment.
-
-2006-07-21 Jason Merrill <jason@redhat.com>
-
- * decl2.c (determine_visibility): Don't propagate visibility from
- type to decl.
- (constrain_class_visibility): Don't warn in system headers.
- Don't warn about pointer fields.
-
-2006-07-20 Mike Stump <mrs@apple.com>
-
- * decl2.c (determine_visibility_from_class): Don't use hidden
- visibility for explicit instantiations.
-
-2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28250
- * pt.c (tsubst_expr): Only apply DECL_TEMPLATE_INSTANTIATED to
- valid decls. Cleanup.
-
- PR c++/28363
- * semantics.c (check_template_template_default_arg): Simplify
- error handling.
-
-2006-07-20 Jason Merrill <jason@redhat.com>
-
- PR c++/28407
- * decl.c (grokvardecl): Set DECL_THIS_STATIC on file-scope
- const variables with implicit internal linkage.
- * tree.c (decl_linkage): Only return lk_external if it's set.
-
- PR c++/28409
- * decl2.c (constrain_visibility): Ignore the anonymous namespace
- for extern "C" decls.
- (VISIBILITY_STATIC): Rename to VISIBILITY_ANON.
-
- * decl2.c (constrain_visibility): Remove specified and reason
- parameters. Don't touch decls that already have explicit visibility.
- (determine_visibility): Do copy DECL_VISIBILITY_SPECIFIED from
- template.
- (determine_visibility_from_class): Reverse sense of
- DECL_VISIBILITY_SPECIFIED test for target-specific visibility rules.
- (constrain_class_visibility): Only complain about member visibility
- if the member type is another class. Don't change visibility of the
- current class.
-
-2006-07-19 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28338
- * decl.c (layout_var_decl): Don't call push_local_name here.
- (initialize_artificial_var): Assert artificiality.
- (cp_finish_decl): Call push_local_name here.
-
-2006-07-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28337
- * typeck.c (build_binary_op): Short-circuit pointer arithmetic in
- templates.
-
-2006-07-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28048
- * semantics.c (check_accessibility_of_qualified_id): Robustify.
-
- PR c++/28235
- * pt.c (tsubst_decl): Handling substitutions into a static data
- member from within the scope of the tempalte itself.
-
-2006-07-18 Lee Millward <lee.millward@gmail.com>
-
- PR c++/28258
- * method.c (locate_copy): Check for non_reference
- returning error_mark_node.
-
- PR c++/28260
- * decl.c (duplicate_decls): Return error_mark_node
- on ambiguous declaration.
-
-2006-07-18 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/27495
- * search.c (adjust_result_of_qualified_name_lookup): Change
- assert to part of if statement.
-
-2006-07-17 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/28291
- * decl.c (reshape_init_class): Return error_mark_node on error.
-
-2006-07-17 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/28304
- * decl2.c (check_classfn): Return NULL_TREE on error.
-
-2006-07-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28250
- * name-lookup.c (pushdecl_maybe_friend): Return early on
- error_mark_node.
- * except.c (expand_start_catch_block): Use error_mark_node instead
- of NULL_TREE for invalid decls.
- * parser.c (cp_parser_exception_declaration): Return error_mark_node
- on invalid catch parameter. Simplify.
-
-2006-07-16 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/28370
- * decl2.c (note_vague_linkage_var): Removed.
- (finish_static_data_member_decl): Add decl to pending_statics vector
- directly. Do it even for non-public decls.
-
-2006-07-15 Lee Millward <lee.millward@gmail.com>
-
- PR c++/28292
- * decl2.c (acceptable_java_type): Robustify. Use
- proper Boolean return type instead of return 1.
- (check_java_method): Don't issue error about
- type not being an acceptable Java parameter if
- it's error_mark_node.
-
- PR c++/28269
- * parser.c (cp_parser_elaborated_type_specifier):
- Return early if an invalid type was detected.
-
-2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28249
- * parser.c (cp_parser_check_decl_spec): New function.
- (cp_parser_decl_specifier_seq): Factor out check for repeated
- decl-specifiers into cp_parser_check_decl_spec. Use it.
- (cp_parser_type_specifier_seq): Use it.
-
- PR c++/28294
- * semantics.c (finish_offsetof): Use TREE_OPERAND for COMPONENT_REFs
- only.
-
- PR c++/28387
- * decl2.c (cplus_decl_attributes): Check for invalid decls.
-
-2006-07-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28343
- * decl.c (cp_finish_decl): Check asmspec_tree for error_mark_node.
- * decl2.c (grokfield): Likewise.
-
-2006-07-12 Geoffrey Keating <geoffk@apple.com>
-
- * decl2.c (determine_visibility): Don't change visibility of
- function locals because of -fvisibility-inlines-hidden.
-
-2006-07-12 Jason Merrill <jason@redhat.com>
-
- PR c++/28217
- * semantics.c (note_decl_for_pch): Don't premangle templates.
-
-2006-07-12 Martin Michlmayr <tbm@cyrius.com>
-
- * typeck.c (string_conv_p): Remove spurious quotation mark in
- warning.
-
-2006-07-07 Lee Millward <lee.millward@gmail.com>
- Andrew Pinski <pinskia@gmail.com>
-
- PR c++/27820
- * decl.c (define_label): Return error_mark_node on error.
- * semantics.c (finish_label_stmt): Don't call
- add_stmt for invalid labels.
-
-2006-07-06 Jason Merrill <jason@redhat.com>
-
- PR c++/28279
- * decl2.c (finish_static_data_member_decl): Don't assert
- TREE_PUBLIC.
-
-2006-07-05 Jason Merrill <jason@redhat.com>
-
- PR c++/13983
- PR c++/17519
- * class.c (check_field_decls): Check TYPE_PACKED after
- stripping array types.
- (finish_struct_bits): Don't copy TYPE_SIZE here.
-
- PR c++/18681
- * friend.c (is_friend): Fix DR 45 implementation.
-
-2006-07-05 Richard Guenther <rguenther@suse.de>
- Andrew Pinski <pinskia@gcc.gnu.org>
-
- PR c++/27084
- * cp-objcp-common.c (cxx_types_compatible_p): Ignore
- top level qualifiers for pointer type comparisons.
-
-2006-07-01 Jason Merrill <jason@redhat.com>
-
- PR c++/28215
- * method.c (make_thunk): Unset DECL_USE_TEMPLATE and
- DECL_TEMPLATE_INFO.
-
-2006-06-30 Jason Merrill <jason@redhat.com>
-
- PR c++/26577
- * call.c (build_new_method_call): Force evaluation of the
- instance pointer, not the object.
-
-2006-06-30 Kazu Hirata <kazu@codesourcery.com>
-
- * decl2.c: Fix a comment typo.
-
-2006-06-30 Jason Merrill <jason@redhat.com>
-
- PR c++/18698
- * decl2.c (grokfield): Only try to treat the decl as an access
- declaration if the scope is a class.
-
-2006-06-29 Jason Merrill <jason@redhat.com>
-
- PR c++/26905
- PR c++/26612
- PR c++/27000
- PR c++/26984
- PR c++/19134
- * decl2.c (determine_visibility): Overhaul.
- (determine_visibility_from_class): Likewise.
- (min_vis_r, type_visibility, constrain_visibility): New fns.
- (constrain_visibility_for_template): Likewise.
- (constrain_class_visibility): Likewise.
- * decl.c (cp_finish_decl): Call determine_visibility for function
- decls, too.
- * name-lookup.c (pushtag): Call determine_visibility.
- * decl.c (duplicate_decls): Don't copy visibility from template to
- specialization.
- * pt.c (check_explicit_specialization): Likewise.
- (lookup_template_class, tsubst_decl): Call determine_visibility.
- * class.c (finish_struct_1): Call constrain_class_visibility.
-
- PR c++/26905
- PR c++/21675
- PR c++/17470
- * parser.c (cp_parser_explicit_instantiation): Pass the attributes
- to grokdeclarator.
- (cp_parser_type_specifier): Allow 'enum __attribute ((...)) E'.
- (cp_parser_enum_specifier): Likewise.
- (cp_parser_elaborated_type_specifier): Apply attributes if this
- declares only the class.
- (cp_parser_class_specifier): Apply leading attributes immediately.
- * semantics.c (begin_class_definition): Add attributes parameter,
- apply them to the type.
-
- PR c++/21581
- PR c++/25915
- * tree.c (decl_anon_ns_mem_p): New function.
- * cp-tree.h: Declare it.
- * decl2.c (determine_visibility): Make anonymous namespace
- members static.
- (min_vis_r, constrain_visibility): Likewise.
- * rtti.c (create_pseudo_type_info): Set TREE_PUBLIC on
- pseudo-types.
- * decl.c (cxx_init_decl_processing): Set TREE_PUBLIC on
- global_namespace.
- * name-lookup.c (push_namespace_with_attribs): Don't set TREE_PUBLIC
- on anonymous namespaces.
-
-2006-06-28 Jason Merrill <jason@redhat.com>
-
- PR c++/27424
- * pt.c (convert_template_argument): Pass all template arguments
- on to coerce_template_template_parms.
-
-2006-06-25 Lee Millward <lee.millward@gmail.com>
- Mark Mitchell <mark@codesuorcery.com>
-
- PR c++/28054
- * decl2.c (grokbitfied): Remove check for grokdeclarator
- returning NULL_TREE, instead check for error_mark_node
- to indicate failure.
- * decl.c (grokdeclarator): Adjust block comment.
-
-2006-06-25 Lee Millward <lee.millward@gmail.com>
-
- PR c++/28051
- * mangle.c (mangle_conv_op_name_for_type): Check for
- invalid types.
- * name-lookup.c (push_class_level_binding): Robustify.
- (do_class_using_decl): Return early if name is error_mark_node.
-
-2006-06-23 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/28114
- * name-lookup.c (pushtag): Return if we have error_mark_node.
-
-2006-06-23 Steve Ellcey <sje@cup.hp.com>
-
- PR c++/27019
- * typeck2.c (process_init_constructor_array): Set ce->value on errors.
-
-2006-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28112
- * parser.c (cp_parser_attribute_list): Skip attributes with invalid
- arguments. Fix comment.
-
- PR c++/11468
- * init.c (build_new_1): Handle error_mark_nodes returned by
- build_java_class_ref.
- (build_java_class_ref): Do not abort compilation, but return
- error_mark_node. Improve error message. Fix indentation.
-
-2006-06-23 Danny Smith <dannysmith@users.sourceforge.net>
-
- PR target/27789
- * decl.c (start_decl): Check that dllimports are not initialized.
-
-2006-06-22 Lee Millward <lee.millward@gmail.com>
-
- PR c++/27805
- * typeck2.c (build_m_component_ref): Use error_operand_p.
-
- PR c++/27821
- * decl.c (grokdeclarator): Return error_mark_node on
- invalid uses of the scope resolution operator.
-
-2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28111
- * pt.c (determine_specialization): Check for invalid decls.
-
- PR c++/28110
- * pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
- parameters.
-
- PR c++/28109
- * rtti.c (get_tinfo_decl_dynamic): Robustify.
-
-2006-06-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/28052
- * init.c (push_base_cleanups): Skip members with invalid types.
- * typeck.c (build_class_member_access_expr): Robustify.
-
-2006-06-19 Mark Mitchell <mark@codesourcery.com>
-
- * pt.c (instantiate_template): Fix typo in comment.
-
-2006-06-19 Richard Guenther <rguenther@suse.de>
-
- * parser.c (CP_LEXER_BUFFER_SIZE): Adjust to assure near
- power-of-two token vector size.
-
-2006-06-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28016
- * decl.c (cp_finsh_decl): Do not emit uninstantiated static data
- members.
-
- PR c++/27979
- * call.c (standard_conversion): Strip cv-qualifiers from bitfield
- types.
-
- PR c++/27884
- * decl.c (have_extern_spec): Remove.
- (start_decl): Do not check have_extern_spec.
- (start_function): Likewise.
- * cp-tree.h (have_extern_spec): Remove.
- * parser.c (cp_parser_linkage_specification): Don't set
- have_extern_spec.
- (cp_parser_init_declarator): Likewise.
- (cp_parser_parameter_declaration): Do not treat parameters as
- within the scope of an unbraced linkage specification.
-
-2006-06-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27689
- * cp-tree.h (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): New
- macro.
- * pt.c (unify): Use it.
-
- PR c++/27666
- * call.c (build_conditional_expr): Robustify.
-
- PR c++/27640
- * pt.c (instantiate_template): Set processing_template_decl to
- zero while performing substitutions.
-
-2006-06-14 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27665
- * parser.c (cp_parser_unqualified_id): Use constructor_name_p to
- identify destructors.
- (cp_parser_nested_name_specifier_opt): Remove invalid
- optimization.
- (cp_parser_template_id): Refine heuristic for determining whether
- we are entering a scope.
-
- PR c++/27648
- * parser.c (cp_parser_declarator): Robustify.
-
- PR c++/26559
- * pt.c (tsubst_expr): Use finish_omp_atomic.
- (value_dependent_expression_p): All CALL_EXPRs are dependent.
- * semantics.c (finish_omp_atomic): Rework to use standard
- paradigms for handling non-dependent expressions.
-
-2006-06-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * typeck.c (build_modify_expr): Tidy diagnostic message.
-
-2006-06-14 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/28018
- * typeck.c (build_modify_expr): Disallow array assignment.
-
-2006-06-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * cp-tree.def: Fix typo.
-
-2006-06-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27227
- * decl.c (decls_match): Allow an extern "C" variable declarations
- from different namespaces to match.
- (duplicate_decls): Disallow redeclaring a variable with a
- different linkage specification.
-
-2006-06-13 Jakub Jelinek <jakub@redhat.com>
-
- PR middle-end/27793
- * cp-tree.h (cxx_int_tree_map): New struct.
- (struct language_function): Add extern_decl_map field.
- * name-lookup.c (pushdecl_maybe_friend): Add x -> t mapping
- to cp_function_chain->extern_decl_map hash table instead of
- copying over DECL_UID.
- * cp-gimplify.c (cxx_int_tree_map_eq, cxx_int_tree_map_hash): New
- functions.
- (cp_genericize_r): Remap DECL_EXTERN local decls using
- cp_function_chain->extern_decl_map hash table.
- * decl.c (finish_function): Clear extern_decl_map.
-
-2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27601
- * semantics.c (finish_offsetof): Handle pseudo-destructors.
-
- PR c++/27933
- * name-lookup.c (lookup_qualified_name): Always return error_mark_node
- if lookup fails.
-
- PR c++/27951
- * decl2.c (finish_anon_union): Return early if build_anon_union_vars
- fails.
-
-2006-06-12 Roger Sayle <roger@eyesopen.com>
-
- PR c++/21210
- * typeck2.c (build_functional_cast): Use cp_convert to construct
- non-aggregate initializers instead of the user-level build_c_cast.
-
-2006-06-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27601
- * cp-tree.h (finish_offsetof): Add prototype.
- * semantics.c (finish_offsetof): New function.
- * parser.c (cp_parser_builtin_offsetof): Call it instead of
- fold_offsetof.
- * pt.c (tsubst_copy_and_build): Likewise.
-
-2006-06-06 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27177
- * call.c (standard_conversion): Require that the derived type be
- complete when performing a derived-to-base conversion.
-
-2006-06-04 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27819
- * decl.c (cp_finish_decl): Process initializers for static data
- members with non-dependent initializers, even in templates.
-
- PR c++/27722
- * decl.c (maybe_deduce_size_from_array_init): If the declaration
- is erroneous, give it an erroneous type.
- (layout_var_decl): If the type is erroneous, give up.
- (check_initializer): Likewise.
-
- PR c++/27807
- * cp-tree.h (TYPE_OBJ_P): New macro.
- (TYPE_PTROB_P): Use it.
- (TYPE_REF_OBJ_P): Likewise.
- * semantics.c (finish_compound_literal): Do not permit compound
- literals of non-object types.
-
- PR c++/27806
- * typeck.c (original_type): Robustify.
-
-2006-06-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27804
- * init.c (constant_value_1): Return decl instead of error_mark_node
- for invalid initializers.
-
-2006-06-01 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR c++/27592
- * rtti.c (build_dynamic_cast_1): Call c_common_truthvalue_conversion
- on operand of the COND_EXPR for the null pointer check.
-
-2006-06-01 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR c++/26740
- * typeck.c (build_unary_op): Mark the function as being used.
-
-2006-06-01 Alexandre Oliva <aoliva@redhat.com>
-
- PR c++/26660
- * parser.c (cp_parser_initial_pragma): Read one more token for
- caller after reading PCH file in.
-
-2006-05-31 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27801
- * call.c (perform_implicit_conversion): Do not actually perform
- conversions in templates.
-
- PR c++/26496
- * call.c (resolve_args): Check for invalid uses of bound
- non-static member functions.
- * init.c (build_offset_ref): Return error_mark_node for errors.
-
- PR c++/27385
- * decl.c (reshape_init): Robustify.
- (reshape_init_array_1): Likewise.
-
-2006-05-30 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27808
- * parser.c (cp_parser_decl_specifier_seq): Issue errors about
- "friend" specifiers that do not appear in class scopes.
-
- PR c++/27803
- * class.c (check_bitfield_decl): Ensure that all bitfields have
- integral type.
-
-2006-05-29 Kazu Hirata <kazu@codesourcery.com>
-
- * pt.c (convert_nontype_argument): Fix a typo in an error
- message.
-
-2006-05-28 Kazu Hirata <kazu@codesourcery.com>
-
- * decl.c, decl2.c, parser.c: Fix comment typos. Follow
- spelling conventions.
-
-2006-05-24 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20103
- * decl.c (cp_make_fname_decl): Don't set DECL_INITIAL to
- error_mark_node to indicate an initialization is OK.
- (start_decl): Likewise. Adjust call to start_decl_1.
- (start_decl_1): Add initialized parameter. Simplify.
- * except.c (initialize_handler_parm): Adjust call to
- setart_decl_1.
- (expand_start_catch_block): Let cp_finish_decl initialize catch
- parameters.
- * cp-tree.h (start_decl_1): Adjust prototype.
- * pt.c (tsubst_expr): Don't set DECL_INITIAL to error_mark_node.
- (instantiate_decl): Let cp_finish_decl handle initialization.
- * semantics.c (finish_compound_literal): Create a temporary
- variable for the literal.
- * typeck.c (build_unary_op): Remove COMPOUND_LITERAL_P special
- cases.
- * decl2.c (finish_static_data_member_decl): Don't set
- DECL_INITIAL.
- (grokfield): Do not try to initialize functions.
-
-2006-05-23 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20173
- * pt.c (determine_specialization): Disallow partial
- specializations of templates.
-
-2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27716
- * typeck.c (build_modify_expr): Test arguments for error_operand_p.
-
- * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE.
-
-2006-05-21 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27210
- * cp-tree.h (cp_save_expr): New function.
- * init.c (build_new): Correct logic for zero-element array
- warning. Use cp_save_expr.
- * tree.c (cp_save_expr): New function.
-
-2006-05-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27398
- * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE
- or void_type_node.
-
-2006-05-19 Mike Stump <mrs@apple.com>
-
- * typeck.c (default_conversion): Remove static.
-
-2006-05-19 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/26433
- * cp-tree.h (begin_function_try_block): Change prototype.
- (finish_function_handler_sequence): Likewise.
- * parser.c (cp_parser_function_try_block): Adjust calls.
- * pt.c (tsubst_expr): Adjust calls.
- * semantics.c (begin_function_try_block): Create an artificial
- outer scope.
- (finish_function_handler_sequence): Close it.
-
-2006-05-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27471
- PR c++/27506
- * typeck.c (decay_conversion): Convert bitfields to their declared
- types here. Improve documentation. Avoid use of cp_convert.
- (default_conversion): Make it static. Perform integral promotions
- before lvalue-to-rvalue, function-to-pointer, and array-to-pointer
- conversions.
- * init.c (build_init): Remove.
- (expand_default_init): Do not call rvalue.
- * call.c (null_ptr_cst_p): Robustify.
- (build_conditional_expr): Tidy.
- * except.c (build_throw): Do not perform lvalue-to-rvalue
- conversion on operand before initializing temporary.
- * tree.c (convert.h): Include it.
- (convert_bitfield_to_declared_type): Use convert_to_integer, not
- cp_convert.
- (rvalue): Don't convert bitfields to their declared type here.
- * cp-tree.h (build_init): Remove.
- (default_conversion): Likewise.
- * typeck2.c (build_m_component_ref): Do not perform
- lvalue-to-rvalue, function-to-pointer, or array-to-pointer
- conversions here. Correct error message.
-
-2006-05-17 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/26122
- * decl2.c (check_member_template): Remove checks for virtual
- functions.
- * parser.c (cp_parser_function_specifier_opt): Complain about
- virtual templates.
- (cp_parser_pure_specifier): Likewise.
-
- PR c++/26068
- * parser.c (cp_parser_set_storage_class): Check for
- invalid uses of storage classes on unbraced linkage
- specifications.
- (cp_parser_decl_specifier_seq): Pass keywords, not storage classes,
- to cp_parser_set_storage_class.
-
-2006-05-17 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/27491
- * semantics.c (finish_compound_literal): Only set TREE_HAS_CONSTRUCTOR
- on CONSTRUCTORs.
-
- PR middle-end/27415
- * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
- on combined parallel workshare constructs.
- * pt.c (tsubst_expr): Copy OMP_PARALLEL_COMBINED flag.
-
-2006-05-16 H.J. Lu <hongjiu.lu@intel.com>
-
- PR driver/26885
- * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS).
-
-2006-05-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27339
- * cp-tree.h (perform_access_checks): New function.
- * semantics.c (perform_access_checks): New function.
- (perform_deferred_access_checks): Use it.
- * parser.c (cp_parser_simple_declaration): Adjust call to
- cp_parser_init_declarator.
- (cp_parser_type_parameter): Do not defer checks in default
- arguments.
- (cp_parser_explicit_specialization): Adjust call to
- cp_parser_single_declaration.
- (cp_parser_init_declarator): Perform template-parameter access
- checks.
- (cp_parser_parameter_declaration): Do not defer checks for
- template parameter default arguments.
- (cp_parser_template_declaration_after_export): Gather access
- checks for template parameters, and pass them to
- cp_parser_single_declaration.
- (cp_parser_template_parameter_access_checks): New function.
- (cp_parser_single_declaration): Add checks parameter.
-
- PR c++/27505
- * call.c (convert_like_real): Convert bitfields to their declared
- types when forming an rvalue.
- * tree.c (convert_bitfield_to_declared_type): New function.
- (rvalue): Use it.
- * cp-tree.h (convert_bitfield_to_declare_type): Declare it.
-
-2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27582
- * pt.c (any_dependent_template_arguments_p): Return early on invalid
- argument list.
-
- PR c++/27581
- * search.c (adjust_result_of_qualified_name_lookup): Skip on
- invalid context_class.
-
- PR c++/27315
- * pt.c (do_decl_instantiation): Return early on invalid decl.
-
- PR c++/27559
- * pt.c (push_template_decl_real): Return error_mark_node instead
- of broken decl.
-
- PR c++/27496
- * pt.c (tsubst_friend_class): Return early on invalid friend
- declarations.
-
-2006-05-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * Make-lang.in (cp/decl.o): Add dependency on $(TARGET_H).
- (cp/decl2.o): Likewise.
- (cp/typeck.o): Likewise.
- (cp/cvt.o): Likewise.
- (cp/parser.o): Likewise.
- (cp/call.o): Replace target.h with $(TARGET_H).
-
-2006-05-14 Alexandre Oliva <aoliva@redhat.com>
-
- * pt.c (build_non_dependent_expr): Leave ADDR_EXPR of
- COMPONENT_REF alone.
-
-2006-05-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27547
- * decl.c (copy_fn_p): Return early on non-member functions.
-
-2006-05-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27447
- * decl2.c (build_memfn_type): Skip invalid functions and class types.
-
-2006-05-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27427
- * pt.c (convert_nontype_argument): Return early on invalid arguments.
-
- * pt.c (process_template_parm): Remove superfluous temporary.
-
- PR c++/27430
- * pt.c (process_template_parm): Handle erroneous non-type parameters.
-
- PR c++/27423
- * typeck.c (convert_for_initialization): Skip erroneous types.
-
- PR c++/27422
- * typeck.c (convert_arguments): Return early on args with
- invalid types.
-
-2006-05-03 Aldy Hernandez <aldyh@redhat.com>
-
- PR/21391
- * typeck.c (build_static_cast_1): Save casted types in used types
- hash table.
- (build_reinterpret_cast_1): Same.
- * rtti.c (build_dynamic_cast_1): Same.
-
-2006-05-04 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/27359
- * parser.c (cp_parser_omp_for_loop): Only call
- cp_parser_abort_tentative_parse if cp_parser_parse_definitely was not
- called.
-
-2006-05-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27102
- * decl.c (grokdeclarator): Robustify checks for defining members
- of incomplete types.
-
- PR c++/27309
- * class.c (add_method): Call grok_special_member_properties.
- * decl.c (grokdeclarator): Don't call it here.
- (copy_fn_p): A TEMPLATE_DECL is never a copy constructor or
- assignment operator. Set TYPE_HAS_CONSTURCTOR if DECL is a
- constructor.
- (start_method): Don't call grok_special_member_properties.
- * method.c (implicitly_declare_fn): Likewise.
- * pt.c (instantiate_class_template): Likewise.
- * decl2.c (grokfield): Likewise.
-
-2006-05-02 Jakub Jelinek <jakub@redhat.com>
-
- PR middle-end/27337
- * cp-gimplify.c (cxx_omp_privatize_by_reference): New function.
- * cp-tree.h (cxx_omp_privatize_by_reference): New prototype.
- * cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define.
-
-2006-04-30 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27094
- * pt.c (tsubst_default_argument): Increment function_depth around
- call to tsubst_expr.
- * parser.c (cp_parser_parameter_declaration): Likewise.
- * decl2.c (mark_used): Tidy.
-
-2006-04-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27278
- * decl.c (grok_op_properties): Skip operators with invalid args
- when checking for class-type or enum-type args.
-
-2006-04-29 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/27279
- * decl.c (copy_fn_p): Skip functions with invalid first arg.
-
-2006-04-27 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27292
- * tree.c (rvalue): Convert bitfields to their declared types.
-
- PR c++/27102
- * typeck2.c (cxx_incomplete_type_diagnostic): Handle
- TYPENAME_TYPE.
-
-2006-04-24 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27292
- * typeck.c (decay_conversion): Don't adjust bitfield types.
- (perform_integral_promotions): Treat bitfield enums as enums, not
- as short integer types.
- * tree.c (rvalue): Convert bitfields to their correct types.
-
-2006-04-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/19963
- * class.c (layout_class_type): Skip fields with invalid types.
-
-2006-04-23 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/26912
- * cp-tree.h (build_this_parm): Declare.
- (grok_method_quals): Remove.
- (build_memfn_type): Declare.
- (build_artificial_parm): Declare.
- (do_friend): Remove quals parameter.
- * decl.c (build_this_parm): New function.
- (grokfndecl): Use it. Do not pass quals to grokclassfn.
- (grokdeclarator): Rename quals to memfn_quals. Avoid allocating
- unnecessary TYPE_DECLs. Correct qualification of member function
- types. Tidy.
- * method.c (implicitly_declare_fn): Use build_this_parm.
- * friend.c (do_friend): Remove quals parameter.
- * decl2.c (grok_method_quals): Remove.
- (build_memfn_type): New function.
- (build_artificial_parm): Give it external linkage.
- (grokclassfn): Remove quals parameter. Do not build "this"
- PARM_DECL here.
-
- PR c++/26534
- * cp-tree.h (is_bitfield_expr_with_lowered_type): New function.
- * typeck.c (is_bitfield_expr_with_lowered_type): New function.
- (decay_conversion): Convert bitfield expressions to the correct
- type.
- (build_modify_expr): Remove spurious conversions.
- * class.c (layout_class_type): Modify the type of bitfields to
- indicate a limited range.
- * call.c (standard_conversion): Adjust the type of bitfield
- expressions used in an rvalue context.
- (build_conditional_expr): Likewise.
-
-2006-04-22 Kazu Hirata <kazu@codesourcery.com>
-
- * decl.c: Fix comment typos.
-
-2006-04-21 Eric Christopher <echristo@apple.com>
-
- * decl.c: Fix typo in function name.
-
-2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/26558
- * parser.c (cp_parser_class_name): Check for invalid typenames.
- Rearrange code.
-
- PR c++/26739
- * pt.c (tsubst_friend_function): Return early if
- pushdecl_namespace_level fails.
-
- PR c++/26036
- * typeck.c (convert_arguments): Return error_mark_node instead of
- error_mark_list.
- * cp-tree.h (error_mark_list): Remove declaration.
- * decl.c (error_mark_list): Remove definition.
- (cxx_init_decl_processing): Do not initialize error_mark_list.
-
- PR c++/10385
- * rtti.c (build_dynamic_cast_1): Check for invalid conversions
- before calling convert_to_reference.
- * cvt.c (convert_to_reference): Assert that reftype is a
- REFERENCE_TYPE.
-
-2006-04-19 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/27102
- * class.c (currently_open_class): Tidy.
- * decl.c (grokdeclarator): If we encounter an erroneous
- declarator, assume that we have already issued an error message
- and return. Return error_mark_node instead of NULL_TREE in more
- places. Issue errors about function definitions that do not have
- a function declarator. Check for complete types for all function
- definitions.
- * cp-tree.h (cp_error_declarator): Remove.
- (currently_open_class): Change return type.
- * parser.c (cp_parser_id_expression): Add optional_p parameter.
- (cp_parser_parse_diagnose_invalid_type_name): Adjust calls.
- (cp_parser_id_expression): Likewise.
- (cp_parser_unqualified_id): If the name is optional, return
- NULL_TREE.
- (cp_parser_postfix_dot_deref_expression): Adjust calls.
- (cp_parser_type_parameter): Likewise.
- (cp_parser_unqualified_id): Likewise.
- (cp_parser_direct_declarator): Likewise.
- (cp_parser_declarator_id): Add optional_p parameter.
- (cp_parser_function_definition_from_specifiers_and_declarator):
- Assume that start_function indicates failure only if it has issued
- an error.
- (cp_parser_omp_var_list_no_open): Adjust calls.
-
-2006-04-17 Janis Johnson <janis187@us.ibm.com>
-
- PR c++/26114, c++/26115
- * typeck.c (cxx_mark_addressable): Restore check for extra_warnings.
- * class.c (check_field_decls): Ditto.
-
-2006-04-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * init.c (build_offset_ref): Remove superfluous temporary.
-
-2006-04-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/26365
- * typeck.c (finish_class_member_access_expr): Robustify
-
-2006-04-15 Kazu Hirata <kazu@codesourcery.com>
-
- * Make-lang.in (cp/pt.o): Depend on vecprim.h.
- * pt.c: Include vecprim.h.
- (inline_parm_levels): Change the type to VEC(int,heap) *.
- (inline_parm_levels_used): Remove.
- (maybe_begin_member_template_processing,
- maybe_end_member_template_processing): Use VEC instead of
- VARRAY.
-
- * cp/call.c: Fix comment typos.
-
-2006-04-12 Mark Mitchell <mark@codesourcery.com>
-
- * parser.c (cp_parser_init_declarator): Initialize local variables
- aggressively.
-
-2006-04-12 Roger Sayle <roger@eyesopen.com>
-
- * parser.c (cp_parser_init_declarator): Initialise
- is_parenthesized_init to false to avoid compiler warning.
-
-2006-04-11 Mark Mitchell <mark@codesourcery.com>
-
- * cp-tree.h (build_operator_new_call): Adjust prototype.
- (build_new_method_call): Likewise.
- (build_op_delete_call): Likewise.
- * init.c (build_raw_new_expr): New function.
- (build_new_1): Pass information as parameters, rather than
- bundling it into a NEW_EXPR.
- (build_new): Adjust accordingly.
- (build_vec_delete_1): Adjust for changes to build_op_delete_call.
- (build_delete): Likewise.
- * decl.c (finish_destructor_body): Likewise.
- * call.c (build_operator_new_call): Return the allocation function
- used.
- (build_op_delete_call): Take allocation function as parameter.
- (build_special_member_call): Adjust call to build_new_method_call.
- (build_new_method_call): Return function called.
- * pt.c (tsubst_copy_and_build): Adjust call to
- build_new_method_call.
- * semantics.c (finish_call_expr): Likewise.
- * parser.c (cp_parser_postfix_expression): Likewise.
- * typeck2.c (cxx_incomplete_type_diagnostic): Refer to
- "incomplete", not "undefined", types.
-
- PR c++/26295
- * decl.c (grokdeclarator): Remove namespace-handling code for
- pointers-to-members.
- * parser.c (cp_parser_ptr_operator): Check for qualified names
- using namespaces.
-
- PR c++/26122
- * parser.c (cp_parser_init_declarator): Adjust logic for deciding
- whether or not to look for a pure-specifier.
- (cp_parser_member_declaration): Likewise.
-
-2006-04-08 Kazu Hirata <kazu@codesourcery.com>
-
- * decl2.c, pt.c, semantics.c: Fix comment typos.
-
-2006-04-06 Roger Sayle <roger@eyesopen.com>
-
- * call.c (null_ptr_cst_p): Add explicit TREE_CONSTANT_OVERFLOW check.
-
-2006-04-05 Jason Merrill <jason@redhat.com>
-
- * name-lookup.c (push_namespace_with_attribs): Temporarily disable
- default hidden visibility for anonymous namespace.
-
-2006-03-29 Roger Sayle <roger@eyesopen.com>
-
- PR c++/22494
- * init.c (build_vec_delete_1): Convert BASE pointer's type to
- the base pointer type to avoid a type mismatch in the EQ_EXPR.
-
-2006-03-24 Carlos O'Donell <carlos@codesourcery.com>
-
- * search.c (maybe_suppress_debug_info): If
- flag_emit_class_debug_always then don't suppress.
-
-2006-03-22 Jason Merrill <jason@redhat.com>
-
- * name-lookup.c (push_namespace_with_attribs): Only apply hidden
- visibility to anonymous namespaces if HAVE_GAS_HIDDEN.
-
-2006-03-21 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/26691
- * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle default arguments.
-
-2006-03-21 Jason Merrill <jason@redhat.com>
-
- PR c++/21581
- * parser.c (cp_parser_declaration): Support attributes on
- anonymous namespaces.
- * name-lookup.c (push_namespace_with_attribs): Anonymous
- namespaces default to hidden visibility.
-
-2006-03-20 Jason Merrill <jason@redhat.com>
-
- PR c++/21764, c++/19238
- * decl.c (cp_finish_decl): Call determine_visibility later.
- (start_preparsed_function): Likewise.
- * cp-tree.h (CP_TYPE_CONTEXT, TYPE_NAMESPACE_SCOPE_P): New macros.
- (TYPE_CLASS_SCOPE_P, TYPE_FUNCTION_SCOPE_P): New macros.
- * name-lookup.h (struct cp_binding_level): Add has_visibility
- bitfield.
- * name-lookup.c: Include c-pragma.h.
- (push_namespace_with_attribs): Split out from push_namespace.
- Push visibility if appropriate. Set TREE_PUBLIC on namespaces.
- (leave_scope): Pop visibility if appropriate.
- * decl2.c (determine_visibility_from_class): Split out from...
- (determine_visibility): ...here. Handle function scope and
- nested classes.
- (import_export_decl): Move visibility handling to
- determine_visibility_from_class.
- * parser.c (cp_parser_declaration, cp_parser_namespace_name): Allow
- attributes on namespace declarations.
-
-2006-03-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/6634
- * decl.c (grokdeclarator): Do not accept long long double.
- Reorganize checks for invalid (combinations of) type modifiers.
- Quote modifiers in messages.
-
-2006-03-09 Jason Merrill <jason@redhat.com>
-
- PR c++/16387, c++/16389
- * typeck.c (cxx_alignof_expr, cxx_sizeof_expr): New functions.
- (cxx_sizeof_or_alignof_expr): Split out from here.
-
-2006-03-09 Diego Novillo <dnovillo@redhat.com>
-
- Merge from gomp-20050608-branch
-
- 2006-02-02 Diego Novillo <dnovillo@redhat.com>
-
- * decl.c (pop_labels_1): Use appropriate pointer casting.
- (poplevel_named_label_1): Likewise.
- (named_label_entry_hash): Likewise.
- (named_label_entry_eq): Likewise.
- (check_goto): Likewise.
- (define_label): Likewise.
-
- 2006-01-26 Diego Novillo <dnovillo@redhat.com>
-
- * cp-tree.h (CP_OMP_CLAUSE_INFO): Use TREE_TYPE instead
- of TREE_BLOCK.
- * pt.c: Use OMP_CLAUSE_CODE and OMP_CLAUSE_OPERAND
- instead of TREE_CODE/TREE_OPERAND.
- * semantics.c: Likewise.
- * parser.c: Likewise.
-
- 2005-11-10 Diego Novillo <dnovillo@redhat.com>
-
- * parser.c (cp_parser_omp_threadprivate): Emit diagnostic if
- target does not support TLS.
-
- 2005-11-09 Jakub Jelinek <jakub@redhat.com>
-
- * decl.c (redeclaration_error_message): Don't error about
- DECL_THREAD_LOCAL_P mismatches if CP_DECL_THREADPRIVATE_P
- (olddecl).
-
- 2005-11-08 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/24735
- * semantics.c (finish_omp_barrier, finish_omp_flush): New
- functions.
- * parser.c (cp_parser_omp_barrier): Call finish_omp_barrier.
- (cp_parser_omp_flush): Call finish_omp_flush.
- * cp-tree.h (finish_omp_barrier, finish_omp_flush): New
- prototypes.
-
- PR c++/24734
- * pt.c (tsubst_expr): Handle OMP_MASTER and OMP_ORDERED.
-
- 2005-11-03 Jakub Jelinek <jakub@redhat.com>
-
- * semantics.c (finish_omp_threadprivate): Error on class-scope
- variables.
-
- 2005-11-02 Jakub Jelinek <jakub@redhat.com>
-
- * parser.c (cp_parser_omp_all_clauses): If some clause
- type is not allowed, don't remove just one of the
- clauses, but all clauses added in that loop round.
-
- * semantics.c (finish_omp_clauses): Fix function
- comment. Don't handle non-const or mutable specially,
- as const and not mutable is predetermined shared and
- that leads to double error. Don't ICE if copyin var is
- PARM_DECL.
-
- PR c++/24613
- * parser.c (cp_parser_pragma): Diagnose
- PRAGMA_OMP_SECTION outside of PRAGMA_OMP_SECTIONS
- construct.
-
- * semantics.c (finish_omp_threadprivate): Error if V
- is automatic variable or has incomplete type.
-
- 2005-11-01 Diego Novillo <dnovillo@redhat.com>
-
- * parser.c (cp_parser_omp_all_clauses): Use
- OMP_CLAUSE_CHAIN instead of TREE_CHAIN.
-
- 2005-11-01 Diego Novillo <dnovillo@redhat.com>
-
- * parser.c (cp_parser_omp_all_clauses): When emitting an
- error message, remove the invalid clause from the list.
-
- 2005-10-31 Diego Novillo <dnovillo@redhat.com>
-
- * parser.c (cp_parser_omp_parallel): Do not allow 'nowait' in
- combined parallel+workshare directives.
-
- 2005-10-31 Richard Henderson <rth@redhat.com>
-
- * cp-objcp-common.h (LANG_HOOKS_OMP_CLAUSE_DTOR):
- Use cxx_omp_clause_dtor.
- * cp-tree.h (CP_OMP_CLAUSE_INFO): New.
- (cxx_omp_clause_dtor): New.
- * cp-gimplify.c (cxx_omp_clause_apply_fn): New.
- (cxx_omp_clause_default_ctor): Use it.
- (cxx_omp_clause_copy_ctor, cxx_omp_clause_assign_op):
- Likewise.
- (cxx_omp_clause_dtor): New.
- * semantics.c (finish_omp_clauses): Rewrite cdtor
- checking to fill in CP_OMP_CLAUSE_INFO. Don't
- specialcase LASTPRIVATE for removal.
- (cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
- cxx_omp_clause_assign_op): Move to cp-gimplify.c.
-
- 2005-10-28 Jakub Jelinek <jakub@redhat.com>
-
- * semantics.c (finish_omp_threadprivate): If
- DECL_RTL_SET_P, call make_decl_rtl again so that
- encode_section_info can update SYMBOL_REF's flags.
-
- 2005-10-26 Jakub Jelinek <jakub@redhat.com>
-
- * semantics.c (finish_omp_for): Don't segfault if COND
- or INCR is NULL. If not calling c_finish_omp_for
- right away and one of COND and INCR is NULL, issue
- error and don't expand anything.
-
- PR c++/24512
- * cp-tree.h (finish_omp_for): Add PRE_BODY argument.
- * semantics.c (finish_omp_for): Likewise. Set
- OMP_FOR_PRE_BODY to PRE_BODY if deferring, add it
- into the current statement list if not processing
- template decl or pass it to c_finish_omp_for.
-
- * parser.c (cp_parser_omp_for_loop): Expand optional DECL_EXPRs
- into PRE_BODY statement list. Pass it to finish_omp_for.
- * pt.c (tsubst_expr) <case OMP_FOR>: tsubst_expr also
- OMP_FOR_PRE_BODY into PRE_BODY stmt list, pass it to
- finish_omp_for. Put all the statements into sk_omp
- scope.
-
- 2005-10-25 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/24516
- * parser.c (struct cp_parser): Rename in_iteration_statement
- field to in_statement.
- (IN_SWITCH_STMT, IN_ITERATION_STMT): Define.
- (IN_OMP_BLOCK, IN_OMP_FOR): Change values.
- (cp_parser_new, cp_parser_begin_omp_structured_block,
- cp_parser_end_omp_structured_block,
- cp_parser_omp_for_loop): Adjust for
- in_iteration_statement renaming.
- (cp_parser_selection_statement): Save
- parser->in_iteration, or it temporarily with
- IN_SWITCH_STMT for the
- cp_parser_implicitly_scoped_statement call.
- (cp_parser_iteration_statement): Adjust for
- in_iteration_statement renaming. Use
- IN_ITERATION_STMT rather than true.
- (cp_parser_jump_statement): Adjust for
- in_iteration_statement renaming and new values. Don't
- error on break in a switch statement within OMP_FOR or
- OpenMP structured block.
-
- PR c++/24513
- * parser.c (cp_parser_cache_group): Don't stop if next
- token is CPP_PRAGMA_EOL and end is CPP_PRAGMA_EOL as
- well. If current token is CPP_PRAGMA, consume
- everything until CPP_PRAGMA_EOL inclusive.
-
- 2005-10-24 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/24502
- * semantics.c (finish_omp_for): Handle MODOP_EXPR in
- addition to MODIFY_EXPR.
-
- 2005-10-23 Richard Henderson <rth@redhat.com>
-
- * cp-gimplify.c (struct cp_gimplify_ctx): Remove.
- (bc_label): New.
- (begin_bc_block, finish_bc_block): Use it.
- (push_context, pop_context): Remove.
- (cp_genericize): Don't use them. Assert bc_label is null.
- * semantics.c (finish_omp_clauses): Create a fake data
- element of TYPE for probing ctors.
-
- 2005-10-23 Richard Henderson <rth@redhat.com>
-
- * cp-objcp-common.h (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): New.
- (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR): New.
- (LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): New.
- (LANG_HOOKS_OMP_CLAUSE_DTOR): New.
- * semantics.c (finish_omp_clauses): Look through
- arrays when looking up special member calls. Also
- remove FIRSTPRIVATE when LASTPRIVATE fails.
- (cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor): New.
- (cxx_omp_clause_assign_op): New.
- * cp-tree.h: Declare them.
-
- 2005-10-21 Richard Henderson <rth@redhat.com>
-
- * decl.c (check_previous_goto_1): Return false if error.
- (check_switch_goto): Likewise.
- (finish_case_label): Don't emit the case label on error.
- * parser.c (struct cp_parser): Revert
- in_switch_statement_p changes.
- (cp_parser_labeled_statement,
- cp_parser_selection_statement): Likewise.
- (cp_parser_begin_omp_structured_block): Don't save...
- (cp_parser_end_omp_structured_block): or restore
- in_switch_statement_p.
-
- 2005-10-21 Richard Henderson <rth@redhat.com>
-
- * semantics.c (finish_omp_threadprivate): Set
- decl_flags.u2sel when necessary.
-
- 2005-10-21 Richard Henderson <rth@redhat.com>
-
- * decl.c (poplevel_named_label_1): Restore creation of the
- bad_decls list.
- (decl_jump_unsafe): Check for error_mark_node types.
- (check_goto): Don't check cdtor_label. Don't use identify_goto.
- * semantics.c (finish_return_stmt): Do check_omp_return before
- converting to cdtor_label goto.
-
- 2005-10-21 Richard Henderson <rth@redhat.com>
-
- PR c++/24451
- * decl.c (check_omp_return): Return false on error.
- * cp-tree.h (check_omp_return): Update decl.
- * semantics.c (finish_return_stmt): Avoid adding
- return on error.
-
- 2005-10-21 Richard Henderson <rth@redhat.com>
-
- * cp-tree.h (struct language_function): Remove
- x_named_label_uses.
- Change x_named_labels to a hashtable.
- (check_omp_return): Declare.
- * decl.c (struct named_label_use_entry): Rename from
- named_label_use_list. Remove label_decl.
- (struct named_label_entry): Rename from
- named_label_list. Remove old_value and next. Change
- in_try_scope and in_catch_scope to bool. Add
- in_omp_scope.
- (pop_labels_1): New.
- (pop_labels): Use it.
- (pop_local_label, poplevel_named_label_1): New.
- (poplevel): Use them.
- (named_label_entry_hash, named_label_entry_eq): New.
- (make_label_decl): Create named_labels. Move label
- creation bits from lookup_label.
- (declare_local_label): Tidy.
- (identify_goto): Split out from ...
- (check_previous_goto_1): Add exited_omp argument.
- Handle omp scopes.
-
- (use_label): Merge into...
- (check_goto): ... here. Handle omp scopes.
- (check_omp_return): New.
- (check_previous_gotos): Merge into...
- (define_label): ... here.
- (save_function_data): Remove x_named_label_uses reference.
- (finish_function): Likewise.
- * name-lookup.h (sk_omp): New.
- * name-lookup.c (begin_scope): Handle it.
- * parser.c (cp_parser_omp_for): Don't create extra
- compound stmt.
-
- (cp_parser_omp_sections): Likewise.
- * semantics.c (finish_return_stmt): Call check_omp_return.
- (begin_omp_structured_block): Use sk_omp.
- (finish_omp_structured_block): Use do_poplevel. Don't build a
- MUST_NOT_THROW expression here.
- (begin_omp_parallel, finish_omp_parallel): Don't create extra
- compound statements.
-
- 2005-10-21 Diego Novillo <dnovillo@redhat.com>
-
- PR 24455
- * cp/cp-tree.h (struct lang_decl_flags): Add field
- threadprivate_p.
- (CP_DECL_IS_THREADPRIVATE): Define.
- * cp/semantics.c (finish_omp_threadprivate): Set. Do
- not error out if CP_DECL_IS_THREADPRIVATE is set
- already.
- * cp/decl.c (duplicate_decls): Merge
- CP_DECL_THREADPRIVATE_P.
-
- 2005-10-20 Richard Henderson <rth@redhat.com>
-
- * cp-gimplify.c (cp_gimplify_omp_for): New.
- (cp_gimplify_expr): Call it.
- * cp-tree.h (OMP_FOR_GIMPLIFYING_P): New.
- * parser.c (struct cp_parser): Rename
- in_iteration_statement_p to in_iteration_statement and
- change to unsigned char. Similarly with
- in_switch_statement. Update all users.
- (IN_OMP_BLOCK, IN_OMP_FOR): New.
- (cp_parser_labeled_statement): Diagnose case labels
- binding closer to an openmp block nested than the
- switch.
- (cp_parser_jump_statement): Diagnose break and
- continue labels binding closer to an openmp block than
- an iteration or switch.
- (cp_parser_omp_for_loop): Mark in_iteration_statement
- for an omp for.
- (cp_parser_begin_omp_structured_block): New.
- (cp_parser_end_omp_structured_block): New.
- (cp_parser_omp_structured_block): Use them.
- (cp_parser_omp_for, cp_parser_omp_sections_scope): Likewise.
- (cp_parser_omp_parallel): Likewise.
-
- 2005-10-20 Richard Henderson <rth@redhat.com>
-
- * semantics.c (begin_omp_structured_block): New.
- (finish_omp_structured_block): New.
- (begin_omp_parallel, finish_omp_parallel): Use them.
- * parser.c (cp_parser_omp_structured_block): Likewise.
- (cp_parser_omp_for): Likewise.
- (cp_parser_omp_sections_scope): Likewise.
- * cp-tree.h: Declare them.
-
- 2005-10-20 Richard Henderson <rth@redhat.com>
-
- * parser.c (cp_parser_omp_master): Return the statement.
- (cp_parser_omp_ordered): Likewise.
- (cp_parser_omp_construct): Set the locus for them.
-
- 2005-10-19 Richard Henderson <rth@redhat.com>
-
- * semantics.c (finish_omp_atomic): Revert to
- uses_template_parms.
-
- 2005-10-19 Richard Henderson <rth@redhat.com>
-
- * semantics.c (finish_omp_clauses): Avoid
- DECL_THREAD_LOCAL_P on a PARM_DECL. Remove some
- stub asserts guaranteed to fail.
-
- 2005-10-19 Richard Henderson <rth@redhat.com>
-
- * cp-tree.h (OMP_ATOMIC_DEPENDENT_P, OMP_ATOMIC_CODE): New.
- (finish_omp_clauses, finish_omp_for, finish_omp_atomic): New.
- * parser.c (cp_parser_omp_clause_copyin): Remove.
- (cp_parser_omp_all_clauses): Use cp_parser_omp_var_list instead.
- Call finish_omp_clauses.
- (cp_parser_omp_clause_if): Don't do error checking here.
- (cp_parser_omp_clause_num_threads): Likewise.
- (cp_parser_omp_clause_schedule): Likewise.
- (cp_parser_omp_atomic): Use finish_omp_atomic.
- (cp_parser_omp_for_loop): Don't discard DECL_EXPR.
- Don't decompose assignment statment here. Use
- finish_omp_for.
-
- * pt.c (tsubst_omp_clauses): New.
- (tsubst_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
- OMP_SINGLE, OMP_SECTION, OMP_CRITICAL, OMP_ATOMIC.
- * semantics.c (finish_omp_clauses): New.
- (begin_omp_parallel, finish_omp_parallel): Know Less about the
- internals of the stmt_list stack.
- (finish_omp_for, finish_omp_atomic): New.
-
- 2005-10-18 Jakub Jelinek <jakub@redhat.com>
-
- * semantics.c (cxx_omp_predetermined_sharing): New function.
- * cp-tree.h (cxx_omp_predetermined_sharing): New prototype.
- * cp-objcp-common.h
- (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.
-
- 2005-10-18 Richard Henderson <rth@redhat.com>
-
- * parser.c (cp_parser_omp_single): Use make_node and accessors
- instead of build.
-
- 2005-10-17 Richard Henderson <rth@redhat.com>
-
- * parser.c (cp_parser_omp_for_loop): Handle declarations.
-
- 2005-10-12 Richard Henderson <rth@redhat.com>
-
- * Make-lang.in (CXX_C_OBJS): Add c-omp.o.
- * cp-tree.h (begin_omp_parallel, finish_omp_parallel): Declare.
- (finish_omp_threadprivate): Declare.
- * parser.c (struct cp_lexer): Add in_pragma.
- (cp_lexer_consume_token): Don't consume a PRAGMA_EOL
- when in_pragma.
- (cp_parser_skip_to_closing_parenthesis): Stop at PRAGMA_EOL.
- (cp_parser_skip_to_end_of_statement): Likewise.
- (cp_parser_skip_to_end_of_block_or_statement): Likewise.
- (cp_parser_skip_to_closing_brace): Likewise.
- (cp_parser_skip_to_pragma_eol): Reset in_pragma.
- (cp_parser_require_pragma_eol): New.
- (cp_parser_statement): Add in_compound argument;
- update all callers.
- Restart if a non-statement pragma seen outside a
- compound.
- (cp_parser_statement_seq_opt): Stop at PRAGMA_EOL.
- (cp_parser_declaration_seq_opt): Likewise.
- (cp_parser_member_specification_opt): Likewise.
- (cp_parser_function_definition_after_decl): Likewise.
- (cp_parser_skip_until_found): Likewise.
- (cp_parser_cache_group): Likewise.
- (enum pragma_omp_clause, cp_parser_omp_clause_name,
- check_no_duplicate_clause,
- cp_parser_omp_var_list_no_open,
- cp_parser_omp_var_list, cp_parser_omp_clause_copyin,
- cp_parser_omp_clause_default, cp_parser_omp_clause_if,
- cp_parser_omp_clause_nowait,
- cp_parser_omp_clause_num_threads,
- cp_parser_omp_clause_ordered,
- cp_parser_omp_clause_reduction,
- cp_parser_omp_clause_schedule,
- cp_parser_omp_all_clauses,
- cp_parser_omp_structured_block, cp_parser_omp_atomic,
- cp_parser_omp_barrier, cp_parser_omp_critical,
- cp_parser_omp_flush, cp_parser_omp_for_loop,
- cp_parser_omp_for, cp_parser_omp_master,
- cp_parser_omp_ordered, cp_parser_omp_sections_scope,
- cp_parser_omp_sections, cp_parser_omp_parallel,
- cp_parser_omp_single, cp_parser_omp_threadprivate,
- cp_parser_omp_construct): New.
- (cp_parser_pragma): Handle OpenMP pragmas.
- * semantics.c (finish_omp_threadprivate): New.
- (begin_omp_parallel, finish_omp_parallel): New.
-
- 2005-10-11 Richard Henderson <rth@redhat.com>
-
- * parser.c (struct cp_token): Add pragma_kind.
- (eof_token): Initialize it.
- (cp_lexer_handle_pragma): Remove.
- (cp_parser_initial_pragma): New.
- (cp_lexer_new_main): Use it.
- (cp_lexer_get_preprocessor_token): Initialize pragma_kind.
- (cp_lexer_print_token): Don't handle CPP_PRAGMA.
- (cp_parser_skip_to_pragma_eol): New.
- (cp_parser_error): Use it.
- (pragma_lex): New.
-
- 2005-10-09 Richard Henderson <rth@redhat.com>
-
- * lex.c (parse_strconst_pragma): Update for c_lex name change.
- (handle_pragma_java_exceptions): Likewise.
- * parser.c (cp_lexer_new_main): Likewise.
-
- 2005-10-06 Richard Henderson <rth@redhat.com>
-
- * parser.c (cp_lexer_new_main): Comment out defer_pragmas.
- (cp_lexer_handle_pragma): Comment out
- cpp_handle_deferred_pragma.
-
- 2005-10-01 Richard Henderson <rth@redhat.com>
-
- * name-lookup.c (lookup_name): Remove prefer_type argument.
- (lookup_name_prefer_type): New function.
- * name-lookup.h (lookup_name_prefer_type): Declare it.
- * decl.c (lookup_and_check_tag): Use it.
- * pt.c (tsubst_friend_class): Likewise. Update for
- lookup_name change.
- (lookup_template_class, tsubst_copy_and_build): Likewise.
-
-2006-03-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/15759
- * tree.c (bot_manip): Don't call mark_used.
-
-2006-03-02 Mike Stump <mrs@apple.com>
-
- * decl2.c (import_export_decl): Remove redundant call to
- targetm.cxx.key_method_may_be_inline ().
-
-2006-03-02 Richard Sandiford <richard@codesourcery.com>
-
- * decl.c (start_decl): Use have_global_bss_p when deciding
- whether to make the decl common.
-
-2006-03-01 Mike Stump <mrs@apple.com>
-
- PR darwin/25908
- * decl2.c (import_export_decl): Fix ABI breakage on darwin.
-
-2006-02-24 Geoffrey Keating <geoffk@apple.com>
-
- * except.c (expand_start_catch_block): Handle
- flag_use_cxa_get_exception_ptr.
-
-2006-02-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/26291
- * decl.c (grok_op_properties): Check for ellipsis in arguments of
- operators.
-
-2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
-
- * Make-lang.in (C++): Remove.
- (.PHONY): Remove C++.
-
-2006-02-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/26266
- * cp-tree.h (cp_finish_decl): Adjust declaration.
- (grokbitfield): Likewise.
- (finish_static_data_member_decl): Likewise.
- * init.c (constant_value_1): Ensure processing_template_decl when
- folding non-dependent initializers for static data members of
- dependent types. Return error_mark_node for erroneous
- initailizers.
- * class.c (get_vtable_decl): Use finish_decl, not cp_finish_decl.
- * decl.c (cp_make_fname_decl): Adjust call to cp_finish_decl.
- (cp_finish_decl): Add init_const_expr_p parameter. Set
- DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here.
- (finish_decl): Adjust call to cp_finish_decl.
- (compute_array_index_type): Robustify.
- (start_method): Use finish_decl, not cp_finish_decl.
- * rtti.c (emit_tinfo_decl): Likewise.
- * except.c (initialize_handler_parm): Adjust call to
- cp_finish_decl.
- (expand_start_catch_block): Likewise.
- * cvt.c (build_up_reference): Adjust call to cp_finish_decl.
- * pt.c (instantiate_class_template): Adjust call to
- finish_static_data_member_decl.
- (tsubst_expr): Use finish_decl, not cp_finish_decl.
- (instantiate_decl): Adjust call to cp_finish_decl.
- * name-lookup.c (pushdecl_top_level_1): Use finish_decl, not
- cp_finish_decl.
- * decl2.c (finish_static_data_member_decl): Add init_const_expr_p
- parameter.
- (grokfield): Likewise.
- * parser.c (cp_parser_condition): Check for constant initializers.
- (cp_parser_init_declarator): Adjust calls to grokfield and
- cp_finish_decl. Don't set
- DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here.
- (cp_parser_member_declaration): Likewise.
- (cp_parser_objc_class_ivars): Likewise.
-
-2006-02-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * call.c (standard_conversion): Return NULL instead of 0.
- (build_user_type_conversion_1): Likewise.
- (tourney): Likewise.
- * decl.c (redeclaration_error_message): Likewise.
- * error.c (language_to_string): Likewise.
-
-2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cp-tree.h (warn_hidden): Remove prototype.
- * class.c (warn_hidden): Make static.
-
- * cp-tree.h (build_type_conversion): Remove prototype.
- * cvt.c (build_type_conversion): Add prototype, make static.
-
- * cp-tree.h (push_tinst_level): Remove prototype.
- (pop_tinst_level): Likewise.
- * pt.c (push_tinst_level): Add prototype, make static.
- (pop_tinst_level): Likewise.
-
-2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * decl.c (grokdeclarator): Return NULL_TREE instead of 0.
- * typeck.c (unary_complex_lvalue): Likewise.
-
-2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * lex.c (parse_strconst_pragma): Return error_mark_node instead of
- "(tree)-1" to indicate failure. Simplify.
- (handle_pragma_interface): Test for error_mark_node instead of
- "(tree)-1".
- (handle_pragma_implementation): Likewise.
-
-2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/26151
- * parser.c (cp_parser_decl_specifier_seq): Check for duplicate
- decl-specifiers. Remove extra check for duplicate 'friend'.
- * decl.c (grokdeclarator): Remove check for duplicate
- decl-specifiers. Set longlong together with long_p.
-
-2006-02-12 Jason Merrill <jason@redhat.com>
-
- PR c++/24996
- * except.c (build_throw): Add a CLEANUP_POINT_EXPR inside the
- TRY_CATCH_EXPR or MUST_NOT_THROW_EXPR.
-
-2006-02-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * class.c (debug_class): Remove extern.
- (debug_thunks): Likewise.
-
-2006-02-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * typeck.c (string_conv_p): Don't test for flag_const_strings.
-
-2006-02-08 Jason Merrill <jason@redhat.com>
-
- PR c++/25979
- * cp-gimplify.c (cp_gimplify_expr): Don't call
- cp_gimplify_init_expr for MODIFY_EXPRs.
- * typeck2.c (split_nonconstant_init_1): Use INIT_EXPR.
-
-2006-02-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/26071
- * decl.c (grokdeclarator): Set dname also for destructor.
-
- PR c++/26070
- * decl.c (grokdeclarator): Clear storage_class together with staticp.
-
-2006-02-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error.
- (cp_build_qualified_type): Propogate renaming.
- * call.c (convert_like_real): Likewise.
- * cvt.c (cp_convert_to_pointer, convert_to_reference): Likewise.
- * decl.c (make_typename_type, grokdeclarator): Likewise.
- * pt.c (tsubst_friend_function, instantiate_class_template,
- tsubst_default_argument, instantiate_decl,
- tsubst_initializer_list, tsubst_enum): Likewise.
- * semantics.c (finish_template_type): Likewise.
- * typeck.c (build_ptrmemfunc, convert_for_assignment): Likewise.
-
-2006-02-07 Dirk Mueller <dmueller@suse.com>
-
- * typeck.c (build_binary_op): Annotate div-by-zero
- warnings to make -Wno-div-by-zero have an effect.
-
-2006-02-07 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/9737
- * pt.c (coerce_template_template_parms): Do not templates with
- excess default arguments to match template template parameters
- with fewer parameters.
- (coerce_template_parms): Add use_default_args parameter; use
- default arguments only when true.
- (lookup_template_class): Adjust call to coerce_template_parms.
- (fn_type_unification): Likewise.
- (unify): Likewise.
- (get_bindings): Likewise.
- (dependent_type_p): Add assertions.
-
-2006-02-06 Roger Sayle <roger@eyesopen.com>
-
- * decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE.
- * rtti.c (typeinfo_in_lib_p): Likewise.
- * cp-tree.h (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P): Likewise.
- * name-lookup.c (arg_assoc_type): Likewise.
-
-2006-02-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * cp-tree.h (tf_warn_or_error): New substituion flag.
- (cp_build_qualified_type): Use it.
- * call.c (convert_like_real): Likewise.
- * cvt.c (cp_convert_to_pointer): Likewise.
- (convert_to_reference): Likewise.
- * decl.c (make_typename_type): Likewise.
- (grokdeclarator): Likewise.
- * pt.c (tsubst_friend_function): Likewise.
- (tsubst_friend_class): Likewise.
- (instantiate_class_template): Likewise.
- (tsubst_default_argument): Likewise.
- (instantiate_decl): Likewise.
- (tsubst_initializer_list): Likewise.
- (tsubst_enum): Likewise.
- * semantics.c (finish_template_type): Likewise.
- * typeck.c (build_ptrmemfunc): Likewise.
- (convert_for_assignment): Likewise.
-
-2006-02-03 Lee Millward <lee.millward@gmail.com>
-
- * typeck.c (string_conv_p): Pass appropiate
- OPT_Wxxxx values when calling warning().
- (build_array_ref, cxx_mark_addressable): Likewise.
- (check_return_expr): Likewise.
-
- * init.c (perform_member_init): Likewise.
- (sort_mem_initializers, emit_mem_initializers): Likewise.
-
- * class.c (check_field_decls): Likewise.
- (warn_about_ambiguous_bases): Likewise.
-
- * decl.c (pop_label, poplevel): Likewise.
- (duplicate_decls, grok_op_properties): Likewise.
- (start_preparsed_function, finish_function): Likewise.
-
- * name-lookup.c (pushdecl_maybe_friend): Likewise.
- (pushdecl_maybe_friend): Likewise.
-
- * parser.c (cp_parser_warn_min_max): Likewise.
- (cp_parser_cast_expression): Likewise.
-
- * method.c (lazily_declare_fn): Likewise.
- * cvt.c (convert_to_void): Likewise.
- * mangle.c (finish_mangling): Likewise.
- * cp-gimplify.c (gimplify_expr_stmt): Likewise.
-
-2006-02-03 Mark Mitchell <mark@codesourcery.com>
-
- * name-lookup.c (do_class_using_decl): Use IDENTIFIER_TYPENAME_P,
- not IDENTIFIER_OPNAME_P.
-
-2006-01-31 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25342
- * cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Revise
- documentation.
- * pt.c (determine_specialization): Use INNERMOST_TEMPLATE_PARMS,
- not TREE_VALUE.
- (instantiate_class_template): Simplify.
- (verify_class_unification): Remove.
- (unify): Document parameters. Use INNERMOST_TEMPLATE_ARGS to
- permit multiple levels of template arguments.
- (more_specialized_class): Simplify.
- (get_class_bindings): Pass full arguments to unify. Fold
- verify_class_unification into this function. Return full
- arguments.
- (most_specialized_class): Adjust for changes to
- get_class_bindings. Issue errors here for ambiguity. Return the
- fully deduced arguments for the most specialized class, in
- addition to the partial specialization.
-
-2006-01-31 Ben Elliston <bje@au.ibm.com>
-
- * mangle.c: Comment fix.
-
-2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * Make-lang.in (cp-warn): Include CXX_COMPAT_WARN.
- * repo.c (extract_string, afgets): Use cast when converting from
- void *.
-
-2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * call.c (alloc_conversion): Use cast when converting from void *.
- (alloc_conversions): Likewise.
- (add_candidate): Likewise.
- (print_z_candidates): Likewise.
- (add_warning): Likewise.
- * pt.c (retrieve_local_specialization): Likewise.
- (process_partial_specialization): Likewise.
- (mangle_class_name_for_template): Likewise.
- (tsubst_template_args): Likewise.
- * typeck2.c (pat_calc_hash): Likewise.
- (pat_compare): Likewise.
- (abstract_virtuals_error): Likewise.
- * class.c (method_name_cmp): Likewise.
- (resort_method_name_cmp): Likewise.
- (get_vfield_name): Likewise.
- * decl2.c (generate_ctor_and_dtor_functions_for_priority): Likewise.
- * lex.c (init_reswords): Likewise.
- * rtti.c (create_pseudo_type_info): Likewise.
- * search.c (dfs_lookup_base): Likewise.
- (dfs_dcast_hint_pre): Likewise.
- (dfs_dcast_hint_post): Likewise.
- * tree.c (hash_tree_cons): Likewise.
- * repo.c (extract_string): Likewise.
- (afgets): Likewise.
- * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise.
- * g++spec.c (lang_specific_driver): Likewise.
-
-2006-01-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * call.c (joust): Pass option code to warning. Use inform for
- explanation.
- * class.c (check_bases): Likewise.
- (maybe_warn_about_overly_private_class): Likewise.
- (check_field_decls): Likewise.
- (layout_empty_base): Likewise.
- (layout_virtual_bases): Likewise.
- (layout_class_type): Likewise.
-
-2006-01-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25999
- * decl.c (start_preparsed_function): Call maybe_apply_pragma_weak
- here, not ...
- (start_function): ... here.
-
-2006-01-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25855
- * class.c (resolve_address_of_overloaded_function): Adjust use of
- return value from most_specialized_instantiation.
- * pt.c (determine_specialization): Avoid multiple calls to
- get_bindings.
- (most_specialized_instantiation): When a tie occurs, set the
- current presumed champion to the next template. Return the
- TREE_LIST node containing the template, rather than the template
- itself.
- (most_specialized): Remove.
- * name-lookup.c (push_overloaded_decl): When duplicate_decls
- indicates a failed redeclaration, report that to callers.
-
-2006-01-26 Jason Merrill <jason@redhat.com>
-
- PR c++/16021
- * name-lookup.c (parse_using_directive): Require strong using to
- name a nested namespace.
-
-2006-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- Revert:
- * cp-tree.h (do_poplevel): Remove prototype.
- * semantics.c (do_poplevel): Add prototype. Make static.
-
- Revert:
- * cp-tree.h (default_conversion): Remove prototype.
- * typeck.c (default_conversion): Make static.
-
-2006-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cp-tree.h (get_primary_binfo): Remove prototype.
- (push_using_decl): Likewise.
- (current_template_args): Likewise.
- (more_specialized_class): Likewise.
- (mark_class_instantiated): Likewise.
- (default_conversion): Likewise.
- (pfn_from_ptrmemfunc): Likewise.
- * class.c (get_primary_binfo): Add prototype, make static, simplify.
- * name-lookup.c (push_using_decl): Make static.
- * pt.c (current_template_args): Likewise.
- (more_specialized_class): Likewise.
- (mark_class_instantiated): Likewise.
- * typeck.c (default_conversion): Make static.
- (pfn_from_ptrmemfunc): Add prototype, make static.
-
-2006-01-24 Dirk Mueller <dmueller@suse.de>
-
- * typeck.c (build_binary_op): Use OPT_Wfloat_equal in warning().
-
-2006-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/25552
- * parser.c (cp_parser_unqualified_id): Check that destructor name
- and scope match.
- * call.c (check_dtor_name): Do not expect a BIT_NOT_EXPR.
- Adjust comment. Return early if possible.
- Use same_type_p to compare types.
- * typeck.c (lookup_destructor): Adjust call to check_dtor_name.
-
-2006-01-24 Mark Mitchell <mark@codesourcery.com>
-
- * semantics.c: Remove outdated comment.
-
-2006-01-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cp-tree.h (do_poplevel): Remove prototype.
- * semantics.c (do_poplevel): Add prototype. Make static.
-
- * cp-tree.h (original_type): Remove prototype.
- * typeck.c (original_type): Make static.
-
- * cp-tree.h (declare_global_var): Remove prototype.
- * decl.c (declare_global_var): Make static.
-
- * cp-tree.h (implicitly_declare_fn): Remove prototype.
- * method.c (implicitly_declare_fn): Make static.
-
- * cp-tree.h (fold_decl_constant_value): Remove prototype.
- * pt.c (fold_decl_constant_value): Make static.
-
- * cp-tree.h (build_x_delete): Remove prototype.
- * init.c (build_vec_delete_1): Call build_op_delete_call directly
- and not via build_x_delete.
- (build_x_delete): Remove.
-
- * cp-tree.h (get_vtt_name): Remove prototype.
- * class.c (get_vtt_name): Remove.
- (build_vtt): Call mangle_vtt_for_type instead of get_vtt_name.
-
-2006-01-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * rtti.c (build_dynamic_cast): Fix comment.
-
-2006-01-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- PR c++/10891
- * rtti.c (build_dynamic_cast): Reject dynamic_cast use if
- -fno-rtti.
-
-2006-01-21 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25895
- * class.c (build_base_path): Generate a NOP_EXPR instead of a
- COMPONENT_REF if the base and derived classes are at the same
- address.
-
- PR c++/25856
- * decl.c (begin_destructor_body): Robustify.
-
- PR c++/25858
- * parser.c (cp_parser_direct_declarator): Robustify.
-
-2006-01-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * parser.c (cp_lexer_next_token_is_keyword): Simplify.
-
- * parser.c (clear_decl_specs): Remove prototype.
-
- * parser.c (cp_parser_expression_fn): Remove.
-
- * call.c (add_builtin_candidates): Remove superfluous return.
- * name-lookup.c (do_toplevel_using_decl): Likewise.
- * parser.c (cp_parser_type_specifier_seq): Likewise.
- (cp_parser_save_default_args): Likewise.
-
-2006-01-20 Dirk Mueller <dmueller@suse.com>
-
- PR c++/5520
- * semantics.c (finish_if_stmt): Call empty_body_warning.
- * parser.c (cp_parser_implicitly_scoped_statement):
- Mark empty statement with an empty stmt.
-
-2006-01-19 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22136
- * name-lookup.c (do_class_using_decl): Don't try to look up base
- classes in templates with dependent base types.
-
-2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/25854
- * pt.c (maybe_process_partial_specialization): Return early on
- error_mark_node.
-
-2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/16829
- * decl.c (start_preparsed_function): Check default arguments
- unconditionally.
- * name-lookup.c (pushdecl_maybe_friend): Check default arguments
- of all functions and function templates.
- * parser.c (cp_parser_late_parsing_default_args): Check default
- arguments.
- * decl2.c (check_default_args): Set missing default arguments to
- error_mark_node.
-
-2006-01-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25836
- * cp-tree.h (push_class_stack): New function.
- (pop_class_stack): Likewise.
- * class.c (class_stack_node): Add hidden field.
- (pushclass): Clear it.
- (push_class_stack): New function.
- (pop_class_stack): Likewise.
- (currently_open_class): Ignore hidden classes.
- (currently_open_derived_class): Likewise.
- * name-lookup.c (push_to_top_level): Call push_class_stack.
- (pop_from_top_level): Call pop_class_stack.
-
-2006-01-18 Kazu Hirata <kazu@codesourcery.com>
-
- * tree.c (find_tree_t, find_tree): Remove.
- * cp-tree.h: Remove the prototype for find_tree.
-
-2006-01-18 Jakub Jelinek <jakub@redhat.com>
-
- * search.c (lookup_conversions_r): Fix a pasto.
-
-2006-01-17 Eric Christopher <echristo@apple.com>
-
- * call.c (convert_like_real): When issuing conversion
- warnings, depend on OPT_Wconversion.
- * cvt.c (build_expr_type_conversion): Ditto.
-
-2006-01-17 Kazu Hirata <kazu@codesourcery.com>
-
- * name-lookup.c (lookup_namespace_name): Remove.
- * name-lookup.h: Remove the prototype for
- lookup_namespace_name.
-
-2006-01-17 Jakub Jelinek <jakub@redhat.com>
-
- PR c/25682
- * decl.c (compute_array_index_type): After issuing not an integral
- constant-expression error, set size to 1 to avoid ICEs later on.
-
-2006-01-16 Ian Lance Taylor <ian@airs.com>
-
- * parser.c: Include "cgraph.h".
- (cp_parser_asm_definition): Call cgraph_add_asm_node rather than
- assemble_asm.
-
-2006-01-16 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
-
- * g++spec.c (lang_specific_spec_functions): Remove.
-
-2006-01-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * decl.c (check_initializer): Fix thinko.
-
-2006-01-14 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25663
- * parser.c (cp_parser_direct_declarator): Use cp_parser_error
- instead of error.
-
-2006-01-13 Jason Merrill <jason@redhat.com>
-
- * pt.c (check_explicit_specialization): Use CP_DECL_CONTEXT even more.
-
- * name-lookup.c (set_decl_namespace): Use CP_DECL_CONTEXT.
- * pt.c (check_explicit_specialization): Likewise.
-
-2006-01-12 Jason Merrill <jason@redhat.com>
-
- PR libstdc++/24660
- * pt.c (check_explicit_specialization): Handle namespace
- association.
- * name-lookup.c (set_decl_namespace): Likewise.
-
-2006-01-12 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/24824
- * class.c (handle_using_decl): Pass correct scope to
- cp_emit_debug_info_for_using.
-
-2006-01-11 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/25386
- * tree.c (lvalue_p_1): Any part of a COMPONENT_REF affects
- packedness.
-
-2006-01-06 Gabriel Dos Reis <gdr@integrablesolutions.net>
-
- * parser.c (cp_parser_primary_expression): Document the grammar
- for the built-in offsetof, a GNU extension.
-
-2006-01-04 Zdenek Dvorak <dvorakz@suse.cz>
-
- PR c++/25632
- * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo
- in condition.
-
-2006-01-04 Chris Lattner <sabre@gnu.org>
-
- * typeck2.c: update copyright to 2006
- (split_nonconstant_init_1): Set TREE_CONSTANT to true.
-
-2006-01-04 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24782
- * parser.c (cp_parser_nested_name_specifier_opt): Preserve access
- checks, even when parsing tentatively.
-
-2006-01-04 Richard Henderson <rth@redhat.com>
-
- Merge from gomp branch.
- * lex.c (handle_pragma_java_exceptions): Fix whitespace.
- * parser.c (struct cp_token): Add pragma_kind.
- (eof_token): Update to match.
- (struct cp_lexer): Add in_pragma; rearrange next for better packing.
- (cp_parser_initial_pragma): New.
- (cp_lexer_new_main): Use it. Don't bother clearing
- c_lex_return_raw_strings.
- (cp_lexer_get_preprocessor_token): Always initialize keyword
- and pragma_kind fields. Handle CPP_PRAGMA.
- (cp_lexer_consume_token): Don't allow CPP_PRAGMA_EOL when
- in_pragma is set.
- (cp_lexer_handle_pragma): Remove. Update callers to cp_parser_pragma.
- (cp_lexer_print_token) <CPP_PRAGMA>: Don't print as a string.
- (cp_parser_skip_to_pragma_eol): New.
- (cp_parser_error): Use it.
- (cp_parser_skip_to_closing_parenthesis): Stop at CPP_PRAGMA_EOL;
- rearrange with switch statement.
- (cp_parser_skip_to_end_of_statement): Likewise.
- (cp_parser_skip_to_end_of_block_or_statement): Likewise.
- (cp_parser_skip_to_closing_brace): Likewise.
- (cp_parser_skip_until_found): Likewise.
- (cp_parser_statement): Add in_compound argument; update callers.
- Use it to decide how to handle pragma parsing.
- (cp_parser_labeled_statement): Add in_compound argument; pass
- it on to cp_parser_statement.
- (cp_parser_statement_seq_opt): Stop at CPP_PRAGMA_EOL.
- (cp_parser_declaration_seq_opt): Likewise.
- (cp_parser_parameter_declaration): Likewise.
- (cp_parser_member_specification_opt): Likewise.
- (cp_parser_function_definition_after_decl): Likewise.
- (cp_parser_cache_group): Handle CPP_PRAGMA/CPP_PRAGMA_EOL pairs.
- (cp_parser_pragma): New.
- (pragma_lex): New.
-
-2006-01-04 Dirk Mueller <dmueller@suse.com>
-
- * decl.c (finish_constructor_body): create simple
- compound stmt instead of a if(1) { } construct.
-
-2006-01-03 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25492
- * name-lookup.c (push_class_level_binding): When a derived class
- provides a type binding, eliminate any type binding from a base
- class.
-
- PR c++/25625
- * repo.c (repo_emit_p): Always instantiate static data members
- initialized by constant expressions, so that there values are
- available.
-
-2006-01-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25635
- * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a
- conversion operator.
- * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here.
-
- PR c++/25638
- * class.c (add_method): Never associate more than one destructor
- with a single class.
-
- PR c++/25637
- * cp-tree.h (do_friend): Adjust prototype.
- * decl.c (grokfndecl): Make funcdef_flag a bool, not an int.
- (grokdeclarator): Likewise. Refine check for invalid
- declarations/definitions of member functions outside of their own
- class.
- * friend.c (do_friend): Make funcdef_flag a bool, not an int.
-
- PR c++/25633
- * parser.c (cp_parser_mem_initializer_list): Check result of
- cp_parser_mem_initializer against error_mark_node, not NULL_TREE.
- (cp_parser_mem_initializer): Return error_mark_node for failure.
-
- PR c++/25634
- * parser.c (cp_parser_template_parameter_list): Call
- begin_template_parm_list and end_template_parm_list here.
- (cp_parser_type_parameter): Not here.
- (cp_parser_template_declaration_after_export): Or here.
- (cp_parser_elaborated_type_specifier): Call
- cp_parser_check_template_parameters.
-
- * tree.c (build_target_expr_with_type): Use force_target_expr.
-
- * decl2.c (mark_used): Fix typo in comment.
-
-2006-01-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * parser.c (cp_parser_using_declaration): Skip name-lookup on
- invalid scope.
-
-2005-12-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * cxx-pretty-print.c (pp_cxx_constant): New. Print
- string-literal in parens if input program says so.
- (pp_cxx_primary_expression): Hand off constant printing to
- pp_cxx_constant.
- (pp_cxx_pretty_printer_init): Set pp->c_base.constant.
- (pp_cxx_expression): Use pp_cxx_constant for literals.
- * error.c (dump_expr): Use pp_constant for literals.
-
-2005-12-29 Nathan Sidwell <nathan@codesourcery.com>
-
- * method.c (make_thunk): Don't set comdat_linkage here.
- (use_thunk): Make thunk one only here, if thunk target is
- DECL_ONE_ONLY.
-
-2005-12-26 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25439
- * decl.c (grokdeclarator): Remove dead code.
- * ptree.c (cxx_print_xnode): Handle BASELINK.
- * parser.c (make_id_declarator): Add sfk parameter.
- (cp_parser_direct_declarator): Do not pass TYPE_DECLs to
- make_id_declarator.
- (cp_parser_declarator_id): Simplify BASELINKs here.
- (cp_parser_member_declaration): Adjust calls to
- make_id_declarator.
-
-2005-12-26 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23171, c++/23172, c++/25417.
- * typeck.c (build_unary_op): Create temporary variables for
- compound literals whose addresses are taken.
- * init.c (expand_aggr_init_1): Use COMPOUND_LITERAL_P.
- * decl.c (reshape_init_vector): Likewise.
- (reshape_init): Give it external linkage.
- (check_initializer): Use COMPOUND_LITERAL_P.
- (initialize_artificial_var): Allow the initializer to be a
- CONSTRUCTOR.
- * call.c (make_temporary_var_for_ref_to_temp): Use
- create_temporary_var.
- * cp-tree.h (COMPOUND_LITERAL_P): New macro.
- (rehape_init): Declare.
- * typeck2.c (digest_init): Use COMPOUND_LITERAL_P.
- * semantics.c (finish_compound_literal): Use reshape_init.
-
-2005-12-23 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24671
- * pt.c (instantiate_template): Handle SFINAE.
-
-2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * decl.c (grokdeclarator): Improve diagnostic for friend
- declarations of class members.
-
-2005-12-22 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25369
- * tree.c (really_overloaded_fn): Tweak comment.
- * pt.c (tsubst_call_declarator_parms): Remove.
- (tsubst_copy): Call mark_used on the member referenced by an
- OFFSET_REF.
- * semantics.c (finish_qualified_id_expr): Simplify.
- * decl2.c (mark_used): Accept BASELINKs.
-
- PR c++/25364
- * typeck.c (build_unary_op): Pass DECLs not names to
- build_offset_refs.
- * init.c (build_offset_ref): Do not do name lookup. Do not call
- mark_used.
- * call.c (build_call): Simplify and tidy.
- * semantics.c (finish_qualified_id_expr): Call mark_used.
-
-2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23333
- * parser.c (cp_parser_pure_specifier): Check for PURE_ZERO to
- identify a single '0'.
-
-2005-12-20 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21228
- * decl.c (use_eh_spec_block): New function.
- (store_parm_decls): Use it.
- (finish_function): Likewise.
-
-2005-12-19 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24278
- * init.c (expand_member_init): Print messages about baseclasses
- using %T rather than %D.
-
- PR c++/24915
- * class.c (add_method): Do not treat templates as identical unless
- their return types are the same.
-
-2005-12-12 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25300
- * tree.c (build_qualified_name): Return error_mark_node for
- erroneous input.
-
-2005-12-10 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/25337
- * pt.c (tsubst_copy_and_build): Permit dependent types for the
- object in a class member access expression.
-
-2005-12-10 Terry Laurenzo <tlaurenzo@gmail.com>
-
- PR java/9861
- * mangle.c (write_bare_function_type): Mangle return type for
- methods of Java classes
-
-2005-12-08 Th�dore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
-
- * call.c (build_conditional_expr): Print types in error messages.
-
-2005-12-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * expr.c (cxx_expand_expr): Call gcc_unreachable instead of abort.
-
-2005-12-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cp-gimplify.c (gimplify_cp_loop): Use fold_build3.
-
-2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
-
- * Make-lang.in (c++.all.build, c++.install-normal): Remove.
-
-2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
-
- * Make-lang.in: Remove all dependencies on s-gtype.
-
-2005-12-06 Aldy Hernandez <aldyh@redhat.com>
-
- PR C++/24138
- * decl.c (reshape_init_array_1): Handle max_index of -1.
-
-2005-12-06 Roger Sayle <roger@eyesopen.com>
-
- * typeck.c (build_binary_op): Issue warning if either operand of a
- comparison operator is a string literal, except for testing equality
- or inequality against NULL.
-
-2005-12-06 Roger Sayle <roger@eyesopen.com>
-
- PR c++/25263
- * decl.c (compute_array_index_type): Check that itype is an
- INTEGER_CST node before testing/clearing TREE_OVERFLOW.
-
-2005-12-05 Daniel Berlin <dberlin@dberlin.org>
-
- * ptree.c (cxx_print_decl): Update to check for decl_common
- structure.
-
-2005-12-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24173
- * decl.c (duplicate_decls): Don't rely on DECL_TEMPLATE_INFO after
- clobbering newdecl.
-
-2005-12-02 Richard Guenther <rguenther@suse.de>
-
- * semantics.c (simplify_aggr_init_expr): Use buildN instead
- of build.
-
-2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * parser.c (cp_lexer_new_main): Usr GGC_RESIZEVEC instead of
- ggc_realloc.
- (cp_parser_template_argument_list): Use XRESIZEVEC instead of
- xrealloc.
- * class.c (pushclass): Likewise.
-
-2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * decl2.c (get_priority_info): Use XNEW, not xmalloc.
- * decl.c (push_switch): Likewise.
- * lex.c (handle_pragma_implementation): Likewise.
- * cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW,
- not ggc_alloc.
- (cxx_initialize_diagnostics): Use XNEW, not xmalloc.
- * class.c (init_class_processing): Use XNEWVEC, not xmalloc.
- * g++spec.c (lang_specific_driver): Likewise.
- * mangle.c (save_partially_mangled_name): Likewise.
- * parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc.
- (cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc.
- (cp_parser_sizeof_operand): Likewise.
- * repo.c (open_repo_file, open_repo_file): Likewise.
-
-2005-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * parser.c (cp_parser_make_typename_type): Call make_typename_type
- with tf_none instead of magic value 0.
- (cp_parser_explicit_instantiation): Call do_type_instantiation
- with tf_error instead of magic value 1.
- (cp_parser_elaborated_type_specifier): Call make_typename_type
- with tf_error instead of magic value 1.
- (cp_parser_class_name): Likewise.
- (cp_parser_lookup_name): Likewise.
-
-2005-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * parser.c (cp_parser_declaration): Set token2.type to CPP_EOF,
- not RID_MAX.
-
-2005-11-30 Jason Merrill <jason@redhat.com>
-
- PR c++/21123
- * cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference
- parms in a thunk.
-
-2005-11-30 Ben Elliston <bje@au.ibm.com>
-
- * typeck.c (build_x_unary_op): Correct spelling in error message.
-
-2005-11-28 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21166
- * class.c (check_field_decls): Only set DECL_PACKED on a field
- when its natural alignment is > BITS_PER_UNIT.
-
-2005-11-27 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/24979
- * cp-tree.h (DECL_MAIN_P): Remove duplicate definition.
-
-2005-11-26 Richard Henderson <rth@redhat.com>
-
- * lex.c: Update for pragma_lex rename.
- * parser.c: Likewise.
-
-2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/9278
- * decl.c (grokparms): Do not allow typedef-names in a '(void)'
- parmlist.
-
-2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * typeck2.c (process_init_constructor_union): Remove check for
- unnamed union members.
-
-2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * name-lookup.c (lookup_name_real): Merge two if's.
-
-2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * pt.c (instantiate_class_template): Clean-up.
-
-2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * pt.c (template_class_depth_real): Remove. Move functionality to ...
- (template_class_depth): ... here, replacing count_specializations
- with 0. Adjust comment.
-
-2005-11-24 Richard Guenther <rguenther@suse.de>
- Dirk Mueller <dmueller@suse.de>
-
- PR c++/14024
- * typeck.c (build_reinterpret_cast_1): Use
- strict_aliasing_warning.
-
-2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- PR c++/24235
- * pt.c (check_instantiated_args): Reword diagnostic message about
- template argument involving local types.
-
-2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- PR c++/21667
- * typeck.c (build_array_ref): Avoid code duplicate. Use common
- C/C++ diagnostic function warn_array_subscript_with_type_char.
-
-2005-11-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- PR c++/22238
- * error.c (resolve_virtual_fun_from_obj_type_ref): New.
- (dump_expr): Use it in <case CALL_EXPR>.
-
-2005-11-21 Richard Henderson <rth@redhat.com>
-
- * cp-objcp-common.h, name-lookup.c, name-lookup.h: Revert 11-18 patch.
-
- * name-lookup.c (lookup_name): Remove prefer_type argument.
- (lookup_name_prefer_type): New.
- * decl.c (lookup_and_check_tag): Use them.
- * pt.c (tsubst_friend_class): Likewise.
- (lookup_template_class): Likewise.
- (tsubst_copy_and_build): Likewise.
- * name-lookup.h (lookup_name_prefer_type): New.
- (lookup_name): Remove declaration.
-
-2005-11-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/8355
- * decl.c (grokfndecl): Set up DECL_TEMPLATE_INFO before calling
- set_decl_namespace.
- * name-lookup.c (set_decl_namespace):
-
-2005-11-18 Mike Stump <mrs@apple.com>
-
- * cp-objcp-common.h (LANG_HOOKS_LOOKUP_NAME): Add.
- * name-lookup.c (lookup_name_two): Remove.
- (lookup_name_one): Add.
- * name-lookup.h (lookup_name_two): Remove.
- (lookup_name_one): Add.
-
-2005-11-15 Jason Merrill <jason@redhat.com>
-
- PR c++/24580
- * method.c (locate_copy): Also use skip_artificial_parms here.
- (synthesize_exception_spec): Use CLASS_TYPE_P rather than checking
- for RECORD_TYPE.
- (locate_ctor): Abort if we fail to find a default constructor.
-
-2005-11-15 Mike Stump <mrs@apple.com>
-
- * name-lookup.c (lookup_name_two): Add.
- * name-lookup.h: Likewise.
-
-2005-11-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24667
- * typeck.c (check_for_casting_away_constness): Use the diag_fn.
- (build_const_cast_1): Call it, for C-style casts.
-
-2005-11-14 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24687
- * pt.c (check_explicit_specialization): Don't check for C linkage.
- (push_template_decl_real): Likewise.
- * parser.c (cp_parser_explicit_specialization): Check here.
- (cp_parser_template_declaration_after_export): And here.
-
- * parser.c (cp_lexer_get_preprocessor_token): Initialize keyword
- field.
-
-2005-11-14 Jason Merrill <jason@redhat.com>
-
- PR c++/24580
- * method.c (locate_ctor): Skip all artificial parms, not just
- 'this'.
-
-2005-11-14 Mark Mitchell <mark@codesourcery.com>
-
- * parser.c (eof_token): Add initializer for ambiguous_p.
-
-2005-11-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24817
- * decl.c (check_redeclaration_exception_specification): New
- function.
- (duplicate_decls): Use it.
- * error.c (fndecl_to_string): Print the template parameter list.
-
- PR c++/20293
- * cxx-pretty-print.c (pp_cxx_statement): Print qualifying scopes
- for namespaces.
- (pp_cxx_original_namespace_definition): Likewise.
- * name-lookup.c (ambiguous_decl): Don't issue error messages;
- instead return lists of ambiguous candidates.
- (select_decl): Handle ambiguous namespace lookups.
- * parser.c (cp_token): Add ambiguous_p.
- (cp_lexer_get_preprocessor_token): Set it.
- (cp_parser_diagnose_invalid_type_name): Avoid duplicate messages
- when a qualified name uses an invalid scope.
- (cp_parser_primary_expression): Print ambiguous candidates.
- (cp_parser_type_parameter): Adjust comment to reflect new
- parameter name for cp_parser_lookup_name.
- (cp_parser_template_argument): Likewise.
- (cp_parser_elaborated_type_specifier): Likewise.
- (cp_parser_namespace_name): Likewise.
- (cp_parser_class_name): Print ambiguous candidates.
- (cp_parser_lookup_name): Rename ambiguous_p parameter to
- ambiguous_decls. Use it to return a list of ambiguous candiates
- when a lookup is ambiguous.
- (cp_parser_lookup_name_simple): Adjust comment to reflect new
- parameter name for cp_parser_lookup_name.
-
-2005-11-12 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/24780
- * typeck.c (complete_type): Set TYPE_NEEDS_CONSTRUCTING
- and TYPE_HAS_NONTRIVIAL_DESTRUCTOR flags for all variants
- of array type.
-
- PR c++/24761
- * pt.c (tsubst_copy_asm_operands): New function.
- (tsubst_expr) <case ASM_EXPR>: Use it.
-
-2005-11-08 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/19450
- * decl.c (redeclaration_error_message): Issue diagnostics about
- olddecl and newdecl disagreement on __thread property.
- (grokdeclarator): Set DECL_TLS_MODEL on class static variables.
-
-2005-11-08 Jason Merrill <jason@redhat.com>
-
- PR c++/21123
- * method.c (use_thunk): Use build_cplus_new instead of
- force_target_expr.
-
-2005-11-06 Jason Merrill <jason@redhat.com>
- James A. Morrison <phython@gcc.gnu.org>
-
- PR c++/17256
- * decl2.c (cp_finish_file): Fix conditions for undefined warning.
- Set TREE_NO_WARNING instead of TREE_PUBLIC.
- * pt.c (instantiate_pending_templates): Set DECL_INITIAL to avoid
- a warning on a function we didn't instantiate because of excessive
- recursion.
-
-2005-11-06 Mark Mitchell <mark@codesourcery.com>
-
- * class.c (record_subobject_offsets): Don't record offsets past
- biggest empty class for non-empty base classes.
- (layout_class_type): Use TYPE_SIZE_UNIT, not TYPE_SIZE, when
- keeping track of the size of emptyclasses.
-
- PR c++/21308
- * class.c (sizeof_biggest_empty_class): New variable.
- (record_subobject_offsets): Don't record offsets past biggest
- empty class for data members. Replace vbases_p parameter with
- is_data_member parameter.
- (build_base_field): Adjust call.
- (layout_class_type): Likewise. Maintain
- sizeof_biggest_empty_class.
-
-2005-11-05 Kazu Hirata <kazu@codesourcery.com>
-
- * decl2.c, init.c, typeck.c: Fix comment typos.
-
-2005-11-04 Richard Guenther <rguenther@suse.de>
-
- PR c++/22487
- * init.c (build_vec_init): Build comparison of matching
- types.
-
-2005-11-03 Josh Conner <jconner@apple.com>
-
- PR c++/19989
- pt.c (tsubst): Accept zero-length array if tf_error is set
- in complain flags. Change error message for negative-
- length array.
-
-2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
-
- * cp-tree.h (cp_cpp_error), error.c (cp_cpp_error): Take va_list*
- parameter.
-
-2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
-
- PR c++/17964
- * error.c (cp_cpp_error): New function.
- * cp-tree.h (cp_cpp_error): Declare.
- * parser.c (cp_lexer_new_main): Set CPP option client_diagnostic
- and error callback after lexing.
-
-2005-11-03 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21627
- * pt.c (register_specialization): Update inline flags on clones.y
-
-2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR c++/24582
- * decl.c (declare_local_label): Return 0 for variables
- with error_mark_node as their types.
-
-2005-11-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22434
- * call.c (build_conditional_expr): Do bad conversions, if there's
- no other choice.
-
- PR c++/24560
- * parser.c (cp_parser_postfix_dot_deref_expression): Improve error
- message for use of overloaded functions on LHS of "." operator.
-
- PR c++/19253
- * parser.c (cp_parser_postfix_expression): Use
- cp_parser_elaborated_type_specifier to handle typename-types in
- functional casts.
- (cp_parser_enclosed_argument_list): Skip ahead to the end of the
- template argument list if the closing ">" is not found.
-
- PR c++/24569
- * pt.c (instantiate_decl): Use cp_finish_decl, not
- finish_static_data_member_decl.
-
-2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
-
- * decl.c (grokfndecl): Remove the setting
- of the return type of the function type
- of main after erroring about must returning
- int.
-
-2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/23229
- * decl.c (grokfndecl): Create a new function type
- after erroring out about main not returning int.
-
-2005-10-28 Josh Conner <jconner@apple.com>
-
- PR c++/22153
- * parser.c (cp_parser_member_declaration): Detect and handle
- a template specialization.
-
-2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/23426
- * decl.c (start_decl): Check that the decl is an
- error_mark_node before getting the type.
- Remove the check for the decl's type being an
- error_mark_node.
-
-2005-10-21 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24260
- * parser.c (cp_parser_init_declarator): Pass attributes to
- grokfield.
-
-2005-10-20 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22618
- * search.c (accessible_p): Check access in the outermost set of
- template parameters.
-
-2005-10-20 Richard Guenther <rguenther@suse.de>
-
- * decl.c (grokdeclarator): Fix ambiguous pedwarn message.
-
-2005-10-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/22293
- * decl.c (grokdeclarator): Reject unqualified destructors in
- friend declarations.
-
-2005-10-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23293
- * pt.c (convert_template_argument): Use canonical type variants in
- template specializations.
-
-2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21383
- * name-lookup.c (arg_assoc): Template args can be null in a
- template-id-expr.
-
- PR c++/22604
- * class.c (update_vtable_entry_for_fn): Don't process invalid
- covariant overriders.
-
- PR c++/23118
- * cp-tree.h (add_method): Add return value.
- * class.c (add_method): Return success indicator.
- * semantics.c (finish_member_declaration): Don't add an invalid
- method to the method list.
-
-2005-10-17 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21908
- * call.c (build_new_method_call): Do not show VTT parameters to
- the user.
-
-2005-10-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23440
- * parser.c (cp_parser_statement): If the parser reached CPP_EOF,
- only complain about missing statement.
-
-2005-10-17 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/24386
- * cp-tree.h (BASELINK_QUALIFIED_P): New.
- * pt.c (tsubst_copy_and_build): <CALL_EXPR case>: Use it.
- * typeck.c (finish_class_member_access_expr): Set it.
-
- PR c++/21353
- * decl.c (check_default_argument): Don't check
- processing_template_decl or uses_template_parms here.
- (grokparms): Only call check_default_argument when not processing
- a template decl.
- * parser.c (cp_parser_late_parsing_default_arg): Call
- check_default_argument when not processing a template decl.
-
-2005-10-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24389
- * decl2.c (mark_used): Use uses_template_parms instead of
- dependent_type_p.
- * init.c (constant_value_1): Handle uninstantiated templates
- specially.
- * pt.c (instantiate_decl): Add sanity check.
-
-2005-10-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22173
- * typeck.c (check_template_keyword): Fix thinko.
-
-2005-10-16 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR c++/23959
- * decl.c (pop_switch): Only call c_do_switch_warnings
- when not processing templates.
-
-2005-10-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22173
- * cp-tree.h (QUALIFIED_NAME_IS_TEMPLATE): New macro.
- (check_template_keyword): New function.
- (finish_id_expression): Change prototoype.
- (finish_qualified_id_expr): Change prototype.
- (build_qualified_name): New function.
- (finish_class_member_access_expr): Change prototype.
- * init.c (build_offset_ref): Use build_qualified_name.
- * mangle.c (write_expression): Likewise.
- * parser.c (cp_parser_primary_expression): Remove qualifying_class
- parameter. Add address_p and template_arg_p. Use
- build_qualified_name.
- (cp_parser_id_expression): Default *template_p to
- template_keyword_p. Check for invalid uses of the template
- keyword.
- (cp_parser_postfix_expression): Eliminate special handling for
- qualified names. Adjust call to cp_parser_primary_expression.
- (cp_parser_postfix_dot_deref_expression): Adjust call to
- cp_parser_id_expression and finish_class_member_access_expr.
- (cp_parser_template_argument_list): Add comment.
- (cp_parser_template_argument): Adjust use of
- cp_parser_primary_expression. Remove call to
- finish_qualified_id_expr.
- (cp_parser_lookup_name): Use build_qualified_name.
- * pt.c (tsubst): Use build_qualified_name.
- (tsubst_qualified_id): Likewise. Adjust call to
- finish_qualified_id_expr.
- (tsubst_copy): Use build_qualified_name.
- (tsubst_copy_and_build): Adjusts call to finish_id_expression and
- finish_class_member_access_expr.
- * semantics.c (finish_non_static_data_member): Use
- build_qualified_name.
- (finish_qualified_id_expr): Add template_p and template_arg_p
- parameters.
- (finish_id_expression): Remove qualifiying_class parameter. Add
- template_p, done, address_p, and template_arg_p. Use
- build_qualified_name. Adjust calls to
- finish_class_member_acess_expr.
- * tree.c (build_qualified_name): New function.
- * typeck.c (check_template_keyword): New function.
- (finish_class_member_access_expr): Add template_p argument. Check
- for invalid uses of the template keyword.
-
-2005-10-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21347
- * class.c (maybe_warn_about_overly_private_class): Lazy
- constructors are public.
-
-2005-10-14 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19565
- * call.c (convert_like_real): Rely on convert_and_check to issue
- warnings about overflow and conversion to unsigned.
- * decl.c (finish_enum): Use the location of the enumerators, not
- the closing brace of the enumeration, when reporting warnings
- about conversions.
- (build_enumerator): Use error_mark_node for erroneous values.
- * typeck2.c (digest_init): Remove reference to "signature pointer"
- from comment.
-
-2005-10-14 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/17796
- * optimize.c (update_cloned_parm): Add FIRST parameter. Use it.
- (maybe_clone_body): Track the first clone.
-
-2005-10-13 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/23984
- * class.c (build_base_path): The vtable is always the first thing
- in the vtt.
-
-2005-10-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20721
- * cp-tree.h (DECL_NONTRIVIALLY_INITIALIZED_P): New macro.
- * decl.c (duplicate_decls): Merge it into new declarations.
- (decl_jump_unsafe): Use it, rather than DECL_INITIAL.
- (cp_finish_decl): Set it, when appropriate.
-
- PR c++/22180
- * call.c (build_new_method_call): Correct pretty-printing of
- destructor names.
- * pt.c (tsubst_qualified_id): Recognize invalid uses of "~T" as an
- identifier.
-
- PR c++/23694
- * decl.c (start_method): Return error_mark_node for errors.
-
- PR c++/23307
- * pt.c (push_template_decl_real): Complain about attempts to
- declare template variables.
-
- PR c++/22352
- * pt.c (tsubst_template_parms): Set processing_template_decl while
- processing the parameters.
- (tsubst_decl): Set processing_template_decl when substituting into
- a TEMPLATE_DECL.
-
- PR c++/22405
- * pt.c (most_specialized_instantiation): Robustify.
-
- PR c++/22464
- * semantics.c (finish_id_expression): Issue errors about uses of
- local variables in containing functions even in templates.
-
-2005-10-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- PR target/21801
- PR target/23589
- * class.c (finish_struct_1): Call
- targetm.cxx.adjust_class_at_definition.
-
-
-2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21592
- * pt.c (build_non_dependent_expr): Don't wrap a COMPONENT_REF
- with already looked up member functions. Assert we're not
- returning a NON_DEPENDENT_EXPR with unknown type.
- * typeck.c (finish_class_member_access_expr): We can get
- non-template-id-expr baselinks. If the lookup finds a baselink,
- remember it even inside templates.
-
- PR c++/23797
- * parser.c (cp_parser_functional_cast): Cope when TYPE is not a
- TYPE_DECL. Use dependent_type_p to check type.
- * pt.c (uses_template_parms_p): Use dependent_type_p for a
- TYPE_DECL.
- (type_dependent_expression_p): Assert we've not been given a
- TYPE_DECL.
-
- PR c++/21117
- * decl.c (check_function_type): Correctly overwrite incomplete
- return type with void type.
- * typeck.c (check_return_expr): If the function's return type is
- void, don't try and convert a return expr.
-
-2005-10-12 David Edelsohn <edelsohn@gnu.org>
-
- PR c++/23730
- * call.c (build_object_call): If BINFO is NULL, bypass
- lookup_fnfields and set fns to NULL_TREE.
-
-2005-10-12 Paolo Bonzini <bonzini@gnu.org>
-
- PR c++/24052
- * error.c (dump_expr): Pass LABEL_DECL to dump_decl. Print
- an ADDR_EXPR of a LABEL_DECL as &&.
-
-2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19964
- * class.c (walk_subobject_offsets): Don't walk error_mark_node.
-
-2005-10-11 Ian Lance Taylor <ian@airs.com>
-
- PR c++/8057
- * cvt.c (convert_to_void): Don't warn about unused values when
- processing a template declaration.
-
-2005-10-11 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21089
- * call.c (convert_like_real): Use decl_constant_value, not
- integral_constant_value.
- * init.c (constant_value_1): New function.
- (integral_constant_value): Use it.
- (decl_constant_value): Likewise.
- * typeck.c (decay_conversion): Use decl_constant_value, not
- integral_constant_value.
-
- PR c++/21369
- * parser.c (cp_parser_elaborated_type_specifier): Don't treat
- class types as templates if the type is not appearing as part of a
- type definition or declaration.
-
-2005-10-10 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24277
- * pt.c (instantiate_decl): Call finish_static_data_member_decl for
- static data members.
-
-2005-10-10 Giovanni Bajo <giovannibajo@gcc.gnu.org>
- Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23437
- * parser.c (cp_parser_template_argument_list): Do not treat
- contents of argument list as part of a constant expression.
-
-2005-10-10 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/24139
- * decl.c (grokdeclarator): Do not require template parameter lists
- for explicitly specialized class.
- * error.c (dump_aggr_type): Do not dump template arguments for
- non-primary specializations.
- (dump_function_name): Likewise.
-
- PR c++/24275
- * pt.c (instantiate_decl): Instantiate the initializer of
- a static data member in the namespace containing the class
- containing the static data member.
-
-2005-10-08 James A. Morrison <phython@gcc.gnu.org>
-
- PR c++/22172
- * parser.c (cp_parser_postfix_expression) <RID_TYPENAME>: Treat nontype
- scopes as nondependent.
-
-2005-10-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * call.c (resolve_args): Remove redundant test.
-
-2005-10-05 Paolo Bonzini <bonzini@gnu.org>
-
- PR tree-optimization/21419
- PR tree-optimization/24146
- PR tree-optimization/24151
-
- * semantics.c (finish_asm_stmt): Call readonly_error if outputs are
- read-only. Set ASM_VOLATILE_P for asms without outputs.
-
-2005-10-05 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/23513
- * call.c (joust): Adjust length count to more_specialized_fn.
- * pt.c (more_specialized_fn): Cope with non-static member vs
- non-member.
-
-2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR middle-end/23125
- * decl.c (make_rtl_for_nonlocal_decl): Use set_user_assembler_name
- instead of change_decl_assembler_name.
-
-2005-10-03 Alexandre Oliva <aoliva@redhat.com>
-
- * error.c (dump_type) <UNKNOWN_TYPE>: Print reworded message.
-
-2005-10-03 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/17775
- * repo.c: Include flags.h.
- (finish_repo): Add -frandom-seed to the arguments.
-
-2005-10-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22621
- * parser.c (cp_parser_template_argument): Don't turn "T::f" into
- "(*this).T::f".
- * pt.c (convert_nontype_argument): Remove ??? comment.
-
- PR c++/23840
- * tree.c (lvalue_p_1): A VA_ARG_EXPR with class type is an lvalue,
- when class rvalues are lvalues.
-
-2005-09-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/16782
- * decl.c (grokdeclarator): Always pedwarn about overqualified
- member names.
-
-2005-09-27 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22147
- * name-lookup.c (maybe_process_template_type_declaration): Don't
- treat forward declarations of classes as templates just because
- we're processing_template_decl.
- * pt.c (tsubst_decl): Clear DECL_TEMPLATE_INFO for friend
- functions.
-
-2005-09-26 Jason Merrill <jason@redhat.com>
-
- PR c++/13764
- * cp-tree.h (FUNCTION_NEEDS_BODY_BLOCK): New macro.
- * name-lookup.c (pushdecl_maybe_friend): Check it.
- * decl.c (begin_function_body): Do nothing if it's false.
- (finish_function_body): Ditto.
- (outer_curly_brace_block): New fn.
- (finish_function): Use it.
-
-2005-09-26 Richard Guenther <rguenther@suse.de>
-
- PR middle-end/15855
- * decl2.c (do_static_destruction): Remove.
- (finish_static_initialization_or_destruction): Likewise.
- (DECL_EFFECTIVE_INIT_PRIORITY): New macro.
- (NEEDS_GUARD_P): Likewise.
- (do_static_initialization): Rename to
- do_static_initialization_or_destruction. Process all
- initializers/destructors and handle common conditionalizing.
- (start_static_initialization_or_destruction): Rename to
- one_static_initialization_or_destruction. Handle only
- decl-specific conditionalizing.
- (cp_finish_file): Call do_static_initialization_or_destruction.
-
-2005-09-22 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/21983
- * class.c (find_final_overrider): Move diagnostic about no unique final
- overrider to...
- (update_vtable_entry_for_fn): ... here.
-
-2005-09-21 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23993
- * init.c (integral_constant_value): Use DECL_INTEGRAL_CONSTANT_VAR_P.
-
-2005-09-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23965
- * call.c (resolve_args): Return error_mark_node on arguments
- whose TREE_TYPE is error_mark_node.
-
-2005-09-20 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/23947
- * rtti.c (get_pseudo_ti_init): Recompute ti pointer after
- get_tinfo_ptr calls.
-
-2005-09-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23914
- * parser.c (cp_parser_enclosed_template_argument_list): Make sure
- skip_evaluation is false when processing template arguments.
-
- PR c++/21514
- * pt.c (check_instantiated_args): Treat uses of anonymous types as
- causing type-deduction failure.
-
-2005-09-15 Jason Merrill <jason@redhat.com>
-
- PR c++/23357
- * cp-tree.def (SIZEOF_EXPR, ALIGNOF_EXPR): Change code class to
- tcc_expression.
-
-2005-09-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23896
- * pt.c (tsubst_aggr_type): Make sure skip_evaluation is false when
- processing template arguments.
-
- * pt.c (check_explicit_instantiation_namespace): Fix typo.
-
- PR c++/13140
- * decl.c (check_class_member_definition_namespace): New function.
- (grokfndecl): Use it.
- (grokvardecl): Likewise.
- (grokdecl): Improve documentation.
- * pt.c (check_explicit_instantiation_namespace): New function.
- (register_specialization): Call check_specialization_namespace
- when replacing an implicitly instantiated function.
- (check_explicit_specialization): Ensure that DECL_CONTEXT is set
- correctly for namespace-scope specializations.
- (do_decl_instantiation): Use
- check_explicit_instantiation_namespace.
- (do_type_instantiation): Likewise.
-
-2005-09-15 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/23725
- * error.c (dump_decl): <USING_DECL case> Use USING_DECL_SCOPE.
-
-2005-09-13 Bastian Blank <waldi@debian.org>
-
- PR c++/16171
- * mangle.c (find_substitution): Do not use special substitutions
- for identifiers not in std::.
-
-2005-09-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23839
- * typeck.c (cxx_mark_addressable): Only check DECL_HARD_REGISTER
- for VAR_DECLs.
-
-2005-09-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23842
- * pt.c (tsubst_default_argument): Do treat default argument
- expressions as occurring in the context of the function called.
-
-2005-09-12 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23841
- * parser.c (cp_parser_primary_expression): Recognize the closing
- ">" of a template-argument-list after a floating-point literal as
- the end of a cast expression.
-
-2005-09-12 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23789
- * cvt.c (perform_qualification_conversions): Don't create
- unnecessary NOP_EXPRs.
- * pt.c (tsubst_template_arg): Use fold_non_dependent_expr.
-
-2005-09-12 Ian Lance Taylor <ian@airs.com>
-
- PR g++/7874
- * cp-tree.h (struct lang_decl_flags): Add hidden_friend_p
- bitfield. Make dummy bitfield one bit smaller.
- (DECL_HIDDEN_FRIEND_P): Define.
- (pushdecl_maybe_friend): Declare.
- (pushdecl_top_level_maybe_friend): Declare.
- * decl.c (duplicate_decls): Add newdecl_is_friend parameter.
- Change prototype and all callers. Add assertion that a
- DECL_ARTIFICIAL FUNCTION_DECL is not DECL_HIDDEN_FRIEND_P. Set
- DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P in duplicated decl if
- appropriate.
- * name-lookup.c (supplement_binding): Don't ignore a
- DECL_HIDDEN_FRIEND_P.
- (pushdecl_maybe_friend): Break out contents of pushdecl. Add
- is_friend parameter. Set DECL_ANTICIPATED and
- DECL_HIDDEN_FRIEND_P for a friend function.
- (pushdecl): Just call pushdecl_maybe_friend.
- (pushdecl_with_scope): Add is_friend parameter. Change prototype
- and all callers.
- (pushdecl_namespace_level): Likewise.
- (push_overloaded_decl): Likewise. Check DECL_HIDDEN_FRIEND_P as
- well as DECL_ANTICIPATED when checking for a builtin.
- (do_nonmember_using_decl): Check DECL_HIDDEN_FRIEND_P as well as
- DECL_ANTICIPATED when checking for a builtin.
- (do_nonmember_using_decl): Likewise.
- (pushdecl_top_level_1): Add is_friend parameter. Change all
- callers.
- (pushdecl_top_level_maybe_friend): New function.
- (remove_hidden_names): New function.
- (struct arg_lookup): Add args field.
- (friend_of_associated_class_p): New static function.
- (arg_assoc_namespace): Ignore hidden functions which are not
- friends of an associated class of some argument.
- (lookup_arg_dependent): Remove hidden functions from list passed
- in. Initialize k.args.
- * name-lookup.h (remove_hidden_names): Declare.
- * friend.c (do_friend): Call pushdecl_maybe_friend instead of
- pushdecl.
- * call.c (add_function_candidate): Change DECL_ANTICIPATED test to
- an assertion, with a check for DECL_HIDDEN_FRIEND_P.
- (build_new_function_call): Add koenig_p parameter. Change
- prototype and callers.
- * pt.c (register_specialization): Add is_friend parameter. Change
- all callers.
- (push_template_decl_real): Change is_friend parameter to bool.
- Change prototype and all callers.
- (tsubst_friend_class): Call pushdecl_top_level_maybe_friend
- instead of pushdecl_top_level.
-
-2005-09-11 Richard Henderson <rth@redhat.com>
-
- * decl2.c (build_anon_union_vars): Copy attributes from the base addr.
- * pt.c (tsubst_decl): Substitute in DECL_VALUE_EXPR.
-
-2005-09-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * parser.c (cp_parser_translation_unit): Simplify. The while-block
- was actually executed at most once.
-
-2005-09-09 Richard Henderson <rth@redhat.com>
-
- PR debug/20998
- * cp-tree.def (ALIAS_DECL): Remove.
- * cp-lang.c (cp_init_ts): Remove support for it.
- * error.c (dump_decl): Likewise.
- * name-lookup.c (pushdecl): Likewise.
- * semantics.c (finish_id_expression): Likewise.
- * decl2.c (build_anon_union_vars): Use a VAR_DECL with
- DECL_VALUE_EXPR instead.
-
-2005-09-09 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22252
- * decl.c (start_preparsed_function): Do not pay attention to
- #pragma interface for implicitly-defined methods.
- * decl2.c (cp_finish_file): Do not complain about uses of inline
- functions that have bodies, even if we decided not to emit the
- body in this translation unit.
- * semantics.c (note_decl_for_pch): Do not mess with linkage.
- (expand_or_defer_fn): Make inline, non-template functions COMDAT
- at this point.
-
-2005-09-08 Richard Henderson <rth@redhat.com>
-
- PR debug/23190
- * decl.c (wrapup_globals_for_namespace): Call
- emit_debug_global_declarations.
- * decl2.c (cp_finish_file): Likewise.
-
-2005-09-08 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23691
- * decl2.c (mark_used): Instantiate static data members initialized
- by constants, even in a template.
-
-2005-09-08 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR obj-c++/16816
- * parser.c (cp_parser_objc_selector_expression): Treat CPP_SCOPE as
- two CPP_COLON.
-
-2005-09-07 Richard Guenther <rguenther@suse.de>
-
- * cp-gimplify.c (cp_gimplify_expr): Create empty CONSTRUCTOR
- for EMPTY_CLASS_EXPR.
-
-2005-09-06 Jakub Jelinek <jakub@redhat.com>
-
- PR c/23075
- * typeck.c (check_return_expr): Add no_warning argument. Set
- *no_warning to true if "return-statement with no value, in function
- returning" warning has been issued.
- * cp-tree.h (check_return_expr): Adjust prototype.
- * semantics.c (finish_return_stmt): Set TREE_NO_WARNING if
- check_return_expr set *no_warning to true.
-
-2005-09-06 Mark Mitchell <mark@codesourcery.com>
-
- * cp-tree.h (rvalue): New function.
- * call.c (build_conditional_expr): Use it.
- * init.c (build_new_1): Likewise.
- * rtti.c (build_dynamic_cast_1): Likewise.
- * tree.c (rvalue): New function.
- * typeck.c (build_unary_op): Use it.
- (build_static_cast_1): Likewise.
-
- PR c++/9782
- * init.c (build_new_1): Make sure the entire array type is
- complete, not just its element types.
-
-2005-09-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * decl.c (check_elaborated_type_specifier): Remove redundant check.
-
-2005-09-06 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/23056
- * typeck.c (ignore_overflows): New helper function.
- (build_static_cast_1): Use it.
-
-2005-09-06 Kazu Hirata <kazu@codesourcery.com>
-
- * cp-tree.h, decl.c, decl2.c, semantics.c: Fix comment typos.
- Follow spelling conventions.
-
-2005-09-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23667
- * pt.c (tsubst_decl): Clear DECL_TEMPLATE_INSTANTIATED when
- copying a VAR_DECL.
-
-2005-09-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21440
- * semantics.c (finish_stmt_expr_expr): Add an explicit
- initialization to the last statement in the statement-expression.
- * (finish_stmt_expr): Adjust accordingly.
-
-2005-09-03 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23699
- * decl2.c (mark_used): Always instantiate static data members
- initialized by constant expressions.
- * pt.c (instantiate_decl): Instantiate the initializers for static
- data members initialized by constant expressions.
-
- PR c++/21687
- * semantics.c (expand_or_defer_fn): Do not call ggc_collect when
- finishing processing for a template function in a local class.
- Revert:
- 2005-09-02 Mark Mitchell <mark@codesourcery.com>
- * parser.c (cp_parser_class_specifier): Push/pop GC contexts
- around functions in local classes.
-
-2005-09-02 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21687
- * parser.c (cp_parser_class_specifier): Push/pop GC contexts
- around functions in local classes.
-
-2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR obj-c++/23640
- * decl2.c (cp_finish_file): If this is obj-c++ and we need a static
- init, call generate_ctor_or_dtor_function.
-
-2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/13377
- * parser.c (cp_parser_lookup_name): Pass LOOKUP_COMPLAIN to
- lookup_name_real on final parse.
-
-2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23639
- * semantics.c (qualified_name_lookup_error): Do not complain again
- on invalid scope.
-
-2005-08-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23586
- * parser.c (cp_parser_namespace_name): Move diagnostic for
- invalid namespace-name to here from ...
- * name-lookup.c (do_namespace_alias): ... here and ...
- (do_using_directive): ... here. Remove dead code.
-
-2005-08-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/23099
- * cp-tree.h (saved_scope): Add skip_evaluation.
- * decl.c (start_decl): Use DECL_INITIALIZED_IN_CLASS_P, not
- DECL_INITIAL, to determine whether or not a static data member was
- initialized in the class-specifier.
- (cp_finish_decl): Add comment.
- * init.c (integral_constant_value): Subtitute into the
- initializers for static data members in templates.
- * name-lookup.c (push_to_top_level): Save skip_evaluation.
- (pop_from_top_level): Restore it.
- * pt.c (instantiate_class_template): Do not substitute into the
- intializers of static data members when instantiating a class.
- (regenerate_decl_from_template): Simplify.
- (instantiate_decl): Tidy. Substitute into the initializer for a
- static data member even when the definition of the data member is
- not available.
-
-2005-08-26 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19004
- * pt.c (uses_template_parms): Handle IDENTIFIER_NODE.
- (type_dependent_expression_p): Allow BASELINKs whose associated
- functions are simply a FUNCTION_DECL.
-
- PR c++/23491
- * cp-tree.h (build_vec_init): Adjust prototype.
- * init.c (perform_member_init): Adjust call to build_vec_init.
- (build_aggr_init): Likewise.
- (build_new_1): Do not call build_default_init for array types.
- (build_vec_init): Add explicit_default_init_p parameter. Perform
- default initialization of vector elements when set.
- * typeck.c (build_modify_expr): Adjust call to build_vec_init.
-
-2005-08-25 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20817
- * typeck.c (build_x_unary_op): Make sure OFFSET_REF is not for a
- ->*.
-
-2005-08-24 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/22454
- * parser.c (cp_lexer_peek_nth_token): Relax assert.
-
-2005-08-23 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/23044
- * pt.c (tsubst_qualified_id): A SCOPE_REF can still remain.
-
-2005-08-22 James E Wilson <wilson@specifix.com>
-
- PR tree-optimization/23426
- * decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for
- array size check.
-
-2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/22233
- * pt.c (push_template_decl_real): Return error_mark_node if the
- number of template parameters does not match previous definition.
-
-2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23089
- * decl.c (require_complete_types_for_parms): Mark incomplete types
- as invalid.
-
-2005-08-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * parser.c (cp_parser_nth_token_starts_template_argument_list_p):
- Fix typo in leading comment.
-
-2005-08-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * name-lookup.c, ptree.c: Delete HOST_PTR_PRINTF.
-
-2005-08-15 Fariborz Jahanian <fjahanian@apple.com>
-
- * cp-tree.h (can_convert_arg, fn_type_unification): New argument.
- * call.c (add_template_candidate_real): Pass down 'flags' to
- fn_type_unification.
- (can_convert_arg): New 'flags' argument. Pass it to call to
- implicit_conversion instead of LOOKUP_NORMAL.
- (can_convert): Add LOOKUP_NORMAL to call to can_convert_arg.
- * class.c (resolve_address_of_overloaded_function): Ditto.
- (resolve_address_of_overloaded_function): Ditto.
- * decl.c (reshape_init, check_default_argument): Ditto.
- * typeck.c (build_ptrmemfunc): Ditto.
- * pt.c (type_unification_real): Add 'flags' argument.
- (fn_type_unification): Pass 'flags' to type_unification_real.
- (type_unification_real): Pass new 'flags' argument to call to
- can_convert_arg.
-
-2005-08-12 Giovanni Bajo <giovannibajo@libero.it>
- Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21799
- PR c++/8271
- * pt.c (unify) <METHOD_TYPE>: Check this-pointer cv-qualifiers
- explicitly.
-
-2005-08-12 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21799
- Revert my 2005-07-08 patch
- * pt.c (type_unification_real): Remove is_method_argument and
- assoicated checks.
- (fn_type_unification, unify): Adjust type_unification_real calls.
-
-2005-08-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23266
- * decl2.c (grokfield): Check that method is not static before
- marking it as pure.
-
-2005-08-11 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/23219
- * name-lookup.c (pushtag): Process the template type before
- altering the identifier lookup fields. Remove unreachable code
- creating an empty stub decl.
-
-2005-08-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/20646
- * decl.c (grokdeclarator): Reset storage_class after error.
-
-2005-08-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/22508
- * init.c (build_new_1): Check for empty candidate list.
-
-2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/23191
- * pt.c (tsubst) <case METHOD_TYPE>: Check for error_mark_node
- before calling build_exception_variant.
-
-2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/19498
- * pt.c (tsubst_decl) <case TEMPLATE_DECL>: Return ERROR_MARK_NODE
- if substitution of template args did not succeed.
-
-2005-08-06 Michael Matz <matz@suse.de>
-
- * method.c (use_thunk): Call init_insn_lengths.
-
-2005-08-05 James A. Morrison <phython@gcc.gnu.org>
-
- PR c++/22514
- * name-lookup.c (cp_emit_debug_info_for_using): Do nothing if
- sorrycount or errorcount are nonzero.
-
-2005-08-05 Mark Mitchell <mark@codesourcery.com>
-
- * name-lookup.c (pushtag): Remove accidental commit from:
- 2004-12-21 Mark Mitchell <mark@codesourcery.com>
- PR c++/19063
- * decl.c (grokdeclarator): Return error_mark_node, not
- void_type_node, to indicate errors.
- * parser.c (cp_parser_template_parameter_list): Robustify.
- (cp_parser_template_parameter): Likewise.
-
-2005-08-01 Kazu Hirata <kazu@codesourcery.com>
-
- * class.c, decl.c, name-lookup.c, pt.c, typeck.c, typeck2.c:
- Fix comment typos.
-
-2005-07-29 Kazu Hirata <kazu@codesourcery.com>
-
- * method.c: Fix a comment typo.
-
-2005-07-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22545
- * call.c (add_builtin_candidate): Adjust for changes in
- representation of pointer-to-member types.
-
-2005-07-28 Mike Stump <mrs@apple.com>
-
- * pt.c (check_explicit_specialization): Add visibility logic.
- (lookup_template_class): Likewise.
- (instantiate_class_template): Likewise.
-
-2005-07-27 Devang Patel <dpatel@apple.com>
-
- * name-lookup.c (pushtag): Do no set DECL_IGNORED_P bit.
-
-2005-07-25 Ian Lance Taylor <ian@airs.com>
-
- * ptree.c (cxx_print_identifier): Print a leading space if the
- indent level is 0.
-
-2005-07-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * call.c (convert_for_arg_passing): Check function pointers when
- -Wmissing-format-attribute is activated.
- * typeck.c (convert_for_assignment): Likewise.
-
-2005-07-22 Manfred Hollstein <mh@suse.com>
-
- * parser.c (cp_parser_declaration): Fix unitialised warnings.
-
-2005-07-21 Andrew Pinski <pinskia@physics.uc.edu>
-
- * class.c (build_base_path): Fix typo.
-
-2005-07-21 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/22358
- * class.c (build_base_path): Convert BINFO_OFFSET to the correct type.
-
-2005-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * call.c: Fix comment typo(s).
- * cxx-pretty-print.h: Likewise.
- * name-lookup.c: Likewise.
- * parser.c: Likewise.
-
-2005-07-20 Douglas Gregor <doug.gregor@gmail.com>
-
- PR c++/2922
- * semantics.c (perform_koenig_lookup): For dependent calls, just
- return the set of functions we've found so far. Later, it will be
- augmented by those found through argument-dependent lookup.
- * name-lookup.c (lookup_arg_dependent): Implement DR 164 by removing
- the optimization that skips namespaces where the functions were
- originally found.
-
-2005-07-20 Giovanni Bajo <giovannibajo@libero.it>
-
- Make CONSTRUCTOR use VEC to store initializers.
- * call.c (convert_default_arg): Update call to digest_init.
- * class.c (dump_class_hierarchy, dump_array): Update to cope with
- VEC in CONSTRUCTOR_ELTS.
- * cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
- (finish_compound_literal, digest_init): Update declaration.
- * decl.c (struct reshape_iter): New data type.
- (reshape_init_array): Rename to...
- (reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
- (reshape_init): Rewrite from scratch. Split parts into...
- (reshape_init_array, reshape_init_vector, reshape_init_class,
- reshape_init_r): New functions.
- (check_initializer): Update call to reshape_init. Remove obsolete
- code.
- (initialize_artificial_var, cp_complete_array_type): Update to cope
- with VEC in CONSTRUCTOR_ELTS.
- * decl2.c (grokfield): Update calls to digest_init.
- (mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
- * error.c (dump_expr_init_vec): New function.
- (dump_expr): Use dump_expr_init_vec.
- * init.c (build_zero_init, build_vec_init): Update to cope with VEC
- in CONSTRUCTOR_ELTS.
- (expand_default_init): Update call to digest_init.
- * parser.c (cp_parser_postfix_expression): Use a VEC for the
- initializers.
- (cp_parser_initializer_list): Build a VEC of initializers.
- * pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
- in CONSTRUCTOR_ELTS.
- * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
- ptm_initializer, class_initializer, get_pseudo_ti_init): Use
- build_constructor_from_list instead of build_constructor.
- * semantics.c (finish_compound_literal): Update call to digest_init.
- * tree.c (stabilize_init): Update to cope with VEC in
- CONSTRUCTOR_ELTS.
- * typeck.c (build_ptrmemfunc1): Likewise.
- * typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
- Likewise.
- (store_init_value): Use build_constructor_from_list and update call
- to digest_init.
- (digest_init): Rewrite.
- (process_init_constructor): Rewrite from scratch. Split into...
- (process_init_constructor_array, picflag_from_initializer,
- process_init_constructor_record, process_init_constructor_union):
- New functions.
- (PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
- New macros.
- (build_functional_cast): Use build_constructor_from_list instead of
- build_constructor.
-
-2005-07-18 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22263
- * cp-tree.h (instantiate_decl): Change prototype.
- * decl2.c (mark_used): Adjust accordingly.
- * pt.c (do_decl_instantiation): Likewise.
- (instantiate_class_member): Likewise.
- (instantiate_decl): Rename undefined_ok as expl_inst_class_mem_p.
- Clear DECL_INTERFACE_KNOWN for an explicitly instantiated template
- that has no definition available.
- (instantiate_pending_templates): Adjust call to instantiate_decl.
-
-2005-07-17 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22139
- * cp-tree.h (DECL_TEMPLATE_INFO): Improve documentation.
- * decl.c (duplicate_decls): Re-register template specializations
- for functions that have DECL_TEMLPLATE_INFO, even if they do not
- have DECL_TEMPLATE_INSTANTIATION set.
-
-2005-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * call.c (diagnostic_fn_t): New.
- (build_temp, convert_like_real): Use diagnostic_fn_t.
-
-2005-07-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22204
- * repo.c (repo_emit_p): Robustify.
-
-2005-07-14 Daniel Berlin <dberlin@dberlin.org>
-
- Fix PR c++/22452
- * tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL.
-
-2005-07-15 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/22132
- * call.c (implicit_conversion): Add c_cast_p parameter.
- (standard_conversion): Likewise. Allow conversions between
- differently-qualified pointer types when performing a C-style
- cast.
- (add_function_candidate): Adjust callee.
- (build_builtin_candidate): Likewise.
- (build_user_type_conversion_1): Likewise.
- (conditional_conversion): Likewise.
- (can_convert_arg): Likewise.
- (can_convert_arg_bad): Likewise.
- (perform_implicit_conversion): Likewise.
- * cp-tree.h (comp_ptr_ttypes_const): Declare.
- * typeck.c (comp_ptr_ttypes_const): Give it external linkage.
- Return bool.
-
-2005-07-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
- Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20172
- * pt.c (tsubst_template_parms): Check for invalid non-type
- parameters.
-
-2005-07-09 Andrew Pinski <pinskia@physics.uc.edu>
-
- * cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup,
- decl_shadowed_for_var_insert): Move over to cp-objcp-common.c.
- (cp_init_ts): Call init_shadowed_var_for_decl.
- Remove include of gt-cp-cp-lang.h.
- * cp-objcp-common.c (shadowed_var_for_decl,
- decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from
- cp-lang.c.
- (init_shadowed_var_for_decl): New function to initialize
- shadowed_var_for_decl.
- Include gt-cp-cp-objcp-common.h.
- * Make-lang.in (gt-cp-lang.h): Remove.
- (gt-cp-cp-objcp-common.h): Add.
- (cp/cp-lang.o): Remove dependancy on gt-cp-lang.h.
- (cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h.
- * config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c.
- * cp-tree (init_shadowed_var_for_decl): Add prototype.
-
-2005-07-08 Daniel Berlin <dberlin@dberlin.org>
-
- * Make-lang.in: Add gt-cp-lang.h.
- (cp-lang.o): Ditto.
- * class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
- the field.
- * config-lang.in: Add cp-lang.c to gtfiles.
- * cp-lang.c: Include hashtab.h.
- (cp_init_ts): New function.
- (LANG_HOOK_INIT_TS): Use macro.
- (decl_shadowed_for_var_lookup): New function.
- (decl_shadowed_for_var_insert): Ditto.
- * cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
- (NON_THUNK_FUNCTION_CHECK): Ditto.
- (DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
- (DECL_INIT_PRIORITY): Ditto.
- (DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
- (DECL_SHADOWED_FOR_VAR): Use hashtable.
- (SET_DECL_SHADOWED_FOR_VAR): Ditto.
- * decl.c (duplicate_decls): Update for new/updated structures.
- (poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
- * decl2.c (start_static_initialization_or_destruction): Deal with
- priority.
- * pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
- SET_DECL_RTL.
- * tree.c (handle_init_priority_attribute): Handle priority.
-
-2005-07-08 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21799
- * pt.c (type_unification_real): Add is_method argument. Use it
- for this pointer unification.
- (fn_type_unification): Adjust type_unification_real call.
- (unify): Likewise.
-
-2005-07-07 Nathan Sidwell <nathan@codesourcery.com>
-
- * pt.c (type_unification_real): Remove allow_incomplete argument.
- Remove unreachable code.
- (fn_type_unification): Adjust call to type_unification_real.
- (unify): Likewise.
-
-2005-07-05 Paolo Bonzini <bonzini@gnu.org>
-
- * Makefile.in (class.o, decl2.o): Adjust dependencies.
- * class.c: Include tree-dump.h.
- * decl2.c: Include tree-dump.h.
-
-2005-07-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * dump.c: Use dump_string_field.
-
-2005-07-03 Joseph S. Myers <joseph@codesourcery.com>
-
- * cp-tree.h (GCC_DIAG_STYLE): #undef before defining. Change
- minimum GCC version for format checking to 4.1.
-
-2005-07-02 Kazu Hirata <kazu@codesourcery.com>
-
- * Make-lang.in (cc1plus-checksum.c): Use
- build/genchecksum$(build_exeext), not build/genchecksum$(exeext).
-
-2005-07-02 Joseph S. Myers <joseph@codesourcery.com>
-
- * name-lookup.c, parser.c: Use %q, %< and %> to quote in
- diagnostics.
-
-2005-07-02 Zack Weinberg <zack@codesourcery.com>
- Joseph S. Myers <joseph@codesourcery.com>
-
- * error.c (location_of): Add comment.
- (locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
- * cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
- * call.c, class.c, decl.c, decl2.c, friend.c, init.c,
- name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
- typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
- or cp_pedwarn_at. Mark up some diagnostic strings with N_.
-
-2005-06-30 Daniel Berlin <dberlin@dberlin.org>
-
- * decl.c (require_complete_types_for_parms): Call relayout_decl
- instead of layout_decl.
-
-2005-06-30 Zack Weinberg <zack@codesourcery.com>
- Jakub Jelinek <jakub@redhat.com>
-
- * cp-lang.c: No need to include cxx-pretty-print.h.
- * error.c (cp_printer): Update signature. No need to process
- flags.
- (print_instantiation_partial_context): Output last newline
- with pp_base_newline.
- * Make-lang.in: Update dependencies.
-
-2005-06-30 Steven Bosscher <stevenb@suse.de>
-
- * decl.c (start_decl): Replace DECL_THREAD_LOCAL with
- DECL_THREAD_LOCAL_P.
- (cp_finish_decl): Likewise.
- (grokvardecl): Set the default DECL_TLS_MODEL here.
-
-2005-06-28 Joseph S. Myers <joseph@codesourcery.com>
-
- * cvt.c (ocp_convert): Use invalid_conversion hook.
- * typeck.c (build_binary_op): Use invalid_binary_op hook.
- (build_unary_op): Use invalid_unary_op hook.
-
-2005-06-28 Paul Brook <paul@codesourcery.com>
-
- * Make-lang.in (cp/except.o): Depend on $(TARGET_H)
- * except.c: Include target.h.
- (init_exception_processing): Initialize unwind_resume_libfunc.
- * doc/tm.texi: Document TARGET_ASM_TTYPE
-
-2005-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * call.c (build_over_call): Pass in named argument list to
- `check_function_arguments'.
- * typeck.c (build_function_call): Likewise.
-
-2005-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * cp-tree.h (lang_check_failed): Add noreturn attribute.
-
-2005-06-25 Kelley Cook <kcook@gcc.gnu.org>
-
- * all files: Update FSF address in copyright headers.
-
-2005-06-23 Jason Merrill <jason@redhat.com>
-
- PR c++/19317
- * semantics.c (simplify_aggr_init_expr): Use
- CALL_EXPR_RETURN_SLOT_OPT, not CALL_EXPR_HAS_RETURN_SLOT_ADDR.
-
-2005-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * pt.c (register_specialization): Remove superfluous assertion.
-
-2005-06-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * call.c (convert_like_real): Add format attribute.
- * typeck.c (check_for_casting_away_constness,
- build_static_cast_1): Likewise.
- * typeck2.c (readonly_error, cxx_incomplete_type_diagnostic):
- Likewise.
-
-2005-06-17 Geoffrey Keating <geoffk@apple.com>
-
- PR c++/17413
- * pt.c (type_unification_real): Apply template type deduction even
- to procedure parameters that are not dependent on a template
- parameter.
-
-2005-06-16 Nathan Sidwell <nathan@codesourcery.com>
-
- * rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might
- change.
- (create_pseudo_type_info): First parameter is an int.
-
-2005-06-15 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20678
- * error.c (dump_expr) <COMPONENT_REF case>: Check DECL_NAME is not
- null.
-
- * Make-lang.in: Reformat some long lines.
- (gt-cp-rtti.h): New target.
- (cp/rtti.o): Add dependency.
- * config-lang.in (gtfiles): Add cp/rtti.c.
- * cp-tree.h (CPTI_TI_DESC_TYPE, CPTI_BLTN_DESC_TYPE,
- CPTI_PTR_DESC_TYPE, CPTI_ARY_DESC_TYPE, CPTI_FUNC_DESC_TYPE,
- CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE,
- CPTI_SI_CLASS_DESC_TYPE, CPTI_VMI_CLASS_DESC_TYPE,
- CPTI_PTM_DESC_TYPE, CPTI_BASE_DESC_TYPE): Remove.
- (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node,
- ary_desc_type_node, func_desc_type_node, enum_desc_type_node,
- class_desc_type_node, si_class_desc_type_node,
- vmi_class_desc_type_node, ptm_desc_type_node,
- base_desc_type_node): Remove.
- * decl.c: Adjust documentation of global trees.
- * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL,
- TINFO_REAL_NAME): Remove.
- (struct tinfo_s): New.
- (enum tinfo_kind): New.
- (tinfo_descs): New.
- (get_tinfo_decl): Adjust use of tinfo descriptor.
- (tinfo_base_init, generic_initializer, ptr_initializer,
- ptm_initializer, class_initializer): Likewise.
- (get_pseudo_ti_init): Take descriptor index. Adjust.
- (create_pseudo_type_info): Likewise.
- (get_pseudo_ti_desc): Return descriptor index. Adjust.
- (create_tinfo_types): Adjust use of create_pseudo_type_info.
- (emit_tinfo_decl): Adjust use of tinfo descriptor.
-
-2005-06-14 Roger Sayle <roger@eyesopen.com>
-
- * decl.c (grokdeclarator): Only check TREE_OVERFLOW on INTEGER_CST.
-
-2005-06-13 Geoffrey Keating <geoffk@apple.com>
-
- * Make-lang.in (c++.install-man): Doesn't really depend on installdirs.
- (rule for installing g++.1 manpage): Does depend on installdirs.
-
-2005-06-13 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20789
- * decl.c (cp_finish_decl): Clear runtime runtime initialization if
- in-class decl's initializer is bad.
-
- PR c++/21929
- * parser.c (struct cp_parser): Document that scope could be
- error_mark.
- (cp_parser_diagnose_invalid_type_name): Cope with error_mark for
- scope.
- (cp_parser_nested_name_specifier): Return NULL_TREE on error.
- (cp_parser_postfix_expression): Deal with null or error_mark
- scope.
- (cp_parser_elaborated_type_specifier): Adjust
- cp_parser_nested_name_specifier call.
-
- * parser (cp_parser_skip_to_end_of_block_or_statement): Cleanup.
-
-2005-06-12 Roger Sayle <roger@eyesopen.com>
-
- PR c++/21930
- * error.c (dump_expr): UNARY_PLUS_EXPR need not handle void types.
- Treat CONVERT_EXPR identically to NOP_EXPR.
-
-2005-06-10 Aldy Hernandez <aldyh@redhat.com>
-
- PR c++/10611
- * cvt.c (build_expr_type_conversion): Same.
- * typeck.c (build_binary_op): Handle vectors.
- (common_type): Same.
- (type_after_usual_arithmetic_conversions): Same.
-
-2005-06-08 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19497
- * cp-tree.def (USING_DECL): Update documentation.
- * cp-tree.h (DECL_DEPENDENT_P): New.
- (USING_DECL_DECLS, USING_DECL_SCOPE): New.
- * class.c (handle_using_decl): Move most of the processing to ...
- * name-lookup.c (do_class_using_decl): ... here. Make stricter.
- (push_using_decl): Use USING_DECL_SCOPE.
- (cp_emit_debug_info_for_using): Make extern.
- * cxx-pretty-print.c (pp_cxx_statement) <USING_DECL case>: Adjust.
- * name-lookup.h (cp_emit_debug_info_for_using): Declare.
- * pt.c (tsubst_decl) <USING_DECL case>: Use do_class_using_decl
- when tsubsting.
- (tsubst_expr): Use USING_DECL_SCOPE.
- * search.c (lookup_field_1): Use DECL_DEPENDENT_P.
- * semantics.c (finish_member_declaration): Likewise.
-
-2005-06-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/19894
- * pt.c (tsubst): Reject pointer-to-member of type void.
-
- PR c++/20563
- * parser.c (cp_parser_label_declaration): Deal with invalid/missing
- identifiers.
-
-2005-06-07 Nathan Sidwell <nathan@codesourcery.com>
-
- * cp-tree.def (DEFAULT_ARG): Adjust documentation.
- * cp-tree.h (DEFARG_INSTANTIATIONS): New.
- (struct tree_default_arg): Add instantiations member.
- * parser.c (cp_parser_late_parsing_default_args): Adjust to use a
- VEC.
- * pt.c (tsubst_arg_types): Likewise.
-
- * parser.c (cp_parser_late_parsing_default_args): Fix overeager
- assert in previous patch.
-
-2005-06-06 Jakub Jelinek <jakub@redhat.com>
-
- * error.c (locate_error): Use gmsgid instead of msgid for argument
- name.
- (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
-
-2005-06-06 Nathan Sidwell <nathan@codesourcery.com>
-
- PR 21903
- * cp-tree.def (DEFAULT_ARG): Document TREE_CHAIN use.
- * parser.c (cp_parser_late_parsing_default_args): Propagate parsed
- argument to any early instantiations.
- * pt.c (tsubst_arg_types): Chain early instantiation of default arg.
-
- PR c++/20637
- * cp-tree.h (add_method): Add using_decl parameter.
- * class.c (add_method): Add using_decl parameter. Adjust error
- messages.
- (handle_using_decl): Pass the using decl to add_method.
- (clone_function_decl): Adjust add_member calls.
- * decl2.c (check_classfn): Likewise.
- * method.c (lazily_declare_fn): Likewise.
- * semantics.c (finish_member_declaration): Likewise.
-
- * method.c (synthesize_method): Use inform, not warning.
-
-2005-06-06 Hans-Peter Nilsson <hp@axis.se>
-
- * config-lang.in (target_libs): Remove target-gperf.
-
-2005-06-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21619
- * cp-tree.h (DECL_IS_BUILTIN_CONSTANT_P): New macro.
- * parser.c (cp_parser_postfix_expression): Allow non-constant
- expressions as arguments to __builtin_constant_p.
- * tree.c (builtin_valid_in_constant_expr_p): Use
- DECL_IS_BUILTIN_CONSTANT_P.
-
-2005-06-03 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21853
- * typeck.c (casts_away_constness_r): Do not drop cv-qualifiers on
- the pointed-to type for a pointer-to-member.
-
- PR c++/21336
- * cp-tree.h (grok_op_properties): Remove friendp parameter.
- * decl.c (grokfndecl): Adjust call.
- (grok_op_properties): Determine the class of which the function is
- a member by looking at its DECL_CONTEXT, not current_class_type.
- * pt.c (tsubst_decl): Adjust call to grok_op_properties.
-
-2005-06-02 Nathan Sidwell <nathan@codesourcery.com>
-
- * method.c (synthesize_method): Add addtional arg to warning call.
-
- PR c++/21280
- * Make-lang.in (method.o): Add diagnostic.h
- * decl.c (start_preparsed_function): Use decl's location for file
- info.
- * decl2.c (cp_finish_file): Set input_location before synthesizing
- a function.
- (mark_used): When deferring a synthesized function, save current
- location. Do not set function's location when actually
- synthesizing it.
- * method.c: #include diagnostic.h.
- (synthesize_method): Set the functions source location. Show
- needed location if errors are emitted.
-
- * decl.c (start_decl): Simplify specialization handling. Remove
- unneeded CLASSTYPE_TEMPLATE_INSTANTIATION check.
- * mangle.c (discriminator_for_local_entity): Use VEC_index.
-
- PR c++/20350
- * decl.c (duplicate_decls): Copy all of DECL_USE_TEMPLATE.
-
- PR c++/21151
- * name-lookup.c (pushtag): Push local class even in a template.
-
-2005-05-31 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21165
- * init.c (integral_constant_value): Check the type of the
- initializer, not the decl.
-
-2005-05-30 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21784
- * name-lookup.c (do_nonmember_using_decl): Ignore builtin
- functions, even when the used name is not a function.
-
-2005-05-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * operators.def, optimize.c: Update copyright.
-
-2005-05-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21210
- * call.c (standard_conversion): Permit conversions to complex
- types if conversion to the corresponding scalar type would be
- permitted.
-
- PR c++/21340
- * method.c (implicitly_declare_fn): Clear processing_template_decl
- when generating implicit declaration.
-
-2005-05-27 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21614
- * typeck.c (get_member_function_from_ptrfunc): Do not attempt
- conversions to base classes of incomplete types.
-
-2005-05-27 Ian Lance Taylor <ian@airs.com>
-
- * semantics.c (add_stmt): Add C++ frontend specific version.
- * cp-tree.h (STMT_IS_FULL_EXPR_P): Define.
- (stmts_are_full_exprs_p): Declare.
-
-2005-05-27 Roger Sayle <roger@eyesopen.com>
- Giovanni Bajo <giovannibajo@gcc.gnu.org>
-
- * cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.
- * parser.c (cp_parser_unary_expression): Use UNARY_PLUS_EXPR instead
- of CONVERT_EXPR.
- (cp_parser_unary_expression): Likewise.
- * typeck.c (build_unary_op): Likewise.
- * call.c (add_builtin_candidate, build_new_op): Likewise.
- * error.c (dump_expr): Likewise.
- * pt.c (tsubst_copy, tsubst_copy_and_build): Likewise.
- * decl.c (ambi_op_p, grok_op_properties): Likewise.
- * dump.c (dump_op): Likewise.
- * lex.c (init_operators): Likewise.
- * operators.def ("+"): Likewise.
- * cp-gimplify.c (cp_gimplify_expr): Handle UNARY_PLUS_EXPR like a
- conversion, if the result and argument types differ.
- * tree.c (fold_if_not_in_template): Fold UNARY_PLUS_EXPR much
- like a NOP_EXPR when !processing_template_decl.
-
- * cxx-pretty-print.c (pp_cxx_cast_expression): Prototype.
- (pp_cxx_unary_expression): Handle new UNARY_PLUS_EXPR tree code.
-
-2005-05-27 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/21455
- * typeck.c (get_delta_difference): Cope with incomplete but equal
- classes. Reorder if.
-
- PR c++/21681
- * parser.c (cp_parser_late_parsing_for_member): Disable access
- checking for template functions.
-
-2005-05-26 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/21768
- * pt.c (redeclare_class_template): Change error message according
- to coding conventions.
-
-2005-05-26 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * call.c (build_op_delete_call): Fix quoting in error message.
-
-2005-05-25 Richard Henderson <rth@redhat.com>
-
- PR libgcj/21692
- * cp-tree.h (make_alias_for): Declare.
- * decl2.c (build_java_method_aliases): New.
- (cp_finish_file): Call it.
- * method.c (make_alias_for): Split out from ...
- (make_alias_for_thunk): ... here.
-
-2005-05-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/21686
- * semantics.c (finish_id_expression): Fix quoting in error message.
-
-2005-05-25 DJ Delorie <dj@redhat.com>
-
- * decl.c (duplicate_decls): Move warning control from if() to
- warning(OPT_*).
- * name-lookup.c (parse_using_directive): Likewise.
- * parser.c (cp_parser_elaborated_type_specifier): Likewise.
- (cp_parser_init_declarator): Likewise.
- * tree.c (handle_com_interface_attribute): Likewise.
-
-2005-05-24 Ziemowit Laski <zlaski@apple.com>
-
- * class.c (layout_class_type): Do not issue C++ ABI warnings
- for ObjC structs.
- * decl.c (objc_mark_locals_volatile): Streamline by calling
- objc_volatilize_decl().
- * parser.c (cp_parser_objc_message_expression): Allow simple
- type specifiers (instead of merely type names) as message
- receivers.
- * pt.c (template_args_equal): Do not call objc_comptypes().
- * typeck.c (composite_pointer_type): If both pointers are
- ObjC-esque, arbitrarily choose the first; do not call
- objc_comptypes().
- (comptypes): Do not call objc_comptypes().
- (convert_for_assignment): Call objc_compare_types().
- (comp_ptr_ttypes_real): Call objc_type_quals_match() before
- concluding that types do not match.
-
-2005-05-24 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/21645
- * optimize.c (update_cloned_parm): Copy the TYPE also from the
- original one.
-
-2005-05-19 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/21495
- * decl.c (grokdeclarator): Fix "storage class specified for"
- error reporting.
-
-2005-05-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * parser.c: Fix comment typos.
-
-2005-05-18 Geoffrey Keating <geoffk@apple.com>
-
- * Make-lang.in (cc1plus-dummy): New.
- (cc1plus-checksum.c): New.
- (cc1plus-checksum.o): New.
- (cc1plus): Add cc1plus-checksum.o.
-
-2005-05-17 H.J. Lu <hongjiu.lu@intel.com>
-
- PR C++/19664
- * decl2.c (determine_visibility): Don't set visibility to
- hidden if it has been set explicitly by user.
-
-2005-05-17 Ziemowit Laski <zlaski@apple.com>
- Mike Stump <mrs@apple.com>
-
- Yet more Objective-C++...
-
- * cp-objcp-common.h (cxx_get_alias_set): Move from
- here...
- (cxx_warn_unused_global_decl): Likewise.
- (cp_expr_size): Likewise.
- (cp_tree_size): Likewise.
- (cp_var_mod_type_p): Likewise.
- (cxx_initialize_diagnostics): Likewise.
- (cxx_types_compatible_p): Likewise.
- * cp-tree.h: to here.
- (do_poplevel): Add.
- * lex.c (D_OBJC): Add.
- (init_reswords): Add.
- * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h.
- * parser.c: Add c-common.h include.
- * pt.c: Add c-common.h and cp-objcp-common.h includes.
- (template_args_equal): Use objc_comptypes as well.
- (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well.
- * semantics.c (do_poplevel): Remove static.
-
- * decl.c (objc_mark_locals_volatile): Don't change decls that are
- already ok.
- * decl2.c (generate_ctor_or_dtor_function): Add code to initialize
- Objective C++ early enough.
- * lex.c (struct resword reswords): Add Objective-C++ support.
- * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++.
- (cp_parser_objc_message_receiver): Add.
- (cp_parser_objc_message_args): Likewise.
- (cp_parser_objc_message_expression): Likewise.
- (cp_parser_objc_encode_expression): Likewise.
- (cp_parser_objc_defs_expression): Likewise.
- (cp_parser_objc_protocol_expression): Likewise.
- (cp_parser_objc_selector_expression): Likewise.
- (cp_parser_objc_expression): Likewise.
- (cp_parser_objc_visibility_spec): Likewise.
- (cp_parser_objc_method_type): Likewise.
- (cp_parser_objc_protocol_qualifiers): Likewise.
- (cp_parser_objc_typename): Likewise.
- (cp_parser_objc_selector_p): Likewise.
- (cp_parser_objc_selector): Likewise.
- (cp_parser_objc_method_keyword_params): Likewise.
- (cp_parser_objc_method_tail_params_opt): Likewise.
- (cp_parser_objc_interstitial_code): Likewise.
- (cp_parser_objc_method_signature): Likewise.
- (cp_parser_objc_method_prototype_list): Likewise.
- (cp_parser_objc_method_definition_list): Likewise.
- (cp_parser_objc_class_ivars): Likewise.
- (cp_parser_objc_identifier_list): Likewise.
- (cp_parser_objc_alias_declaration): Likewise.
- (cp_parser_objc_class_declaration): Likewise.
- (cp_parser_objc_protocol_declaration): Likewise.
- (cp_parser_objc_protocol_refs_opt): Likewise.
- (cp_parser_objc_superclass_or_category): Likewise.
- (cp_parser_objc_class_interface): Likewise.
- (cp_parser_objc_class_implementation): Likewise.
- (cp_parser_objc_end_implementation): Likewise.
- (cp_parser_objc_declaration): Likewise.
- (cp_parser_objc_try_catch_finally_statement): Likewise.
- (cp_parser_objc_synchronized_statement): Likewise.
- (cp_parser_objc_throw_statement): Likewise.
- (cp_parser_objc_statement): Likewise.
- (cp_parser_primary_expression): Add Objective-C++.
- (cp_parser_statement): Likewise.
- (cp_parser_declaration): Likewise.
- (cp_parser_simple_type_specifier): Likewise.
- (cp_parser_type_name): Likewise.
- (cp_parser_parameter_declaration_list): Likewise.
- (cp_parser_member_declaration) Likewise.
- * tree.c: Include debug.h.
- * typeck.c (composite_pointer_type): Add Objective-C++ support.
- (finish_class_member_access_expr): Likewise.
- (build_function_call): Allow objc to rewrite FUNCTION_DECLs.
- (build_modify_expr): Allow objc to generate write barriers.
-
- * Make-lang.in (cp/tree.o): Add debug.h.
- * tree.c (lvalue_p_1, case CONST_DECL): Add.
-
-2005-05-18 Jan Hubicka <jh@suse.cz>
-
- * method.c: Include tree-pass.h
- (use_thunk): Lower body before expanding.
-
-2005-05-17 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/21454
- * decl.c (maybe_deduce_size_from_array_init): Call
- cp_apply_type_quals_to_decl after completing array type.
-
-2005-05-16 Richard Henderson <rth@redhat.com>
-
- * decl.c (build_library_fn_1): Move setting TREE_NOTHROW ...
- (build_library_fn): ... here.
-
-2005-05-12 Ian Lance Taylor <ian@airs.com>
-
- * cp-tree.h (cp_stmt_codes): Don't define.
- (statement_code_p): Declare.
- (STATEMENT_CODE_P): Define.
- * lex.c (statement_code_p): Define.
- (cxx_init): Use actual codes in stmt_codes initializer, not
- cp_stmt_codes macro. Initialize statement_code_p directly, rather
- than using INIT_STATEMENT_CODES.
-
-2005-05-09 Mark Mitchell <mark@codesourcery.com>
-
- * typeck.c (build_unary_op): Do not resort to address arithmetic
- when taking the address of a COMPONENT_REF.
-
-2005-05-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * class.c (vtbl_init_data_s): Change the type of fns to
- VEC(tree,gc)*.
- (build_vtbl_initializer, add_vcall_offset, add_vcall_offset):
- Use VEC instead of VARRAY.
-
-2005-05-07 Richard Sandiford <rsandifo@redhat.com>
-
- * mangle.c: Remove a reference to the MIPS -mint64 option.
-
-2005-05-07 Kazu Hirata <kazu@cs.umass.edu>
-
- * decl.c (wrapup_globals_for_namespace): Use VEC instead of
- VARRAY.
- * name-lookup.c (add_decl_to_level, begin_scope): Likewise.
- * name-lookup.h (cp_binding_level): Change the type of
- static_decls to VEC(tree,gc)*.
-
- * mangle.c (globals): Change the type of substitutions to
- VEC(tree,gc)*.
- (dump_substitution_candidates, add_substitution,
- find_substitution, finish_mangling, init_mangle): Use VEC
- instead of VARRAY.
-
-2005-05-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * decl2.c (spew_debug): Remove.
-
- * decl2.c (ssdf_decls, start_static_storage_duration_function,
- generate_ctor_or_dtor_function): Use VEC instead of VARRAY.
-
- * decl2.c (pending_statics, note_vague_linkage_var,
- cp_finish_file): Use VEC instead of VARRAY.
- (pending_statics_used): Remove.
-
-2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * decl2.c (deferred_fns, note_vague_linkage_fn,
- cp_finish_file): Use VEC instead of VARRAY.
-
-2005-05-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21352
- * pt.c (build_non_dependent_expr): Use is_overloaded_fn.
-
-2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * pt.c: Fix a comment typo.
-
-2005-05-04 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h (language_function): Change the type of
- x_local_names to VEC.
- * decl.c (push_local_name): Adjust uses of local_names.
-
-2005-05-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * friend.c, lex.c, mangle.c, repo.c: Update copyright.
-
-2005-05-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * class.c (local_classes, init_class_processing): Use VEC
- instead of VARRAY.
- * cp-tree.h (local_classes): Likewise.
- * mangle.c (discriminator_for_local_entity): Likewise.
- * name-lookup.c (pushtag): Likewise.
-
- * class.c (current_lang_depth, push_lang_context,
- pop_lang_context): Use VEC instead of VARRAY.
- * cp-tree.h (saved_scope): Use VEC for lang_base instead of
- VARRAY.
- * name-lookup.c (push_to_top_level): Use VEC instead of
- VARRAY.
-
-2005-05-02 Paolo Bonzini <bonzini@gnu.org>
-
- * semantics.c (finish_call_expr): Call resolve_overloaded_builtin
- for BUILT_IN_MD built-ins.
-
-2005-05-02 Michael Matz <matz@suse.de>
-
- PR c++/19542
- * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C
- common frontend.
- (null_node): Remove.
- * lex.c (cxx_init): Move null_node initialisation to C common frontend.
-
-2005-04-25 Ian Lance Taylor <ian@airs.com>
-
- * cp-tree.def: Add EXPR_STMT.
- * cp-tree.h (cp_stmt_codes): Add EXPR_STMT.
- (EXPR_STMT_EXPR): Define.
- * cp-gimplify.c: Include "flags.h".
- (gimplify_expr_stmt): New static function.
- (cp_gimplify_expr): Handle EXPR_STMT.
- * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression
- rather than pp_expression.
- (pp_cxx_statement): Handle EXPR_STMT.
- * dump.c (cp_dump_tree): Handle EXPR_STMT.
- * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes
- initializer.
-
-2005-04-25 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR C++/21188
- * rtti.c (ifnonnull): Cast the zero comparison operand
- to the correct type.
-
-2005-04-24 Jakub Jelinek <jakub@redhat.com>
-
- PR middle-end/20991
- * class.c: Include cgraph.h.
- (cp_fold_obj_type_ref): Set node->local.vtable_method.
- * Make-lang.in (cgraph.o): Depend on $(CGRAPH_H).
-
-2005-04-12 Markus F.X.J. Oberhumer <markus@oberhumer.com>
-
- * mangle.c (write_builtin_type): Handle integer types which are
- not one of the shared integer type nodes and emit a "vendor
- extended builtin type" with an encoding in the form of "u5int96".
-
-2005-04-24 Ian Lance Taylor <ian@airs.com>
-
- * cp-tree.def (USING_STMT): Change class to tcc_statement.
- (TRY_BLOCK, EH_SPEC_BLOCK, HANDLER, CLEANUP_STMT): Likewise.
- (IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT): Likewise.
- (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
-
-2005-04-23 DJ Delorie <dj@redhat.com>
-
- * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c,
- init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c,
- repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning()
- callers.
-
-2005-04-22 Per Bothner <per@bothner.com>
-
- * decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if
- input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__.
-
-2005-04-22 Alexandre Oliva <aoliva@redhat.com>
-
- PR c++/21087
- * name-lookup.c (push_overloaded_decl): Do not overload with
- non-duplicate anticipated built-in.
-
-2005-04-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT,
- VTABLE_BASE, VTABLE_NAME_PREFIX, STATIC_NAME_FORMAT): Remove.
-
-2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
-
- * cp-tree.h: Adjust for new VEC API.
- Define VEC(tree_pair_s,gc).
- (struct save_scope): Adjust.
- (struct lang_type_class): Adjust.
- (unemitted_tinfo_decls): Adjust.
- * class.c (add_method, resort_type_method_vec,
- finish_struct_methods, struct find_final_overrider_data,
- dfs_find_final_overrider_pre, find_final_overrider,
- get_vcall_index, warn_hidden, walk_subobject_offsets,
- check_methods, fixup_inline_methods, end_of_class,
- warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
- add_vcall_offset): Adjust.
- * decl.c (xref_basetypes, finish_method): Adjust.
- * decl2.c (check_classfn): Adjust.
- * init.c (sort_mem_initializers, push_base_cleanups): Adjust.
- * method.c (do_build_copy_constructor): Adjust.
- * name-lookup.c (new_class_binding, store_binding,
- store_bindings, store_class_bindings): Adjust.
- * name-lookup.h: Define VEC(cxx_saved_binding,gc),
- VEC(cp_class_binding,gc).
- (struct cp_binding_level): Adjust.
- * parser.c: Define VEC(cp_token_position,heap).
- (struct cp_lexer): Adjust.
- (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
- cp_lexer_save_tokens): Adjust.
- * pt.c (retrieve_specialization,
- check_explicit_specialization): Adjust.
- * rtti.c (unemitted_tinfo_decls): Adjust.
- (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
- get_pseudo_ti_desc): Adjust.
- * search.c (dfs_access_in_type, lookup_conversion_operator,
- lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
- dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
- * semantics.c: Define VEC(deferred_access,gc).
- (push_deferring_access_checks): Adjust.
- * typeck2.c (abstract_virtuals_error): Adjust.
-
-2005-04-20 Ian Lance Taylor <ian@airs.com>
-
- * cp-tree.def: Add STMT_EXPR.
- * cp-tree.h (STMT_EXPR_NO_SCOPE): Define.
- (STMT_EXPR_STMT): Define.
- * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
- STMT_EXPR.
- (pp_cxx_expression): Likewise.
- (pp_cxx_statement): Call pp_cxx_statement, not pp_statement.
- * dump.c (cp_dump_tree): Handle STMT_EXPR.
-
-2005-04-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * decl.c (expand_static_init): Call build2 and build3 instead
- of build.
-
- * cp-tree.h (VPTR_NAME, VPTR_NAME_P): Remove.
-
-2005-04-17 Ian Lance Taylor <ian@airs.com>
-
- * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR.
- * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle
- ARROW_EXPR.
- (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR.
- (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and
- ALIGNOF_EXPR.
- * typeck.c (cxx_sizeof_or_alignof_type): Update call to
- c_sizeof_or_alignof_type for change in parameter type.
-
-2005-04-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/21025
- * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
- which sizeof/alignof is dependent, rather than just whether we are
- processing_template_decl.
-
-2005-04-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h (LOOKUP_GLOBAL): Remove.
- (LOOKUP_ONLYCONVERTING, DIRECT_BIND, LOOKUP_NO_CONVERSION,
- LOOKUP_DESTRUCTOR, LOOKUP_NO_TEMP_BIND, LOOKUP_PREFER_TYPES,
- LOOKUP_PREFER_NAMESPACES, LOOKUP_CONSTRUCTOR_CALLABLE): Adjust
- their values.
-
-2005-04-15 Richard Henderson <rth@redhat.com>
-
- PR middle-end/14311
- * semantics.c (finish_call_expr): Call resolve_overloaded_builtin.
-
-2005-04-15 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h (lang_type_class): Remove redefined. Move
- java_interface into where redefined was. Increment the width
- of dummy.
- (TYPE_REDEFINED): Remove.
-
-2005-04-14 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h (SET_TMPL_ARG, ENUM_TI_TEMPLATE, ENUM_TI_ARGS,
- CLASSTYPE_TEMPLATE_LEVEL): Remove.
-
-2005-04-11 Mark Mitchell <mark@codesourcery.com>
-
- * decl2.c (determine_visibility): Don't use export_class_data.
- (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
- TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY.
-
-2005-04-09 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h (cxx_alignof): Remove.
-
- * cp-tree.h (DECL_ARRAY_DELETE_OPERATOR_P): Remove.
-
- * cp-tree.h (EXCEPTION_CLEANUP_NAME, B_SET, B_CLR, B_TST,
- CONV_STATIC_CAST): Remove.
-
- * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Remove.
-
- * cp-tree.h (VF_BINFO_VALUE, VF_BASETYPE_VALUE): Remove.
-
- * cp-tree.h (cp_deprecated): Remove.
-
-2005-04-08 Ian Lance Taylor <ian@airs.com>
-
- * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT,
- CONTINUE_STMT, SWITCH_STMT.
- * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT,
- BREAK_STMT, CONTINUE_STMT, SWITCH_STMT.
- (WHILE_COND, WHILE_BODY): Define.
- (DO_COND, DO_BODY): Define.
- (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define.
- (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define.
- * cp-gimplify.c (enum bc_t): Define.
- (struct cp_gimplify_ctx, ctxp): Define.
- (push_context, pop_context): New static functions.
- (begin_bc_block, finish_bc_block): New static functions.
- (build_bc_goto): New static function.
- (gimplify_cp_loop, gimplify_for_stmt): New static functions.
- (gimplify_while_stmt, gimplify_do_stmt): Likewise.
- (gimplify_switch_stmt): Likewise.
- (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT,
- SWITCH_STMT, CONTINUE_STMT, BREAK_STMT.
- (cp_genericize): Call push_context and pop_context.
- * semantics.c (finish_break_stmt): Just call build_stmt
- (BREAK_STMT) rather than build_break_stmt.
- (finish_continue_stmt): Corresponding change.
- * decl.c (pop_switch): Update call to c_do_switch_warnings for new
- parameters.
- * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT,
- WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT.
- * dump.c (cp_dump_tree): Likewise.
-
-2005-04-08 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20905
- * parser.c (cp_parser_type_specifier_seq): Add is_condition
- parameter.
- (cp_parser_new_type_id): Pass it.
- (cp_parser_condition): Likewise.
- (cp_parser_conversion_type_id): Likewise.
- (cp_parser_type_id): Likewise.
- (cp_parser_type_specifier_seq): In a condition, do not allow
- invalid type-specifier combinations.
- (cp_parser_exception_declaration): Adjust call to
- cp_parser_type_specifier_seq.
-
- * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P.
- * cp-tree.h (struct tinst_level): Add in_system_header_p.
- (TINST_IN_SYSTEM_HEADER_P): New macro.
- (make_tinst_level): Remove.
- * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on
- the instantiated class.
- (push_tinst_level): Do not use make_tinst_level. Set
- TINST_IN_SYSTEM_HEADER_P.
- (pop_tinst_level): Likewise.
- (instantiate_class_template): Set in_system_header.
- (instantiate_pending_templates): Likewise.
- * tree.c (make_tinst_level): Remove.
-
-2005-04-06 Joseph S. Myers <joseph@codesourcery.com>
-
- * decl.c (start_decl): Apply pending #pragma weak regardless of
- scope.
-
-2005-04-06 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20212
- * pt.c (regenerate_decl_from_template): Copy attributes for
- parameters from the pattern to the instantiation.
-
-2005-04-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20734
- * cp-tree.def (OFFSET_REF): Correct comments.
- * init.c (build_offset_ref): Remove misleading comment.
- * typeck.c (build_unary_op): Handle pointer-to-member creation
- here, rather than ...
- (unary_complex_lvalue): ... here.
-
-2005-04-06 Jason Merrill <jason@redhat.com>
-
- PR c++/19312
- * tree.c (stabilize_init): Don't bother trying to stabilize
- something with no side-effects.
-
-2005-04-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20763
- * decl.c (grokdeclarator): Correct attribute handling.
-
-2005-04-05 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19159
- * decl2.c (import_export_decl): Use non-COMDAT external linkage
- for virtual tables, typeinfo, etc. that will be emitted in only
- one translation unit on systems without weak symbols.
-
-2005-04-04 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20679
- * parser.c (cp_parser_template_name): Fix thinko.
-
-2005-04-04 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20746
- * method.c (use_thunk): Protect covariant pointer return
- adjustments from NULL pointers.
-
-2005-04-04 Jan Hubicka <jh@suse.cz>
-
- * decl2.c (finish_objects): Revert my previous patch.
- (cp_finish_file): Likewise.
-
-2005-04-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * pt.c: Fix comment typos.
-
-2005-04-03 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20723
- * pt.c (more_specialized_fn): Member functions are unordered wrt
- non-members. Conversion operators are unordered wrt other
- functions.
-
-2005-04-01 Nathan Sidwell <nathan@codesourcery.com>
-
- * call.c (add_template_candidates_real): Remove length parameter
- from fn_type_unification call.
- * class.c (resolve_address_of_overloaded_function): Likewise
- * cp-tree.h (fn_type_unification): Remove length parameter.
- * pt.c (get_bindings_overload): Remove.
- (get_bindings_real): Rename to ...
- (get_bindings): ... here. Remove length and strict
- parameters. Change return type flag to boolean. Remove original
- forwarding function.
- (determine_specialization): Adjust get_bindings call.
- (fn_type_unification): Remove length parameter. Adjust.
- (type_unification_real): Remove length parameter. Adjust.
- (resolve_overloaded_unification): Adjust get_bindings call.
- (try_one_overload): Simplify confusing cascaded if control flow.
- (unify): Remove length paramter from type_unification_real call.
- (most_specialized_instantiation): Adjust get_bindings calls.
- (most_specialized): Likewise.
-
-2005-03-31 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19203, implement DR 214
- * call.c (joust): Use more_specialized_fn.
- * cp-tree.h (DEDUCE_ORDER): Remove.
- (more_specialized): Replace with ...
- (more_specialized_fn): ... this.
- * pt.c (maybe_adjust_types_for_deduction): Remove DEDUCE_ORDER
- case.
- (type_unification_real): Remove DEDUCE_ORDER case.
- (more_specialized): Replace with ...
- (more_specialized_fn): ... this. Implement DR 214.
- (most_specialized_instantiation): Use get_bindings_real directly.
-
-2005-03-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- PR c++/18644
- * call.c (build_new_op): Remove check for -Wsynth.
-
-2005-03-31 Jan Hubicka <jh@suse.cz>
-
- * decl2.c (finish_objects): Mark ctor as needed.
- (cp_finish_file): Output variables only in nonunit-at-a-time.
-
-2005-03-29 Richard Henderson <rth@redhat.com>
-
- PR c/20519
- * decl.c (cp_complete_array_type): Rename from complete_array_type.
- Use the new complete_array_type in c-common.c. Update all callers.
- * cp-tree.h (cp_complete_array_type): Update to match.
-
-2005-03-24 Geoffrey Keating <geoffk@apple.com>
-
- * typeck.c (build_static_cast_1): Allow scalar_cast between
- any integral, floating, or enumeration type.
-
-2005-03-24 Steven Bosscher <stevenb@suse.de>
-
- * typeck.c (comptypes): First determine if the types are compatible
- from a target-independent point of view. Check target attributes
- last.
-
- * class.c (build_base_path):
- (build_vbase_offset_vtbl_entries):
- (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN.
- * error.c (dump_expr): Likewise.
- * init.c (build_zero_init, expand_cleanup_for_base,
- build_vec_delete_1): Likewise.
- * mangle.c (write_integer_cst): Likewise.
- * method.c (thunk_adjust): Likewise.
- * pt.c (convert_nontype_argument, tsubst, unify): Likewise.
- * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise.
- * typeck.c (build_ptrmemfunc_access_expr,
- (get_member_function_from_ptrfunc): Likewise.
-
-2005-03-23 Joseph S. Myers <joseph@codesourcery.com>
-
- * cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
-
-2005-03-23 Joseph S. Myers <joseph@codesourcery.com>
-
- * cp-tree.h (perform_integral_promotions): Remove.
- (default_conversion): Add.
-
-2005-03-22 Mark Mitchell <mark@codesourcery.com>
-
- * parser.c (cp_parser_warn_min_max): New function.
- (cp_parser_binary_expression): Use it.
- (cp_parser_assignment_operator_opt): Likewise.
- (cp_parser_operator): Likewise.
-
-2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/19980
- * decl.c (start_preparsed_function): Robustify.
-
-2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/20499
- * parser.c (cp_parser_class_head): Return NULL_TREE when
- encountering a redefinition.
-
-2005-03-22 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20465
- PR c++/20381
- * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a
- template.
-
-2005-03-21 Paolo Carlini <pcarlini@suse.de>
-
- PR c++/20461
- PR c++/20536
- * init.c (emit_mem_initializers): Don't crash on undefined
- types.
-
-2005-03-21 Paolo Carlini <pcarlini@suse.de>
-
- PR c++/20147
- * semantics.c (finish_stmt_expr_expr): Return immediately
- if error_operand_p (expr).
-
-2005-03-21 Joseph S. Myers <joseph@codesourcery.com>
-
- * cp-tree.h (lvalue_or_else, lvalue_p): New.
- * typeck.c (lvalue_or_else): New. Call lvalue_error.
-
-2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/20240
- * decl.c (decls_match): Compare context of VAR_DECL.
-
-2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/20333
- * parser.c (cp_parser_postfix_expression) <case RID_TYPENAME>:
- Check the return value of cp_parser_nested_name_specifier.
-
-2005-03-18 Dale Johannesen <dalej@apple.com>
-
- * cp/tree.c (cp_tree_equal): Handle SSA_NAME.
-
-2005-03-18 Paolo Carlini <pcarlini@suse.de>
-
- PR c++/20463
- * parser.c (cp_parser_diagnose_invalid_type_name):
- Check TYPE_BINFO (current_class_type) before attempting
- to emit inform messages.
-
-2005-03-17 Paolo Carlini <pcarlini@suse.de>
-
- PR c++/19966
- * cp-tree.h (grok_op_properties): Change return type to void.
- * decl.c (grok_op_properties): Return early - don't check the
- arity - in case of a static member or an operator that cannot
- be non-member; tidy a bit.
-
-2005-03-17 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20186
- * pt.c (contains_dependent_cast_p): Remove.
- (fold_non_dependent_expr): Don't use it.
- (value_dependent_expression_p): Use a switch statement.
- reference_exprs can be dependent.
-
-2005-03-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/4403
- PR c++/9783, DR433
- * name-lookup.c (pushtag): Skip template parameter scope when
- scope is ts_global. Don't push tag into template parameter
- scope.
- * pt.c (instantiate_class_template): Reorder friend class
- template substitution to handle non-dependent friend class
- that hasn't been previously declared.
-
-2005-03-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- Friend class name lookup 5/n
- PR c++/1016
- * cp-tree.h (pushtag): Adjust declaration.
- * decl.c (lookup_and_check_tag): Call lookup_type_scope if
- lookup_name fails.
- (xref_tag): Adjust call to pushtag. Make hidden class visible.
- (start_enum): Adjust call to pushtag.
- * name-lookup.c (ambiguous_decl): Ignore hidden names.
- (qualify_lookup): Change return type to bool.
- (hidden_name_p): New function.
- (lookup_namespace_name, unqualified_namespace_lookup,
- lookup_name_real): Use it.
- (lookup_type_scope): Update comments.
- (maybe_process_template_type_declaration): Change parameter name
- from globalize to is_friend.
- (pushtag): Change globalize parameter of type int to tag_scope.
- Hide name if introduced by friend declaration.
- * name-lookup.h (hidden_name_p): Add declaration.
- * parser.c (cp_parser_lookup_name): Don't deal with hidden name
- here.
- * pt.c (push_template_decl_real): Make hidden class template
- visible.
- (lookup_template_class, instantiate_class_template): Adjust call
- to pushtag.
- * semantics.c (begin_class_definition): Likewise.
- * rtti.c (init_rtti_processing, build_dynamic_cast_1,
- tinfo_base_init, emit_support_tinfos): Use ts_current instead of
- ts_global.
-
-2005-03-13 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20157
- * pt.c (determine_specialization): Reject non-specializations.
-
-2005-03-11 Per Bothner <per@bothner.com>
-
- * cp-tree.h (struct cp_declarator): New id_loc field.
- * cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's
- location using c_lex_with_flags, instead of input_location.
- (cp_parser_direct_declarator): Set declarator's id_loc from
- cp_token's id_loc.
-
-2005-03-10 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/18384, c++/18327
- * decl.c (reshape_init_array): Use UHWI type for max_index_cst
- and index. Convert max_index to size_type_node if it isn't
- host_integerp (, 1).
-
-2005-03-09 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20208
- * pt.c (tsubst_decl): Apply array-to-pointer and
- function-to-pointer conversions to function arguments.
- (regenerate_decl_from_template): Likewise.
-
-2005-03-09 Paolo Carlini <pcarlini@suse.de>
-
- PR c++/16859
- * decl.c (complete_array_type): In pedantic mode, return
- 3 for an empty initializer list as the initializer for an
- array of unknown bound (8.5.1/4).
- (maybe_deduce_size_from_array_init): Fix final test to use
- the above.
-
-2005-03-08 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20186
- * pt.c (contains_dependent_cast_p): New.
- (fold_non_dependent_expr): Call it.
-
-2005-03-08 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20142
- * cp-tree.h (target_type): Remove.
- * decl.c (layout_var_decl): Remove #if 0'd code.
- (cp_finish_decl): Remove dead code.
- * init.c (build_vec_init): When determining whether or not the
- element type has an asignment operator, look through all array
- dimensions.
- * typeck.c (target_type): Remove.
-
-2005-03-07 Mark Mitchell <mark@codesourcery.com>
-
- * class.c (finish_struct_1): Do not warn about non-virtual
- destructors in Java classes.
-
-2005-03-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/19311
- * init.c (build_offset_ref): Don't build non-dependent SCOPE_REF.
- * pt.c (build_non_dependent_expr): Don't build NON_DEPENDENT_EXPR
- for OFFSET_TYPE.
- * typeck.c (build_x_unary_op): Don't build non-dependent SCOPE_REF.
- Also set PTRMEM_OK_P for NON_DEPENDENT_EXPR.
- (build_unary_op): Handle building ADDR_EXPR of OFFSET_REF inside
- template.
-
-2005-03-02 Alexandre Oliva <aoliva@redhat.com>
-
- * name-lookup.c (push_overloaded_decl): Don't error if the new
- decl matches the old one.
- * decl.c (redeclaration_error_message): Likewise.
-
-2005-03-01 Per Bothner <per@bothner.com>
-
- * decl.c (finish_function): Use SET_EXPR_LOCATION instead of
- unavailable annotate_with_file_line, if USE_MAPPED_LOCATION.
-
-2005-03-01 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/20232
- * class.c (update_vtable_entry_for_fn): Don't crash on invalid
- covariancy.
-
- * cp-tree.g (THUNK_TARGET): Expand comment.
- * method.c (use_thunk): Make sure we also use the target, if that
- is a thunk.
-
-2005-02-27 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/20206
- * decl.c (cxx_comdat_group): Put thunks for
- TARGET_USE_LOCAL_THUNK_ALIAS_P (function) functions into the same
- comdat group as the thunk target.
-
-2005-02-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c,
- parser.c: Fix comment typo(s).
-
-2005-02-24 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/20175
- * decl.c (reshape_init): Don't warn about missing braces if STRING_CST
- initializes a char/wchar_t array.
-
-2005-02-23 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19878
- * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
- with internal linkage.
-
-2005-02-23 Alexandre Oliva <aoliva@redhat.com>
-
- * decl.c (grokvardecl): Don't exempt anonymous types from having
- linkage for variables that have linkage other than "C".
-
-2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-objcp-common.h, error.c: Update copyright.
-
-2005-02-22 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/20073
- * decl.c (start_decl_1): Don't clear TREE_READONLY.
- (cp_finish_decl): Likewise.
- (complete_vars): Call cp_apply_type_quals_to_decl.
- * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in
- cases where that's not valid.
-
- PR c++/19991
- * init.c (integral_constant_value): Iterate if the value of a decl
- is itself a constant.
-
- PR c++/20152
- * parser.c (cp_parser_class_head): Check for redefintions here.
- * semantics.c (begin_class_definition): Not here.
-
- PR c++/20153
- * decl2.c (build_anon_union_vars): Add type parameter.
- (finish_anon_union): Pass it.
-
- PR c++/20148
- * error.c (dump_expr): Do not print the body of a BIND_EXPR.
- Handle STATEMENT_LIST.
-
- PR c++/19883
- * parser.c (cp_parser_direct_declarator): Always complain about
- non-constant array bounds when in a function scope.
- * semantics.c (finish_id_expression): Do not mark dependent names
- as non-constant.
-
-2005-02-21 Douglas Gregor <dgregor@cs.indiana.edu>
-
- PR c++/19076
- PR c++/6628
- * cp-tree.h (cp_apply_type_quals_to_decl): Declared.
- * decl.c (grokdeclarator): Pedwarn about qualifying a function
- type.
- Add qualifiers when declaring a typedef of a function type.
- Member function pointers pick up the qualifiers of the typedef
- used to declare them.
- Don't complain about creating cv-qualified function types.
- Complain about qualified function typedefs that are used to
- declare non-static member functions or free functions.
- Use cp_apply_type_quals_to_decl.
- (start_preparsed_function): Use cp_apply_type_quals_to_decl.
- (grokclassfn): Use cp_apply_type_quals_to_decl.
- * error.c (dump_type_suffix): Print qualifiers for function
- types.
- * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
- (tsubst): When substituting a function type into a member
- pointer type, pass along the qualifiers.
- (unify): Unify member pointers to member function pointers.
- * tree.c (cp_build_qualified_type_real): Function types may be
- qualified. This includes restrict qualifiers.
- * typeck.c (cp_apply_type_quals_to_decl): New function to replace
- use of c_apply_type_quals_to_decl. Drops qualifiers that are being
- added to function types.
-
-2005-02-20 Zack Weinberg <zack@codesourcery.com>
-
- PR 18785
- * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
- c_common_to_target_charset. Delete bogus comment.
-
-2005-02-18 Richard Henderson <rth@redhat.com>
-
- PR libstdc++/10606
- * except.c (do_get_exception_ptr): New.
- (expand_start_catch_block): Use it.
-
-2005-02-19 Jakub Jelinek <jakub@redhat.com>
-
- * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING
- if type is not error_mark_node.
-
-2005-01-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
-
- PR c++/19508
- * decl2.c (grokfield): Do not apply attributes to template parameters
- as they are ignored by tsubst anyway.
-
-2005-02-18 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/19813
- * decl.c (start_decl_1): Clear TREE_READONLY flag if
- its type has TYPE_NEEDS_CONSTRUCTING.
- (complete_vars): Likewise.
-
-2005-02-17 Alexandre Oliva <aoliva@redhat.com>
-
- PR c++/20028
- * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a
- template along with TYPE_SIZE.
-
- PR c++/20022
- * semantics.c (perform_deferred_access_checks): Use
- get_deferred_access_checks to get the top of the stack.
-
-2005-02-15 Alexandre Oliva <aoliva@redhat.com>
-
- PR c++/17788
- * class.c (add_implicitly_declared_members, check_field_decl)
- (check_field_decls, check_bases): Remove arguments, tests and
- assignments of cant_have_default_ctor-related variables.
-
-2005-02-15 Alexandre Oliva <aoliva@redhat.com>
-
- * decl2.c (mark_used): Set the source location of the used decl to
- the current input location here...
- * method.c (synthesize_method): ... not here. Set input_location
- from the decl instead.
-
-2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19608
- * parser.c (cp_parser_late_parsing_for_member): Use
- current_function_decl as scope to push to and from.
-
- PR c++/19884
- * pt.c (check_explicit_specialization): Make sure namespace
- binding lookup found an overloaded function.
- (lookup_template_function): Just assert FNS is an overloaded
- function.
-
- PR c++/19895
- * decl.c (grokdeclarator): Check for error mark node in ptrmem
- construction.
-
-2005-02-14 Alexandre Oliva <aoliva@redhat.com>
-
- PR c++/17816
- * decl.c (redeclaration_error_message): Report redefinition of
- pure virtual function.
-
-2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19891
- * class.c (build_simple_base_path): Build the component_ref
- directly.
- (update_vtable_entry_for_fn): Walk the covariant's binfo chain
- rather than using lookup_base.
- * search.c (dfs_walk_once): Add non-recursive assert check.
- * typeck.c (build_class_member_access_expr): It is possible for
- the member type to be both const and volatile.
-
-2005-02-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/14479
- PR c++/19487
- * pt.c (maybe_check_template_type): Remove.
- * cp-tree.h (maybe_check_template_type): Remove prototype.
- * name-lookup.c (maybe_process_template_type_declaration): Don't
- use maybe_check_template_type.
-
-2005-02-11 Richard Henderson <rth@redhat.com>
-
- PR c++/19632
- * pt.c (get_mostly_instantiated_function_type): Save and restore
- flag_access_control instead of push/pop_access_scope.
-
-2005-02-10 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19755
- * decl.c (reshape_init): Issue warnings about missing braces.
-
-2005-02-11 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.def, except.c, ptree.c: Update copyright.
-
-2005-02-09 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19811
- * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
- attempting name lookup.
-
- * parser.c (cp_parser_unqualified_id): Initialize type_decl.
-
- PR c++/19787
- * call.c (initialize_reference): Robustify.
-
- PR ++/19732
- * decl.c (grokdeclarator): Check for invalid use of destructor
- names.
-
- PR c++/19762
- * parser.c (cp_parser_unqualified_id): Avoid creating destructor
- names with invalid types.
-
- PR c++/19826
- * parser.c (cp_parser_direct_declarator): Allow type-dependent
- expressions as array bounds.
-
- PR c++/19739
- * parser.c (cp_parser_attributes_list): Allow empty lists.
-
-2005-02-08 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19733
- * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR.
- (check_bases): Give warnings about a base class with a
- non-virtual destructor, even if it is implicit.
- (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR.
- (maybe_warn_about_overly_private_class): Don't use
- TYPE_HAS_DESTRUCTOR.
- (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR.
- (check_for_override): Give it external linkage.
- (add_implicitly_declared_members): Generate destructors lazily.
- (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
- TYPE_HAS_DESTRUCTOR.
- (check_bases_and_members): Call check_methods before
- check_field_decls.
- (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
- TYPE_HAS_DESTRUCTOR.
- (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR.
- * cp-tree.def (PSEUDO_DTOR_EXPR): Document.
- * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove.
- (lang_type_class): Add lazy_destructor.
- (CLASSTYPE_LAZY_DESTRUCTOR): New macro.
- (CLASSTYPE_DESTRUCTORS): Robustify.
- (TYPE_HAS_DESTRUCTOR): Remove.
- (check_for_override): Declare.
- (build_vbase_delete): Remove.
- * cvt.c (convert_to_void): Issue errors about pseudo-destructor
- expressions.
- * decl.c (cxx_maybe_build_cleanup): Remove dead code.
- * except.c (dtor_nothrow): Lazily create destructors if necessary.
- (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
- * init.c (build_delete): Lazily create destructors, if necessary.
- (build_vbase_delete): Remove.
- * method.c (locate_dtor): Simplify.
- (implicitly_declare_fn): Add support for destructors.
- * parser.c (cp_parser_lookup_name): Lazily create destructors, if
- necessary.
- * pt.c (check_explicit_specialization): Don't use
- TYPE_HAS_DESTRUCTOR.
- (instantiate_class_template): Likewise.
- * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR.
- * rtti.c (emit_support_tinfos): Robustify.
- * search.c (lookup_fnfields_1): Lazily create destructors.
- * typeck.c (build_class_member_access_expr): Remove
- PSEUDO_DTOR_EXPR handling.
- (lookup_destructor): Likewise.
-
-2005-02-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update
- copyright.
-
-2005-02-07 Mark Mitchell <mark@codesourcery.com>
-
- * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations
- on boolean variables.
- (cp_lexer_stop_debugging): Likewise.
-
-2005-02-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
-
- PR c++/17401
- * parser.c (cp_parser_pure_specifier): Emit a specific error
- message with an invalid pure specifier.
- * decl2.c (grok_function_init): Remove.
- (grokfield): An initializer for a method is a always a pure
- specifier.
-
-2005-02-02 Matt Austern <austern@apple.com>
-
- PR c++/19628
- * cp-tree.h (builtin_valid_in_constant_expr_p): Declare.
- * parser.c (cp_parser_postfix_expression): Accept function call in
- constant expression if builtin_valid_in_constant_expr_p is true
- for that function.
- * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly.
- * semantics.c (finish_id_expression): Accept function call in constant
- expression if builtin_valid_in_constant_expr_p is true for that
- function.
- * tree.c (builtin_valid_in_constant_expr_p): New.
-
-2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/17413
- * pt.c (check_instantiated_args): Improve error message.
- Fix logic when to print its second part.
-
-2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cp-tree.h (complete_type_or_else): Remove macro.
- (complete_type_or_diagnostic): Rename to complete_type_or_else
- and remove last argument.
- * typeck.c (complete_type_or_diagnostic): Rename to
- complete_type_or_else and remove last argument.
-
-2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cp-tree.h (commonparms): Remove prototype.
- (convert_arguments): Likewise.
- (PFN_FROM_PTRMEMFUNC): Remove.
- * typeck.c (commonparms): Make static.
- (convert_arguments): Add prototype. Make static.
- (PFN_FROM_PTRMEMFUNC): Replace by pfn_from_ptrmemfunc.
-
-2005-01-31 Mark Mitchell <mark@codesourcery.com>
-
- * parser.c (cp_parser_primary_expression): Don't complain about
- floating-point literals in integral constant expressions when
- !pedantic.
-
-2005-02-01 Alexandre Oliva <aoliva@redhat.com>
-
- * parser.c (cp_parser_template_id): Revert comment patch too.
-
- PR c++/18757
- PR c++/19366
- PR c++/19499
- * parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
- Issue an error when creating the template id.
- * pt.c (fn_type_unification): Return early if the explicit
- template arg list is an error_mark_node.
-
-2005-01-31 Mark Mitchell <mark@codesourcery.com>
-
- * decl.c (build_enumerator): Do not issue duplicate error messages
- about invalid enumeration constants.
- * parser.c (cp_parser_non_integral_constant_expression): Always
- set parser->non_integral_constant_expression_p.
- (cp_parser_primary_expression): Add cast_p parameter. Issue
- errors about invalid uses of floating-point literals in
- cast-expressions.
- (cp_parser_postfix_expression): Add cast_p parameter.
- (cp_parser_open_square_expression): Pass it.
- (cp_parser_parenthesized_expression_list): Add cast_p parameter.
- (cp_parser_unary_expression): Likewise.
- (cp_parser_new_placement): Pass it.
- (cp_parser_direct_new_declarator): Likewise.
- (cp_parser_new_initializer): Likewise.
- (cp_parser_cast_expression): Add cast_p parameter.
- (cp_parser_binary_expression): Likewise.
- (cp_parser_question_colon_clause): Likewise.
- (cp_parser_assignment_expression): Likewise.
- (cp_parser_expression): Likewise.
- (cp_parser_constant_expression): If an integral constant
- expression is invalid, return error_mark_node.
- (cp_parser_expression_statement): Pass cast_p.
- (cp_parser_condition): Likewise.
- (cp_parser_iteration_statement): Likewise.
- (cp_parser_jump_statement): Likewise.
- (cp_parser_mem_initializer): Likewise.
- (cp_parser_template_argument): Likewise.
- (cp_parser_parameter_declaration): Likewise.
- (cp_parser_initializer): Likewise.
- (cp_parser_throw_expression): Likewise.
- (cp_parser_attribute_list): Likewise.
- (cp_parser_simple_cast_expression): Likewise.
- (cp_parser_functional_cast): Likewise.
- (cp_parser_late_parsing_default_args): Likewise.
- (cp_parser_sizeof_operand): Save/restore
- non_integral_constant_expression_p.
-
-2005-01-31 Mike Stump <mrs@apple.com>
-
- * parser.c (cp_lexer_new_main): Get the first token, first, before
- doing anything.
-
-2005-01-31 Mark Mitchell <mark@codesourcery.com>
-
- * decl.c (start_decl): Add missing parentheses.
-
-2005-01-30 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19555
- * cp-tree.h (DECL_USE_TEMPLATE): Expand documentation.
- * decl.c (duplicate_decls): Do not discard
- DECL_IMPLICIT_INSTANTIATION when merging declarations.
- (start_decl): Do not SET_DECL_TEMPLATE_SPECIALIZATION for
- variables that do not have DECL_USE_TEMPLATE.
-
- PR c++/19395
- * decl.c (grokdeclarator): Refactor code so that qualified names
- are never allowed as the declarator in a typedef.
-
- PR c++/19367
- * name-lookup.c (do_nonmember_using_decl): Avoid overloading
- builtin declarations.
-
- PR c++/19457
- * call.c (convert_like_real): Inline call to
- dubious_conversion_warnings here.
- * cp-tree.h (dubious_conversion_warnings): Remove.
- * semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before
- setting TREE_NEGATED_INT.
- * typeck.c (dubious_conversion_warnings): Remove.
-
- PR c++/19349
- * name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
- memory.
-
-2005-01-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19253
- * parser.c (cp_parser_diagnose_invalid_type_name): Commit to
- tentative parses.
-
- PR c++/19667
- * pt.c (redeclare_class_template): Robustify.
-
-2005-01-27 Steven Bosscher <stevenb@suse.de>
-
- * decl.c (finish_case_label): Use SWITCH_STMT accessor macros
- instead of SWITCH_EXPR ones.
- * pt.c (tsubst_expr): Likewise.
- * semantics.c (begin_switch_stmt, finish_switch_cond,
- finish_switch_stmt): Likewise.
-
-2005-01-26 J"orn Rennecke <joern.rennecke@st.com>
-
- PR c++/18370
- * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.
-
-2005-01-25 Andrew Pinski <pinskia@physics.uc.edu>
-
- * class.c (abort_fndecl_addr): New variable.
- (build_vtbl_initializer): If we have a pure virtual function
- share the abort function's address.
- Include gt-cp-class.h at the end.
- * config-lang.in (gtfiles): Add cp/class.c.
-
-2005-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * cxx-pretty-print.c (pp_cxx_statement): Add prototype. Make static.
- (pp_cxx_function_definition): Make static.
- * cxx-pretty-print.h (pp_cxx_statement): Remove prototype.
- (pp_cxx_function_definition): Likewise.
-
-2005-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * name-lookup.c (print_binding_level): Make static.
- (constructor_name_full): Make static inline.
- (current_decl_namespace): Make static.
- * name-lookup.h (constructor_name_full): Remove prototype.
- (print_binding_level): Likewise.
- (current_decl_namespace): Likewise.
-
-2005-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * decl.h (debug_bindings_indentation): Remove.
-
-2005-01-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * typeck.c: Fix a comment typo.
-
-2005-01-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
-
- PR c++/19208
- * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr
- at least once.
- (tsubst): Use fold_decl_constant_value in place of a bare call to
- integral_constant_value.
-
-2005-01-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * typeck.c (more_qualified_p): Remove.
- * cp-tree.h: Remove the corresponding prototype.
-
-2005-01-19 Matt Austern <austern@apple.com>
-
- * typeck.c (comptypes): Handle return code from objc_comptypes
- correctly.
-
-2005-01-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h, name-lookup.h: Remove unused prototypes.
-
-2005-01-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/19375
- * semantics.c (finish_id_expression): Disable access checking for
- already lookuped FIELD_DECL.
-
-2005-01-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * decl.c (delete_block): Remove.
- * cp-tree.h: Remove the corresponding prototype.
-
- * decl.c (vtable_decl_p, vtype_decl_p, walk_globals_data,
- walk_vtables_r, walk_vtables, walk_globals_r, walk_globals):
- Remove.
- * cp-tree.h: Remove the corresponding prototypes.
-
- * tree.c (count_functions, bound_pmf_p, cp_is_overload_p,
- cp_update_decl_after_saving, name_p): Remove.
- * cp-tree.h: Remove the corresponding prototypes.
-
-2005-01-18 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR c/19472
- * semantics.c (finish_asm_stmt): Strip nops off
- input memory operands.
-
-2005-01-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,
- typeck2.c: Update copyright.
-
-2005-01-16 Kazu Hirata <kazu@cs.umass.edu>
-
- * class.c (get_enclosing_class): Remove.
- * cp-tree.h: Remove the corresponding prototypes.
-
- * cvt.c (convert_lvalue): Remove.
- * cp-tree.h: Remove the corresponding prototype.
-
- * pt.c (tinst_for_decl): Remove.
- * cp-tree.h: Remove the corresponding prototypes.
-
- * tree.c (hash_chainon): Remove.
- * cp-tree.h: Remove the corresponding prototypes.
-
-2005-01-15 Jakub Jelinek <jakub@redhat.com>
-
- PR c++/19263
- * typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
- of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
-
-2005-01-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Make-lang.in (cp-warn): Don't append $(WERROR).
-
-2005-01-10 Kazu Hirata <kazu@cs.umass.edu>
-
- * cp-tree.h: Fix a comment typo.
-
-2005-01-07 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19298
- * pt.c (tsubst_qualified_id): Call convert_from_reference.
-
-2005-01-06 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/19244
- * class.c (add_implicitly_declared_members): Remove dead code.
- * decl.c (grokfndecl): Add sfk parameter. Use it do set
- DECL_CONSTRUCTOR_P.
- (grokdeclarator): Adjust calls to grokfndecl.
- * method.c (implicitly_declare_fn): Improve documentation.
- * parser.c (cp_parser_direct_declarator): Do not consider a
- function to be a constructor if the containing class was
- originally anonymous.
-
-2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/17154
- * search.c (lookup_field_1): Handle using declaration in
- class template partial specialization.
-
-2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- PR c++/19258
- * pt.c (push_access_scope): Handle friend defined in class.
- (pop_access_scope): Likewise.
-
-2005-01-06 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19270
- * pt.c (tsubst_copy) <ARRAY_REF case>: Handle separately.
- (tsubst_copy_and_build) <ARRAY_REF case>: Remove obsolete
- array-new handling code. Use build_x_binary_op.
-
-2005-01-05 Nathan Sidwell <nathan@codesourcery.com>
-
- PR c++/19030
- * cp-tree.h (start_decl): Take pointer to pushed scope, not bool.
- * name-lookup.h (push_scope): Return pushed scope, not flag.
- * name-lookup.c (push_scope): Return scope that should be popped,
- not a flag.
- * decl.c (start_decl): Adjust.
- (grokfndecl): Adjust scope push and pop.
- * decl2.c (check_classfn): Likewise.
- * parser.c (cp_parser_condition, cp_parser_conversion_function_id,
- cp_parser_init_declarator, cp_parser_direct_declarator,
- cp_parser_class_specifier, cp_parser_class_head,
- cp_parser_lookup_name,
- cp_parser_constructor_declarator_p): Likewise.
- * pt.c (instantiate_class_template,
- resolve_typename_type): Likewise.
-
-2005-01-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR c++/14136
- * parser.c (cp_parser_unqualified_id): Do not issue error message
- for typedef-name as destructor declarator when performing an
- uncommitted tentative parse.
-
-2005-01-01 Steven Bosscher <stevenb@suse.de>
-
- PR middle-end/17544
- * decl.c (finish_function): Fix comment. Annotate the compiler
- generated return with the current file name and line 0.
diff --git a/gcc/cp/ChangeLog-2005 b/gcc/cp/ChangeLog-2005
new file mode 100644
index 00000000000..02f0b9d846f
--- /dev/null
+++ b/gcc/cp/ChangeLog-2005
@@ -0,0 +1,3521 @@
+2005-12-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cxx-pretty-print.c (pp_cxx_constant): New. Print
+ string-literal in parens if input program says so.
+ (pp_cxx_primary_expression): Hand off constant printing to
+ pp_cxx_constant.
+ (pp_cxx_pretty_printer_init): Set pp->c_base.constant.
+ (pp_cxx_expression): Use pp_cxx_constant for literals.
+ * error.c (dump_expr): Use pp_constant for literals.
+
+2005-12-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * method.c (make_thunk): Don't set comdat_linkage here.
+ (use_thunk): Make thunk one only here, if thunk target is
+ DECL_ONE_ONLY.
+
+2005-12-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25439
+ * decl.c (grokdeclarator): Remove dead code.
+ * ptree.c (cxx_print_xnode): Handle BASELINK.
+ * parser.c (make_id_declarator): Add sfk parameter.
+ (cp_parser_direct_declarator): Do not pass TYPE_DECLs to
+ make_id_declarator.
+ (cp_parser_declarator_id): Simplify BASELINKs here.
+ (cp_parser_member_declaration): Adjust calls to
+ make_id_declarator.
+
+2005-12-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23171, c++/23172, c++/25417.
+ * typeck.c (build_unary_op): Create temporary variables for
+ compound literals whose addresses are taken.
+ * init.c (expand_aggr_init_1): Use COMPOUND_LITERAL_P.
+ * decl.c (reshape_init_vector): Likewise.
+ (reshape_init): Give it external linkage.
+ (check_initializer): Use COMPOUND_LITERAL_P.
+ (initialize_artificial_var): Allow the initializer to be a
+ CONSTRUCTOR.
+ * call.c (make_temporary_var_for_ref_to_temp): Use
+ create_temporary_var.
+ * cp-tree.h (COMPOUND_LITERAL_P): New macro.
+ (rehape_init): Declare.
+ * typeck2.c (digest_init): Use COMPOUND_LITERAL_P.
+ * semantics.c (finish_compound_literal): Use reshape_init.
+
+2005-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24671
+ * pt.c (instantiate_template): Handle SFINAE.
+
+2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * decl.c (grokdeclarator): Improve diagnostic for friend
+ declarations of class members.
+
+2005-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25369
+ * tree.c (really_overloaded_fn): Tweak comment.
+ * pt.c (tsubst_call_declarator_parms): Remove.
+ (tsubst_copy): Call mark_used on the member referenced by an
+ OFFSET_REF.
+ * semantics.c (finish_qualified_id_expr): Simplify.
+ * decl2.c (mark_used): Accept BASELINKs.
+
+ PR c++/25364
+ * typeck.c (build_unary_op): Pass DECLs not names to
+ build_offset_refs.
+ * init.c (build_offset_ref): Do not do name lookup. Do not call
+ mark_used.
+ * call.c (build_call): Simplify and tidy.
+ * semantics.c (finish_qualified_id_expr): Call mark_used.
+
+2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23333
+ * parser.c (cp_parser_pure_specifier): Check for PURE_ZERO to
+ identify a single '0'.
+
+2005-12-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21228
+ * decl.c (use_eh_spec_block): New function.
+ (store_parm_decls): Use it.
+ (finish_function): Likewise.
+
+2005-12-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24278
+ * init.c (expand_member_init): Print messages about baseclasses
+ using %T rather than %D.
+
+ PR c++/24915
+ * class.c (add_method): Do not treat templates as identical unless
+ their return types are the same.
+
+2005-12-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25300
+ * tree.c (build_qualified_name): Return error_mark_node for
+ erroneous input.
+
+2005-12-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25337
+ * pt.c (tsubst_copy_and_build): Permit dependent types for the
+ object in a class member access expression.
+
+2005-12-10 Terry Laurenzo <tlaurenzo@gmail.com>
+
+ PR java/9861
+ * mangle.c (write_bare_function_type): Mangle return type for
+ methods of Java classes
+
+2005-12-08 Th�dore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * call.c (build_conditional_expr): Print types in error messages.
+
+2005-12-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * expr.c (cxx_expand_expr): Call gcc_unreachable instead of abort.
+
+2005-12-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cp-gimplify.c (gimplify_cp_loop): Use fold_build3.
+
+2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
+
+ * Make-lang.in (c++.all.build, c++.install-normal): Remove.
+
+2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
+
+ * Make-lang.in: Remove all dependencies on s-gtype.
+
+2005-12-06 Aldy Hernandez <aldyh@redhat.com>
+
+ PR C++/24138
+ * decl.c (reshape_init_array_1): Handle max_index of -1.
+
+2005-12-06 Roger Sayle <roger@eyesopen.com>
+
+ * typeck.c (build_binary_op): Issue warning if either operand of a
+ comparison operator is a string literal, except for testing equality
+ or inequality against NULL.
+
+2005-12-06 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/25263
+ * decl.c (compute_array_index_type): Check that itype is an
+ INTEGER_CST node before testing/clearing TREE_OVERFLOW.
+
+2005-12-05 Daniel Berlin <dberlin@dberlin.org>
+
+ * ptree.c (cxx_print_decl): Update to check for decl_common
+ structure.
+
+2005-12-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24173
+ * decl.c (duplicate_decls): Don't rely on DECL_TEMPLATE_INFO after
+ clobbering newdecl.
+
+2005-12-02 Richard Guenther <rguenther@suse.de>
+
+ * semantics.c (simplify_aggr_init_expr): Use buildN instead
+ of build.
+
+2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * parser.c (cp_lexer_new_main): Usr GGC_RESIZEVEC instead of
+ ggc_realloc.
+ (cp_parser_template_argument_list): Use XRESIZEVEC instead of
+ xrealloc.
+ * class.c (pushclass): Likewise.
+
+2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * decl2.c (get_priority_info): Use XNEW, not xmalloc.
+ * decl.c (push_switch): Likewise.
+ * lex.c (handle_pragma_implementation): Likewise.
+ * cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW,
+ not ggc_alloc.
+ (cxx_initialize_diagnostics): Use XNEW, not xmalloc.
+ * class.c (init_class_processing): Use XNEWVEC, not xmalloc.
+ * g++spec.c (lang_specific_driver): Likewise.
+ * mangle.c (save_partially_mangled_name): Likewise.
+ * parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc.
+ (cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc.
+ (cp_parser_sizeof_operand): Likewise.
+ * repo.c (open_repo_file, open_repo_file): Likewise.
+
+2005-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * parser.c (cp_parser_make_typename_type): Call make_typename_type
+ with tf_none instead of magic value 0.
+ (cp_parser_explicit_instantiation): Call do_type_instantiation
+ with tf_error instead of magic value 1.
+ (cp_parser_elaborated_type_specifier): Call make_typename_type
+ with tf_error instead of magic value 1.
+ (cp_parser_class_name): Likewise.
+ (cp_parser_lookup_name): Likewise.
+
+2005-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * parser.c (cp_parser_declaration): Set token2.type to CPP_EOF,
+ not RID_MAX.
+
+2005-11-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/21123
+ * cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference
+ parms in a thunk.
+
+2005-11-30 Ben Elliston <bje@au.ibm.com>
+
+ * typeck.c (build_x_unary_op): Correct spelling in error message.
+
+2005-11-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21166
+ * class.c (check_field_decls): Only set DECL_PACKED on a field
+ when its natural alignment is > BITS_PER_UNIT.
+
+2005-11-27 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/24979
+ * cp-tree.h (DECL_MAIN_P): Remove duplicate definition.
+
+2005-11-26 Richard Henderson <rth@redhat.com>
+
+ * lex.c: Update for pragma_lex rename.
+ * parser.c: Likewise.
+
+2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/9278
+ * decl.c (grokparms): Do not allow typedef-names in a '(void)'
+ parmlist.
+
+2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * typeck2.c (process_init_constructor_union): Remove check for
+ unnamed union members.
+
+2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * name-lookup.c (lookup_name_real): Merge two if's.
+
+2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * pt.c (instantiate_class_template): Clean-up.
+
+2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * pt.c (template_class_depth_real): Remove. Move functionality to ...
+ (template_class_depth): ... here, replacing count_specializations
+ with 0. Adjust comment.
+
+2005-11-24 Richard Guenther <rguenther@suse.de>
+ Dirk Mueller <dmueller@suse.de>
+
+ PR c++/14024
+ * typeck.c (build_reinterpret_cast_1): Use
+ strict_aliasing_warning.
+
+2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/24235
+ * pt.c (check_instantiated_args): Reword diagnostic message about
+ template argument involving local types.
+
+2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/21667
+ * typeck.c (build_array_ref): Avoid code duplicate. Use common
+ C/C++ diagnostic function warn_array_subscript_with_type_char.
+
+2005-11-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/22238
+ * error.c (resolve_virtual_fun_from_obj_type_ref): New.
+ (dump_expr): Use it in <case CALL_EXPR>.
+
+2005-11-21 Richard Henderson <rth@redhat.com>
+
+ * cp-objcp-common.h, name-lookup.c, name-lookup.h: Revert 11-18 patch.
+
+ * name-lookup.c (lookup_name): Remove prefer_type argument.
+ (lookup_name_prefer_type): New.
+ * decl.c (lookup_and_check_tag): Use them.
+ * pt.c (tsubst_friend_class): Likewise.
+ (lookup_template_class): Likewise.
+ (tsubst_copy_and_build): Likewise.
+ * name-lookup.h (lookup_name_prefer_type): New.
+ (lookup_name): Remove declaration.
+
+2005-11-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8355
+ * decl.c (grokfndecl): Set up DECL_TEMPLATE_INFO before calling
+ set_decl_namespace.
+ * name-lookup.c (set_decl_namespace):
+
+2005-11-18 Mike Stump <mrs@apple.com>
+
+ * cp-objcp-common.h (LANG_HOOKS_LOOKUP_NAME): Add.
+ * name-lookup.c (lookup_name_two): Remove.
+ (lookup_name_one): Add.
+ * name-lookup.h (lookup_name_two): Remove.
+ (lookup_name_one): Add.
+
+2005-11-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/24580
+ * method.c (locate_copy): Also use skip_artificial_parms here.
+ (synthesize_exception_spec): Use CLASS_TYPE_P rather than checking
+ for RECORD_TYPE.
+ (locate_ctor): Abort if we fail to find a default constructor.
+
+2005-11-15 Mike Stump <mrs@apple.com>
+
+ * name-lookup.c (lookup_name_two): Add.
+ * name-lookup.h: Likewise.
+
+2005-11-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24667
+ * typeck.c (check_for_casting_away_constness): Use the diag_fn.
+ (build_const_cast_1): Call it, for C-style casts.
+
+2005-11-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24687
+ * pt.c (check_explicit_specialization): Don't check for C linkage.
+ (push_template_decl_real): Likewise.
+ * parser.c (cp_parser_explicit_specialization): Check here.
+ (cp_parser_template_declaration_after_export): And here.
+
+ * parser.c (cp_lexer_get_preprocessor_token): Initialize keyword
+ field.
+
+2005-11-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/24580
+ * method.c (locate_ctor): Skip all artificial parms, not just
+ 'this'.
+
+2005-11-14 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (eof_token): Add initializer for ambiguous_p.
+
+2005-11-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24817
+ * decl.c (check_redeclaration_exception_specification): New
+ function.
+ (duplicate_decls): Use it.
+ * error.c (fndecl_to_string): Print the template parameter list.
+
+ PR c++/20293
+ * cxx-pretty-print.c (pp_cxx_statement): Print qualifying scopes
+ for namespaces.
+ (pp_cxx_original_namespace_definition): Likewise.
+ * name-lookup.c (ambiguous_decl): Don't issue error messages;
+ instead return lists of ambiguous candidates.
+ (select_decl): Handle ambiguous namespace lookups.
+ * parser.c (cp_token): Add ambiguous_p.
+ (cp_lexer_get_preprocessor_token): Set it.
+ (cp_parser_diagnose_invalid_type_name): Avoid duplicate messages
+ when a qualified name uses an invalid scope.
+ (cp_parser_primary_expression): Print ambiguous candidates.
+ (cp_parser_type_parameter): Adjust comment to reflect new
+ parameter name for cp_parser_lookup_name.
+ (cp_parser_template_argument): Likewise.
+ (cp_parser_elaborated_type_specifier): Likewise.
+ (cp_parser_namespace_name): Likewise.
+ (cp_parser_class_name): Print ambiguous candidates.
+ (cp_parser_lookup_name): Rename ambiguous_p parameter to
+ ambiguous_decls. Use it to return a list of ambiguous candiates
+ when a lookup is ambiguous.
+ (cp_parser_lookup_name_simple): Adjust comment to reflect new
+ parameter name for cp_parser_lookup_name.
+
+2005-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/24780
+ * typeck.c (complete_type): Set TYPE_NEEDS_CONSTRUCTING
+ and TYPE_HAS_NONTRIVIAL_DESTRUCTOR flags for all variants
+ of array type.
+
+ PR c++/24761
+ * pt.c (tsubst_copy_asm_operands): New function.
+ (tsubst_expr) <case ASM_EXPR>: Use it.
+
+2005-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/19450
+ * decl.c (redeclaration_error_message): Issue diagnostics about
+ olddecl and newdecl disagreement on __thread property.
+ (grokdeclarator): Set DECL_TLS_MODEL on class static variables.
+
+2005-11-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/21123
+ * method.c (use_thunk): Use build_cplus_new instead of
+ force_target_expr.
+
+2005-11-06 Jason Merrill <jason@redhat.com>
+ James A. Morrison <phython@gcc.gnu.org>
+
+ PR c++/17256
+ * decl2.c (cp_finish_file): Fix conditions for undefined warning.
+ Set TREE_NO_WARNING instead of TREE_PUBLIC.
+ * pt.c (instantiate_pending_templates): Set DECL_INITIAL to avoid
+ a warning on a function we didn't instantiate because of excessive
+ recursion.
+
+2005-11-06 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (record_subobject_offsets): Don't record offsets past
+ biggest empty class for non-empty base classes.
+ (layout_class_type): Use TYPE_SIZE_UNIT, not TYPE_SIZE, when
+ keeping track of the size of emptyclasses.
+
+ PR c++/21308
+ * class.c (sizeof_biggest_empty_class): New variable.
+ (record_subobject_offsets): Don't record offsets past biggest
+ empty class for data members. Replace vbases_p parameter with
+ is_data_member parameter.
+ (build_base_field): Adjust call.
+ (layout_class_type): Likewise. Maintain
+ sizeof_biggest_empty_class.
+
+2005-11-05 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl2.c, init.c, typeck.c: Fix comment typos.
+
+2005-11-04 Richard Guenther <rguenther@suse.de>
+
+ PR c++/22487
+ * init.c (build_vec_init): Build comparison of matching
+ types.
+
+2005-11-03 Josh Conner <jconner@apple.com>
+
+ PR c++/19989
+ pt.c (tsubst): Accept zero-length array if tf_error is set
+ in complain flags. Change error message for negative-
+ length array.
+
+2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cp-tree.h (cp_cpp_error), error.c (cp_cpp_error): Take va_list*
+ parameter.
+
+2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c++/17964
+ * error.c (cp_cpp_error): New function.
+ * cp-tree.h (cp_cpp_error): Declare.
+ * parser.c (cp_lexer_new_main): Set CPP option client_diagnostic
+ and error callback after lexing.
+
+2005-11-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21627
+ * pt.c (register_specialization): Update inline flags on clones.y
+
+2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/24582
+ * decl.c (declare_local_label): Return 0 for variables
+ with error_mark_node as their types.
+
+2005-11-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22434
+ * call.c (build_conditional_expr): Do bad conversions, if there's
+ no other choice.
+
+ PR c++/24560
+ * parser.c (cp_parser_postfix_dot_deref_expression): Improve error
+ message for use of overloaded functions on LHS of "." operator.
+
+ PR c++/19253
+ * parser.c (cp_parser_postfix_expression): Use
+ cp_parser_elaborated_type_specifier to handle typename-types in
+ functional casts.
+ (cp_parser_enclosed_argument_list): Skip ahead to the end of the
+ template argument list if the closing ">" is not found.
+
+ PR c++/24569
+ * pt.c (instantiate_decl): Use cp_finish_decl, not
+ finish_static_data_member_decl.
+
+2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * decl.c (grokfndecl): Remove the setting
+ of the return type of the function type
+ of main after erroring about must returning
+ int.
+
+2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/23229
+ * decl.c (grokfndecl): Create a new function type
+ after erroring out about main not returning int.
+
+2005-10-28 Josh Conner <jconner@apple.com>
+
+ PR c++/22153
+ * parser.c (cp_parser_member_declaration): Detect and handle
+ a template specialization.
+
+2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/23426
+ * decl.c (start_decl): Check that the decl is an
+ error_mark_node before getting the type.
+ Remove the check for the decl's type being an
+ error_mark_node.
+
+2005-10-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24260
+ * parser.c (cp_parser_init_declarator): Pass attributes to
+ grokfield.
+
+2005-10-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22618
+ * search.c (accessible_p): Check access in the outermost set of
+ template parameters.
+
+2005-10-20 Richard Guenther <rguenther@suse.de>
+
+ * decl.c (grokdeclarator): Fix ambiguous pedwarn message.
+
+2005-10-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/22293
+ * decl.c (grokdeclarator): Reject unqualified destructors in
+ friend declarations.
+
+2005-10-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23293
+ * pt.c (convert_template_argument): Use canonical type variants in
+ template specializations.
+
+2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21383
+ * name-lookup.c (arg_assoc): Template args can be null in a
+ template-id-expr.
+
+ PR c++/22604
+ * class.c (update_vtable_entry_for_fn): Don't process invalid
+ covariant overriders.
+
+ PR c++/23118
+ * cp-tree.h (add_method): Add return value.
+ * class.c (add_method): Return success indicator.
+ * semantics.c (finish_member_declaration): Don't add an invalid
+ method to the method list.
+
+2005-10-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21908
+ * call.c (build_new_method_call): Do not show VTT parameters to
+ the user.
+
+2005-10-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23440
+ * parser.c (cp_parser_statement): If the parser reached CPP_EOF,
+ only complain about missing statement.
+
+2005-10-17 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/24386
+ * cp-tree.h (BASELINK_QUALIFIED_P): New.
+ * pt.c (tsubst_copy_and_build): <CALL_EXPR case>: Use it.
+ * typeck.c (finish_class_member_access_expr): Set it.
+
+ PR c++/21353
+ * decl.c (check_default_argument): Don't check
+ processing_template_decl or uses_template_parms here.
+ (grokparms): Only call check_default_argument when not processing
+ a template decl.
+ * parser.c (cp_parser_late_parsing_default_arg): Call
+ check_default_argument when not processing a template decl.
+
+2005-10-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24389
+ * decl2.c (mark_used): Use uses_template_parms instead of
+ dependent_type_p.
+ * init.c (constant_value_1): Handle uninstantiated templates
+ specially.
+ * pt.c (instantiate_decl): Add sanity check.
+
+2005-10-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22173
+ * typeck.c (check_template_keyword): Fix thinko.
+
+2005-10-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/23959
+ * decl.c (pop_switch): Only call c_do_switch_warnings
+ when not processing templates.
+
+2005-10-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22173
+ * cp-tree.h (QUALIFIED_NAME_IS_TEMPLATE): New macro.
+ (check_template_keyword): New function.
+ (finish_id_expression): Change prototoype.
+ (finish_qualified_id_expr): Change prototype.
+ (build_qualified_name): New function.
+ (finish_class_member_access_expr): Change prototype.
+ * init.c (build_offset_ref): Use build_qualified_name.
+ * mangle.c (write_expression): Likewise.
+ * parser.c (cp_parser_primary_expression): Remove qualifying_class
+ parameter. Add address_p and template_arg_p. Use
+ build_qualified_name.
+ (cp_parser_id_expression): Default *template_p to
+ template_keyword_p. Check for invalid uses of the template
+ keyword.
+ (cp_parser_postfix_expression): Eliminate special handling for
+ qualified names. Adjust call to cp_parser_primary_expression.
+ (cp_parser_postfix_dot_deref_expression): Adjust call to
+ cp_parser_id_expression and finish_class_member_access_expr.
+ (cp_parser_template_argument_list): Add comment.
+ (cp_parser_template_argument): Adjust use of
+ cp_parser_primary_expression. Remove call to
+ finish_qualified_id_expr.
+ (cp_parser_lookup_name): Use build_qualified_name.
+ * pt.c (tsubst): Use build_qualified_name.
+ (tsubst_qualified_id): Likewise. Adjust call to
+ finish_qualified_id_expr.
+ (tsubst_copy): Use build_qualified_name.
+ (tsubst_copy_and_build): Adjusts call to finish_id_expression and
+ finish_class_member_access_expr.
+ * semantics.c (finish_non_static_data_member): Use
+ build_qualified_name.
+ (finish_qualified_id_expr): Add template_p and template_arg_p
+ parameters.
+ (finish_id_expression): Remove qualifiying_class parameter. Add
+ template_p, done, address_p, and template_arg_p. Use
+ build_qualified_name. Adjust calls to
+ finish_class_member_acess_expr.
+ * tree.c (build_qualified_name): New function.
+ * typeck.c (check_template_keyword): New function.
+ (finish_class_member_access_expr): Add template_p argument. Check
+ for invalid uses of the template keyword.
+
+2005-10-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21347
+ * class.c (maybe_warn_about_overly_private_class): Lazy
+ constructors are public.
+
+2005-10-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19565
+ * call.c (convert_like_real): Rely on convert_and_check to issue
+ warnings about overflow and conversion to unsigned.
+ * decl.c (finish_enum): Use the location of the enumerators, not
+ the closing brace of the enumeration, when reporting warnings
+ about conversions.
+ (build_enumerator): Use error_mark_node for erroneous values.
+ * typeck2.c (digest_init): Remove reference to "signature pointer"
+ from comment.
+
+2005-10-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/17796
+ * optimize.c (update_cloned_parm): Add FIRST parameter. Use it.
+ (maybe_clone_body): Track the first clone.
+
+2005-10-13 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/23984
+ * class.c (build_base_path): The vtable is always the first thing
+ in the vtt.
+
+2005-10-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20721
+ * cp-tree.h (DECL_NONTRIVIALLY_INITIALIZED_P): New macro.
+ * decl.c (duplicate_decls): Merge it into new declarations.
+ (decl_jump_unsafe): Use it, rather than DECL_INITIAL.
+ (cp_finish_decl): Set it, when appropriate.
+
+ PR c++/22180
+ * call.c (build_new_method_call): Correct pretty-printing of
+ destructor names.
+ * pt.c (tsubst_qualified_id): Recognize invalid uses of "~T" as an
+ identifier.
+
+ PR c++/23694
+ * decl.c (start_method): Return error_mark_node for errors.
+
+ PR c++/23307
+ * pt.c (push_template_decl_real): Complain about attempts to
+ declare template variables.
+
+ PR c++/22352
+ * pt.c (tsubst_template_parms): Set processing_template_decl while
+ processing the parameters.
+ (tsubst_decl): Set processing_template_decl when substituting into
+ a TEMPLATE_DECL.
+
+ PR c++/22405
+ * pt.c (most_specialized_instantiation): Robustify.
+
+ PR c++/22464
+ * semantics.c (finish_id_expression): Issue errors about uses of
+ local variables in containing functions even in templates.
+
+2005-10-12 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/21801
+ PR target/23589
+ * class.c (finish_struct_1): Call
+ targetm.cxx.adjust_class_at_definition.
+
+
+2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21592
+ * pt.c (build_non_dependent_expr): Don't wrap a COMPONENT_REF
+ with already looked up member functions. Assert we're not
+ returning a NON_DEPENDENT_EXPR with unknown type.
+ * typeck.c (finish_class_member_access_expr): We can get
+ non-template-id-expr baselinks. If the lookup finds a baselink,
+ remember it even inside templates.
+
+ PR c++/23797
+ * parser.c (cp_parser_functional_cast): Cope when TYPE is not a
+ TYPE_DECL. Use dependent_type_p to check type.
+ * pt.c (uses_template_parms_p): Use dependent_type_p for a
+ TYPE_DECL.
+ (type_dependent_expression_p): Assert we've not been given a
+ TYPE_DECL.
+
+ PR c++/21117
+ * decl.c (check_function_type): Correctly overwrite incomplete
+ return type with void type.
+ * typeck.c (check_return_expr): If the function's return type is
+ void, don't try and convert a return expr.
+
+2005-10-12 David Edelsohn <edelsohn@gnu.org>
+
+ PR c++/23730
+ * call.c (build_object_call): If BINFO is NULL, bypass
+ lookup_fnfields and set fns to NULL_TREE.
+
+2005-10-12 Paolo Bonzini <bonzini@gnu.org>
+
+ PR c++/24052
+ * error.c (dump_expr): Pass LABEL_DECL to dump_decl. Print
+ an ADDR_EXPR of a LABEL_DECL as &&.
+
+2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19964
+ * class.c (walk_subobject_offsets): Don't walk error_mark_node.
+
+2005-10-11 Ian Lance Taylor <ian@airs.com>
+
+ PR c++/8057
+ * cvt.c (convert_to_void): Don't warn about unused values when
+ processing a template declaration.
+
+2005-10-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21089
+ * call.c (convert_like_real): Use decl_constant_value, not
+ integral_constant_value.
+ * init.c (constant_value_1): New function.
+ (integral_constant_value): Use it.
+ (decl_constant_value): Likewise.
+ * typeck.c (decay_conversion): Use decl_constant_value, not
+ integral_constant_value.
+
+ PR c++/21369
+ * parser.c (cp_parser_elaborated_type_specifier): Don't treat
+ class types as templates if the type is not appearing as part of a
+ type definition or declaration.
+
+2005-10-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24277
+ * pt.c (instantiate_decl): Call finish_static_data_member_decl for
+ static data members.
+
+2005-10-10 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+ Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23437
+ * parser.c (cp_parser_template_argument_list): Do not treat
+ contents of argument list as part of a constant expression.
+
+2005-10-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24139
+ * decl.c (grokdeclarator): Do not require template parameter lists
+ for explicitly specialized class.
+ * error.c (dump_aggr_type): Do not dump template arguments for
+ non-primary specializations.
+ (dump_function_name): Likewise.
+
+ PR c++/24275
+ * pt.c (instantiate_decl): Instantiate the initializer of
+ a static data member in the namespace containing the class
+ containing the static data member.
+
+2005-10-08 James A. Morrison <phython@gcc.gnu.org>
+
+ PR c++/22172
+ * parser.c (cp_parser_postfix_expression) <RID_TYPENAME>: Treat nontype
+ scopes as nondependent.
+
+2005-10-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * call.c (resolve_args): Remove redundant test.
+
+2005-10-05 Paolo Bonzini <bonzini@gnu.org>
+
+ PR tree-optimization/21419
+ PR tree-optimization/24146
+ PR tree-optimization/24151
+
+ * semantics.c (finish_asm_stmt): Call readonly_error if outputs are
+ read-only. Set ASM_VOLATILE_P for asms without outputs.
+
+2005-10-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/23513
+ * call.c (joust): Adjust length count to more_specialized_fn.
+ * pt.c (more_specialized_fn): Cope with non-static member vs
+ non-member.
+
+2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR middle-end/23125
+ * decl.c (make_rtl_for_nonlocal_decl): Use set_user_assembler_name
+ instead of change_decl_assembler_name.
+
+2005-10-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * error.c (dump_type) <UNKNOWN_TYPE>: Print reworded message.
+
+2005-10-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/17775
+ * repo.c: Include flags.h.
+ (finish_repo): Add -frandom-seed to the arguments.
+
+2005-10-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22621
+ * parser.c (cp_parser_template_argument): Don't turn "T::f" into
+ "(*this).T::f".
+ * pt.c (convert_nontype_argument): Remove ??? comment.
+
+ PR c++/23840
+ * tree.c (lvalue_p_1): A VA_ARG_EXPR with class type is an lvalue,
+ when class rvalues are lvalues.
+
+2005-09-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/16782
+ * decl.c (grokdeclarator): Always pedwarn about overqualified
+ member names.
+
+2005-09-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22147
+ * name-lookup.c (maybe_process_template_type_declaration): Don't
+ treat forward declarations of classes as templates just because
+ we're processing_template_decl.
+ * pt.c (tsubst_decl): Clear DECL_TEMPLATE_INFO for friend
+ functions.
+
+2005-09-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/13764
+ * cp-tree.h (FUNCTION_NEEDS_BODY_BLOCK): New macro.
+ * name-lookup.c (pushdecl_maybe_friend): Check it.
+ * decl.c (begin_function_body): Do nothing if it's false.
+ (finish_function_body): Ditto.
+ (outer_curly_brace_block): New fn.
+ (finish_function): Use it.
+
+2005-09-26 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/15855
+ * decl2.c (do_static_destruction): Remove.
+ (finish_static_initialization_or_destruction): Likewise.
+ (DECL_EFFECTIVE_INIT_PRIORITY): New macro.
+ (NEEDS_GUARD_P): Likewise.
+ (do_static_initialization): Rename to
+ do_static_initialization_or_destruction. Process all
+ initializers/destructors and handle common conditionalizing.
+ (start_static_initialization_or_destruction): Rename to
+ one_static_initialization_or_destruction. Handle only
+ decl-specific conditionalizing.
+ (cp_finish_file): Call do_static_initialization_or_destruction.
+
+2005-09-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/21983
+ * class.c (find_final_overrider): Move diagnostic about no unique final
+ overrider to...
+ (update_vtable_entry_for_fn): ... here.
+
+2005-09-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23993
+ * init.c (integral_constant_value): Use DECL_INTEGRAL_CONSTANT_VAR_P.
+
+2005-09-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23965
+ * call.c (resolve_args): Return error_mark_node on arguments
+ whose TREE_TYPE is error_mark_node.
+
+2005-09-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/23947
+ * rtti.c (get_pseudo_ti_init): Recompute ti pointer after
+ get_tinfo_ptr calls.
+
+2005-09-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23914
+ * parser.c (cp_parser_enclosed_template_argument_list): Make sure
+ skip_evaluation is false when processing template arguments.
+
+ PR c++/21514
+ * pt.c (check_instantiated_args): Treat uses of anonymous types as
+ causing type-deduction failure.
+
+2005-09-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/23357
+ * cp-tree.def (SIZEOF_EXPR, ALIGNOF_EXPR): Change code class to
+ tcc_expression.
+
+2005-09-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23896
+ * pt.c (tsubst_aggr_type): Make sure skip_evaluation is false when
+ processing template arguments.
+
+ * pt.c (check_explicit_instantiation_namespace): Fix typo.
+
+ PR c++/13140
+ * decl.c (check_class_member_definition_namespace): New function.
+ (grokfndecl): Use it.
+ (grokvardecl): Likewise.
+ (grokdecl): Improve documentation.
+ * pt.c (check_explicit_instantiation_namespace): New function.
+ (register_specialization): Call check_specialization_namespace
+ when replacing an implicitly instantiated function.
+ (check_explicit_specialization): Ensure that DECL_CONTEXT is set
+ correctly for namespace-scope specializations.
+ (do_decl_instantiation): Use
+ check_explicit_instantiation_namespace.
+ (do_type_instantiation): Likewise.
+
+2005-09-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/23725
+ * error.c (dump_decl): <USING_DECL case> Use USING_DECL_SCOPE.
+
+2005-09-13 Bastian Blank <waldi@debian.org>
+
+ PR c++/16171
+ * mangle.c (find_substitution): Do not use special substitutions
+ for identifiers not in std::.
+
+2005-09-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23839
+ * typeck.c (cxx_mark_addressable): Only check DECL_HARD_REGISTER
+ for VAR_DECLs.
+
+2005-09-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23842
+ * pt.c (tsubst_default_argument): Do treat default argument
+ expressions as occurring in the context of the function called.
+
+2005-09-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23841
+ * parser.c (cp_parser_primary_expression): Recognize the closing
+ ">" of a template-argument-list after a floating-point literal as
+ the end of a cast expression.
+
+2005-09-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23789
+ * cvt.c (perform_qualification_conversions): Don't create
+ unnecessary NOP_EXPRs.
+ * pt.c (tsubst_template_arg): Use fold_non_dependent_expr.
+
+2005-09-12 Ian Lance Taylor <ian@airs.com>
+
+ PR g++/7874
+ * cp-tree.h (struct lang_decl_flags): Add hidden_friend_p
+ bitfield. Make dummy bitfield one bit smaller.
+ (DECL_HIDDEN_FRIEND_P): Define.
+ (pushdecl_maybe_friend): Declare.
+ (pushdecl_top_level_maybe_friend): Declare.
+ * decl.c (duplicate_decls): Add newdecl_is_friend parameter.
+ Change prototype and all callers. Add assertion that a
+ DECL_ARTIFICIAL FUNCTION_DECL is not DECL_HIDDEN_FRIEND_P. Set
+ DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P in duplicated decl if
+ appropriate.
+ * name-lookup.c (supplement_binding): Don't ignore a
+ DECL_HIDDEN_FRIEND_P.
+ (pushdecl_maybe_friend): Break out contents of pushdecl. Add
+ is_friend parameter. Set DECL_ANTICIPATED and
+ DECL_HIDDEN_FRIEND_P for a friend function.
+ (pushdecl): Just call pushdecl_maybe_friend.
+ (pushdecl_with_scope): Add is_friend parameter. Change prototype
+ and all callers.
+ (pushdecl_namespace_level): Likewise.
+ (push_overloaded_decl): Likewise. Check DECL_HIDDEN_FRIEND_P as
+ well as DECL_ANTICIPATED when checking for a builtin.
+ (do_nonmember_using_decl): Check DECL_HIDDEN_FRIEND_P as well as
+ DECL_ANTICIPATED when checking for a builtin.
+ (do_nonmember_using_decl): Likewise.
+ (pushdecl_top_level_1): Add is_friend parameter. Change all
+ callers.
+ (pushdecl_top_level_maybe_friend): New function.
+ (remove_hidden_names): New function.
+ (struct arg_lookup): Add args field.
+ (friend_of_associated_class_p): New static function.
+ (arg_assoc_namespace): Ignore hidden functions which are not
+ friends of an associated class of some argument.
+ (lookup_arg_dependent): Remove hidden functions from list passed
+ in. Initialize k.args.
+ * name-lookup.h (remove_hidden_names): Declare.
+ * friend.c (do_friend): Call pushdecl_maybe_friend instead of
+ pushdecl.
+ * call.c (add_function_candidate): Change DECL_ANTICIPATED test to
+ an assertion, with a check for DECL_HIDDEN_FRIEND_P.
+ (build_new_function_call): Add koenig_p parameter. Change
+ prototype and callers.
+ * pt.c (register_specialization): Add is_friend parameter. Change
+ all callers.
+ (push_template_decl_real): Change is_friend parameter to bool.
+ Change prototype and all callers.
+ (tsubst_friend_class): Call pushdecl_top_level_maybe_friend
+ instead of pushdecl_top_level.
+
+2005-09-11 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (build_anon_union_vars): Copy attributes from the base addr.
+ * pt.c (tsubst_decl): Substitute in DECL_VALUE_EXPR.
+
+2005-09-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * parser.c (cp_parser_translation_unit): Simplify. The while-block
+ was actually executed at most once.
+
+2005-09-09 Richard Henderson <rth@redhat.com>
+
+ PR debug/20998
+ * cp-tree.def (ALIAS_DECL): Remove.
+ * cp-lang.c (cp_init_ts): Remove support for it.
+ * error.c (dump_decl): Likewise.
+ * name-lookup.c (pushdecl): Likewise.
+ * semantics.c (finish_id_expression): Likewise.
+ * decl2.c (build_anon_union_vars): Use a VAR_DECL with
+ DECL_VALUE_EXPR instead.
+
+2005-09-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22252
+ * decl.c (start_preparsed_function): Do not pay attention to
+ #pragma interface for implicitly-defined methods.
+ * decl2.c (cp_finish_file): Do not complain about uses of inline
+ functions that have bodies, even if we decided not to emit the
+ body in this translation unit.
+ * semantics.c (note_decl_for_pch): Do not mess with linkage.
+ (expand_or_defer_fn): Make inline, non-template functions COMDAT
+ at this point.
+
+2005-09-08 Richard Henderson <rth@redhat.com>
+
+ PR debug/23190
+ * decl.c (wrapup_globals_for_namespace): Call
+ emit_debug_global_declarations.
+ * decl2.c (cp_finish_file): Likewise.
+
+2005-09-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23691
+ * decl2.c (mark_used): Instantiate static data members initialized
+ by constants, even in a template.
+
+2005-09-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR obj-c++/16816
+ * parser.c (cp_parser_objc_selector_expression): Treat CPP_SCOPE as
+ two CPP_COLON.
+
+2005-09-07 Richard Guenther <rguenther@suse.de>
+
+ * cp-gimplify.c (cp_gimplify_expr): Create empty CONSTRUCTOR
+ for EMPTY_CLASS_EXPR.
+
+2005-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/23075
+ * typeck.c (check_return_expr): Add no_warning argument. Set
+ *no_warning to true if "return-statement with no value, in function
+ returning" warning has been issued.
+ * cp-tree.h (check_return_expr): Adjust prototype.
+ * semantics.c (finish_return_stmt): Set TREE_NO_WARNING if
+ check_return_expr set *no_warning to true.
+
+2005-09-06 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (rvalue): New function.
+ * call.c (build_conditional_expr): Use it.
+ * init.c (build_new_1): Likewise.
+ * rtti.c (build_dynamic_cast_1): Likewise.
+ * tree.c (rvalue): New function.
+ * typeck.c (build_unary_op): Use it.
+ (build_static_cast_1): Likewise.
+
+ PR c++/9782
+ * init.c (build_new_1): Make sure the entire array type is
+ complete, not just its element types.
+
+2005-09-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * decl.c (check_elaborated_type_specifier): Remove redundant check.
+
+2005-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/23056
+ * typeck.c (ignore_overflows): New helper function.
+ (build_static_cast_1): Use it.
+
+2005-09-06 Kazu Hirata <kazu@codesourcery.com>
+
+ * cp-tree.h, decl.c, decl2.c, semantics.c: Fix comment typos.
+ Follow spelling conventions.
+
+2005-09-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23667
+ * pt.c (tsubst_decl): Clear DECL_TEMPLATE_INSTANTIATED when
+ copying a VAR_DECL.
+
+2005-09-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21440
+ * semantics.c (finish_stmt_expr_expr): Add an explicit
+ initialization to the last statement in the statement-expression.
+ * (finish_stmt_expr): Adjust accordingly.
+
+2005-09-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23699
+ * decl2.c (mark_used): Always instantiate static data members
+ initialized by constant expressions.
+ * pt.c (instantiate_decl): Instantiate the initializers for static
+ data members initialized by constant expressions.
+
+ PR c++/21687
+ * semantics.c (expand_or_defer_fn): Do not call ggc_collect when
+ finishing processing for a template function in a local class.
+ Revert:
+ 2005-09-02 Mark Mitchell <mark@codesourcery.com>
+ * parser.c (cp_parser_class_specifier): Push/pop GC contexts
+ around functions in local classes.
+
+2005-09-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21687
+ * parser.c (cp_parser_class_specifier): Push/pop GC contexts
+ around functions in local classes.
+
+2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR obj-c++/23640
+ * decl2.c (cp_finish_file): If this is obj-c++ and we need a static
+ init, call generate_ctor_or_dtor_function.
+
+2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/13377
+ * parser.c (cp_parser_lookup_name): Pass LOOKUP_COMPLAIN to
+ lookup_name_real on final parse.
+
+2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23639
+ * semantics.c (qualified_name_lookup_error): Do not complain again
+ on invalid scope.
+
+2005-08-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23586
+ * parser.c (cp_parser_namespace_name): Move diagnostic for
+ invalid namespace-name to here from ...
+ * name-lookup.c (do_namespace_alias): ... here and ...
+ (do_using_directive): ... here. Remove dead code.
+
+2005-08-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23099
+ * cp-tree.h (saved_scope): Add skip_evaluation.
+ * decl.c (start_decl): Use DECL_INITIALIZED_IN_CLASS_P, not
+ DECL_INITIAL, to determine whether or not a static data member was
+ initialized in the class-specifier.
+ (cp_finish_decl): Add comment.
+ * init.c (integral_constant_value): Subtitute into the
+ initializers for static data members in templates.
+ * name-lookup.c (push_to_top_level): Save skip_evaluation.
+ (pop_from_top_level): Restore it.
+ * pt.c (instantiate_class_template): Do not substitute into the
+ intializers of static data members when instantiating a class.
+ (regenerate_decl_from_template): Simplify.
+ (instantiate_decl): Tidy. Substitute into the initializer for a
+ static data member even when the definition of the data member is
+ not available.
+
+2005-08-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19004
+ * pt.c (uses_template_parms): Handle IDENTIFIER_NODE.
+ (type_dependent_expression_p): Allow BASELINKs whose associated
+ functions are simply a FUNCTION_DECL.
+
+ PR c++/23491
+ * cp-tree.h (build_vec_init): Adjust prototype.
+ * init.c (perform_member_init): Adjust call to build_vec_init.
+ (build_aggr_init): Likewise.
+ (build_new_1): Do not call build_default_init for array types.
+ (build_vec_init): Add explicit_default_init_p parameter. Perform
+ default initialization of vector elements when set.
+ * typeck.c (build_modify_expr): Adjust call to build_vec_init.
+
+2005-08-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20817
+ * typeck.c (build_x_unary_op): Make sure OFFSET_REF is not for a
+ ->*.
+
+2005-08-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/22454
+ * parser.c (cp_lexer_peek_nth_token): Relax assert.
+
+2005-08-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/23044
+ * pt.c (tsubst_qualified_id): A SCOPE_REF can still remain.
+
+2005-08-22 James E Wilson <wilson@specifix.com>
+
+ PR tree-optimization/23426
+ * decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for
+ array size check.
+
+2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/22233
+ * pt.c (push_template_decl_real): Return error_mark_node if the
+ number of template parameters does not match previous definition.
+
+2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23089
+ * decl.c (require_complete_types_for_parms): Mark incomplete types
+ as invalid.
+
+2005-08-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * parser.c (cp_parser_nth_token_starts_template_argument_list_p):
+ Fix typo in leading comment.
+
+2005-08-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * name-lookup.c, ptree.c: Delete HOST_PTR_PRINTF.
+
+2005-08-15 Fariborz Jahanian <fjahanian@apple.com>
+
+ * cp-tree.h (can_convert_arg, fn_type_unification): New argument.
+ * call.c (add_template_candidate_real): Pass down 'flags' to
+ fn_type_unification.
+ (can_convert_arg): New 'flags' argument. Pass it to call to
+ implicit_conversion instead of LOOKUP_NORMAL.
+ (can_convert): Add LOOKUP_NORMAL to call to can_convert_arg.
+ * class.c (resolve_address_of_overloaded_function): Ditto.
+ (resolve_address_of_overloaded_function): Ditto.
+ * decl.c (reshape_init, check_default_argument): Ditto.
+ * typeck.c (build_ptrmemfunc): Ditto.
+ * pt.c (type_unification_real): Add 'flags' argument.
+ (fn_type_unification): Pass 'flags' to type_unification_real.
+ (type_unification_real): Pass new 'flags' argument to call to
+ can_convert_arg.
+
+2005-08-12 Giovanni Bajo <giovannibajo@libero.it>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21799
+ PR c++/8271
+ * pt.c (unify) <METHOD_TYPE>: Check this-pointer cv-qualifiers
+ explicitly.
+
+2005-08-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21799
+ Revert my 2005-07-08 patch
+ * pt.c (type_unification_real): Remove is_method_argument and
+ assoicated checks.
+ (fn_type_unification, unify): Adjust type_unification_real calls.
+
+2005-08-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23266
+ * decl2.c (grokfield): Check that method is not static before
+ marking it as pure.
+
+2005-08-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/23219
+ * name-lookup.c (pushtag): Process the template type before
+ altering the identifier lookup fields. Remove unreachable code
+ creating an empty stub decl.
+
+2005-08-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/20646
+ * decl.c (grokdeclarator): Reset storage_class after error.
+
+2005-08-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/22508
+ * init.c (build_new_1): Check for empty candidate list.
+
+2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23191
+ * pt.c (tsubst) <case METHOD_TYPE>: Check for error_mark_node
+ before calling build_exception_variant.
+
+2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19498
+ * pt.c (tsubst_decl) <case TEMPLATE_DECL>: Return ERROR_MARK_NODE
+ if substitution of template args did not succeed.
+
+2005-08-06 Michael Matz <matz@suse.de>
+
+ * method.c (use_thunk): Call init_insn_lengths.
+
+2005-08-05 James A. Morrison <phython@gcc.gnu.org>
+
+ PR c++/22514
+ * name-lookup.c (cp_emit_debug_info_for_using): Do nothing if
+ sorrycount or errorcount are nonzero.
+
+2005-08-05 Mark Mitchell <mark@codesourcery.com>
+
+ * name-lookup.c (pushtag): Remove accidental commit from:
+ 2004-12-21 Mark Mitchell <mark@codesourcery.com>
+ PR c++/19063
+ * decl.c (grokdeclarator): Return error_mark_node, not
+ void_type_node, to indicate errors.
+ * parser.c (cp_parser_template_parameter_list): Robustify.
+ (cp_parser_template_parameter): Likewise.
+
+2005-08-01 Kazu Hirata <kazu@codesourcery.com>
+
+ * class.c, decl.c, name-lookup.c, pt.c, typeck.c, typeck2.c:
+ Fix comment typos.
+
+2005-07-29 Kazu Hirata <kazu@codesourcery.com>
+
+ * method.c: Fix a comment typo.
+
+2005-07-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22545
+ * call.c (add_builtin_candidate): Adjust for changes in
+ representation of pointer-to-member types.
+
+2005-07-28 Mike Stump <mrs@apple.com>
+
+ * pt.c (check_explicit_specialization): Add visibility logic.
+ (lookup_template_class): Likewise.
+ (instantiate_class_template): Likewise.
+
+2005-07-27 Devang Patel <dpatel@apple.com>
+
+ * name-lookup.c (pushtag): Do no set DECL_IGNORED_P bit.
+
+2005-07-25 Ian Lance Taylor <ian@airs.com>
+
+ * ptree.c (cxx_print_identifier): Print a leading space if the
+ indent level is 0.
+
+2005-07-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (convert_for_arg_passing): Check function pointers when
+ -Wmissing-format-attribute is activated.
+ * typeck.c (convert_for_assignment): Likewise.
+
+2005-07-22 Manfred Hollstein <mh@suse.com>
+
+ * parser.c (cp_parser_declaration): Fix unitialised warnings.
+
+2005-07-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * class.c (build_base_path): Fix typo.
+
+2005-07-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/22358
+ * class.c (build_base_path): Convert BINFO_OFFSET to the correct type.
+
+2005-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * call.c: Fix comment typo(s).
+ * cxx-pretty-print.h: Likewise.
+ * name-lookup.c: Likewise.
+ * parser.c: Likewise.
+
+2005-07-20 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR c++/2922
+ * semantics.c (perform_koenig_lookup): For dependent calls, just
+ return the set of functions we've found so far. Later, it will be
+ augmented by those found through argument-dependent lookup.
+ * name-lookup.c (lookup_arg_dependent): Implement DR 164 by removing
+ the optimization that skips namespaces where the functions were
+ originally found.
+
+2005-07-20 Giovanni Bajo <giovannibajo@libero.it>
+
+ Make CONSTRUCTOR use VEC to store initializers.
+ * call.c (convert_default_arg): Update call to digest_init.
+ * class.c (dump_class_hierarchy, dump_array): Update to cope with
+ VEC in CONSTRUCTOR_ELTS.
+ * cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
+ (finish_compound_literal, digest_init): Update declaration.
+ * decl.c (struct reshape_iter): New data type.
+ (reshape_init_array): Rename to...
+ (reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
+ (reshape_init): Rewrite from scratch. Split parts into...
+ (reshape_init_array, reshape_init_vector, reshape_init_class,
+ reshape_init_r): New functions.
+ (check_initializer): Update call to reshape_init. Remove obsolete
+ code.
+ (initialize_artificial_var, cp_complete_array_type): Update to cope
+ with VEC in CONSTRUCTOR_ELTS.
+ * decl2.c (grokfield): Update calls to digest_init.
+ (mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
+ * error.c (dump_expr_init_vec): New function.
+ (dump_expr): Use dump_expr_init_vec.
+ * init.c (build_zero_init, build_vec_init): Update to cope with VEC
+ in CONSTRUCTOR_ELTS.
+ (expand_default_init): Update call to digest_init.
+ * parser.c (cp_parser_postfix_expression): Use a VEC for the
+ initializers.
+ (cp_parser_initializer_list): Build a VEC of initializers.
+ * pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
+ in CONSTRUCTOR_ELTS.
+ * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
+ ptm_initializer, class_initializer, get_pseudo_ti_init): Use
+ build_constructor_from_list instead of build_constructor.
+ * semantics.c (finish_compound_literal): Update call to digest_init.
+ * tree.c (stabilize_init): Update to cope with VEC in
+ CONSTRUCTOR_ELTS.
+ * typeck.c (build_ptrmemfunc1): Likewise.
+ * typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
+ Likewise.
+ (store_init_value): Use build_constructor_from_list and update call
+ to digest_init.
+ (digest_init): Rewrite.
+ (process_init_constructor): Rewrite from scratch. Split into...
+ (process_init_constructor_array, picflag_from_initializer,
+ process_init_constructor_record, process_init_constructor_union):
+ New functions.
+ (PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
+ New macros.
+ (build_functional_cast): Use build_constructor_from_list instead of
+ build_constructor.
+
+2005-07-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22263
+ * cp-tree.h (instantiate_decl): Change prototype.
+ * decl2.c (mark_used): Adjust accordingly.
+ * pt.c (do_decl_instantiation): Likewise.
+ (instantiate_class_member): Likewise.
+ (instantiate_decl): Rename undefined_ok as expl_inst_class_mem_p.
+ Clear DECL_INTERFACE_KNOWN for an explicitly instantiated template
+ that has no definition available.
+ (instantiate_pending_templates): Adjust call to instantiate_decl.
+
+2005-07-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22139
+ * cp-tree.h (DECL_TEMPLATE_INFO): Improve documentation.
+ * decl.c (duplicate_decls): Re-register template specializations
+ for functions that have DECL_TEMLPLATE_INFO, even if they do not
+ have DECL_TEMPLATE_INSTANTIATION set.
+
+2005-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (diagnostic_fn_t): New.
+ (build_temp, convert_like_real): Use diagnostic_fn_t.
+
+2005-07-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22204
+ * repo.c (repo_emit_p): Robustify.
+
+2005-07-14 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR c++/22452
+ * tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL.
+
+2005-07-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22132
+ * call.c (implicit_conversion): Add c_cast_p parameter.
+ (standard_conversion): Likewise. Allow conversions between
+ differently-qualified pointer types when performing a C-style
+ cast.
+ (add_function_candidate): Adjust callee.
+ (build_builtin_candidate): Likewise.
+ (build_user_type_conversion_1): Likewise.
+ (conditional_conversion): Likewise.
+ (can_convert_arg): Likewise.
+ (can_convert_arg_bad): Likewise.
+ (perform_implicit_conversion): Likewise.
+ * cp-tree.h (comp_ptr_ttypes_const): Declare.
+ * typeck.c (comp_ptr_ttypes_const): Give it external linkage.
+ Return bool.
+
+2005-07-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20172
+ * pt.c (tsubst_template_parms): Check for invalid non-type
+ parameters.
+
+2005-07-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup,
+ decl_shadowed_for_var_insert): Move over to cp-objcp-common.c.
+ (cp_init_ts): Call init_shadowed_var_for_decl.
+ Remove include of gt-cp-cp-lang.h.
+ * cp-objcp-common.c (shadowed_var_for_decl,
+ decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from
+ cp-lang.c.
+ (init_shadowed_var_for_decl): New function to initialize
+ shadowed_var_for_decl.
+ Include gt-cp-cp-objcp-common.h.
+ * Make-lang.in (gt-cp-lang.h): Remove.
+ (gt-cp-cp-objcp-common.h): Add.
+ (cp/cp-lang.o): Remove dependancy on gt-cp-lang.h.
+ (cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h.
+ * config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c.
+ * cp-tree (init_shadowed_var_for_decl): Add prototype.
+
+2005-07-08 Daniel Berlin <dberlin@dberlin.org>
+
+ * Make-lang.in: Add gt-cp-lang.h.
+ (cp-lang.o): Ditto.
+ * class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
+ the field.
+ * config-lang.in: Add cp-lang.c to gtfiles.
+ * cp-lang.c: Include hashtab.h.
+ (cp_init_ts): New function.
+ (LANG_HOOK_INIT_TS): Use macro.
+ (decl_shadowed_for_var_lookup): New function.
+ (decl_shadowed_for_var_insert): Ditto.
+ * cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
+ (NON_THUNK_FUNCTION_CHECK): Ditto.
+ (DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
+ (DECL_INIT_PRIORITY): Ditto.
+ (DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
+ (DECL_SHADOWED_FOR_VAR): Use hashtable.
+ (SET_DECL_SHADOWED_FOR_VAR): Ditto.
+ * decl.c (duplicate_decls): Update for new/updated structures.
+ (poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
+ * decl2.c (start_static_initialization_or_destruction): Deal with
+ priority.
+ * pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
+ SET_DECL_RTL.
+ * tree.c (handle_init_priority_attribute): Handle priority.
+
+2005-07-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21799
+ * pt.c (type_unification_real): Add is_method argument. Use it
+ for this pointer unification.
+ (fn_type_unification): Adjust type_unification_real call.
+ (unify): Likewise.
+
+2005-07-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * pt.c (type_unification_real): Remove allow_incomplete argument.
+ Remove unreachable code.
+ (fn_type_unification): Adjust call to type_unification_real.
+ (unify): Likewise.
+
+2005-07-05 Paolo Bonzini <bonzini@gnu.org>
+
+ * Makefile.in (class.o, decl2.o): Adjust dependencies.
+ * class.c: Include tree-dump.h.
+ * decl2.c: Include tree-dump.h.
+
+2005-07-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * dump.c: Use dump_string_field.
+
+2005-07-03 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cp-tree.h (GCC_DIAG_STYLE): #undef before defining. Change
+ minimum GCC version for format checking to 4.1.
+
+2005-07-02 Kazu Hirata <kazu@codesourcery.com>
+
+ * Make-lang.in (cc1plus-checksum.c): Use
+ build/genchecksum$(build_exeext), not build/genchecksum$(exeext).
+
+2005-07-02 Joseph S. Myers <joseph@codesourcery.com>
+
+ * name-lookup.c, parser.c: Use %q, %< and %> to quote in
+ diagnostics.
+
+2005-07-02 Zack Weinberg <zack@codesourcery.com>
+ Joseph S. Myers <joseph@codesourcery.com>
+
+ * error.c (location_of): Add comment.
+ (locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
+ * cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
+ * call.c, class.c, decl.c, decl2.c, friend.c, init.c,
+ name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
+ typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
+ or cp_pedwarn_at. Mark up some diagnostic strings with N_.
+
+2005-06-30 Daniel Berlin <dberlin@dberlin.org>
+
+ * decl.c (require_complete_types_for_parms): Call relayout_decl
+ instead of layout_decl.
+
+2005-06-30 Zack Weinberg <zack@codesourcery.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * cp-lang.c: No need to include cxx-pretty-print.h.
+ * error.c (cp_printer): Update signature. No need to process
+ flags.
+ (print_instantiation_partial_context): Output last newline
+ with pp_base_newline.
+ * Make-lang.in: Update dependencies.
+
+2005-06-30 Steven Bosscher <stevenb@suse.de>
+
+ * decl.c (start_decl): Replace DECL_THREAD_LOCAL with
+ DECL_THREAD_LOCAL_P.
+ (cp_finish_decl): Likewise.
+ (grokvardecl): Set the default DECL_TLS_MODEL here.
+
+2005-06-28 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cvt.c (ocp_convert): Use invalid_conversion hook.
+ * typeck.c (build_binary_op): Use invalid_binary_op hook.
+ (build_unary_op): Use invalid_unary_op hook.
+
+2005-06-28 Paul Brook <paul@codesourcery.com>
+
+ * Make-lang.in (cp/except.o): Depend on $(TARGET_H)
+ * except.c: Include target.h.
+ (init_exception_processing): Initialize unwind_resume_libfunc.
+ * doc/tm.texi: Document TARGET_ASM_TTYPE
+
+2005-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (build_over_call): Pass in named argument list to
+ `check_function_arguments'.
+ * typeck.c (build_function_call): Likewise.
+
+2005-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cp-tree.h (lang_check_failed): Add noreturn attribute.
+
+2005-06-25 Kelley Cook <kcook@gcc.gnu.org>
+
+ * all files: Update FSF address in copyright headers.
+
+2005-06-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/19317
+ * semantics.c (simplify_aggr_init_expr): Use
+ CALL_EXPR_RETURN_SLOT_OPT, not CALL_EXPR_HAS_RETURN_SLOT_ADDR.
+
+2005-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * pt.c (register_specialization): Remove superfluous assertion.
+
+2005-06-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (convert_like_real): Add format attribute.
+ * typeck.c (check_for_casting_away_constness,
+ build_static_cast_1): Likewise.
+ * typeck2.c (readonly_error, cxx_incomplete_type_diagnostic):
+ Likewise.
+
+2005-06-17 Geoffrey Keating <geoffk@apple.com>
+
+ PR c++/17413
+ * pt.c (type_unification_real): Apply template type deduction even
+ to procedure parameters that are not dependent on a template
+ parameter.
+
+2005-06-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might
+ change.
+ (create_pseudo_type_info): First parameter is an int.
+
+2005-06-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20678
+ * error.c (dump_expr) <COMPONENT_REF case>: Check DECL_NAME is not
+ null.
+
+ * Make-lang.in: Reformat some long lines.
+ (gt-cp-rtti.h): New target.
+ (cp/rtti.o): Add dependency.
+ * config-lang.in (gtfiles): Add cp/rtti.c.
+ * cp-tree.h (CPTI_TI_DESC_TYPE, CPTI_BLTN_DESC_TYPE,
+ CPTI_PTR_DESC_TYPE, CPTI_ARY_DESC_TYPE, CPTI_FUNC_DESC_TYPE,
+ CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE,
+ CPTI_SI_CLASS_DESC_TYPE, CPTI_VMI_CLASS_DESC_TYPE,
+ CPTI_PTM_DESC_TYPE, CPTI_BASE_DESC_TYPE): Remove.
+ (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node,
+ ary_desc_type_node, func_desc_type_node, enum_desc_type_node,
+ class_desc_type_node, si_class_desc_type_node,
+ vmi_class_desc_type_node, ptm_desc_type_node,
+ base_desc_type_node): Remove.
+ * decl.c: Adjust documentation of global trees.
+ * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL,
+ TINFO_REAL_NAME): Remove.
+ (struct tinfo_s): New.
+ (enum tinfo_kind): New.
+ (tinfo_descs): New.
+ (get_tinfo_decl): Adjust use of tinfo descriptor.
+ (tinfo_base_init, generic_initializer, ptr_initializer,
+ ptm_initializer, class_initializer): Likewise.
+ (get_pseudo_ti_init): Take descriptor index. Adjust.
+ (create_pseudo_type_info): Likewise.
+ (get_pseudo_ti_desc): Return descriptor index. Adjust.
+ (create_tinfo_types): Adjust use of create_pseudo_type_info.
+ (emit_tinfo_decl): Adjust use of tinfo descriptor.
+
+2005-06-14 Roger Sayle <roger@eyesopen.com>
+
+ * decl.c (grokdeclarator): Only check TREE_OVERFLOW on INTEGER_CST.
+
+2005-06-13 Geoffrey Keating <geoffk@apple.com>
+
+ * Make-lang.in (c++.install-man): Doesn't really depend on installdirs.
+ (rule for installing g++.1 manpage): Does depend on installdirs.
+
+2005-06-13 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20789
+ * decl.c (cp_finish_decl): Clear runtime runtime initialization if
+ in-class decl's initializer is bad.
+
+ PR c++/21929
+ * parser.c (struct cp_parser): Document that scope could be
+ error_mark.
+ (cp_parser_diagnose_invalid_type_name): Cope with error_mark for
+ scope.
+ (cp_parser_nested_name_specifier): Return NULL_TREE on error.
+ (cp_parser_postfix_expression): Deal with null or error_mark
+ scope.
+ (cp_parser_elaborated_type_specifier): Adjust
+ cp_parser_nested_name_specifier call.
+
+ * parser (cp_parser_skip_to_end_of_block_or_statement): Cleanup.
+
+2005-06-12 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/21930
+ * error.c (dump_expr): UNARY_PLUS_EXPR need not handle void types.
+ Treat CONVERT_EXPR identically to NOP_EXPR.
+
+2005-06-10 Aldy Hernandez <aldyh@redhat.com>
+
+ PR c++/10611
+ * cvt.c (build_expr_type_conversion): Same.
+ * typeck.c (build_binary_op): Handle vectors.
+ (common_type): Same.
+ (type_after_usual_arithmetic_conversions): Same.
+
+2005-06-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19497
+ * cp-tree.def (USING_DECL): Update documentation.
+ * cp-tree.h (DECL_DEPENDENT_P): New.
+ (USING_DECL_DECLS, USING_DECL_SCOPE): New.
+ * class.c (handle_using_decl): Move most of the processing to ...
+ * name-lookup.c (do_class_using_decl): ... here. Make stricter.
+ (push_using_decl): Use USING_DECL_SCOPE.
+ (cp_emit_debug_info_for_using): Make extern.
+ * cxx-pretty-print.c (pp_cxx_statement) <USING_DECL case>: Adjust.
+ * name-lookup.h (cp_emit_debug_info_for_using): Declare.
+ * pt.c (tsubst_decl) <USING_DECL case>: Use do_class_using_decl
+ when tsubsting.
+ (tsubst_expr): Use USING_DECL_SCOPE.
+ * search.c (lookup_field_1): Use DECL_DEPENDENT_P.
+ * semantics.c (finish_member_declaration): Likewise.
+
+2005-06-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19894
+ * pt.c (tsubst): Reject pointer-to-member of type void.
+
+ PR c++/20563
+ * parser.c (cp_parser_label_declaration): Deal with invalid/missing
+ identifiers.
+
+2005-06-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.def (DEFAULT_ARG): Adjust documentation.
+ * cp-tree.h (DEFARG_INSTANTIATIONS): New.
+ (struct tree_default_arg): Add instantiations member.
+ * parser.c (cp_parser_late_parsing_default_args): Adjust to use a
+ VEC.
+ * pt.c (tsubst_arg_types): Likewise.
+
+ * parser.c (cp_parser_late_parsing_default_args): Fix overeager
+ assert in previous patch.
+
+2005-06-06 Jakub Jelinek <jakub@redhat.com>
+
+ * error.c (locate_error): Use gmsgid instead of msgid for argument
+ name.
+ (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
+
+2005-06-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR 21903
+ * cp-tree.def (DEFAULT_ARG): Document TREE_CHAIN use.
+ * parser.c (cp_parser_late_parsing_default_args): Propagate parsed
+ argument to any early instantiations.
+ * pt.c (tsubst_arg_types): Chain early instantiation of default arg.
+
+ PR c++/20637
+ * cp-tree.h (add_method): Add using_decl parameter.
+ * class.c (add_method): Add using_decl parameter. Adjust error
+ messages.
+ (handle_using_decl): Pass the using decl to add_method.
+ (clone_function_decl): Adjust add_member calls.
+ * decl2.c (check_classfn): Likewise.
+ * method.c (lazily_declare_fn): Likewise.
+ * semantics.c (finish_member_declaration): Likewise.
+
+ * method.c (synthesize_method): Use inform, not warning.
+
+2005-06-06 Hans-Peter Nilsson <hp@axis.se>
+
+ * config-lang.in (target_libs): Remove target-gperf.
+
+2005-06-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21619
+ * cp-tree.h (DECL_IS_BUILTIN_CONSTANT_P): New macro.
+ * parser.c (cp_parser_postfix_expression): Allow non-constant
+ expressions as arguments to __builtin_constant_p.
+ * tree.c (builtin_valid_in_constant_expr_p): Use
+ DECL_IS_BUILTIN_CONSTANT_P.
+
+2005-06-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21853
+ * typeck.c (casts_away_constness_r): Do not drop cv-qualifiers on
+ the pointed-to type for a pointer-to-member.
+
+ PR c++/21336
+ * cp-tree.h (grok_op_properties): Remove friendp parameter.
+ * decl.c (grokfndecl): Adjust call.
+ (grok_op_properties): Determine the class of which the function is
+ a member by looking at its DECL_CONTEXT, not current_class_type.
+ * pt.c (tsubst_decl): Adjust call to grok_op_properties.
+
+2005-06-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * method.c (synthesize_method): Add addtional arg to warning call.
+
+ PR c++/21280
+ * Make-lang.in (method.o): Add diagnostic.h
+ * decl.c (start_preparsed_function): Use decl's location for file
+ info.
+ * decl2.c (cp_finish_file): Set input_location before synthesizing
+ a function.
+ (mark_used): When deferring a synthesized function, save current
+ location. Do not set function's location when actually
+ synthesizing it.
+ * method.c: #include diagnostic.h.
+ (synthesize_method): Set the functions source location. Show
+ needed location if errors are emitted.
+
+ * decl.c (start_decl): Simplify specialization handling. Remove
+ unneeded CLASSTYPE_TEMPLATE_INSTANTIATION check.
+ * mangle.c (discriminator_for_local_entity): Use VEC_index.
+
+ PR c++/20350
+ * decl.c (duplicate_decls): Copy all of DECL_USE_TEMPLATE.
+
+ PR c++/21151
+ * name-lookup.c (pushtag): Push local class even in a template.
+
+2005-05-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21165
+ * init.c (integral_constant_value): Check the type of the
+ initializer, not the decl.
+
+2005-05-30 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21784
+ * name-lookup.c (do_nonmember_using_decl): Ignore builtin
+ functions, even when the used name is not a function.
+
+2005-05-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * operators.def, optimize.c: Update copyright.
+
+2005-05-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21210
+ * call.c (standard_conversion): Permit conversions to complex
+ types if conversion to the corresponding scalar type would be
+ permitted.
+
+ PR c++/21340
+ * method.c (implicitly_declare_fn): Clear processing_template_decl
+ when generating implicit declaration.
+
+2005-05-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21614
+ * typeck.c (get_member_function_from_ptrfunc): Do not attempt
+ conversions to base classes of incomplete types.
+
+2005-05-27 Ian Lance Taylor <ian@airs.com>
+
+ * semantics.c (add_stmt): Add C++ frontend specific version.
+ * cp-tree.h (STMT_IS_FULL_EXPR_P): Define.
+ (stmts_are_full_exprs_p): Declare.
+
+2005-05-27 Roger Sayle <roger@eyesopen.com>
+ Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.
+ * parser.c (cp_parser_unary_expression): Use UNARY_PLUS_EXPR instead
+ of CONVERT_EXPR.
+ (cp_parser_unary_expression): Likewise.
+ * typeck.c (build_unary_op): Likewise.
+ * call.c (add_builtin_candidate, build_new_op): Likewise.
+ * error.c (dump_expr): Likewise.
+ * pt.c (tsubst_copy, tsubst_copy_and_build): Likewise.
+ * decl.c (ambi_op_p, grok_op_properties): Likewise.
+ * dump.c (dump_op): Likewise.
+ * lex.c (init_operators): Likewise.
+ * operators.def ("+"): Likewise.
+ * cp-gimplify.c (cp_gimplify_expr): Handle UNARY_PLUS_EXPR like a
+ conversion, if the result and argument types differ.
+ * tree.c (fold_if_not_in_template): Fold UNARY_PLUS_EXPR much
+ like a NOP_EXPR when !processing_template_decl.
+
+ * cxx-pretty-print.c (pp_cxx_cast_expression): Prototype.
+ (pp_cxx_unary_expression): Handle new UNARY_PLUS_EXPR tree code.
+
+2005-05-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21455
+ * typeck.c (get_delta_difference): Cope with incomplete but equal
+ classes. Reorder if.
+
+ PR c++/21681
+ * parser.c (cp_parser_late_parsing_for_member): Disable access
+ checking for template functions.
+
+2005-05-26 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/21768
+ * pt.c (redeclare_class_template): Change error message according
+ to coding conventions.
+
+2005-05-26 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * call.c (build_op_delete_call): Fix quoting in error message.
+
+2005-05-25 Richard Henderson <rth@redhat.com>
+
+ PR libgcj/21692
+ * cp-tree.h (make_alias_for): Declare.
+ * decl2.c (build_java_method_aliases): New.
+ (cp_finish_file): Call it.
+ * method.c (make_alias_for): Split out from ...
+ (make_alias_for_thunk): ... here.
+
+2005-05-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/21686
+ * semantics.c (finish_id_expression): Fix quoting in error message.
+
+2005-05-25 DJ Delorie <dj@redhat.com>
+
+ * decl.c (duplicate_decls): Move warning control from if() to
+ warning(OPT_*).
+ * name-lookup.c (parse_using_directive): Likewise.
+ * parser.c (cp_parser_elaborated_type_specifier): Likewise.
+ (cp_parser_init_declarator): Likewise.
+ * tree.c (handle_com_interface_attribute): Likewise.
+
+2005-05-24 Ziemowit Laski <zlaski@apple.com>
+
+ * class.c (layout_class_type): Do not issue C++ ABI warnings
+ for ObjC structs.
+ * decl.c (objc_mark_locals_volatile): Streamline by calling
+ objc_volatilize_decl().
+ * parser.c (cp_parser_objc_message_expression): Allow simple
+ type specifiers (instead of merely type names) as message
+ receivers.
+ * pt.c (template_args_equal): Do not call objc_comptypes().
+ * typeck.c (composite_pointer_type): If both pointers are
+ ObjC-esque, arbitrarily choose the first; do not call
+ objc_comptypes().
+ (comptypes): Do not call objc_comptypes().
+ (convert_for_assignment): Call objc_compare_types().
+ (comp_ptr_ttypes_real): Call objc_type_quals_match() before
+ concluding that types do not match.
+
+2005-05-24 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/21645
+ * optimize.c (update_cloned_parm): Copy the TYPE also from the
+ original one.
+
+2005-05-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/21495
+ * decl.c (grokdeclarator): Fix "storage class specified for"
+ error reporting.
+
+2005-05-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * parser.c: Fix comment typos.
+
+2005-05-18 Geoffrey Keating <geoffk@apple.com>
+
+ * Make-lang.in (cc1plus-dummy): New.
+ (cc1plus-checksum.c): New.
+ (cc1plus-checksum.o): New.
+ (cc1plus): Add cc1plus-checksum.o.
+
+2005-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR C++/19664
+ * decl2.c (determine_visibility): Don't set visibility to
+ hidden if it has been set explicitly by user.
+
+2005-05-17 Ziemowit Laski <zlaski@apple.com>
+ Mike Stump <mrs@apple.com>
+
+ Yet more Objective-C++...
+
+ * cp-objcp-common.h (cxx_get_alias_set): Move from
+ here...
+ (cxx_warn_unused_global_decl): Likewise.
+ (cp_expr_size): Likewise.
+ (cp_tree_size): Likewise.
+ (cp_var_mod_type_p): Likewise.
+ (cxx_initialize_diagnostics): Likewise.
+ (cxx_types_compatible_p): Likewise.
+ * cp-tree.h: to here.
+ (do_poplevel): Add.
+ * lex.c (D_OBJC): Add.
+ (init_reswords): Add.
+ * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h.
+ * parser.c: Add c-common.h include.
+ * pt.c: Add c-common.h and cp-objcp-common.h includes.
+ (template_args_equal): Use objc_comptypes as well.
+ (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well.
+ * semantics.c (do_poplevel): Remove static.
+
+ * decl.c (objc_mark_locals_volatile): Don't change decls that are
+ already ok.
+ * decl2.c (generate_ctor_or_dtor_function): Add code to initialize
+ Objective C++ early enough.
+ * lex.c (struct resword reswords): Add Objective-C++ support.
+ * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++.
+ (cp_parser_objc_message_receiver): Add.
+ (cp_parser_objc_message_args): Likewise.
+ (cp_parser_objc_message_expression): Likewise.
+ (cp_parser_objc_encode_expression): Likewise.
+ (cp_parser_objc_defs_expression): Likewise.
+ (cp_parser_objc_protocol_expression): Likewise.
+ (cp_parser_objc_selector_expression): Likewise.
+ (cp_parser_objc_expression): Likewise.
+ (cp_parser_objc_visibility_spec): Likewise.
+ (cp_parser_objc_method_type): Likewise.
+ (cp_parser_objc_protocol_qualifiers): Likewise.
+ (cp_parser_objc_typename): Likewise.
+ (cp_parser_objc_selector_p): Likewise.
+ (cp_parser_objc_selector): Likewise.
+ (cp_parser_objc_method_keyword_params): Likewise.
+ (cp_parser_objc_method_tail_params_opt): Likewise.
+ (cp_parser_objc_interstitial_code): Likewise.
+ (cp_parser_objc_method_signature): Likewise.
+ (cp_parser_objc_method_prototype_list): Likewise.
+ (cp_parser_objc_method_definition_list): Likewise.
+ (cp_parser_objc_class_ivars): Likewise.
+ (cp_parser_objc_identifier_list): Likewise.
+ (cp_parser_objc_alias_declaration): Likewise.
+ (cp_parser_objc_class_declaration): Likewise.
+ (cp_parser_objc_protocol_declaration): Likewise.
+ (cp_parser_objc_protocol_refs_opt): Likewise.
+ (cp_parser_objc_superclass_or_category): Likewise.
+ (cp_parser_objc_class_interface): Likewise.
+ (cp_parser_objc_class_implementation): Likewise.
+ (cp_parser_objc_end_implementation): Likewise.
+ (cp_parser_objc_declaration): Likewise.
+ (cp_parser_objc_try_catch_finally_statement): Likewise.
+ (cp_parser_objc_synchronized_statement): Likewise.
+ (cp_parser_objc_throw_statement): Likewise.
+ (cp_parser_objc_statement): Likewise.
+ (cp_parser_primary_expression): Add Objective-C++.
+ (cp_parser_statement): Likewise.
+ (cp_parser_declaration): Likewise.
+ (cp_parser_simple_type_specifier): Likewise.
+ (cp_parser_type_name): Likewise.
+ (cp_parser_parameter_declaration_list): Likewise.
+ (cp_parser_member_declaration) Likewise.
+ * tree.c: Include debug.h.
+ * typeck.c (composite_pointer_type): Add Objective-C++ support.
+ (finish_class_member_access_expr): Likewise.
+ (build_function_call): Allow objc to rewrite FUNCTION_DECLs.
+ (build_modify_expr): Allow objc to generate write barriers.
+
+ * Make-lang.in (cp/tree.o): Add debug.h.
+ * tree.c (lvalue_p_1, case CONST_DECL): Add.
+
+2005-05-18 Jan Hubicka <jh@suse.cz>
+
+ * method.c: Include tree-pass.h
+ (use_thunk): Lower body before expanding.
+
+2005-05-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/21454
+ * decl.c (maybe_deduce_size_from_array_init): Call
+ cp_apply_type_quals_to_decl after completing array type.
+
+2005-05-16 Richard Henderson <rth@redhat.com>
+
+ * decl.c (build_library_fn_1): Move setting TREE_NOTHROW ...
+ (build_library_fn): ... here.
+
+2005-05-12 Ian Lance Taylor <ian@airs.com>
+
+ * cp-tree.h (cp_stmt_codes): Don't define.
+ (statement_code_p): Declare.
+ (STATEMENT_CODE_P): Define.
+ * lex.c (statement_code_p): Define.
+ (cxx_init): Use actual codes in stmt_codes initializer, not
+ cp_stmt_codes macro. Initialize statement_code_p directly, rather
+ than using INIT_STATEMENT_CODES.
+
+2005-05-09 Mark Mitchell <mark@codesourcery.com>
+
+ * typeck.c (build_unary_op): Do not resort to address arithmetic
+ when taking the address of a COMPONENT_REF.
+
+2005-05-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * class.c (vtbl_init_data_s): Change the type of fns to
+ VEC(tree,gc)*.
+ (build_vtbl_initializer, add_vcall_offset, add_vcall_offset):
+ Use VEC instead of VARRAY.
+
+2005-05-07 Richard Sandiford <rsandifo@redhat.com>
+
+ * mangle.c: Remove a reference to the MIPS -mint64 option.
+
+2005-05-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * decl.c (wrapup_globals_for_namespace): Use VEC instead of
+ VARRAY.
+ * name-lookup.c (add_decl_to_level, begin_scope): Likewise.
+ * name-lookup.h (cp_binding_level): Change the type of
+ static_decls to VEC(tree,gc)*.
+
+ * mangle.c (globals): Change the type of substitutions to
+ VEC(tree,gc)*.
+ (dump_substitution_candidates, add_substitution,
+ find_substitution, finish_mangling, init_mangle): Use VEC
+ instead of VARRAY.
+
+2005-05-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * decl2.c (spew_debug): Remove.
+
+ * decl2.c (ssdf_decls, start_static_storage_duration_function,
+ generate_ctor_or_dtor_function): Use VEC instead of VARRAY.
+
+ * decl2.c (pending_statics, note_vague_linkage_var,
+ cp_finish_file): Use VEC instead of VARRAY.
+ (pending_statics_used): Remove.
+
+2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * decl2.c (deferred_fns, note_vague_linkage_fn,
+ cp_finish_file): Use VEC instead of VARRAY.
+
+2005-05-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21352
+ * pt.c (build_non_dependent_expr): Use is_overloaded_fn.
+
+2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * pt.c: Fix a comment typo.
+
+2005-05-04 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h (language_function): Change the type of
+ x_local_names to VEC.
+ * decl.c (push_local_name): Adjust uses of local_names.
+
+2005-05-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * friend.c, lex.c, mangle.c, repo.c: Update copyright.
+
+2005-05-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * class.c (local_classes, init_class_processing): Use VEC
+ instead of VARRAY.
+ * cp-tree.h (local_classes): Likewise.
+ * mangle.c (discriminator_for_local_entity): Likewise.
+ * name-lookup.c (pushtag): Likewise.
+
+ * class.c (current_lang_depth, push_lang_context,
+ pop_lang_context): Use VEC instead of VARRAY.
+ * cp-tree.h (saved_scope): Use VEC for lang_base instead of
+ VARRAY.
+ * name-lookup.c (push_to_top_level): Use VEC instead of
+ VARRAY.
+
+2005-05-02 Paolo Bonzini <bonzini@gnu.org>
+
+ * semantics.c (finish_call_expr): Call resolve_overloaded_builtin
+ for BUILT_IN_MD built-ins.
+
+2005-05-02 Michael Matz <matz@suse.de>
+
+ PR c++/19542
+ * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C
+ common frontend.
+ (null_node): Remove.
+ * lex.c (cxx_init): Move null_node initialisation to C common frontend.
+
+2005-04-25 Ian Lance Taylor <ian@airs.com>
+
+ * cp-tree.def: Add EXPR_STMT.
+ * cp-tree.h (cp_stmt_codes): Add EXPR_STMT.
+ (EXPR_STMT_EXPR): Define.
+ * cp-gimplify.c: Include "flags.h".
+ (gimplify_expr_stmt): New static function.
+ (cp_gimplify_expr): Handle EXPR_STMT.
+ * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression
+ rather than pp_expression.
+ (pp_cxx_statement): Handle EXPR_STMT.
+ * dump.c (cp_dump_tree): Handle EXPR_STMT.
+ * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes
+ initializer.
+
+2005-04-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/21188
+ * rtti.c (ifnonnull): Cast the zero comparison operand
+ to the correct type.
+
+2005-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/20991
+ * class.c: Include cgraph.h.
+ (cp_fold_obj_type_ref): Set node->local.vtable_method.
+ * Make-lang.in (cgraph.o): Depend on $(CGRAPH_H).
+
+2005-04-12 Markus F.X.J. Oberhumer <markus@oberhumer.com>
+
+ * mangle.c (write_builtin_type): Handle integer types which are
+ not one of the shared integer type nodes and emit a "vendor
+ extended builtin type" with an encoding in the form of "u5int96".
+
+2005-04-24 Ian Lance Taylor <ian@airs.com>
+
+ * cp-tree.def (USING_STMT): Change class to tcc_statement.
+ (TRY_BLOCK, EH_SPEC_BLOCK, HANDLER, CLEANUP_STMT): Likewise.
+ (IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT): Likewise.
+ (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
+
+2005-04-23 DJ Delorie <dj@redhat.com>
+
+ * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c,
+ init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c,
+ repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning()
+ callers.
+
+2005-04-22 Per Bothner <per@bothner.com>
+
+ * decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if
+ input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__.
+
+2005-04-22 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/21087
+ * name-lookup.c (push_overloaded_decl): Do not overload with
+ non-duplicate anticipated built-in.
+
+2005-04-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT,
+ VTABLE_BASE, VTABLE_NAME_PREFIX, STATIC_NAME_FORMAT): Remove.
+
+2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h: Adjust for new VEC API.
+ Define VEC(tree_pair_s,gc).
+ (struct save_scope): Adjust.
+ (struct lang_type_class): Adjust.
+ (unemitted_tinfo_decls): Adjust.
+ * class.c (add_method, resort_type_method_vec,
+ finish_struct_methods, struct find_final_overrider_data,
+ dfs_find_final_overrider_pre, find_final_overrider,
+ get_vcall_index, warn_hidden, walk_subobject_offsets,
+ check_methods, fixup_inline_methods, end_of_class,
+ warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
+ add_vcall_offset): Adjust.
+ * decl.c (xref_basetypes, finish_method): Adjust.
+ * decl2.c (check_classfn): Adjust.
+ * init.c (sort_mem_initializers, push_base_cleanups): Adjust.
+ * method.c (do_build_copy_constructor): Adjust.
+ * name-lookup.c (new_class_binding, store_binding,
+ store_bindings, store_class_bindings): Adjust.
+ * name-lookup.h: Define VEC(cxx_saved_binding,gc),
+ VEC(cp_class_binding,gc).
+ (struct cp_binding_level): Adjust.
+ * parser.c: Define VEC(cp_token_position,heap).
+ (struct cp_lexer): Adjust.
+ (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
+ cp_lexer_save_tokens): Adjust.
+ * pt.c (retrieve_specialization,
+ check_explicit_specialization): Adjust.
+ * rtti.c (unemitted_tinfo_decls): Adjust.
+ (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
+ get_pseudo_ti_desc): Adjust.
+ * search.c (dfs_access_in_type, lookup_conversion_operator,
+ lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
+ dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
+ * semantics.c: Define VEC(deferred_access,gc).
+ (push_deferring_access_checks): Adjust.
+ * typeck2.c (abstract_virtuals_error): Adjust.
+
+2005-04-20 Ian Lance Taylor <ian@airs.com>
+
+ * cp-tree.def: Add STMT_EXPR.
+ * cp-tree.h (STMT_EXPR_NO_SCOPE): Define.
+ (STMT_EXPR_STMT): Define.
+ * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
+ STMT_EXPR.
+ (pp_cxx_expression): Likewise.
+ (pp_cxx_statement): Call pp_cxx_statement, not pp_statement.
+ * dump.c (cp_dump_tree): Handle STMT_EXPR.
+
+2005-04-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * decl.c (expand_static_init): Call build2 and build3 instead
+ of build.
+
+ * cp-tree.h (VPTR_NAME, VPTR_NAME_P): Remove.
+
+2005-04-17 Ian Lance Taylor <ian@airs.com>
+
+ * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR.
+ * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle
+ ARROW_EXPR.
+ (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR.
+ (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and
+ ALIGNOF_EXPR.
+ * typeck.c (cxx_sizeof_or_alignof_type): Update call to
+ c_sizeof_or_alignof_type for change in parameter type.
+
+2005-04-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21025
+ * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
+ which sizeof/alignof is dependent, rather than just whether we are
+ processing_template_decl.
+
+2005-04-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h (LOOKUP_GLOBAL): Remove.
+ (LOOKUP_ONLYCONVERTING, DIRECT_BIND, LOOKUP_NO_CONVERSION,
+ LOOKUP_DESTRUCTOR, LOOKUP_NO_TEMP_BIND, LOOKUP_PREFER_TYPES,
+ LOOKUP_PREFER_NAMESPACES, LOOKUP_CONSTRUCTOR_CALLABLE): Adjust
+ their values.
+
+2005-04-15 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/14311
+ * semantics.c (finish_call_expr): Call resolve_overloaded_builtin.
+
+2005-04-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h (lang_type_class): Remove redefined. Move
+ java_interface into where redefined was. Increment the width
+ of dummy.
+ (TYPE_REDEFINED): Remove.
+
+2005-04-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h (SET_TMPL_ARG, ENUM_TI_TEMPLATE, ENUM_TI_ARGS,
+ CLASSTYPE_TEMPLATE_LEVEL): Remove.
+
+2005-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (determine_visibility): Don't use export_class_data.
+ (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
+ TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY.
+
+2005-04-09 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h (cxx_alignof): Remove.
+
+ * cp-tree.h (DECL_ARRAY_DELETE_OPERATOR_P): Remove.
+
+ * cp-tree.h (EXCEPTION_CLEANUP_NAME, B_SET, B_CLR, B_TST,
+ CONV_STATIC_CAST): Remove.
+
+ * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Remove.
+
+ * cp-tree.h (VF_BINFO_VALUE, VF_BASETYPE_VALUE): Remove.
+
+ * cp-tree.h (cp_deprecated): Remove.
+
+2005-04-08 Ian Lance Taylor <ian@airs.com>
+
+ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT,
+ CONTINUE_STMT, SWITCH_STMT.
+ * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT,
+ BREAK_STMT, CONTINUE_STMT, SWITCH_STMT.
+ (WHILE_COND, WHILE_BODY): Define.
+ (DO_COND, DO_BODY): Define.
+ (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define.
+ (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define.
+ * cp-gimplify.c (enum bc_t): Define.
+ (struct cp_gimplify_ctx, ctxp): Define.
+ (push_context, pop_context): New static functions.
+ (begin_bc_block, finish_bc_block): New static functions.
+ (build_bc_goto): New static function.
+ (gimplify_cp_loop, gimplify_for_stmt): New static functions.
+ (gimplify_while_stmt, gimplify_do_stmt): Likewise.
+ (gimplify_switch_stmt): Likewise.
+ (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT,
+ SWITCH_STMT, CONTINUE_STMT, BREAK_STMT.
+ (cp_genericize): Call push_context and pop_context.
+ * semantics.c (finish_break_stmt): Just call build_stmt
+ (BREAK_STMT) rather than build_break_stmt.
+ (finish_continue_stmt): Corresponding change.
+ * decl.c (pop_switch): Update call to c_do_switch_warnings for new
+ parameters.
+ * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT,
+ WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT.
+ * dump.c (cp_dump_tree): Likewise.
+
+2005-04-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20905
+ * parser.c (cp_parser_type_specifier_seq): Add is_condition
+ parameter.
+ (cp_parser_new_type_id): Pass it.
+ (cp_parser_condition): Likewise.
+ (cp_parser_conversion_type_id): Likewise.
+ (cp_parser_type_id): Likewise.
+ (cp_parser_type_specifier_seq): In a condition, do not allow
+ invalid type-specifier combinations.
+ (cp_parser_exception_declaration): Adjust call to
+ cp_parser_type_specifier_seq.
+
+ * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P.
+ * cp-tree.h (struct tinst_level): Add in_system_header_p.
+ (TINST_IN_SYSTEM_HEADER_P): New macro.
+ (make_tinst_level): Remove.
+ * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on
+ the instantiated class.
+ (push_tinst_level): Do not use make_tinst_level. Set
+ TINST_IN_SYSTEM_HEADER_P.
+ (pop_tinst_level): Likewise.
+ (instantiate_class_template): Set in_system_header.
+ (instantiate_pending_templates): Likewise.
+ * tree.c (make_tinst_level): Remove.
+
+2005-04-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ * decl.c (start_decl): Apply pending #pragma weak regardless of
+ scope.
+
+2005-04-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20212
+ * pt.c (regenerate_decl_from_template): Copy attributes for
+ parameters from the pattern to the instantiation.
+
+2005-04-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20734
+ * cp-tree.def (OFFSET_REF): Correct comments.
+ * init.c (build_offset_ref): Remove misleading comment.
+ * typeck.c (build_unary_op): Handle pointer-to-member creation
+ here, rather than ...
+ (unary_complex_lvalue): ... here.
+
+2005-04-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/19312
+ * tree.c (stabilize_init): Don't bother trying to stabilize
+ something with no side-effects.
+
+2005-04-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20763
+ * decl.c (grokdeclarator): Correct attribute handling.
+
+2005-04-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19159
+ * decl2.c (import_export_decl): Use non-COMDAT external linkage
+ for virtual tables, typeinfo, etc. that will be emitted in only
+ one translation unit on systems without weak symbols.
+
+2005-04-04 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20679
+ * parser.c (cp_parser_template_name): Fix thinko.
+
+2005-04-04 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20746
+ * method.c (use_thunk): Protect covariant pointer return
+ adjustments from NULL pointers.
+
+2005-04-04 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (finish_objects): Revert my previous patch.
+ (cp_finish_file): Likewise.
+
+2005-04-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * pt.c: Fix comment typos.
+
+2005-04-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20723
+ * pt.c (more_specialized_fn): Member functions are unordered wrt
+ non-members. Conversion operators are unordered wrt other
+ functions.
+
+2005-04-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (add_template_candidates_real): Remove length parameter
+ from fn_type_unification call.
+ * class.c (resolve_address_of_overloaded_function): Likewise
+ * cp-tree.h (fn_type_unification): Remove length parameter.
+ * pt.c (get_bindings_overload): Remove.
+ (get_bindings_real): Rename to ...
+ (get_bindings): ... here. Remove length and strict
+ parameters. Change return type flag to boolean. Remove original
+ forwarding function.
+ (determine_specialization): Adjust get_bindings call.
+ (fn_type_unification): Remove length parameter. Adjust.
+ (type_unification_real): Remove length parameter. Adjust.
+ (resolve_overloaded_unification): Adjust get_bindings call.
+ (try_one_overload): Simplify confusing cascaded if control flow.
+ (unify): Remove length paramter from type_unification_real call.
+ (most_specialized_instantiation): Adjust get_bindings calls.
+ (most_specialized): Likewise.
+
+2005-03-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19203, implement DR 214
+ * call.c (joust): Use more_specialized_fn.
+ * cp-tree.h (DEDUCE_ORDER): Remove.
+ (more_specialized): Replace with ...
+ (more_specialized_fn): ... this.
+ * pt.c (maybe_adjust_types_for_deduction): Remove DEDUCE_ORDER
+ case.
+ (type_unification_real): Remove DEDUCE_ORDER case.
+ (more_specialized): Replace with ...
+ (more_specialized_fn): ... this. Implement DR 214.
+ (most_specialized_instantiation): Use get_bindings_real directly.
+
+2005-03-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/18644
+ * call.c (build_new_op): Remove check for -Wsynth.
+
+2005-03-31 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (finish_objects): Mark ctor as needed.
+ (cp_finish_file): Output variables only in nonunit-at-a-time.
+
+2005-03-29 Richard Henderson <rth@redhat.com>
+
+ PR c/20519
+ * decl.c (cp_complete_array_type): Rename from complete_array_type.
+ Use the new complete_array_type in c-common.c. Update all callers.
+ * cp-tree.h (cp_complete_array_type): Update to match.
+
+2005-03-24 Geoffrey Keating <geoffk@apple.com>
+
+ * typeck.c (build_static_cast_1): Allow scalar_cast between
+ any integral, floating, or enumeration type.
+
+2005-03-24 Steven Bosscher <stevenb@suse.de>
+
+ * typeck.c (comptypes): First determine if the types are compatible
+ from a target-independent point of view. Check target attributes
+ last.
+
+ * class.c (build_base_path):
+ (build_vbase_offset_vtbl_entries):
+ (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN.
+ * error.c (dump_expr): Likewise.
+ * init.c (build_zero_init, expand_cleanup_for_base,
+ build_vec_delete_1): Likewise.
+ * mangle.c (write_integer_cst): Likewise.
+ * method.c (thunk_adjust): Likewise.
+ * pt.c (convert_nontype_argument, tsubst, unify): Likewise.
+ * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise.
+ * typeck.c (build_ptrmemfunc_access_expr,
+ (get_member_function_from_ptrfunc): Likewise.
+
+2005-03-23 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
+
+2005-03-23 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cp-tree.h (perform_integral_promotions): Remove.
+ (default_conversion): Add.
+
+2005-03-22 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (cp_parser_warn_min_max): New function.
+ (cp_parser_binary_expression): Use it.
+ (cp_parser_assignment_operator_opt): Likewise.
+ (cp_parser_operator): Likewise.
+
+2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19980
+ * decl.c (start_preparsed_function): Robustify.
+
+2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/20499
+ * parser.c (cp_parser_class_head): Return NULL_TREE when
+ encountering a redefinition.
+
+2005-03-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20465
+ PR c++/20381
+ * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a
+ template.
+
+2005-03-21 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/20461
+ PR c++/20536
+ * init.c (emit_mem_initializers): Don't crash on undefined
+ types.
+
+2005-03-21 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/20147
+ * semantics.c (finish_stmt_expr_expr): Return immediately
+ if error_operand_p (expr).
+
+2005-03-21 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cp-tree.h (lvalue_or_else, lvalue_p): New.
+ * typeck.c (lvalue_or_else): New. Call lvalue_error.
+
+2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/20240
+ * decl.c (decls_match): Compare context of VAR_DECL.
+
+2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/20333
+ * parser.c (cp_parser_postfix_expression) <case RID_TYPENAME>:
+ Check the return value of cp_parser_nested_name_specifier.
+
+2005-03-18 Dale Johannesen <dalej@apple.com>
+
+ * cp/tree.c (cp_tree_equal): Handle SSA_NAME.
+
+2005-03-18 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/20463
+ * parser.c (cp_parser_diagnose_invalid_type_name):
+ Check TYPE_BINFO (current_class_type) before attempting
+ to emit inform messages.
+
+2005-03-17 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/19966
+ * cp-tree.h (grok_op_properties): Change return type to void.
+ * decl.c (grok_op_properties): Return early - don't check the
+ arity - in case of a static member or an operator that cannot
+ be non-member; tidy a bit.
+
+2005-03-17 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20186
+ * pt.c (contains_dependent_cast_p): Remove.
+ (fold_non_dependent_expr): Don't use it.
+ (value_dependent_expression_p): Use a switch statement.
+ reference_exprs can be dependent.
+
+2005-03-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/4403
+ PR c++/9783, DR433
+ * name-lookup.c (pushtag): Skip template parameter scope when
+ scope is ts_global. Don't push tag into template parameter
+ scope.
+ * pt.c (instantiate_class_template): Reorder friend class
+ template substitution to handle non-dependent friend class
+ that hasn't been previously declared.
+
+2005-03-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ Friend class name lookup 5/n
+ PR c++/1016
+ * cp-tree.h (pushtag): Adjust declaration.
+ * decl.c (lookup_and_check_tag): Call lookup_type_scope if
+ lookup_name fails.
+ (xref_tag): Adjust call to pushtag. Make hidden class visible.
+ (start_enum): Adjust call to pushtag.
+ * name-lookup.c (ambiguous_decl): Ignore hidden names.
+ (qualify_lookup): Change return type to bool.
+ (hidden_name_p): New function.
+ (lookup_namespace_name, unqualified_namespace_lookup,
+ lookup_name_real): Use it.
+ (lookup_type_scope): Update comments.
+ (maybe_process_template_type_declaration): Change parameter name
+ from globalize to is_friend.
+ (pushtag): Change globalize parameter of type int to tag_scope.
+ Hide name if introduced by friend declaration.
+ * name-lookup.h (hidden_name_p): Add declaration.
+ * parser.c (cp_parser_lookup_name): Don't deal with hidden name
+ here.
+ * pt.c (push_template_decl_real): Make hidden class template
+ visible.
+ (lookup_template_class, instantiate_class_template): Adjust call
+ to pushtag.
+ * semantics.c (begin_class_definition): Likewise.
+ * rtti.c (init_rtti_processing, build_dynamic_cast_1,
+ tinfo_base_init, emit_support_tinfos): Use ts_current instead of
+ ts_global.
+
+2005-03-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20157
+ * pt.c (determine_specialization): Reject non-specializations.
+
+2005-03-11 Per Bothner <per@bothner.com>
+
+ * cp-tree.h (struct cp_declarator): New id_loc field.
+ * cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's
+ location using c_lex_with_flags, instead of input_location.
+ (cp_parser_direct_declarator): Set declarator's id_loc from
+ cp_token's id_loc.
+
+2005-03-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/18384, c++/18327
+ * decl.c (reshape_init_array): Use UHWI type for max_index_cst
+ and index. Convert max_index to size_type_node if it isn't
+ host_integerp (, 1).
+
+2005-03-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20208
+ * pt.c (tsubst_decl): Apply array-to-pointer and
+ function-to-pointer conversions to function arguments.
+ (regenerate_decl_from_template): Likewise.
+
+2005-03-09 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/16859
+ * decl.c (complete_array_type): In pedantic mode, return
+ 3 for an empty initializer list as the initializer for an
+ array of unknown bound (8.5.1/4).
+ (maybe_deduce_size_from_array_init): Fix final test to use
+ the above.
+
+2005-03-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20186
+ * pt.c (contains_dependent_cast_p): New.
+ (fold_non_dependent_expr): Call it.
+
+2005-03-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20142
+ * cp-tree.h (target_type): Remove.
+ * decl.c (layout_var_decl): Remove #if 0'd code.
+ (cp_finish_decl): Remove dead code.
+ * init.c (build_vec_init): When determining whether or not the
+ element type has an asignment operator, look through all array
+ dimensions.
+ * typeck.c (target_type): Remove.
+
+2005-03-07 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (finish_struct_1): Do not warn about non-virtual
+ destructors in Java classes.
+
+2005-03-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/19311
+ * init.c (build_offset_ref): Don't build non-dependent SCOPE_REF.
+ * pt.c (build_non_dependent_expr): Don't build NON_DEPENDENT_EXPR
+ for OFFSET_TYPE.
+ * typeck.c (build_x_unary_op): Don't build non-dependent SCOPE_REF.
+ Also set PTRMEM_OK_P for NON_DEPENDENT_EXPR.
+ (build_unary_op): Handle building ADDR_EXPR of OFFSET_REF inside
+ template.
+
+2005-03-02 Alexandre Oliva <aoliva@redhat.com>
+
+ * name-lookup.c (push_overloaded_decl): Don't error if the new
+ decl matches the old one.
+ * decl.c (redeclaration_error_message): Likewise.
+
+2005-03-01 Per Bothner <per@bothner.com>
+
+ * decl.c (finish_function): Use SET_EXPR_LOCATION instead of
+ unavailable annotate_with_file_line, if USE_MAPPED_LOCATION.
+
+2005-03-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20232
+ * class.c (update_vtable_entry_for_fn): Don't crash on invalid
+ covariancy.
+
+ * cp-tree.g (THUNK_TARGET): Expand comment.
+ * method.c (use_thunk): Make sure we also use the target, if that
+ is a thunk.
+
+2005-02-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/20206
+ * decl.c (cxx_comdat_group): Put thunks for
+ TARGET_USE_LOCAL_THUNK_ALIAS_P (function) functions into the same
+ comdat group as the thunk target.
+
+2005-02-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c,
+ parser.c: Fix comment typo(s).
+
+2005-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/20175
+ * decl.c (reshape_init): Don't warn about missing braces if STRING_CST
+ initializes a char/wchar_t array.
+
+2005-02-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19878
+ * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
+ with internal linkage.
+
+2005-02-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl.c (grokvardecl): Don't exempt anonymous types from having
+ linkage for variables that have linkage other than "C".
+
+2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-objcp-common.h, error.c: Update copyright.
+
+2005-02-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20073
+ * decl.c (start_decl_1): Don't clear TREE_READONLY.
+ (cp_finish_decl): Likewise.
+ (complete_vars): Call cp_apply_type_quals_to_decl.
+ * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in
+ cases where that's not valid.
+
+ PR c++/19991
+ * init.c (integral_constant_value): Iterate if the value of a decl
+ is itself a constant.
+
+ PR c++/20152
+ * parser.c (cp_parser_class_head): Check for redefintions here.
+ * semantics.c (begin_class_definition): Not here.
+
+ PR c++/20153
+ * decl2.c (build_anon_union_vars): Add type parameter.
+ (finish_anon_union): Pass it.
+
+ PR c++/20148
+ * error.c (dump_expr): Do not print the body of a BIND_EXPR.
+ Handle STATEMENT_LIST.
+
+ PR c++/19883
+ * parser.c (cp_parser_direct_declarator): Always complain about
+ non-constant array bounds when in a function scope.
+ * semantics.c (finish_id_expression): Do not mark dependent names
+ as non-constant.
+
+2005-02-21 Douglas Gregor <dgregor@cs.indiana.edu>
+
+ PR c++/19076
+ PR c++/6628
+ * cp-tree.h (cp_apply_type_quals_to_decl): Declared.
+ * decl.c (grokdeclarator): Pedwarn about qualifying a function
+ type.
+ Add qualifiers when declaring a typedef of a function type.
+ Member function pointers pick up the qualifiers of the typedef
+ used to declare them.
+ Don't complain about creating cv-qualified function types.
+ Complain about qualified function typedefs that are used to
+ declare non-static member functions or free functions.
+ Use cp_apply_type_quals_to_decl.
+ (start_preparsed_function): Use cp_apply_type_quals_to_decl.
+ (grokclassfn): Use cp_apply_type_quals_to_decl.
+ * error.c (dump_type_suffix): Print qualifiers for function
+ types.
+ * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
+ (tsubst): When substituting a function type into a member
+ pointer type, pass along the qualifiers.
+ (unify): Unify member pointers to member function pointers.
+ * tree.c (cp_build_qualified_type_real): Function types may be
+ qualified. This includes restrict qualifiers.
+ * typeck.c (cp_apply_type_quals_to_decl): New function to replace
+ use of c_apply_type_quals_to_decl. Drops qualifiers that are being
+ added to function types.
+
+2005-02-20 Zack Weinberg <zack@codesourcery.com>
+
+ PR 18785
+ * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
+ c_common_to_target_charset. Delete bogus comment.
+
+2005-02-18 Richard Henderson <rth@redhat.com>
+
+ PR libstdc++/10606
+ * except.c (do_get_exception_ptr): New.
+ (expand_start_catch_block): Use it.
+
+2005-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING
+ if type is not error_mark_node.
+
+2005-01-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/19508
+ * decl2.c (grokfield): Do not apply attributes to template parameters
+ as they are ignored by tsubst anyway.
+
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/19813
+ * decl.c (start_decl_1): Clear TREE_READONLY flag if
+ its type has TYPE_NEEDS_CONSTRUCTING.
+ (complete_vars): Likewise.
+
+2005-02-17 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/20028
+ * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a
+ template along with TYPE_SIZE.
+
+ PR c++/20022
+ * semantics.c (perform_deferred_access_checks): Use
+ get_deferred_access_checks to get the top of the stack.
+
+2005-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17788
+ * class.c (add_implicitly_declared_members, check_field_decl)
+ (check_field_decls, check_bases): Remove arguments, tests and
+ assignments of cant_have_default_ctor-related variables.
+
+2005-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl2.c (mark_used): Set the source location of the used decl to
+ the current input location here...
+ * method.c (synthesize_method): ... not here. Set input_location
+ from the decl instead.
+
+2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19608
+ * parser.c (cp_parser_late_parsing_for_member): Use
+ current_function_decl as scope to push to and from.
+
+ PR c++/19884
+ * pt.c (check_explicit_specialization): Make sure namespace
+ binding lookup found an overloaded function.
+ (lookup_template_function): Just assert FNS is an overloaded
+ function.
+
+ PR c++/19895
+ * decl.c (grokdeclarator): Check for error mark node in ptrmem
+ construction.
+
+2005-02-14 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17816
+ * decl.c (redeclaration_error_message): Report redefinition of
+ pure virtual function.
+
+2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19891
+ * class.c (build_simple_base_path): Build the component_ref
+ directly.
+ (update_vtable_entry_for_fn): Walk the covariant's binfo chain
+ rather than using lookup_base.
+ * search.c (dfs_walk_once): Add non-recursive assert check.
+ * typeck.c (build_class_member_access_expr): It is possible for
+ the member type to be both const and volatile.
+
+2005-02-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/14479
+ PR c++/19487
+ * pt.c (maybe_check_template_type): Remove.
+ * cp-tree.h (maybe_check_template_type): Remove prototype.
+ * name-lookup.c (maybe_process_template_type_declaration): Don't
+ use maybe_check_template_type.
+
+2005-02-11 Richard Henderson <rth@redhat.com>
+
+ PR c++/19632
+ * pt.c (get_mostly_instantiated_function_type): Save and restore
+ flag_access_control instead of push/pop_access_scope.
+
+2005-02-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19755
+ * decl.c (reshape_init): Issue warnings about missing braces.
+
+2005-02-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.def, except.c, ptree.c: Update copyright.
+
+2005-02-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19811
+ * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
+ attempting name lookup.
+
+ * parser.c (cp_parser_unqualified_id): Initialize type_decl.
+
+ PR c++/19787
+ * call.c (initialize_reference): Robustify.
+
+ PR ++/19732
+ * decl.c (grokdeclarator): Check for invalid use of destructor
+ names.
+
+ PR c++/19762
+ * parser.c (cp_parser_unqualified_id): Avoid creating destructor
+ names with invalid types.
+
+ PR c++/19826
+ * parser.c (cp_parser_direct_declarator): Allow type-dependent
+ expressions as array bounds.
+
+ PR c++/19739
+ * parser.c (cp_parser_attributes_list): Allow empty lists.
+
+2005-02-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19733
+ * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR.
+ (check_bases): Give warnings about a base class with a
+ non-virtual destructor, even if it is implicit.
+ (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR.
+ (maybe_warn_about_overly_private_class): Don't use
+ TYPE_HAS_DESTRUCTOR.
+ (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR.
+ (check_for_override): Give it external linkage.
+ (add_implicitly_declared_members): Generate destructors lazily.
+ (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
+ TYPE_HAS_DESTRUCTOR.
+ (check_bases_and_members): Call check_methods before
+ check_field_decls.
+ (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
+ TYPE_HAS_DESTRUCTOR.
+ (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR.
+ * cp-tree.def (PSEUDO_DTOR_EXPR): Document.
+ * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove.
+ (lang_type_class): Add lazy_destructor.
+ (CLASSTYPE_LAZY_DESTRUCTOR): New macro.
+ (CLASSTYPE_DESTRUCTORS): Robustify.
+ (TYPE_HAS_DESTRUCTOR): Remove.
+ (check_for_override): Declare.
+ (build_vbase_delete): Remove.
+ * cvt.c (convert_to_void): Issue errors about pseudo-destructor
+ expressions.
+ * decl.c (cxx_maybe_build_cleanup): Remove dead code.
+ * except.c (dtor_nothrow): Lazily create destructors if necessary.
+ (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
+ * init.c (build_delete): Lazily create destructors, if necessary.
+ (build_vbase_delete): Remove.
+ * method.c (locate_dtor): Simplify.
+ (implicitly_declare_fn): Add support for destructors.
+ * parser.c (cp_parser_lookup_name): Lazily create destructors, if
+ necessary.
+ * pt.c (check_explicit_specialization): Don't use
+ TYPE_HAS_DESTRUCTOR.
+ (instantiate_class_template): Likewise.
+ * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR.
+ * rtti.c (emit_support_tinfos): Robustify.
+ * search.c (lookup_fnfields_1): Lazily create destructors.
+ * typeck.c (build_class_member_access_expr): Remove
+ PSEUDO_DTOR_EXPR handling.
+ (lookup_destructor): Likewise.
+
+2005-02-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update
+ copyright.
+
+2005-02-07 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations
+ on boolean variables.
+ (cp_lexer_stop_debugging): Likewise.
+
+2005-02-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/17401
+ * parser.c (cp_parser_pure_specifier): Emit a specific error
+ message with an invalid pure specifier.
+ * decl2.c (grok_function_init): Remove.
+ (grokfield): An initializer for a method is a always a pure
+ specifier.
+
+2005-02-02 Matt Austern <austern@apple.com>
+
+ PR c++/19628
+ * cp-tree.h (builtin_valid_in_constant_expr_p): Declare.
+ * parser.c (cp_parser_postfix_expression): Accept function call in
+ constant expression if builtin_valid_in_constant_expr_p is true
+ for that function.
+ * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly.
+ * semantics.c (finish_id_expression): Accept function call in constant
+ expression if builtin_valid_in_constant_expr_p is true for that
+ function.
+ * tree.c (builtin_valid_in_constant_expr_p): New.
+
+2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/17413
+ * pt.c (check_instantiated_args): Improve error message.
+ Fix logic when to print its second part.
+
+2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cp-tree.h (complete_type_or_else): Remove macro.
+ (complete_type_or_diagnostic): Rename to complete_type_or_else
+ and remove last argument.
+ * typeck.c (complete_type_or_diagnostic): Rename to
+ complete_type_or_else and remove last argument.
+
+2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cp-tree.h (commonparms): Remove prototype.
+ (convert_arguments): Likewise.
+ (PFN_FROM_PTRMEMFUNC): Remove.
+ * typeck.c (commonparms): Make static.
+ (convert_arguments): Add prototype. Make static.
+ (PFN_FROM_PTRMEMFUNC): Replace by pfn_from_ptrmemfunc.
+
+2005-01-31 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (cp_parser_primary_expression): Don't complain about
+ floating-point literals in integral constant expressions when
+ !pedantic.
+
+2005-02-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * parser.c (cp_parser_template_id): Revert comment patch too.
+
+ PR c++/18757
+ PR c++/19366
+ PR c++/19499
+ * parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
+ Issue an error when creating the template id.
+ * pt.c (fn_type_unification): Return early if the explicit
+ template arg list is an error_mark_node.
+
+2005-01-31 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (build_enumerator): Do not issue duplicate error messages
+ about invalid enumeration constants.
+ * parser.c (cp_parser_non_integral_constant_expression): Always
+ set parser->non_integral_constant_expression_p.
+ (cp_parser_primary_expression): Add cast_p parameter. Issue
+ errors about invalid uses of floating-point literals in
+ cast-expressions.
+ (cp_parser_postfix_expression): Add cast_p parameter.
+ (cp_parser_open_square_expression): Pass it.
+ (cp_parser_parenthesized_expression_list): Add cast_p parameter.
+ (cp_parser_unary_expression): Likewise.
+ (cp_parser_new_placement): Pass it.
+ (cp_parser_direct_new_declarator): Likewise.
+ (cp_parser_new_initializer): Likewise.
+ (cp_parser_cast_expression): Add cast_p parameter.
+ (cp_parser_binary_expression): Likewise.
+ (cp_parser_question_colon_clause): Likewise.
+ (cp_parser_assignment_expression): Likewise.
+ (cp_parser_expression): Likewise.
+ (cp_parser_constant_expression): If an integral constant
+ expression is invalid, return error_mark_node.
+ (cp_parser_expression_statement): Pass cast_p.
+ (cp_parser_condition): Likewise.
+ (cp_parser_iteration_statement): Likewise.
+ (cp_parser_jump_statement): Likewise.
+ (cp_parser_mem_initializer): Likewise.
+ (cp_parser_template_argument): Likewise.
+ (cp_parser_parameter_declaration): Likewise.
+ (cp_parser_initializer): Likewise.
+ (cp_parser_throw_expression): Likewise.
+ (cp_parser_attribute_list): Likewise.
+ (cp_parser_simple_cast_expression): Likewise.
+ (cp_parser_functional_cast): Likewise.
+ (cp_parser_late_parsing_default_args): Likewise.
+ (cp_parser_sizeof_operand): Save/restore
+ non_integral_constant_expression_p.
+
+2005-01-31 Mike Stump <mrs@apple.com>
+
+ * parser.c (cp_lexer_new_main): Get the first token, first, before
+ doing anything.
+
+2005-01-31 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (start_decl): Add missing parentheses.
+
+2005-01-30 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19555
+ * cp-tree.h (DECL_USE_TEMPLATE): Expand documentation.
+ * decl.c (duplicate_decls): Do not discard
+ DECL_IMPLICIT_INSTANTIATION when merging declarations.
+ (start_decl): Do not SET_DECL_TEMPLATE_SPECIALIZATION for
+ variables that do not have DECL_USE_TEMPLATE.
+
+ PR c++/19395
+ * decl.c (grokdeclarator): Refactor code so that qualified names
+ are never allowed as the declarator in a typedef.
+
+ PR c++/19367
+ * name-lookup.c (do_nonmember_using_decl): Avoid overloading
+ builtin declarations.
+
+ PR c++/19457
+ * call.c (convert_like_real): Inline call to
+ dubious_conversion_warnings here.
+ * cp-tree.h (dubious_conversion_warnings): Remove.
+ * semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before
+ setting TREE_NEGATED_INT.
+ * typeck.c (dubious_conversion_warnings): Remove.
+
+ PR c++/19349
+ * name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
+ memory.
+
+2005-01-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19253
+ * parser.c (cp_parser_diagnose_invalid_type_name): Commit to
+ tentative parses.
+
+ PR c++/19667
+ * pt.c (redeclare_class_template): Robustify.
+
+2005-01-27 Steven Bosscher <stevenb@suse.de>
+
+ * decl.c (finish_case_label): Use SWITCH_STMT accessor macros
+ instead of SWITCH_EXPR ones.
+ * pt.c (tsubst_expr): Likewise.
+ * semantics.c (begin_switch_stmt, finish_switch_cond,
+ finish_switch_stmt): Likewise.
+
+2005-01-26 J"orn Rennecke <joern.rennecke@st.com>
+
+ PR c++/18370
+ * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.
+
+2005-01-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * class.c (abort_fndecl_addr): New variable.
+ (build_vtbl_initializer): If we have a pure virtual function
+ share the abort function's address.
+ Include gt-cp-class.h at the end.
+ * config-lang.in (gtfiles): Add cp/class.c.
+
+2005-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cxx-pretty-print.c (pp_cxx_statement): Add prototype. Make static.
+ (pp_cxx_function_definition): Make static.
+ * cxx-pretty-print.h (pp_cxx_statement): Remove prototype.
+ (pp_cxx_function_definition): Likewise.
+
+2005-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * name-lookup.c (print_binding_level): Make static.
+ (constructor_name_full): Make static inline.
+ (current_decl_namespace): Make static.
+ * name-lookup.h (constructor_name_full): Remove prototype.
+ (print_binding_level): Likewise.
+ (current_decl_namespace): Likewise.
+
+2005-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * decl.h (debug_bindings_indentation): Remove.
+
+2005-01-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * typeck.c: Fix a comment typo.
+
+2005-01-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/19208
+ * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr
+ at least once.
+ (tsubst): Use fold_decl_constant_value in place of a bare call to
+ integral_constant_value.
+
+2005-01-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * typeck.c (more_qualified_p): Remove.
+ * cp-tree.h: Remove the corresponding prototype.
+
+2005-01-19 Matt Austern <austern@apple.com>
+
+ * typeck.c (comptypes): Handle return code from objc_comptypes
+ correctly.
+
+2005-01-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h, name-lookup.h: Remove unused prototypes.
+
+2005-01-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/19375
+ * semantics.c (finish_id_expression): Disable access checking for
+ already lookuped FIELD_DECL.
+
+2005-01-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * decl.c (delete_block): Remove.
+ * cp-tree.h: Remove the corresponding prototype.
+
+ * decl.c (vtable_decl_p, vtype_decl_p, walk_globals_data,
+ walk_vtables_r, walk_vtables, walk_globals_r, walk_globals):
+ Remove.
+ * cp-tree.h: Remove the corresponding prototypes.
+
+ * tree.c (count_functions, bound_pmf_p, cp_is_overload_p,
+ cp_update_decl_after_saving, name_p): Remove.
+ * cp-tree.h: Remove the corresponding prototypes.
+
+2005-01-18 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/19472
+ * semantics.c (finish_asm_stmt): Strip nops off
+ input memory operands.
+
+2005-01-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,
+ typeck2.c: Update copyright.
+
+2005-01-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * class.c (get_enclosing_class): Remove.
+ * cp-tree.h: Remove the corresponding prototypes.
+
+ * cvt.c (convert_lvalue): Remove.
+ * cp-tree.h: Remove the corresponding prototype.
+
+ * pt.c (tinst_for_decl): Remove.
+ * cp-tree.h: Remove the corresponding prototypes.
+
+ * tree.c (hash_chainon): Remove.
+ * cp-tree.h: Remove the corresponding prototypes.
+
+2005-01-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/19263
+ * typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
+ of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
+
+2005-01-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Make-lang.in (cp-warn): Don't append $(WERROR).
+
+2005-01-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h: Fix a comment typo.
+
+2005-01-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19298
+ * pt.c (tsubst_qualified_id): Call convert_from_reference.
+
+2005-01-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19244
+ * class.c (add_implicitly_declared_members): Remove dead code.
+ * decl.c (grokfndecl): Add sfk parameter. Use it do set
+ DECL_CONSTRUCTOR_P.
+ (grokdeclarator): Adjust calls to grokfndecl.
+ * method.c (implicitly_declare_fn): Improve documentation.
+ * parser.c (cp_parser_direct_declarator): Do not consider a
+ function to be a constructor if the containing class was
+ originally anonymous.
+
+2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/17154
+ * search.c (lookup_field_1): Handle using declaration in
+ class template partial specialization.
+
+2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/19258
+ * pt.c (push_access_scope): Handle friend defined in class.
+ (pop_access_scope): Likewise.
+
+2005-01-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19270
+ * pt.c (tsubst_copy) <ARRAY_REF case>: Handle separately.
+ (tsubst_copy_and_build) <ARRAY_REF case>: Remove obsolete
+ array-new handling code. Use build_x_binary_op.
+
+2005-01-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19030
+ * cp-tree.h (start_decl): Take pointer to pushed scope, not bool.
+ * name-lookup.h (push_scope): Return pushed scope, not flag.
+ * name-lookup.c (push_scope): Return scope that should be popped,
+ not a flag.
+ * decl.c (start_decl): Adjust.
+ (grokfndecl): Adjust scope push and pop.
+ * decl2.c (check_classfn): Likewise.
+ * parser.c (cp_parser_condition, cp_parser_conversion_function_id,
+ cp_parser_init_declarator, cp_parser_direct_declarator,
+ cp_parser_class_specifier, cp_parser_class_head,
+ cp_parser_lookup_name,
+ cp_parser_constructor_declarator_p): Likewise.
+ * pt.c (instantiate_class_template,
+ resolve_typename_type): Likewise.
+
+2005-01-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/14136
+ * parser.c (cp_parser_unqualified_id): Do not issue error message
+ for typedef-name as destructor declarator when performing an
+ uncommitted tentative parse.
+
+2005-01-01 Steven Bosscher <stevenb@suse.de>
+
+ PR middle-end/17544
+ * decl.c (finish_function): Fix comment. Annotate the compiler
+ generated return with the current file name and line 0.
diff --git a/gcc/cp/ChangeLog-2006 b/gcc/cp/ChangeLog-2006
new file mode 100644
index 00000000000..bbdfbc2aaa2
--- /dev/null
+++ b/gcc/cp/ChangeLog-2006
@@ -0,0 +1,3495 @@
+2006-12-31 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/29731
+ * parser.c (cp_parser_primary_expression): Return error_mark_node when
+ a statement-expression is found outside of a function body.
+
+2006-12-28 Kazu Hirata <kazu@codesourcery.com>
+
+ * cp-tree.h (TYPE_NAMESPACE_SCOPE_P, TYPE_FUNCTION_SCOPE_P):
+ Remove.
+
+ * decl2.c: Fix a comment typo.
+
+2006-12-21 Andrew Pinski <pinskia@gmail.com>
+
+ PR C++/30225
+ * decl.c (cxx_builtin_function): Only copy the decl if adding
+ it to the std namespace.
+
+2006-12-21 Andrew Pinski <pinskia@gmail.com>
+
+ PR C++/30168
+ * optimize.c (update_cloned_parm): Copy DECL_GIMPLE_REG_P also.
+
+2006-12-22 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl.c: Fix a coment typo.
+
+2006-12-18 Ian Lance Taylor <iant@google.com>
+
+ * decl.c (start_preparsed_function): Add support for
+ -Wmissing-declarations.
+
+2006-12-16 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/29475
+ * cp-tree.h (struct deferred_access_check): New structure to represent a
+ deferred access check. It replaces the previous representation as a tree.
+ (get_deferred_access_checks): Return a vector of struct
+ deferred_access_check instead of a tree list.
+ (perform_access_checks): Take a vector of struct deferred_access_check
+ instead of a tree list.
+ * semantics.c (struct deferred_access): Store the deferred access checks
+ as a vector of struct deferred_access_check instead of a tree list.
+ (push_deferring_access_checks): Handle the change in struct
+ deferred_access.
+ (get_deferred_access_checks): Likewise.
+ (pop_to_parent_deferring_access_checks): Likewise.
+ (perform_or_defer_access_check): Likewise.
+ (perform_access_checks): Take a vector of struct deferred_access_check
+ instead of a tree list.
+ * parser.c (struct tree_check): New structure to store various data
+ associated with a CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID token.
+ (struct cp_token): Changed the value field to be a union with a pointer to
+ a struct tree_check for CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID
+ tokens and a tree field for all other tokens.
+ (eof_token): Adjusted due to the change in struct cp_token.
+ (cp_lexer_get_preprocessor_token): Likewise.
+ (cp_lexer_purge_token): Likewise.
+ (cp_lexer_purge_tokens_after): Likewise.
+ (cp_lexer_print_token): Likewise.
+ (cp_parser_error): Likewise.
+ (cp_parser_identifier): Likewise.
+ (cp_parser_string_literal): Likewise.
+ (cp_parser_primary_expression): Likewise.
+ (cp_parser_unqualified_id): Likewise.
+ (cp_parser_parenthesized_expression_list): Likewise.
+ (cp_parser_storage_class_specifier_opt): Likewise.
+ (cp_parser_function_specifier_opt): Likewise.
+ (cp_parser_type_specifier): Likewise.
+ (cp_parser_simple_type_specifier): Likewise.
+ (cp_parser_initializer_list): Likewise.
+ (cp_parser_member_specification_opt): Likewise.
+ (cp_parser_attribute_list): Likewise.
+ (cp_parser_objc_expression): Likewise.
+ (cp_parser_objc_protocol_qualifiers): Likewise.
+ (cp_parser_objc_selector): Likewise.
+ (cp_parser_objc_declaration): Likewise.
+ (cp_parser_objc_statement): Likewise.
+ (cp_parser_omp_clause_name): Likewise.
+ (cp_parser_omp_clause_default): Likewise.
+ (cp_parser_omp_clause_schedule): Likewise.
+ (cp_parser_omp_parallel): Likewise.
+ (cp_parser_initial_pragma): Likewise.
+ (pragma_lex): Likewise.
+ (cp_parser_pre_parsed_nested_name_specifier): Likewise.
+ (cp_parser_nested_name_specifier_opt): Likewise.
+ Use cp_token::u::tree_check_value to save the token's value, the
+ associated deferred checks and its qualifying scope.
+ (cp_parser_template_id): Likewise.
+ (cp_parser_template_declaration_after_export): Adjusted the call to
+ get_deferred_access_checks.
+ (cp_parser_init_declarator): Take the access checks as a vector of struct
+ deferred_access_check instead of a tree list.
+ (cp_parser_single_declaration): Likewise.
+ (cp_parser_perform_template_parameter_access_checks): Likewise.
+ (cp_parser_simple_declaration): Adjusted the call to
+ cp_parser_init_declarator.
+ (cp_parser_explicit_specialization): Adjusted the call to
+ cp_parser_single_declaration.
+
+2006-12-13 Ian Lance Taylor <iant@google.com>
+
+ PR c++/19564
+ PR c++/19756
+ * parser.c (cp_parser_expression_stack_entry): Add field
+ lhs_type.
+ (cp_parser_binary_expression): Track tree code of left hand side
+ of expression. Use it when calling build_x_binary_op.
+ (cp_parser_selection_statement): Add if_p parameter. Change all
+ callers. Warn about ambiguous else.
+ (cp_parser_statement): Add if_p parameter. Change all callers.
+ (cp_parser_implicitly_scoped_statement): Likewise.
+ * typeck.c (build_x_binary_op): Add parameters arg1_code and
+ arg2_code. Change all callers. Call warn_about_parentheses.
+ * cp-tree.h (build_x_binary_op): Update declaration.
+
+2006-12-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * decl.c (build_enumerator): Update error message to match C
+ front-end.
+
+2006-12-11 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (var_finalized_p): Update for renamed varpool functions.
+
+2006-12-09 Zack Weinberg <zackw@panix.com>
+
+ * parser.c (yydebug, enum pragma_omp_clause): Delete.
+
+2006-12-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29732
+ * cp-tree.h (DECL_USE_TEMPLATE): Mention partial specializations.
+ (explicit_class_specialization_p): Declare.
+ * pt.c (explicit_class_specialization_p): New function.
+ * parser.c (cp_parser_init_declarator): Check correct number of
+ template parameters for in-class function definitions.
+ (cp_parser_check_declrator_template_parameters): Stop looking for
+ template classes when we find an explicit specialization.
+
+2006-12-07 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/29980
+ * cp_parser_elaborated_type_specifier: Check
+ the return value of check_elaborated_type_specifier.
+
+2006-12-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29730
+ * parser.c (cp_parser_init_declarator): Reject initialization of
+ functions.
+
+2006-12-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29729
+ * decl2.c (check_member_template): Move check for member
+ templates in local classes to ...
+ * parser.c (cp_parser_template_declaration_after_export):
+ ... here.
+
+ PR c++/29728
+ * decl.c (check_array_designated_initializer): New function.
+ (maybe_deduce_size_from_array_init): Use it.
+ (reshape_init_array): Likewise.
+
+2006-12-05 Aldy Hernandez <aldyh@redhat.com>
+
+ Merge from gimple-tuples-branch.
+
+ 2006-10-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp-gimplify.c (cp_gimplify_expr): Adjust for GIMPLE_MODIFY_STMT.
+ (cxx_omp_clause_apply_fn): Adjust for GIMPLE_MODIFY_STMT.
+ (cxx_omp_clause_copy_ctor): Same.
+ (cxx_omp_clause_assign_op): Same.
+
+ 2006-09-28 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp-tree.h (union lang_tree_node): Gimple statements do not
+ have a TREE_CHAIN.
+ (TREE_INDIRECT_USING): Look in base.
+
+2006-12-04 Jan Hubicka <jh@suse.cz>
+
+ * cp-objcp-common.c (cp_expr_size): Return NULL in the case
+ size is undefined.
+
+2006-12-04 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29733
+ * pt.c (tsubst_decl): Disallow variables of function type.
+
+ PR c++/29632
+ * call.c (add_builtin_candidate): Do not permit NULL pointer
+ constants to be compared with template parameters.
+
+2006-12-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * pt.c (for_each_template_parm_r) <INTEGER_TYPE>: New case.
+ Call for_each_template_parm on TYPE_MIN_VALUE and TYPE_MAX_VALUE.
+
+2006-12-03 Richard Henderson <rth@redhat.com>
+ Andrew Pinski <pinskia@gmail.com>
+
+ PR C++/14329
+ * error.c (cp_printer) <'D'>: Handle DECL_DEBUG_EXPR.
+
+2006-12-02 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/30033
+ * decl.c (cp_tree_node_structure): Handle STATIC_ASSERT.
+
+2006-12-02 Kazu Hirata <kazu@codesourcery.com>
+
+ * name-lookup.c: Follow spelling conventions.
+
+2006-12-01 Geoffrey Keating <geoffk@apple.com>
+
+ * decl.c (poplevel): Check DECL_INITIAL invariant.
+ (duplicate_decls): Preserve DECL_INITIAL when eliminating
+ a new definition in favour of an old declaration.
+ (start_preparsed_function): Define and document value of
+ DECL_INITIAL before and after routine.
+ (finish_function): Check DECL_INITIAL invariant.
+ * parser.c
+ (cp_parser_function_definition_from_specifiers_and_declarator):
+ Skip duplicate function definitions.
+
+2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/30022
+ * typeck.c (type_after_usual_arithmetic_conversions):
+ Fix assertion for vector types.
+ (build_binary_op): Use temporary for inner type of vector types.
+
+2006-12-01 Ryan Mansfield <rmansfield@qnx.com>
+
+ PR c++/29066
+ * typeck.c (build_binary_op): Fix pointer to member function
+ comparison for ptrmemfunc_vbit_in_delta targets.
+
+2006-12-01 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/18313
+ * decl.c (grokdeclarator): Warn for type qualifiers on return
+ type for non-dependent types.
+ * pt.c (tsubst_function_type): Warn for type qualifiers on
+ return type for dependent types.
+
+2006-11-30 Geoffrey Keating <geoffk@apple.com>
+
+ * rtti.c (get_tinfo_decl): Handle return value from
+ pushdecl_top_level_and_finish.
+
+2006-11-29 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/29022
+ * parser.c (cp_parser_class_head): Move processing
+ of any base classes to...
+ (cp_parser_class_specifier) ...here. Take an extra
+ tree* parameter for any base classes. Only process
+ them if the opening brace was found.
+
+2006-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/29735
+ * decl.c (grokfndecl): Check main's type after applying
+ attributes, not before.
+
+2006-11-27 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (build_vcall_offset_vtbl_entries): Do not add vcall
+ entries for a primary construction virtual table.
+
+2006-11-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29886
+ * parser.c (cp_parser): Add in_function_body.
+ (cp_parser_new): Initialize it.
+ (cp_parser_primary_expression): Use parser->in_function_body
+ instead of at_function_scope_p.
+ (cp_parser_asm_definition): Likewise.
+ (cp_parser_direct_declarator): Likewise.
+ (cp_parser_class_specifier): Clear parser->in_function_body.
+ (cp_parser_constructor_declarator_p): Use parser->in_function_body
+ instead of at_function_scope_p.
+ (cp_parser_function_body_after_declarator): Set
+ parser->in_function_body.
+
+2006-11-21 Douglas Gregor <doug.gregor@gmail.com>
+
+ * cp-tree.def (STATIC_ASSERT): New.
+ * cp-objcp-common.c (cp_tree_size): Handle STATIC_ASSERT.
+ * error.c (dump_decl): Handle STATIC_ASSERT.
+ * cp-tree.h (STATIC_ASSERT_CONDITION): New.
+ (STATIC_ASSERT_MESSAGE): New.
+ (STATIC_ASSERT_SOURCE_LOCATION): New.
+ (struct tree_static_assert): New.
+ (enum cp_tree_node_structure_enum): Add TS_CP_STATIC_ASSERT.
+ (union lang_tree_node): Add static_assertion.
+ (finish_static_assert): Declare.
+ * cxx-pretty-print.c (pp_cxx_statement): Handle STATIC_ASSERT.
+ (pp_cxx_declaration): Handle STATIC_ASSERT.
+ * pt.c (instantiate_class_template): Handle
+ STATIC_ASSERT members.
+ (tsubst_expr): Handle STATIC_ASSERT statements.
+ * semantics.c (finish_static_assert): New.
+ * lex.c (D_CPP0X): New.
+ (reswords): Add static_assert keyword.
+ (init_reswords): If not flag_cpp0x, mask out C++0x keywords.
+ * parser.c (cp_parser_block_declaration): Parse static
+ assertions.
+ (cp_parser_static_assert): New.
+ (cp_parser_member_declaration): Parse static assertions.
+
+2006-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/29570
+ * decl.c (cp_finish_decl): Check for value dependent brace enclosed
+ scalar initializer.
+
+ PR c++/29734
+ * cp-tree.h (WANT_VECTOR): Define.
+ (WANT_ARITH): Add WANT_VECTOR.
+ * cvt.c (build_expr_type_conversion): Handle vector types.
+ * typeck.c (build_unary_op): Add WANT_VECTOR to
+ build_expr_type_conversion flags.
+
+2006-11-20 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/29475
+ * cp-tree.h (enforce_access, perform_or_defer_access_check): Added an
+ extra argument that represents the declaration to use to print
+ potential error messages.
+ * init.c (build_offset_ref): Adjusted the call to
+ perform_or_defer_access_check.
+ * class.c (alter_access, resolve_address_of_overloaded_function):
+ Likewise.
+ * decl.c (make_typename_type, make_unbound_class_template): Likewise.
+ * search.c (lookup_member): Likewise.
+ * friend.c (add_friend): Likewise.
+ * parser.c (cp_parser_template_id,
+ cp_parser_pre_parsed_nested_name_specifier): Likewise.
+ * semantics.c (finish_non_static_data_member,
+ check_accessibility_of_qualified_id, finish_id_expression): Likewise.
+ (pop_to_parent_deferring_access_checks, perform_access_checks,
+ perform_or_defer_access_check): Adjusted the call to enforce_access.
+ * call.c (enforce_access): Use the new extra argument to build the
+ error message.
+ (build_op_delete_call): Adjusted the call to
+ perform_or_defer_access_check.
+ (build_over_call): Likewise.
+
+2006-11-16 Dirk Mueller <dmueller@suse.de>
+
+ * name-lookup.c (begin_scope): Use GGC_CNEW instead of
+ GGC_NEW and memset.
+
+2006-11-13 Roger Sayle <roger@eyesopen.com>
+
+ * rtti.c (get_pseudo_ti_init): Ensure that the offset field of the
+ base type info initializer has the correct type.
+
+2006-11-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29518
+ * pt.c (coerce_template_parms): Do not skip_evaluation while
+ substituting template arguments.
+
+2006-11-11 Richard Guenther <rguenther@suse.de>
+
+ * typeck.c (build_unary_op): Remove handling of FIX_CEIL_EXPR,
+ FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
+
+2006-11-03 Roger Sayle <roger@eyesopen.com>
+
+ * call.c (build_op_delete_call): Test user-visible type against
+ size_type_node, instead of against the internal type, sizetype.
+ * class.c (type_requires_array_cookie): Likewise.
+ * mangle.c (write_builtin_type) <INTEGER_TYPE>: Remove special
+ handling of TYPE_IS_SIZETYPE.
+ * typeck.c (type_after_usual_arithmetic_conversions): Remove
+ special case handling of TYPE_IS_SIZETYPE.
+ (comptypes): Likewise.
+
+2006-11-01 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * decl.c (get_atexit_node): Reference atexit, not __cxa_exit.
+ if targetm.cxx.use_atexit_for cxa_atexit.
+ (start_cleanup_fn): Likewise.
+ (register_dtor_fn): Likewise.
+
+2006-09-25 Geoffrey Keating <geoffk@apple.com>
+
+ * decl2.c (cp_write_global_declarations): Rename from
+ cp_finish_file.
+ * cp-lang.c (finish_file): Don't call cp_finish_file.
+ * cp-tree.h (cp_write_global_declarations): Rename from
+ cp_finish_file.
+ * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Define to
+ cp_write_global_declarations.
+
+2006-10-31 Geoffrey Keating <geoffk@apple.com>
+
+ * name-lookup.c (get_anonymous_namespace_name): New.
+ (push_namespace_with_attribs): Use get_anonymous_namespace_name.
+ * decl2.c (start_objects): Update for rename of
+ get_file_function_name_long.
+
+2006-10-30 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/28704
+ * decl.c (grokdeclarator): Duplicate diagnostic message
+ for easier translation.
+ * decl.c (grokdeclarator): Fix line-wrapping.
+
+2006-10-30 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/6321
+ * decl.c (grokfndecl): Use check_main_parameter_types.
+
+2006-10-30 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/28669
+ * decl.c (grokfndecl): Duplicate warning message for
+ easier translation.
+
+2006-10-30 Dirk Mueller <dmueller@suse.de>
+
+ * typeck.c (build_unary_op): Fix indenting. Use G_().
+
+2006-10-29 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/29089
+ * typeck.c (build_unary_op): Duplicate warning message
+ for easier translation.
+
+2006-10-29 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/16307
+ * typeck.c (build_array_ref): Warn for char subscriptions
+ on pointers.
+
+2006-10-29 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl.c: Fix a comment typo.
+
+2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/29295
+ * typeck.c (build_unary_op): Use same_type_p when comparing to
+ boolean type.
+
+2006-10-29 Dirk Mueller <dmueller@suse.de>
+
+ PR c++/29033
+ * typeck.c (build_binary_op): Duplicate warning message
+ for better translation.
+
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * decl.c (builtin_function_1): Move common code to
+ add_builtin_function.
+ (builtin_function): Rename to cxx_builtin_function.
+ Change the signature.
+ * call.c: Include langhooks.h.
+ (build_java_interface_fn_ref): Replace calls to
+ builtin_function with add_builtin_function.
+ * Make-lang.in (cp/call.o): Depend on langhooks.h.
+ * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as
+ cxx_builtin_function.
+ * cp-tree.h (builtin_function): Rename to cxx_builtin_function.
+ Change the signature.
+
+2006-10-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20647
+ * rtti.c (tinfo_base_init): The type info string is always global.
+
+2006-10-20 Lee Millward <lee.millward@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28053
+ * decl2.c (grokbitfield): Detect invalid non-integral
+ types earlier when possible.
+
+2006-10-18 Mark Shinwell <shinwell@codesourcery.com>
+
+ PR c++/26884
+ * typeck2.c (digest_init): Raise error upon attempts to
+ initialize arrays with variables.
+
+2006-10-17 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/27952
+ * cp-tree.h (xref_basetypes): Return bool instead of void.
+ * decl.c (xref_basetypes): Adjust definition. Return false
+ if the class bases are invalid.
+ * parser.c (cp_parser_class_head): Check the return value
+ from xref_basetypes.
+
+2006-10-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28261
+ * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Add
+ comment.
+
+ PR c++/28261
+ * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): New
+ function.
+ (cp_parser_constructor_declarator_p): Use it.
+ (cp_parser_check_type_definition): Return a value indicating
+ whether or not the definition is valid.
+ (cp_parser_enum_specifier): Skip invalid enum definitions.
+
+2006-10-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29039
+ * typeck2.c (build_functional_cast): Don't zero-initialize
+ non-PODs; instead, call their constructors.
+ * method.c (synthesize_method): Always build mem-initializers, if
+ we're synthesizing the default constructor.
+
+2006-10-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27270
+ * decl.c (reshape_init_class): Move check for designated
+ to ...
+ * parser.c (cp_parser_initializer_list): ... here.
+ * pt.c (tsubst_copy_and_build): Use finish_compound_literal.
+
+2006-10-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27270
+ * typeck2.c (process_init_constructor_array): Reword comment.
+ * pt.c (tsubst_copy_and_built): Call reshape_init before calling
+ digest_init.
+
+ PR c++/29408
+ * parser.c (cp_parser_using_declaration): Stop parsing when
+ something goes wrong with an access declaration.
+
+ PR c++/29435
+ * typeck.c (cxx_sizeof_or_alignof_type): Complete non-dependent
+ types when their sizes are required. Refine test for VLAs.
+
+ PR c++/28211
+ * parser.c (cp_parser_template_argument): Don't consider "&var" a
+ possible constant-expression.
+ * pt.c (convert_nontype_argument): Refine handling of arguments of
+ pointer type.
+
+2006-10-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28506
+ * parser.c (function_declarator_p): New function.
+ (cp_parser_init_declarator): Use it.
+ (cp_parser_member_declaration): Likewise.
+
+2006-10-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29318
+ * rtti.c (get_tinfo_decl): Refuse to create type info objects for
+ variably modified types.
+
+2006-10-12 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/27961
+ * decl.c (start_decl): Return error_mark_node if a
+ function is initialized like a variable.
+ (check_var_type): If a variable of field is declared void,
+ set the type to error_mark_node.
+ (grokdeclarator): Check the return type of check_var_type.
+ * class.c (finish_struct_1): Robustify.
+
+2006-10-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29175
+ * decl.c (check_initializer): Issue errors about trying to
+ initialize arrays whose elements have variable size.
+
+2006-10-11 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/29024
+ * cp-tree (struct cp_decl_specifier_seq): Rename to
+ conflicting_specifiers_p
+ * parser.c (cp_parser_set_storage_class): Set
+ conflicting_specifiers_p for the input decl specifier
+ if a typedef specifier is present. Rename uses of
+ multiple_specifiers_p to conflicting_specifiers_p.
+ (cp_parser_decl_specifier_seq) <RID_TYPEDEF>: If a storage
+ class specifier has already been set for this declaration,
+ set conflicting_specifiers_p to true on the decl_specs.
+ * decl.c (grokdeclarator): Rename uses of
+ multiple_specifiers_p to conflicting_specifiers_p.
+
+2006-10-10 Brooks Moses <bmoses@stanford.edu>
+
+ * Make-lang.in: Added "c++.pdf" target support.
+
+2006-10-10 Richard Guenther <rguenther@suse.de>
+
+ PR rtl-optimization/29323
+ * decl.c (finish_function): Set TREE_NOTHROW only for
+ functions that bind local.
+
+2006-10-09 Richard Henderson <rth@redhat.com>
+
+ Revert emutls patch.
+
+2006-10-04 Richard Henderson <rth@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (grokvardecl): Don't error if !have_tls.
+ (grokdeclarator): Likewise.
+ * parser.c (cp_parser_omp_threadprivate): Likewise.
+
+2006-10-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29020
+ * friend.c (do_friend): Improve comments; add assertion.
+ * parser.c (cp_parser_nested_name_specifier_opt): Resolve
+ typenames for qualified names used in declarations, even when
+ caching qualified name lookup.
+
+ PR c++/29138
+ * decl2.c (grokfield): Don't handle access declarations here.
+ * parser.c (cp_parser_using_declaration): Handle access
+ declarations too.
+ (cp_parser_block_declaration): Adjust calls to
+ cp_parser_using_declaration.
+ (cp_parser_member_declaration): Likewise. Use
+ cp_parser_using_declaration to look for access_declarations.
+
+2006-10-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/29291
+ * init.c (build_new): Check for invalid init.
+
+2006-10-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29226
+ * typeck.c (cxx_sizeof_or_alignof_type): Tidy. In templates, do
+ not try to actually evaluate sizeof for a VLA type.
+
+2006-10-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29105
+ * pt.c (tsubst_baselink): Substituteinto the qualifying scope.
+ * semantics.c (baselink_for_fns): Build a baselink, even when
+ processing a template.
+
+ PR c++/29080
+ * parser.c (cp_parser_postfix_dot_deref_expression): Use
+ BASELINK_ACCESS_BINFO as the qualifying scope when calling
+ adjust_result_of_qualified_name_lookup.
+
+2006-09-25 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/27329
+ PR c++/26938
+ * cp-tree.h (redeclare_class_template): Adjust declaration
+ to return bool instead of void.
+ * pt.c (redeclare_class_template): Update definition.
+ Return false on error.
+ * decl.c (xref_tag): Return error_mark_node if
+ redeclare_class_template returned false.
+
+ PR c++/27667
+ * cp-tree.h (begin_specialization): Return bool
+ instead of void.
+ * pt.c (check_specialization_scope): Likwise.
+ Adjust comment. Return false if a specialization
+ isn't permitted in the current scope.
+ (begin_specialization): Use the return value of
+ check_specialization_scope.
+ * parser.c (cp_parser_explicit_specialization): If
+ begin_specialization returned false, skip the rest
+ of the specialization.
+
+2006-09-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/29016
+ * typeck.c (build_unary_op): Don't form an ADDR_EXPR around a
+ BASELINK.
+
+2006-09-21 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/28861
+ * decl.c (shadow_tag): Return error_mark_node
+ if maybe_process_partial_specialization failed.
+
+ PR c++/28303
+ * decl.c (grokdeclarator): Return error_mark_node on
+ declaration with two or more data types.
+
+2006-09-20 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/27650
+ * class.c (check_for_override): Remove dllimport from virtual
+ methods.
+
+2006-09-18 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c++/29087
+ * parser.c (cp_parser_labeled_statement): Return nothing. Do
+ not take in_statement_expr and in_compound as arguments. Rename
+ to cp_parser_label_for_labeled_statement. Parse only the label,
+ not the statement.
+ (cp_parser_statement): Parse the statement of a labeled-statement
+ from here, using tail recursion.
+
+2006-09-14 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/29002
+ * init.c (build_zero_init): If we have an error mark node for
+ the array size, return.
+
+2006-09-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28991
+ * cp-objcp-common.c (cxx_staticp): New function.
+ * cp-objcp-common.h (LANG_HOOOKS_STATICP): Use it.
+ * cp-tree.h (cxx_staticp): New function.
+
+2006-09-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/28996
+ * cvt.c (convert_to_void): Strip COMPONENT_REF to functions.
+
+2006-09-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28858
+ * parser.c (cp_parser_skip_until_found): Rename to
+ cp_parser_skip_to_end_of_template_parameter_list. Remove last two
+ parameters. Track levels of '< ... >'. Stop at '{', '}', or ';'.
+ Reorganize. Adjust comment.
+ (cp_parser_template_declaration_after_export): Adjust call.
+ (cp_parser_enclosed_template_argument_list): Likewise.
+
+2006-09-07 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/28906
+ * init.c (build_new_1): Build a distinct type copy
+ for the array type that was returned from
+ build_cplus_array_type.
+
+2006-09-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/27371
+ * cvt.c (convert_to_void): Enable previous change.
+
+ PR c++/26957
+ * method.c (use_thunk): Clear DECL_HAS_VALUE_EXPR_P on copied
+ parms.
+
+2006-09-07 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/28284
+ * pt.c (fold_non_dependent_expr): Make sure expr is not
+ dereferenced if it is NULL.
+
+2006-09-06 Zak Kipling <zak@transversal.com>
+
+ PR c++/26195
+ * decl.c (make_rtl_for_nonlocal_decl),
+ (start_preparsed_function): Don't use lbasename on
+ input_filename when calling get_fileinfo.
+ * semantics.c (begin_class_definition): Likewise.
+ * lex.c (cxx_make_type): Likewise.
+ (handle_pragma_interface): Call get_fileinfo on input_filename,
+ not on the parameter to the directive.
+
+2006-09-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28903
+ * pt.c (tsubst): Use fold_non_dependent_expr to fold array
+ dimensions.
+
+ PR c++/28886
+ * pt.c (unify): Avoid unnecessary calls to fold_build2 for array
+ dimensions.
+
+2006-09-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/27371
+ * cvt.c (convert_to_void): Strip useless TARGET_EXPR.
+ * cp-tree.h (TARGET_EXPR_IMPLICIT_P): New macro.
+ * tree.c (build_cplus_new): Set it.
+
+ PR c++/26696
+ * cvt.c (convert_to_void): Replace a subexpression with no side
+ effects with void_zero_node.
+ * tree.c (is_overloaded_fn): Look through COMPONENT_REF.
+ (get_first_fn): Ditto.
+ * decl.c (grokdeclarator): No need to look through COMPONENT_REF.
+
+2006-09-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/26571
+ * parser.c (cp_parser_diagnose_invalid_type_name): Handle the case
+ where the name is a type used incorrectly.
+
+ PR c++/26671
+ * typeck.c (maybe_warn_about_returning_address_of_local): Look
+ through COMPONENT_REF and ARRAY_REF.
+
+ PR c++/26102
+ * name-lookup.c (do_class_using_decl): Try to find the base even
+ if bases_dependent_p.
+ * pt.c (type_dependent_expression_p): A USING_DECL is dependent.
+
+ PR c++/19809
+ * pt.c (tsubst_friend_function): Set DECL_INITIAL before pushdecl.
+
+2006-09-04 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR 23287 Revert my 2006-09-01 patch.
+ * parser.c: Reverted.
+ * pt.c: Reverted.
+
+2006-09-02 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/27670
+ PR c++/27493
+ PR c++/27494
+ PR c++/27397
+ * parser.c (cp_parser_template_parameter_list): Add
+ invalid template parameters to the parameter list as
+ error_mark_node.
+
+2006-09-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/28878
+ * except.c (build_throw): Only set current_function_returns_abnormally
+ if cfun is not NULL.
+
+ PR c++/26917
+ * repo.c (repo_file): Remove.
+ (open_repo_file, reopen_repo_file_for_write): Return fopened
+ FILE * instead of setting global repo_file variable.
+ (init_repo): Adjust caller.
+ (finish_repo): Likewise. Return instead of goto out before
+ reopen_repo_file_for_write has been called.
+
+2006-09-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/28705
+ * semantics.c (finish_call_expr): Add assert.
+ * name-lookup.c (lookup_arg_dependent): Check we found an overload
+ or an object.
+
+ PR c++/23287
+ * parser.c (cp_parser_id_expression): Add member_p
+ argument. Update all callers.
+ (cp_parser_unqualified_id): Likewise. Lookup a destructor name in
+ the object's scope, if valid.
+ (cp_parser_global_scope_opt): Add object_scope_valid_p. Update
+ callers.
+ (cp_parser_postfix_dot_deref_expression): Set object_scope.
+ * pt.c (tsubst_copy_and_build): Lookup dependent dtor name here.
+
+2006-08-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/26670
+ * class.c (check_field_decls): Don't unset TYPE_PACKED until all
+ the fields have been processed.
+
+2006-08-29 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/28349
+ * call.c (build_x_va_arg): Remove the reference type
+ from the type before creating the pointer type.
+
+2006-08-29 J"orn Rennecke <joern.rennecke@st.com>
+
+ PR c++/28139
+ * except.c (expand_start_catch_block): Use correct types for bitwise
+ copy.
+
+2006-08-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/26670
+ * class.c (check_field_decls): Unset TYPE_PACKED (t) if one of the
+ fields can't be packed.
+
+ PR c++/26577
+ * cvt.c (convert_to_void): Don't automatically load from volatiles
+ of TREE_ADDRESSABLE type.
+
+2006-08-28 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28860
+ * cp-tree.h (maybe_process_partial_specialization): Return
+ tree instead of void.
+ * parser.c (cp_parser_class_head): Use return value of
+ maybe_process_partial_specialization.
+ * pt.c (maybe_process_partial_specialization): Return error_mark_node
+ for broken specializations, TYPE otherwise. Check for template
+ template parameters.
+
+2006-08-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28058
+ * pt.c (register_specialization): Return error_mark_node for
+ specialization-after-instantiation.
+ * decl2.c (mark_used): Mark the main function used when one of its
+ clones is used.
+
+2006-08-27 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/26573
+ * class.c (check_field_decls): Don't issue error about
+ local classes containing static data members.
+
+2006-08-26 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c++/24009
+ * parser.c (struct cp_token): Add input_file_stack_index.
+ (eof_token): Update.
+ (cp_lexer_get_preprocessor_token): Save input_file_stack_tick.
+ (cp_lexer_set_source_position_from_token): Restore input file
+ stack.
+
+2006-08-26 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/28736
+ PR c++/28737
+ PR c++/28738
+ * pt.c (process_template_parm): Store invalid template
+ parameters as a TREE_LIST with a TREE_VALUE of error_mark_node.
+ (push_inline_template_parms_recursive): Check for template
+ parameters having a TREE_VALUE of error_mark_node rather than
+ check the parameter itself.
+ (mangle_class_name_for_template): Likewise.
+ (comp_template_parms): When comparing the individual template
+ parameters, return 1 if either is error_mark_node.
+ (current_template_args): Robustify.
+ (redeclare_class_template): Likewise.
+
+2006-08-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28588
+ * class.c (resolve_address_of_overloaded_function): Add
+ access_path parameter. Perform access checks.
+ (instantiate_type): Adjust call to
+ resolve_address_of_overloaded_function. Remove unnecessary code.
+ * tree.c (is_overloaded_fn): Document. Return 2 when there are
+ acutally multiple functions.
+ (really_overloaded_fn): Use is_overloaded_fn.
+ * mangle.c (write_expression): Handle BASELINKs.
+ * cp-tree.h (really_overloaded_fn): Return bool.
+ (baselink_for_fns): Declare.
+ * search.c (lookup_member): Check access for single static
+ functions here.
+ * pt.c (convert_nontype_argument_function): Handle BASELINKs.
+ (tsubst_copy_and_build): Generate BASELINKs for template-ids.
+ * semantics.c (finish_call_expr): Use baselink_for_fns.
+ (baselink_for_fns): New function.
+ (finish_id_expression): Use it.
+ * parser.c (cp_parser_template_argument): Don't strip BASELINKs.
+
+ PR c++/28595
+ * pt.c (tsubst): Issue errors about attempts to create VLAs at
+ template-instantiation time.
+
+2006-08-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28853
+ * typeck2.c (cxx_incomplete_type_diagnostic): Handle template
+ template parameters. Improve error message for template type
+ parameters.
+
+ PR c++/28852
+ * cp-tree.h (grok_op_properties): Return bool instead of void.
+ * decl.c (grokfndecl): Discard invalid operator declarations.
+ (copy_fn_p): Revert change for PR 27547.
+ (grok_op_properties): Return error status (true on success).
+ * pt.c (tsubst_decl): Discard invalid operator declarations.
+
+2006-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28056
+ * decl.c (grokdeclarator): Disallow declarations with qualified
+ names in local scopes.
+
+2006-08-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/27787
+ * decl.c (make_typename_type): Only try and resolve it when
+ context is not dependent. Refactor.
+ * decl2.c (check_classfn): Push to class scope before looking for
+ the function.
+
+2006-08-24 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR driver/28528
+ * g++spec.c (lang_specific_driver): Always check if we need to
+ swallow a space-separated arg to '-x'.
+ * lang-specs.h: Don't create ouput files for '-xc++-header'
+ if -fsyntax-only.
+
+2006-08-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/27714
+ * pt.c (push_template_decl_real): A friend template with class
+ scope isn't primary.
+
+2006-08-23 Benjamin Smedberg <benjamin@smedbergs.us>
+
+ PR c++/28687
+ * rtti.c (build_dynamic_cast, build_dynamic_cast_1):
+ Move -fno-rtti check to be more specific.
+
+2006-08-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/23372
+ * call.c (build_over_call): Don't make a copy here if build_call
+ will make one too.
+
+2006-08-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/28450
+ * cp/init.c (build_zero_init): Handle VECTOR_TYPE and
+ COMPLEX_TYPEs.
+
+2006-08-22 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/28420
+ * parser.c (cp_parser_postfix_expression): Make sure that the
+ saved value for parser->type_definition_forbidden_message is
+ restored before returning to avoid an invalid free().
+
+2006-08-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/28659
+ * typeck.c (merge_types): If either of the types have the right
+ attributes, return that one.
+
+ * tree.c (cp_build_type_attribute_variant): Make sure we aren't
+ doing this to class types.
+ * typeck.c (original_type): Deal with type quals properly.
+
+2006-08-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/27115
+ * semantics.c (finish_stmt_expr_expr): Don't try to voidify here,
+ just leave the expression as it is.
+ (finish_stmt_expr): If the statement-expression has class type,
+ wrap it in a TARGET_EXPR.
+ * cp-gimplify.c (cp_gimplify_init_expr): Don't bother with
+ CLEANUP_POINT_EXPR.
+ * except.c (build_throw): Give the CLEANUP_POINT_EXPR void type.
+
+2006-08-21 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/26269
+ * decl.c (duplicate_decls): Return early if either
+ newdecl or olddecl is error_mark_node.
+
+ PR c++/28505
+ * decl.c (grokdeclarator): Return early after
+ issuing diagnostic about an incomplete type.
+
+ PR c++/28741
+ * tree.c (decl_anon_ns_mem_p): Robustify.
+ * decl2.c (determine_visibility): Likewise.
+
+2006-08-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28341
+ * tree.c (cast_valid_in_integral_constant_expression_p): New
+ function.
+ * cp-tree.h (tsubst_copy_and_build): Adjust prototype.
+ * pt.c (tsubst_expr): Add integral_constant_expression_p
+ parameter.
+ (fold_non_dependent_expr): Adjust callers of
+ tsubst_{expr,copy_and_build}.
+ (tsubst_friend_function): Likewise.
+ (tsubst_template_arg): Likewise.
+ (tsubst_default_argument): Likewise.
+ (tsubst_decl): Likewise.
+ (tsubst): Likewise.
+ (tsubst_omp_clasuses): Likewise.
+ (regenerate_decl_fromp_template): Likewise.
+ (instantiate_decl): Likewise.
+ (tsubst_initializer_list): Likewise.
+ (tsubst_enum): Likewise.
+ (tsubst_expr): Use RECUR throughout.
+ (tsubst_copy_and_build): Change definition of RECUR. Do not allow
+ invalid casts in integral constant expressions.
+ * parser.c (cp_parser_postfix_expression): Use
+ cast_valid_in_integral_constant_expression_p.
+ (cp_parser_cast_expression): Likewise.
+ (cp_parser_functional_cast): Likewise.
+
+ PR c++/28346
+ * pt.c (tsubst_qualified_id): Do not strip references from
+ OFFSET_REFs.
+
+2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28606
+ * parser.c (cp_parser_diagnose_invalid_type_name): Handle BIT_NOT_EXPR.
+ Fix formatting.
+ (cp_parser_parse_and_diagnose_invalid_type_name): Tighten condition
+ for valid type-names.
+ (cp_parser_unqualified_id): Fix error handling for destructors.
+
+ PR c++/28710
+ * decl.c (xref_tag): Improve error message. Return early on error.
+
+ PR c++/28711
+ * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Robustify.
+
+2006-08-17 Paolo Bonzini <bonzini@gnu.org>
+
+ PR c++/28573
+ * semantics.c (finish_offsetof): Add new argument to fold_offsetof.
+
+2006-08-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/28302
+ * typeck.c (build_unary_op <case BIT_NOT_EXPR:>): Don't call
+ perform_integral_promotions for non integral type.
+
+2006-08-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/28385
+ * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Ignore quals from template
+ if arg is a function.
+
+2006-08-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28593
+ * init.c (build_new): Return early on invalid placement.
+
+2006-08-15 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/28594
+ * pt.c (process_template_parm): Robustify.
+
+2006-08-14 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/28288
+ PR c++/14556
+ * operators.def: Remove <?, ?>, <?=, and >?= operators.
+ * parser.c: Remove CPP_MIN, CPP_MAX, CPP_MIN_EQ, and CPP_MAX_EQ.
+ (cp_parser_warn_min_max): Remove.
+
+2006-08-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/28559
+ * parser.c (cp_parser_elaborated_type_specifier): Also ignore
+ attributes applied to a TYPENAME_TYPE.
+
+2006-08-09 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/28637
+ * pt.c (coerce_template_parms): Copy across the
+ invalid template arguments to the new template inner arguments.
+ (retrieve_specialization): Robustify.
+
+ PR c++/28638
+ * pt.c (coerce_template_template_parms): Robustify.
+
+ PR c++/28639
+ * error.c (dump_template_parms): Robustify.
+
+ PR c++/28640
+ * pt.c (redeclare_class_template): Robustify.
+
+ PR c++/28641
+ * pt.c (type_unification_real): Robustify.
+
+2006-08-03 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/28347
+ * decl.c (start_decl): Return error_mark_node if a
+ diagnostic was issed for an invalid typedef initialization.
+
+2006-08-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27508
+ * parser.c (cp_parser_unqualified_id): Check for invalid scopes
+ when parsing destructor names.
+
+ PR c++/28274
+ * decl.c (duplicate_decls): Call check_default_args here.
+ (start_preparsed_function): Do not call check_default_args.
+ * name-lookup.c (pushdecl_maybe_friend): Only call
+ check_default_args if duplicate_decls got bypassed.
+
+2006-08-02 Richard Guenther <rguenther@suse.de>
+
+ PR c++/28479
+ Revert
+ 2006-07-05 Richard Guenther <rguenther@suse.de>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR c++/27084
+ * cp-objcp-common.c (cxx_types_compatible_p): Ignore
+ top level qualifiers for pointer type comparisons.
+
+2006-08-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28557
+ * pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
+
+2006-07-31 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28523
+ * tree.c (stabilize_expr): Tweak documentation. Add assertion.
+ (stabilize_call): Tweak documentation.
+ (stabilize_init): Only call stabilize_call for calls.
+
+2006-08-01 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/28432
+ * decl2.c (check_classfn): Remove early return.
+ * search.c (lookup_member): Return NULL with bad type.
+
+2006-08-01 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/28256
+ * decl.c (check_initializer): Check for 1 initializer on scalar types.
+
+2006-08-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR debug/23336
+ * pt.c (tsubst_copy_and_build): Mark used enum types.
+ * semantics.c (finish_id_expression): Likewise.
+
+2006-07-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/6634
+ * decl.c (grokdeclarator): Check whether "long" or "short" was
+ specified for non-integral types.
+
+2006-07-28 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies.
+
+2006-07-28 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/27668
+ PR c++/27962
+ * pt.c (process_template_parm) Store invalid template
+ parameters as error_mark_node in the paramater list.
+ (push_inline_template_parms_recursive): Handle invalid
+ template parameters.
+ (comp_template_parms): Likewise.
+ (check_default_tmpl_arg): Likewise.
+ (coerce_template_template_parms): Likewise.
+ (mangle_class_name_for_template): Likewise.
+ (tsubst_template_parms): Likewise.
+ * error.c (dump_template_argument_list): Likewise.
+
+2006-07-28 Kazu Hirata <kazu@codesourcery.com>
+
+ * cp-tree.h: Fix a comment typo.
+
+2006-07-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27572
+ * decl.c (grokdeclarator): Return error_mark_node after invalid
+ typedef.
+
+2006-07-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR c++/28460
+ * decl.c (grokvardecl): Use FROB_CONTEXT.
+ * pt.c (register_specialization): Likewise.
+
+2006-07-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28025
+ * cp-tree.h (LOOKUP_HIDDEN): New macro. Reformat comments.
+ * name-lookup.c (unqualified_namespace_lookup): There is no way to
+ have a hidden name in non-namespace scopes.
+ * pt.c (tsubst_friend_class): Look for hidden names.
+ * decl.c (lookup_and_check_tag): Fix typo in comment.
+
+ * semantics.c (finish_compound_literal): Fix typo in comment.
+
+2006-07-21 Jason Merrill <jason@redhat.com>
+
+ * decl2.c (determine_visibility): Don't propagate visibility from
+ type to decl.
+ (constrain_class_visibility): Don't warn in system headers.
+ Don't warn about pointer fields.
+
+2006-07-20 Mike Stump <mrs@apple.com>
+
+ * decl2.c (determine_visibility_from_class): Don't use hidden
+ visibility for explicit instantiations.
+
+2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28250
+ * pt.c (tsubst_expr): Only apply DECL_TEMPLATE_INSTANTIATED to
+ valid decls. Cleanup.
+
+ PR c++/28363
+ * semantics.c (check_template_template_default_arg): Simplify
+ error handling.
+
+2006-07-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/28407
+ * decl.c (grokvardecl): Set DECL_THIS_STATIC on file-scope
+ const variables with implicit internal linkage.
+ * tree.c (decl_linkage): Only return lk_external if it's set.
+
+ PR c++/28409
+ * decl2.c (constrain_visibility): Ignore the anonymous namespace
+ for extern "C" decls.
+ (VISIBILITY_STATIC): Rename to VISIBILITY_ANON.
+
+ * decl2.c (constrain_visibility): Remove specified and reason
+ parameters. Don't touch decls that already have explicit visibility.
+ (determine_visibility): Do copy DECL_VISIBILITY_SPECIFIED from
+ template.
+ (determine_visibility_from_class): Reverse sense of
+ DECL_VISIBILITY_SPECIFIED test for target-specific visibility rules.
+ (constrain_class_visibility): Only complain about member visibility
+ if the member type is another class. Don't change visibility of the
+ current class.
+
+2006-07-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28338
+ * decl.c (layout_var_decl): Don't call push_local_name here.
+ (initialize_artificial_var): Assert artificiality.
+ (cp_finish_decl): Call push_local_name here.
+
+2006-07-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28337
+ * typeck.c (build_binary_op): Short-circuit pointer arithmetic in
+ templates.
+
+2006-07-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28048
+ * semantics.c (check_accessibility_of_qualified_id): Robustify.
+
+ PR c++/28235
+ * pt.c (tsubst_decl): Handling substitutions into a static data
+ member from within the scope of the tempalte itself.
+
+2006-07-18 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/28258
+ * method.c (locate_copy): Check for non_reference
+ returning error_mark_node.
+
+ PR c++/28260
+ * decl.c (duplicate_decls): Return error_mark_node
+ on ambiguous declaration.
+
+2006-07-18 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/27495
+ * search.c (adjust_result_of_qualified_name_lookup): Change
+ assert to part of if statement.
+
+2006-07-17 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/28291
+ * decl.c (reshape_init_class): Return error_mark_node on error.
+
+2006-07-17 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/28304
+ * decl2.c (check_classfn): Return NULL_TREE on error.
+
+2006-07-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28250
+ * name-lookup.c (pushdecl_maybe_friend): Return early on
+ error_mark_node.
+ * except.c (expand_start_catch_block): Use error_mark_node instead
+ of NULL_TREE for invalid decls.
+ * parser.c (cp_parser_exception_declaration): Return error_mark_node
+ on invalid catch parameter. Simplify.
+
+2006-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/28370
+ * decl2.c (note_vague_linkage_var): Removed.
+ (finish_static_data_member_decl): Add decl to pending_statics vector
+ directly. Do it even for non-public decls.
+
+2006-07-15 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/28292
+ * decl2.c (acceptable_java_type): Robustify. Use
+ proper Boolean return type instead of return 1.
+ (check_java_method): Don't issue error about
+ type not being an acceptable Java parameter if
+ it's error_mark_node.
+
+ PR c++/28269
+ * parser.c (cp_parser_elaborated_type_specifier):
+ Return early if an invalid type was detected.
+
+2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28249
+ * parser.c (cp_parser_check_decl_spec): New function.
+ (cp_parser_decl_specifier_seq): Factor out check for repeated
+ decl-specifiers into cp_parser_check_decl_spec. Use it.
+ (cp_parser_type_specifier_seq): Use it.
+
+ PR c++/28294
+ * semantics.c (finish_offsetof): Use TREE_OPERAND for COMPONENT_REFs
+ only.
+
+ PR c++/28387
+ * decl2.c (cplus_decl_attributes): Check for invalid decls.
+
+2006-07-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28343
+ * decl.c (cp_finish_decl): Check asmspec_tree for error_mark_node.
+ * decl2.c (grokfield): Likewise.
+
+2006-07-12 Geoffrey Keating <geoffk@apple.com>
+
+ * decl2.c (determine_visibility): Don't change visibility of
+ function locals because of -fvisibility-inlines-hidden.
+
+2006-07-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/28217
+ * semantics.c (note_decl_for_pch): Don't premangle templates.
+
+2006-07-12 Martin Michlmayr <tbm@cyrius.com>
+
+ * typeck.c (string_conv_p): Remove spurious quotation mark in
+ warning.
+
+2006-07-07 Lee Millward <lee.millward@gmail.com>
+ Andrew Pinski <pinskia@gmail.com>
+
+ PR c++/27820
+ * decl.c (define_label): Return error_mark_node on error.
+ * semantics.c (finish_label_stmt): Don't call
+ add_stmt for invalid labels.
+
+2006-07-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/28279
+ * decl2.c (finish_static_data_member_decl): Don't assert
+ TREE_PUBLIC.
+
+2006-07-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/13983
+ PR c++/17519
+ * class.c (check_field_decls): Check TYPE_PACKED after
+ stripping array types.
+ (finish_struct_bits): Don't copy TYPE_SIZE here.
+
+ PR c++/18681
+ * friend.c (is_friend): Fix DR 45 implementation.
+
+2006-07-05 Richard Guenther <rguenther@suse.de>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR c++/27084
+ * cp-objcp-common.c (cxx_types_compatible_p): Ignore
+ top level qualifiers for pointer type comparisons.
+
+2006-07-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/28215
+ * method.c (make_thunk): Unset DECL_USE_TEMPLATE and
+ DECL_TEMPLATE_INFO.
+
+2006-06-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/26577
+ * call.c (build_new_method_call): Force evaluation of the
+ instance pointer, not the object.
+
+2006-06-30 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl2.c: Fix a comment typo.
+
+2006-06-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/18698
+ * decl2.c (grokfield): Only try to treat the decl as an access
+ declaration if the scope is a class.
+
+2006-06-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/26905
+ PR c++/26612
+ PR c++/27000
+ PR c++/26984
+ PR c++/19134
+ * decl2.c (determine_visibility): Overhaul.
+ (determine_visibility_from_class): Likewise.
+ (min_vis_r, type_visibility, constrain_visibility): New fns.
+ (constrain_visibility_for_template): Likewise.
+ (constrain_class_visibility): Likewise.
+ * decl.c (cp_finish_decl): Call determine_visibility for function
+ decls, too.
+ * name-lookup.c (pushtag): Call determine_visibility.
+ * decl.c (duplicate_decls): Don't copy visibility from template to
+ specialization.
+ * pt.c (check_explicit_specialization): Likewise.
+ (lookup_template_class, tsubst_decl): Call determine_visibility.
+ * class.c (finish_struct_1): Call constrain_class_visibility.
+
+ PR c++/26905
+ PR c++/21675
+ PR c++/17470
+ * parser.c (cp_parser_explicit_instantiation): Pass the attributes
+ to grokdeclarator.
+ (cp_parser_type_specifier): Allow 'enum __attribute ((...)) E'.
+ (cp_parser_enum_specifier): Likewise.
+ (cp_parser_elaborated_type_specifier): Apply attributes if this
+ declares only the class.
+ (cp_parser_class_specifier): Apply leading attributes immediately.
+ * semantics.c (begin_class_definition): Add attributes parameter,
+ apply them to the type.
+
+ PR c++/21581
+ PR c++/25915
+ * tree.c (decl_anon_ns_mem_p): New function.
+ * cp-tree.h: Declare it.
+ * decl2.c (determine_visibility): Make anonymous namespace
+ members static.
+ (min_vis_r, constrain_visibility): Likewise.
+ * rtti.c (create_pseudo_type_info): Set TREE_PUBLIC on
+ pseudo-types.
+ * decl.c (cxx_init_decl_processing): Set TREE_PUBLIC on
+ global_namespace.
+ * name-lookup.c (push_namespace_with_attribs): Don't set TREE_PUBLIC
+ on anonymous namespaces.
+
+2006-06-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/27424
+ * pt.c (convert_template_argument): Pass all template arguments
+ on to coerce_template_template_parms.
+
+2006-06-25 Lee Millward <lee.millward@gmail.com>
+ Mark Mitchell <mark@codesuorcery.com>
+
+ PR c++/28054
+ * decl2.c (grokbitfied): Remove check for grokdeclarator
+ returning NULL_TREE, instead check for error_mark_node
+ to indicate failure.
+ * decl.c (grokdeclarator): Adjust block comment.
+
+2006-06-25 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/28051
+ * mangle.c (mangle_conv_op_name_for_type): Check for
+ invalid types.
+ * name-lookup.c (push_class_level_binding): Robustify.
+ (do_class_using_decl): Return early if name is error_mark_node.
+
+2006-06-23 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/28114
+ * name-lookup.c (pushtag): Return if we have error_mark_node.
+
+2006-06-23 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/27019
+ * typeck2.c (process_init_constructor_array): Set ce->value on errors.
+
+2006-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28112
+ * parser.c (cp_parser_attribute_list): Skip attributes with invalid
+ arguments. Fix comment.
+
+ PR c++/11468
+ * init.c (build_new_1): Handle error_mark_nodes returned by
+ build_java_class_ref.
+ (build_java_class_ref): Do not abort compilation, but return
+ error_mark_node. Improve error message. Fix indentation.
+
+2006-06-23 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/27789
+ * decl.c (start_decl): Check that dllimports are not initialized.
+
+2006-06-22 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/27805
+ * typeck2.c (build_m_component_ref): Use error_operand_p.
+
+ PR c++/27821
+ * decl.c (grokdeclarator): Return error_mark_node on
+ invalid uses of the scope resolution operator.
+
+2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28111
+ * pt.c (determine_specialization): Check for invalid decls.
+
+ PR c++/28110
+ * pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
+ parameters.
+
+ PR c++/28109
+ * rtti.c (get_tinfo_decl_dynamic): Robustify.
+
+2006-06-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28052
+ * init.c (push_base_cleanups): Skip members with invalid types.
+ * typeck.c (build_class_member_access_expr): Robustify.
+
+2006-06-19 Mark Mitchell <mark@codesourcery.com>
+
+ * pt.c (instantiate_template): Fix typo in comment.
+
+2006-06-19 Richard Guenther <rguenther@suse.de>
+
+ * parser.c (CP_LEXER_BUFFER_SIZE): Adjust to assure near
+ power-of-two token vector size.
+
+2006-06-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28016
+ * decl.c (cp_finsh_decl): Do not emit uninstantiated static data
+ members.
+
+ PR c++/27979
+ * call.c (standard_conversion): Strip cv-qualifiers from bitfield
+ types.
+
+ PR c++/27884
+ * decl.c (have_extern_spec): Remove.
+ (start_decl): Do not check have_extern_spec.
+ (start_function): Likewise.
+ * cp-tree.h (have_extern_spec): Remove.
+ * parser.c (cp_parser_linkage_specification): Don't set
+ have_extern_spec.
+ (cp_parser_init_declarator): Likewise.
+ (cp_parser_parameter_declaration): Do not treat parameters as
+ within the scope of an unbraced linkage specification.
+
+2006-06-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27689
+ * cp-tree.h (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): New
+ macro.
+ * pt.c (unify): Use it.
+
+ PR c++/27666
+ * call.c (build_conditional_expr): Robustify.
+
+ PR c++/27640
+ * pt.c (instantiate_template): Set processing_template_decl to
+ zero while performing substitutions.
+
+2006-06-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27665
+ * parser.c (cp_parser_unqualified_id): Use constructor_name_p to
+ identify destructors.
+ (cp_parser_nested_name_specifier_opt): Remove invalid
+ optimization.
+ (cp_parser_template_id): Refine heuristic for determining whether
+ we are entering a scope.
+
+ PR c++/27648
+ * parser.c (cp_parser_declarator): Robustify.
+
+ PR c++/26559
+ * pt.c (tsubst_expr): Use finish_omp_atomic.
+ (value_dependent_expression_p): All CALL_EXPRs are dependent.
+ * semantics.c (finish_omp_atomic): Rework to use standard
+ paradigms for handling non-dependent expressions.
+
+2006-06-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * typeck.c (build_modify_expr): Tidy diagnostic message.
+
+2006-06-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28018
+ * typeck.c (build_modify_expr): Disallow array assignment.
+
+2006-06-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cp-tree.def: Fix typo.
+
+2006-06-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27227
+ * decl.c (decls_match): Allow an extern "C" variable declarations
+ from different namespaces to match.
+ (duplicate_decls): Disallow redeclaring a variable with a
+ different linkage specification.
+
+2006-06-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/27793
+ * cp-tree.h (cxx_int_tree_map): New struct.
+ (struct language_function): Add extern_decl_map field.
+ * name-lookup.c (pushdecl_maybe_friend): Add x -> t mapping
+ to cp_function_chain->extern_decl_map hash table instead of
+ copying over DECL_UID.
+ * cp-gimplify.c (cxx_int_tree_map_eq, cxx_int_tree_map_hash): New
+ functions.
+ (cp_genericize_r): Remap DECL_EXTERN local decls using
+ cp_function_chain->extern_decl_map hash table.
+ * decl.c (finish_function): Clear extern_decl_map.
+
+2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27601
+ * semantics.c (finish_offsetof): Handle pseudo-destructors.
+
+ PR c++/27933
+ * name-lookup.c (lookup_qualified_name): Always return error_mark_node
+ if lookup fails.
+
+ PR c++/27951
+ * decl2.c (finish_anon_union): Return early if build_anon_union_vars
+ fails.
+
+2006-06-12 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/21210
+ * typeck2.c (build_functional_cast): Use cp_convert to construct
+ non-aggregate initializers instead of the user-level build_c_cast.
+
+2006-06-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27601
+ * cp-tree.h (finish_offsetof): Add prototype.
+ * semantics.c (finish_offsetof): New function.
+ * parser.c (cp_parser_builtin_offsetof): Call it instead of
+ fold_offsetof.
+ * pt.c (tsubst_copy_and_build): Likewise.
+
+2006-06-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27177
+ * call.c (standard_conversion): Require that the derived type be
+ complete when performing a derived-to-base conversion.
+
+2006-06-04 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27819
+ * decl.c (cp_finish_decl): Process initializers for static data
+ members with non-dependent initializers, even in templates.
+
+ PR c++/27722
+ * decl.c (maybe_deduce_size_from_array_init): If the declaration
+ is erroneous, give it an erroneous type.
+ (layout_var_decl): If the type is erroneous, give up.
+ (check_initializer): Likewise.
+
+ PR c++/27807
+ * cp-tree.h (TYPE_OBJ_P): New macro.
+ (TYPE_PTROB_P): Use it.
+ (TYPE_REF_OBJ_P): Likewise.
+ * semantics.c (finish_compound_literal): Do not permit compound
+ literals of non-object types.
+
+ PR c++/27806
+ * typeck.c (original_type): Robustify.
+
+2006-06-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27804
+ * init.c (constant_value_1): Return decl instead of error_mark_node
+ for invalid initializers.
+
+2006-06-01 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/27592
+ * rtti.c (build_dynamic_cast_1): Call c_common_truthvalue_conversion
+ on operand of the COND_EXPR for the null pointer check.
+
+2006-06-01 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/26740
+ * typeck.c (build_unary_op): Mark the function as being used.
+
+2006-06-01 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/26660
+ * parser.c (cp_parser_initial_pragma): Read one more token for
+ caller after reading PCH file in.
+
+2006-05-31 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27801
+ * call.c (perform_implicit_conversion): Do not actually perform
+ conversions in templates.
+
+ PR c++/26496
+ * call.c (resolve_args): Check for invalid uses of bound
+ non-static member functions.
+ * init.c (build_offset_ref): Return error_mark_node for errors.
+
+ PR c++/27385
+ * decl.c (reshape_init): Robustify.
+ (reshape_init_array_1): Likewise.
+
+2006-05-30 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27808
+ * parser.c (cp_parser_decl_specifier_seq): Issue errors about
+ "friend" specifiers that do not appear in class scopes.
+
+ PR c++/27803
+ * class.c (check_bitfield_decl): Ensure that all bitfields have
+ integral type.
+
+2006-05-29 Kazu Hirata <kazu@codesourcery.com>
+
+ * pt.c (convert_nontype_argument): Fix a typo in an error
+ message.
+
+2006-05-28 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl.c, decl2.c, parser.c: Fix comment typos. Follow
+ spelling conventions.
+
+2006-05-24 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20103
+ * decl.c (cp_make_fname_decl): Don't set DECL_INITIAL to
+ error_mark_node to indicate an initialization is OK.
+ (start_decl): Likewise. Adjust call to start_decl_1.
+ (start_decl_1): Add initialized parameter. Simplify.
+ * except.c (initialize_handler_parm): Adjust call to
+ setart_decl_1.
+ (expand_start_catch_block): Let cp_finish_decl initialize catch
+ parameters.
+ * cp-tree.h (start_decl_1): Adjust prototype.
+ * pt.c (tsubst_expr): Don't set DECL_INITIAL to error_mark_node.
+ (instantiate_decl): Let cp_finish_decl handle initialization.
+ * semantics.c (finish_compound_literal): Create a temporary
+ variable for the literal.
+ * typeck.c (build_unary_op): Remove COMPOUND_LITERAL_P special
+ cases.
+ * decl2.c (finish_static_data_member_decl): Don't set
+ DECL_INITIAL.
+ (grokfield): Do not try to initialize functions.
+
+2006-05-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20173
+ * pt.c (determine_specialization): Disallow partial
+ specializations of templates.
+
+2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27716
+ * typeck.c (build_modify_expr): Test arguments for error_operand_p.
+
+ * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE.
+
+2006-05-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27210
+ * cp-tree.h (cp_save_expr): New function.
+ * init.c (build_new): Correct logic for zero-element array
+ warning. Use cp_save_expr.
+ * tree.c (cp_save_expr): New function.
+
+2006-05-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27398
+ * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE
+ or void_type_node.
+
+2006-05-19 Mike Stump <mrs@apple.com>
+
+ * typeck.c (default_conversion): Remove static.
+
+2006-05-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/26433
+ * cp-tree.h (begin_function_try_block): Change prototype.
+ (finish_function_handler_sequence): Likewise.
+ * parser.c (cp_parser_function_try_block): Adjust calls.
+ * pt.c (tsubst_expr): Adjust calls.
+ * semantics.c (begin_function_try_block): Create an artificial
+ outer scope.
+ (finish_function_handler_sequence): Close it.
+
+2006-05-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27471
+ PR c++/27506
+ * typeck.c (decay_conversion): Convert bitfields to their declared
+ types here. Improve documentation. Avoid use of cp_convert.
+ (default_conversion): Make it static. Perform integral promotions
+ before lvalue-to-rvalue, function-to-pointer, and array-to-pointer
+ conversions.
+ * init.c (build_init): Remove.
+ (expand_default_init): Do not call rvalue.
+ * call.c (null_ptr_cst_p): Robustify.
+ (build_conditional_expr): Tidy.
+ * except.c (build_throw): Do not perform lvalue-to-rvalue
+ conversion on operand before initializing temporary.
+ * tree.c (convert.h): Include it.
+ (convert_bitfield_to_declared_type): Use convert_to_integer, not
+ cp_convert.
+ (rvalue): Don't convert bitfields to their declared type here.
+ * cp-tree.h (build_init): Remove.
+ (default_conversion): Likewise.
+ * typeck2.c (build_m_component_ref): Do not perform
+ lvalue-to-rvalue, function-to-pointer, or array-to-pointer
+ conversions here. Correct error message.
+
+2006-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/26122
+ * decl2.c (check_member_template): Remove checks for virtual
+ functions.
+ * parser.c (cp_parser_function_specifier_opt): Complain about
+ virtual templates.
+ (cp_parser_pure_specifier): Likewise.
+
+ PR c++/26068
+ * parser.c (cp_parser_set_storage_class): Check for
+ invalid uses of storage classes on unbraced linkage
+ specifications.
+ (cp_parser_decl_specifier_seq): Pass keywords, not storage classes,
+ to cp_parser_set_storage_class.
+
+2006-05-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/27491
+ * semantics.c (finish_compound_literal): Only set TREE_HAS_CONSTRUCTOR
+ on CONSTRUCTORs.
+
+ PR middle-end/27415
+ * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
+ on combined parallel workshare constructs.
+ * pt.c (tsubst_expr): Copy OMP_PARALLEL_COMBINED flag.
+
+2006-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR driver/26885
+ * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS).
+
+2006-05-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27339
+ * cp-tree.h (perform_access_checks): New function.
+ * semantics.c (perform_access_checks): New function.
+ (perform_deferred_access_checks): Use it.
+ * parser.c (cp_parser_simple_declaration): Adjust call to
+ cp_parser_init_declarator.
+ (cp_parser_type_parameter): Do not defer checks in default
+ arguments.
+ (cp_parser_explicit_specialization): Adjust call to
+ cp_parser_single_declaration.
+ (cp_parser_init_declarator): Perform template-parameter access
+ checks.
+ (cp_parser_parameter_declaration): Do not defer checks for
+ template parameter default arguments.
+ (cp_parser_template_declaration_after_export): Gather access
+ checks for template parameters, and pass them to
+ cp_parser_single_declaration.
+ (cp_parser_template_parameter_access_checks): New function.
+ (cp_parser_single_declaration): Add checks parameter.
+
+ PR c++/27505
+ * call.c (convert_like_real): Convert bitfields to their declared
+ types when forming an rvalue.
+ * tree.c (convert_bitfield_to_declared_type): New function.
+ (rvalue): Use it.
+ * cp-tree.h (convert_bitfield_to_declare_type): Declare it.
+
+2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27582
+ * pt.c (any_dependent_template_arguments_p): Return early on invalid
+ argument list.
+
+ PR c++/27581
+ * search.c (adjust_result_of_qualified_name_lookup): Skip on
+ invalid context_class.
+
+ PR c++/27315
+ * pt.c (do_decl_instantiation): Return early on invalid decl.
+
+ PR c++/27559
+ * pt.c (push_template_decl_real): Return error_mark_node instead
+ of broken decl.
+
+ PR c++/27496
+ * pt.c (tsubst_friend_class): Return early on invalid friend
+ declarations.
+
+2006-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Make-lang.in (cp/decl.o): Add dependency on $(TARGET_H).
+ (cp/decl2.o): Likewise.
+ (cp/typeck.o): Likewise.
+ (cp/cvt.o): Likewise.
+ (cp/parser.o): Likewise.
+ (cp/call.o): Replace target.h with $(TARGET_H).
+
+2006-05-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * pt.c (build_non_dependent_expr): Leave ADDR_EXPR of
+ COMPONENT_REF alone.
+
+2006-05-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27547
+ * decl.c (copy_fn_p): Return early on non-member functions.
+
+2006-05-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27447
+ * decl2.c (build_memfn_type): Skip invalid functions and class types.
+
+2006-05-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27427
+ * pt.c (convert_nontype_argument): Return early on invalid arguments.
+
+ * pt.c (process_template_parm): Remove superfluous temporary.
+
+ PR c++/27430
+ * pt.c (process_template_parm): Handle erroneous non-type parameters.
+
+ PR c++/27423
+ * typeck.c (convert_for_initialization): Skip erroneous types.
+
+ PR c++/27422
+ * typeck.c (convert_arguments): Return early on args with
+ invalid types.
+
+2006-05-03 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/21391
+ * typeck.c (build_static_cast_1): Save casted types in used types
+ hash table.
+ (build_reinterpret_cast_1): Same.
+ * rtti.c (build_dynamic_cast_1): Same.
+
+2006-05-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/27359
+ * parser.c (cp_parser_omp_for_loop): Only call
+ cp_parser_abort_tentative_parse if cp_parser_parse_definitely was not
+ called.
+
+2006-05-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27102
+ * decl.c (grokdeclarator): Robustify checks for defining members
+ of incomplete types.
+
+ PR c++/27309
+ * class.c (add_method): Call grok_special_member_properties.
+ * decl.c (grokdeclarator): Don't call it here.
+ (copy_fn_p): A TEMPLATE_DECL is never a copy constructor or
+ assignment operator. Set TYPE_HAS_CONSTURCTOR if DECL is a
+ constructor.
+ (start_method): Don't call grok_special_member_properties.
+ * method.c (implicitly_declare_fn): Likewise.
+ * pt.c (instantiate_class_template): Likewise.
+ * decl2.c (grokfield): Likewise.
+
+2006-05-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/27337
+ * cp-gimplify.c (cxx_omp_privatize_by_reference): New function.
+ * cp-tree.h (cxx_omp_privatize_by_reference): New prototype.
+ * cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define.
+
+2006-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27094
+ * pt.c (tsubst_default_argument): Increment function_depth around
+ call to tsubst_expr.
+ * parser.c (cp_parser_parameter_declaration): Likewise.
+ * decl2.c (mark_used): Tidy.
+
+2006-04-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27278
+ * decl.c (grok_op_properties): Skip operators with invalid args
+ when checking for class-type or enum-type args.
+
+2006-04-29 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27279
+ * decl.c (copy_fn_p): Skip functions with invalid first arg.
+
+2006-04-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27292
+ * tree.c (rvalue): Convert bitfields to their declared types.
+
+ PR c++/27102
+ * typeck2.c (cxx_incomplete_type_diagnostic): Handle
+ TYPENAME_TYPE.
+
+2006-04-24 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27292
+ * typeck.c (decay_conversion): Don't adjust bitfield types.
+ (perform_integral_promotions): Treat bitfield enums as enums, not
+ as short integer types.
+ * tree.c (rvalue): Convert bitfields to their correct types.
+
+2006-04-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19963
+ * class.c (layout_class_type): Skip fields with invalid types.
+
+2006-04-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/26912
+ * cp-tree.h (build_this_parm): Declare.
+ (grok_method_quals): Remove.
+ (build_memfn_type): Declare.
+ (build_artificial_parm): Declare.
+ (do_friend): Remove quals parameter.
+ * decl.c (build_this_parm): New function.
+ (grokfndecl): Use it. Do not pass quals to grokclassfn.
+ (grokdeclarator): Rename quals to memfn_quals. Avoid allocating
+ unnecessary TYPE_DECLs. Correct qualification of member function
+ types. Tidy.
+ * method.c (implicitly_declare_fn): Use build_this_parm.
+ * friend.c (do_friend): Remove quals parameter.
+ * decl2.c (grok_method_quals): Remove.
+ (build_memfn_type): New function.
+ (build_artificial_parm): Give it external linkage.
+ (grokclassfn): Remove quals parameter. Do not build "this"
+ PARM_DECL here.
+
+ PR c++/26534
+ * cp-tree.h (is_bitfield_expr_with_lowered_type): New function.
+ * typeck.c (is_bitfield_expr_with_lowered_type): New function.
+ (decay_conversion): Convert bitfield expressions to the correct
+ type.
+ (build_modify_expr): Remove spurious conversions.
+ * class.c (layout_class_type): Modify the type of bitfields to
+ indicate a limited range.
+ * call.c (standard_conversion): Adjust the type of bitfield
+ expressions used in an rvalue context.
+ (build_conditional_expr): Likewise.
+
+2006-04-22 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl.c: Fix comment typos.
+
+2006-04-21 Eric Christopher <echristo@apple.com>
+
+ * decl.c: Fix typo in function name.
+
+2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/26558
+ * parser.c (cp_parser_class_name): Check for invalid typenames.
+ Rearrange code.
+
+ PR c++/26739
+ * pt.c (tsubst_friend_function): Return early if
+ pushdecl_namespace_level fails.
+
+ PR c++/26036
+ * typeck.c (convert_arguments): Return error_mark_node instead of
+ error_mark_list.
+ * cp-tree.h (error_mark_list): Remove declaration.
+ * decl.c (error_mark_list): Remove definition.
+ (cxx_init_decl_processing): Do not initialize error_mark_list.
+
+ PR c++/10385
+ * rtti.c (build_dynamic_cast_1): Check for invalid conversions
+ before calling convert_to_reference.
+ * cvt.c (convert_to_reference): Assert that reftype is a
+ REFERENCE_TYPE.
+
+2006-04-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27102
+ * class.c (currently_open_class): Tidy.
+ * decl.c (grokdeclarator): If we encounter an erroneous
+ declarator, assume that we have already issued an error message
+ and return. Return error_mark_node instead of NULL_TREE in more
+ places. Issue errors about function definitions that do not have
+ a function declarator. Check for complete types for all function
+ definitions.
+ * cp-tree.h (cp_error_declarator): Remove.
+ (currently_open_class): Change return type.
+ * parser.c (cp_parser_id_expression): Add optional_p parameter.
+ (cp_parser_parse_diagnose_invalid_type_name): Adjust calls.
+ (cp_parser_id_expression): Likewise.
+ (cp_parser_unqualified_id): If the name is optional, return
+ NULL_TREE.
+ (cp_parser_postfix_dot_deref_expression): Adjust calls.
+ (cp_parser_type_parameter): Likewise.
+ (cp_parser_unqualified_id): Likewise.
+ (cp_parser_direct_declarator): Likewise.
+ (cp_parser_declarator_id): Add optional_p parameter.
+ (cp_parser_function_definition_from_specifiers_and_declarator):
+ Assume that start_function indicates failure only if it has issued
+ an error.
+ (cp_parser_omp_var_list_no_open): Adjust calls.
+
+2006-04-17 Janis Johnson <janis187@us.ibm.com>
+
+ PR c++/26114, c++/26115
+ * typeck.c (cxx_mark_addressable): Restore check for extra_warnings.
+ * class.c (check_field_decls): Ditto.
+
+2006-04-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * init.c (build_offset_ref): Remove superfluous temporary.
+
+2006-04-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/26365
+ * typeck.c (finish_class_member_access_expr): Robustify
+
+2006-04-15 Kazu Hirata <kazu@codesourcery.com>
+
+ * Make-lang.in (cp/pt.o): Depend on vecprim.h.
+ * pt.c: Include vecprim.h.
+ (inline_parm_levels): Change the type to VEC(int,heap) *.
+ (inline_parm_levels_used): Remove.
+ (maybe_begin_member_template_processing,
+ maybe_end_member_template_processing): Use VEC instead of
+ VARRAY.
+
+ * cp/call.c: Fix comment typos.
+
+2006-04-12 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (cp_parser_init_declarator): Initialize local variables
+ aggressively.
+
+2006-04-12 Roger Sayle <roger@eyesopen.com>
+
+ * parser.c (cp_parser_init_declarator): Initialise
+ is_parenthesized_init to false to avoid compiler warning.
+
+2006-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (build_operator_new_call): Adjust prototype.
+ (build_new_method_call): Likewise.
+ (build_op_delete_call): Likewise.
+ * init.c (build_raw_new_expr): New function.
+ (build_new_1): Pass information as parameters, rather than
+ bundling it into a NEW_EXPR.
+ (build_new): Adjust accordingly.
+ (build_vec_delete_1): Adjust for changes to build_op_delete_call.
+ (build_delete): Likewise.
+ * decl.c (finish_destructor_body): Likewise.
+ * call.c (build_operator_new_call): Return the allocation function
+ used.
+ (build_op_delete_call): Take allocation function as parameter.
+ (build_special_member_call): Adjust call to build_new_method_call.
+ (build_new_method_call): Return function called.
+ * pt.c (tsubst_copy_and_build): Adjust call to
+ build_new_method_call.
+ * semantics.c (finish_call_expr): Likewise.
+ * parser.c (cp_parser_postfix_expression): Likewise.
+ * typeck2.c (cxx_incomplete_type_diagnostic): Refer to
+ "incomplete", not "undefined", types.
+
+ PR c++/26295
+ * decl.c (grokdeclarator): Remove namespace-handling code for
+ pointers-to-members.
+ * parser.c (cp_parser_ptr_operator): Check for qualified names
+ using namespaces.
+
+ PR c++/26122
+ * parser.c (cp_parser_init_declarator): Adjust logic for deciding
+ whether or not to look for a pure-specifier.
+ (cp_parser_member_declaration): Likewise.
+
+2006-04-08 Kazu Hirata <kazu@codesourcery.com>
+
+ * decl2.c, pt.c, semantics.c: Fix comment typos.
+
+2006-04-06 Roger Sayle <roger@eyesopen.com>
+
+ * call.c (null_ptr_cst_p): Add explicit TREE_CONSTANT_OVERFLOW check.
+
+2006-04-05 Jason Merrill <jason@redhat.com>
+
+ * name-lookup.c (push_namespace_with_attribs): Temporarily disable
+ default hidden visibility for anonymous namespace.
+
+2006-03-29 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/22494
+ * init.c (build_vec_delete_1): Convert BASE pointer's type to
+ the base pointer type to avoid a type mismatch in the EQ_EXPR.
+
+2006-03-24 Carlos O'Donell <carlos@codesourcery.com>
+
+ * search.c (maybe_suppress_debug_info): If
+ flag_emit_class_debug_always then don't suppress.
+
+2006-03-22 Jason Merrill <jason@redhat.com>
+
+ * name-lookup.c (push_namespace_with_attribs): Only apply hidden
+ visibility to anonymous namespaces if HAVE_GAS_HIDDEN.
+
+2006-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/26691
+ * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle default arguments.
+
+2006-03-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/21581
+ * parser.c (cp_parser_declaration): Support attributes on
+ anonymous namespaces.
+ * name-lookup.c (push_namespace_with_attribs): Anonymous
+ namespaces default to hidden visibility.
+
+2006-03-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/21764, c++/19238
+ * decl.c (cp_finish_decl): Call determine_visibility later.
+ (start_preparsed_function): Likewise.
+ * cp-tree.h (CP_TYPE_CONTEXT, TYPE_NAMESPACE_SCOPE_P): New macros.
+ (TYPE_CLASS_SCOPE_P, TYPE_FUNCTION_SCOPE_P): New macros.
+ * name-lookup.h (struct cp_binding_level): Add has_visibility
+ bitfield.
+ * name-lookup.c: Include c-pragma.h.
+ (push_namespace_with_attribs): Split out from push_namespace.
+ Push visibility if appropriate. Set TREE_PUBLIC on namespaces.
+ (leave_scope): Pop visibility if appropriate.
+ * decl2.c (determine_visibility_from_class): Split out from...
+ (determine_visibility): ...here. Handle function scope and
+ nested classes.
+ (import_export_decl): Move visibility handling to
+ determine_visibility_from_class.
+ * parser.c (cp_parser_declaration, cp_parser_namespace_name): Allow
+ attributes on namespace declarations.
+
+2006-03-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/6634
+ * decl.c (grokdeclarator): Do not accept long long double.
+ Reorganize checks for invalid (combinations of) type modifiers.
+ Quote modifiers in messages.
+
+2006-03-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/16387, c++/16389
+ * typeck.c (cxx_alignof_expr, cxx_sizeof_expr): New functions.
+ (cxx_sizeof_or_alignof_expr): Split out from here.
+
+2006-03-09 Diego Novillo <dnovillo@redhat.com>
+
+ Merge from gomp-20050608-branch
+
+ 2006-02-02 Diego Novillo <dnovillo@redhat.com>
+
+ * decl.c (pop_labels_1): Use appropriate pointer casting.
+ (poplevel_named_label_1): Likewise.
+ (named_label_entry_hash): Likewise.
+ (named_label_entry_eq): Likewise.
+ (check_goto): Likewise.
+ (define_label): Likewise.
+
+ 2006-01-26 Diego Novillo <dnovillo@redhat.com>
+
+ * cp-tree.h (CP_OMP_CLAUSE_INFO): Use TREE_TYPE instead
+ of TREE_BLOCK.
+ * pt.c: Use OMP_CLAUSE_CODE and OMP_CLAUSE_OPERAND
+ instead of TREE_CODE/TREE_OPERAND.
+ * semantics.c: Likewise.
+ * parser.c: Likewise.
+
+ 2005-11-10 Diego Novillo <dnovillo@redhat.com>
+
+ * parser.c (cp_parser_omp_threadprivate): Emit diagnostic if
+ target does not support TLS.
+
+ 2005-11-09 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (redeclaration_error_message): Don't error about
+ DECL_THREAD_LOCAL_P mismatches if CP_DECL_THREADPRIVATE_P
+ (olddecl).
+
+ 2005-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/24735
+ * semantics.c (finish_omp_barrier, finish_omp_flush): New
+ functions.
+ * parser.c (cp_parser_omp_barrier): Call finish_omp_barrier.
+ (cp_parser_omp_flush): Call finish_omp_flush.
+ * cp-tree.h (finish_omp_barrier, finish_omp_flush): New
+ prototypes.
+
+ PR c++/24734
+ * pt.c (tsubst_expr): Handle OMP_MASTER and OMP_ORDERED.
+
+ 2005-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ * semantics.c (finish_omp_threadprivate): Error on class-scope
+ variables.
+
+ 2005-11-02 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_parser_omp_all_clauses): If some clause
+ type is not allowed, don't remove just one of the
+ clauses, but all clauses added in that loop round.
+
+ * semantics.c (finish_omp_clauses): Fix function
+ comment. Don't handle non-const or mutable specially,
+ as const and not mutable is predetermined shared and
+ that leads to double error. Don't ICE if copyin var is
+ PARM_DECL.
+
+ PR c++/24613
+ * parser.c (cp_parser_pragma): Diagnose
+ PRAGMA_OMP_SECTION outside of PRAGMA_OMP_SECTIONS
+ construct.
+
+ * semantics.c (finish_omp_threadprivate): Error if V
+ is automatic variable or has incomplete type.
+
+ 2005-11-01 Diego Novillo <dnovillo@redhat.com>
+
+ * parser.c (cp_parser_omp_all_clauses): Use
+ OMP_CLAUSE_CHAIN instead of TREE_CHAIN.
+
+ 2005-11-01 Diego Novillo <dnovillo@redhat.com>
+
+ * parser.c (cp_parser_omp_all_clauses): When emitting an
+ error message, remove the invalid clause from the list.
+
+ 2005-10-31 Diego Novillo <dnovillo@redhat.com>
+
+ * parser.c (cp_parser_omp_parallel): Do not allow 'nowait' in
+ combined parallel+workshare directives.
+
+ 2005-10-31 Richard Henderson <rth@redhat.com>
+
+ * cp-objcp-common.h (LANG_HOOKS_OMP_CLAUSE_DTOR):
+ Use cxx_omp_clause_dtor.
+ * cp-tree.h (CP_OMP_CLAUSE_INFO): New.
+ (cxx_omp_clause_dtor): New.
+ * cp-gimplify.c (cxx_omp_clause_apply_fn): New.
+ (cxx_omp_clause_default_ctor): Use it.
+ (cxx_omp_clause_copy_ctor, cxx_omp_clause_assign_op):
+ Likewise.
+ (cxx_omp_clause_dtor): New.
+ * semantics.c (finish_omp_clauses): Rewrite cdtor
+ checking to fill in CP_OMP_CLAUSE_INFO. Don't
+ specialcase LASTPRIVATE for removal.
+ (cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
+ cxx_omp_clause_assign_op): Move to cp-gimplify.c.
+
+ 2005-10-28 Jakub Jelinek <jakub@redhat.com>
+
+ * semantics.c (finish_omp_threadprivate): If
+ DECL_RTL_SET_P, call make_decl_rtl again so that
+ encode_section_info can update SYMBOL_REF's flags.
+
+ 2005-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ * semantics.c (finish_omp_for): Don't segfault if COND
+ or INCR is NULL. If not calling c_finish_omp_for
+ right away and one of COND and INCR is NULL, issue
+ error and don't expand anything.
+
+ PR c++/24512
+ * cp-tree.h (finish_omp_for): Add PRE_BODY argument.
+ * semantics.c (finish_omp_for): Likewise. Set
+ OMP_FOR_PRE_BODY to PRE_BODY if deferring, add it
+ into the current statement list if not processing
+ template decl or pass it to c_finish_omp_for.
+
+ * parser.c (cp_parser_omp_for_loop): Expand optional DECL_EXPRs
+ into PRE_BODY statement list. Pass it to finish_omp_for.
+ * pt.c (tsubst_expr) <case OMP_FOR>: tsubst_expr also
+ OMP_FOR_PRE_BODY into PRE_BODY stmt list, pass it to
+ finish_omp_for. Put all the statements into sk_omp
+ scope.
+
+ 2005-10-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/24516
+ * parser.c (struct cp_parser): Rename in_iteration_statement
+ field to in_statement.
+ (IN_SWITCH_STMT, IN_ITERATION_STMT): Define.
+ (IN_OMP_BLOCK, IN_OMP_FOR): Change values.
+ (cp_parser_new, cp_parser_begin_omp_structured_block,
+ cp_parser_end_omp_structured_block,
+ cp_parser_omp_for_loop): Adjust for
+ in_iteration_statement renaming.
+ (cp_parser_selection_statement): Save
+ parser->in_iteration, or it temporarily with
+ IN_SWITCH_STMT for the
+ cp_parser_implicitly_scoped_statement call.
+ (cp_parser_iteration_statement): Adjust for
+ in_iteration_statement renaming. Use
+ IN_ITERATION_STMT rather than true.
+ (cp_parser_jump_statement): Adjust for
+ in_iteration_statement renaming and new values. Don't
+ error on break in a switch statement within OMP_FOR or
+ OpenMP structured block.
+
+ PR c++/24513
+ * parser.c (cp_parser_cache_group): Don't stop if next
+ token is CPP_PRAGMA_EOL and end is CPP_PRAGMA_EOL as
+ well. If current token is CPP_PRAGMA, consume
+ everything until CPP_PRAGMA_EOL inclusive.
+
+ 2005-10-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/24502
+ * semantics.c (finish_omp_for): Handle MODOP_EXPR in
+ addition to MODIFY_EXPR.
+
+ 2005-10-23 Richard Henderson <rth@redhat.com>
+
+ * cp-gimplify.c (struct cp_gimplify_ctx): Remove.
+ (bc_label): New.
+ (begin_bc_block, finish_bc_block): Use it.
+ (push_context, pop_context): Remove.
+ (cp_genericize): Don't use them. Assert bc_label is null.
+ * semantics.c (finish_omp_clauses): Create a fake data
+ element of TYPE for probing ctors.
+
+ 2005-10-23 Richard Henderson <rth@redhat.com>
+
+ * cp-objcp-common.h (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): New.
+ (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR): New.
+ (LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): New.
+ (LANG_HOOKS_OMP_CLAUSE_DTOR): New.
+ * semantics.c (finish_omp_clauses): Look through
+ arrays when looking up special member calls. Also
+ remove FIRSTPRIVATE when LASTPRIVATE fails.
+ (cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor): New.
+ (cxx_omp_clause_assign_op): New.
+ * cp-tree.h: Declare them.
+
+ 2005-10-21 Richard Henderson <rth@redhat.com>
+
+ * decl.c (check_previous_goto_1): Return false if error.
+ (check_switch_goto): Likewise.
+ (finish_case_label): Don't emit the case label on error.
+ * parser.c (struct cp_parser): Revert
+ in_switch_statement_p changes.
+ (cp_parser_labeled_statement,
+ cp_parser_selection_statement): Likewise.
+ (cp_parser_begin_omp_structured_block): Don't save...
+ (cp_parser_end_omp_structured_block): or restore
+ in_switch_statement_p.
+
+ 2005-10-21 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (finish_omp_threadprivate): Set
+ decl_flags.u2sel when necessary.
+
+ 2005-10-21 Richard Henderson <rth@redhat.com>
+
+ * decl.c (poplevel_named_label_1): Restore creation of the
+ bad_decls list.
+ (decl_jump_unsafe): Check for error_mark_node types.
+ (check_goto): Don't check cdtor_label. Don't use identify_goto.
+ * semantics.c (finish_return_stmt): Do check_omp_return before
+ converting to cdtor_label goto.
+
+ 2005-10-21 Richard Henderson <rth@redhat.com>
+
+ PR c++/24451
+ * decl.c (check_omp_return): Return false on error.
+ * cp-tree.h (check_omp_return): Update decl.
+ * semantics.c (finish_return_stmt): Avoid adding
+ return on error.
+
+ 2005-10-21 Richard Henderson <rth@redhat.com>
+
+ * cp-tree.h (struct language_function): Remove
+ x_named_label_uses.
+ Change x_named_labels to a hashtable.
+ (check_omp_return): Declare.
+ * decl.c (struct named_label_use_entry): Rename from
+ named_label_use_list. Remove label_decl.
+ (struct named_label_entry): Rename from
+ named_label_list. Remove old_value and next. Change
+ in_try_scope and in_catch_scope to bool. Add
+ in_omp_scope.
+ (pop_labels_1): New.
+ (pop_labels): Use it.
+ (pop_local_label, poplevel_named_label_1): New.
+ (poplevel): Use them.
+ (named_label_entry_hash, named_label_entry_eq): New.
+ (make_label_decl): Create named_labels. Move label
+ creation bits from lookup_label.
+ (declare_local_label): Tidy.
+ (identify_goto): Split out from ...
+ (check_previous_goto_1): Add exited_omp argument.
+ Handle omp scopes.
+
+ (use_label): Merge into...
+ (check_goto): ... here. Handle omp scopes.
+ (check_omp_return): New.
+ (check_previous_gotos): Merge into...
+ (define_label): ... here.
+ (save_function_data): Remove x_named_label_uses reference.
+ (finish_function): Likewise.
+ * name-lookup.h (sk_omp): New.
+ * name-lookup.c (begin_scope): Handle it.
+ * parser.c (cp_parser_omp_for): Don't create extra
+ compound stmt.
+
+ (cp_parser_omp_sections): Likewise.
+ * semantics.c (finish_return_stmt): Call check_omp_return.
+ (begin_omp_structured_block): Use sk_omp.
+ (finish_omp_structured_block): Use do_poplevel. Don't build a
+ MUST_NOT_THROW expression here.
+ (begin_omp_parallel, finish_omp_parallel): Don't create extra
+ compound statements.
+
+ 2005-10-21 Diego Novillo <dnovillo@redhat.com>
+
+ PR 24455
+ * cp/cp-tree.h (struct lang_decl_flags): Add field
+ threadprivate_p.
+ (CP_DECL_IS_THREADPRIVATE): Define.
+ * cp/semantics.c (finish_omp_threadprivate): Set. Do
+ not error out if CP_DECL_IS_THREADPRIVATE is set
+ already.
+ * cp/decl.c (duplicate_decls): Merge
+ CP_DECL_THREADPRIVATE_P.
+
+ 2005-10-20 Richard Henderson <rth@redhat.com>
+
+ * cp-gimplify.c (cp_gimplify_omp_for): New.
+ (cp_gimplify_expr): Call it.
+ * cp-tree.h (OMP_FOR_GIMPLIFYING_P): New.
+ * parser.c (struct cp_parser): Rename
+ in_iteration_statement_p to in_iteration_statement and
+ change to unsigned char. Similarly with
+ in_switch_statement. Update all users.
+ (IN_OMP_BLOCK, IN_OMP_FOR): New.
+ (cp_parser_labeled_statement): Diagnose case labels
+ binding closer to an openmp block nested than the
+ switch.
+ (cp_parser_jump_statement): Diagnose break and
+ continue labels binding closer to an openmp block than
+ an iteration or switch.
+ (cp_parser_omp_for_loop): Mark in_iteration_statement
+ for an omp for.
+ (cp_parser_begin_omp_structured_block): New.
+ (cp_parser_end_omp_structured_block): New.
+ (cp_parser_omp_structured_block): Use them.
+ (cp_parser_omp_for, cp_parser_omp_sections_scope): Likewise.
+ (cp_parser_omp_parallel): Likewise.
+
+ 2005-10-20 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (begin_omp_structured_block): New.
+ (finish_omp_structured_block): New.
+ (begin_omp_parallel, finish_omp_parallel): Use them.
+ * parser.c (cp_parser_omp_structured_block): Likewise.
+ (cp_parser_omp_for): Likewise.
+ (cp_parser_omp_sections_scope): Likewise.
+ * cp-tree.h: Declare them.
+
+ 2005-10-20 Richard Henderson <rth@redhat.com>
+
+ * parser.c (cp_parser_omp_master): Return the statement.
+ (cp_parser_omp_ordered): Likewise.
+ (cp_parser_omp_construct): Set the locus for them.
+
+ 2005-10-19 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (finish_omp_atomic): Revert to
+ uses_template_parms.
+
+ 2005-10-19 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (finish_omp_clauses): Avoid
+ DECL_THREAD_LOCAL_P on a PARM_DECL. Remove some
+ stub asserts guaranteed to fail.
+
+ 2005-10-19 Richard Henderson <rth@redhat.com>
+
+ * cp-tree.h (OMP_ATOMIC_DEPENDENT_P, OMP_ATOMIC_CODE): New.
+ (finish_omp_clauses, finish_omp_for, finish_omp_atomic): New.
+ * parser.c (cp_parser_omp_clause_copyin): Remove.
+ (cp_parser_omp_all_clauses): Use cp_parser_omp_var_list instead.
+ Call finish_omp_clauses.
+ (cp_parser_omp_clause_if): Don't do error checking here.
+ (cp_parser_omp_clause_num_threads): Likewise.
+ (cp_parser_omp_clause_schedule): Likewise.
+ (cp_parser_omp_atomic): Use finish_omp_atomic.
+ (cp_parser_omp_for_loop): Don't discard DECL_EXPR.
+ Don't decompose assignment statment here. Use
+ finish_omp_for.
+
+ * pt.c (tsubst_omp_clauses): New.
+ (tsubst_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
+ OMP_SINGLE, OMP_SECTION, OMP_CRITICAL, OMP_ATOMIC.
+ * semantics.c (finish_omp_clauses): New.
+ (begin_omp_parallel, finish_omp_parallel): Know Less about the
+ internals of the stmt_list stack.
+ (finish_omp_for, finish_omp_atomic): New.
+
+ 2005-10-18 Jakub Jelinek <jakub@redhat.com>
+
+ * semantics.c (cxx_omp_predetermined_sharing): New function.
+ * cp-tree.h (cxx_omp_predetermined_sharing): New prototype.
+ * cp-objcp-common.h
+ (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.
+
+ 2005-10-18 Richard Henderson <rth@redhat.com>
+
+ * parser.c (cp_parser_omp_single): Use make_node and accessors
+ instead of build.
+
+ 2005-10-17 Richard Henderson <rth@redhat.com>
+
+ * parser.c (cp_parser_omp_for_loop): Handle declarations.
+
+ 2005-10-12 Richard Henderson <rth@redhat.com>
+
+ * Make-lang.in (CXX_C_OBJS): Add c-omp.o.
+ * cp-tree.h (begin_omp_parallel, finish_omp_parallel): Declare.
+ (finish_omp_threadprivate): Declare.
+ * parser.c (struct cp_lexer): Add in_pragma.
+ (cp_lexer_consume_token): Don't consume a PRAGMA_EOL
+ when in_pragma.
+ (cp_parser_skip_to_closing_parenthesis): Stop at PRAGMA_EOL.
+ (cp_parser_skip_to_end_of_statement): Likewise.
+ (cp_parser_skip_to_end_of_block_or_statement): Likewise.
+ (cp_parser_skip_to_closing_brace): Likewise.
+ (cp_parser_skip_to_pragma_eol): Reset in_pragma.
+ (cp_parser_require_pragma_eol): New.
+ (cp_parser_statement): Add in_compound argument;
+ update all callers.
+ Restart if a non-statement pragma seen outside a
+ compound.
+ (cp_parser_statement_seq_opt): Stop at PRAGMA_EOL.
+ (cp_parser_declaration_seq_opt): Likewise.
+ (cp_parser_member_specification_opt): Likewise.
+ (cp_parser_function_definition_after_decl): Likewise.
+ (cp_parser_skip_until_found): Likewise.
+ (cp_parser_cache_group): Likewise.
+ (enum pragma_omp_clause, cp_parser_omp_clause_name,
+ check_no_duplicate_clause,
+ cp_parser_omp_var_list_no_open,
+ cp_parser_omp_var_list, cp_parser_omp_clause_copyin,
+ cp_parser_omp_clause_default, cp_parser_omp_clause_if,
+ cp_parser_omp_clause_nowait,
+ cp_parser_omp_clause_num_threads,
+ cp_parser_omp_clause_ordered,
+ cp_parser_omp_clause_reduction,
+ cp_parser_omp_clause_schedule,
+ cp_parser_omp_all_clauses,
+ cp_parser_omp_structured_block, cp_parser_omp_atomic,
+ cp_parser_omp_barrier, cp_parser_omp_critical,
+ cp_parser_omp_flush, cp_parser_omp_for_loop,
+ cp_parser_omp_for, cp_parser_omp_master,
+ cp_parser_omp_ordered, cp_parser_omp_sections_scope,
+ cp_parser_omp_sections, cp_parser_omp_parallel,
+ cp_parser_omp_single, cp_parser_omp_threadprivate,
+ cp_parser_omp_construct): New.
+ (cp_parser_pragma): Handle OpenMP pragmas.
+ * semantics.c (finish_omp_threadprivate): New.
+ (begin_omp_parallel, finish_omp_parallel): New.
+
+ 2005-10-11 Richard Henderson <rth@redhat.com>
+
+ * parser.c (struct cp_token): Add pragma_kind.
+ (eof_token): Initialize it.
+ (cp_lexer_handle_pragma): Remove.
+ (cp_parser_initial_pragma): New.
+ (cp_lexer_new_main): Use it.
+ (cp_lexer_get_preprocessor_token): Initialize pragma_kind.
+ (cp_lexer_print_token): Don't handle CPP_PRAGMA.
+ (cp_parser_skip_to_pragma_eol): New.
+ (cp_parser_error): Use it.
+ (pragma_lex): New.
+
+ 2005-10-09 Richard Henderson <rth@redhat.com>
+
+ * lex.c (parse_strconst_pragma): Update for c_lex name change.
+ (handle_pragma_java_exceptions): Likewise.
+ * parser.c (cp_lexer_new_main): Likewise.
+
+ 2005-10-06 Richard Henderson <rth@redhat.com>
+
+ * parser.c (cp_lexer_new_main): Comment out defer_pragmas.
+ (cp_lexer_handle_pragma): Comment out
+ cpp_handle_deferred_pragma.
+
+ 2005-10-01 Richard Henderson <rth@redhat.com>
+
+ * name-lookup.c (lookup_name): Remove prefer_type argument.
+ (lookup_name_prefer_type): New function.
+ * name-lookup.h (lookup_name_prefer_type): Declare it.
+ * decl.c (lookup_and_check_tag): Use it.
+ * pt.c (tsubst_friend_class): Likewise. Update for
+ lookup_name change.
+ (lookup_template_class, tsubst_copy_and_build): Likewise.
+
+2006-03-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/15759
+ * tree.c (bot_manip): Don't call mark_used.
+
+2006-03-02 Mike Stump <mrs@apple.com>
+
+ * decl2.c (import_export_decl): Remove redundant call to
+ targetm.cxx.key_method_may_be_inline ().
+
+2006-03-02 Richard Sandiford <richard@codesourcery.com>
+
+ * decl.c (start_decl): Use have_global_bss_p when deciding
+ whether to make the decl common.
+
+2006-03-01 Mike Stump <mrs@apple.com>
+
+ PR darwin/25908
+ * decl2.c (import_export_decl): Fix ABI breakage on darwin.
+
+2006-02-24 Geoffrey Keating <geoffk@apple.com>
+
+ * except.c (expand_start_catch_block): Handle
+ flag_use_cxa_get_exception_ptr.
+
+2006-02-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/26291
+ * decl.c (grok_op_properties): Check for ellipsis in arguments of
+ operators.
+
+2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+
+ * Make-lang.in (C++): Remove.
+ (.PHONY): Remove C++.
+
+2006-02-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/26266
+ * cp-tree.h (cp_finish_decl): Adjust declaration.
+ (grokbitfield): Likewise.
+ (finish_static_data_member_decl): Likewise.
+ * init.c (constant_value_1): Ensure processing_template_decl when
+ folding non-dependent initializers for static data members of
+ dependent types. Return error_mark_node for erroneous
+ initailizers.
+ * class.c (get_vtable_decl): Use finish_decl, not cp_finish_decl.
+ * decl.c (cp_make_fname_decl): Adjust call to cp_finish_decl.
+ (cp_finish_decl): Add init_const_expr_p parameter. Set
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here.
+ (finish_decl): Adjust call to cp_finish_decl.
+ (compute_array_index_type): Robustify.
+ (start_method): Use finish_decl, not cp_finish_decl.
+ * rtti.c (emit_tinfo_decl): Likewise.
+ * except.c (initialize_handler_parm): Adjust call to
+ cp_finish_decl.
+ (expand_start_catch_block): Likewise.
+ * cvt.c (build_up_reference): Adjust call to cp_finish_decl.
+ * pt.c (instantiate_class_template): Adjust call to
+ finish_static_data_member_decl.
+ (tsubst_expr): Use finish_decl, not cp_finish_decl.
+ (instantiate_decl): Adjust call to cp_finish_decl.
+ * name-lookup.c (pushdecl_top_level_1): Use finish_decl, not
+ cp_finish_decl.
+ * decl2.c (finish_static_data_member_decl): Add init_const_expr_p
+ parameter.
+ (grokfield): Likewise.
+ * parser.c (cp_parser_condition): Check for constant initializers.
+ (cp_parser_init_declarator): Adjust calls to grokfield and
+ cp_finish_decl. Don't set
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here.
+ (cp_parser_member_declaration): Likewise.
+ (cp_parser_objc_class_ivars): Likewise.
+
+2006-02-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * call.c (standard_conversion): Return NULL instead of 0.
+ (build_user_type_conversion_1): Likewise.
+ (tourney): Likewise.
+ * decl.c (redeclaration_error_message): Likewise.
+ * error.c (language_to_string): Likewise.
+
+2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cp-tree.h (warn_hidden): Remove prototype.
+ * class.c (warn_hidden): Make static.
+
+ * cp-tree.h (build_type_conversion): Remove prototype.
+ * cvt.c (build_type_conversion): Add prototype, make static.
+
+ * cp-tree.h (push_tinst_level): Remove prototype.
+ (pop_tinst_level): Likewise.
+ * pt.c (push_tinst_level): Add prototype, make static.
+ (pop_tinst_level): Likewise.
+
+2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * decl.c (grokdeclarator): Return NULL_TREE instead of 0.
+ * typeck.c (unary_complex_lvalue): Likewise.
+
+2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * lex.c (parse_strconst_pragma): Return error_mark_node instead of
+ "(tree)-1" to indicate failure. Simplify.
+ (handle_pragma_interface): Test for error_mark_node instead of
+ "(tree)-1".
+ (handle_pragma_implementation): Likewise.
+
+2006-02-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/26151
+ * parser.c (cp_parser_decl_specifier_seq): Check for duplicate
+ decl-specifiers. Remove extra check for duplicate 'friend'.
+ * decl.c (grokdeclarator): Remove check for duplicate
+ decl-specifiers. Set longlong together with long_p.
+
+2006-02-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/24996
+ * except.c (build_throw): Add a CLEANUP_POINT_EXPR inside the
+ TRY_CATCH_EXPR or MUST_NOT_THROW_EXPR.
+
+2006-02-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * class.c (debug_class): Remove extern.
+ (debug_thunks): Likewise.
+
+2006-02-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * typeck.c (string_conv_p): Don't test for flag_const_strings.
+
+2006-02-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/25979
+ * cp-gimplify.c (cp_gimplify_expr): Don't call
+ cp_gimplify_init_expr for MODIFY_EXPRs.
+ * typeck2.c (split_nonconstant_init_1): Use INIT_EXPR.
+
+2006-02-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/26071
+ * decl.c (grokdeclarator): Set dname also for destructor.
+
+ PR c++/26070
+ * decl.c (grokdeclarator): Clear storage_class together with staticp.
+
+2006-02-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error.
+ (cp_build_qualified_type): Propogate renaming.
+ * call.c (convert_like_real): Likewise.
+ * cvt.c (cp_convert_to_pointer, convert_to_reference): Likewise.
+ * decl.c (make_typename_type, grokdeclarator): Likewise.
+ * pt.c (tsubst_friend_function, instantiate_class_template,
+ tsubst_default_argument, instantiate_decl,
+ tsubst_initializer_list, tsubst_enum): Likewise.
+ * semantics.c (finish_template_type): Likewise.
+ * typeck.c (build_ptrmemfunc, convert_for_assignment): Likewise.
+
+2006-02-07 Dirk Mueller <dmueller@suse.com>
+
+ * typeck.c (build_binary_op): Annotate div-by-zero
+ warnings to make -Wno-div-by-zero have an effect.
+
+2006-02-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9737
+ * pt.c (coerce_template_template_parms): Do not templates with
+ excess default arguments to match template template parameters
+ with fewer parameters.
+ (coerce_template_parms): Add use_default_args parameter; use
+ default arguments only when true.
+ (lookup_template_class): Adjust call to coerce_template_parms.
+ (fn_type_unification): Likewise.
+ (unify): Likewise.
+ (get_bindings): Likewise.
+ (dependent_type_p): Add assertions.
+
+2006-02-06 Roger Sayle <roger@eyesopen.com>
+
+ * decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE.
+ * rtti.c (typeinfo_in_lib_p): Likewise.
+ * cp-tree.h (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P): Likewise.
+ * name-lookup.c (arg_assoc_type): Likewise.
+
+2006-02-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cp-tree.h (tf_warn_or_error): New substituion flag.
+ (cp_build_qualified_type): Use it.
+ * call.c (convert_like_real): Likewise.
+ * cvt.c (cp_convert_to_pointer): Likewise.
+ (convert_to_reference): Likewise.
+ * decl.c (make_typename_type): Likewise.
+ (grokdeclarator): Likewise.
+ * pt.c (tsubst_friend_function): Likewise.
+ (tsubst_friend_class): Likewise.
+ (instantiate_class_template): Likewise.
+ (tsubst_default_argument): Likewise.
+ (instantiate_decl): Likewise.
+ (tsubst_initializer_list): Likewise.
+ (tsubst_enum): Likewise.
+ * semantics.c (finish_template_type): Likewise.
+ * typeck.c (build_ptrmemfunc): Likewise.
+ (convert_for_assignment): Likewise.
+
+2006-02-03 Lee Millward <lee.millward@gmail.com>
+
+ * typeck.c (string_conv_p): Pass appropiate
+ OPT_Wxxxx values when calling warning().
+ (build_array_ref, cxx_mark_addressable): Likewise.
+ (check_return_expr): Likewise.
+
+ * init.c (perform_member_init): Likewise.
+ (sort_mem_initializers, emit_mem_initializers): Likewise.
+
+ * class.c (check_field_decls): Likewise.
+ (warn_about_ambiguous_bases): Likewise.
+
+ * decl.c (pop_label, poplevel): Likewise.
+ (duplicate_decls, grok_op_properties): Likewise.
+ (start_preparsed_function, finish_function): Likewise.
+
+ * name-lookup.c (pushdecl_maybe_friend): Likewise.
+ (pushdecl_maybe_friend): Likewise.
+
+ * parser.c (cp_parser_warn_min_max): Likewise.
+ (cp_parser_cast_expression): Likewise.
+
+ * method.c (lazily_declare_fn): Likewise.
+ * cvt.c (convert_to_void): Likewise.
+ * mangle.c (finish_mangling): Likewise.
+ * cp-gimplify.c (gimplify_expr_stmt): Likewise.
+
+2006-02-03 Mark Mitchell <mark@codesourcery.com>
+
+ * name-lookup.c (do_class_using_decl): Use IDENTIFIER_TYPENAME_P,
+ not IDENTIFIER_OPNAME_P.
+
+2006-01-31 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25342
+ * cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Revise
+ documentation.
+ * pt.c (determine_specialization): Use INNERMOST_TEMPLATE_PARMS,
+ not TREE_VALUE.
+ (instantiate_class_template): Simplify.
+ (verify_class_unification): Remove.
+ (unify): Document parameters. Use INNERMOST_TEMPLATE_ARGS to
+ permit multiple levels of template arguments.
+ (more_specialized_class): Simplify.
+ (get_class_bindings): Pass full arguments to unify. Fold
+ verify_class_unification into this function. Return full
+ arguments.
+ (most_specialized_class): Adjust for changes to
+ get_class_bindings. Issue errors here for ambiguity. Return the
+ fully deduced arguments for the most specialized class, in
+ addition to the partial specialization.
+
+2006-01-31 Ben Elliston <bje@au.ibm.com>
+
+ * mangle.c: Comment fix.
+
+2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * Make-lang.in (cp-warn): Include CXX_COMPAT_WARN.
+ * repo.c (extract_string, afgets): Use cast when converting from
+ void *.
+
+2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * call.c (alloc_conversion): Use cast when converting from void *.
+ (alloc_conversions): Likewise.
+ (add_candidate): Likewise.
+ (print_z_candidates): Likewise.
+ (add_warning): Likewise.
+ * pt.c (retrieve_local_specialization): Likewise.
+ (process_partial_specialization): Likewise.
+ (mangle_class_name_for_template): Likewise.
+ (tsubst_template_args): Likewise.
+ * typeck2.c (pat_calc_hash): Likewise.
+ (pat_compare): Likewise.
+ (abstract_virtuals_error): Likewise.
+ * class.c (method_name_cmp): Likewise.
+ (resort_method_name_cmp): Likewise.
+ (get_vfield_name): Likewise.
+ * decl2.c (generate_ctor_and_dtor_functions_for_priority): Likewise.
+ * lex.c (init_reswords): Likewise.
+ * rtti.c (create_pseudo_type_info): Likewise.
+ * search.c (dfs_lookup_base): Likewise.
+ (dfs_dcast_hint_pre): Likewise.
+ (dfs_dcast_hint_post): Likewise.
+ * tree.c (hash_tree_cons): Likewise.
+ * repo.c (extract_string): Likewise.
+ (afgets): Likewise.
+ * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise.
+ * g++spec.c (lang_specific_driver): Likewise.
+
+2006-01-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * call.c (joust): Pass option code to warning. Use inform for
+ explanation.
+ * class.c (check_bases): Likewise.
+ (maybe_warn_about_overly_private_class): Likewise.
+ (check_field_decls): Likewise.
+ (layout_empty_base): Likewise.
+ (layout_virtual_bases): Likewise.
+ (layout_class_type): Likewise.
+
+2006-01-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25999
+ * decl.c (start_preparsed_function): Call maybe_apply_pragma_weak
+ here, not ...
+ (start_function): ... here.
+
+2006-01-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25855
+ * class.c (resolve_address_of_overloaded_function): Adjust use of
+ return value from most_specialized_instantiation.
+ * pt.c (determine_specialization): Avoid multiple calls to
+ get_bindings.
+ (most_specialized_instantiation): When a tie occurs, set the
+ current presumed champion to the next template. Return the
+ TREE_LIST node containing the template, rather than the template
+ itself.
+ (most_specialized): Remove.
+ * name-lookup.c (push_overloaded_decl): When duplicate_decls
+ indicates a failed redeclaration, report that to callers.
+
+2006-01-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/16021
+ * name-lookup.c (parse_using_directive): Require strong using to
+ name a nested namespace.
+
+2006-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ Revert:
+ * cp-tree.h (do_poplevel): Remove prototype.
+ * semantics.c (do_poplevel): Add prototype. Make static.
+
+ Revert:
+ * cp-tree.h (default_conversion): Remove prototype.
+ * typeck.c (default_conversion): Make static.
+
+2006-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cp-tree.h (get_primary_binfo): Remove prototype.
+ (push_using_decl): Likewise.
+ (current_template_args): Likewise.
+ (more_specialized_class): Likewise.
+ (mark_class_instantiated): Likewise.
+ (default_conversion): Likewise.
+ (pfn_from_ptrmemfunc): Likewise.
+ * class.c (get_primary_binfo): Add prototype, make static, simplify.
+ * name-lookup.c (push_using_decl): Make static.
+ * pt.c (current_template_args): Likewise.
+ (more_specialized_class): Likewise.
+ (mark_class_instantiated): Likewise.
+ * typeck.c (default_conversion): Make static.
+ (pfn_from_ptrmemfunc): Add prototype, make static.
+
+2006-01-24 Dirk Mueller <dmueller@suse.de>
+
+ * typeck.c (build_binary_op): Use OPT_Wfloat_equal in warning().
+
+2006-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/25552
+ * parser.c (cp_parser_unqualified_id): Check that destructor name
+ and scope match.
+ * call.c (check_dtor_name): Do not expect a BIT_NOT_EXPR.
+ Adjust comment. Return early if possible.
+ Use same_type_p to compare types.
+ * typeck.c (lookup_destructor): Adjust call to check_dtor_name.
+
+2006-01-24 Mark Mitchell <mark@codesourcery.com>
+
+ * semantics.c: Remove outdated comment.
+
+2006-01-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * cp-tree.h (do_poplevel): Remove prototype.
+ * semantics.c (do_poplevel): Add prototype. Make static.
+
+ * cp-tree.h (original_type): Remove prototype.
+ * typeck.c (original_type): Make static.
+
+ * cp-tree.h (declare_global_var): Remove prototype.
+ * decl.c (declare_global_var): Make static.
+
+ * cp-tree.h (implicitly_declare_fn): Remove prototype.
+ * method.c (implicitly_declare_fn): Make static.
+
+ * cp-tree.h (fold_decl_constant_value): Remove prototype.
+ * pt.c (fold_decl_constant_value): Make static.
+
+ * cp-tree.h (build_x_delete): Remove prototype.
+ * init.c (build_vec_delete_1): Call build_op_delete_call directly
+ and not via build_x_delete.
+ (build_x_delete): Remove.
+
+ * cp-tree.h (get_vtt_name): Remove prototype.
+ * class.c (get_vtt_name): Remove.
+ (build_vtt): Call mangle_vtt_for_type instead of get_vtt_name.
+
+2006-01-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * rtti.c (build_dynamic_cast): Fix comment.
+
+2006-01-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10891
+ * rtti.c (build_dynamic_cast): Reject dynamic_cast use if
+ -fno-rtti.
+
+2006-01-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25895
+ * class.c (build_base_path): Generate a NOP_EXPR instead of a
+ COMPONENT_REF if the base and derived classes are at the same
+ address.
+
+ PR c++/25856
+ * decl.c (begin_destructor_body): Robustify.
+
+ PR c++/25858
+ * parser.c (cp_parser_direct_declarator): Robustify.
+
+2006-01-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * parser.c (cp_lexer_next_token_is_keyword): Simplify.
+
+ * parser.c (clear_decl_specs): Remove prototype.
+
+ * parser.c (cp_parser_expression_fn): Remove.
+
+ * call.c (add_builtin_candidates): Remove superfluous return.
+ * name-lookup.c (do_toplevel_using_decl): Likewise.
+ * parser.c (cp_parser_type_specifier_seq): Likewise.
+ (cp_parser_save_default_args): Likewise.
+
+2006-01-20 Dirk Mueller <dmueller@suse.com>
+
+ PR c++/5520
+ * semantics.c (finish_if_stmt): Call empty_body_warning.
+ * parser.c (cp_parser_implicitly_scoped_statement):
+ Mark empty statement with an empty stmt.
+
+2006-01-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/22136
+ * name-lookup.c (do_class_using_decl): Don't try to look up base
+ classes in templates with dependent base types.
+
+2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/25854
+ * pt.c (maybe_process_partial_specialization): Return early on
+ error_mark_node.
+
+2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/16829
+ * decl.c (start_preparsed_function): Check default arguments
+ unconditionally.
+ * name-lookup.c (pushdecl_maybe_friend): Check default arguments
+ of all functions and function templates.
+ * parser.c (cp_parser_late_parsing_default_args): Check default
+ arguments.
+ * decl2.c (check_default_args): Set missing default arguments to
+ error_mark_node.
+
+2006-01-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25836
+ * cp-tree.h (push_class_stack): New function.
+ (pop_class_stack): Likewise.
+ * class.c (class_stack_node): Add hidden field.
+ (pushclass): Clear it.
+ (push_class_stack): New function.
+ (pop_class_stack): Likewise.
+ (currently_open_class): Ignore hidden classes.
+ (currently_open_derived_class): Likewise.
+ * name-lookup.c (push_to_top_level): Call push_class_stack.
+ (pop_from_top_level): Call pop_class_stack.
+
+2006-01-18 Kazu Hirata <kazu@codesourcery.com>
+
+ * tree.c (find_tree_t, find_tree): Remove.
+ * cp-tree.h: Remove the prototype for find_tree.
+
+2006-01-18 Jakub Jelinek <jakub@redhat.com>
+
+ * search.c (lookup_conversions_r): Fix a pasto.
+
+2006-01-17 Eric Christopher <echristo@apple.com>
+
+ * call.c (convert_like_real): When issuing conversion
+ warnings, depend on OPT_Wconversion.
+ * cvt.c (build_expr_type_conversion): Ditto.
+
+2006-01-17 Kazu Hirata <kazu@codesourcery.com>
+
+ * name-lookup.c (lookup_namespace_name): Remove.
+ * name-lookup.h: Remove the prototype for
+ lookup_namespace_name.
+
+2006-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/25682
+ * decl.c (compute_array_index_type): After issuing not an integral
+ constant-expression error, set size to 1 to avoid ICEs later on.
+
+2006-01-16 Ian Lance Taylor <ian@airs.com>
+
+ * parser.c: Include "cgraph.h".
+ (cp_parser_asm_definition): Call cgraph_add_asm_node rather than
+ assemble_asm.
+
+2006-01-16 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
+
+ * g++spec.c (lang_specific_spec_functions): Remove.
+
+2006-01-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * decl.c (check_initializer): Fix thinko.
+
+2006-01-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25663
+ * parser.c (cp_parser_direct_declarator): Use cp_parser_error
+ instead of error.
+
+2006-01-13 Jason Merrill <jason@redhat.com>
+
+ * pt.c (check_explicit_specialization): Use CP_DECL_CONTEXT even more.
+
+ * name-lookup.c (set_decl_namespace): Use CP_DECL_CONTEXT.
+ * pt.c (check_explicit_specialization): Likewise.
+
+2006-01-12 Jason Merrill <jason@redhat.com>
+
+ PR libstdc++/24660
+ * pt.c (check_explicit_specialization): Handle namespace
+ association.
+ * name-lookup.c (set_decl_namespace): Likewise.
+
+2006-01-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/24824
+ * class.c (handle_using_decl): Pass correct scope to
+ cp_emit_debug_info_for_using.
+
+2006-01-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/25386
+ * tree.c (lvalue_p_1): Any part of a COMPONENT_REF affects
+ packedness.
+
+2006-01-06 Gabriel Dos Reis <gdr@integrablesolutions.net>
+
+ * parser.c (cp_parser_primary_expression): Document the grammar
+ for the built-in offsetof, a GNU extension.
+
+2006-01-04 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR c++/25632
+ * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo
+ in condition.
+
+2006-01-04 Chris Lattner <sabre@gnu.org>
+
+ * typeck2.c: update copyright to 2006
+ (split_nonconstant_init_1): Set TREE_CONSTANT to true.
+
+2006-01-04 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24782
+ * parser.c (cp_parser_nested_name_specifier_opt): Preserve access
+ checks, even when parsing tentatively.
+
+2006-01-04 Richard Henderson <rth@redhat.com>
+
+ Merge from gomp branch.
+ * lex.c (handle_pragma_java_exceptions): Fix whitespace.
+ * parser.c (struct cp_token): Add pragma_kind.
+ (eof_token): Update to match.
+ (struct cp_lexer): Add in_pragma; rearrange next for better packing.
+ (cp_parser_initial_pragma): New.
+ (cp_lexer_new_main): Use it. Don't bother clearing
+ c_lex_return_raw_strings.
+ (cp_lexer_get_preprocessor_token): Always initialize keyword
+ and pragma_kind fields. Handle CPP_PRAGMA.
+ (cp_lexer_consume_token): Don't allow CPP_PRAGMA_EOL when
+ in_pragma is set.
+ (cp_lexer_handle_pragma): Remove. Update callers to cp_parser_pragma.
+ (cp_lexer_print_token) <CPP_PRAGMA>: Don't print as a string.
+ (cp_parser_skip_to_pragma_eol): New.
+ (cp_parser_error): Use it.
+ (cp_parser_skip_to_closing_parenthesis): Stop at CPP_PRAGMA_EOL;
+ rearrange with switch statement.
+ (cp_parser_skip_to_end_of_statement): Likewise.
+ (cp_parser_skip_to_end_of_block_or_statement): Likewise.
+ (cp_parser_skip_to_closing_brace): Likewise.
+ (cp_parser_skip_until_found): Likewise.
+ (cp_parser_statement): Add in_compound argument; update callers.
+ Use it to decide how to handle pragma parsing.
+ (cp_parser_labeled_statement): Add in_compound argument; pass
+ it on to cp_parser_statement.
+ (cp_parser_statement_seq_opt): Stop at CPP_PRAGMA_EOL.
+ (cp_parser_declaration_seq_opt): Likewise.
+ (cp_parser_parameter_declaration): Likewise.
+ (cp_parser_member_specification_opt): Likewise.
+ (cp_parser_function_definition_after_decl): Likewise.
+ (cp_parser_cache_group): Handle CPP_PRAGMA/CPP_PRAGMA_EOL pairs.
+ (cp_parser_pragma): New.
+ (pragma_lex): New.
+
+2006-01-04 Dirk Mueller <dmueller@suse.com>
+
+ * decl.c (finish_constructor_body): create simple
+ compound stmt instead of a if(1) { } construct.
+
+2006-01-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25492
+ * name-lookup.c (push_class_level_binding): When a derived class
+ provides a type binding, eliminate any type binding from a base
+ class.
+
+ PR c++/25625
+ * repo.c (repo_emit_p): Always instantiate static data members
+ initialized by constant expressions, so that there values are
+ available.
+
+2006-01-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25635
+ * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a
+ conversion operator.
+ * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here.
+
+ PR c++/25638
+ * class.c (add_method): Never associate more than one destructor
+ with a single class.
+
+ PR c++/25637
+ * cp-tree.h (do_friend): Adjust prototype.
+ * decl.c (grokfndecl): Make funcdef_flag a bool, not an int.
+ (grokdeclarator): Likewise. Refine check for invalid
+ declarations/definitions of member functions outside of their own
+ class.
+ * friend.c (do_friend): Make funcdef_flag a bool, not an int.
+
+ PR c++/25633
+ * parser.c (cp_parser_mem_initializer_list): Check result of
+ cp_parser_mem_initializer against error_mark_node, not NULL_TREE.
+ (cp_parser_mem_initializer): Return error_mark_node for failure.
+
+ PR c++/25634
+ * parser.c (cp_parser_template_parameter_list): Call
+ begin_template_parm_list and end_template_parm_list here.
+ (cp_parser_type_parameter): Not here.
+ (cp_parser_template_declaration_after_export): Or here.
+ (cp_parser_elaborated_type_specifier): Call
+ cp_parser_check_template_parameters.
+
+ * tree.c (build_target_expr_with_type): Use force_target_expr.
+
+ * decl2.c (mark_used): Fix typo in comment.
+
+2006-01-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * parser.c (cp_parser_using_declaration): Skip name-lookup on
+ invalid scope.
+
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 2c0dd838e8e..6f17276b547 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -136,8 +136,6 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
#undef LANG_HOOKS_SIGNED_TYPE
#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
-#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index fb682c7ee04..df067c9d46c 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -303,7 +303,8 @@ typedef struct ptrmem_cst * ptrmem_cst_t;
#define DECL_MAIN_P(NODE) \
(DECL_EXTERN_C_FUNCTION_P (NODE) \
&& DECL_NAME (NODE) != NULL_TREE \
- && MAIN_NAME_P (DECL_NAME (NODE)))
+ && MAIN_NAME_P (DECL_NAME (NODE))) \
+ && flag_hosted
/* The overloaded FUNCTION_DECL. */
#define OVL_FUNCTION(NODE) \
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 31bc8d2649e..9b62658b2e0 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7376,7 +7376,7 @@ grokdeclarator (const cp_declarator *declarator,
else if (type == char_type_node)
type = unsigned_char_type_node;
else if (typedef_decl)
- type = c_common_unsigned_type (type);
+ type = unsigned_type_for (type);
else
type = unsigned_type_node;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 5788f94ca13..9eb6fd5c1ce 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2333,9 +2333,7 @@ start_objects (int method_type, int initp)
void_list_node));
start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED);
- /* It can be a static function as long as collect2 does not have
- to scan the object file to find its ctor/dtor routine. */
- TREE_PUBLIC (current_function_decl) = ! targetm.have_ctors_dtors;
+ TREE_PUBLIC (current_function_decl) = 0;
/* Mark this declaration as used to avoid spurious warnings. */
TREE_USED (current_function_decl) = 1;
@@ -3299,8 +3297,6 @@ cp_write_global_declarations (void)
if (priority_info_map)
splay_tree_delete (priority_info_map);
- c_build_cdtor_fns ();
-
/* Generate any missing aliases. */
maybe_apply_pending_pragma_weaks ();
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 40c059ad63c..31676e7b454 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -688,7 +688,8 @@ write_mangled_name (const tree decl, bool top_level)
}
}
else if (TREE_CODE (decl) == VAR_DECL
- /* The names of global variables aren't mangled. */
+ /* The names of non-static global variables aren't mangled. */
+ && DECL_EXTERNAL_LINKAGE_P (decl)
&& (CP_DECL_CONTEXT (decl) == global_namespace
/* And neither are `extern "C"' variables. */
|| DECL_EXTERN_C_P (decl)))
@@ -1086,7 +1087,10 @@ write_template_prefix (const tree node)
<unqualified-name> ::= <operator-name>
::= <special-name>
- ::= <source-name> */
+ ::= <source-name>
+ ::= <local-source-name>
+
+ <local-source-name> ::= L <source-name> <discriminator> */
static void
write_unqualified_name (const tree decl)
@@ -1126,6 +1130,16 @@ write_unqualified_name (const tree decl)
write_string (oni[DECL_OVERLOADED_OPERATOR_P (decl)].mangled_name);
}
+ else if (VAR_OR_FUNCTION_DECL_P (decl) && ! TREE_PUBLIC (decl)
+ && DECL_NAMESPACE_SCOPE_P (decl)
+ && decl_linkage (decl) == lk_internal)
+ {
+ MANGLE_TRACE_TREE ("local-source-name", decl);
+ write_char ('L');
+ write_source_name (DECL_NAME (decl));
+ /* The default discriminator is 1, and that's all we ever use,
+ so there's no code to output one here. */
+ }
else
write_source_name (DECL_NAME (decl));
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 63f7fec0169..4599aca0166 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -7065,6 +7065,51 @@ cp_parser_condition (cp_parser* parser)
return cp_parser_expression (parser, /*cast_p=*/false);
}
+/* We check for a ) immediately followed by ; with no whitespacing
+ between. This is used to issue a warning for:
+
+ while (...);
+
+ and:
+
+ for (...);
+
+ as the semicolon is probably extraneous.
+
+ On parse errors, the next token might not be a ), so do nothing in
+ that case. */
+
+static void
+check_empty_body (cp_parser* parser, const char* type)
+{
+ cp_token *token;
+ cp_token *close_paren;
+ expanded_location close_loc;
+ expanded_location semi_loc;
+
+ close_paren = cp_lexer_peek_token (parser->lexer);
+ if (close_paren->type != CPP_CLOSE_PAREN)
+ return;
+
+ close_loc = expand_location (close_paren->location);
+ token = cp_lexer_peek_nth_token (parser->lexer, 2);
+
+ if (token->type != CPP_SEMICOLON
+ || (token->flags & PREV_WHITE))
+ return;
+
+ semi_loc = expand_location (token->location);
+ if (close_loc.line == semi_loc.line
+#ifdef USE_MAPPED_LOCATION
+ && close_loc.column+1 == semi_loc.column
+#endif
+ )
+ warning (OPT_Wempty_body,
+ "suggest a space before %<;%> or explicit braces around empty "
+ "body in %<%s%> statement",
+ type);
+}
+
/* Parse an iteration-statement.
iteration-statement:
@@ -7107,6 +7152,7 @@ cp_parser_iteration_statement (cp_parser* parser)
/* Parse the condition. */
condition = cp_parser_condition (parser);
finish_while_stmt_cond (condition, statement);
+ check_empty_body (parser, "while");
/* Look for the `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
/* Parse the dependent statement. */
@@ -7168,6 +7214,7 @@ cp_parser_iteration_statement (cp_parser* parser)
if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN))
expression = cp_parser_expression (parser, /*cast_p=*/false);
finish_for_expr (expression, statement);
+ check_empty_body (parser, "for");
/* Look for the `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 121699f669d..1891f3b4833 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -238,7 +238,7 @@ get_tinfo_decl_dynamic (tree exp)
/* Peel off cv qualifiers. */
type = TYPE_MAIN_VARIANT (type);
- if (!VOID_TYPE_P (type))
+ if (CLASS_TYPE_P (type))
type = complete_type_or_else (type, exp);
if (!type)
@@ -431,7 +431,7 @@ get_typeid (tree type)
that is the operand of typeid are always ignored. */
type = TYPE_MAIN_VARIANT (type);
- if (!VOID_TYPE_P (type))
+ if (CLASS_TYPE_P (type))
type = complete_type_or_else (type, NULL_TREE);
if (!type)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index a920bfb6ce7..a484c053353 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3188,10 +3188,6 @@ expand_or_defer_fn (tree fn)
return;
}
- /* Keep track of functions declared with the "constructor" and
- "destructor" attribute. */
- c_record_cdtor_fn (fn);
-
/* We make a decision about linkage for these functions at the end
of the compilation. Until that point, we do not want the back
end to output them -- but we do want it to see the bodies of
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 2b4e065913c..fa0c956dc73 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -2333,6 +2333,19 @@ build_indirect_ref (tree ptr, const char *errorstring)
types. */
tree t = canonical_type_variant (TREE_TYPE (type));
+ if (TREE_CODE (ptr) == CONVERT_EXPR
+ || TREE_CODE (ptr) == NOP_EXPR
+ || TREE_CODE (ptr) == VIEW_CONVERT_EXPR)
+ {
+ /* If a warning is issued, mark it to avoid duplicates from
+ the backend. This only needs to be done at
+ warn_strict_aliasing > 2. */
+ if (warn_strict_aliasing > 2)
+ if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (ptr, 0)),
+ type, TREE_OPERAND (ptr, 0)))
+ TREE_NO_WARNING (ptr) = 1;
+ }
+
if (VOID_TYPE_P (t))
{
/* A pointer to incomplete type (other than cv void) can be
@@ -4278,41 +4291,6 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
inc = cp_convert (argtype, inc);
- /* Handle incrementing a cast-expression. */
-
- switch (TREE_CODE (arg))
- {
- case NOP_EXPR:
- case CONVERT_EXPR:
- case FLOAT_EXPR:
- case FIX_TRUNC_EXPR:
- {
- tree incremented, modify, value, compound;
- if (! lvalue_p (arg) && pedantic)
- pedwarn ("cast to non-reference type used as lvalue");
- arg = stabilize_reference (arg);
- if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR)
- value = arg;
- else
- value = save_expr (arg);
- incremented = build2 (((code == PREINCREMENT_EXPR
- || code == POSTINCREMENT_EXPR)
- ? PLUS_EXPR : MINUS_EXPR),
- argtype, value, inc);
-
- modify = build_modify_expr (arg, NOP_EXPR, incremented);
- compound = build2 (COMPOUND_EXPR, TREE_TYPE (arg),
- modify, value);
-
- /* Eliminate warning about unused result of + or -. */
- TREE_NO_WARNING (compound) = 1;
- return compound;
- }
-
- default:
- break;
- }
-
/* Complain about anything else that is not a true lvalue. */
if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
@@ -5324,7 +5302,8 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
/* We need to strip nops here, because the front end likes to
create (int *)&a for array-to-pointer decay, instead of &a[0]. */
STRIP_NOPS (sexpr);
- strict_aliasing_warning (intype, type, sexpr);
+ if (warn_strict_aliasing <= 2)
+ strict_aliasing_warning (intype, type, sexpr);
return fold_if_not_in_template (build_nop (type, expr));
}
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index e847ad04760..fc57d45afc8 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -106,6 +106,11 @@ call_ ## FUNC (void) \
# define EH_FRAME_SECTION_CONST
#endif
+#if !defined(DTOR_LIST_END) && defined(OBJECT_FORMAT_ELF) \
+ && defined(HAVE_GAS_HIDDEN) && !defined(FINI_ARRAY_SECTION_ASM_OP)
+# define HIDDEN_DTOR_LIST_END
+#endif
+
/* We do not want to add the weak attribute to the declarations of these
routines in unwind-dw2-fde.h because that will cause the definition of
these symbols to be weak as well.
@@ -265,10 +270,6 @@ extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK;
static void __attribute__((used))
__do_global_dtors_aux (void)
{
-#ifndef FINI_ARRAY_SECTION_ASM_OP
- static func_ptr *p = __DTOR_LIST__ + 1;
- func_ptr f;
-#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */
static _Bool completed;
if (__builtin_expect (completed, 0))
@@ -282,12 +283,32 @@ __do_global_dtors_aux (void)
#ifdef FINI_ARRAY_SECTION_ASM_OP
/* If we are using .fini_array then destructors will be run via that
mechanism. */
+#elif defined(HIDDEN_DTOR_LIST_END)
+ {
+ /* Safer version that makes sure only .dtors function pointers are
+ called even if the static variable is maliciously changed. */
+ extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden")));
+ static size_t dtor_idx;
+ const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1;
+ func_ptr f;
+
+ while (dtor_idx < max_idx)
+ {
+ f = __DTOR_LIST__[++dtor_idx];
+ f ();
+ }
+ }
#else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */
- while ((f = *p))
- {
- p++;
- f ();
- }
+ {
+ static func_ptr *p = __DTOR_LIST__ + 1;
+ func_ptr f;
+
+ while ((f = *p))
+ {
+ p++;
+ f ();
+ }
+ }
#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */
#ifdef USE_EH_FRAME_REGISTRY
@@ -471,6 +492,17 @@ STATIC func_ptr __CTOR_END__[1]
#ifdef DTOR_LIST_END
DTOR_LIST_END;
+#elif defined(HIDDEN_DTOR_LIST_END)
+#ifdef DTORS_SECTION_ASM_OP
+asm (DTORS_SECTION_ASM_OP);
+#endif
+func_ptr __DTOR_END__[1]
+ __attribute__ ((unused,
+#ifndef DTORS_SECTION_ASM_OP
+ section(".dtors"),
+#endif
+ aligned(sizeof(func_ptr)), visibility ("hidden")))
+ = { (func_ptr) 0 };
#elif defined(DTORS_SECTION_ASM_OP)
asm (DTORS_SECTION_ASM_OP);
STATIC func_ptr __DTOR_END__[1]
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi
index 60482e4626c..bd4c62308ee 100644
--- a/gcc/doc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -1983,8 +1983,11 @@ This macro returns the attributes on the type @var{type}.
@tindex VEC_WIDEN_MULT_LO_EXPR
@tindex VEC_UNPACK_HI_EXPR
@tindex VEC_UNPACK_LO_EXPR
+@tindex VEC_UNPACK_FLOAT_HI_EXPR
+@tindex VEC_UNPACK_FLOAT_LO_EXPR
@tindex VEC_PACK_TRUNC_EXPR
@tindex VEC_PACK_SAT_EXPR
+@tindex VEC_PACK_FIX_TRUNC_EXPR
@tindex VEC_EXTRACT_EVEN_EXPR
@tindex VEC_EXTRACT_ODD_EXPR
@tindex VEC_INTERLEAVE_HIGH_EXPR
@@ -2846,6 +2849,17 @@ high @code{N/2} elements of the vector are extracted and widened (promoted).
In the case of @code{VEC_UNPACK_LO_EXPR} the low @code{N/2} elements of the
vector are extracted and widened (promoted).
+@item VEC_UNPACK_FLOAT_HI_EXPR
+@item VEC_UNPACK_FLOAT_LO_EXPR
+These nodes represent unpacking of the high and low parts of the input vector,
+where the values are converted from fixed point to floating point. The
+single operand is a vector that contains @code{N} elements of the same
+integral type. The result is a vector that contains half as many elements
+of a floating point type whose size is twice as wide. In the case of
+@code{VEC_UNPACK_HI_EXPR} the high @code{N/2} elements of the vector are
+extracted, converted and widened. In the case of @code{VEC_UNPACK_LO_EXPR}
+the low @code{N/2} elements of the vector are extracted, converted and widened.
+
@item VEC_PACK_TRUNC_EXPR
This node represents packing of truncated elements of the two input vectors
into the output vector. Input operands are vectors that contain the same
@@ -2862,6 +2876,15 @@ vector that contains twice as many elements of an integral type whose size
is half as wide. The elements of the two vectors are demoted and merged
(concatenated) to form the output vector.
+@item VEC_PACK_FIX_TRUNC_EXPR
+This node represents packing of elements of the two input vectors into the
+output vector, where the values are converted from floating point
+to fixed point. Input operands are vectors that contain the same number
+of elements of a floating point type. The result is a vector that contains
+twice as many elements of an integral type whose size is half as wide. The
+elements of the two vectors are merged (concatenated) to form the output
+vector.
+
@item VEC_EXTRACT_EVEN_EXPR
@item VEC_EXTRACT_ODD_EXPR
These nodes represent extracting of the even/odd elements of the two input
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 45a632493de..2a310571b71 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1972,7 +1972,7 @@ is used. @xref{C Dialect Options,,Options
Controlling C Dialect}.
@item function_vector
-@cindex calling functions through the function vector on the H8/300 processors
+@cindex calling functions through the function vector on H8/300, M16C, and M32C processors
Use this attribute on the H8/300, H8/300H, and H8S to indicate that the specified
function should be called through the function vector. Calling a
function through the function vector will reduce code size, however;
@@ -1982,6 +1982,40 @@ and 64 entries on the H8/300H and H8S) and shares space with the interrupt vecto
You must use GAS and GLD from GNU binutils version 2.7 or later for
this attribute to work correctly.
+On M16C/M32C targets, the @code{function_vector} attribute declares a
+special page subroutine call function. Use of this attribute reduces
+the code size by 2 bytes for each call generated to the
+subroutine. The argument to the attribute is the vector number entry
+from the special page vector table which contains the 16 low-order
+bits of the subroutine's entry address. Each vector table has special
+page number (18 to 255) which are used in @code{jsrs} instruction.
+Jump addresses of the routines are generated by adding 0x0F0000 (in
+case of M16C targets) or 0xFF0000 (in case of M32C targets), to the 2
+byte addresses set in the vector table. Therefore you need to ensure
+that all the special page vector routines should get mapped within the
+address range 0x0F0000 to 0x0FFFFF (for M16C) and 0xFF0000 to 0xFFFFFF
+(for M32C).
+
+In the following example 2 bytes will be saved for each call to
+function @code{foo}.
+
+@smallexample
+void foo (void) __attribute__((function_vector(0x18)));
+void foo (void)
+@{
+@}
+
+void bar (void)
+@{
+ foo();
+@}
+@end smallexample
+
+If functions are defined in one file and are called in another file,
+then be sure to write this declaration in both files.
+
+This attribute is ignored for R8C target.
+
@item interrupt
@cindex interrupt handler functions
Use this attribute on the ARM, AVR, C4x, CRX, M32C, M32R/D, MS1, and Xstormy16
@@ -2013,6 +2047,14 @@ indicate that the specified function is an interrupt handler. The compiler
will generate function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.
+@item interrupt_thread
+@cindex interrupt thread functions on fido
+Use this attribute on fido, a subarchitecture of the m68k, to indicate
+that the specified function is an interrupt handler that is designed
+to run as a thread. The compiler omits generate prologue/epilogue
+sequences and replaces the return instruction with a @code{sleep}
+instruction. This attribute is available only on fido.
+
@item kspisusp
@cindex User stack pointer in interrupts on the Blackfin
When used together with @code{interrupt_handler}, @code{exception_handler}
@@ -5479,6 +5521,9 @@ should be called and the @var{flag} argument passed to it.
@findex gamma
@findex gammaf
@findex gammal
+@findex gamma_r
+@findex gammaf_r
+@findex gammal_r
@findex gettext
@findex hypot
@findex hypotf
@@ -5529,6 +5574,9 @@ should be called and the @var{flag} argument passed to it.
@findex lgamma
@findex lgammaf
@findex lgammal
+@findex lgamma_r
+@findex lgammaf_r
+@findex lgammal_r
@findex llabs
@findex llrint
@findex llrintf
@@ -5558,6 +5606,7 @@ should be called and the @var{flag} argument passed to it.
@findex lroundf
@findex lroundl
@findex malloc
+@findex memchr
@findex memcmp
@findex memcpy
@findex mempcpy
@@ -5709,20 +5758,22 @@ Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
@code{_exit}, @code{alloca}, @code{bcmp}, @code{bzero},
@code{dcgettext}, @code{dgettext}, @code{dremf}, @code{dreml},
@code{drem}, @code{exp10f}, @code{exp10l}, @code{exp10}, @code{ffsll},
-@code{ffsl}, @code{ffs}, @code{fprintf_unlocked}, @code{fputs_unlocked},
-@code{gammaf}, @code{gammal}, @code{gamma}, @code{gettext},
+@code{ffsl}, @code{ffs}, @code{fprintf_unlocked},
+@code{fputs_unlocked}, @code{gammaf}, @code{gammal}, @code{gamma},
+@code{gammaf_r}, @code{gammal_r}, @code{gamma_r}, @code{gettext},
@code{index}, @code{isascii}, @code{j0f}, @code{j0l}, @code{j0},
@code{j1f}, @code{j1l}, @code{j1}, @code{jnf}, @code{jnl}, @code{jn},
-@code{mempcpy}, @code{pow10f}, @code{pow10l}, @code{pow10},
-@code{printf_unlocked}, @code{rindex}, @code{scalbf}, @code{scalbl},
-@code{scalb}, @code{signbit}, @code{signbitf}, @code{signbitl},
-@code{signbitd32}, @code{signbitd64}, @code{signbitd128},
-@code{significandf}, @code{significandl}, @code{significand},
-@code{sincosf}, @code{sincosl}, @code{sincos}, @code{stpcpy},
-@code{stpncpy}, @code{strcasecmp}, @code{strdup}, @code{strfmon},
-@code{strncasecmp}, @code{strndup}, @code{toascii}, @code{y0f},
-@code{y0l}, @code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf},
-@code{ynl} and @code{yn}
+@code{lgammaf_r}, @code{lgammal_r}, @code{lgamma_r}, @code{mempcpy},
+@code{pow10f}, @code{pow10l}, @code{pow10}, @code{printf_unlocked},
+@code{rindex}, @code{scalbf}, @code{scalbl}, @code{scalb},
+@code{signbit}, @code{signbitf}, @code{signbitl}, @code{signbitd32},
+@code{signbitd64}, @code{signbitd128}, @code{significandf},
+@code{significandl}, @code{significand}, @code{sincosf},
+@code{sincosl}, @code{sincos}, @code{stpcpy}, @code{stpncpy},
+@code{strcasecmp}, @code{strdup}, @code{strfmon}, @code{strncasecmp},
+@code{strndup}, @code{toascii}, @code{y0f}, @code{y0l}, @code{y0},
+@code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and
+@code{yn}
may be handled as built-in functions.
All these functions have corresponding versions
prefixed with @code{__builtin_}, which may be used even in strict C89
@@ -5802,14 +5853,14 @@ The ISO C90 functions
@code{isgraph}, @code{islower}, @code{isprint}, @code{ispunct},
@code{isspace}, @code{isupper}, @code{isxdigit}, @code{tolower},
@code{toupper}, @code{labs}, @code{ldexp}, @code{log10}, @code{log},
-@code{malloc}, @code{memcmp}, @code{memcpy}, @code{memset}, @code{modf},
-@code{pow}, @code{printf}, @code{putchar}, @code{puts}, @code{scanf},
-@code{sinh}, @code{sin}, @code{snprintf}, @code{sprintf}, @code{sqrt},
-@code{sscanf}, @code{strcat}, @code{strchr}, @code{strcmp},
-@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat},
-@code{strncmp}, @code{strncpy}, @code{strpbrk}, @code{strrchr},
-@code{strspn}, @code{strstr}, @code{tanh}, @code{tan}, @code{vfprintf},
-@code{vprintf} and @code{vsprintf}
+@code{malloc}, @code{memchr}, @code{memcmp}, @code{memcpy},
+@code{memset}, @code{modf}, @code{pow}, @code{printf}, @code{putchar},
+@code{puts}, @code{scanf}, @code{sinh}, @code{sin}, @code{snprintf},
+@code{sprintf}, @code{sqrt}, @code{sscanf}, @code{strcat},
+@code{strchr}, @code{strcmp}, @code{strcpy}, @code{strcspn},
+@code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
+@code{strpbrk}, @code{strrchr}, @code{strspn}, @code{strstr},
+@code{tanh}, @code{tan}, @code{vfprintf}, @code{vprintf} and @code{vsprintf}
are all recognized as built-in functions unless
@option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}}
is specified for an individual function). All of these functions have
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 07bf9e974a1..9b0d65ac709 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -248,7 +248,7 @@ Objective-C and Objective-C++ Dialects}.
-Wredundant-decls @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
-Wsign-compare -Wstack-protector @gol
--Wstrict-aliasing -Wstrict-aliasing=2 @gol
+-Wstrict-aliasing -Wstrict-aliasing=n @gol
-Wstrict-overflow -Wstrict-overflow=@var{n} @gol
-Wswitch -Wswitch-default -Wswitch-enum @gol
-Wsystem-headers -Wtrigraphs -Wundef -Wuninitialized @gol
@@ -439,12 +439,13 @@ Objective-C and Objective-C++ Dialects}.
-mcall-prologues -mno-tablejump -mtiny-stack -mint8}
@emph{Blackfin Options}
-@gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
--mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
--mlow-64k -mno-low64k -mstack-check-l1 -mid-shared-library @gol
--mno-id-shared-library -mshared-library-id=@var{n} @gol
--mleaf-id-shared-library -mno-leaf-id-shared-library @gol
--msep-data -mno-sep-data -mlong-calls -mno-long-calls}
+@gccoptlist{-mcpu=@var{cpu} -msim -momit-leaf-frame-pointer @gol
+-mno-omit-leaf-frame-pointer -mspecld-anomaly -mno-specld-anomaly @gol
+-mcsync-anomaly -mno-csync-anomaly -mlow-64k -mno-low64k @gol
+-mstack-check-l1 -mid-shared-library -mno-id-shared-library @gol
+-mshared-library-id=@var{n} -mleaf-id-shared-library @gol
+-mno-leaf-id-shared-library -msep-data -mno-sep-data -mlong-calls @gol
+-mno-long-calls}
@emph{CRIS Options}
@gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
@@ -3007,14 +3008,40 @@ It warns about code which might break the strict aliasing rules that the
compiler is using for optimization. The warning does not catch all
cases, but does attempt to catch the more common pitfalls. It is
included in @option{-Wall}.
+It is equivalent to -Wstrict-aliasing=3
-@item -Wstrict-aliasing=2
-@opindex Wstrict-aliasing=2
+@item -Wstrict-aliasing=n
+@opindex Wstrict-aliasing=n
This option is only active when @option{-fstrict-aliasing} is active.
It warns about code which might break the strict aliasing rules that the
-compiler is using for optimization. This warning catches more cases than
-@option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
-cases that are safe.
+compiler is using for optimization.
+Higher levels correspond to higher accuracy (fewer false positives).
+Higher levels also correspond to more effort, similar to the way -O works.
+@option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
+with n=3.
+
+Level 1: Most aggressive, quick, least accurate.
+Possibly useful when higher levels
+do not warn but -fstrict-aliasing still breaks the code, as it has very few
+false negatives. However, it has many false positives.
+Warns for all pointer conversions between possibly incompatible types,
+even if never dereferenced. Runs in the frontend only.
+
+Level 2: Aggressive, quick, not too precise.
+May still have many false positives (not as many as level 1 though),
+and few false negatives (but possibly more than level 1).
+Unlike level 1, it only warns when an address is taken. Warns about
+incomplete types. Runs in the frontend only.
+
+Level 3 (default for @option{-Wstrict-aliasing}):
+Should have very few false positives and few false
+negatives. Slightly slower than levels 1 or 2 when optimization is enabled.
+Takes care of the common punn+dereference pattern in the frontend:
+@code{*(int*)&some_float}.
+If optimization is enabled, it also runs in the backend, where it deals
+with multiple statement cases using flow-sensitive points-to information.
+Only warns when the converted pointer is dereferenced.
+Does not warn about incomplete types.
@item -Wstrict-overflow
@item -Wstrict-overflow=@var{n}
@@ -3157,6 +3184,11 @@ An empty body occurs in an @samp{if}, @samp{else} or
@samp{do while} statement. This warning can be independently
controlled by @option{-Wempty-body}.
+@item @r{(C++ only)}
+An empty body occurs in a @samp{while} or @samp{for} statement with no
+whitespacing before the semicolon. This warning can be independently
+controlled by @option{-Wempty-body}.
+
@item
A pointer is compared against integer zero with @samp{<}, @samp{<=},
@samp{>}, or @samp{>=}.
@@ -3421,8 +3453,10 @@ to them.
@item -Wempty-body
@opindex Wempty-body
-An empty body occurs in an @samp{if}, @samp{else} or @samp{do while}
-statement. This warning is also enabled by @option{-Wextra}.
+Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
+while} statement. Additionally, in C++, warn when an empty body occurs
+in a @samp{while} or @samp{for} statement with no whitespacing before
+the semicolon. This warning is also enabled by @option{-Wextra}.
@item -Wsign-compare
@opindex Wsign-compare
@@ -8342,6 +8376,23 @@ size.
@cindex Blackfin Options
@table @gcctabopt
+@item -mcpu=@var{cpu}
+@opindex mcpu=
+Specifies the name of the target Blackfin processor. Currently, @var{cpu}
+can be one of @samp{bf531}, @samp{bf532}, @samp{bf533},
+@samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf561}.
+Without this option, @samp{bf532} is used as the processor by default.
+The corresponding predefined processor macros for @var{cpu} is to
+be defined. For the @samp{bfin-elf} toolchain, this causes the hardware
+BSP provided by libgloss to be linked in if @samp{-msim} is not given.
+Support for @samp{bf561} is incomplete; only the processor macro is defined.
+
+@item -msim
+@opindex msim
+Specifies that the program will be run on the simulator. This causes
+the simulator BSP provided by libgloss to be linked in. This option
+has effect only for @samp{bfin-elf} toolchain.
+
@item -momit-leaf-frame-pointer
@opindex momit-leaf-frame-pointer
Don't keep the frame pointer in a register for leaf functions. This
@@ -9928,18 +9979,6 @@ specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}
@opindex mcpu
A deprecated synonym for @option{-mtune}.
-@item -m386
-@itemx -m486
-@itemx -mpentium
-@itemx -mpentiumpro
-@opindex m386
-@opindex m486
-@opindex mpentium
-@opindex mpentiumpro
-These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
-@option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
-These synonyms are deprecated.
-
@item -mfpmath=@var{unit}
@opindex march
Generate floating point arithmetics for selected unit @var{unit}. The choices
@@ -10141,12 +10180,21 @@ the system libraries and startup modules.
@opindex mpc80
Set 80387 floating-point precision to 32, 64 or 80 bits. When @option{-mpc32}
-is specified, the significand of floating-point operations is rounded to 24
-bits (single precision), @option{-mpc64} rounds the significand of
-floating-point operations to 53 bits (double precision) and @option{-mpc80}
-rounds the significand of floating-point operations to 64 bits (extended
-double precision). Note that a change of default precision control may
-affect the results returned by some of the mathematical functions.
+is specified, the significands of results of floating-point operations are
+rounded to 24 bits (single precision); @option{-mpc64} rounds the the
+significands of results of floating-point operations to 53 bits (double
+precision) and @option{-mpc80} rounds the significands of results of
+floating-point operations to 64 bits (extended double precision), which is
+the default. When this option is used, floating-point operations in higher
+precisions are not available to the programmer without setting the FPU
+control word explicitly.
+
+Setting the rounding of floating-point operations to less than the default
+80 bits can speed some programs by 2% or more. Note that some mathematical
+libraries assume that extended precision (80 bit) floating-point operations
+are enabled by default; routines in such libraries could suffer significant
+loss of accuracy, typically through so-called "catastrophic cancellation",
+when this option is used to set the precision to less than extended precision.
@item -mstackrealign
@opindex mstackrealign
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 56cc60f2e1e..029657d3fe0 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -3607,6 +3607,14 @@ Operand 0 is the resulting vector in which the elements of the two input
vectors are concatenated after narrowing them down using signed/unsigned
saturating arithmetic.
+@cindex @code{vec_pack_sfix_trunc_@var{m}} instruction pattern
+@cindex @code{vec_pack_ufix_trunc_@var{m}} instruction pattern
+@item @samp{vec_pack_sfix_trunc_@var{m}}, @samp{vec_pack_ufix_trunc_@var{m}}
+Narrow, convert to signed/unsigned integral type and merge the elements
+of two vectors. Operands 1 and 2 are vectors of the same mode having N
+floating point elements of size S. Operand 0 is the resulting vector
+in which 2*N elements of size N/2 are concatenated.
+
@cindex @code{vec_unpacks_hi_@var{m}} instruction pattern
@cindex @code{vec_unpacks_lo_@var{m}} instruction pattern
@item @samp{vec_unpacks_hi_@var{m}}, @samp{vec_unpacks_lo_@var{m}}
@@ -3624,11 +3632,24 @@ integral elements. The input vector (operand 1) has N elements of size S.
Widen (promote) the high/low elements of the vector using zero extension and
place the resulting N/2 values of size 2*S in the output vector (operand 0).
+@cindex @code{vec_unpacks_float_hi_@var{m}} instruction pattern
+@cindex @code{vec_unpacks_float_lo_@var{m}} instruction pattern
+@cindex @code{vec_unpacku_float_hi_@var{m}} instruction pattern
+@cindex @code{vec_unpacku_float_lo_@var{m}} instruction pattern
+@item @samp{vec_unpacks_float_hi_@var{m}}, @samp{vec_unpacks_float_lo_@var{m}}
+@itemx @samp{vec_unpacku_float_hi_@var{m}}, @samp{vec_unpacku_float_lo_@var{m}}
+Extract, convert to floating point type and widen the high/low part of a
+vector of signed/unsigned integral elements. The input vector (operand 1)
+has N elements of size S. Convert the high/low elements of the vector using
+floating point conversion and place the resulting N/2 values of size 2*S in
+the output vector (operand 0).
+
@cindex @code{vec_widen_umult_hi_@var{m}} instruction pattern
@cindex @code{vec_widen_umult_lo__@var{m}} instruction pattern
@cindex @code{vec_widen_smult_hi_@var{m}} instruction pattern
@cindex @code{vec_widen_smult_lo_@var{m}} instruction pattern
-@item @samp{vec_widen_umult_hi_@var{m}}, @samp{vec_widen_umult_lo_@var{m}}, @samp{vec_widen_smult_hi_@var{m}}, @samp{vec_widen_smult_lo_@var{m}}
+@item @samp{vec_widen_umult_hi_@var{m}}, @samp{vec_widen_umult_lo_@var{m}}
+@itemx @samp{vec_widen_smult_hi_@var{m}}, @samp{vec_widen_smult_lo_@var{m}}
Signed/Unsigned widening multiplication. The two inputs (operands 1 and 2)
are vectors with N signed/unsigned elements of size S. Multiply the high/low
elements of the two vectors, and put the N/2 products of size 2*S in the
@@ -3687,6 +3708,25 @@ These instructions are not allowed to @code{FAIL}.
Like @code{madd@var{m}@var{n}4}, but zero-extend the multiplication
operands instead of sign-extending them.
+@cindex @code{msub@var{m}@var{n}4} instruction pattern
+@item @samp{msub@var{m}@var{n}4}
+Multiply operands 1 and 2, sign-extend them to mode @var{n}, subtract the
+result from operand 3, and store the result in operand 0. Operands 1 and 2
+have mode @var{m} and operands 0 and 3 have mode @var{n}.
+Both modes must be integer modes and @var{n} must be twice
+the size of @var{m}.
+
+In other words, @code{msub@var{m}@var{n}4} is like
+@code{mul@var{m}@var{n}3} except that it also subtracts the result
+from operand 3.
+
+These instructions are not allowed to @code{FAIL}.
+
+@cindex @code{umsub@var{m}@var{n}4} instruction pattern
+@item @samp{umsub@var{m}@var{n}4}
+Like @code{msub@var{m}@var{n}4}, but zero-extend the multiplication
+operands instead of sign-extending them.
+
@cindex @code{divmod@var{m}4} instruction pattern
@item @samp{divmod@var{m}4}
Signed division that produces both a quotient and a remainder.
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index d7063313df3..682ef94ee3f 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1026,7 +1026,8 @@ targets.
@item @{ dg-excess-errors @var{comment} [@{ target/xfail @var{selector} @}] @}
This DejaGnu directive indicates that the test is expected to fail due
to compiler messages that are not handled by @samp{dg-error},
-@samp{dg-warning} or @samp{dg-bogus}.
+@samp{dg-warning} or @samp{dg-bogus}. For this directive @samp{xfail}
+has the same effect as @samp{target}.
@item @{ dg-output @var{regexp} [@{ target/xfail @var{selector} @}] @}
This DejaGnu directive compares @var{regexp} to the combined output
diff --git a/gcc/dominance.c b/gcc/dominance.c
index cb57692e261..4ae8b4dffe3 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -46,7 +46,7 @@
#include "timevar.h"
/* Whether the dominators and the postdominators are available. */
-enum dom_state dom_computed[2];
+static enum dom_state dom_computed[2];
/* We name our nodes with integers, beginning with 1. Zero is reserved for
'undefined' or 'end of list'. The name of each node is given by the dfs
@@ -114,13 +114,12 @@ struct dom_info
static void init_dom_info (struct dom_info *, enum cdi_direction);
static void free_dom_info (struct dom_info *);
-static void calc_dfs_tree_nonrec (struct dom_info *, basic_block,
- enum cdi_direction);
-static void calc_dfs_tree (struct dom_info *, enum cdi_direction);
+static void calc_dfs_tree_nonrec (struct dom_info *, basic_block, bool);
+static void calc_dfs_tree (struct dom_info *, bool);
static void compress (struct dom_info *, TBB);
static TBB eval (struct dom_info *, TBB);
static void link_roots (struct dom_info *, TBB, TBB);
-static void calc_idoms (struct dom_info *, enum cdi_direction);
+static void calc_idoms (struct dom_info *, bool);
void debug_dominance_info (enum cdi_direction);
/* Keeps track of the*/
@@ -169,11 +168,34 @@ init_dom_info (struct dom_info *di, enum cdi_direction dir)
di->dfsnum = 1;
di->nodes = 0;
- di->fake_exit_edge = dir ? BITMAP_ALLOC (NULL) : NULL;
+ switch (dir)
+ {
+ case CDI_DOMINATORS:
+ di->fake_exit_edge = NULL;
+ break;
+ case CDI_POST_DOMINATORS:
+ di->fake_exit_edge = BITMAP_ALLOC (NULL);
+ break;
+ default:
+ gcc_unreachable ();
+ break;
+ }
}
#undef init_ar
+/* Map dominance calculation type to array index used for various
+ dominance information arrays. This version is simple -- it will need
+ to be modified, obviously, if additional values are added to
+ cdi_direction. */
+
+static unsigned int
+dom_convert_dir_to_idx (enum cdi_direction dir)
+{
+ gcc_assert (dir == CDI_DOMINATORS || dir == CDI_POST_DOMINATORS);
+ return dir - 1;
+}
+
/* Free all allocated memory in DI, but not DI itself. */
static void
@@ -200,8 +222,7 @@ free_dom_info (struct dom_info *di)
assigned their dfs number and are linked together to form a tree. */
static void
-calc_dfs_tree_nonrec (struct dom_info *di, basic_block bb,
- enum cdi_direction reverse)
+calc_dfs_tree_nonrec (struct dom_info *di, basic_block bb, bool reverse)
{
/* We call this _only_ if bb is not already visited. */
edge e;
@@ -312,7 +333,7 @@ calc_dfs_tree_nonrec (struct dom_info *di, basic_block bb,
because there may be nodes from which the EXIT_BLOCK is unreachable. */
static void
-calc_dfs_tree (struct dom_info *di, enum cdi_direction reverse)
+calc_dfs_tree (struct dom_info *di, bool reverse)
{
/* The first block is the ENTRY_BLOCK (or EXIT_BLOCK if REVERSE). */
basic_block begin = reverse ? EXIT_BLOCK_PTR : ENTRY_BLOCK_PTR;
@@ -472,7 +493,7 @@ link_roots (struct dom_info *di, TBB v, TBB w)
On return the immediate dominator to node V is in di->dom[V]. */
static void
-calc_idoms (struct dom_info *di, enum cdi_direction reverse)
+calc_idoms (struct dom_info *di, bool reverse)
{
TBB v, w, k, par;
basic_block en_block;
@@ -591,19 +612,20 @@ compute_dom_fast_query (enum cdi_direction dir)
{
int num = 0;
basic_block bb;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
gcc_assert (dom_info_available_p (dir));
- if (dom_computed[dir] == DOM_OK)
+ if (dom_computed[dir_index] == DOM_OK)
return;
FOR_ALL_BB (bb)
{
- if (!bb->dom[dir]->father)
- assign_dfs_numbers (bb->dom[dir], &num);
+ if (!bb->dom[dir_index]->father)
+ assign_dfs_numbers (bb->dom[dir_index], &num);
}
- dom_computed[dir] = DOM_OK;
+ dom_computed[dir_index] = DOM_OK;
}
/* The main entry point into this module. DIR is set depending on whether
@@ -614,35 +636,37 @@ calculate_dominance_info (enum cdi_direction dir)
{
struct dom_info di;
basic_block b;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ bool reverse = (dir == CDI_POST_DOMINATORS) ? true : false;
- if (dom_computed[dir] == DOM_OK)
+ if (dom_computed[dir_index] == DOM_OK)
return;
timevar_push (TV_DOMINANCE);
if (!dom_info_available_p (dir))
{
- gcc_assert (!n_bbs_in_dom_tree[dir]);
+ gcc_assert (!n_bbs_in_dom_tree[dir_index]);
FOR_ALL_BB (b)
{
- b->dom[dir] = et_new_tree (b);
+ b->dom[dir_index] = et_new_tree (b);
}
- n_bbs_in_dom_tree[dir] = n_basic_blocks;
+ n_bbs_in_dom_tree[dir_index] = n_basic_blocks;
init_dom_info (&di, dir);
- calc_dfs_tree (&di, dir);
- calc_idoms (&di, dir);
+ calc_dfs_tree (&di, reverse);
+ calc_idoms (&di, reverse);
FOR_EACH_BB (b)
{
TBB d = di.dom[di.dfs_order[b->index]];
if (di.dfs_to_bb[d])
- et_set_father (b->dom[dir], di.dfs_to_bb[d]->dom[dir]);
+ et_set_father (b->dom[dir_index], di.dfs_to_bb[d]->dom[dir_index]);
}
free_dom_info (&di);
- dom_computed[dir] = DOM_NO_FAST_QUERY;
+ dom_computed[dir_index] = DOM_NO_FAST_QUERY;
}
compute_dom_fast_query (dir);
@@ -655,29 +679,31 @@ void
free_dominance_info (enum cdi_direction dir)
{
basic_block bb;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
if (!dom_info_available_p (dir))
return;
FOR_ALL_BB (bb)
{
- et_free_tree_force (bb->dom[dir]);
- bb->dom[dir] = NULL;
+ et_free_tree_force (bb->dom[dir_index]);
+ bb->dom[dir_index] = NULL;
}
et_free_pools ();
- n_bbs_in_dom_tree[dir] = 0;
+ n_bbs_in_dom_tree[dir_index] = 0;
- dom_computed[dir] = DOM_NONE;
+ dom_computed[dir_index] = DOM_NONE;
}
/* Return the immediate dominator of basic block BB. */
basic_block
get_immediate_dominator (enum cdi_direction dir, basic_block bb)
{
- struct et_node *node = bb->dom[dir];
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *node = bb->dom[dir_index];
- gcc_assert (dom_computed[dir]);
+ gcc_assert (dom_computed[dir_index]);
if (!node->father)
return NULL;
@@ -691,9 +717,10 @@ inline void
set_immediate_dominator (enum cdi_direction dir, basic_block bb,
basic_block dominated_by)
{
- struct et_node *node = bb->dom[dir];
-
- gcc_assert (dom_computed[dir]);
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *node = bb->dom[dir_index];
+
+ gcc_assert (dom_computed[dir_index]);
if (node->father)
{
@@ -703,10 +730,10 @@ set_immediate_dominator (enum cdi_direction dir, basic_block bb,
}
if (dominated_by)
- et_set_father (node, dominated_by->dom[dir]);
+ et_set_father (node, dominated_by->dom[dir_index]);
- if (dom_computed[dir] == DOM_OK)
- dom_computed[dir] = DOM_NO_FAST_QUERY;
+ if (dom_computed[dir_index] == DOM_OK)
+ dom_computed[dir_index] = DOM_NO_FAST_QUERY;
}
/* Store all basic blocks immediately dominated by BB into BBS and return
@@ -714,10 +741,11 @@ set_immediate_dominator (enum cdi_direction dir, basic_block bb,
int
get_dominated_by (enum cdi_direction dir, basic_block bb, basic_block **bbs)
{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
int n;
- struct et_node *node = bb->dom[dir], *son = node->son, *ason;
-
- gcc_assert (dom_computed[dir]);
+ struct et_node *node = bb->dom[dir_index], *son = node->son, *ason;
+
+ gcc_assert (dom_computed[dir_index]);
if (!son)
{
@@ -767,9 +795,13 @@ void
redirect_immediate_dominators (enum cdi_direction dir, basic_block bb,
basic_block to)
{
- struct et_node *bb_node = bb->dom[dir], *to_node = to->dom[dir], *son;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *bb_node, *to_node, *son;
+
+ bb_node = bb->dom[dir_index];
+ to_node = to->dom[dir_index];
- gcc_assert (dom_computed[dir]);
+ gcc_assert (dom_computed[dir_index]);
if (!bb_node->son)
return;
@@ -782,22 +814,24 @@ redirect_immediate_dominators (enum cdi_direction dir, basic_block bb,
et_set_father (son, to_node);
}
- if (dom_computed[dir] == DOM_OK)
- dom_computed[dir] = DOM_NO_FAST_QUERY;
+ if (dom_computed[dir_index] == DOM_OK)
+ dom_computed[dir_index] = DOM_NO_FAST_QUERY;
}
/* Find first basic block in the tree dominating both BB1 and BB2. */
basic_block
nearest_common_dominator (enum cdi_direction dir, basic_block bb1, basic_block bb2)
{
- gcc_assert (dom_computed[dir]);
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+
+ gcc_assert (dom_computed[dir_index]);
if (!bb1)
return bb2;
if (!bb2)
return bb1;
- return et_nca (bb1->dom[dir], bb2->dom[dir])->data;
+ return et_nca (bb1->dom[dir_index], bb2->dom[dir_index])->data;
}
@@ -899,11 +933,12 @@ nearest_common_dominator_for_set (enum cdi_direction dir, bitmap blocks)
bool
dominated_by_p (enum cdi_direction dir, basic_block bb1, basic_block bb2)
{
- struct et_node *n1 = bb1->dom[dir], *n2 = bb2->dom[dir];
-
- gcc_assert (dom_computed[dir]);
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *n1 = bb1->dom[dir_index], *n2 = bb2->dom[dir_index];
+
+ gcc_assert (dom_computed[dir_index]);
- if (dom_computed[dir] == DOM_OK)
+ if (dom_computed[dir_index] == DOM_OK)
return (n1->dfs_num_in >= n2->dfs_num_in
&& n1->dfs_num_out <= n2->dfs_num_out);
@@ -915,9 +950,10 @@ dominated_by_p (enum cdi_direction dir, basic_block bb1, basic_block bb2)
unsigned
bb_dom_dfs_in (enum cdi_direction dir, basic_block bb)
{
- struct et_node *n = bb->dom[dir];
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *n = bb->dom[dir_index];
- gcc_assert (dom_computed[dir] == DOM_OK);
+ gcc_assert (dom_computed[dir_index] == DOM_OK);
return n->dfs_num_in;
}
@@ -926,9 +962,10 @@ bb_dom_dfs_in (enum cdi_direction dir, basic_block bb)
unsigned
bb_dom_dfs_out (enum cdi_direction dir, basic_block bb)
{
- struct et_node *n = bb->dom[dir];
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *n = bb->dom[dir_index];
- gcc_assert (dom_computed[dir] == DOM_OK);
+ gcc_assert (dom_computed[dir_index] == DOM_OK);
return n->dfs_num_out;
}
@@ -982,11 +1019,12 @@ verify_dominators (enum cdi_direction dir)
basic_block
recount_dominator (enum cdi_direction dir, basic_block bb)
{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
basic_block dom_bb = NULL;
edge e;
edge_iterator ei;
- gcc_assert (dom_computed[dir]);
+ gcc_assert (dom_computed[dir_index]);
if (dir == CDI_DOMINATORS)
{
@@ -1018,10 +1056,11 @@ recount_dominator (enum cdi_direction dir, basic_block bb)
void
iterate_fix_dominators (enum cdi_direction dir, basic_block *bbs, int n)
{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
int i, changed = 1;
basic_block old_dom, new_dom;
- gcc_assert (dom_computed[dir]);
+ gcc_assert (dom_computed[dir_index]);
for (i = 0; i < n; i++)
set_immediate_dominator (dir, bbs[i], NULL);
@@ -1048,28 +1087,32 @@ iterate_fix_dominators (enum cdi_direction dir, basic_block *bbs, int n)
void
add_to_dominance_info (enum cdi_direction dir, basic_block bb)
{
- gcc_assert (dom_computed[dir]);
- gcc_assert (!bb->dom[dir]);
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+
+ gcc_assert (dom_computed[dir_index]);
+ gcc_assert (!bb->dom[dir_index]);
- n_bbs_in_dom_tree[dir]++;
+ n_bbs_in_dom_tree[dir_index]++;
- bb->dom[dir] = et_new_tree (bb);
+ bb->dom[dir_index] = et_new_tree (bb);
- if (dom_computed[dir] == DOM_OK)
- dom_computed[dir] = DOM_NO_FAST_QUERY;
+ if (dom_computed[dir_index] == DOM_OK)
+ dom_computed[dir_index] = DOM_NO_FAST_QUERY;
}
void
delete_from_dominance_info (enum cdi_direction dir, basic_block bb)
{
- gcc_assert (dom_computed[dir]);
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
- et_free_tree (bb->dom[dir]);
- bb->dom[dir] = NULL;
- n_bbs_in_dom_tree[dir]--;
+ gcc_assert (dom_computed[dir_index]);
- if (dom_computed[dir] == DOM_OK)
- dom_computed[dir] = DOM_NO_FAST_QUERY;
+ et_free_tree (bb->dom[dir_index]);
+ bb->dom[dir_index] = NULL;
+ n_bbs_in_dom_tree[dir_index]--;
+
+ if (dom_computed[dir_index] == DOM_OK)
+ dom_computed[dir_index] = DOM_NO_FAST_QUERY;
}
/* Returns the first son of BB in the dominator or postdominator tree
@@ -1078,7 +1121,8 @@ delete_from_dominance_info (enum cdi_direction dir, basic_block bb)
basic_block
first_dom_son (enum cdi_direction dir, basic_block bb)
{
- struct et_node *son = bb->dom[dir]->son;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *son = bb->dom[dir_index]->son;
return son ? son->data : NULL;
}
@@ -1089,17 +1133,40 @@ first_dom_son (enum cdi_direction dir, basic_block bb)
basic_block
next_dom_son (enum cdi_direction dir, basic_block bb)
{
- struct et_node *next = bb->dom[dir]->right;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *next = bb->dom[dir_index]->right;
return next->father->son == next ? NULL : next->data;
}
+/* Return dominance availability for dominance info DIR. */
+
+enum dom_state
+dom_info_state (enum cdi_direction dir)
+{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+
+ return dom_computed[dir_index];
+}
+
+/* Set the dominance availability for dominance info DIR to NEW_STATE. */
+
+void
+set_dom_info_availability (enum cdi_direction dir, enum dom_state new_state)
+{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+
+ dom_computed[dir_index] = new_state;
+}
+
/* Returns true if dominance information for direction DIR is available. */
bool
dom_info_available_p (enum cdi_direction dir)
{
- return dom_computed[dir] != DOM_NONE;
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+
+ return dom_computed[dir_index] != DOM_NONE;
}
void
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index a5d9627e3af..2fb5b3f773f 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -168,7 +168,6 @@ static GTY ((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
static rtx make_call_insn_raw (rtx);
static rtx change_address_1 (rtx, enum machine_mode, rtx, int);
-static void unshare_all_decls (tree);
static void reset_used_decls (tree);
static void mark_label_nuses (rtx);
static hashval_t const_int_htab_hash (const void *);
@@ -2116,17 +2115,8 @@ set_new_first_and_last_insn (rtx first, rtx last)
structure. This routine should only be called once. */
static void
-unshare_all_rtl_1 (tree fndecl, rtx insn)
+unshare_all_rtl_1 (rtx insn)
{
- tree decl;
-
- /* Make sure that virtual parameters are not shared. */
- for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
- SET_DECL_RTL (decl, copy_rtx_if_shared (DECL_RTL (decl)));
-
- /* Make sure that virtual stack slots are not shared. */
- unshare_all_decls (DECL_INITIAL (fndecl));
-
/* Unshare just about everything else. */
unshare_all_rtl_in_chain (insn);
@@ -2166,13 +2156,13 @@ unshare_all_rtl_again (rtx insn)
reset_used_flags (stack_slot_list);
- unshare_all_rtl_1 (cfun->decl, insn);
+ unshare_all_rtl_1 (insn);
}
unsigned int
unshare_all_rtl (void)
{
- unshare_all_rtl_1 (current_function_decl, get_insns ());
+ unshare_all_rtl_1 (get_insns ());
return 0;
}
@@ -2354,23 +2344,6 @@ unshare_all_rtl_in_chain (rtx insn)
}
}
-/* Go through all virtual stack slots of a function and copy any
- shared structure. */
-static void
-unshare_all_decls (tree blk)
-{
- tree t;
-
- /* Copy shared decls. */
- for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
- if (DECL_RTL_SET_P (t))
- SET_DECL_RTL (t, copy_rtx_if_shared (DECL_RTL (t)));
-
- /* Now process sub-blocks. */
- for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
- unshare_all_decls (t);
-}
-
/* Go through all virtual stack slots of a function and mark them as
not shared. */
static void
diff --git a/gcc/except.c b/gcc/except.c
index e6c1b48f49a..c360ef7f560 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2898,7 +2898,7 @@ expand_builtin_eh_return_data_regno (tree exp)
rtx
expand_builtin_extract_return_addr (tree addr_tree)
{
- rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, 0);
+ rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, EXPAND_NORMAL);
if (GET_MODE (addr) != Pmode
&& GET_MODE (addr) != VOIDmode)
@@ -2930,7 +2930,7 @@ expand_builtin_extract_return_addr (tree addr_tree)
rtx
expand_builtin_frob_return_addr (tree addr_tree)
{
- rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, 0);
+ rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, EXPAND_NORMAL);
addr = convert_memory_address (Pmode, addr);
@@ -2952,7 +2952,8 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
rtx tmp;
#ifdef EH_RETURN_STACKADJ_RTX
- tmp = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj, VOIDmode, 0);
+ tmp = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj,
+ VOIDmode, EXPAND_NORMAL);
tmp = convert_memory_address (Pmode, tmp);
if (!cfun->eh->ehr_stackadj)
cfun->eh->ehr_stackadj = copy_to_reg (tmp);
@@ -2960,7 +2961,8 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
emit_move_insn (cfun->eh->ehr_stackadj, tmp);
#endif
- tmp = expand_expr (handler_tree, cfun->eh->ehr_handler, VOIDmode, 0);
+ tmp = expand_expr (handler_tree, cfun->eh->ehr_handler,
+ VOIDmode, EXPAND_NORMAL);
tmp = convert_memory_address (Pmode, tmp);
if (!cfun->eh->ehr_handler)
cfun->eh->ehr_handler = copy_to_reg (tmp);
@@ -3018,7 +3020,7 @@ expand_eh_return (void)
rtx
expand_builtin_extend_pointer (tree addr_tree)
{
- rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, 0);
+ rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, EXPAND_NORMAL);
int extend;
#ifdef POINTERS_EXTEND_UNSIGNED
diff --git a/gcc/explow.c b/gcc/explow.c
index b2d4f52969b..79ba5c7e291 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -251,7 +251,7 @@ expr_size (tree exp)
size = SUBSTITUTE_PLACEHOLDER_IN_EXPR (size, exp);
}
- return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype), 0);
+ return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype), EXPAND_NORMAL);
}
/* Return a wide integer for the size in bytes of the value of EXP, or -1
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 019f1131cc7..26802ca2371 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -5045,7 +5045,7 @@ make_tree (tree type, rtx x)
make_tree (type, XEXP (x, 1)));
case LSHIFTRT:
- t = lang_hooks.types.unsigned_type (type);
+ t = unsigned_type_for (type);
return fold_convert (type, build2 (RSHIFT_EXPR, t,
make_tree (t, XEXP (x, 0)),
make_tree (type, XEXP (x, 1))));
@@ -5066,7 +5066,7 @@ make_tree (tree type, rtx x)
make_tree (t, XEXP (x, 0)),
make_tree (t, XEXP (x, 1))));
case UDIV:
- t = lang_hooks.types.unsigned_type (type);
+ t = unsigned_type_for (type);
return fold_convert (type, build2 (TRUNC_DIV_EXPR, t,
make_tree (t, XEXP (x, 0)),
make_tree (t, XEXP (x, 1))));
diff --git a/gcc/expr.c b/gcc/expr.c
index 5eb3d9efb1f..8d11ab8c99d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -2868,7 +2868,12 @@ emit_move_change_mode (enum machine_mode new_mode,
{
rtx ret;
- if (MEM_P (x))
+ if (push_operand (x, GET_MODE (x)))
+ {
+ ret = gen_rtx_MEM (new_mode, XEXP (x, 0));
+ MEM_COPY_ATTRIBUTES (ret, x);
+ }
+ else if (MEM_P (x))
{
/* We don't have to worry about changing the address since the
size in bytes is supposed to be the same. */
@@ -3996,7 +4001,7 @@ optimize_bitfield_assignment_op (unsigned HOST_WIDE_INT bitsize,
&& (bitsize != 1 || TREE_CODE (op1) != INTEGER_CST))
break;
- value = expand_expr (op1, NULL_RTX, str_mode, 0);
+ value = expand_expr (op1, NULL_RTX, str_mode, EXPAND_NORMAL);
value = convert_modes (str_mode,
TYPE_MODE (TREE_TYPE (op1)), value,
TYPE_UNSIGNED (TREE_TYPE (op1)));
@@ -4029,7 +4034,7 @@ optimize_bitfield_assignment_op (unsigned HOST_WIDE_INT bitsize,
case BIT_XOR_EXPR:
if (TREE_CODE (op1) != INTEGER_CST)
break;
- value = expand_expr (op1, NULL_RTX, GET_MODE (str_rtx), 0);
+ value = expand_expr (op1, NULL_RTX, GET_MODE (str_rtx), EXPAND_NORMAL);
value = convert_modes (GET_MODE (str_rtx),
TYPE_MODE (TREE_TYPE (op1)), value,
TYPE_UNSIGNED (TREE_TYPE (op1)));
@@ -4253,7 +4258,7 @@ expand_assignment (tree to, tree from)
rtx temp;
push_temp_slots ();
- temp = expand_expr (from, 0, GET_MODE (to_rtx), 0);
+ temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL);
if (GET_CODE (to_rtx) == PARALLEL)
emit_group_load (to_rtx, temp, TREE_TYPE (from),
@@ -4329,7 +4334,7 @@ store_expr (tree exp, rtx target, int call_param_p)
branch and an rvalue in the other. Here, we resolve attempts to
store the throw expression's nonexistent result. */
gcc_assert (!call_param_p);
- expand_expr (exp, const0_rtx, VOIDmode, 0);
+ expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
return NULL_RTX;
}
if (TREE_CODE (exp) == COMPOUND_EXPR)
@@ -5525,7 +5530,7 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
/* If we have nothing to store, do nothing unless the expression has
side-effects. */
if (bitsize == 0)
- return expand_expr (exp, const0_rtx, VOIDmode, 0);
+ return expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
else if (bitsize >= 0 && bitsize < HOST_BITS_PER_WIDE_INT)
width_mask = ((HOST_WIDE_INT) 1 << bitsize) - 1;
@@ -6631,7 +6636,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
if (modifier != EXPAND_NORMAL)
result = force_operand (result, NULL);
- tmp = expand_expr (offset, NULL, tmode, EXPAND_NORMAL);
+ tmp = expand_expr (offset, NULL_RTX, tmode, EXPAND_NORMAL);
result = convert_memory_address (tmode, result);
tmp = convert_memory_address (tmode, tmp);
@@ -7112,8 +7117,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
itarg = XEXP (original_target, 1);
/* Move the real and imaginary parts separately. */
- op0 = expand_expr (TREE_REALPART (exp), rtarg, mode, 0);
- op1 = expand_expr (TREE_IMAGPART (exp), itarg, mode, 0);
+ op0 = expand_expr (TREE_REALPART (exp), rtarg, mode, EXPAND_NORMAL);
+ op1 = expand_expr (TREE_IMAGPART (exp), itarg, mode, EXPAND_NORMAL);
if (op0 != rtarg)
emit_move_insn (rtarg, op0);
@@ -7183,7 +7188,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
tree value;
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)
- expand_expr (value, const0_rtx, VOIDmode, 0);
+ expand_expr (value, const0_rtx, VOIDmode, EXPAND_NORMAL);
return const0_rtx;
}
@@ -8011,7 +8016,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
TREE_OPERAND (subsubexp1, 0),
NULL_RTX, &op0, &op1, EXPAND_NORMAL);
op2 = expand_expr (TREE_OPERAND (exp, 1), subtarget,
- VOIDmode, 0);
+ VOIDmode, EXPAND_NORMAL);
temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
target, unsignedp);
gcc_assert (temp);
@@ -8134,6 +8139,47 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return REDUCE_BIT_FIELD (simplify_gen_binary (PLUS, mode, op0, op1));
case MINUS_EXPR:
+ /* Check if this is a case for multiplication and subtraction. */
+ if (TREE_CODE (type) == INTEGER_TYPE
+ && TREE_CODE (TREE_OPERAND (exp, 1)) == MULT_EXPR)
+ {
+ tree subsubexp0, subsubexp1;
+ enum tree_code code0, code1;
+
+ subexp1 = TREE_OPERAND (exp, 1);
+ subsubexp0 = TREE_OPERAND (subexp1, 0);
+ subsubexp1 = TREE_OPERAND (subexp1, 1);
+ code0 = TREE_CODE (subsubexp0);
+ code1 = TREE_CODE (subsubexp1);
+ if (code0 == NOP_EXPR && code1 == NOP_EXPR
+ && (TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (subsubexp0, 0)))
+ < TYPE_PRECISION (TREE_TYPE (subsubexp0)))
+ && (TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (subsubexp0, 0)))
+ == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (subsubexp1, 0))))
+ && (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (subsubexp0, 0)))
+ == TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (subsubexp1, 0)))))
+ {
+ tree op0type = TREE_TYPE (TREE_OPERAND (subsubexp0, 0));
+ enum machine_mode innermode = TYPE_MODE (op0type);
+ bool zextend_p = TYPE_UNSIGNED (op0type);
+ this_optab = zextend_p ? umsub_widen_optab : smsub_widen_optab;
+ if (mode == GET_MODE_2XWIDER_MODE (innermode)
+ && (this_optab->handlers[(int) mode].insn_code
+ != CODE_FOR_nothing))
+ {
+ expand_operands (TREE_OPERAND (subsubexp0, 0),
+ TREE_OPERAND (subsubexp1, 0),
+ NULL_RTX, &op0, &op1, EXPAND_NORMAL);
+ op2 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
+ VOIDmode, EXPAND_NORMAL);
+ temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
+ target, unsignedp);
+ gcc_assert (temp);
+ return REDUCE_BIT_FIELD (temp);
+ }
+ }
+ }
+
/* For initializers, we are allowed to return a MINUS of two
symbolic constants. Here we handle all cases when both operands
are constant. */
@@ -8370,7 +8416,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target;
case NEGATE_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
+ op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
+ VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM)
target = 0;
temp = expand_unop (mode,
@@ -8380,7 +8427,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return REDUCE_BIT_FIELD (temp);
case ABS_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
+ op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
+ VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM)
target = 0;
@@ -8512,7 +8560,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target;
case BIT_NOT_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
+ op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
+ VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM)
target = 0;
temp = expand_unop (mode, one_cmpl_optab, op0, target, 1);
@@ -8555,7 +8604,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
subtarget = 0;
if (modifier == EXPAND_STACK_PARM)
target = 0;
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
+ op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
+ VOIDmode, EXPAND_NORMAL);
return expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target,
unsignedp);
@@ -8589,7 +8639,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
== TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)))))
{
temp = expand_expr (TREE_OPERAND (exp, 0), original_target,
- VOIDmode, 0);
+ VOIDmode, EXPAND_NORMAL);
/* If temp is constant, we can just compute the result. */
if (GET_CODE (temp) == CONST_INT)
@@ -8648,7 +8698,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case TRUTH_NOT_EXPR:
if (modifier == EXPAND_STACK_PARM)
target = 0;
- op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, 0);
+ op0 = expand_expr (TREE_OPERAND (exp, 0), target,
+ VOIDmode, EXPAND_NORMAL);
/* The parser is careful to generate TRUTH_NOT_EXPR
only with operands that are always zero or one. */
temp = expand_binop (mode, xor_optab, op0, const1_rtx,
@@ -8948,7 +8999,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_UNPACK_HI_EXPR:
case VEC_UNPACK_LO_EXPR:
{
- op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
+ op0 = expand_normal (TREE_OPERAND (exp, 0));
this_optab = optab_for_tree_code (code, type);
temp = expand_widen_pattern_expr (exp, op0, NULL_RTX, NULL_RTX,
target, unsignedp);
@@ -8956,6 +9007,21 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return temp;
}
+ case VEC_UNPACK_FLOAT_HI_EXPR:
+ case VEC_UNPACK_FLOAT_LO_EXPR:
+ {
+ op0 = expand_normal (TREE_OPERAND (exp, 0));
+ /* The signedness is determined from input operand. */
+ this_optab = optab_for_tree_code (code,
+ TREE_TYPE (TREE_OPERAND (exp, 0)));
+ temp = expand_widen_pattern_expr
+ (exp, op0, NULL_RTX, NULL_RTX,
+ target, TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
+
+ gcc_assert (temp);
+ return temp;
+ }
+
case VEC_WIDEN_MULT_HI_EXPR:
case VEC_WIDEN_MULT_LO_EXPR:
{
@@ -8971,6 +9037,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
+ case VEC_PACK_FIX_TRUNC_EXPR:
{
mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
goto binop;
diff --git a/gcc/flags.h b/gcc/flags.h
index 98396f04091..07e5ec358b8 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -122,6 +122,15 @@ extern bool extra_warnings;
extern void set_Wunused (int setting);
+/* Used to set the level of -Wstrict-aliasing, when no level is specified.
+ The external way to set the default level is to use
+ -Wstrict-aliasing=level.
+ ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified,
+ and 0 otherwise. After calling this function, wstrict_aliasing will be
+ set to the default value of -Wstrict_aliasing=level. */
+
+extern void set_Wstrict_aliasing (int onoff);
+
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 2d9f752c5b3..c4c6edce9f7 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1411,7 +1411,7 @@ fold_negate_expr (tree t)
{
tree ntype = TYPE_UNSIGNED (type)
? lang_hooks.types.signed_type (type)
- : lang_hooks.types.unsigned_type (type);
+ : unsigned_type_for (type);
tree temp = fold_convert (ntype, TREE_OPERAND (t, 0));
temp = fold_build2 (RSHIFT_EXPR, ntype, temp, op1);
return fold_convert (type, temp);
@@ -4352,7 +4352,7 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high)
{
if (! TYPE_UNSIGNED (etype))
{
- etype = lang_hooks.types.unsigned_type (etype);
+ etype = unsigned_type_for (etype);
high = fold_convert (etype, high);
exp = fold_convert (etype, exp);
}
@@ -4420,7 +4420,7 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high)
/* Check if (unsigned) INT_MAX + 1 == (unsigned) INT_MIN
for the type in question, as we rely on this here. */
- utype = lang_hooks.types.unsigned_type (etype);
+ utype = unsigned_type_for (etype);
maxv = fold_convert (utype, TYPE_MAX_VALUE (etype));
maxv = range_binop (PLUS_EXPR, NULL_TREE, maxv, 1,
integer_one_node, 1);
@@ -7798,7 +7798,7 @@ fold_unary (enum tree_code code, tree type, tree op0)
&& (LOAD_EXTEND_OP (TYPE_MODE (TREE_TYPE (and0)))
== ZERO_EXTEND))
{
- tree uns = lang_hooks.types.unsigned_type (TREE_TYPE (and0));
+ tree uns = unsigned_type_for (TREE_TYPE (and0));
and0 = fold_convert (uns, and0);
and1 = fold_convert (uns, and1);
}
@@ -7814,24 +7814,20 @@ fold_unary (enum tree_code code, tree type, tree op0)
}
}
- /* Convert (T1)((T2)X op Y) into (T1)X op Y, for pointer types T1 and
- T2 being pointers to types of the same size. */
- if (POINTER_TYPE_P (type)
+ /* Convert (T1)(X op Y) into ((T1)X op (T1)Y), for pointer type,
+ when one of the new casts will fold away. Conservatively we assume
+ that this happens when X or Y is NOP_EXPR or Y is INTEGER_CST. */
+ if (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE (arg0))
&& BINARY_CLASS_P (arg0)
- && TREE_CODE (TREE_OPERAND (arg0, 0)) == NOP_EXPR
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (arg0, 0))))
+ && (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
+ || TREE_CODE (TREE_OPERAND (arg0, 0)) == NOP_EXPR
+ || TREE_CODE (TREE_OPERAND (arg0, 1)) == NOP_EXPR))
{
tree arg00 = TREE_OPERAND (arg0, 0);
- tree t0 = type;
- tree t1 = TREE_TYPE (arg00);
- tree tt0 = TREE_TYPE (t0);
- tree tt1 = TREE_TYPE (t1);
- tree s0 = TYPE_SIZE (tt0);
- tree s1 = TYPE_SIZE (tt1);
+ tree arg01 = TREE_OPERAND (arg0, 1);
- if (s0 && s1 && operand_equal_p (s0, s1, OEP_ONLY_CONST))
- return build2 (TREE_CODE (arg0), t0, fold_convert (t0, arg00),
- TREE_OPERAND (arg0, 1));
+ return fold_build2 (TREE_CODE (arg0), type, fold_convert (type, arg00),
+ fold_convert (type, arg01));
}
/* Convert (T1)(~(T2)X) into ~(T1)X if T1 and T2 are integral types
@@ -11224,7 +11220,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
|| TREE_CODE (arg0) == ROUND_MOD_EXPR)
&& integer_pow2p (TREE_OPERAND (arg0, 1)))
{
- tree newtype = lang_hooks.types.unsigned_type (TREE_TYPE (arg0));
+ tree newtype = unsigned_type_for (TREE_TYPE (arg0));
tree newmod = fold_build2 (TREE_CODE (arg0), newtype,
fold_convert (newtype,
TREE_OPERAND (arg0, 0)),
@@ -12333,7 +12329,7 @@ fold_ternary (enum tree_code code, tree type, tree op0, tree op1, tree op2)
else if ((TREE_INT_CST_HIGH (arg1) & mask_hi) == 0
&& (TREE_INT_CST_LOW (arg1) & mask_lo) == 0)
{
- tem_type = lang_hooks.types.unsigned_type (TREE_TYPE (tem));
+ tem_type = unsigned_type_for (TREE_TYPE (tem));
tem = fold_convert (tem_type, tem);
}
else
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 66e61587fc0..08c9d33a0d1 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,6 +1,248 @@
+2007-05-18 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/24633
+ * symbol.c (gfc_add_flavor): Add the NAME to error message if
+ available.
+
+2007-05-15 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/31919
+ PR fortran/31929
+ PR fortran/31930
+ * intrinsic.c (check_specific): Check elemental intrinsics for
+ rank and shape.
+ (add_functions): Fixed dummy argument names of BESJN and BESYN.
+ Fixed elemental status of MCLOCK and MCLOCK8.
+ * check.c (check_rest): Added check for array conformance.
+ (gfc_check_merge): Removed check for array conformance.
+ (gfc_check_besn): Removed check for scalarity.
+ * intrinsic.texi (CSHIFT, EOSHIFT): Fixed typos.
+ (BESJN, BESYN): Clarified documentation.
+
+2007-05-17 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.texi (GFORTRAN_CONVERT_UNIT): Improve documentation.
+
+2007-05-16 Brooks Moses <brooks.moses@codesourcery.com>
+
+ PR fortran/18769
+ PR fortran/30881
+ PR fortran/31194
+ PR fortran/31216
+ PR fortran/31427
+ * target-memory.c: New file.
+ * target-memory.h: New file.
+ * simplify.c: Add #include "target-memory.h".
+ (gfc_simplify_transfer): Implement constant-
+ folding for TRANSFER intrinsic.
+ * Make-lang.in: Add dependencies on new target-memory.* files.
+
+2007-05-15 Paul Brook <paul@codesourcery.com>
+
+ * trans-types.c (gfc_type_for_size): Handle signed TImode.
+
+2007-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/30723
+ * trans.h (gfor_fndecl_internal_malloc, gfor_fndecl_internal_malloc64,
+ gfor_fndecl_internal_free): Remove prototypes.
+ (gfor_fndecl_os_error, gfc_call_free, gfc_call_malloc): Add prototypes.
+ * trans.c (gfc_call_malloc, gfc_call_free): New functions.
+ * f95-lang.c (gfc_init_builtin_functions): Add __builtin_free
+ and __builtin_malloc builtins.
+ * trans-decl.c (gfor_fndecl_internal_malloc,
+ gfor_fndecl_internal_malloc64, gfor_fndecl_internal_free): Remove.
+ (gfor_fndecl_os_error): Add.
+ (gfc_build_builtin_function_decls): Don't create internal_malloc,
+ internal_malloc64 and internal_free library function declaration.
+ Create os_error library call function declaration.
+ * trans-array.c (gfc_trans_allocate_array_storage,
+ gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
+ gfc_conv_array_parameter, gfc_duplicate_allocatable): Use
+ gfc_call_malloc and gfc_call_free instead of building calls to
+ internal_malloc and internal_free.
+ * trans-expr.c (gfc_conv_string_tmp): Likewise.
+ * trans-stmt.c (gfc_do_allocate, gfc_trans_assign_need_temp,
+ gfc_trans_pointer_assign_need_temp, gfc_trans_forall_1,
+ gfc_trans_where_2: Likewise.
+ * trans-intrinsic.c (gfc_conv_intrinsic_ctime,
+ gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
+ gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_trim): Likewise.
+
+2007-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31725
+ * trans-expr.c (gfc_conv_substring): Evaluate substring bounds
+ only once.
+
+2007-05-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * f95-lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+ * trans-intrinsic.c (gfc_conv_intrinsic_ishft): Use unsigned_type_for
+ instead of gfc_unsigned_type.
+ * trans-stmt.c (gfc_trans_do): Use unsigned_type_for instead of
+ gfc_unsigned_type.
+ * trans-types.c (gfc_unsigned_type): Remove.
+ * trans-types.h (gfc_unsigned_type): Remove.
+
+2007-05-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30746
+ * resolve.c (check_host_association): New function that detects
+ incorrect host association and corrects it.
+ (gfc_resolve_expr): Call the new function for variables and
+ functions.
+ * match.h : Remove prototype for gfc_match_rvalue.
+ * gfortran.h : Add prototype for gfc_match_rvalue.
+
+2007-05-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30876
+ * trans-expr.c (gfc_conv_function_call): Reduce indirection for
+ direct assignments of recursive array valued functions.
+ * primary.c (gfc_match_rvalue): Correct error for recursive
+ function calls such that directly recursive calls of scalar
+ function without an explicit result are disallowed.
+
+2007-05-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30878
+ * resolve.c (resolve_fl_namelist): It is not an error if the
+ namelist element is the result variable of the enclosing
+ function. Search for the symbol in current and all parent
+ namespaces for a potential conflict.
+ * symbol.c (check_conflict): Remove the conflict between
+ 'in_namelist' and 'FL_PROCEDURE' because the symbol info
+ is not available to exclude function result variables.
+ * trans-io.c (nml_get_addr_expr): Use the fake result decl
+ if the symbol is an implicit result variable.
+
+2007-05-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31474
+ * decl.c (get_proc_name): If an entry has already been declared
+ as a module procedure, pick up the symbol and the symtree and
+ use them for the entry.
+
+2007-05-08 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31630
+ * resolve.c (resolve_symbol): Remove the flagging mechanism from the
+ formal namespace resolution and instead check that the formal
+ namespace is not the current namespace.
+
+2007-05-08 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31692
+ * trans-array.c (gfc_conv_array_parameter): Convert full array
+ references to the result of the procedure enclusing the call.
+
+2007-05-08 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29397
+ PR fortran/29400
+ * decl.c (add_init_expr_to_sym): Expand a scalar initializer
+ for a parameter array into an array expression with the right
+ shape.
+ * array.c (spec_dimen_size): Remove static attribute.
+ * gfortran.h : Prototype for spec_dimen_size.
+
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31399
+ * trans-stmt.c (gfc_trans_do): Handle large loop counts.
+
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31764
+ * simplify.c (gfc_simplify_new_line): NEW_LINE can be simplified
+ even for non constant arguments.
+
+2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31201
+ * gfortran.h: Add runtime error codes from libgfortran.h. Define
+ MAX_UNIT_NUMBER.
+ * trans.c (gfc_trans_runtime_check): Update the format of runtime error
+ messages to match library runtime errors. Use call to new library
+ function runtime_error_at().
+ * trans.h: Add prototype for new function gfc_trans_io_runtime_check.
+ Add declaration for library functions runtime_error_at and
+ generate_error.
+ * trans_io.c (gfc_trans_io_runtime_check): New function.
+ (set_parameter_value): Add error checking for UNIT numbers.
+ (set_parameter_ref): Initialize the users variable to zero.
+ (gfc_trans_open): Move setting of unit number to after setting of common
+ flags so that runtime error trapping can be detected.
+ (gfc_trans_close): Likewise. (build_filepos): Likewise.
+ (gfc_trans_inquire): Likewise. (build_dt): Likewise.
+ * trans-decl.c: Add declarations for runtime_error_at and
+ generate_error. (gfc_build_builtin_function_decls): Build function
+ declarations for runtime_error_at and generate_error.
+
+2007-05-06 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31540
+ * resolve.c (resolve_fl_procedure): Resolve constant character
+ lengths.
+
+2007-05-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/31251
+ * decl.c (match_char_spec): Add check for invalid character lengths.
+
+2007-05-04 Brooks Moses <brooks.moses@codesourcery.com>
+
+ * intrinsic.texi (CMPLX): Document result kind.
+ (COMPLEX): Add documentation.
+
+2007-05-04 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/31760
+ * intrinsic.c (add_functions): Replaced calls to gfc_check_g77_math1
+ by gfc_check_fn_r to avoid checks for scalarity.
+ * check.c (gfc_check_besn): Removed check for scalarity.
+ (gfc_check_g77_math1): Removed.
+ * intrinsic.h (gfc_check_g77_math1): Removed.
+
+2007-05-04 Daniel Franke <franke.daniel@gmail.com>
+
+ * check.c (gfc_check_fseek_sub): Fixed typo.
+
+2007-05-04 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/22359
+ * intrinsic.c (add_subroutines): Added FSEEK.
+ * intrinsic.h (gfc_resolve_fseek_sub, gfc_check_fseek_sub): New.
+ * iresolve.c (gfc_resolve_fseek_sub): New.
+ * check.c (gfc_check_fseek_sub): New.
+ * intrinsic.texi (FSEEK): Updated.
+
+2007-05-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/31803
+ * expr.c (gfc_check_pointer_assign): Check for NULL pointer.
+
+2007-05-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/31251
+ * simplify.c (gfc_simplify_len): Only simplify integer lengths.
+
+2007-05-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31781
+ * simplify.c (gfc_simplify_repeat): Don't put function call with
+ side effect in a gcc_assert().
+
+2007-05-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/25071
+ * interface.c (compare_actual_formal): Check character length.
+
2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
- PR fortran/31732
+ PR fortran/31732
* dependency.c (gfc_full_array_ref_p): If the reference is
to a single element, check that the array has a single
element and that the correct element is referenced.
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index 4c707716b42..f9053dc519e 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -66,7 +66,7 @@ F95_PARSER_OBJS = fortran/arith.o fortran/array.o fortran/bbt.o \
fortran/match.o fortran/matchexp.o fortran/misc.o fortran/module.o \
fortran/openmp.o fortran/options.o fortran/parse.o fortran/primary.o \
fortran/resolve.o fortran/scanner.o fortran/simplify.o fortran/st.o \
- fortran/symbol.o
+ fortran/symbol.o fortran/target-memory.o
F95_OBJS = $(F95_PARSER_OBJS) \
fortran/convert.o fortran/dependency.o fortran/f95-lang.o \
@@ -297,7 +297,7 @@ fortran.stagefeedback: stageprofile-start
# TODO: Add dependencies on the backend/tree header files
$(F95_PARSER_OBJS): fortran/gfortran.h fortran/intrinsic.h fortran/match.h \
- fortran/parse.h \
+ fortran/parse.h fortran/arith.h fortran/target-memory.h \
$(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TM_P_H) coretypes.h \
$(RTL_H) $(TREE_H) $(TREE_DUMP_H) $(GGC_H) $(EXPR_H) \
$(FLAGS_H) output.h $(DIAGNOSTIC_H) errors.h $(FUNCTION_H)
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 895bccc14d1..9359624efec 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -1714,7 +1714,7 @@ gfc_get_array_element (gfc_expr *array, int element)
/* Get the size of single dimension of an array specification. The
array is guaranteed to be one dimensional. */
-static try
+try
spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
{
if (as == NULL)
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 9806ebdf79a..4c0a5920b55 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -649,15 +649,9 @@ gfc_check_atan2 (gfc_expr *y, gfc_expr *x)
try
gfc_check_besn (gfc_expr *n, gfc_expr *x)
{
- if (scalar_check (n, 0) == FAILURE)
- return FAILURE;
-
if (type_check (n, 0, BT_INTEGER) == FAILURE)
return FAILURE;
- if (scalar_check (x, 1) == FAILURE)
- return FAILURE;
-
if (type_check (x, 1, BT_REAL) == FAILURE)
return FAILURE;
@@ -1037,22 +1031,6 @@ gfc_check_fnum (gfc_expr *unit)
}
-/* This is used for the g77 one-argument Bessel functions, and the
- error function. */
-
-try
-gfc_check_g77_math1 (gfc_expr *x)
-{
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
-
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
-
- return SUCCESS;
-}
-
-
try
gfc_check_huge (gfc_expr *x)
{
@@ -1510,14 +1488,16 @@ min_max_args (gfc_actual_arglist *arg)
static try
check_rest (bt type, int kind, gfc_actual_arglist *arg)
{
- gfc_expr *x;
+ gfc_expr *x, *first_arg;
int n;
+ char buffer[80];
if (min_max_args (arg) == FAILURE)
return FAILURE;
n = 1;
+ first_arg = arg->expr;
for (; arg; arg = arg->next, n++)
{
x = arg->expr;
@@ -1537,6 +1517,12 @@ check_rest (bt type, int kind, gfc_actual_arglist *arg)
return FAILURE;
}
}
+
+ snprintf (buffer, 80, "arguments '%s' and '%s' for intrinsic '%s'",
+ gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[n-1],
+ gfc_current_intrinsic);
+ if (gfc_check_conformance (buffer, first_arg, x) == FAILURE)
+ return FAILURE;
}
return SUCCESS;
@@ -1816,26 +1802,12 @@ gfc_check_product_sum (gfc_actual_arglist *ap)
try
gfc_check_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
{
- char buffer[80];
-
if (same_type_check (tsource, 0, fsource, 1) == FAILURE)
return FAILURE;
if (type_check (mask, 2, BT_LOGICAL) == FAILURE)
return FAILURE;
- snprintf (buffer, 80, "arguments '%s' and '%s' for intrinsic '%s'",
- gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[1],
- gfc_current_intrinsic);
- if (gfc_check_conformance (buffer, tsource, fsource) == FAILURE)
- return FAILURE;
-
- snprintf (buffer, 80, "arguments '%s' and '%s' for intrinsic '%s'",
- gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[2],
- gfc_current_intrinsic);
- if (gfc_check_conformance (buffer, tsource, mask) == FAILURE)
- return FAILURE;
-
return SUCCESS;
}
@@ -2461,6 +2433,44 @@ gfc_check_fgetput (gfc_expr *c)
try
+gfc_check_fseek_sub (gfc_expr *unit, gfc_expr *offset, gfc_expr *whence, gfc_expr *status)
+{
+ if (type_check (unit, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (unit, 0) == FAILURE)
+ return FAILURE;
+
+ if (type_check (offset, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (offset, 1) == FAILURE)
+ return FAILURE;
+
+ if (type_check (whence, 2, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (whence, 2) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (type_check (status, 3, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (kind_value_check (status, 3, 4) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (status, 3) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+
+try
gfc_check_fstat (gfc_expr *unit, gfc_expr *array)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 7665bc838e9..9eeacc09427 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -671,7 +671,12 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
space is set to point to the master function, so that the fake
result mechanism can work. */
if (module_fcn_entry)
- rc = gfc_get_symbol (name, NULL, result);
+ {
+ /* Present if entry is declared to be a module procedure. */
+ rc = gfc_find_symbol (name, gfc_current_ns->parent, 0, result);
+ if (*result == NULL)
+ rc = gfc_get_symbol (name, NULL, result);
+ }
else
rc = gfc_get_symbol (name, gfc_current_ns->parent, result);
@@ -712,7 +717,12 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
/* Module function entries will already have a symtree in
the current namespace but will need one at module level. */
if (module_fcn_entry)
- st = gfc_new_symtree (&gfc_current_ns->parent->sym_root, name);
+ {
+ /* Present if entry is declared to be a module procedure. */
+ rc = gfc_find_sym_tree (name, gfc_current_ns->parent, 0, &st);
+ if (st == NULL)
+ st = gfc_new_symtree (&gfc_current_ns->parent->sym_root, name);
+ }
else
st = gfc_new_symtree (&gfc_current_ns->sym_root, name);
@@ -722,10 +732,11 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
/* See if the procedure should be a module procedure */
if (((sym->ns->proc_name != NULL
- && sym->ns->proc_name->attr.flavor == FL_MODULE
- && sym->attr.proc != PROC_MODULE) || module_fcn_entry)
- && gfc_add_procedure (&sym->attr, PROC_MODULE,
- sym->name, NULL) == FAILURE)
+ && sym->ns->proc_name->attr.flavor == FL_MODULE
+ && sym->attr.proc != PROC_MODULE)
+ || (module_fcn_entry && sym->attr.proc != PROC_MODULE))
+ && gfc_add_procedure (&sym->attr, PROC_MODULE,
+ sym->name, NULL) == FAILURE)
rc = 2;
return rc;
@@ -974,7 +985,44 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp,
/* Add initializer. Make sure we keep the ranks sane. */
if (sym->attr.dimension && init->rank == 0)
- init->rank = sym->as->rank;
+ {
+ mpz_t size;
+ gfc_expr *array;
+ gfc_constructor *c;
+ int n;
+ if (sym->attr.flavor == FL_PARAMETER
+ && init->expr_type == EXPR_CONSTANT
+ && spec_size (sym->as, &size) == SUCCESS
+ && mpz_cmp_si (size, 0) > 0)
+ {
+ array = gfc_start_constructor (init->ts.type, init->ts.kind,
+ &init->where);
+
+ array->value.constructor = c = NULL;
+ for (n = 0; n < (int)mpz_get_si (size); n++)
+ {
+ if (array->value.constructor == NULL)
+ {
+ array->value.constructor = c = gfc_get_constructor ();
+ c->expr = init;
+ }
+ else
+ {
+ c->next = gfc_get_constructor ();
+ c = c->next;
+ c->expr = gfc_copy_expr (init);
+ }
+ }
+
+ array->shape = gfc_get_shape (sym->as->rank);
+ for (n = 0; n < sym->as->rank; n++)
+ spec_dimen_size (sym->as, n, &array->shape[n]);
+
+ init = array;
+ mpz_clear (size);
+ }
+ init->rank = sym->as->rank;
+ }
sym->value = init;
*initp = NULL;
@@ -1626,14 +1674,23 @@ rparen:
syntax:
gfc_error ("Syntax error in CHARACTER declaration at %C");
m = MATCH_ERROR;
+ gfc_free_expr (len);
+ return m;
done:
- if (m == MATCH_YES && gfc_validate_kind (BT_CHARACTER, kind, true) < 0)
+ if (gfc_validate_kind (BT_CHARACTER, kind, true) < 0)
{
gfc_error ("Kind %d is not a CHARACTER kind at %C", kind);
m = MATCH_ERROR;
}
+ if (seen_length == 1 && len != NULL
+ && len->ts.type != BT_INTEGER && len->ts.type != BT_UNKNOWN)
+ {
+ gfc_error ("Expression at %C must be of INTEGER type");
+ m = MATCH_ERROR;
+ }
+
if (m != MATCH_YES)
{
gfc_free_expr (len);
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index a408229242d..9957a4629a0 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2553,6 +2553,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
return SUCCESS;
if (lvalue->ts.type == BT_CHARACTER
+ && lvalue->ts.cl && rvalue->ts.cl
&& lvalue->ts.cl->length && rvalue->ts.cl->length
&& abs (gfc_dep_compare_expr (lvalue->ts.cl->length,
rvalue->ts.cl->length)) == 1)
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 4995e4c5432..06cea98d73a 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -113,7 +113,6 @@ static HOST_WIDE_INT gfc_get_alias_set (tree);
#undef LANG_HOOKS_MARK_ADDRESSABLE
#undef LANG_HOOKS_TYPE_FOR_MODE
#undef LANG_HOOKS_TYPE_FOR_SIZE
-#undef LANG_HOOKS_UNSIGNED_TYPE
#undef LANG_HOOKS_SIGNED_TYPE
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#undef LANG_HOOKS_CLEAR_BINDING_STACK
@@ -138,7 +137,6 @@ static HOST_WIDE_INT gfc_get_alias_set (tree);
#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable
#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode
#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size
-#define LANG_HOOKS_UNSIGNED_TYPE gfc_unsigned_type
#define LANG_HOOKS_SIGNED_TYPE gfc_signed_type
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gfc_expand_function
#define LANG_HOOKS_CLEAR_BINDING_STACK gfc_clear_binding_stack
@@ -990,6 +988,17 @@ gfc_init_builtin_functions (void)
gfc_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT,
"__builtin_expect", true);
+ tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node);
+ ftype = build_function_type (void_type_node, tmp);
+ gfc_define_builtin ("__builtin_free", ftype, BUILT_IN_FREE,
+ "free", false);
+
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ ftype = build_function_type (pvoid_type_node, tmp);
+ gfc_define_builtin ("__builtin_malloc", ftype, BUILT_IN_MALLOC,
+ "malloc", false);
+ DECL_IS_MALLOC (built_in_decls[BUILT_IN_MALLOC]) = 1;
+
#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
builtin_types[(int) ENUM] = VALUE;
#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 039c1ee9c20..38ef1a6d319 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -472,6 +472,39 @@ enum gfc_generic_isym_id
};
typedef enum gfc_generic_isym_id gfc_generic_isym_id;
+/* Runtime errors. The EOR and EOF errors are required to be negative.
+ These codes must be kept synchronized with their equivalents in
+ libgfortran/libgfortran.h . */
+
+typedef enum
+{
+ IOERROR_FIRST = -3, /* Marker for the first error. */
+ IOERROR_EOR = -2,
+ IOERROR_END = -1,
+ IOERROR_OK = 0, /* Indicates success, must be zero. */
+ IOERROR_OS = 5000, /* Operating system error, more info in errno. */
+ IOERROR_OPTION_CONFLICT,
+ IOERROR_BAD_OPTION,
+ IOERROR_MISSING_OPTION,
+ IOERROR_ALREADY_OPEN,
+ IOERROR_BAD_UNIT,
+ IOERROR_FORMAT,
+ IOERROR_BAD_ACTION,
+ IOERROR_ENDFILE,
+ IOERROR_BAD_US,
+ IOERROR_READ_VALUE,
+ IOERROR_READ_OVERFLOW,
+ IOERROR_INTERNAL,
+ IOERROR_INTERNAL_UNIT,
+ IOERROR_ALLOCATION,
+ IOERROR_DIRECT_EOR,
+ IOERROR_SHORT_RECORD,
+ IOERROR_CORRUPT_FILE,
+ IOERROR_LAST /* Not a real error, the last error # + 1. */
+}
+ioerror_codes;
+
+
/************************* Structures *****************************/
/* Used for keeping things in balanced binary trees. */
@@ -2088,6 +2121,7 @@ void gfc_insert_constructor (gfc_expr *, gfc_constructor *);
gfc_constructor *gfc_get_constructor (void);
tree gfc_conv_array_initializer (tree type, gfc_expr * expr);
try spec_size (gfc_array_spec *, mpz_t *);
+try spec_dimen_size (gfc_array_spec *, int, mpz_t *);
int gfc_is_compile_time_shape (gfc_array_spec *);
/* interface.c -- FIXME: some of these should be in symbol.c */
@@ -2126,6 +2160,7 @@ bool gfc_check_access (gfc_access, gfc_access);
/* primary.c */
symbol_attribute gfc_variable_attr (gfc_expr *, gfc_typespec *);
symbol_attribute gfc_expr_attr (gfc_expr *);
+match gfc_match_rvalue (gfc_expr **);
/* trans.c */
void gfc_generate_code (gfc_namespace *);
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 819651b1f05..6b604afe462 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -611,7 +611,7 @@ By setting the @env{GFORTRAN_CONVERT_UNIT} variable, it is possible
to change the representation of data for unformatted files.
The syntax for the @env{GFORTRAN_CONVERT_UNIT} variable is:
@smallexample
-GFORTRAN_CONVERT_UNIT: mode | mode ';' exception ;
+GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
exception: mode ':' unit_list | unit_list ;
unit_list: unit_spec | unit_list unit_spec ;
@@ -668,6 +668,11 @@ data representation for unformatted files. @xref{Runtime Options}, for
setting a default data representation for the whole program. The
@code{CONVERT} specifier overrides the @option{-fconvert} compile options.
+@emph{Note that the values specified via the GFORTRAN_CONVERT_UNIT
+environment variable will override the CONVERT specifier in the
+open statement}. This is to give control over data formats to
+users who do not have the source code of their program available.
+
@c =====================================================================
@c PART II: LANGUAGE REFERENCE
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 1672b1c3abc..22a39b5246b 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1369,6 +1369,34 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
return 0;
}
+ if (a->expr->ts.type == BT_CHARACTER
+ && a->expr->ts.cl && a->expr->ts.cl->length
+ && a->expr->ts.cl->length->expr_type == EXPR_CONSTANT
+ && f->sym->ts.cl && f->sym->ts.cl && f->sym->ts.cl->length
+ && f->sym->ts.cl->length->expr_type == EXPR_CONSTANT)
+ {
+ if (mpz_cmp (a->expr->ts.cl->length->value.integer,
+ f->sym->ts.cl->length->value.integer) < 0)
+ {
+ if (where)
+ gfc_error ("Character length of actual argument shorter "
+ "than of dummy argument '%s' at %L",
+ f->sym->name, &a->expr->where);
+ return 0;
+ }
+
+ if ((f->sym->attr.pointer || f->sym->attr.allocatable)
+ && (mpz_cmp (a->expr->ts.cl->length->value.integer,
+ f->sym->ts.cl->length->value.integer) != 0))
+ {
+ if (where)
+ gfc_error ("Character length mismatch between actual argument "
+ "and pointer or allocatable dummy argument "
+ "'%s' at %L", f->sym->name, &a->expr->where);
+ return 0;
+ }
+ }
+
/* Satisfy 12.4.1.2 by ensuring that a procedure actual argument is
provided for a procedure formal argument. */
if (a->expr->ts.type != BT_PROCEDURE
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index de74678d268..d64f77f94fa 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -896,7 +896,7 @@ add_functions (void)
const char
*a = "a", *f = "field", *pt = "pointer", *tg = "target",
*b = "b", *m = "matrix", *ma = "matrix_a", *mb = "matrix_b",
- *c = "c", *n = "ncopies", *pos = "pos", *bck = "back",
+ *c = "c", *n = "n", *ncopies= "ncopies", *pos = "pos", *bck = "back",
*i = "i", *v = "vector", *va = "vector_a", *vb = "vector_b",
*j = "j", *a1 = "a1", *fs = "fsource", *ts = "tsource",
*l = "l", *a2 = "a2", *mo = "mold", *ord = "order",
@@ -1097,21 +1097,21 @@ add_functions (void)
/* Bessel and Neumann functions for G77 compatibility. */
add_sym_1 ("besj0", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dbesj0", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
make_generic ("besj0", GFC_ISYM_J0, GFC_STD_GNU);
add_sym_1 ("besj1", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dbesj1", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
make_generic ("besj1", GFC_ISYM_J1, GFC_STD_GNU);
@@ -1127,21 +1127,21 @@ add_functions (void)
make_generic ("besjn", GFC_ISYM_JN, GFC_STD_GNU);
add_sym_1 ("besy0", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dbesy0", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
make_generic ("besy0", GFC_ISYM_Y0, GFC_STD_GNU);
add_sym_1 ("besy1", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dbesy1", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
make_generic ("besy1", GFC_ISYM_Y1, GFC_STD_GNU);
@@ -1340,21 +1340,21 @@ add_functions (void)
/* G77 compatibility for the ERF() and ERFC() functions. */
add_sym_1 ("erf", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("derf", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
make_generic ("erf", GFC_ISYM_ERF, GFC_STD_GNU);
add_sym_1 ("erfc", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("derfc", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
- gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+ gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
make_generic ("erfc", GFC_ISYM_ERFC, GFC_STD_GNU);
@@ -1819,12 +1819,12 @@ add_functions (void)
make_generic ("maxval", GFC_ISYM_MAXVAL, GFC_STD_F95);
- add_sym_0 ("mclock", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_0 ("mclock", NOT_ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, gfc_resolve_mclock);
make_generic ("mclock", GFC_ISYM_MCLOCK, GFC_STD_GNU);
- add_sym_0 ("mclock8", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_0 ("mclock8", NOT_ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, gfc_resolve_mclock8);
make_generic ("mclock8", GFC_ISYM_MCLOCK8, GFC_STD_GNU);
@@ -2013,7 +2013,7 @@ add_functions (void)
add_sym_2 ("repeat", NOT_ELEMENTAL, ACTUAL_NO, BT_CHARACTER, dc, GFC_STD_F95,
gfc_check_repeat, gfc_simplify_repeat, gfc_resolve_repeat,
- stg, BT_CHARACTER, dc, REQUIRED, n, BT_INTEGER, di, REQUIRED);
+ stg, BT_CHARACTER, dc, REQUIRED, ncopies, BT_INTEGER, di, REQUIRED);
make_generic ("repeat", GFC_ISYM_REPEAT, GFC_STD_F95);
@@ -2147,7 +2147,7 @@ add_functions (void)
add_sym_3 ("spread", NOT_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
gfc_check_spread, NULL, gfc_resolve_spread,
src, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, REQUIRED,
- n, BT_INTEGER, di, REQUIRED);
+ ncopies, BT_INTEGER, di, REQUIRED);
make_generic ("spread", GFC_ISYM_SPREAD, GFC_STD_F95);
@@ -2313,7 +2313,8 @@ add_subroutines (void)
*com = "command", *length = "length", *st = "status",
*val = "value", *num = "number", *name = "name",
*trim_name = "trim_name", *ut = "unit", *han = "handler",
- *sec = "seconds", *res = "result", *of = "offset", *md = "mode";
+ *sec = "seconds", *res = "result", *of = "offset", *md = "mode",
+ *whence = "whence";
int di, dr, dc, dl, ii;
@@ -2489,6 +2490,11 @@ add_subroutines (void)
add_sym_1s ("free", NOT_ELEMENTAL, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_free,
NULL, gfc_resolve_free, c, BT_INTEGER, ii, REQUIRED);
+ add_sym_4s ("fseek", NOT_ELEMENTAL, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_fseek_sub, NULL, gfc_resolve_fseek_sub,
+ ut, BT_INTEGER, di, REQUIRED, of, BT_INTEGER, di, REQUIRED,
+ whence, BT_INTEGER, di, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
add_sym_2s ("ftell", NOT_ELEMENTAL, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ftell_sub, NULL, gfc_resolve_ftell_sub,
ut, BT_INTEGER, di, REQUIRED, of, BT_INTEGER, ii, REQUIRED);
@@ -3195,7 +3201,6 @@ static try
check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
{
gfc_actual_arglist *arg, **ap;
- int r;
try t;
ap = &expr->value.function.actual;
@@ -3236,26 +3241,25 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
t = do_check (specific, *ap);
}
- /* Check ranks for elemental intrinsics. */
+ /* Check conformance of elemental intrinsics. */
if (t == SUCCESS && specific->elemental)
{
- r = 0;
- for (arg = expr->value.function.actual; arg; arg = arg->next)
- {
- if (arg->expr == NULL || arg->expr->rank == 0)
- continue;
- if (r == 0)
- {
- r = arg->expr->rank;
- continue;
- }
+ int n = 0;
+ gfc_expr *first_expr;
+ arg = expr->value.function.actual;
- if (arg->expr->rank != r)
- {
- gfc_error ("Ranks of arguments to elemental intrinsic '%s' "
- "differ at %L", specific->name, &arg->expr->where);
- return FAILURE;
- }
+ /* There is no elemental intrinsic without arguments. */
+ gcc_assert(arg != NULL);
+ first_expr = arg->expr;
+
+ for ( ; arg && arg->expr; arg = arg->next, n++)
+ {
+ char buffer[80];
+ snprintf (buffer, 80, "arguments '%s' and '%s' for intrinsic '%s'",
+ gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[n],
+ gfc_current_intrinsic);
+ if (gfc_check_conformance (buffer, first_expr, arg->expr) == FAILURE)
+ return FAILURE;
}
}
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 46d49f7e744..d4a4fc5ce85 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -62,7 +62,6 @@ try gfc_check_fn_c (gfc_expr *);
try gfc_check_fn_r (gfc_expr *);
try gfc_check_fn_rc (gfc_expr *);
try gfc_check_fnum (gfc_expr *);
-try gfc_check_g77_math1 (gfc_expr *);
try gfc_check_hostnm (gfc_expr *);
try gfc_check_huge (gfc_expr *);
try gfc_check_i (gfc_expr *);
@@ -162,6 +161,7 @@ try gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_etime_sub (gfc_expr *, gfc_expr *);
try gfc_check_fgetputc_sub (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_fgetput_sub (gfc_expr *, gfc_expr *);
+try gfc_check_fseek_sub (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_ftell_sub (gfc_expr *, gfc_expr *);
try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *);
try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *);
@@ -456,6 +456,7 @@ void gfc_resolve_exit (gfc_code *);
void gfc_resolve_fdate_sub (gfc_code *);
void gfc_resolve_flush (gfc_code *);
void gfc_resolve_free (gfc_code *);
+void gfc_resolve_fseek_sub (gfc_code *);
void gfc_resolve_fstat_sub (gfc_code *);
void gfc_resolve_ftell_sub (gfc_code *);
void gfc_resolve_fgetc_sub (gfc_code *);
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index b71609b4dd4..52d09fba526 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -76,6 +76,7 @@ Some basic guidelines for editing this document:
* @code{CHMOD}: CHMOD, Change access permissions of files
* @code{CMPLX}: CMPLX, Complex conversion function
* @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Get number of command line arguments
+* @code{COMPLEX}: COMPLEX, Complex conversion function
* @code{CONJG}: CONJG, Complex conjugate function
* @code{COS}: COS, Cosine function
* @code{COSH}: COSH, Hyperbolic cosine function
@@ -1574,6 +1575,8 @@ end program test_besj1
@code{BESJN(N, X)} computes the Bessel function of the first kind of order
@var{N} of @var{X}.
+If both arguments are arrays, their ranks and shapes shall conform.
+
@item @emph{Standard}:
GNU extension
@@ -1585,8 +1588,8 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
-@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
+@item @var{N} @tab Shall be a scalar or an array of type @code{INTEGER(*)}.
+@item @var{X} @tab Shall be a scalar or an array of type @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
@@ -1711,6 +1714,8 @@ end program test_besy1
@code{BESYN(N, X)} computes the Bessel function of the second kind of order
@var{N} of @var{X}.
+If both arguments are arrays, their ranks and shapes shall conform.
+
@item @emph{Standard}:
GNU extension
@@ -1722,8 +1727,8 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
-@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
+@item @var{N} @tab Shall be a scalar or an array of type @code{INTEGER(*)}.
+@item @var{X} @tab Shall be a scalar or an array of type @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
@@ -2083,7 +2088,10 @@ Elemental function
@end multitable
@item @emph{Return value}:
-The return value is of type @code{COMPLEX(*)}
+The return value is of @code{COMPLEX} type, with a kind equal to
+@var{KIND} if it is specified. If @var{KIND} is not specified, the
+result is of the default @code{COMPLEX} kind, regardless of the kinds of
+@var{X} and @var{Y}.
@item @emph{Example}:
@smallexample
@@ -2095,6 +2103,9 @@ program test_cmplx
print *, z, cmplx(x)
end program test_cmplx
@end smallexample
+
+@item @emph{See also}:
+@ref{COMPLEX}
@end table
@@ -2143,6 +2154,57 @@ end program test_command_argument_count
+@node COMPLEX
+@section @code{COMPLEX} --- Complex conversion function
+@fnindex COMPLEX
+@cindex complex numbers, conversion to
+@cindex conversion, to complex
+
+@table @asis
+@item @emph{Description}:
+@code{COMPLEX(X, Y)} returns a complex number where @var{X} is converted
+to the real component and @var{Y} is converted to the imaginary
+component.
+
+@item @emph{Standard}:
+GNU extension
+
+@item @emph{Class}:
+Elemental function
+
+@item @emph{Syntax}:
+@code{RESULT = COMPLEX(X, Y)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
+@item @var{Y} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
+@end multitable
+
+@item @emph{Return value}:
+If @var{X} and @var{Y} are both of @code{INTEGER} type, then the return
+value is of default @code{COMPLEX} type.
+
+If @var{X} and @var{Y} are of @code{REAL} type, or one is of @code{REAL}
+type and one is of @code{INTEGER} type, then the return value is of
+@code{COMPLEX} type with a kind equal to that of the @code{REAL}
+argument with the highest precision.
+
+@item @emph{Example}:
+@smallexample
+program test_complex
+ integer :: i = 42
+ real :: x = 3.14
+ print *, complex(i, x)
+end program test_complex
+@end smallexample
+
+@item @emph{See also}:
+@ref{CMPLX}
+@end table
+
+
+
@node CONJG
@section @code{CONJG} --- Complex conjugate function
@fnindex CONJG
@@ -2429,14 +2491,14 @@ shifted out one end of each rank one section are shifted back in the other end.
F95 and later
@item @emph{Class}:
-transformational function
+Transformational function
@item @emph{Syntax}:
-@code{RESULT = CSHIFT(A, SHIFT [, DIM])}
+@code{RESULT = CSHIFT(ARRAY, SHIFT [, DIM])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{ARRAY} @tab May be any type, not scaler.
+@item @var{ARRAY} @tab Shall be an array of any type.
@item @var{SHIFT} @tab The type shall be @code{INTEGER}.
@item @var{DIM} @tab The type shall be @code{INTEGER}.
@end multitable
@@ -3062,10 +3124,10 @@ following are copied in depending on the type of @var{ARRAY}.
F95 and later
@item @emph{Class}:
-transformational function
+Transformational function
@item @emph{Syntax}:
-@code{RESULT = EOSHIFT(A, SHIFT [, BOUNDARY, DIM])}
+@code{RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -3966,10 +4028,31 @@ See @code{MALLOC} for an example.
@cindex file operation, seek
@cindex file operation, position
-Not yet implemented in GNU Fortran.
-
@table @asis
@item @emph{Description}:
+Moves @var{UNIT} to the specified @var{OFFSET}. If @var{WHENCE}
+is set to 0, the @var{OFFSET} is taken as an absolute value @code{SEEK_SET},
+if set to 1, @var{OFFSET} is taken to be relative to the current position
+@code{SEEK_CUR}, and if set to 2 relative to the end of the file @code{SEEK_END}.
+On error, @var{STATUS} is set to a non-zero value. If @var{STATUS} the seek
+fails silently.
+
+This intrinsic routine is not fully backwards compatible with @command{g77}.
+In @command{g77}, the @code{FSEEK} takes a statement label instead of a
+@var{STATUS} variable. If FSEEK is used in old code, change
+@smallexample
+ CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
+@end smallexample
+to
+@smallexample
+ INTEGER :: status
+ CALL FSEEK(UNIT, OFFSET, WHENCE, status)
+ IF (status /= 0) GOTO label
+@end smallexample
+
+Please note that GNU Fortran provides the Fortran 2003 Stream facility.
+Programmers should consider the use of new stream IO feature in new code
+for future portability. See also @ref{Fortran 2003 status}.
@item @emph{Standard}:
GNU extension
@@ -3978,13 +4061,44 @@ GNU extension
Subroutine
@item @emph{Syntax}:
+@code{CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .70
+@item @var{UNIT} @tab Shall be a scalar of type @code{INTEGER}.
+@item @var{OFFSET} @tab Shall be a scalar of type @code{INTEGER}.
+@item @var{WHENCE} @tab Shall be a scalar of type @code{INTEGER}.
+Its value shall be either 0, 1 or 2.
+@item @var{STATUS} @tab (Optional) shall be a scalar of type
+@code{INTEGER(4)}.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
-@item @emph{See also}:
-@uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
+@smallexample
+PROGRAM test_fseek
+ INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
+ INTEGER :: fd, offset, ierr
+
+ ierr = 0
+ offset = 5
+ fd = 10
+ OPEN(UNIT=fd, FILE="fseek.test")
+ CALL FSEEK(fd, offset, SEEK_SET, ierr) ! move to OFFSET
+ print *, FTELL(fd), ierr
+
+ CALL FSEEK(fd, 0, SEEK_END, ierr) ! move to end
+ print *, FTELL(fd), ierr
+
+ CALL FSEEK(fd, 0, SEEK_SET, ierr) ! move to beginning
+ print *, FTELL(fd), ierr
+
+ CLOSE(UNIT=fd)
+END PROGRAM
+@end smallexample
+
+@item @emph{See also}:
+@ref{FTELL}
@end table
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 14ed3e32e8d..b0a1c37dda6 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -2965,6 +2965,50 @@ gfc_resolve_fput_sub (gfc_code *c)
}
+void
+gfc_resolve_fseek_sub (gfc_code *c)
+{
+ gfc_expr *unit;
+ gfc_expr *offset;
+ gfc_expr *whence;
+ gfc_expr *status;
+ gfc_typespec ts;
+
+ unit = c->ext.actual->expr;
+ offset = c->ext.actual->next->expr;
+ whence = c->ext.actual->next->next->expr;
+ status = c->ext.actual->next->next->next->expr;
+
+ if (unit->ts.kind != gfc_c_int_kind)
+ {
+ ts.type = BT_INTEGER;
+ ts.kind = gfc_c_int_kind;
+ ts.derived = NULL;
+ ts.cl = NULL;
+ gfc_convert_type (unit, &ts, 2);
+ }
+
+ if (offset->ts.kind != gfc_intio_kind)
+ {
+ ts.type = BT_INTEGER;
+ ts.kind = gfc_intio_kind;
+ ts.derived = NULL;
+ ts.cl = NULL;
+ gfc_convert_type (offset, &ts, 2);
+ }
+
+ if (whence->ts.kind != gfc_c_int_kind)
+ {
+ ts.type = BT_INTEGER;
+ ts.kind = gfc_c_int_kind;
+ ts.derived = NULL;
+ ts.cl = NULL;
+ gfc_convert_type (whence, &ts, 2);
+ }
+
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("fseek_sub"));
+}
+
void
gfc_resolve_ftell_sub (gfc_code *c)
{
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index 3c8089af566..3ed673f0679 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -153,7 +153,6 @@ match gfc_match_volatile (void);
/* primary.c */
match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **);
-match gfc_match_rvalue (gfc_expr **);
match gfc_match_variable (gfc_expr **, int);
match gfc_match_equiv_variable (gfc_expr **);
match gfc_match_actual_arglist (int, gfc_actual_arglist **);
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 902279c24a0..653df5d4162 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2062,17 +2062,16 @@ gfc_match_rvalue (gfc_expr **result)
gfc_gobble_whitespace ();
if (sym->attr.recursive
&& gfc_peek_char () == '('
- && gfc_current_ns->proc_name == sym)
+ && gfc_current_ns->proc_name == sym
+ && !sym->attr.dimension)
{
- if (!sym->attr.dimension)
- goto function0;
-
- gfc_error ("'%s' is array valued and directly recursive "
- "at %C , so the keyword RESULT must be specified "
- "in the FUNCTION statement", sym->name);
+ gfc_error ("'%s' at %C is the name of a recursive function "
+ "and so refers to the result variable. Use an "
+ "explicit RESULT variable for direct recursion "
+ "(12.5.2.1)", sym->name);
return MATCH_ERROR;
}
-
+
if (gfc_current_ns->proc_name == sym
|| (gfc_current_ns->parent != NULL
&& gfc_current_ns->parent->proc_name == sym))
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 55f1390d03b..b6d1f3b9732 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -3204,6 +3204,70 @@ resolve_variable (gfc_expr *e)
}
+/* Checks to see that the correct symbol has been host associated.
+ The only situation where this arises is that in which a twice
+ contained function is parsed after the host association is made.
+ Therefore, on detecting this, the line is rematched, having got
+ rid of the existing references and actual_arg_list. */
+static bool
+check_host_association (gfc_expr *e)
+{
+ gfc_symbol *sym, *old_sym;
+ locus temp_locus;
+ gfc_expr *expr;
+ int n;
+
+ if (e->symtree == NULL || e->symtree->n.sym == NULL)
+ return e->expr_type == EXPR_FUNCTION;
+
+ old_sym = e->symtree->n.sym;
+ if (gfc_current_ns->parent
+ && gfc_current_ns->parent->parent
+ && old_sym->ns != gfc_current_ns)
+ {
+ gfc_find_symbol (old_sym->name, gfc_current_ns->parent, 1, &sym);
+ if (sym && old_sym != sym && sym->attr.flavor == FL_PROCEDURE)
+ {
+ temp_locus = gfc_current_locus;
+ gfc_current_locus = e->where;
+
+ gfc_buffer_error (1);
+
+ gfc_free_ref_list (e->ref);
+ e->ref = NULL;
+
+ if (e->expr_type == EXPR_FUNCTION)
+ {
+ gfc_free_actual_arglist (e->value.function.actual);
+ e->value.function.actual = NULL;
+ }
+
+ if (e->shape != NULL)
+ {
+ for (n = 0; n < e->rank; n++)
+ mpz_clear (e->shape[n]);
+
+ gfc_free (e->shape);
+ }
+
+ gfc_match_rvalue (&expr);
+ gfc_clear_error ();
+ gfc_buffer_error (0);
+
+ gcc_assert (expr && sym == expr->symtree->n.sym);
+
+ *e = *expr;
+ gfc_free (expr);
+ sym->refs++;
+
+ gfc_current_locus = temp_locus;
+ }
+ }
+
+ return e->expr_type == EXPR_FUNCTION;
+}
+
+
/* Resolve an expression. That is, make sure that types of operands agree
with their operators, intrinsic operators are converted to function calls
for overloaded types and unresolved function references are resolved. */
@@ -3223,13 +3287,16 @@ gfc_resolve_expr (gfc_expr *e)
break;
case EXPR_FUNCTION:
- t = resolve_function (e);
- break;
-
case EXPR_VARIABLE:
- t = resolve_variable (e);
- if (t == SUCCESS)
- expression_rank (e);
+
+ if (check_host_association (e))
+ t = resolve_function (e);
+ else
+ {
+ t = resolve_variable (e);
+ if (t == SUCCESS)
+ expression_rank (e);
+ }
break;
case EXPR_SUBSTRING:
@@ -5812,6 +5879,11 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
if (sym->ts.type == BT_CHARACTER)
{
gfc_charlen *cl = sym->ts.cl;
+
+ if (cl && cl->length && gfc_is_constant_expr (cl->length)
+ && resolve_charlen (cl) == FAILURE)
+ return FAILURE;
+
if (!cl || !cl->length || cl->length->expr_type != EXPR_CONSTANT)
{
if (sym->attr.proc == PROC_ST_FUNCTION)
@@ -6065,16 +6137,21 @@ resolve_fl_namelist (gfc_symbol *sym)
}
/* 14.1.2 A module or internal procedure represent local entities
- of the same type as a namelist member and so are not allowed.
- Note that this is sometimes caught by check_conflict so the
- same message has been used. */
+ of the same type as a namelist member and so are not allowed. */
for (nl = sym->namelist; nl; nl = nl->next)
{
if (nl->sym->ts.kind != 0 && nl->sym->attr.flavor == FL_VARIABLE)
continue;
+
+ if (nl->sym->attr.function && nl->sym == nl->sym->result)
+ if ((nl->sym == sym->ns->proc_name)
+ ||
+ (sym->ns->parent && nl->sym == sym->ns->parent->proc_name))
+ continue;
+
nlsym = NULL;
- if (sym->ns->parent && nl->sym && nl->sym->name)
- gfc_find_symbol (nl->sym->name, sym->ns->parent, 0, &nlsym);
+ if (nl->sym && nl->sym->name)
+ gfc_find_symbol (nl->sym->name, sym->ns, 1, &nlsym);
if (nlsym && nlsym->attr.flavor == FL_PROCEDURE)
{
gfc_error ("PROCEDURE attribute conflicts with NAMELIST "
@@ -6131,9 +6208,7 @@ resolve_fl_parameter (gfc_symbol *sym)
static void
resolve_symbol (gfc_symbol *sym)
{
- /* Zero if we are checking a formal namespace. */
- static int formal_ns_flag = 1;
- int formal_ns_save, check_constant, mp_flag;
+ int check_constant, mp_flag;
gfc_symtree *symtree;
gfc_symtree *this_symtree;
gfc_namespace *ns;
@@ -6340,18 +6415,9 @@ resolve_symbol (gfc_symbol *sym)
formal_arg_flag = 0;
- /* Resolve formal namespaces. The symbols in formal namespaces that
- themselves are from procedures in formal namespaces will not stand
- resolution, except when they are use associated.
- TODO: Fix the symbols in formal namespaces so that resolution can
- be done unconditionally. */
- if (formal_ns_flag && sym != NULL && sym->formal_ns != NULL)
- {
- formal_ns_save = formal_ns_flag;
- formal_ns_flag = sym->attr.use_assoc ? 1 : 0;
- gfc_resolve (sym->formal_ns);
- formal_ns_flag = formal_ns_save;
- }
+ /* Resolve formal namespaces. */
+ if (sym->formal_ns && sym->formal_ns != gfc_current_ns)
+ gfc_resolve (sym->formal_ns);
/* Check threadprivate restrictions. */
if (sym->attr.threadprivate && !sym->attr.save
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index b31597d170b..87fe6f14708 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -26,6 +26,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "gfortran.h"
#include "arith.h"
#include "intrinsic.h"
+#include "target-memory.h"
gfc_expr gfc_bad_expr;
@@ -2136,14 +2137,15 @@ gfc_simplify_len (gfc_expr *e)
}
if (e->ts.cl != NULL && e->ts.cl->length != NULL
- && e->ts.cl->length->expr_type == EXPR_CONSTANT)
+ && e->ts.cl->length->expr_type == EXPR_CONSTANT
+ && e->ts.cl->length->ts.type == BT_INTEGER)
{
result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind,
&e->where);
mpz_set (result->value.integer, e->ts.cl->length->value.integer);
return range_check (result, "LEN");
}
-
+
return NULL;
}
@@ -2640,13 +2642,8 @@ gfc_simplify_new_line (gfc_expr *e)
{
gfc_expr *result;
- if (e->expr_type != EXPR_CONSTANT)
- return NULL;
-
result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where);
-
result->value.character.string = gfc_getmem (2);
-
result->value.character.length = 1;
result->value.character.string[0] = '\n';
result->value.character.string[1] = '\0'; /* For debugger */
@@ -2919,7 +2916,10 @@ gfc_simplify_repeat (gfc_expr *e, gfc_expr *n)
return NULL;
if (mpz_sgn (e->ts.cl->length->value.integer) != 0)
- gcc_assert (gfc_extract_int (n, &ncop) == NULL);
+ {
+ const char *res = gfc_extract_int (n, &ncop);
+ gcc_assert (res == NULL);
+ }
else
ncop = 0;
@@ -3866,12 +3866,81 @@ gfc_simplify_tiny (gfc_expr *e)
gfc_expr *
gfc_simplify_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
{
- /* Reference mold and size to suppress warning. */
- if (gfc_init_expr && (mold || size))
- gfc_error ("TRANSFER intrinsic not implemented for initialization at %L",
- &source->where);
+ gfc_expr *result;
+ gfc_expr *mold_element;
+ size_t source_size;
+ size_t result_size;
+ size_t result_elt_size;
+ size_t buffer_size;
+ mpz_t tmp;
+ unsigned char *buffer;
+
+ if (!gfc_is_constant_expr (source)
+ || !gfc_is_constant_expr (size))
+ return NULL;
- return NULL;
+ /* Calculate the size of the source. */
+ if (source->expr_type == EXPR_ARRAY
+ && gfc_array_size (source, &tmp) == FAILURE)
+ gfc_internal_error ("Failure getting length of a constant array.");
+
+ source_size = gfc_target_expr_size (source);
+
+ /* Create an empty new expression with the appropriate characteristics. */
+ result = gfc_constant_result (mold->ts.type, mold->ts.kind,
+ &source->where);
+ result->ts = mold->ts;
+
+ mold_element = mold->expr_type == EXPR_ARRAY
+ ? mold->value.constructor->expr
+ : mold;
+
+ /* Set result character length, if needed. Note that this needs to be
+ set even for array expressions, in order to pass this information into
+ gfc_target_interpret_expr. */
+ if (result->ts.type == BT_CHARACTER)
+ result->value.character.length = mold_element->value.character.length;
+
+ /* Set the number of elements in the result, and determine its size. */
+ result_elt_size = gfc_target_expr_size (mold_element);
+ if (mold->expr_type == EXPR_ARRAY || size)
+ {
+ int result_length;
+
+ result->expr_type = EXPR_ARRAY;
+ result->rank = 1;
+
+ if (size)
+ result_length = (size_t)mpz_get_ui (size->value.integer);
+ else
+ {
+ result_length = source_size / result_elt_size;
+ if (result_length * result_elt_size < source_size)
+ result_length += 1;
+ }
+
+ result->shape = gfc_get_shape (1);
+ mpz_init_set_ui (result->shape[0], result_length);
+
+ result_size = result_length * result_elt_size;
+ }
+ else
+ {
+ result->rank = 0;
+ result_size = result_elt_size;
+ }
+
+ /* Allocate the buffer to store the binary version of the source. */
+ buffer_size = MAX (source_size, result_size);
+ buffer = (unsigned char*)alloca (buffer_size);
+
+ /* Now write source to the buffer. */
+ gfc_target_encode_expr (source, buffer, buffer_size);
+
+ /* And read the buffer back into the new expression. */
+ gfc_target_interpret_expr (buffer, buffer_size, result);
+
+ return result;
}
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 0388e54e9f7..71f89123e95 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -477,6 +477,7 @@ check_conflict (symbol_attribute * attr, const char * name, locus * where)
if (attr->in_namelist
&& attr->flavor != FL_VARIABLE
+ && attr->flavor != FL_PROCEDURE
&& attr->flavor != FL_UNKNOWN)
{
@@ -1155,9 +1156,14 @@ gfc_add_flavor (symbol_attribute * attr, sym_flavor f, const char *name,
if (where == NULL)
where = &gfc_current_locus;
- gfc_error ("%s attribute conflicts with %s attribute at %L",
- gfc_code2string (flavors, attr->flavor),
- gfc_code2string (flavors, f), where);
+ if (name)
+ gfc_error ("%s attribute of '%s' conflicts with %s attribute at %L",
+ gfc_code2string (flavors, attr->flavor), name,
+ gfc_code2string (flavors, f), where);
+ else
+ gfc_error ("%s attribute conflicts with %s attribute at %L",
+ gfc_code2string (flavors, attr->flavor),
+ gfc_code2string (flavors, f), where);
return FAILURE;
}
diff --git a/gcc/fortran/target-memory.c b/gcc/fortran/target-memory.c
new file mode 100644
index 00000000000..ba2363adf9c
--- /dev/null
+++ b/gcc/fortran/target-memory.c
@@ -0,0 +1,451 @@
+/* Simulate storage of variables into target memory.
+ Copyright (C) 2007
+ Free Software Foundation, Inc.
+ Contributed by Paul Thomas and Brooks Moses
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "flags.h"
+#include "machmode.h"
+#include "tree.h"
+#include "gfortran.h"
+#include "arith.h"
+#include "trans.h"
+#include "trans-const.h"
+#include "trans-types.h"
+#include "target-memory.h"
+
+/* --------------------------------------------------------------- */
+/* Calculate the size of an expression. */
+
+static size_t
+size_array (gfc_expr *e)
+{
+ mpz_t array_size;
+ size_t elt_size = gfc_target_expr_size (e->value.constructor->expr);
+
+ gfc_array_size (e, &array_size);
+ return (size_t)mpz_get_ui (array_size) * elt_size;
+}
+
+static size_t
+size_integer (int kind)
+{
+ return GET_MODE_SIZE (TYPE_MODE (gfc_get_int_type (kind)));;
+}
+
+
+static size_t
+size_float (int kind)
+{
+ return GET_MODE_SIZE (TYPE_MODE (gfc_get_real_type (kind)));;
+}
+
+
+static size_t
+size_complex (int kind)
+{
+ return 2 * size_float (kind);
+}
+
+
+static size_t
+size_logical (int kind)
+{
+ return GET_MODE_SIZE (TYPE_MODE (gfc_get_logical_type (kind)));;
+}
+
+
+static size_t
+size_character (int length)
+{
+ return length;
+}
+
+
+size_t
+gfc_target_expr_size (gfc_expr *e)
+{
+ tree type;
+
+ gcc_assert (e != NULL);
+
+ if (e->expr_type == EXPR_ARRAY)
+ return size_array (e);
+
+ switch (e->ts.type)
+ {
+ case BT_INTEGER:
+ return size_integer (e->ts.kind);
+ case BT_REAL:
+ return size_float (e->ts.kind);
+ case BT_COMPLEX:
+ return size_complex (e->ts.kind);
+ case BT_LOGICAL:
+ return size_logical (e->ts.kind);
+ case BT_CHARACTER:
+ return size_character (e->value.character.length);
+ case BT_DERIVED:
+ type = gfc_typenode_for_spec (&e->ts);
+ return int_size_in_bytes (type);
+ default:
+ gfc_internal_error ("Invalid expression in gfc_target_expr_size.");
+ return 0;
+ }
+}
+
+
+/* The encode_* functions export a value into a buffer, and
+ return the number of bytes of the buffer that have been
+ used. */
+
+static int
+encode_array (gfc_expr *expr, unsigned char *buffer, size_t buffer_size)
+{
+ mpz_t array_size;
+ int i;
+ int ptr = 0;
+
+ gfc_array_size (expr, &array_size);
+ for (i = 0; i < (int)mpz_get_ui (array_size); i++)
+ {
+ ptr += gfc_target_encode_expr (gfc_get_array_element (expr, i),
+ &buffer[ptr], buffer_size - ptr);
+ }
+
+ mpz_clear (array_size);
+ return ptr;
+}
+
+
+static int
+encode_integer (int kind, mpz_t integer, unsigned char *buffer,
+ size_t buffer_size)
+{
+ return native_encode_expr (gfc_conv_mpz_to_tree (integer, kind),
+ buffer, buffer_size);
+}
+
+
+static int
+encode_float (int kind, mpfr_t real, unsigned char *buffer, size_t buffer_size)
+{
+ return native_encode_expr (gfc_conv_mpfr_to_tree (real, kind), buffer,
+ buffer_size);
+}
+
+
+static int
+encode_complex (int kind, mpfr_t real, mpfr_t imaginary, unsigned char *buffer,
+ size_t buffer_size)
+{
+ int size;
+ size = encode_float (kind, real, &buffer[0], buffer_size);
+ size += encode_float (kind, imaginary, &buffer[size], buffer_size - size);
+ return size;
+}
+
+
+static int
+encode_logical (int kind, int logical, unsigned char *buffer, size_t buffer_size)
+{
+ return native_encode_expr (build_int_cst (gfc_get_logical_type (kind),
+ logical),
+ buffer, buffer_size);
+}
+
+
+static int
+encode_character (int length, char *string, unsigned char *buffer,
+ size_t buffer_size)
+{
+ gcc_assert (buffer_size >= size_character (length));
+ memcpy (buffer, string, length);
+ return length;
+}
+
+
+static int
+encode_derived (gfc_expr *source, unsigned char *buffer, size_t buffer_size)
+{
+ gfc_constructor *ctr;
+ gfc_component *cmp;
+ int ptr;
+ tree type;
+
+ type = gfc_typenode_for_spec (&source->ts);
+
+ ctr = source->value.constructor;
+ cmp = source->ts.derived->components;
+ for (;ctr; ctr = ctr->next, cmp = cmp->next)
+ {
+ gcc_assert (ctr->expr && cmp);
+ ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));
+ gfc_target_encode_expr (ctr->expr, &buffer[ptr],
+ buffer_size - ptr);
+ }
+
+ return int_size_in_bytes (type);
+}
+
+
+/* Write a constant expression in binary form to a buffer. */
+int
+gfc_target_encode_expr (gfc_expr *source, unsigned char *buffer,
+ size_t buffer_size)
+{
+ if (source == NULL)
+ return 0;
+
+ if (source->expr_type == EXPR_ARRAY)
+ return encode_array (source, buffer, buffer_size);
+
+ gcc_assert (source->expr_type == EXPR_CONSTANT
+ || source->expr_type == EXPR_STRUCTURE);
+
+ switch (source->ts.type)
+ {
+ case BT_INTEGER:
+ return encode_integer (source->ts.kind, source->value.integer, buffer,
+ buffer_size);
+ case BT_REAL:
+ return encode_float (source->ts.kind, source->value.real, buffer,
+ buffer_size);
+ case BT_COMPLEX:
+ return encode_complex (source->ts.kind, source->value.complex.r,
+ source->value.complex.i, buffer, buffer_size);
+ case BT_LOGICAL:
+ return encode_logical (source->ts.kind, source->value.logical, buffer,
+ buffer_size);
+ case BT_CHARACTER:
+ return encode_character (source->value.character.length,
+ source->value.character.string, buffer,
+ buffer_size);
+ case BT_DERIVED:
+ return encode_derived (source, buffer, buffer_size);
+ default:
+ gfc_internal_error ("Invalid expression in gfc_target_encode_expr.");
+ return 0;
+ }
+}
+
+
+static int
+interpret_array (unsigned char *buffer, size_t buffer_size, gfc_expr *result)
+{
+ int array_size = 1;
+ int i;
+ int ptr = 0;
+ gfc_constructor *head = NULL, *tail = NULL;
+
+ /* Calculate array size from its shape and rank. */
+ gcc_assert (result->rank > 0 && result->shape);
+
+ for (i = 0; i < result->rank; i++)
+ array_size *= (int)mpz_get_ui (result->shape[i]);
+
+ /* Iterate over array elements, producing constructors. */
+ for (i = 0; i < array_size; i++)
+ {
+ if (head == NULL)
+ head = tail = gfc_get_constructor ();
+ else
+ {
+ tail->next = gfc_get_constructor ();
+ tail = tail->next;
+ }
+
+ tail->where = result->where;
+ tail->expr = gfc_constant_result (result->ts.type,
+ result->ts.kind, &result->where);
+ tail->expr->ts = result->ts;
+
+ if (tail->expr->ts.type == BT_CHARACTER)
+ tail->expr->value.character.length = result->value.character.length;
+
+ ptr += gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr,
+ tail->expr);
+ }
+ result->value.constructor = head;
+
+ return ptr;
+}
+
+
+static int
+interpret_integer (int kind, unsigned char *buffer, size_t buffer_size,
+ mpz_t integer)
+{
+ mpz_init (integer);
+ gfc_conv_tree_to_mpz (integer,
+ native_interpret_expr (gfc_get_int_type (kind),
+ buffer, buffer_size));
+ return size_integer (kind);
+}
+
+
+static int
+interpret_float (int kind, unsigned char *buffer, size_t buffer_size,
+ mpfr_t real)
+{
+ mpfr_init (real);
+ gfc_conv_tree_to_mpfr (real,
+ native_interpret_expr (gfc_get_real_type (kind),
+ buffer, buffer_size));
+
+ return size_float (kind);
+}
+
+
+static int
+interpret_complex (int kind, unsigned char *buffer, size_t buffer_size,
+ mpfr_t real, mpfr_t imaginary)
+{
+ int size;
+ size = interpret_float (kind, &buffer[0], buffer_size, real);
+ size += interpret_float (kind, &buffer[size], buffer_size - size, imaginary);
+ return size;
+}
+
+
+static int
+interpret_logical (int kind, unsigned char *buffer, size_t buffer_size,
+ int *logical)
+{
+ tree t = native_interpret_expr (gfc_get_logical_type (kind), buffer,
+ buffer_size);
+ *logical = double_int_zero_p (tree_to_double_int (t))
+ ? 0 : 1;
+ return size_logical (kind);
+}
+
+
+static int
+interpret_character (unsigned char *buffer, size_t buffer_size, gfc_expr *result)
+{
+ if (result->ts.cl && result->ts.cl->length)
+ result->value.character.length =
+ (int)mpz_get_ui (result->ts.cl->length->value.integer);
+
+ gcc_assert (buffer_size >= size_character (result->value.character.length));
+ result->value.character.string =
+ gfc_getmem (result->value.character.length + 1);
+ memcpy (result->value.character.string, buffer,
+ result->value.character.length);
+ result->value.character.string [result->value.character.length] = '\0';
+
+ return result->value.character.length;
+}
+
+
+static int
+interpret_derived (unsigned char *buffer, size_t buffer_size, gfc_expr *result)
+{
+ gfc_component *cmp;
+ gfc_constructor *head = NULL, *tail = NULL;
+ int ptr;
+ tree type;
+
+ /* The attributes of the derived type need to be bolted to the floor. */
+ result->expr_type = EXPR_STRUCTURE;
+
+ type = gfc_typenode_for_spec (&result->ts);
+ cmp = result->ts.derived->components;
+
+ /* Run through the derived type components. */
+ for (;cmp; cmp = cmp->next)
+ {
+ if (head == NULL)
+ head = tail = gfc_get_constructor ();
+ else
+ {
+ tail->next = gfc_get_constructor ();
+ tail = tail->next;
+ }
+
+ /* The constructor points to the component. */
+ tail->n.component = cmp;
+
+ tail->expr = gfc_constant_result (cmp->ts.type, cmp->ts.kind,
+ &result->where);
+ tail->expr->ts = cmp->ts;
+
+ /* Copy shape, if needed. */
+ if (cmp->as && cmp->as->rank)
+ {
+ int n;
+
+ tail->expr->expr_type = EXPR_ARRAY;
+ tail->expr->rank = cmp->as->rank;
+
+ tail->expr->shape = gfc_get_shape (tail->expr->rank);
+ for (n = 0; n < tail->expr->rank; n++)
+ {
+ mpz_init_set_ui (tail->expr->shape[n], 1);
+ mpz_add (tail->expr->shape[n], tail->expr->shape[n],
+ cmp->as->upper[n]->value.integer);
+ mpz_sub (tail->expr->shape[n], tail->expr->shape[n],
+ cmp->as->lower[n]->value.integer);
+ }
+ }
+
+ ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));
+ gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr,
+ tail->expr);
+
+ result->value.constructor = head;
+ }
+
+ return int_size_in_bytes (type);
+}
+
+
+/* Read a binary buffer to a constant expression. */
+int
+gfc_target_interpret_expr (unsigned char *buffer, size_t buffer_size,
+ gfc_expr *result)
+{
+ if (result->expr_type == EXPR_ARRAY)
+ return interpret_array (buffer, buffer_size, result);
+
+ switch (result->ts.type)
+ {
+ case BT_INTEGER:
+ return interpret_integer (result->ts.kind, buffer, buffer_size,
+ result->value.integer);
+ case BT_REAL:
+ return interpret_float (result->ts.kind, buffer, buffer_size,
+ result->value.real);
+ case BT_COMPLEX:
+ return interpret_complex (result->ts.kind, buffer, buffer_size,
+ result->value.complex.r,
+ result->value.complex.i);
+ case BT_LOGICAL:
+ return interpret_logical (result->ts.kind, buffer, buffer_size,
+ &result->value.logical);
+ case BT_CHARACTER:
+ return interpret_character (buffer, buffer_size, result);
+ case BT_DERIVED:
+ return interpret_derived (buffer, buffer_size, result);
+ default:
+ gfc_internal_error ("Invalid expression in gfc_target_interpret_expr.");
+ }
+ return 0;
+}
diff --git a/gcc/fortran/target-memory.h b/gcc/fortran/target-memory.h
new file mode 100644
index 00000000000..85ae552aec3
--- /dev/null
+++ b/gcc/fortran/target-memory.h
@@ -0,0 +1,37 @@
+/* Simulate storage of variables into target memory, header.
+ Copyright (C) 2007
+ Free Software Foundation, Inc.
+ Contributed by Paul Thomas and Brooks Moses
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+#ifndef GFC_TARGET_MEMORY_H
+#define GFC_TARGET_MEMORY_H
+
+#include "gfortran.h"
+
+/* Return the size of an expression in its target representation. */
+size_t gfc_target_expr_size (gfc_expr *);
+
+/* Write a constant expression in binary form to a target buffer. */
+int gfc_target_encode_expr (gfc_expr *, unsigned char *, size_t);
+
+/* Read a target buffer into a constant expression. */
+int gfc_target_interpret_expr (unsigned char *, size_t, gfc_expr *);
+
+#endif /* GFC_TARGET_MEMORY_H */
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 92fd67cccf5..61e35543fe3 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -533,13 +533,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
else
{
/* Allocate memory to hold the data. */
- if (gfc_index_integer_kind == 4)
- tmp = gfor_fndecl_internal_malloc;
- else if (gfc_index_integer_kind == 8)
- tmp = gfor_fndecl_internal_malloc64;
- else
- gcc_unreachable ();
- tmp = build_call_expr (tmp, 1, size);
+ tmp = gfc_call_malloc (pre, NULL, size);
tmp = gfc_evaluate_now (tmp, pre);
gfc_conv_descriptor_data_set (pre, desc, tmp);
}
@@ -555,8 +549,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
{
/* Free the temporary. */
tmp = gfc_conv_descriptor_data_get (desc);
- tmp = fold_convert (pvoid_type_node, tmp);
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp);
+ tmp = gfc_call_free (fold_convert (pvoid_type_node, tmp));
gfc_add_expr_to_block (post, tmp);
}
}
@@ -3793,7 +3786,6 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
stmtblock_t block;
tree type;
tree tmp;
- tree fndecl;
tree size;
tree offset;
bool onstack;
@@ -3857,14 +3849,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp);
/* Allocate memory to hold the data. */
- if (gfc_index_integer_kind == 4)
- fndecl = gfor_fndecl_internal_malloc;
- else if (gfc_index_integer_kind == 8)
- fndecl = gfor_fndecl_internal_malloc64;
- else
- gcc_unreachable ();
- tmp = build_call_expr (fndecl, 1, size);
- tmp = fold_convert (TREE_TYPE (decl), tmp);
+ tmp = gfc_call_malloc (&block, TREE_TYPE (decl), size);
gfc_add_modify_expr (&block, decl, tmp);
/* Set offset of the array. */
@@ -3878,8 +3863,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
gfc_add_expr_to_block (&block, fnbody);
/* Free the temporary. */
- tmp = convert (pvoid_type_node, decl);
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp);
+ tmp = gfc_call_free (convert (pvoid_type_node, decl));
gfc_add_expr_to_block (&block, tmp);
return gfc_finish_block (&block);
@@ -4235,7 +4219,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
}
/* Free the temporary. */
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmpdesc);
+ tmp = gfc_call_free (tmpdesc);
gfc_add_expr_to_block (&cleanup, tmp);
stmt = gfc_finish_block (&cleanup);
@@ -4748,14 +4732,25 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
tree desc;
tree tmp;
tree stmt;
+ tree parent = DECL_CONTEXT (current_function_decl);
+ bool full_array_var, this_array_result;
gfc_symbol *sym;
stmtblock_t block;
+ full_array_var = (expr->expr_type == EXPR_VARIABLE
+ && expr->ref->u.ar.type == AR_FULL);
+ sym = full_array_var ? expr->symtree->n.sym : NULL;
+
+ /* Is this the result of the enclosing procedure? */
+ this_array_result = (full_array_var && sym->attr.flavor == FL_PROCEDURE);
+ if (this_array_result
+ && (sym->backend_decl != current_function_decl)
+ && (sym->backend_decl != parent))
+ this_array_result = false;
+
/* Passing address of the array if it is not pointer or assumed-shape. */
- if (expr->expr_type == EXPR_VARIABLE
- && expr->ref->u.ar.type == AR_FULL && g77)
+ if (full_array_var && g77 && !this_array_result)
{
- sym = expr->symtree->n.sym;
tmp = gfc_get_symbol_decl (sym);
if (sym->ts.type == BT_CHARACTER)
@@ -4784,8 +4779,25 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
}
}
- se->want_pointer = 1;
- gfc_conv_expr_descriptor (se, expr, ss);
+ if (this_array_result)
+ {
+ /* Result of the enclosing function. */
+ gfc_conv_expr_descriptor (se, expr, ss);
+ se->expr = build_fold_addr_expr (se->expr);
+
+ if (g77 && TREE_TYPE (TREE_TYPE (se->expr)) != NULL_TREE
+ && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (se->expr))))
+ se->expr = gfc_conv_array_data (build_fold_indirect_ref (se->expr));
+
+ return;
+ }
+ else
+ {
+ /* Every other type of array. */
+ se->want_pointer = 1;
+ gfc_conv_expr_descriptor (se, expr, ss);
+ }
+
/* Deallocate the allocatable components of structures that are
not variable. */
@@ -4813,8 +4825,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
gfc_add_expr_to_block (&block, tmp);
/* Free the temporary. */
- tmp = convert (pvoid_type_node, ptr);
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp);
+ tmp = gfc_call_free (convert (pvoid_type_node, ptr));
gfc_add_expr_to_block (&block, tmp);
stmt = gfc_finish_block (&block);
@@ -4914,13 +4925,8 @@ gfc_duplicate_allocatable(tree dest, tree src, tree type, int rank)
TYPE_SIZE_UNIT (gfc_get_element_type (type)));
/* Allocate memory to the destination. */
- if (gfc_index_integer_kind == 4)
- tmp = build_call_expr (gfor_fndecl_internal_malloc, 1, size);
- else if (gfc_index_integer_kind == 8)
- tmp = build_call_expr (gfor_fndecl_internal_malloc64, 1, size);
- else
- gcc_unreachable ();
- tmp = fold_convert (TREE_TYPE (gfc_conv_descriptor_data_get (src)), tmp);
+ tmp = gfc_call_malloc (&block, TREE_TYPE (gfc_conv_descriptor_data_get (src)),
+ size);
gfc_conv_descriptor_data_set (&block, dest, tmp);
/* We know the temporary and the value will be the same length,
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index ccf46852761..8c564cbca35 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -74,11 +74,8 @@ tree gfc_static_ctors;
/* Function declarations for builtin library functions. */
-tree gfor_fndecl_internal_malloc;
-tree gfor_fndecl_internal_malloc64;
tree gfor_fndecl_internal_realloc;
tree gfor_fndecl_internal_realloc64;
-tree gfor_fndecl_internal_free;
tree gfor_fndecl_allocate;
tree gfor_fndecl_allocate64;
tree gfor_fndecl_allocate_array;
@@ -90,6 +87,9 @@ tree gfor_fndecl_stop_numeric;
tree gfor_fndecl_stop_string;
tree gfor_fndecl_select_string;
tree gfor_fndecl_runtime_error;
+tree gfor_fndecl_runtime_error_at;
+tree gfor_fndecl_os_error;
+tree gfor_fndecl_generate_error;
tree gfor_fndecl_set_fpe;
tree gfor_fndecl_set_std;
tree gfor_fndecl_set_convert;
@@ -2245,18 +2245,6 @@ gfc_build_builtin_function_decls (void)
tree gfc_logical4_type_node = gfc_get_logical_type (4);
tree gfc_pint4_type_node = build_pointer_type (gfc_int4_type_node);
- /* Treat these two internal malloc wrappers as malloc. */
- gfor_fndecl_internal_malloc =
- gfc_build_library_function_decl (get_identifier (PREFIX("internal_malloc")),
- pvoid_type_node, 1, gfc_int4_type_node);
- DECL_IS_MALLOC (gfor_fndecl_internal_malloc) = 1;
-
- gfor_fndecl_internal_malloc64 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("internal_malloc64")),
- pvoid_type_node, 1, gfc_int8_type_node);
- DECL_IS_MALLOC (gfor_fndecl_internal_malloc64) = 1;
-
gfor_fndecl_internal_realloc =
gfc_build_library_function_decl (get_identifier
(PREFIX("internal_realloc")),
@@ -2269,10 +2257,6 @@ gfc_build_builtin_function_decls (void)
pvoid_type_node, 2, pvoid_type_node,
gfc_int8_type_node);
- gfor_fndecl_internal_free =
- gfc_build_library_function_decl (get_identifier (PREFIX("internal_free")),
- void_type_node, 1, pvoid_type_node);
-
gfor_fndecl_allocate =
gfc_build_library_function_decl (get_identifier (PREFIX("allocate")),
pvoid_type_node, 2,
@@ -2335,6 +2319,24 @@ gfc_build_builtin_function_decls (void)
/* The runtime_error function does not return. */
TREE_THIS_VOLATILE (gfor_fndecl_runtime_error) = 1;
+ gfor_fndecl_runtime_error_at =
+ gfc_build_library_function_decl (get_identifier (PREFIX("runtime_error_at")),
+ void_type_node, 2, pchar_type_node,
+ pchar_type_node);
+ /* The runtime_error_at function does not return. */
+ TREE_THIS_VOLATILE (gfor_fndecl_runtime_error_at) = 1;
+
+ gfor_fndecl_generate_error =
+ gfc_build_library_function_decl (get_identifier (PREFIX("generate_error")),
+ void_type_node, 3, pvoid_type_node,
+ gfc_c_int_type_node, pchar_type_node);
+
+ gfor_fndecl_os_error =
+ gfc_build_library_function_decl (get_identifier (PREFIX("os_error")),
+ void_type_node, 1, pchar_type_node);
+ /* The runtime_error function does not return. */
+ TREE_THIS_VOLATILE (gfor_fndecl_os_error) = 1;
+
gfor_fndecl_set_fpe =
gfc_build_library_function_decl (get_identifier (PREFIX("set_fpe")),
void_type_node, 1, gfc_c_int_type_node);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 182ec19e12b..d5f584c2ab9 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -261,6 +261,10 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind,
gfc_conv_string_parameter (se);
else
{
+ /* Avoid multiple evaluation of substring start. */
+ if (!CONSTANT_CLASS_P (start.expr) && !DECL_P (start.expr))
+ start.expr = gfc_evaluate_now (start.expr, &se->pre);
+
/* Change the start of the string. */
if (TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
tmp = se->expr;
@@ -279,6 +283,9 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind,
gfc_conv_expr_type (&end, ref->u.ss.end, gfc_charlen_type_node);
gfc_add_block_to_block (&se->pre, &end.pre);
}
+ if (!CONSTANT_CLASS_P (end.expr) && !DECL_P (end.expr))
+ end.expr = gfc_evaluate_now (end.expr, &se->pre);
+
if (flag_bounds_check)
{
tree nonempty = fold_build2 (LE_EXPR, boolean_type_node,
@@ -928,13 +935,11 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
{
/* Allocate a temporary to hold the result. */
var = gfc_create_var (type, "pstr");
- tmp = build_call_expr (gfor_fndecl_internal_malloc, 1, len);
- tmp = convert (type, tmp);
+ tmp = gfc_call_malloc (&se->pre, type, len);
gfc_add_modify_expr (&se->pre, var, tmp);
/* Free the temporary afterwards. */
- tmp = convert (pvoid_type_node, var);
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp);
+ tmp = gfc_call_free (convert (pvoid_type_node, var));
gfc_add_expr_to_block (&se->post, tmp);
}
@@ -2317,7 +2322,17 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
if (byref)
{
if (se->direct_byref)
- retargs = gfc_chainon_list (retargs, se->expr);
+ {
+ /* Sometimes, too much indirection can be applied; eg. for
+ function_result = array_valued_recursive_function. */
+ if (TREE_TYPE (TREE_TYPE (se->expr))
+ && TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr)))
+ && GFC_DESCRIPTOR_TYPE_P
+ (TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr)))))
+ se->expr = build_fold_indirect_ref (se->expr);
+
+ retargs = gfc_chainon_list (retargs, se->expr);
+ }
else if (sym->result->attr.dimension)
{
gcc_assert (se->loop && info);
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 25c8e1e8b1a..75b5a4cffc5 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -1275,7 +1275,7 @@ gfc_conv_intrinsic_ctime (gfc_se * se, gfc_expr * expr)
/* Free the temporary afterwards, if necessary. */
cond = build2 (GT_EXPR, boolean_type_node, len,
build_int_cst (TREE_TYPE (len), 0));
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, var);
+ tmp = gfc_call_free (var);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -1310,7 +1310,7 @@ gfc_conv_intrinsic_fdate (gfc_se * se, gfc_expr * expr)
/* Free the temporary afterwards, if necessary. */
cond = build2 (GT_EXPR, boolean_type_node, len,
build_int_cst (TREE_TYPE (len), 0));
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, var);
+ tmp = gfc_call_free (var);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -1347,7 +1347,7 @@ gfc_conv_intrinsic_ttynam (gfc_se * se, gfc_expr * expr)
/* Free the temporary afterwards, if necessary. */
cond = build2 (GT_EXPR, boolean_type_node, len,
build_int_cst (TREE_TYPE (len), 0));
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, var);
+ tmp = gfc_call_free (var);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
@@ -2400,7 +2400,7 @@ gfc_conv_intrinsic_ishft (gfc_se * se, gfc_expr * expr)
arg2 = TREE_VALUE (TREE_CHAIN (arg));
arg = TREE_VALUE (arg);
type = TREE_TYPE (arg);
- utype = gfc_unsigned_type (type);
+ utype = unsigned_type_for (type);
width = fold_build1 (ABS_EXPR, TREE_TYPE (arg2), arg2);
@@ -2866,8 +2866,7 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
/* Free the temporary. */
gfc_start_block (&block);
- tmp = convert (pvoid_type_node, source);
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, tmp);
+ tmp = gfc_call_free (convert (pvoid_type_node, source));
gfc_add_expr_to_block (&block, tmp);
stmt = gfc_finish_block (&block);
@@ -3364,7 +3363,7 @@ gfc_conv_intrinsic_trim (gfc_se * se, gfc_expr * expr)
/* Free the temporary afterwards, if necessary. */
cond = build2 (GT_EXPR, boolean_type_node, len,
build_int_cst (TREE_TYPE (len), 0));
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, var);
+ tmp = gfc_call_free (var);
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ());
gfc_add_expr_to_block (&se->post, tmp);
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 856938c9fdd..e543f4c7c3c 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -212,6 +212,62 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
st_parameter[ptype].type = t;
}
+
+/* Build code to test an error condition and call generate_error if needed.
+ Note: This builds calls to generate_error in the runtime library function.
+ The function generate_error is dependent on certain parameters in the
+ st_parameter_common flags to be set. (See libgfortran/runtime/error.c)
+ Therefore, the code to set these flags must be generated before
+ this function is used. */
+
+void
+gfc_trans_io_runtime_check (tree cond, tree var, int error_code,
+ const char * msgid, stmtblock_t * pblock)
+{
+ stmtblock_t block;
+ tree body;
+ tree tmp;
+ tree arg1, arg2, arg3;
+ char *message;
+
+ if (integer_zerop (cond))
+ return;
+
+ /* The code to generate the error. */
+ gfc_start_block (&block);
+
+ arg1 = build_fold_addr_expr (var);
+
+ arg2 = build_int_cst (integer_type_node, error_code),
+
+ asprintf (&message, "%s", _(msgid));
+ arg3 = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message));
+ gfc_free(message);
+
+ tmp = build_call_expr (gfor_fndecl_generate_error, 3, arg1, arg2, arg3);
+
+ gfc_add_expr_to_block (&block, tmp);
+
+ body = gfc_finish_block (&block);
+
+ if (integer_onep (cond))
+ {
+ gfc_add_expr_to_block (pblock, body);
+ }
+ else
+ {
+ /* Tell the compiler that this isn't likely. */
+ cond = fold_convert (long_integer_type_node, cond);
+ tmp = build_int_cst (long_integer_type_node, 0);
+ cond = build_call_expr (built_in_decls[BUILT_IN_EXPECT], 2, cond, tmp);
+ cond = fold_convert (boolean_type_node, cond);
+
+ tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt ());
+ gfc_add_expr_to_block (pblock, tmp);
+ }
+}
+
+
/* Create function decls for IO library functions. */
void
@@ -396,16 +452,49 @@ set_parameter_value (stmtblock_t *block, tree var, enum iofield type,
gfc_se se;
tree tmp;
gfc_st_parameter_field *p = &st_parameter_field[type];
+ tree dest_type = TREE_TYPE (p->field);
gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, e, TREE_TYPE (p->field));
+ gfc_conv_expr_val (&se, e);
+
+ /* If we're storing a UNIT number, we need to check it first. */
+ if (type == IOPARM_common_unit && e->ts.kind != 4)
+ {
+ tree cond, max;
+ ioerror_codes bad_unit;
+ int i;
+
+ bad_unit = IOERROR_BAD_UNIT;
+
+ /* Don't evaluate the UNIT number multiple times. */
+ se.expr = gfc_evaluate_now (se.expr, &se.pre);
+
+ /* UNIT numbers should be nonnegative. */
+ cond = fold_build2 (LT_EXPR, boolean_type_node, se.expr,
+ build_int_cst (TREE_TYPE (se.expr),0));
+ gfc_trans_io_runtime_check (cond, var, bad_unit,
+ "Negative unit number in I/O statement",
+ &se.pre);
+
+ /* UNIT numbers should be less than the max. */
+ i = gfc_validate_kind (BT_INTEGER, 4, false);
+ max = gfc_conv_mpz_to_tree (gfc_integer_kinds[i].huge, 4);
+ cond = fold_build2 (GT_EXPR, boolean_type_node, se.expr,
+ fold_convert (TREE_TYPE (se.expr), max));
+ gfc_trans_io_runtime_check (cond, var, bad_unit,
+ "Unit number in I/O statement too large",
+ &se.pre);
+
+ }
+
+ se.expr = convert (dest_type, se.expr);
gfc_add_block_to_block (block, &se.pre);
if (p->param_type == IOPARM_ptype_common)
var = build3 (COMPONENT_REF, st_parameter[IOPARM_ptype_common].type,
var, TYPE_FIELDS (TREE_TYPE (var)), NULL_TREE);
- tmp = build3 (COMPONENT_REF, TREE_TYPE (p->field), var, p->field,
- NULL_TREE);
+
+ tmp = build3 (COMPONENT_REF, dest_type, var, p->field, NULL_TREE);
gfc_add_modify_expr (block, tmp, se.expr);
return p->mask;
}
@@ -430,20 +519,42 @@ set_parameter_ref (stmtblock_t *block, stmtblock_t *postblock,
if (TYPE_MODE (TREE_TYPE (se.expr))
== TYPE_MODE (TREE_TYPE (TREE_TYPE (p->field))))
- addr = convert (TREE_TYPE (p->field),
- build_fold_addr_expr (se.expr));
+ {
+ addr = convert (TREE_TYPE (p->field), build_fold_addr_expr (se.expr));
+
+ /* If this is for the iostat variable initialize the
+ user variable to IOERROR_OK which is zero. */
+ if (type == IOPARM_common_iostat)
+ {
+ ioerror_codes ok;
+ ok = IOERROR_OK;
+ gfc_add_modify_expr (block, se.expr,
+ build_int_cst (TREE_TYPE (se.expr), ok));
+ }
+ }
else
{
/* The type used by the library has different size
- from the type of the variable supplied by the user.
- Need to use a temporary. */
- tree tmpvar
- = gfc_create_var (TREE_TYPE (TREE_TYPE (p->field)),
- st_parameter_field[type].name);
+ from the type of the variable supplied by the user.
+ Need to use a temporary. */
+ tree tmpvar = gfc_create_var (TREE_TYPE (TREE_TYPE (p->field)),
+ st_parameter_field[type].name);
+
+ /* If this is for the iostat variable, initialize the
+ user variable to IOERROR_OK which is zero. */
+ if (type == IOPARM_common_iostat)
+ {
+ ioerror_codes ok;
+ ok = IOERROR_OK;
+ gfc_add_modify_expr (block, tmpvar,
+ build_int_cst (TREE_TYPE (tmpvar), ok));
+ }
+
addr = build_fold_addr_expr (tmpvar);
+ /* After the I/O operation, we set the variable from the temporary. */
tmp = convert (TREE_TYPE (se.expr), tmpvar);
gfc_add_modify_expr (postblock, se.expr, tmp);
- }
+ }
if (p->param_type == IOPARM_ptype_common)
var = build3 (COMPONENT_REF, st_parameter[IOPARM_ptype_common].type,
@@ -776,10 +887,16 @@ gfc_trans_open (gfc_code * code)
set_error_locus (&block, var, &code->loc);
p = code->ext.open;
- if (p->unit)
- set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
- else
- set_parameter_const (&block, var, IOPARM_common_unit, 0);
+ if (p->iomsg)
+ mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
+ p->iomsg);
+
+ if (p->iostat)
+ mask |= set_parameter_ref (&block, &post_block, var, IOPARM_common_iostat,
+ p->iostat);
+
+ if (p->err)
+ mask |= IOPARM_common_err;
if (p->file)
mask |= set_string (&block, &post_block, var, IOPARM_open_file, p->file);
@@ -817,23 +934,17 @@ gfc_trans_open (gfc_code * code)
if (p->pad)
mask |= set_string (&block, &post_block, var, IOPARM_open_pad, p->pad);
- if (p->iomsg)
- mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
- p->iomsg);
-
- if (p->iostat)
- mask |= set_parameter_ref (&block, &post_block, var, IOPARM_common_iostat,
- p->iostat);
-
- if (p->err)
- mask |= IOPARM_common_err;
-
if (p->convert)
mask |= set_string (&block, &post_block, var, IOPARM_open_convert,
p->convert);
set_parameter_const (&block, var, IOPARM_common_flags, mask);
+ if (p->unit)
+ set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
+ else
+ set_parameter_const (&block, var, IOPARM_common_unit, 0);
+
tmp = build_fold_addr_expr (var);
tmp = build_call_expr (iocall[IOCALL_OPEN], 1, tmp);
gfc_add_expr_to_block (&block, tmp);
@@ -864,15 +975,6 @@ gfc_trans_close (gfc_code * code)
set_error_locus (&block, var, &code->loc);
p = code->ext.close;
- if (p->unit)
- set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
- else
- set_parameter_const (&block, var, IOPARM_common_unit, 0);
-
- if (p->status)
- mask |= set_string (&block, &post_block, var, IOPARM_close_status,
- p->status);
-
if (p->iomsg)
mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
p->iomsg);
@@ -884,8 +986,17 @@ gfc_trans_close (gfc_code * code)
if (p->err)
mask |= IOPARM_common_err;
+ if (p->status)
+ mask |= set_string (&block, &post_block, var, IOPARM_close_status,
+ p->status);
+
set_parameter_const (&block, var, IOPARM_common_flags, mask);
+ if (p->unit)
+ set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
+ else
+ set_parameter_const (&block, var, IOPARM_common_unit, 0);
+
tmp = build_fold_addr_expr (var);
tmp = build_call_expr (iocall[IOCALL_CLOSE], 1, tmp);
gfc_add_expr_to_block (&block, tmp);
@@ -918,11 +1029,6 @@ build_filepos (tree function, gfc_code * code)
set_error_locus (&block, var, &code->loc);
- if (p->unit)
- set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
- else
- set_parameter_const (&block, var, IOPARM_common_unit, 0);
-
if (p->iomsg)
mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
p->iomsg);
@@ -936,6 +1042,11 @@ build_filepos (tree function, gfc_code * code)
set_parameter_const (&block, var, IOPARM_common_flags, mask);
+ if (p->unit)
+ set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
+ else
+ set_parameter_const (&block, var, IOPARM_common_unit, 0);
+
tmp = build_fold_addr_expr (var);
tmp = build_call_expr (function, 1, tmp);
gfc_add_expr_to_block (&block, tmp);
@@ -1003,19 +1114,6 @@ gfc_trans_inquire (gfc_code * code)
set_error_locus (&block, var, &code->loc);
p = code->ext.inquire;
- /* Sanity check. */
- if (p->unit && p->file)
- gfc_error ("INQUIRE statement at %L cannot contain both FILE and UNIT specifiers", &code->loc);
-
- if (p->unit)
- set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
- else
- set_parameter_const (&block, var, IOPARM_common_unit, 0);
-
- if (p->file)
- mask |= set_string (&block, &post_block, var, IOPARM_inquire_file,
- p->file);
-
if (p->iomsg)
mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
p->iomsg);
@@ -1024,6 +1122,17 @@ gfc_trans_inquire (gfc_code * code)
mask |= set_parameter_ref (&block, &post_block, var, IOPARM_common_iostat,
p->iostat);
+ if (p->err)
+ mask |= IOPARM_common_err;
+
+ /* Sanity check. */
+ if (p->unit && p->file)
+ gfc_error ("INQUIRE statement at %L cannot contain both FILE and UNIT specifiers", &code->loc);
+
+ if (p->file)
+ mask |= set_string (&block, &post_block, var, IOPARM_inquire_file,
+ p->file);
+
if (p->exist)
mask |= set_parameter_ref (&block, &post_block, var, IOPARM_inquire_exist,
p->exist);
@@ -1108,9 +1217,6 @@ gfc_trans_inquire (gfc_code * code)
mask |= set_string (&block, &post_block, var, IOPARM_inquire_pad,
p->pad);
- if (p->err)
- mask |= IOPARM_common_err;
-
if (p->convert)
mask |= set_string (&block, &post_block, var, IOPARM_inquire_convert,
p->convert);
@@ -1121,6 +1227,11 @@ gfc_trans_inquire (gfc_code * code)
set_parameter_const (&block, var, IOPARM_common_flags, mask);
+ if (p->unit)
+ set_parameter_value (&block, var, IOPARM_common_unit, p->unit);
+ else
+ set_parameter_const (&block, var, IOPARM_common_unit, 0);
+
tmp = build_fold_addr_expr (var);
tmp = build_call_expr (iocall[IOCALL_INQUIRE], 1, tmp);
gfc_add_expr_to_block (&block, tmp);
@@ -1186,6 +1297,13 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
{
sym->attr.referenced = 1;
decl = gfc_get_symbol_decl (sym);
+
+ /* If this is the enclosing function declaration, use
+ the fake result instead. */
+ if (decl == current_function_decl)
+ decl = gfc_get_fake_result_decl (sym, 0);
+ else if (decl == DECL_CONTEXT (current_function_decl))
+ decl = gfc_get_fake_result_decl (sym, 1);
}
else
decl = c->backend_decl;
@@ -1419,14 +1537,29 @@ build_dt (tree function, gfc_code * code)
var, dt->io_unit);
set_parameter_const (&block, var, IOPARM_common_unit, 0);
}
- else
- set_parameter_value (&block, var, IOPARM_common_unit, dt->io_unit);
}
else
set_parameter_const (&block, var, IOPARM_common_unit, 0);
if (dt)
{
+ if (dt->iomsg)
+ mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
+ dt->iomsg);
+
+ if (dt->iostat)
+ mask |= set_parameter_ref (&block, &post_end_block, var,
+ IOPARM_common_iostat, dt->iostat);
+
+ if (dt->err)
+ mask |= IOPARM_common_err;
+
+ if (dt->eor)
+ mask |= IOPARM_common_eor;
+
+ if (dt->end)
+ mask |= IOPARM_common_end;
+
if (dt->rec)
mask |= set_parameter_value (&block, var, IOPARM_dt_rec, dt->rec);
@@ -1447,27 +1580,10 @@ build_dt (tree function, gfc_code * code)
dt->format_label->format);
}
- if (dt->iomsg)
- mask |= set_string (&block, &post_block, var, IOPARM_common_iomsg,
- dt->iomsg);
-
- if (dt->iostat)
- mask |= set_parameter_ref (&block, &post_end_block, var,
- IOPARM_common_iostat, dt->iostat);
-
if (dt->size)
mask |= set_parameter_ref (&block, &post_end_block, var,
IOPARM_dt_size, dt->size);
- if (dt->err)
- mask |= IOPARM_common_err;
-
- if (dt->eor)
- mask |= IOPARM_common_eor;
-
- if (dt->end)
- mask |= IOPARM_common_end;
-
if (dt->namelist)
{
if (dt->format_expr || dt->format_label)
@@ -1491,6 +1607,9 @@ build_dt (tree function, gfc_code * code)
}
else
set_parameter_const (&block, var, IOPARM_common_flags, mask);
+
+ if (dt->io_unit && dt->io_unit->ts.type == BT_INTEGER)
+ set_parameter_value (&block, var, IOPARM_common_unit, dt->io_unit);
}
else
set_parameter_const (&block, var, IOPARM_common_flags, mask);
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index cdc8dc6c669..d0af66e60b4 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -809,22 +809,22 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar,
to:
[evaluate loop bounds and step]
- count = (to + step - from) / step;
+ empty = (step > 0 ? to < from : to > from);
+ countm1 = (to - from) / step;
dovar = from;
+ if (empty) goto exit_label;
for (;;)
{
body;
cycle_label:
dovar += step
- count--;
- if (count <=0) goto exit_label;
+ countm1--;
+ if (countm1 ==0) goto exit_label;
}
exit_label:
- TODO: Large loop counts
- The code above assumes the loop count fits into a signed integer kind,
- i.e. Does not work for loop counts > 2^31 for integer(kind=4) variables
- We must support the full range. */
+ countm1 is an unsigned integer. It is equal to the loop count minus one,
+ because the loop count itself can overflow. */
tree
gfc_trans_do (gfc_code * code)
@@ -834,13 +834,15 @@ gfc_trans_do (gfc_code * code)
tree from;
tree to;
tree step;
- tree count;
- tree count_one;
+ tree empty;
+ tree countm1;
tree type;
+ tree utype;
tree cond;
tree cycle_label;
tree exit_label;
tree tmp;
+ tree pos_step;
stmtblock_t block;
stmtblock_t body;
@@ -874,48 +876,59 @@ gfc_trans_do (gfc_code * code)
|| tree_int_cst_equal (step, integer_minus_one_node)))
return gfc_trans_simple_do (code, &block, dovar, from, to, step);
- /* Initialize loop count. This code is executed before we enter the
- loop body. We generate: count = (to + step - from) / step. */
+ /* We need a special check for empty loops:
+ empty = (step > 0 ? to < from : to > from); */
+ pos_step = fold_build2 (GT_EXPR, boolean_type_node, step,
+ fold_convert (type, integer_zero_node));
+ empty = fold_build3 (COND_EXPR, boolean_type_node, pos_step,
+ fold_build2 (LT_EXPR, boolean_type_node, to, from),
+ fold_build2 (GT_EXPR, boolean_type_node, to, from));
- tmp = fold_build2 (MINUS_EXPR, type, step, from);
- tmp = fold_build2 (PLUS_EXPR, type, to, tmp);
+ /* Initialize loop count. This code is executed before we enter the
+ loop body. We generate: countm1 = abs(to - from) / abs(step). */
if (TREE_CODE (type) == INTEGER_TYPE)
{
- tmp = fold_build2 (TRUNC_DIV_EXPR, type, tmp, step);
- count = gfc_create_var (type, "count");
+ tree ustep;
+
+ utype = unsigned_type_for (type);
+
+ /* tmp = abs(to - from) / abs(step) */
+ ustep = fold_convert (utype, fold_build1 (ABS_EXPR, type, step));
+ tmp = fold_build3 (COND_EXPR, type, pos_step,
+ fold_build2 (MINUS_EXPR, type, to, from),
+ fold_build2 (MINUS_EXPR, type, from, to));
+ tmp = fold_build2 (TRUNC_DIV_EXPR, utype, fold_convert (utype, tmp),
+ ustep);
}
else
{
/* TODO: We could use the same width as the real type.
This would probably cause more problems that it solves
when we implement "long double" types. */
+ utype = unsigned_type_for (gfc_array_index_type);
+ tmp = fold_build2 (MINUS_EXPR, type, to, from);
tmp = fold_build2 (RDIV_EXPR, type, tmp, step);
- tmp = fold_build1 (FIX_TRUNC_EXPR, gfc_array_index_type, tmp);
- count = gfc_create_var (gfc_array_index_type, "count");
+ tmp = fold_build1 (FIX_TRUNC_EXPR, utype, tmp);
}
- gfc_add_modify_expr (&block, count, tmp);
+ countm1 = gfc_create_var (utype, "countm1");
+ gfc_add_modify_expr (&block, countm1, tmp);
- count_one = build_int_cst (TREE_TYPE (count), 1);
+ /* Cycle and exit statements are implemented with gotos. */
+ cycle_label = gfc_build_label_decl (NULL_TREE);
+ exit_label = gfc_build_label_decl (NULL_TREE);
+ TREE_USED (exit_label) = 1;
/* Initialize the DO variable: dovar = from. */
gfc_add_modify_expr (&block, dovar, from);
+ /* If the loop is empty, go directly to the exit label. */
+ tmp = fold_build3 (COND_EXPR, void_type_node, empty,
+ build1_v (GOTO_EXPR, exit_label), build_empty_stmt ());
+ gfc_add_expr_to_block (&block, tmp);
+
/* Loop body. */
gfc_start_block (&body);
- /* Cycle and exit statements are implemented with gotos. */
- cycle_label = gfc_build_label_decl (NULL_TREE);
- exit_label = gfc_build_label_decl (NULL_TREE);
-
- /* Start with the loop condition. Loop until count <= 0. */
- cond = fold_build2 (LE_EXPR, boolean_type_node, count,
- build_int_cst (TREE_TYPE (count), 0));
- tmp = build1_v (GOTO_EXPR, exit_label);
- TREE_USED (exit_label) = 1;
- tmp = fold_build3 (COND_EXPR, void_type_node,
- cond, tmp, build_empty_stmt ());
- gfc_add_expr_to_block (&body, tmp);
-
/* Put these labels where they can be found later. We put the
labels in a TREE_LIST node (because TREE_CHAIN is already
used). cycle_label goes in TREE_PURPOSE (backend_decl), exit
@@ -934,13 +947,21 @@ gfc_trans_do (gfc_code * code)
gfc_add_expr_to_block (&body, tmp);
}
+ /* End with the loop condition. Loop until countm1 == 0. */
+ cond = fold_build2 (EQ_EXPR, boolean_type_node, countm1,
+ build_int_cst (utype, 0));
+ tmp = build1_v (GOTO_EXPR, exit_label);
+ tmp = fold_build3 (COND_EXPR, void_type_node,
+ cond, tmp, build_empty_stmt ());
+ gfc_add_expr_to_block (&body, tmp);
+
/* Increment the loop variable. */
tmp = build2 (PLUS_EXPR, type, dovar, step);
gfc_add_modify_expr (&body, dovar, tmp);
/* Decrement the loop count. */
- tmp = build2 (MINUS_EXPR, TREE_TYPE (count), count, count_one);
- gfc_add_modify_expr (&body, count, tmp);
+ tmp = build2 (MINUS_EXPR, utype, countm1, build_int_cst (utype, 1));
+ gfc_add_modify_expr (&body, countm1, tmp);
/* End of loop body. */
tmp = gfc_finish_block (&body);
@@ -1691,14 +1712,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock,
tmpvar = gfc_create_var (build_pointer_type (type), "temp");
*pdata = convert (pvoid_type_node, tmpvar);
- if (gfc_index_integer_kind == 4)
- tmp = gfor_fndecl_internal_malloc;
- else if (gfc_index_integer_kind == 8)
- tmp = gfor_fndecl_internal_malloc64;
- else
- gcc_unreachable ();
- tmp = build_call_expr (tmp, 1, bytesize);
- tmp = convert (TREE_TYPE (tmpvar), tmp);
+ tmp = gfc_call_malloc (pblock, TREE_TYPE (tmpvar), bytesize);
gfc_add_modify_expr (pblock, tmpvar, tmp);
}
return tmpvar;
@@ -2209,7 +2223,7 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
if (ptemp1)
{
/* Free the temporary. */
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, ptemp1);
+ tmp = gfc_call_free (ptemp1);
gfc_add_expr_to_block (block, tmp);
}
}
@@ -2367,7 +2381,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
/* Free the temporary. */
if (ptemp1)
{
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, ptemp1);
+ tmp = gfc_call_free (ptemp1);
gfc_add_expr_to_block (block, tmp);
}
}
@@ -2702,7 +2716,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
if (pmask)
{
/* Free the temporary for the mask. */
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, pmask);
+ tmp = gfc_call_free (pmask);
gfc_add_expr_to_block (&block, tmp);
}
if (maskindex)
@@ -3299,14 +3313,14 @@ gfc_trans_where_2 (gfc_code * code, tree mask, bool invert,
/* If we allocated a pending mask array, deallocate it now. */
if (ppmask)
{
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, ppmask);
+ tmp = gfc_call_free (ppmask);
gfc_add_expr_to_block (block, tmp);
}
/* If we allocated a current mask array, deallocate it now. */
if (pcmask)
{
- tmp = build_call_expr (gfor_fndecl_internal_free, 1, pcmask);
+ tmp = gfc_call_free (pcmask);
gfc_add_expr_to_block (block, tmp);
}
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index c31b732101a..db85d96d3a2 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1785,6 +1785,13 @@ gfc_type_for_size (unsigned bits, int unsignedp)
if (type && bits == TYPE_PRECISION (type))
return type;
}
+
+ /* Handle TImode as a special case because it is used by some backends
+ (eg. 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;
+#endif
}
else
{
@@ -1839,14 +1846,6 @@ gfc_type_for_mode (enum machine_mode mode, int unsignedp)
return NULL_TREE;
}
-/* Return an unsigned type the same as TYPE in other respects. */
-
-tree
-gfc_unsigned_type (tree type)
-{
- return get_signed_or_unsigned_type (1, type);
-}
-
/* Return a signed type the same as TYPE in other respects. */
tree
diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h
index c39c375ad17..761b2184af5 100644
--- a/gcc/fortran/trans-types.h
+++ b/gcc/fortran/trans-types.h
@@ -82,7 +82,6 @@ tree gfc_get_function_type (gfc_symbol *);
tree gfc_type_for_size (unsigned, int);
tree gfc_type_for_mode (enum machine_mode, int);
-tree gfc_unsigned_type (tree);
tree gfc_signed_type (tree);
tree gfc_get_element_type (tree);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 64dbb73a59e..97336b68f61 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -29,6 +29,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "toplev.h"
#include "defaults.h"
#include "real.h"
+#include "flags.h"
#include "gfortran.h"
#include "trans.h"
#include "trans-stmt.h"
@@ -318,8 +319,8 @@ gfc_trans_runtime_check (tree cond, const char * msgid, stmtblock_t * pblock,
stmtblock_t block;
tree body;
tree tmp;
- tree arg;
- char * message;
+ tree arg, arg2;
+ char *message;
int line;
if (integer_zerop (cond))
@@ -335,17 +336,21 @@ gfc_trans_runtime_check (tree cond, const char * msgid, stmtblock_t * pblock,
#else
line = where->lb->linenum;
#endif
- asprintf (&message, "%s (in file '%s', at line %d)", _(msgid),
- where->lb->file->filename, line);
+ asprintf (&message, "At line %d of file %s", line,
+ where->lb->file->filename);
}
else
- asprintf (&message, "%s (in file '%s', around line %d)", _(msgid),
+ asprintf (&message, "In file '%s', around line %d",
gfc_source_file, input_line + 1);
arg = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message));
gfc_free(message);
+
+ asprintf (&message, "%s", _(msgid));
+ arg2 = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message));
+ gfc_free(message);
- tmp = build_call_expr (gfor_fndecl_runtime_error, 1, arg);
+ tmp = build_call_expr (gfor_fndecl_runtime_error_at, 2, arg, arg2);
gfc_add_expr_to_block (&block, tmp);
body = gfc_finish_block (&block);
@@ -368,6 +373,86 @@ gfc_trans_runtime_check (tree cond, const char * msgid, stmtblock_t * pblock,
}
+/* Call malloc to allocate size bytes of memory, with special conditions:
+ + if size < 0, generate a runtime error,
+ + if size == 0, return a NULL pointer,
+ + if malloc returns NULL, issue a runtime error. */
+tree
+gfc_call_malloc (stmtblock_t * block, tree type, tree size)
+{
+ tree tmp, msg, negative, zero, malloc_result, null_result, res;
+ stmtblock_t block2;
+
+ size = gfc_evaluate_now (size, block);
+
+ if (TREE_TYPE (size) != TREE_TYPE (size_type_node))
+ size = fold_convert (size_type_node, size);
+
+ /* Create a variable to hold the result. */
+ res = gfc_create_var (pvoid_type_node, NULL);
+
+ /* size < 0 ? */
+ negative = fold_build2 (LT_EXPR, boolean_type_node, size,
+ build_int_cst (size_type_node, 0));
+ msg = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const
+ ("Attempt to allocate a negative amount of memory."));
+ tmp = fold_build3 (COND_EXPR, void_type_node, negative,
+ build_call_expr (gfor_fndecl_runtime_error, 1, msg),
+ build_empty_stmt ());
+ gfc_add_expr_to_block (block, tmp);
+
+ /* Call malloc and check the result. */
+ gfc_start_block (&block2);
+ gfc_add_modify_expr (&block2, res,
+ build_call_expr (built_in_decls[BUILT_IN_MALLOC], 1,
+ size));
+ null_result = fold_build2 (EQ_EXPR, boolean_type_node, res,
+ build_int_cst (pvoid_type_node, 0));
+ msg = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const
+ ("Memory allocation failed"));
+ tmp = fold_build3 (COND_EXPR, void_type_node, null_result,
+ build_call_expr (gfor_fndecl_os_error, 1, msg),
+ build_empty_stmt ());
+ gfc_add_expr_to_block (&block2, tmp);
+ malloc_result = gfc_finish_block (&block2);
+
+ /* size == 0 */
+ zero = fold_build2 (EQ_EXPR, boolean_type_node, size,
+ build_int_cst (size_type_node, 0));
+ tmp = fold_build2 (MODIFY_EXPR, pvoid_type_node, res,
+ build_int_cst (pvoid_type_node, 0));
+ tmp = fold_build3 (COND_EXPR, void_type_node, zero, tmp, malloc_result);
+ gfc_add_expr_to_block (block, tmp);
+
+ if (type != NULL)
+ res = fold_convert (type, res);
+ return res;
+}
+
+
+/* Free a given variable, if it's not NULL. */
+tree
+gfc_call_free (tree var)
+{
+ stmtblock_t block;
+ tree tmp, cond, call;
+
+ if (TREE_TYPE (var) != TREE_TYPE (pvoid_type_node))
+ var = fold_convert (pvoid_type_node, var);
+
+ gfc_start_block (&block);
+ var = gfc_evaluate_now (var, &block);
+ cond = fold_build2 (NE_EXPR, boolean_type_node, var,
+ build_int_cst (pvoid_type_node, 0));
+ call = build_call_expr (built_in_decls[BUILT_IN_FREE], 1, var);
+ tmp = fold_build3 (COND_EXPR, void_type_node, cond, call,
+ build_empty_stmt ());
+ gfc_add_expr_to_block (&block, tmp);
+
+ return gfc_finish_block (&block);
+}
+
+
/* Add a statement to a block. */
void
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 7ca396608bd..da4b0c10352 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -439,6 +439,12 @@ bool get_array_ctor_strlen (gfc_constructor *, tree *);
/* Generate a runtime error check. */
void gfc_trans_runtime_check (tree, const char *, stmtblock_t *, locus *);
+/* Generate a call to free() after checking that its arg is non-NULL. */
+tree gfc_call_free (tree);
+
+/* Allocate memory after performing a few checks. */
+tree gfc_call_malloc (stmtblock_t *, tree, tree);
+
/* Generate code for an assignment, includes scalarization. */
tree gfc_trans_assignment (gfc_expr *, gfc_expr *, bool);
@@ -448,6 +454,7 @@ tree gfc_trans_pointer_assignment (gfc_expr *, gfc_expr *);
/* Initialize function decls for library functions. */
void gfc_build_intrinsic_lib_fndecls (void);
/* Create function decls for IO library functions. */
+void gfc_trans_io_runtime_check (tree, tree, int, const char *, stmtblock_t *);
void gfc_build_io_library_fndecls (void);
/* Build a function decl for a library function. */
tree gfc_build_library_function_decl (tree, tree, int, ...);
@@ -471,11 +478,8 @@ struct gimplify_omp_ctx;
void gfc_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, tree);
/* Runtime library function decls. */
-extern GTY(()) tree gfor_fndecl_internal_malloc;
-extern GTY(()) tree gfor_fndecl_internal_malloc64;
extern GTY(()) tree gfor_fndecl_internal_realloc;
extern GTY(()) tree gfor_fndecl_internal_realloc64;
-extern GTY(()) tree gfor_fndecl_internal_free;
extern GTY(()) tree gfor_fndecl_allocate;
extern GTY(()) tree gfor_fndecl_allocate64;
extern GTY(()) tree gfor_fndecl_allocate_array;
@@ -487,6 +491,9 @@ extern GTY(()) tree gfor_fndecl_stop_numeric;
extern GTY(()) tree gfor_fndecl_stop_string;
extern GTY(()) tree gfor_fndecl_select_string;
extern GTY(()) tree gfor_fndecl_runtime_error;
+extern GTY(()) tree gfor_fndecl_runtime_error_at;
+extern GTY(()) tree gfor_fndecl_os_error;
+extern GTY(()) tree gfor_fndecl_generate_error;
extern GTY(()) tree gfor_fndecl_set_fpe;
extern GTY(()) tree gfor_fndecl_set_std;
extern GTY(()) tree gfor_fndecl_ttynam;
diff --git a/gcc/function.h b/gcc/function.h
index 6fa3402d1ce..972dc2d1d44 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -190,7 +190,7 @@ struct function GTY(())
struct gimple_df *gimple_df;
/* The loops in this function. */
- struct loops * GTY((skip)) x_current_loops;
+ struct loops *x_current_loops;
/* Value histograms attached to particular statements. */
htab_t GTY((skip)) value_histograms;
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 10468026939..5ed41bd66ff 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -127,6 +127,9 @@ static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
/* Flag set by cppspec.c to 1. */
int is_cpp_driver;
+/* Flag set to non-zero if an @file argument has been supplied to gcc. */
+static bool at_file_supplied;
+
/* Flag saying to pass the greatest exit code returned by a sub-process
to the calling program. */
static int pass_exit_codes;
@@ -5009,9 +5012,63 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
int max = n_infiles;
max += lang_specific_extra_outfiles;
- for (i = 0; i < max; i++)
- if (outfiles[i])
- store_arg (outfiles[i], 0, 0);
+ if (HAVE_GNU_LD && at_file_supplied)
+ {
+ /* We are going to expand `%o' to `@FILE', where FILE
+ is a newly-created temporary filename. The filenames
+ that would usually be expanded in place of %o will be
+ written to the temporary file. */
+
+ char *temp_file = make_temp_file ("");
+ char *at_argument;
+ char **argv;
+ int n_files, j, status;
+ FILE *f;
+
+ at_argument = concat ("@", temp_file, NULL);
+ store_arg (at_argument, 0, 0);
+
+ /* Convert OUTFILES into a form suitable for writeargv. */
+
+ /* Determine how many are non-NULL. */
+ for (n_files = 0, i = 0; i < max; i++)
+ n_files += outfiles[i] != NULL;
+
+ argv = alloca (sizeof (char *) * (n_files + 1));
+
+ /* Copy the strings over. */
+ for (i = 0, j = 0; i < max; i++)
+ if (outfiles[i])
+ {
+ argv[j] = (char *) outfiles[i];
+ j++;
+ }
+ argv[j] = NULL;
+
+ f = fopen (temp_file, "w");
+
+ if (f == NULL)
+ fatal ("could not open temporary response file %s",
+ temp_file);
+
+ status = writeargv (argv, f);
+
+ if (status)
+ fatal ("could not write to temporary response file %s",
+ temp_file);
+
+ status = fclose (f);
+
+ if (EOF == status)
+ fatal ("could not close temporary response file %s",
+ temp_file);
+
+ record_temp_file (temp_file, !save_temps_flag, !save_temps_flag);
+ }
+ else
+ for (i = 0; i < max; i++)
+ if (outfiles[i])
+ store_arg (outfiles[i], 0, 0);
break;
}
@@ -6093,6 +6150,7 @@ main (int argc, char **argv)
char *specs_file;
const char *p;
struct user_specs *uptr;
+ char **old_argv = argv;
p = argv[0] + strlen (argv[0]);
while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
@@ -6103,6 +6161,10 @@ main (int argc, char **argv)
expandargv (&argc, &argv);
+ /* Determine if any expansions were made. */
+ if (argv != old_argv)
+ at_file_supplied = true;
+
prune_options (&argc, &argv);
#ifdef GCC_DRIVER_HOST_INITIALIZATION
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 47be2591b84..c5be0809d1e 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -794,7 +794,7 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
alloc_gcse_mem ();
/* This time, go ahead and allow cprop to alter jumps. */
timevar_push (TV_CPROP2);
- one_cprop_pass (pass + 1, true, false);
+ one_cprop_pass (pass + 1, true, true);
timevar_pop (TV_CPROP2);
free_gcse_mem ();
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index 26eb281e812..5bfdf96fa43 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -1542,12 +1542,12 @@ gen_regexp_el (const char *str)
}
else if (strcmp (str, NOTHING_NAME) == 0)
{
- regexp = create_node (sizeof (struct decl));
+ regexp = create_node (sizeof *regexp);
regexp->mode = rm_nothing;
}
else
{
- regexp = create_node (sizeof (struct decl));
+ regexp = create_node (sizeof *regexp);
regexp->mode = rm_unit;
REGEXP_UNIT (regexp)->name = str;
}
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index c291fe64c6b..fc4536c45f2 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1535,7 +1535,7 @@ open_base_files (void)
"hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
"optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
"tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
- "cfglayout.h", "except.h", "output.h", NULL
+ "cfglayout.h", "except.h", "output.h", "cfgloop.h", NULL
};
const char *const *ifp;
outf_p gtype_desc_c;
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index 992981aa8c0..a16d0e17c6b 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -87,6 +87,8 @@ static const char * const optabs[] =
"usmul_widen_optab->handlers[$B].insn_code = CODE_FOR_$(usmul$a$b3$)$N",
"smadd_widen_optab->handlers[$B].insn_code = CODE_FOR_$(madd$a$b4$)$N",
"umadd_widen_optab->handlers[$B].insn_code = CODE_FOR_$(umadd$a$b4$)$N",
+ "smsub_widen_optab->handlers[$B].insn_code = CODE_FOR_$(msub$a$b4$)$N",
+ "umsub_widen_optab->handlers[$B].insn_code = CODE_FOR_$(umsub$a$b4$)$N",
"sdiv_optab->handlers[$A].insn_code = CODE_FOR_$(div$a3$)",
"sdivv_optab->handlers[$A].insn_code = CODE_FOR_$(div$V$I$a3$)",
"udiv_optab->handlers[$A].insn_code = CODE_FOR_$(udiv$I$a3$)",
@@ -231,9 +233,15 @@ static const char * const optabs[] =
"vec_unpacks_lo_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacks_lo_$a$)",
"vec_unpacku_hi_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacku_hi_$a$)",
"vec_unpacku_lo_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacku_lo_$a$)",
+ "vec_unpacks_float_hi_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacks_float_hi_$a$)",
+ "vec_unpacks_float_lo_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacks_float_lo_$a$)",
+ "vec_unpacku_float_hi_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacku_float_hi_$a$)",
+ "vec_unpacku_float_lo_optab->handlers[$A].insn_code = CODE_FOR_$(vec_unpacku_float_lo_$a$)",
"vec_pack_trunc_optab->handlers[$A].insn_code = CODE_FOR_$(vec_pack_trunc_$a$)",
"vec_pack_ssat_optab->handlers[$A].insn_code = CODE_FOR_$(vec_pack_ssat_$a$)",
- "vec_pack_usat_optab->handlers[$A].insn_code = CODE_FOR_$(vec_pack_usat_$a$)"
+ "vec_pack_usat_optab->handlers[$A].insn_code = CODE_FOR_$(vec_pack_usat_$a$)",
+ "vec_pack_sfix_trunc_optab->handlers[$A].insn_code = CODE_FOR_$(vec_pack_sfix_trunc_$a$)",
+ "vec_pack_ufix_trunc_optab->handlers[$A].insn_code = CODE_FOR_$(vec_pack_ufix_trunc_$a$)"
};
static void gen_insn (rtx);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 805c3020272..a6978d95296 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -5881,7 +5881,24 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
{
*expr_p = build_fold_addr_expr_with_type (tmp,
TREE_TYPE (*expr_p));
- break;
+ break;
+ }
+ /* Convert (void *)&a + 4 into (void *)&a[1]. */
+ if (POINTER_TYPE_P (TREE_TYPE (*expr_p))
+ && TREE_CODE (TREE_OPERAND (*expr_p, 0)) == NOP_EXPR
+ && TREE_CODE (TREE_OPERAND (*expr_p, 1)) == INTEGER_CST
+ && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (*expr_p,
+ 0),0)))
+ && (tmp = maybe_fold_offset_to_reference
+ (TREE_OPERAND (TREE_OPERAND (*expr_p, 0), 0),
+ TREE_OPERAND (*expr_p, 1),
+ TREE_TYPE (TREE_TYPE
+ (TREE_OPERAND (TREE_OPERAND (*expr_p, 0),
+ 0))))))
+ {
+ tmp = build_fold_addr_expr (tmp);
+ *expr_p = fold_convert (TREE_TYPE (*expr_p), tmp);
+ break;
}
/* FALLTHRU */
default:
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 50937dc672e..c2384d5ee0d 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -485,6 +485,9 @@ haifa_classify_insn (rtx insn)
return insn_class;
}
+/* A typedef for rtx vector. */
+typedef VEC(rtx, heap) *rtx_vec_t;
+
/* Forward declarations. */
static int priority (rtx);
@@ -569,9 +572,9 @@ static void fix_jump_move (rtx);
static void move_block_after_check (rtx);
static void move_succs (VEC(edge,gc) **, basic_block);
static void sched_remove_insn (rtx);
-static void clear_priorities (rtx);
+static void clear_priorities (rtx, rtx_vec_t *);
+static void calc_priorities (rtx_vec_t);
static void add_jump_dependencies (rtx, rtx);
-static void calc_priorities (rtx);
#ifdef ENABLE_CHECKING
static int has_edge_p (VEC(edge,gc) *, int);
static void check_cfg (rtx, rtx);
@@ -697,8 +700,30 @@ dep_cost (dep_t link)
return cost;
}
-/* Compute the priority number for INSN. */
+/* Return 'true' if DEP should be included in priority calculations. */
+static bool
+contributes_to_priority_p (dep_t dep)
+{
+ /* Critical path is meaningful in block boundaries only. */
+ if (!current_sched_info->contributes_to_priority (DEP_CON (dep),
+ DEP_PRO (dep)))
+ return false;
+
+ /* If flag COUNT_SPEC_IN_CRITICAL_PATH is set,
+ then speculative instructions will less likely be
+ scheduled. That is because the priority of
+ their producers will increase, and, thus, the
+ producers will more likely be scheduled, thus,
+ resolving the dependence. */
+ if ((current_sched_info->flags & DO_SPECULATION)
+ && !(spec_info->flags & COUNT_SPEC_IN_CRITICAL_PATH)
+ && (DEP_STATUS (dep) & SPECULATIVE))
+ return false;
+ return true;
+}
+
+/* Compute the priority number for INSN. */
static int
priority (rtx insn)
{
@@ -707,7 +732,10 @@ priority (rtx insn)
if (! INSN_P (insn))
return 0;
- if (! INSN_PRIORITY_KNOWN (insn))
+ /* We should not be insterested in priority of an already scheduled insn. */
+ gcc_assert (QUEUE_INDEX (insn) != QUEUE_SCHEDULED);
+
+ if (!INSN_PRIORITY_KNOWN (insn))
{
int this_priority = 0;
@@ -754,20 +782,7 @@ priority (rtx insn)
{
int cost;
- /* Critical path is meaningful in block boundaries
- only. */
- if (! (*current_sched_info->contributes_to_priority)
- (next, insn)
- /* If flag COUNT_SPEC_IN_CRITICAL_PATH is set,
- then speculative instructions will less likely be
- scheduled. That is because the priority of
- their producers will increase, and, thus, the
- producers will more likely be scheduled, thus,
- resolving the dependence. */
- || ((current_sched_info->flags & DO_SPECULATION)
- && (DEP_STATUS (dep) & SPECULATIVE)
- && !(spec_info->flags
- & COUNT_SPEC_IN_CRITICAL_PATH)))
+ if (!contributes_to_priority_p (dep))
continue;
if (twin == insn)
@@ -793,7 +808,7 @@ priority (rtx insn)
while (twin != prev_first);
}
INSN_PRIORITY (insn) = this_priority;
- INSN_PRIORITY_KNOWN (insn) = 1;
+ INSN_PRIORITY_STATUS (insn) = 1;
}
return INSN_PRIORITY (insn);
@@ -826,6 +841,9 @@ rank_for_schedule (const void *x, const void *y)
if (SCHED_GROUP_P (tmp) != SCHED_GROUP_P (tmp2))
return SCHED_GROUP_P (tmp2) ? 1 : -1;
+ /* Make sure that priority of TMP and TMP2 are initialized. */
+ gcc_assert (INSN_PRIORITY_KNOWN (tmp) && INSN_PRIORITY_KNOWN (tmp2));
+
/* Prefer insn with higher priority. */
priority_val = INSN_PRIORITY (tmp2) - INSN_PRIORITY (tmp);
@@ -2554,9 +2572,10 @@ set_priorities (rtx head, rtx tail)
n_insn++;
(void) priority (insn);
- if (INSN_PRIORITY_KNOWN (insn))
- sched_max_insns_priority =
- MAX (sched_max_insns_priority, INSN_PRIORITY (insn));
+ gcc_assert (INSN_PRIORITY_KNOWN (insn));
+
+ sched_max_insns_priority = MAX (sched_max_insns_priority,
+ INSN_PRIORITY (insn));
}
current_sched_info->sched_max_insns_priority = sched_max_insns_priority;
@@ -3231,6 +3250,7 @@ add_to_speculative_block (rtx insn)
ds_t ts;
dep_link_t link;
rtx twins = NULL;
+ rtx_vec_t priorities_roots;
ts = TODO_SPEC (insn);
gcc_assert (!(ts & ~BE_IN_SPEC));
@@ -3262,7 +3282,8 @@ add_to_speculative_block (rtx insn)
link = DEP_LINK_NEXT (link);
}
- clear_priorities (insn);
+ priorities_roots = NULL;
+ clear_priorities (insn, &priorities_roots);
do
{
@@ -3349,13 +3370,15 @@ add_to_speculative_block (rtx insn)
rtx twin;
twin = XEXP (twins, 0);
- calc_priorities (twin);
add_back_forw_dep (twin, insn, REG_DEP_OUTPUT, DEP_OUTPUT);
twin = XEXP (twins, 1);
free_INSN_LIST_node (twins);
twins = twin;
}
+
+ calc_priorities (priorities_roots);
+ VEC_free (rtx, heap, priorities_roots);
}
/* Extends and fills with zeros (only the new part) array pointed to by P. */
@@ -3800,8 +3823,11 @@ create_check_block_twin (rtx insn, bool mutate_p)
/* Fix priorities. If MUTATE_P is nonzero, this is not necessary,
because it'll be done later in add_to_speculative_block. */
{
- clear_priorities (twin);
- calc_priorities (twin);
+ rtx_vec_t priorities_roots = NULL;
+
+ clear_priorities (twin, &priorities_roots);
+ calc_priorities (priorities_roots);
+ VEC_free (rtx, heap, priorities_roots);
}
}
@@ -4169,42 +4195,50 @@ sched_remove_insn (rtx insn)
remove_insn (insn);
}
-/* Clear priorities of all instructions, that are
- forward dependent on INSN. */
+/* Clear priorities of all instructions, that are forward dependent on INSN.
+ Store in vector pointed to by ROOTS_PTR insns on which priority () should
+ be invoked to initialize all cleared priorities. */
static void
-clear_priorities (rtx insn)
+clear_priorities (rtx insn, rtx_vec_t *roots_ptr)
{
dep_link_t link;
+ bool insn_is_root_p = true;
+
+ gcc_assert (QUEUE_INDEX (insn) != QUEUE_SCHEDULED);
FOR_EACH_DEP_LINK (link, INSN_BACK_DEPS (insn))
{
- rtx pro = DEP_LINK_PRO (link);
+ dep_t dep = DEP_LINK_DEP (link);
+ rtx pro = DEP_PRO (dep);
- if (INSN_PRIORITY_KNOWN (pro))
+ if (INSN_PRIORITY_STATUS (pro) >= 0
+ && QUEUE_INDEX (insn) != QUEUE_SCHEDULED)
{
- INSN_PRIORITY_KNOWN (pro) = 0;
- clear_priorities (pro);
+ /* If DEP doesn't contribute to priority then INSN itself should
+ be added to priority roots. */
+ if (contributes_to_priority_p (dep))
+ insn_is_root_p = false;
+
+ INSN_PRIORITY_STATUS (pro) = -1;
+ clear_priorities (pro, roots_ptr);
}
}
+
+ if (insn_is_root_p)
+ VEC_safe_push (rtx, heap, *roots_ptr, insn);
}
/* Recompute priorities of instructions, whose priorities might have been
- changed due to changes in INSN. */
+ changed. ROOTS is a vector of instructions whose priority computation will
+ trigger initialization of all cleared priorities. */
static void
-calc_priorities (rtx insn)
+calc_priorities (rtx_vec_t roots)
{
- dep_link_t link;
-
- FOR_EACH_DEP_LINK (link, INSN_BACK_DEPS (insn))
- {
- rtx pro = DEP_LINK_PRO (link);
+ int i;
+ rtx insn;
- if (!INSN_PRIORITY_KNOWN (pro))
- {
- priority (pro);
- calc_priorities (pro);
- }
- }
+ for (i = 0; VEC_iterate (rtx, roots, i, insn); i++)
+ priority (insn);
}
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 1db2cabcc34..dcd7dfd0883 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2938,7 +2938,7 @@ find_if_header (basic_block test_bb, int pass)
&& find_cond_trap (test_bb, then_edge, else_edge))
goto success;
- if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY
+ if (dom_info_state (CDI_POST_DOMINATORS) >= DOM_NO_FAST_QUERY
&& (! HAVE_conditional_execution || reload_completed))
{
if (find_if_case_1 (test_bb, then_edge, else_edge))
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 04306aaa7e0..076979ed5de 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -668,6 +668,9 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node)
int depth = 0;
int n = 0;
+ if (optimize_size)
+ return false;
+
if (DECL_DECLARED_INLINE_P (node->decl))
{
limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE);
@@ -913,7 +916,7 @@ cgraph_decide_inlining_of_small_functions (void)
}
}
- if (!cgraph_maybe_hot_edge_p (edge) && growth > 0)
+ if ((!cgraph_maybe_hot_edge_p (edge) || optimize_size) && growth > 0)
{
if (!cgraph_recursive_inlining_p (edge->caller, edge->callee,
&edge->inline_failed))
@@ -1444,7 +1447,7 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount)
return 0;
if (cgraph_decide_inlining_incrementally (node,
- flag_unit_at_a_time
+ flag_unit_at_a_time || optimize_size
? INLINE_SIZE : INLINE_SPEED, 0))
{
timevar_push (TV_INTEGRATION);
diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c
index 921284db667..1619c5e47c0 100644
--- a/gcc/ipa-type-escape.c
+++ b/gcc/ipa-type-escape.c
@@ -196,8 +196,9 @@ compare_type_brand (splay_tree_key sk1, splay_tree_key sk2)
/* This is a trivial algorithm for removing duplicate types. This
would not work for any language that used structural equivalence as
the basis of its type system. */
-/* Return either TYPE if this is first time TYPE has been seen an
- compatible TYPE that has already been processed. */
+/* Return TYPE if no type compatible with TYPE has been seen so far,
+ otherwise return a type compatible with TYPE that has already been
+ processed. */
static tree
discover_unique_type (tree type)
@@ -1662,7 +1663,7 @@ ipa_init (void)
/* Check out the rhs of a static or global initialization VNODE to see
if any of them contain addressof operations. Note that some of
- these variables may not even be referenced in the code in this
+ these variables may not even be referenced in the code in this
compilation unit but their right hand sides may contain references
to variables defined within this unit. */
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 202ffc33763..dceb9690a8f 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * expr.c (build_java_binop): Use unsigned_type_for instead of
+ java_unsigned_type.
+ * java-tree.h (java_unsigned_type): Remove.
+ * lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+ * typeck.c (java_unsigned_type): Remove.
+
2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
* java-tree.h (lang_tree_node): Use GENERIC_NEXT
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 1a5ec68648b..c915a91589f 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1523,7 +1523,7 @@ build_java_binop (enum tree_code op, tree type, tree arg1, tree arg2)
{
case URSHIFT_EXPR:
{
- tree u_type = java_unsigned_type (type);
+ tree u_type = unsigned_type_for (type);
arg1 = convert (u_type, arg1);
arg1 = build_java_binop (RSHIFT_EXPR, u_type, arg1, arg2);
return convert (type, arg1);
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index d560deeaeda..cf41ef2435c 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -1099,7 +1099,6 @@ extern void java_parse_file (int);
extern bool java_mark_addressable (tree);
extern tree java_type_for_mode (enum machine_mode, int);
extern tree java_type_for_size (unsigned int, int);
-extern tree java_unsigned_type (tree);
extern tree java_signed_type (tree);
extern tree java_truthvalue_conversion (tree);
extern void add_assume_compiled (const char *, int);
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 723d9a69a43..5b0cbe84140 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -184,8 +184,6 @@ struct language_function GTY(())
#define LANG_HOOKS_TYPE_FOR_SIZE java_type_for_size
#undef LANG_HOOKS_SIGNED_TYPE
#define LANG_HOOKS_SIGNED_TYPE java_signed_type
-#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE java_unsigned_type
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN java_dump_tree
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index b35461b4761..0d70929d099 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -203,14 +203,6 @@ java_signed_type (tree type)
return get_signed_or_unsigned_type (0, type);
}
-/* Return an unsigned type the same as TYPE in other respects. */
-
-tree
-java_unsigned_type (tree type)
-{
- return get_signed_or_unsigned_type (1, type);
-}
-
/* Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
Value is true if successful. */
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index 655c0258230..579c3d3fb7f 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1187,12 +1187,11 @@ invariant_in_loop_and_outer_loops (struct loop *loop, tree op)
{
if (is_gimple_min_invariant (op))
return true;
- if (loop->depth == 0)
+ if (loop_depth (loop) == 0)
return true;
if (!expr_invariant_in_loop_p (loop, op))
return false;
- if (loop->outer
- && !invariant_in_loop_and_outer_loops (loop->outer, op))
+ if (!invariant_in_loop_and_outer_loops (loop_outer (loop), op))
return false;
return true;
}
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index c2d5bc2e22c..def7a4a5381 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -211,7 +211,6 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_MAKE_TYPE, \
LANG_HOOKS_TYPE_FOR_MODE, \
LANG_HOOKS_TYPE_FOR_SIZE, \
- LANG_HOOKS_UNSIGNED_TYPE, \
LANG_HOOKS_SIGNED_TYPE, \
LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, \
LANG_HOOKS_GENERIC_TYPE_P, \
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 3e38f2653bd..b3719c7094d 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -103,10 +103,6 @@ struct lang_hooks_for_types
integer type with at least that precision. */
tree (*type_for_size) (unsigned, int);
- /* Given an integer type T, return a type like T but unsigned.
- If T is unsigned, the value is T. */
- tree (*unsigned_type) (tree);
-
/* Given an integer type T, return a type like T but signed.
If T is signed, the value is T. */
tree (*signed_type) (tree);
diff --git a/gcc/libgcc-std.ver b/gcc/libgcc-std.ver
index 4b707944e80..3dcca01f48f 100644
--- a/gcc/libgcc-std.ver
+++ b/gcc/libgcc-std.ver
@@ -282,4 +282,7 @@ GCC_4.3.0 {
__bswapdi2
__emutls_get_address
__emutls_register_common
+ __ffssi2
+ __extendxftf2
+ __trunctfxf2
}
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 8b512d2f284..b96e8bbb640 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -341,19 +341,48 @@ UDItype __umulsidi3 (USItype, USItype);
: "0" ((USItype) (n0)), \
"1" ((USItype) (n1)), \
"rm" ((USItype) (dv)))
-#define count_leading_zeros(count, x) \
- do { \
- USItype __cbtmp; \
- __asm__ ("bsrl %1,%0" \
- : "=r" (__cbtmp) : "rm" ((USItype) (x))); \
- (count) = __cbtmp ^ 31; \
- } while (0)
-#define count_trailing_zeros(count, x) \
- __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)))
+#define count_leading_zeros(count, x) ((count) = __builtin_clz (x))
+#define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
#define UMUL_TIME 40
#define UDIV_TIME 40
#endif /* 80x86 */
+#if (defined (__x86_64__) || defined (__i386__)) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addq %5,%1\n\tadcq %3,%0" \
+ : "=r" ((UDItype) (sh)), \
+ "=&r" ((UDItype) (sl)) \
+ : "%0" ((UDItype) (ah)), \
+ "rme" ((UDItype) (bh)), \
+ "%1" ((UDItype) (al)), \
+ "rme" ((UDItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subq %5,%1\n\tsbbq %3,%0" \
+ : "=r" ((UDItype) (sh)), \
+ "=&r" ((UDItype) (sl)) \
+ : "0" ((UDItype) (ah)), \
+ "rme" ((UDItype) (bh)), \
+ "1" ((UDItype) (al)), \
+ "rme" ((UDItype) (bl)))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mulq %3" \
+ : "=a" ((UDItype) (w0)), \
+ "=d" ((UDItype) (w1)) \
+ : "%0" ((UDItype) (u)), \
+ "rm" ((UDItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, dv) \
+ __asm__ ("divq %4" \
+ : "=a" ((UDItype) (q)), \
+ "=d" ((UDItype) (r)) \
+ : "0" ((UDItype) (n0)), \
+ "1" ((UDItype) (n1)), \
+ "rm" ((UDItype) (dv)))
+#define count_leading_zeros(count, x) ((count) = __builtin_clzl (x))
+#define count_trailing_zeros(count, x) ((count) = __builtin_ctzl (x))
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* x86_64 */
+
#if defined (__i960__) && W_TYPE_SIZE == 32
#define umul_ppmm(w1, w0, u, v) \
({union {UDItype __ll; \
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 3ad0e723c31..78087a241ba 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -32,6 +32,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "timevar.h"
#include "flags.h"
#include "df.h"
+#include "ggc.h"
/* Initialize loop structures. This is used by the tree and RTL loop
@@ -44,7 +45,7 @@ loop_optimizer_init (unsigned flags)
struct loops *loops;
gcc_assert (!current_loops);
- loops = XCNEW (struct loops);
+ loops = GGC_CNEW (struct loops);
/* Find the loops. */
@@ -117,7 +118,7 @@ loop_optimizer_finalize (void)
if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
release_recorded_exits ();
flow_loops_free (current_loops);
- free (current_loops);
+ ggc_free (current_loops);
current_loops = NULL;
FOR_ALL_BB (bb)
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 2049385231a..d0e3ac931e2 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -1211,10 +1211,22 @@ move_invariant_reg (struct loop *loop, unsigned invno)
to let emit_move_insn produce a valid instruction stream. */
if (REG_P (dest) && !HARD_REGISTER_P (dest))
{
+ rtx note;
+
emit_insn_after (gen_move_insn (dest, reg), inv->insn);
SET_DEST (set) = reg;
df_insn_rescan (inv->insn);
reorder_insns (inv->insn, inv->insn, BB_END (preheader));
+
+ /* If there is a REG_EQUAL note on the insn we just moved, and
+ insn is in a basic block that is not always executed, the note
+ may no longer be valid after we move the insn.
+ Note that uses in REG_EQUAL notes are taken into account in
+ the computation of invariants. Hence it is safe to retain the
+ note even if the note contains register references. */
+ if (! inv->always_executed
+ && (note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX)))
+ remove_note (inv->insn, note);
}
else
{
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index d1322d11e39..c5653b2c051 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -2014,7 +2014,30 @@ expand_var_during_unrolling (struct var_to_expand *ve, rtx insn)
/* Initialize the variable expansions in loop preheader.
Callbacks for htab_traverse. PLACE_P is the loop-preheader
basic block where the initialization of the expansions
- should take place. */
+ should take place. The expansions are initialized with (-0)
+ when the operation is plus or minus to honor sign zero.
+ This way we can prevent cases where the sign of the final result is
+ effected by the sign of the expansion.
+ Here is an example to demonstrate this:
+
+ for (i = 0 ; i < n; i++)
+ sum += something;
+
+ ==>
+
+ sum += something
+ ....
+ i = i+1;
+ sum1 += something
+ ....
+ i = i+1
+ sum2 += something;
+ ....
+
+ When SUM is initialized with -zero and SOMETHING is also -zero; the
+ final result of sum should be -zero thus the expansions sum1 and sum2
+ should be initialized with -zero as well (otherwise we will get +zero
+ as the final result). */
static int
insert_var_expansion_initialization (void **slot, void *place_p)
@@ -2023,7 +2046,9 @@ insert_var_expansion_initialization (void **slot, void *place_p)
basic_block place = (basic_block)place_p;
rtx seq, var, zero_init, insn;
unsigned i;
-
+ enum machine_mode mode = GET_MODE (ve->reg);
+ bool honor_signed_zero_p = HONOR_SIGNED_ZEROS (mode);
+
if (VEC_length (rtx, ve->var_expansions) == 0)
return 1;
@@ -2031,7 +2056,11 @@ insert_var_expansion_initialization (void **slot, void *place_p)
if (ve->op == PLUS || ve->op == MINUS)
for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
{
- zero_init = CONST0_RTX (GET_MODE (var));
+ if (honor_signed_zero_p)
+ zero_init = simplify_gen_unary (NEG, mode, CONST0_RTX (mode), mode);
+ else
+ zero_init = CONST0_RTX (mode);
+
emit_move_insn (var, zero_init);
}
else if (ve->op == MULT)
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index be047b5c901..80aad5f4cf7 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -807,7 +807,7 @@ static bool
loop_canon_p (struct loop *loop)
{
- if (loop->inner || ! loop->outer)
+ if (loop->inner || !loop_outer (loop))
return false;
if (!single_exit (loop))
diff --git a/gcc/optabs.c b/gcc/optabs.c
index cc5923797b8..c1dd744e2fd 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -344,12 +344,26 @@ optab_for_tree_code (enum tree_code code, tree type)
return TYPE_UNSIGNED (type) ?
vec_unpacku_lo_optab : vec_unpacks_lo_optab;
+ case VEC_UNPACK_FLOAT_HI_EXPR:
+ /* The signedness is determined from input operand. */
+ return TYPE_UNSIGNED (type) ?
+ vec_unpacku_float_hi_optab : vec_unpacks_float_hi_optab;
+
+ case VEC_UNPACK_FLOAT_LO_EXPR:
+ /* The signedness is determined from input operand. */
+ return TYPE_UNSIGNED (type) ?
+ vec_unpacku_float_lo_optab : vec_unpacks_float_lo_optab;
+
case VEC_PACK_TRUNC_EXPR:
return vec_pack_trunc_optab;
case VEC_PACK_SAT_EXPR:
return TYPE_UNSIGNED (type) ? vec_pack_usat_optab : vec_pack_ssat_optab;
+ case VEC_PACK_FIX_TRUNC_EXPR:
+ return TYPE_UNSIGNED (type) ?
+ vec_pack_ufix_trunc_optab : vec_pack_sfix_trunc_optab;
+
default:
break;
}
@@ -688,12 +702,12 @@ expand_vec_shift_expr (tree vec_shift_expr, rtx target)
mode1 = insn_data[icode].operand[1].mode;
mode2 = insn_data[icode].operand[2].mode;
- rtx_op1 = expand_expr (vec_oprnd, NULL_RTX, VOIDmode, EXPAND_NORMAL);
+ rtx_op1 = expand_normal (vec_oprnd);
if (!(*insn_data[icode].operand[1].predicate) (rtx_op1, mode1)
&& mode1 != VOIDmode)
rtx_op1 = force_reg (mode1, rtx_op1);
- rtx_op2 = expand_expr (shift_oprnd, NULL_RTX, VOIDmode, EXPAND_NORMAL);
+ rtx_op2 = expand_normal (shift_oprnd);
if (!(*insn_data[icode].operand[2].predicate) (rtx_op2, mode2)
&& mode2 != VOIDmode)
rtx_op2 = force_reg (mode2, rtx_op2);
@@ -1379,7 +1393,9 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if (binoptab == vec_pack_trunc_optab
|| binoptab == vec_pack_usat_optab
- || binoptab == vec_pack_ssat_optab)
+ || binoptab == vec_pack_ssat_optab
+ || binoptab == vec_pack_ufix_trunc_optab
+ || binoptab == vec_pack_sfix_trunc_optab)
{
/* The mode of the result is different then the mode of the
arguments. */
@@ -5455,6 +5471,8 @@ init_optabs (void)
usmul_widen_optab = init_optab (UNKNOWN);
smadd_widen_optab = init_optab (UNKNOWN);
umadd_widen_optab = init_optab (UNKNOWN);
+ smsub_widen_optab = init_optab (UNKNOWN);
+ umsub_widen_optab = init_optab (UNKNOWN);
sdiv_optab = init_optab (DIV);
sdivv_optab = init_optabv (DIV);
sdivmod_optab = init_optab (UNKNOWN);
@@ -5576,9 +5594,15 @@ init_optabs (void)
vec_unpacks_lo_optab = init_optab (UNKNOWN);
vec_unpacku_hi_optab = init_optab (UNKNOWN);
vec_unpacku_lo_optab = init_optab (UNKNOWN);
+ vec_unpacks_float_hi_optab = init_optab (UNKNOWN);
+ vec_unpacks_float_lo_optab = init_optab (UNKNOWN);
+ vec_unpacku_float_hi_optab = init_optab (UNKNOWN);
+ vec_unpacku_float_lo_optab = init_optab (UNKNOWN);
vec_pack_trunc_optab = init_optab (UNKNOWN);
vec_pack_usat_optab = init_optab (UNKNOWN);
vec_pack_ssat_optab = init_optab (UNKNOWN);
+ vec_pack_ufix_trunc_optab = init_optab (UNKNOWN);
+ vec_pack_sfix_trunc_optab = init_optab (UNKNOWN);
powi_optab = init_optab (UNKNOWN);
@@ -5961,8 +5985,10 @@ vector_compare_rtx (tree cond, bool unsignedp, enum insn_code icode)
t_op1 = TREE_OPERAND (cond, 1);
/* Expand operands. */
- rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)), 1);
- rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)), 1);
+ rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)),
+ EXPAND_STACK_PARM);
+ rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)),
+ EXPAND_STACK_PARM);
if (!insn_data[icode].operand[4].predicate (rtx_op0, GET_MODE (rtx_op0))
&& GET_MODE (rtx_op0) != VOIDmode)
@@ -6023,14 +6049,12 @@ expand_vec_cond_expr (tree vec_cond_expr, rtx target)
cc_op0 = XEXP (comparison, 0);
cc_op1 = XEXP (comparison, 1);
/* Expand both operands and force them in reg, if required. */
- rtx_op1 = expand_expr (TREE_OPERAND (vec_cond_expr, 1),
- NULL_RTX, VOIDmode, EXPAND_NORMAL);
+ rtx_op1 = expand_normal (TREE_OPERAND (vec_cond_expr, 1));
if (!insn_data[icode].operand[1].predicate (rtx_op1, mode)
&& mode != VOIDmode)
rtx_op1 = force_reg (mode, rtx_op1);
- rtx_op2 = expand_expr (TREE_OPERAND (vec_cond_expr, 2),
- NULL_RTX, VOIDmode, EXPAND_NORMAL);
+ rtx_op2 = expand_normal (TREE_OPERAND (vec_cond_expr, 2));
if (!insn_data[icode].operand[2].predicate (rtx_op2, mode)
&& mode != VOIDmode)
rtx_op2 = force_reg (mode, rtx_op2);
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 4e71a109f69..3f9e48ad367 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -92,6 +92,12 @@ enum optab_index
/* Unigned multiply and add with the result and addend one machine mode
wider than the multiplicand and multiplier. */
OTI_umadd_widen,
+ /* Signed multiply and subtract the result and minuend one machine mode
+ wider than the multiplicand and multiplier. */
+ OTI_smsub_widen,
+ /* Unigned multiply and subtract the result and minuend one machine mode
+ wider than the multiplicand and multiplier. */
+ OTI_umsub_widen,
/* Signed divide */
OTI_sdiv,
@@ -292,11 +298,24 @@ enum optab_index
elements. */
OTI_vec_unpacku_hi,
OTI_vec_unpacku_lo,
+
+ /* Extract, convert to floating point and widen the high/low part of
+ a vector of signed or unsigned integer elements. */
+ OTI_vec_unpacks_float_hi,
+ OTI_vec_unpacks_float_lo,
+ OTI_vec_unpacku_float_hi,
+ OTI_vec_unpacku_float_lo,
+
/* Narrow (demote) and merge the elements of two vectors. */
OTI_vec_pack_trunc,
OTI_vec_pack_usat,
OTI_vec_pack_ssat,
+ /* Convert to signed/unsigned integer, narrow and merge elements
+ of two vectors of floating point elements. */
+ OTI_vec_pack_sfix_trunc,
+ OTI_vec_pack_ufix_trunc,
+
/* Perform a raise to the power of integer. */
OTI_powi,
@@ -317,6 +336,8 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define usmul_widen_optab (optab_table[OTI_usmul_widen])
#define smadd_widen_optab (optab_table[OTI_smadd_widen])
#define umadd_widen_optab (optab_table[OTI_umadd_widen])
+#define smsub_widen_optab (optab_table[OTI_smsub_widen])
+#define umsub_widen_optab (optab_table[OTI_umsub_widen])
#define sdiv_optab (optab_table[OTI_sdiv])
#define smulv_optab (optab_table[OTI_smulv])
#define sdivv_optab (optab_table[OTI_sdivv])
@@ -438,9 +459,15 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define vec_unpacks_lo_optab (optab_table[OTI_vec_unpacks_lo])
#define vec_unpacku_hi_optab (optab_table[OTI_vec_unpacku_hi])
#define vec_unpacku_lo_optab (optab_table[OTI_vec_unpacku_lo])
+#define vec_unpacks_float_hi_optab (optab_table[OTI_vec_unpacks_float_hi])
+#define vec_unpacks_float_lo_optab (optab_table[OTI_vec_unpacks_float_lo])
+#define vec_unpacku_float_hi_optab (optab_table[OTI_vec_unpacku_float_hi])
+#define vec_unpacku_float_lo_optab (optab_table[OTI_vec_unpacku_float_lo])
#define vec_pack_trunc_optab (optab_table[OTI_vec_pack_trunc])
#define vec_pack_ssat_optab (optab_table[OTI_vec_pack_ssat])
#define vec_pack_usat_optab (optab_table[OTI_vec_pack_usat])
+#define vec_pack_sfix_trunc_optab (optab_table[OTI_vec_pack_sfix_trunc])
+#define vec_pack_ufix_trunc_optab (optab_table[OTI_vec_pack_ufix_trunc])
#define powi_optab (optab_table[OTI_powi])
diff --git a/gcc/opts.c b/gcc/opts.c
index 8b422f07efc..a365d652c73 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -797,9 +797,8 @@ decode_options (unsigned int argc, const char **argv)
if (optimize_size)
{
- /* Inlining of very small functions usually reduces total size. */
- set_param_value ("max-inline-insns-single", 5);
- set_param_value ("max-inline-insns-auto", 5);
+ /* Inlining of functions reducing size is a good idea regardless
+ of them being declared inline. */
flag_inline_functions = 1;
/* We want to crossjump as much as possible. */
@@ -1354,6 +1353,9 @@ common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_Wstrict_aliasing:
+ set_Wstrict_aliasing (value);
+ break;
+
case OPT_Wstrict_aliasing_:
warn_strict_aliasing = value;
break;
@@ -1721,6 +1723,20 @@ set_Wunused (int setting)
warn_unused_value = setting;
}
+/* Used to set the level of strict aliasing warnings,
+ when no level is specified (i.e., when -Wstrict-aliasing, and not
+ -Wstrict-aliasing=level was given).
+ ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified,
+ and 0 otherwise. After calling this function, wstrict_aliasing will be
+ set to the default value of -Wstrict_aliasing=level, currently 3. */
+void
+set_Wstrict_aliasing (int onoff)
+{
+ gcc_assert (onoff == 0 || onoff == 1);
+ if (onoff != 0)
+ warn_strict_aliasing = 3;
+}
+
/* The following routines are useful in setting all the flags that
-ffast-math and -fno-fast-math imply. */
void
diff --git a/gcc/passes.c b/gcc/passes.c
index ae14e5031d9..5fd5b885370 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -133,6 +133,7 @@ debug_pass (void)
/* Global variables used to communicate with passes. */
int dump_flags;
bool in_gimple_form;
+bool first_pass_instance;
/* This is called from various places for FUNCTION_DECL, VAR_DECL,
@@ -420,6 +421,8 @@ next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
memcpy (new, pass, sizeof (*new));
new->next = NULL;
+ new->todo_flags_start &= ~TODO_mark_first_instance;
+
/* Indicate to register_dump_files that this pass has duplicates,
and so it should rename the dump file. The first instance will
be -1, and be number of duplicates = -static_pass_number - 1.
@@ -434,6 +437,7 @@ next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
}
else
{
+ pass->todo_flags_start |= TODO_mark_first_instance;
pass->static_pass_number = -1;
*list = pass;
}
@@ -694,7 +698,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_cse);
NEXT_PASS (pass_rtl_fwprop);
NEXT_PASS (pass_gcse);
- NEXT_PASS (pass_jump_bypass);
NEXT_PASS (pass_rtl_ifcvt);
NEXT_PASS (pass_tracer);
/* Perform loop optimizations. It might be better to do them a bit
@@ -712,6 +715,7 @@ init_optimization_passes (void)
*p = NULL;
}
NEXT_PASS (pass_web);
+ NEXT_PASS (pass_jump_bypass);
NEXT_PASS (pass_cse2);
NEXT_PASS (pass_rtl_dse1);
NEXT_PASS (pass_rtl_fwprop_addr);
@@ -981,6 +985,9 @@ execute_todo (unsigned int flags)
gcc_assert (flags & TODO_update_ssa_any);
#endif
+ /* Inform the pass whether it is the first time it is run. */
+ first_pass_instance = (flags & TODO_mark_first_instance) != 0;
+
do_per_function (execute_function_todo, (void *)(size_t) flags);
/* Always remove functions just as before inlining: IPA passes might be
diff --git a/gcc/reload.c b/gcc/reload.c
index 9c5ac227123..4e4caee8709 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -88,6 +88,9 @@ a register with any other reload. */
#define REG_OK_STRICT
+/* We do not enable this with ENABLE_CHECKING, since it is awfully slow. */
+#undef DEBUG_RELOAD
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -1181,7 +1184,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
/* If IN appears in OUT, we can't share any input-only reload for IN. */
if (in != 0 && out != 0 && MEM_P (out)
- && (REG_P (in) || MEM_P (in))
+ && (REG_P (in) || MEM_P (in) || GET_CODE (in) == PLUS)
&& reg_overlap_mentioned_for_reload_p (in, XEXP (out, 0)))
dont_share = 1;
@@ -6103,8 +6106,12 @@ subst_reloads (rtx insn)
rtx reloadreg = rld[r->what].reg_rtx;
if (reloadreg)
{
-#ifdef ENABLE_CHECKING
- /* Internal consistency test. Check that we don't modify
+#ifdef DEBUG_RELOAD
+ /* This checking takes a very long time on some platforms
+ causing the gcc.c-torture/compile/limits-fnargs.c test
+ to time out during testing. See PR 31850.
+
+ Internal consistency test. Check that we don't modify
anything in the equivalence arrays. Whenever something from
those arrays needs to be reloaded, it must be unshared before
being substituted into; the equivalence must not be modified.
@@ -6126,7 +6133,7 @@ subst_reloads (rtx insn)
CHECK_MODF (reg_equiv_mem);
#undef CHECK_MODF
}
-#endif /* ENABLE_CHECKING */
+#endif /* DEBUG_RELOAD */
/* If we're replacing a LABEL_REF with a register, add a
REG_LABEL note to indicate to flow which label this
@@ -6517,7 +6524,8 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
if (REG_P (in))
return 0;
else if (GET_CODE (in) == PLUS)
- return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
+ return (rtx_equal_p (x, in)
+ || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
|| reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1)));
else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in)
|| reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in));
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 165494108c3..74d476eda4c 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -81,6 +81,19 @@ schedule_more_p (void)
return sched_n_insns < n_insns;
}
+/* Print dependency information about ebb between HEAD and TAIL. */
+static void
+debug_ebb_dependencies (rtx head, rtx tail)
+{
+ fprintf (sched_dump,
+ ";; --------------- forward dependences: ------------ \n");
+
+ fprintf (sched_dump, "\n;; --- EBB Dependences --- from bb%d to bb%d \n",
+ BLOCK_NUM (head), BLOCK_NUM (tail));
+
+ debug_dependencies (head, tail);
+}
+
/* Add all insns that are initially ready to the ready list READY. Called
once before scheduling a set of insns. */
@@ -94,11 +107,9 @@ init_ready_list (void)
sched_n_insns = 0;
-#if 0
/* Print debugging information. */
if (sched_verbose >= 5)
- debug_dependencies ();
-#endif
+ debug_ebb_dependencies (NEXT_INSN (prev_head), PREV_INSN (next_tail));
/* Initialize ready list with all 'ready' insns in target block.
Count number of insns in the target block being scheduled. */
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 4f30174057e..53c4cb02840 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -527,8 +527,10 @@ struct haifa_insn_data
unsigned int fed_by_spec_load : 1;
unsigned int is_load_insn : 1;
- /* Nonzero if priority has been computed already. */
- unsigned int priority_known : 1;
+ /* '> 0' if priority is valid,
+ '== 0' if priority was not yet computed,
+ '< 0' if priority in invalid and should be recomputed. */
+ signed char priority_status;
/* Nonzero if instruction has internal dependence
(e.g. add_dependence was invoked with (insn == elem)). */
@@ -560,7 +562,8 @@ extern struct haifa_insn_data *h_i_d;
#define CANT_MOVE(insn) (h_i_d[INSN_UID (insn)].cant_move)
#define INSN_DEP_COUNT(INSN) (h_i_d[INSN_UID (INSN)].dep_count)
#define INSN_PRIORITY(INSN) (h_i_d[INSN_UID (INSN)].priority)
-#define INSN_PRIORITY_KNOWN(INSN) (h_i_d[INSN_UID (INSN)].priority_known)
+#define INSN_PRIORITY_STATUS(INSN) (h_i_d[INSN_UID (INSN)].priority_status)
+#define INSN_PRIORITY_KNOWN(INSN) (INSN_PRIORITY_STATUS (INSN) > 0)
#define INSN_REG_WEIGHT(INSN) (h_i_d[INSN_UID (INSN)].reg_weight)
#define HAS_INTERNAL_DEP(INSN) (h_i_d[INSN_UID (INSN)].has_internal_dep)
#define TODO_SPEC(INSN) (h_i_d[INSN_UID (INSN)].todo_spec)
@@ -853,4 +856,7 @@ extern void unlink_bb_notes (basic_block, basic_block);
extern void add_block (basic_block, basic_block);
extern rtx bb_note (basic_block);
+/* Functions in sched-rgn.c. */
+extern void debug_dependencies (rtx, rtx);
+
#endif /* GCC_SCHED_INT_H */
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index ce01e58f12c..6a523d882e1 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -278,7 +278,6 @@ static bool sets_likely_spilled (rtx);
static void sets_likely_spilled_1 (rtx, rtx, void *);
static void add_branch_dependences (rtx, rtx);
static void compute_block_backward_dependences (int);
-void debug_dependencies (void);
static void init_regions (void);
static void schedule_region (int);
@@ -1929,6 +1928,8 @@ static void add_block1 (basic_block, basic_block);
static void fix_recovery_cfg (int, int, int);
static basic_block advance_target_bb (basic_block, rtx);
+static void debug_rgn_dependencies (int);
+
/* Return nonzero if there are more insns that should be scheduled. */
static int
@@ -1954,7 +1955,7 @@ init_ready_list (void)
/* Print debugging information. */
if (sched_verbose >= 5)
- debug_dependencies ();
+ debug_rgn_dependencies (target_bb);
/* Prepare current target block info. */
if (current_nr_blocks > 1)
@@ -2526,73 +2527,84 @@ free_pending_lists (void)
}
}
-/* Print dependences for debugging, callable from debugger. */
+/* Print dependences for debugging starting from FROM_BB.
+ Callable from debugger. */
void
-debug_dependencies (void)
+debug_rgn_dependencies (int from_bb)
{
int bb;
- fprintf (sched_dump, ";; --------------- forward dependences: ------------ \n");
- for (bb = 0; bb < current_nr_blocks; bb++)
+ fprintf (sched_dump,
+ ";; --------------- forward dependences: ------------ \n");
+
+ for (bb = from_bb; bb < current_nr_blocks; bb++)
{
rtx head, tail;
- rtx next_tail;
- rtx insn;
gcc_assert (EBB_FIRST_BB (bb) == EBB_LAST_BB (bb));
get_ebb_head_tail (EBB_FIRST_BB (bb), EBB_LAST_BB (bb), &head, &tail);
- next_tail = NEXT_INSN (tail);
fprintf (sched_dump, "\n;; --- Region Dependences --- b %d bb %d \n",
BB_TO_BLOCK (bb), bb);
- fprintf (sched_dump, ";; %7s%6s%6s%6s%6s%6s%14s\n",
- "insn", "code", "bb", "dep", "prio", "cost",
- "reservation");
- fprintf (sched_dump, ";; %7s%6s%6s%6s%6s%6s%14s\n",
- "----", "----", "--", "---", "----", "----",
- "-----------");
+ debug_dependencies (head, tail);
+ }
+}
- for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- {
- dep_link_t link;
+/* Print dependencies information for instructions between HEAD and TAIL.
+ ??? This function would probably fit best in haifa-sched.c. */
+void debug_dependencies (rtx head, rtx tail)
+{
+ rtx insn;
+ rtx next_tail = NEXT_INSN (tail);
+
+ fprintf (sched_dump, ";; %7s%6s%6s%6s%6s%6s%14s\n",
+ "insn", "code", "bb", "dep", "prio", "cost",
+ "reservation");
+ fprintf (sched_dump, ";; %7s%6s%6s%6s%6s%6s%14s\n",
+ "----", "----", "--", "---", "----", "----",
+ "-----------");
- if (! INSN_P (insn))
+ for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
+ {
+ dep_link_t link;
+
+ if (! INSN_P (insn))
+ {
+ int n;
+ fprintf (sched_dump, ";; %6d ", INSN_UID (insn));
+ if (NOTE_P (insn))
{
- int n;
- fprintf (sched_dump, ";; %6d ", INSN_UID (insn));
- if (NOTE_P (insn))
- {
- n = NOTE_LINE_NUMBER (insn);
- if (n < 0)
- fprintf (sched_dump, "%s\n", GET_NOTE_INSN_NAME (n));
- }
- else
- fprintf (sched_dump, " {%s}\n", GET_RTX_NAME (GET_CODE (insn)));
- continue;
+ n = NOTE_LINE_NUMBER (insn);
+ if (n < 0)
+ fprintf (sched_dump, "%s\n", GET_NOTE_INSN_NAME (n));
}
-
- fprintf (sched_dump,
- ";; %s%5d%6d%6d%6d%6d%6d ",
- (SCHED_GROUP_P (insn) ? "+" : " "),
- INSN_UID (insn),
- INSN_CODE (insn),
- INSN_BB (insn),
- INSN_DEP_COUNT (insn),
- INSN_PRIORITY (insn),
- insn_cost (insn));
-
- if (recog_memoized (insn) < 0)
- fprintf (sched_dump, "nothing");
else
- print_reservation (sched_dump, insn);
-
- fprintf (sched_dump, "\t: ");
- FOR_EACH_DEP_LINK (link, INSN_FORW_DEPS (insn))
- fprintf (sched_dump, "%d ", INSN_UID (DEP_LINK_CON (link)));
- fprintf (sched_dump, "\n");
+ fprintf (sched_dump, " {%s}\n", GET_RTX_NAME (GET_CODE (insn)));
+ continue;
}
+
+ fprintf (sched_dump,
+ ";; %s%5d%6d%6d%6d%6d%6d ",
+ (SCHED_GROUP_P (insn) ? "+" : " "),
+ INSN_UID (insn),
+ INSN_CODE (insn),
+ BLOCK_NUM (insn),
+ INSN_DEP_COUNT (insn),
+ INSN_PRIORITY (insn),
+ insn_cost (insn));
+
+ if (recog_memoized (insn) < 0)
+ fprintf (sched_dump, "nothing");
+ else
+ print_reservation (sched_dump, insn);
+
+ fprintf (sched_dump, "\t: ");
+ FOR_EACH_DEP_LINK (link, INSN_FORW_DEPS (insn))
+ fprintf (sched_dump, "%d ", INSN_UID (DEP_LINK_CON (link)));
+ fprintf (sched_dump, "\n");
}
+
fprintf (sched_dump, "\n");
}
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 8b62014288e..742ff79e3e0 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1362,7 +1362,7 @@ expand_expr_stmt (tree exp)
rtx value;
tree type;
- value = expand_expr (exp, const0_rtx, VOIDmode, 0);
+ value = expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
if (GIMPLE_TUPLE_P (exp))
type = void_type_node;
else
@@ -1728,7 +1728,7 @@ expand_return (tree retval)
tree nt = build_qualified_type (ot, TYPE_QUALS (ot) | TYPE_QUAL_CONST);
val = assign_temp (nt, 0, 0, 1);
- val = expand_expr (retval_rhs, val, GET_MODE (val), 0);
+ val = expand_expr (retval_rhs, val, GET_MODE (val), EXPAND_NORMAL);
val = force_not_mem (val);
/* Return the calculated value. */
expand_value_return (val);
@@ -1736,7 +1736,7 @@ expand_return (tree retval)
else
{
/* No hard reg used; calculate value into hard return reg. */
- expand_expr (retval, const0_rtx, VOIDmode, 0);
+ expand_expr (retval, const0_rtx, VOIDmode, EXPAND_NORMAL);
expand_value_return (result_rtl);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1f0e63713c5..1386babeda1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,383 @@
+2007-05-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/31628
+ * gcc.target/i386/pr31628.c: New.
+
+2007-05-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/31344
+ * gcc.dg/pr31344.c: New test.
+
+2007-05-17 Ian Lance Taylor <iant@google.com>
+
+ PR tree-optimization/31953
+ * gcc.c-torture/compile/pr31953.c: New test.
+
+2007-05-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/builtins-1.c: Test reentrant gamma functions.
+
+ * gcc.dg/torture/builtin-math-2.c: Add tests for remquo, remainder
+ and drem.
+ * gcc.dg/torture/builtin-math-4.c: Likewise.
+
+ * gcc.dg/torture/builtin-math-2.c: Test y0, y1, yn.
+ * gcc.dg/torture/builtin-math-4.c: Likewise.
+
+ * gcc.dg/torture/builtin-math-4.c: New test.
+
+2007-05-17 Janis Johnson <janis187@us.ibm.com>
+ Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * gcc.target/powerpc/pr18096-1.c: Change dg-warning to dg-error.
+ * gcc.dg/cpp/include2.c: Ditto.
+ * gcc.dg/cpp/mac-dir-2.c: Ditto.
+ * gcc.dg/cpp/paste5.c: Ditto.
+ * gcc.dg/cpp/paste6.c: Ditto.
+ * gcc.dg/cpp/paste8.c: Ditto.
+ * gcc.dg/cpp/paste11.c: Ditto.
+ * gcc.dg/cpp/paste13.c: Ditto.
+ * gcc.dg/cpp/skipping2.c: Ditto.
+ * gcc.dg/reg-vol-struct-1.c: Ditto.
+ * gcc.dg/Wshadow-1.c: Ditto.
+ * gcc.dg/cpp/trad/comment.c: Ditto.
+ * gcc.dg/cpp/trad/literals-2.c: Change dg-error to dg-warning.
+ * gcc.dg/cpp/if-2.c: Ditto.
+ * gcc.dg/array-5.c: Ditto.
+ * gcc.dg/inline-15.c: Ditto.
+ * gcc.dg/pr27953.c: Ditto.
+ * gcc.dg/Wno-c++-compat.c: Ditto.
+
+2007-05-17 Kazu Hirata <kazu@codesourcery.com>
+
+ * g++.dg/cpp/_Pragma1.C: Skip on fido-*-* and m68k-*-*.
+
+2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.c-torture/execute/20070517-1.c: New test.
+
+2007-05-17 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/31919
+ * gfortran.dg/min_max_conformance.f90: New test.
+
+2007-05-17 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * gcc.dg/tree-ssa/ssa-dom-thread-2.c: New test.
+ * gcc.dg/vect/vect-102.c, gcc.dg/vect/vect-103.c,
+ gcc.dg/vect/vect-104.c: Use more complex construction to prevent vectorizing.
+ * gcc.dg/tree-ssa/pr21559.c: Update outcome.
+
+2007-05-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR tree-optimization/24659
+ * gcc.dg/vect/vect-floatint-conversion-2.c: New test.
+ * gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
+ not vect_int target.
+ * gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
+ not vect_int target. Loop is vectorized for vect_intfloat_cvt
+ targets.
+ * gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
+ * gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
+ * gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.
+
+2007-05-16 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/torture/fp-int-convert-float128.c: Do not xfail for i?86-*-*
+ and x86_64-*-* targets.
+ * gcc.dg/torture/fp-int-convert-float128-timode.c: Ditto.
+
+2007-05-16 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/18769
+ PR fortran/30881
+ PR fortran/31194
+ PR fortran/31216
+ PR fortran/31427
+ * transfer_simplify_1.f90: New test.
+ * transfer_simplify_2.f90: New test.
+
+2007-05-15 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ * gfortran.dg/unf_io_convert_3.f90: Fix dg directive.
+
+2007-05-14 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/dfp/usual-arith-conv-bad.c: New test.
+
+ * gcc.dg/fltconst-pedantic-dfp.c: New test.
+
+ PR c/31924
+ * gcc.dg/fltconst-1.c: New test.
+
+ * gcc.dg/dfp/func-mixed.c: Replace invalid constant suffixes.
+ * gcc.dg/dfp/operator-assignment.c: Ditto.
+
+2007-05-14 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/29928
+ * g++.dg/rtti/typeid5.C: New.
+
+2007-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31725
+ * gfortran.dg/substr_4.f: New test.
+
+2007-05-14 Kazu Hirata <kazu@codesourcery.com>
+
+ * gcc.target/m68k/interrupt_thread-1.c,
+ gcc.target/m68k/interrupt_thread-2.c,
+ gcc.target/m68k/interrupt_thread-3.c: New.
+ * gcc.target/m68k/m68k.exp: Accept fido.
+
+2007-05-13 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ * gfortran.dg/alloc_comp_basics_1.f90: Fix dg directive.
+ * gfortran.dg/altreturn_3.f90: Likewise.
+ * gfortran.dg/assumed_dummy_1.f90: Likewise.
+ * gfortran.dg/default_numeric_type_1.f90: Likewise.
+ * gfortran.dg/inquire_iolength.f90: Likewise.
+ * gfortran.dg/module_naming_1.f90: Likewise.
+ * gfortran.dg/oldstyle_2.f90: Likewise.
+ * gfortran.dg/operator_2.f90: Likewise.
+ * gfortran.dg/parameter_array_element_1.f90: Likewise.
+ * gfortran.dg/used_types_11.f90: Likewise.
+ * gfortran.dg/zero_array_components_1.f90: Likewise.
+ * gfortran.dg/fmt_zero_precision.f90: Fix dg-output directives.
+ * gfortran.dg/parameter_array_dummy.f90: Likewise.
+ * gfortran.dg/real_const_3.f90: Likewise.
+
+2007-05-13 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * gcc.dg/vect/no-section-anchors-vect-69.c: Fix outcome.
+ * gcc.dg/tree-ssa/loop-30.c: New test.
+
+2007-05-13 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/pr17141-1.c: Scan in forwprop2, xfail
+ scanning forwprop1.
+ * g++.dg/tree-ssa/pr31146.C: Likewise.
+
+2007-05-13 Revital Eres <eres@il.ibm.com>
+
+ * gcc.dg/dse.c: New test.
+
+2007-05-12 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/31797
+ * gcc.c-torture/compile/pr31797.c: New testcase.
+
+2007-05-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30746
+ * gfortran.dg/host_assoc_function_1.f90: New test.
+
+2007-05-11 Steve Ellcey <sje@cup.hp.com>
+
+ PR c++/31829
+ * g++.dg/warn/multiple-overflow-warn-3.C: Change wchar_t to short.
+
+2007-05-11 Silvius Rus <rus@google.com>
+
+ * gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c: New test.
+ * gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c: New test.
+ * gcc.dg/Wstrict-aliasing-bogus-struct-included.c: New test.
+ * gcc.dg/Wstrict-aliasing-converted-assigned.c: New test.
+ * gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: New test.
+ * gcc.dg/alias-1.c: Update option: -Wstrict-aliasing=2.
+ * gcc.dg/alias-9.c: Update option: -Wstrict-aliasing=2.
+ * g++.dg/warn/Wstrict-aliasing-7.C: Update option: -Wstrict-aliasing=2.
+ * g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-bogus-char-1.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-bogus-const.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-bogus-union.C: New test.
+ * g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: New test.
+
+2007-05-11 Paolo Carlini <pcarlini@suse.de>
+
+ PR other/31852
+ * gcc.c-torture/execute/builtins/memchr.c: New.
+ * gcc.c-torture/execute/builtins/memchr-lib.c: New.
+ * gcc.c-torture/execute/builtins/lib/memchr.c: New.
+
+2007-05-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30876
+ * gfortran.dg/recursive_reference_1.f90: Put error at correct
+ line.
+ * gfortran.dg/recursive_reference_2.f90: New test.
+
+2007-05-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30878
+ * gfortran.dg/namelist_29.f90: New test.
+
+2007-05-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31474
+ * gfortran.dg/entry_10.f90: New test.
+
+2007-05-10 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/31885
+ * gcc.dg/tree-ssa/loop-29.c: New test.
+
+2007-05-10 Dominique d'Humières <dominiq@lps.ens.fr>
+
+ * assumed_dummy_1.f90: Fix dg directive.
+ * char_initialiser_actual.f90: Likewise.
+ * nested_modules_2.f90: Likewise.
+ * shift-alloc.f90: Likewise.
+
+2007-05-10 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc.dg/20070507-1.c: Disable for non-pic targets.
+
+2007-05-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/31880
+ * gfortran.dg/unf_read_corrupted_2.f90: New test.
+
+2007-05-09 Mike Stump <mrs@apple.com>
+
+ * g++.dg/other/first-global.C: Add -fpie for darwin.
+ * g++.dg/parse/attr-externally-visible-1.C: Likewise.
+
+2007-05-09 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc.dg/20070507-1.c: New testcase.
+
+2007-05-08 Chao-ying Fu <fu@mips.com>
+
+ * gcc.target/mips/msub-1.c, gcc.target/mips/msub-2.c,
+ * gcc.target/mips/msub-3.c, gcc.target/mips/msub-4.c,
+ * gcc.target/mips/msubu-1.c, gcc.target/mips/msubu-2.c,
+ * gcc.target/mips/msubu-3.c, gcc.target/mips/msubu-4.c: New tests.
+
+2007-05-08 Simon Martin <simartin@users.sourceforge.net>
+
+ PR 31847
+ * gcc.dg/pr31847.c: New test.
+
+2007-05-08 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31692
+ * gfortran.dg/actual_array_result_1.f90: New test.
+
+2007-05-08 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29397
+ * gfortran.dg/parameter_array_init_1.f90: New test.
+
+ PR fortran/29400
+ * gfortran.dg/parameter_array_init_2.f90: New test.
+
+2007-05-08 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/31854
+ * gcc.target/i386/pr31854.c: New test.
+
+2007-05-07 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/pch/pch.exp: XFAIL largefile on Solaris 10 x86.
+
+2007-05-07 Mike Stump <mrs@apple.com>
+
+ * g++.old-deja/g++.mike/empty.C: Add.
+
+2007-05-07 Eric Christopher <echristo@apple.com>
+
+ * gcc.dg/invalid-call-1.c: Fix options for 32-bit x86.
+
+2007-05-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/dfp/convert-bfp-fold.c: Remove extra assignment to 'sf'
+ variable. Rearrange conversions from binary float to decimal float.
+
+2007-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/special/gcsec-1.c: Don't link statically on Solaris 10
+ x86.
+
+2007-05-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt1.ad[sb]: New testcase.
+
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31399
+ * gfortran.dg/do_3.F90: New test.
+
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31764
+ * gfortran.dg/new_line.f90: Add new checks.
+
+2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/31201
+ * gfortran.dg/large_unit_1.f90: New.
+ * gfortran.dg/large_unit_2.f90: New.
+ * gfortran.dg/iostat_4.f90: New
+ * gfortran.dg/bounds_check_fail_1.f90: Updated.
+
+2007-05-06 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31540
+ * gfortran.dg/char_result_4.f90: New test.
+
+2007-06-05 Revital Eres <eres@il.ibm.com>
+
+ PR 30957
+ * gcc.dg/pr30957-1.c: New test.
+
+2007-05-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/31251
+ * gfortran.dg/char_type_len_2.f90: New test.
+
+2007-05-05 Geoffrey Keating <geoffk@apple.com>
+
+ PR 31775
+ * g++.dg/other/nested-extern.cc: New.
+ * g++.dg/other/nested-extern-1.C: New.
+ * g++.dg/other/nested-extern-2.C: New.
+
+2007-05-04 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/31760
+ * gfortran.dg/erf.f90: New test.
+ * gfortran.dg/besxy.f90: New test.
+
+2007-05-04 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/22359
+ * gfortran.dg/fseek.f90: New test.
+
+2007-05-04 Bob Wilson <bob.wilson@acm.org>
+
+ * g++.old-deja/g++.pt/static11.C: Remove xtensa-*-elf* xfail.
+
+2007-05-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/31210
+ * gfortran.dg/zero_length_1.f90: New test.
+
+2007-05-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/31803
+ * gfortran.dg/char_pointer_assign_3.f90: New test.
+ * gfortran.dg/char_result_2.f90: Re-enable test.
+
+2007-05-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/25071
+ * gfortran.dg/char_length_3.f90: New test.
+ * gfortran.dg/char_result_2.f90: Fix test.
+
2007-05-03 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/30565
@@ -13,7 +393,7 @@
2007-05-03 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/31699
- * lib/target-supports.exp (check_effective_target_vect_intfloat_cvt):
+ * lib/target-supports.exp (check_effective_target_vect_intfloat_cvt):
New.
(check_effective_target_vect_floatint_cvt): New.
* gcc.dg/vect/vect-floatint-conversion-1.c: Use new keyword instead
@@ -32,8 +412,8 @@
2007-05-02 Seongbae Park <seongbae.park@gmail.com>
PR C++/31663
- * g++.dg/warn/anonymous-namespace-2.C: New.
- * g++.dg/warn/anonymous-namespace-2.h: New.
+ * g++.dg/warn/anonymous-namespace-2.C: New.
+ * g++.dg/warn/anonymous-namespace-2.h: New.
2007-05-02 Paul Brook <paul@codesourcery.com>
@@ -81,7 +461,7 @@
2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
- PR fortran/31732
+ PR fortran/31732
* gfortran.dg/array_memset_2: New test case.
2007-05-01 Dorit Nuzman <dorit@il.ibm.com>
@@ -449,7 +829,7 @@
* g++.dg/expr/bitfield8.C: New test.
2007-04-17 Joseph Myers <joseph@codesourcery.com>
- Richard Sandiford <richard@codesourcery.com>
+ Richard Sandiford <richard@codesourcery.com>
* lib/target-supports.exp (check_profiling_available): Return 0
for uClibc with -p or -pg.
diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C
new file mode 100644
index 00000000000..7a9c35964f7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/forced.C
@@ -0,0 +1,25 @@
+// This test only applies to glibc (NPTL) targets.
+// { dg-do run { target *-*-linux* } }
+// { dg-options "-pthread" }
+
+#include <pthread.h>
+#include <cxxabi.h>
+extern "C" int printf (const char *, ...);
+
+int main()
+{
+ try
+ {
+ pthread_exit (0);
+ }
+ catch (abi::__forced_unwind &)
+ {
+ printf ("caught forced unwind\n");
+ throw;
+ }
+ catch (...)
+ {
+ printf ("caught ...\n");
+ return 1;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/cpp/_Pragma1.C b/gcc/testsuite/g++.dg/cpp/_Pragma1.C
index 5783af16f62..34e860b6744 100644
--- a/gcc/testsuite/g++.dg/cpp/_Pragma1.C
+++ b/gcc/testsuite/g++.dg/cpp/_Pragma1.C
@@ -2,7 +2,7 @@
// This is supposed to succeed only if
// the target defines HANDLE_PRAGMA_PACK_PUSH_POP
// and doesn't define HANDLE_PRAGMA_PACK_WITH_EXPANSION.
-// { dg-do compile { target { ! { *-*-solaris2* sh*-[us]*-elf } } } }
+// { dg-do compile { target { ! { *-*-solaris2* fido-*-* m68k-*-* sh*-[us]*-elf } } } }
#define push bar
#define foo _Pragma ("pack(push)")
diff --git a/gcc/testsuite/g++.dg/other/first-global.C b/gcc/testsuite/g++.dg/other/first-global.C
index b50f3266b5d..81e7a96e2e0 100644
--- a/gcc/testsuite/g++.dg/other/first-global.C
+++ b/gcc/testsuite/g++.dg/other/first-global.C
@@ -1,4 +1,6 @@
/* { dg-do compile } */
+/* { dg-options "-fpie" { target *-*-darwin* } } */
/* { dg-final { scan-assembler "_GLOBAL__I_foobar" } } */
+
struct foo { foo (); };
foo foobar;
diff --git a/gcc/testsuite/g++.dg/other/nested-extern-1.C b/gcc/testsuite/g++.dg/other/nested-extern-1.C
new file mode 100644
index 00000000000..6533a2ade51
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/nested-extern-1.C
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+// { dg-additional-sources "nested-extern.cc" }
+/* PR 31775 */
+extern "C" void abort();
+extern int *p;
+int main()
+{
+ extern int i;
+ i = 1;
+ *p = 2;
+ if (i == 2)
+ abort ();
+ return 0;
+}
+
+static int i;
+int *p = &i;
diff --git a/gcc/testsuite/g++.dg/other/nested-extern-2.C b/gcc/testsuite/g++.dg/other/nested-extern-2.C
new file mode 100644
index 00000000000..58f53e083f9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/nested-extern-2.C
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+// { dg-additional-sources "nested-extern.cc" }
+/* PR 31775 */
+extern "C" void abort();
+static int i;
+int *p = &i;
+int main()
+{
+ int i;
+ {
+ extern int i;
+ i = 1;
+ *p = 2;
+ if (i == 2)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/other/nested-extern.cc b/gcc/testsuite/g++.dg/other/nested-extern.cc
new file mode 100644
index 00000000000..048f715b465
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/nested-extern.cc
@@ -0,0 +1 @@
+int i;
diff --git a/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C b/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
index 9016bc4225a..98fec2b4a98 100644
--- a/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
+++ b/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
@@ -1,5 +1,6 @@
// { dg-do compile }
// { dg-options "-O3 -fwhole-program" }
+/* { dg-options "-O3 -fwhole-program -fpie" { target *-*-darwin* } } */
// { dg-final { scan-assembler "foo1" } }
// { dg-final { scan-assembler "foo2" } }
// { dg-final { scan-assembler "foo3" } }
diff --git a/gcc/testsuite/g++.dg/rtti/typeid5.C b/gcc/testsuite/g++.dg/rtti/typeid5.C
new file mode 100644
index 00000000000..ef769ce533a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid5.C
@@ -0,0 +1,13 @@
+// PR c++/29928
+// { dg-do compile }
+
+#include <typeinfo>
+
+struct S;
+
+void f()
+{
+ const std::type_info& info1 = typeid(int []);
+ const std::type_info& info2 = typeid(S [3]);
+ const std::type_info& info3 = typeid(S []);
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
index e91d17415b3..6123e033c78 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fdump-tree-forwprop" } */
/* We should be able to optimize this to i[j] = 1 during
early optimizations. */
@@ -12,5 +12,6 @@ void foo (int j)
*q = 1;
}
-/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop1" } } */
-/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop2" } } */
+/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-7.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-7.C
index 5e41808f6c4..71ed6cae851 100644
--- a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-7.C
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-7.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Wstrict-aliasing -O2" } */
+/* { dg-options "-Wstrict-aliasing=2 -O2" } */
int a[2];
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C
new file mode 100644
index 00000000000..18e6caf90f1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+class base {
+ public:
+ int x;
+};
+
+class derived: public base {
+ public:
+ int y;
+};
+
+base foo () {
+ derived d;
+ base* pb = &d; /* { dg-bogus "base vs. derived" } */
+ pb->x = 1;
+
+ return d;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-1.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-1.C
new file mode 100644
index 00000000000..bdd24aca64a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-1.C
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo () {
+ int i;
+ char* c= reinterpret_cast<char*>(&i); /* { dg-bogus "char" } */
+ c[1] = 1;
+ return i;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-const.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-const.C
new file mode 100644
index 00000000000..7c079ad5c54
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-const.C
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+int foo(int* p) {
+ const int& q = *p; /* { dg-bogus "const vs. non-const" } */
+ *p = 1;
+ return q;
+}
+
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C
new file mode 100644
index 00000000000..52911810247
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+int foo () {
+ int buffer[10][10];
+ int* pi = &buffer[0][0]; /* { dg-bogus "same element type" } */
+ *pi = 10;
+ return buffer[0][0];
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C
new file mode 100644
index 00000000000..5e71ebff805
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo () {
+ int i;
+ unsigned int* pu = reinterpret_cast<unsigned int*> (&i); /* { dg-bogus "signed vs. unsigned" } */
+ *pu = 1000000;
+ return i;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C
new file mode 100644
index 00000000000..3f55c78c96d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+struct S {
+ int i;
+ float f;
+};
+
+int foo () {
+ struct S s;
+ s.i = 7;
+ float* f = &s.f; /* { dg-bogus "float included in struct S" } */
+ *f = 2.0;
+ return s.i + (int)s.f;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-union.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-union.C
new file mode 100644
index 00000000000..dfbb42c6fd5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-union.C
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+union U {
+ int i;
+ float f;
+};
+
+float foo () {
+ union U u;
+ float* f = &u.f; /* { dg-bogus "unions are holy in GCC" } */
+ u.i = 2;
+ return *f;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C
new file mode 100644
index 00000000000..5527808b4a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo() {
+ int x;
+ float& q = reinterpret_cast<float&> (x); /* { dg-warning "type-punn" } */
+ q = 1.0;
+ return x;
+}
diff --git a/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-3.C b/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-3.C
index 491f7af58ca..afb4e517f28 100644
--- a/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-3.C
+++ b/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-3.C
@@ -2,10 +2,10 @@
/* { dg-do compile } */
/* { dg-options "-Woverflow" } */
-wchar_t
+short int
g (void)
{
- wchar_t wc = ((wchar_t)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */
+ short int wc = ((short int)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */
/* { dg-warning "overflow" "" { target *-*-* } 8 } */
return wc;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/empty.C b/gcc/testsuite/g++.old-deja/g++.mike/empty.C
new file mode 100644
index 00000000000..d69f3ad6243
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/empty.C
@@ -0,0 +1,25 @@
+// { dg-options "-W" }
+
+#define NOPE
+
+void foo() {
+ while (1); /* { dg-error "suggest a space before " } */
+ {
+ }
+ for (;;); /* { dg-error "suggest a space before " } */
+ {
+ }
+ while (1)
+ ;
+ for (;;)
+ ;
+ while (1) ;
+ for (;;) ;
+ /* These two work when using mapped locations */
+ while (1) NOPE; /* { dg-bogus "suggest a space before " "suggest" { xfail *-*-* } } */
+ for (;;) NOPE; /* { dg-bogus "suggest a space before " "suggest" { xfail *-*-* } } */
+ while (1)
+ NOPE;
+ for (;;)
+ NOPE;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline8.C b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
index b919ab5df3f..a46dc382a7d 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/inline8.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
@@ -4,6 +4,7 @@
#include <map>
#include <cstdlib>
+#include <cstring>
using namespace std;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static11.C b/gcc/testsuite/g++.old-deja/g++.pt/static11.C
index bf9489e857e..f3e119868f1 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/static11.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/static11.C
@@ -2,7 +2,7 @@
// in their dejagnu baseboard description) require that the status is
// final when exit is entered (or main returns), and not "overruled" by a
// destructor calling _exit. It's not really worth it to handle that.
-// { dg-do run { xfail mmix-knuth-mmixware xtensa-*-elf* arm*-*-elf arm*-*-eabi m68k-*-elf } }
+// { dg-do run { xfail mmix-knuth-mmixware arm*-*-elf arm*-*-eabi m68k-*-elf } }
// Bug: g++ was failing to destroy C<int>::a because it was using two
// different sentry variables for construction and destruction.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr31797.c b/gcc/testsuite/gcc.c-torture/compile/pr31797.c
new file mode 100644
index 00000000000..97958f38929
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr31797.c
@@ -0,0 +1,31 @@
+struct GTeth_desc
+{
+ unsigned ed_cmdsts;
+};
+struct GTeth_softc
+{
+ struct GTeth_desc txq_desc[32];
+ unsigned int txq_fi;
+ unsigned int txq_nactive;
+};
+
+void
+GTeth_txq_free (struct GTeth_softc *sc)
+{
+ struct GTeth_desc *txd = &sc->txq_desc[0];
+ txd->ed_cmdsts &= ~(1U << (31));
+}
+void
+GTeth_txq_done (struct GTeth_softc *sc)
+{
+ while (sc->txq_nactive > 0)
+ {
+ volatile struct GTeth_desc *txd = &sc->txq_desc[sc->txq_fi];
+ if (txd->ed_cmdsts)
+ {
+ if (sc->txq_nactive == 1)
+ return;
+ }
+ GTeth_txq_free (sc);
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr31953.c b/gcc/testsuite/gcc.c-torture/compile/pr31953.c
new file mode 100644
index 00000000000..667c9ae8851
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr31953.c
@@ -0,0 +1,14 @@
+struct WView
+{
+ int hexedit_mode:1;
+};
+toggle_hexedit_mode (struct WView *view)
+{
+ if (view->hexedit_mode)
+ {
+ }
+ else
+ {
+ view->hexedit_mode = !view->hexedit_mode;
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20070517-1.c b/gcc/testsuite/gcc.c-torture/execute/20070517-1.c
new file mode 100644
index 00000000000..c81cbc639be
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20070517-1.c
@@ -0,0 +1,41 @@
+/* PR rtl-optimization/31691 */
+/* Origin: Chi-Hua Chen <stephaniechc-gccbug@yahoo.com> */
+
+extern void abort (void);
+
+static int get_kind(int) __attribute__ ((noinline));
+
+static int get_kind(int v)
+{
+ volatile int k = v;
+ return k;
+}
+
+static int some_call(void) __attribute__ ((noinline));
+
+static int some_call(void)
+{
+ return 0;
+}
+
+static void example (int arg)
+{
+ int tmp, kind = get_kind (arg);
+
+ if (kind == 9 || kind == 10 || kind == 5)
+ {
+ if (some_call() == 0)
+ {
+ if (kind == 9 || kind == 10)
+ tmp = arg;
+ else
+ abort();
+ }
+ }
+}
+
+int main(void)
+{
+ example(10);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c
new file mode 100644
index 00000000000..ddab08bcf8d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c
@@ -0,0 +1,21 @@
+extern void abort(void);
+extern int inside_main;
+
+void *
+memchr (const void *s, int c, __SIZE_TYPE__ n)
+{
+ const unsigned char uc = c;
+ const unsigned char *sp;
+
+#ifdef __OPTIMIZE__
+ if (inside_main)
+ abort ();
+#endif
+
+ sp = s;
+ for (; n != 0; ++sp, --n)
+ if (*sp == uc)
+ return (void *) sp;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/memchr-lib.c b/gcc/testsuite/gcc.c-torture/execute/builtins/memchr-lib.c
new file mode 100644
index 00000000000..ccea6ba7d97
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/memchr-lib.c
@@ -0,0 +1 @@
+#include "lib/memchr.c"
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/memchr.c b/gcc/testsuite/gcc.c-torture/execute/builtins/memchr.c
new file mode 100644
index 00000000000..88e731128f6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/memchr.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Ensure all expected transformations of builtin memchr occur
+ and perform correctly.
+
+ Written by Paolo Carlini, 10/5/2007. */
+
+extern void abort (void);
+typedef __SIZE_TYPE__ size_t;
+extern void *memchr (const void *, int, size_t);
+
+void
+main_test (void)
+{
+ const char* const foo1 = "hello world";
+
+ if (memchr (foo1, 'x', 11))
+ abort ();
+ if (memchr (foo1, 'o', 11) != foo1 + 4)
+ abort ();
+ if (memchr (foo1, 'w', 2))
+ abort ();
+ if (memchr (foo1 + 5, 'o', 6) != foo1 + 7)
+ abort ();
+ if (memchr (foo1, 'd', 11) != foo1 + 10)
+ abort ();
+ if (memchr (foo1, 'd', 10))
+ abort ();
+ if (memchr (foo1, '\0', 11))
+ abort ();
+ if (memchr (foo1, '\0', 12) != foo1 + 11)
+ abort ();
+
+ /* Test at least one instance of the __builtin_ style. We do this
+ to ensure that it works and that the prototype is correct. */
+ if (__builtin_memchr (foo1, 'r', 11) != foo1 + 8)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/20070507-1.c b/gcc/testsuite/gcc.dg/20070507-1.c
new file mode 100644
index 00000000000..2884d1aa8d8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20070507-1.c
@@ -0,0 +1,103 @@
+/* This failed on s390x due to bug in loop.c.
+ loop.c failed to remove a REG_EQUAL note when
+ hoisting an insn from a loop body. */
+
+/* { dg-options "-O3 -fPIC" } */
+/* { dg-do run { target fpic } } */
+
+typedef __SIZE_TYPE__ size_t;
+int memcmp(const void *s1, const void *s2, size_t n);
+
+typedef struct
+{
+ char name[30];
+ int a;
+} LOCAL;
+
+int global = 0;
+int sy = 1;
+int subroutine_offset;
+
+LOCAL local = { "local", 0 };
+LOCAL keywords = { "keywords", 1 };
+int local_table = 0;
+int keywords_table = 0;
+
+void __attribute__((noinline)) bar (char *p_buffer)
+{
+ p_buffer[255] = 1;
+}
+
+int __attribute__((noinline)) foo (char *p_str1)
+{
+ global = 1;
+ return 1;
+}
+
+int __attribute__((noinline)) loop_next (int *p_table, char *p_table_head)
+{
+ static loop_next = 0;
+
+ if (loop_next == 1)
+ return 1;
+
+ loop_next = 1;
+ return 0;
+}
+
+int
+main ()
+{
+ char buffer[256];
+ int ende = 0;
+ int index;
+ int local_base = 2;
+
+ keywords.a = 1;
+ for (sy = 0;; sy++)
+ {
+ for (index = 1;;)
+ {
+ bar (buffer);
+ if (buffer[sy] != 0)
+ {
+ ende = 1;
+ break;
+ };
+ if (foo (buffer))
+ {
+ keywords.a += index - 1;
+ break;
+ }
+ index++;
+ }
+ if (ende)
+ break;
+ }
+
+ subroutine_offset = 0;
+
+ for (;;)
+ {
+ if (loop_next (&keywords_table, (char*)&keywords))
+ break;
+
+ if ((!memcmp (keywords.name, "+++", 3)))
+ local_base = 100;
+ else
+ local_base = 0;
+
+ if ((!memcmp (keywords.name, "+++", 3)))
+ subroutine_offset += local_table;
+
+ for (;;)
+ {
+ if (loop_next (&local_table, (char*)&local))
+ break;;
+ if ((local.a == 0))
+ continue;;
+ foo (local.name);
+ }
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Wno-c++-compat.c b/gcc/testsuite/gcc.dg/Wno-c++-compat.c
index b1f3cf26f57..1fda016e66e 100644
--- a/gcc/testsuite/gcc.dg/Wno-c++-compat.c
+++ b/gcc/testsuite/gcc.dg/Wno-c++-compat.c
@@ -5,5 +5,5 @@
/* { dg-do compile } */
/* { dg-options "-Wno-c++-compat" } */
-extern const int foo = 42; /* { dg-error "initialized and declared" } */
+extern const int foo = 42; /* { dg-warning "initialized and declared" } */
diff --git a/gcc/testsuite/gcc.dg/Wshadow-1.c b/gcc/testsuite/gcc.dg/Wshadow-1.c
index c4553a43561..6dd2eb6791a 100644
--- a/gcc/testsuite/gcc.dg/Wshadow-1.c
+++ b/gcc/testsuite/gcc.dg/Wshadow-1.c
@@ -10,7 +10,7 @@ void foo (double decl1) /* { dg-warning "shadows a global decl" } */
{
}
-void foo1 (int d) /* { dg-warning "previous definition" } */
+void foo1 (int d) /* { dg-error "previous definition" } */
{
double d; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "redeclared as different" "" { target *-*-* } 15 } */
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c
new file mode 100644
index 00000000000..8a5dcd8e2a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+const int* foo (void)
+{
+ int *i;
+ const int** cpi = (const int**) &i; /* { dg-bogus "const vs. non-const" } */
+ i = 0;
+ return *cpi;
+}
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c
new file mode 100644
index 00000000000..fd3f767ac86
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo ()
+{
+ int x = 10;
+ int *p;
+ float *q;
+
+ q = (float*) &x; /* { dg-bogus "not referenced" } */
+
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c
new file mode 100644
index 00000000000..382fecd6f5a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+struct U
+{
+ float f;
+ int i;
+};
+
+
+int foo ()
+{
+ struct U u;
+ float *pf = (float*)&u; /* { dg-bogus "float included in struct U" } */
+ *pf = 2.0;
+ return u.i;
+}
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
new file mode 100644
index 00000000000..409120f2a40
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo()
+{
+ int i;
+ *(long*)&i = 0; /* { dg-warning "type-punn" } */
+ return i;
+}
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
new file mode 100644
index 00000000000..7780fa6fcd6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */
+
+extern int flag;
+
+int foo() {
+
+ int x;
+ int y = 9;
+ float* q;
+ float* r;
+
+ if (flag) {
+ q = (float*) &x; /* { dg-warning "type-punn" } */
+ } else {
+ q = (float*) &y; /* { dg-warning "type-punn" } */
+ }
+
+ *q = 1.0;
+
+ return x;
+
+}
diff --git a/gcc/testsuite/gcc.dg/alias-1.c b/gcc/testsuite/gcc.dg/alias-1.c
index 82dbc9efbf8..388cb3bf533 100644
--- a/gcc/testsuite/gcc.dg/alias-1.c
+++ b/gcc/testsuite/gcc.dg/alias-1.c
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-Wstrict-aliasing -fstrict-aliasing" }
+// { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 29 Sep 2002 <nathan@codesourcery.com>
diff --git a/gcc/testsuite/gcc.dg/alias-9.c b/gcc/testsuite/gcc.dg/alias-9.c
index 6e9d4a83e35..f8c10031622 100644
--- a/gcc/testsuite/gcc.dg/alias-9.c
+++ b/gcc/testsuite/gcc.dg/alias-9.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Wstrict-aliasing -O2" } */
+/* { dg-options "-Wstrict-aliasing=2 -O2" } */
int a[2];
diff --git a/gcc/testsuite/gcc.dg/array-5.c b/gcc/testsuite/gcc.dg/array-5.c
index 1717de4ba8e..a4053da72a2 100644
--- a/gcc/testsuite/gcc.dg/array-5.c
+++ b/gcc/testsuite/gcc.dg/array-5.c
@@ -24,7 +24,7 @@ void func(int n, int m)
/* Invalid: not compatible because 4 != 6. */
int a[n][6][m];
int (*p)[4][n+1];
- p = a; /* { dg-error "incompatible" } */
+ p = a; /* { dg-warning "incompatible" } */
}
{
/* Compatible, but defined behavior only if n == 6 and m == n+1. */
diff --git a/gcc/testsuite/gcc.dg/builtins-1.c b/gcc/testsuite/gcc.dg/builtins-1.c
index 640576a50a7..573a879bd00 100644
--- a/gcc/testsuite/gcc.dg/builtins-1.c
+++ b/gcc/testsuite/gcc.dg/builtins-1.c
@@ -44,6 +44,14 @@ double test_##FN(double x, TYPE y) { return __builtin_##FN(x, y); } \
float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \
long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); }
+/* Test FP functions taking two arguments, the second argument is of a
+ supplied type. The function is named reentrant style, meaning "_r"
+ appears after the possible f/l suffix. */
+#define FPTEST2ARG2_REENT(FN, TYPE) \
+double test_##FN##_r(double x, TYPE y) { return __builtin_##FN##_r(x, y); } \
+float test_##FN##f_r(float x, TYPE y) { return __builtin_##FN##f_r(x, y); } \
+long double test_##FN##l_r(long double x, TYPE y) { return __builtin_##FN##l_r(x, y); }
+
/* Test FP functions taking two arguments, the second argument is a
FP pointer. */
#define FPTEST2FPP2(FN) \
@@ -132,6 +140,7 @@ FPTEST2 (fmin)
FPTEST2 (fmod)
FPTEST2ARG2 (frexp, int *)
FPTEST1 (gamma)
+FPTEST2ARG2_REENT (gamma, int *) /* gamma_r */
FPTEST0 (huge_val)
FPTEST2 (hypot)
FPTEST1 (ilogb)
@@ -141,6 +150,7 @@ FPTEST1 (j1)
FPTEST2ARG1 (jn, int)
FPTEST2ARG2 (ldexp, int)
FPTEST1 (lgamma)
+FPTEST2ARG2_REENT (lgamma, int *) /* lgamma_r */
FPTEST1RET (llrint, long long)
FPTEST1RET (llround, long long)
FPTEST1 (log)
diff --git a/gcc/testsuite/gcc.dg/cpp/if-2.c b/gcc/testsuite/gcc.dg/cpp/if-2.c
index 8bca251b46b..dc136b45634 100644
--- a/gcc/testsuite/gcc.dg/cpp/if-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/if-2.c
@@ -21,7 +21,7 @@
#if 'abcd' /* { dg-warning "(multi-character character constant)|(character constant (is )?too long)" "multi-character charconst" } */
#endif
-#if 'abcdefghi' /* { dg-error "character constant (is )?too long" "charconst too long" } */
+#if 'abcdefghi' /* { dg-warning "character constant (is )?too long" "charconst too long" } */
#endif
#if '' /* { dg-error "empty character constant" "empty charconst" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/include2.c b/gcc/testsuite/gcc.dg/cpp/include2.c
index 46844bf2cc1..cda818ed5af 100644
--- a/gcc/testsuite/gcc.dg/cpp/include2.c
+++ b/gcc/testsuite/gcc.dg/cpp/include2.c
@@ -7,8 +7,8 @@
/* Source: Neil Booth, 4 Nov 2000. */
-#include <silly\>> /* { dg-warning "extra tokens" "" } */
-#include "silly\"" /* { dg-warning "extra tokens" "" } */
+#include <silly\>> /* { dg-error "extra tokens" "" } */
+#include "silly\"" /* { dg-error "extra tokens" "" } */
/* These error is No such file or directory, just once. However, this
message is locale-dependent, so don't test for it. */
diff --git a/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c b/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c
index b574cfd71cf..b31ab3bee7b 100644
--- a/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c
@@ -11,6 +11,6 @@
#define f(x) x
f (
-#if 1 /* { dg-warning "not portable" } */
+#if 1 /* { dg-error "not portable" } */
1)
#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/paste11.c b/gcc/testsuite/gcc.dg/cpp/paste11.c
index 18530b3448a..e3860ebb745 100644
--- a/gcc/testsuite/gcc.dg/cpp/paste11.c
+++ b/gcc/testsuite/gcc.dg/cpp/paste11.c
@@ -9,7 +9,7 @@
glue (ident, 12) /* OK. */
glue (ident, 12e3) /* OK. */
-glue (ident, 12e+3) /* { dg-warning "valid preprocessing tok" } */
-glue (ident, 12e-3) /* { dg-warning "valid preprocessing tok" } */
-glue (ident, 1.2) /* { dg-warning "valid preprocessing tok" } */
-glue (ident, .12) /* { dg-warning "valid preprocessing tok" } */
+glue (ident, 12e+3) /* { dg-error "valid preprocessing tok" } */
+glue (ident, 12e-3) /* { dg-error "valid preprocessing tok" } */
+glue (ident, 1.2) /* { dg-error "valid preprocessing tok" } */
+glue (ident, .12) /* { dg-error "valid preprocessing tok" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/paste13.c b/gcc/testsuite/gcc.dg/cpp/paste13.c
index e59c2099656..62c72d44993 100644
--- a/gcc/testsuite/gcc.dg/cpp/paste13.c
+++ b/gcc/testsuite/gcc.dg/cpp/paste13.c
@@ -6,4 +6,4 @@
spellings. Neil Booth, 9 Oct 2002. */
#define a /##/=
-a /* { dg-warning "valid preprocessing tok" } */
+a /* { dg-error "valid preprocessing tok" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/paste5.c b/gcc/testsuite/gcc.dg/cpp/paste5.c
index 2a763f58e19..fd0406674ff 100644
--- a/gcc/testsuite/gcc.dg/cpp/paste5.c
+++ b/gcc/testsuite/gcc.dg/cpp/paste5.c
@@ -18,7 +18,7 @@ extern void B(int);
void foo(void)
{
- E(glue(F,*)) dummy; /* { dg-warning "valid preprocessing token" } */
+ E(glue(F,*)) dummy; /* { dg-error "valid preprocessing token" } */
E(glue(F,G)) ;
}
diff --git a/gcc/testsuite/gcc.dg/cpp/paste6.c b/gcc/testsuite/gcc.dg/cpp/paste6.c
index 6b6733c4e9d..ac9ae3901b3 100644
--- a/gcc/testsuite/gcc.dg/cpp/paste6.c
+++ b/gcc/testsuite/gcc.dg/cpp/paste6.c
@@ -9,4 +9,4 @@ extern int foo(int x);
#define bar(x) foo(x)
#define baz(x) bar(##x)
-int quux(int y) { return baz(y); } /* { dg-warning "valid preprocessing" } */
+int quux(int y) { return baz(y); } /* { dg-error "valid preprocessing" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/paste8.c b/gcc/testsuite/gcc.dg/cpp/paste8.c
index dd098947919..ab017797868 100644
--- a/gcc/testsuite/gcc.dg/cpp/paste8.c
+++ b/gcc/testsuite/gcc.dg/cpp/paste8.c
@@ -7,9 +7,9 @@ int foo(int, ...);
a(1)
a(1, 2, 3)
#define b(x, y, z...) foo(x, ##y)
-b(1, 2, 3) /* { dg-warning "valid preprocessing token" } */
+b(1, 2, 3) /* { dg-error "valid preprocessing token" } */
#define c(x, y, z...) foo(x, ##z)
c(1, 2)
c(1, 2, 3)
#define d(x) fo(##x)
-d(1) /* { dg-warning "valid preprocessing token" } */
+d(1) /* { dg-error "valid preprocessing token" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/skipping2.c b/gcc/testsuite/gcc.dg/cpp/skipping2.c
index 3b0d0f32c8e..14dafc01e85 100644
--- a/gcc/testsuite/gcc.dg/cpp/skipping2.c
+++ b/gcc/testsuite/gcc.dg/cpp/skipping2.c
@@ -10,5 +10,5 @@
#if foo
#else foo /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
#endif foo /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
-#endif bar /* { dg-warning "extra tokens" "tokens after #endif" } */
+#endif bar /* { dg-error "extra tokens" "tokens after #endif" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment.c b/gcc/testsuite/gcc.dg/cpp/trad/comment.c
index ce9d7f18e1c..971a78a6d10 100644
--- a/gcc/testsuite/gcc.dg/cpp/trad/comment.c
+++ b/gcc/testsuite/gcc.dg/cpp/trad/comment.c
@@ -2,4 +2,4 @@
/* { dg-do preprocess } */
-/* { dg-warning "unterminated comment" }
+/* { dg-error "unterminated comment" }
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c b/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c
index 767ed77ffb8..b471772f648 100644
--- a/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c
@@ -2,7 +2,7 @@
recognized. */
/* { dg-do preprocess } */
-/* { dg-error "missing terminating" "bad charconst" { target *-*-* } 7 } */
+/* { dg-warning "missing terminating" "bad charconst" { target *-*-* } 7 } */
/* { dg-error "not valid" "bad charconst" { target *-*-* } 7 } */
#if 'x
#endif
diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c
index 7724e1d2c82..c5504993480 100644
--- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c
+++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c
@@ -62,43 +62,42 @@ main ()
/* Conversions from binary float to decimal float. */
sf = 30.0f;
- d32 = sf;
- if (d32 != 30.0df)
+ d128 = sf;
+ if (d128 != 30.0dl)
link_error ();
d64 = sf;
if (d64 != 30.0dd)
link_error ();
+ d32 = sf;
+ if (d32 != 30.0df)
+ link_error ();
+
df = -2.0;
- d32 = df;
- if (d32 != -2.0df)
+ d128 = df;
+ if (d128 != -2.0dl)
link_error ();
d64 = df;
if (d64 != -2.0dd)
link_error ();
- d128 = df;
- if (d128 != -2.0dl)
- link_error ();
-
- sf = 30.0f;
- d128 = sf;
- if (d128 != 30.0dl)
- link_error ();
+ d32 = df;
+ if (d32 != -2.0df)
+ link_error ();
tf = -22.0l;
- d32 = tf;
- if (d32 != -22.0df)
+ d128 = tf;
+ if (d128 != -22.0dl)
link_error ();
d64 = tf;
if (d64 != -22.0dd)
link_error ();
- d128 = tf;
- if (d128 != -22.0dl)
+ d32 = tf;
+ if (d32 != -22.0df)
link_error ();
/* 2**(-11) = 0.00048828125. */
diff --git a/gcc/testsuite/gcc.dg/dfp/func-mixed.c b/gcc/testsuite/gcc.dg/dfp/func-mixed.c
index 0c9fbc98b7d..33fa821ba51 100644
--- a/gcc/testsuite/gcc.dg/dfp/func-mixed.c
+++ b/gcc/testsuite/gcc.dg/dfp/func-mixed.c
@@ -147,28 +147,28 @@ int
main ()
{
/* _Decimal32 variants. */
- if (arg0_32 (0.0df, -1, 2, 3.0f, 4.0, 5.0ld) != 0.0df) abort ();
- if (arg1_32 (0, 1.0df, 2, 3.0f, 4.0, 5.0ld) != 1.0df) abort ();
- if (arg2_32 (0, -1, 2.0df, 3.0f, 4.0, 5.0ld) != 2.0df) abort ();
- if (arg3_32 (0, -1, 2.0f, 3.0df, 4.0, 5.0ld) != 3.0df) abort ();
- if (arg4_32 (0, -1, 2.0f, 3.0, 4.0df, 5.0ld) != 4.0df) abort ();
- if (arg5_32 (0, -1, 2.0f, 3.0, 4.0ld, 5.0df) != 5.0df) abort ();
+ if (arg0_32 (0.0df, -1, 2, 3.0f, 4.0, 5.0l) != 0.0df) abort ();
+ if (arg1_32 (0, 1.0df, 2, 3.0f, 4.0, 5.0l) != 1.0df) abort ();
+ if (arg2_32 (0, -1, 2.0df, 3.0f, 4.0, 5.0l) != 2.0df) abort ();
+ if (arg3_32 (0, -1, 2.0f, 3.0df, 4.0, 5.0l) != 3.0df) abort ();
+ if (arg4_32 (0, -1, 2.0f, 3.0, 4.0df, 5.0l) != 4.0df) abort ();
+ if (arg5_32 (0, -1, 2.0f, 3.0, 4.0l, 5.0df) != 5.0df) abort ();
/* _Decimal64 variants. */
- if (arg0_64 (0.0dd, -1, 2, 3.0f, 4.0, 5.0ld) != 0.0dd) abort ();
- if (arg1_64 (0, 1.0dd, 2, 3.0f, 4.0, 5.0ld) != 1.0dd) abort ();
- if (arg2_64 (0, -1, 2.0dd, 3.0f, 4.0, 5.0ld) != 2.0dd) abort ();
- if (arg3_64 (0, -1, 2.0f, 3.0dd, 4.0, 5.0ld) != 3.0dd) abort ();
- if (arg4_64 (0, -1, 2.0f, 3.0, 4.0dd, 5.0ld) != 4.0dd) abort ();
- if (arg5_64 (0, -1, 2.0f, 3.0, 4.0ld, 5.0dd) != 5.0dd) abort ();
+ if (arg0_64 (0.0dd, -1, 2, 3.0f, 4.0, 5.0l) != 0.0dd) abort ();
+ if (arg1_64 (0, 1.0dd, 2, 3.0f, 4.0, 5.0l) != 1.0dd) abort ();
+ if (arg2_64 (0, -1, 2.0dd, 3.0f, 4.0, 5.0l) != 2.0dd) abort ();
+ if (arg3_64 (0, -1, 2.0f, 3.0dd, 4.0, 5.0l) != 3.0dd) abort ();
+ if (arg4_64 (0, -1, 2.0f, 3.0, 4.0dd, 5.0l) != 4.0dd) abort ();
+ if (arg5_64 (0, -1, 2.0f, 3.0, 4.0l, 5.0dd) != 5.0dd) abort ();
/* _Decimal128 variants. */
- if (arg0_128 (0.0dl, -1, 2, 3.0f, 4.0, 5.0ld) != 0.0dl) abort ();
- if (arg1_128 (0, 1.0dl, 2, 3.0f, 4.0, 5.0ld) != 1.0dl) abort ();
- if (arg2_128 (0, -1, 2.0dl, 3.0f, 4.0, 5.0ld) != 2.0dl) abort ();
- if (arg3_128 (0, -1, 2.0f, 3.0dl, 4.0, 5.0ld) != 3.0dl) abort ();
- if (arg4_128 (0, -1, 2.0f, 3.0, 4.0dl, 5.0ld) != 4.0dl) abort ();
- if (arg5_128 (0, -1, 2.0f, 3.0, 4.0ld, 5.0dl) != 5.0dl) abort ();
+ if (arg0_128 (0.0dl, -1, 2, 3.0f, 4.0, 5.0l) != 0.0dl) abort ();
+ if (arg1_128 (0, 1.0dl, 2, 3.0f, 4.0, 5.0l) != 1.0dl) abort ();
+ if (arg2_128 (0, -1, 2.0dl, 3.0f, 4.0, 5.0l) != 2.0dl) abort ();
+ if (arg3_128 (0, -1, 2.0f, 3.0dl, 4.0, 5.0l) != 3.0dl) abort ();
+ if (arg4_128 (0, -1, 2.0f, 3.0, 4.0dl, 5.0l) != 4.0dl) abort ();
+ if (arg5_128 (0, -1, 2.0f, 3.0, 4.0l, 5.0dl) != 5.0dl) abort ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/dfp/operator-assignment.c b/gcc/testsuite/gcc.dg/dfp/operator-assignment.c
index 490748f50ac..8e8a922f371 100644
--- a/gcc/testsuite/gcc.dg/dfp/operator-assignment.c
+++ b/gcc/testsuite/gcc.dg/dfp/operator-assignment.c
@@ -46,9 +46,9 @@ extern void abort (void);
int
main ()
{
- _Decimal32 d32 = 1.23456fd, d32a = 1.2df;
+ _Decimal32 d32 = 1.23456df, d32a = 1.2df;
_Decimal64 d64 = 23.456789dd, d64a = 2.8dd;
- _Decimal128 d128 = 345.67890123456789ld, d128a = 4.7dl;
+ _Decimal128 d128 = 345.67890123456789dl, d128a = 4.7dl;
DECIMAL_COMPOUND_ASSIGNMENT(32, d32);
DECIMAL_COMPOUND_ASSIGNMENT(64, d64);
diff --git a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c
new file mode 100644
index 00000000000..4693abc90d9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* This used to result in an ICE. */
+
+extern _Decimal64 x;
+extern int i;
+
+void
+foo (void)
+{
+ if (x <= 2.0) /* { dg-error "mix operands" } */
+ i++;
+}
diff --git a/gcc/testsuite/gcc.dg/dse.c b/gcc/testsuite/gcc.dg/dse.c
new file mode 100644
index 00000000000..4a859ae03e7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dse.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse-details" } */
+
+#define N 256
+
+struct
+{
+ int x;
+ int y;
+} S[100];
+
+int z[100];
+
+int
+foo (void)
+{
+ int i;
+ int x, y;
+
+ S[5].x = 0;
+ S[5].y = 0;
+
+ x = 5 + z[0];
+ y = z[0];
+
+ S[5].x = x;
+ S[5].y = y;
+}
+
+/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse*" } } */
+
diff --git a/gcc/testsuite/gcc.dg/fltconst-1.c b/gcc/testsuite/gcc.dg/fltconst-1.c
new file mode 100644
index 00000000000..bf922270644
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fltconst-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+double a = 1.ld; /* { dg-error "invalid suffix" } */
+double b = 1.fd; /* { dg-error "invalid suffix" } */
+double c = 1.di; /* { dg-error "invalid suffix" } */
+double d = 1.dj; /* { dg-error "invalid suffix" } */
+double e = 1.id; /* { dg-error "invalid suffix" } */
+double f = 1.jd; /* { dg-error "invalid suffix" } */
+double g = 1.ddd; /* { dg-error "invalid suffix" } */
+double h = 1.ldd; /* { dg-error "invalid suffix" } */
+double i = 1.dld; /* { dg-error "invalid suffix" } */
+double j = 1.ddl; /* { dg-error "invalid suffix" } */
+double k = 1.fdd; /* { dg-error "invalid suffix" } */
+double l = 1.dfd; /* { dg-error "invalid suffix" } */
+double m = 1.ddf; /* { dg-error "invalid suffix" } */
diff --git a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
new file mode 100644
index 00000000000..d0d1c4c52fc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+double a = 1.dl; /* { dg-warning "decimal float" } */
+double b = 1.df; /* { dg-warning "decimal float" } */
+double c = 1.dd; /* { dg-warning "decimal float" } */
diff --git a/gcc/testsuite/gcc.dg/inline-15.c b/gcc/testsuite/gcc.dg/inline-15.c
index 7df8af1102e..e668191159a 100644
--- a/gcc/testsuite/gcc.dg/inline-15.c
+++ b/gcc/testsuite/gcc.dg/inline-15.c
@@ -3,5 +3,5 @@
/* { dg-do compile } */
/* { dg-options "-std=c99" } */
-extern inline int func1 (void); /* { dg-error "never defined" } */
-inline int func2 (void); /* { dg-error "never defined" } */
+extern inline int func1 (void); /* { dg-warning "never defined" } */
+inline int func2 (void); /* { dg-warning "never defined" } */
diff --git a/gcc/testsuite/gcc.dg/invalid-call-1.c b/gcc/testsuite/gcc.dg/invalid-call-1.c
index 7474227fa52..4126b5a4ff0 100644
--- a/gcc/testsuite/gcc.dg/invalid-call-1.c
+++ b/gcc/testsuite/gcc.dg/invalid-call-1.c
@@ -3,7 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-options "-O2 -mtune=i586" { target i?86-*-* } } */
+/* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
typedef void (*fp)(void);
extern char* bar(void* a1, int a2);
diff --git a/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc/testsuite/gcc.dg/pch/pch.exp
index 7e65e03e657..c2b309e194c 100644
--- a/gcc/testsuite/gcc.dg/pch/pch.exp
+++ b/gcc/testsuite/gcc.dg/pch/pch.exp
@@ -40,6 +40,7 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
set test "largefile.c"
set testh "largefile.hs"
set f [open $test w]
+puts $f "/* { dg-xfail-if \"PR 14940\" { \"i?86-*-solaris2.10\" } { \"*\" } { \"\" } } */"
set v 0
for { set v 0 } { $v < 10000 } { incr v } {
puts $f "#define MACRO_${v} \"1234567890\" \"$v\""
diff --git a/gcc/testsuite/gcc.dg/pr27953.c b/gcc/testsuite/gcc.dg/pr27953.c
index 92a63d83686..b5e86e262fd 100644
--- a/gcc/testsuite/gcc.dg/pr27953.c
+++ b/gcc/testsuite/gcc.dg/pr27953.c
@@ -1,4 +1,4 @@
/* PR c/27953 */
-void foo(struct A a) {} /* { dg-error "parameter list|definition|incomplete type" } */
+void foo(struct A a) {} /* { dg-warning "parameter list|definition|incomplete type" } */
void foo() {} /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/pr30957-1.c b/gcc/testsuite/gcc.dg/pr30957-1.c
new file mode 100644
index 00000000000..26d5de7f6f7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30957-1.c
@@ -0,0 +1,30 @@
+/* { dg-do run { xfail vax-*-* powerpc-*-*spe } } */
+/* { dg-options "-O2 -funroll-loops -funsafe-math-optimizations -fvariable-expansion-in-unroller -dL" } */
+
+extern void abort (void);
+extern void exit (int);
+
+float
+foo (float d, int n)
+{
+ unsigned i;
+ float accum = d;
+
+ for (i = 0; i < n; i++)
+ accum += d;
+
+ return accum;
+}
+
+int
+main ()
+{
+ if (__builtin_copysignf (1.0, foo (0.0 / -5.0, 10)) != -1.0)
+ abort ();
+ exit (0);
+}
+
+/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop*" } } */
+
+
diff --git a/gcc/testsuite/gcc.dg/pr31344.c b/gcc/testsuite/gcc.dg/pr31344.c
new file mode 100644
index 00000000000..a01439b7e0e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr31344.c
@@ -0,0 +1,25 @@
+/* { dg-do compile { target dfp } } */
+/* { dg-options "-O -std=gnu99 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-O -std=gnu99" } */
+
+typedef struct
+{
+ unsigned char bits;
+} decNumber;
+
+typedef struct
+{
+ unsigned char bytes[1];
+} decimal32;
+
+extern decNumber *__decimal32ToNumber (const decimal32 *, decNumber *);
+extern void __host_to_ieee_32 (_Decimal32, decimal32 *);
+
+void
+foo (_Decimal32 arg)
+{
+ decNumber dn;
+ decimal32 d32;
+ __host_to_ieee_32 (arg, &d32);
+ __decimal32ToNumber (&d32, &dn);
+}
diff --git a/gcc/testsuite/gcc.dg/pr31847.c b/gcc/testsuite/gcc.dg/pr31847.c
new file mode 100644
index 00000000000..4b945a994aa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr31847.c
@@ -0,0 +1,15 @@
+/* PR 31847 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-all" } */
+
+extern int bar(int);
+
+int foo()
+{
+ int a = 0;
+ return bar(a);
+}
+
+/* { dg-final { scan-tree-dump-not "Created value for " "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/reg-vol-struct-1.c b/gcc/testsuite/gcc.dg/reg-vol-struct-1.c
index 7751bb4a117..b885f917946 100644
--- a/gcc/testsuite/gcc.dg/reg-vol-struct-1.c
+++ b/gcc/testsuite/gcc.dg/reg-vol-struct-1.c
@@ -13,6 +13,6 @@ f (void)
register struct S a;
register struct S b[2];
register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */
- &a; /* { dg-warning "address of register" "explicit address" } */
- b; /* { dg-warning "address of register" "implicit address" } */
+ &a; /* { dg-error "address of register" "explicit address" } */
+ b; /* { dg-error "address of register" "implicit address" } */
}
diff --git a/gcc/testsuite/gcc.dg/special/gcsec-1.c b/gcc/testsuite/gcc.dg/special/gcsec-1.c
index 68d4066fa39..b76ad50aa78 100644
--- a/gcc/testsuite/gcc.dg/special/gcsec-1.c
+++ b/gcc/testsuite/gcc.dg/special/gcsec-1.c
@@ -5,7 +5,8 @@
/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" } */
/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" { target native } } */
-/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections" { target *-*-netware* } } */
+/* Solaris 10 does not support static linking; there is no libc.a. */
+/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections" { target *-*-netware* i?86-*-solaris2.1[0-9] } } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-2.c b/gcc/testsuite/gcc.dg/torture/builtin-math-2.c
index 5153ae49214..81608b87893 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-math-2.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-math-2.c
@@ -24,6 +24,12 @@ extern void fool (long double);
fool (__builtin_##FUNC##l (ARG1##L, ARG2##L)); \
} while (0)
+#define TESTIT2_I1(FUNC, ARG1, ARG2) do { \
+ foof (__builtin_##FUNC##f (ARG1, ARG2##F)); \
+ foo (__builtin_##FUNC (ARG1, ARG2)); \
+ fool (__builtin_##FUNC##l (ARG1, ARG2##L)); \
+} while (0)
+
#define TESTIT2_I2ALL(FUNC, ARGF, MAXF, ARGD, MAXD, ARGLD, MAXLD) do { \
foof (__builtin_##FUNC##f (ARGF, MAXF)); \
foo (__builtin_##FUNC (ARGD, MAXD)); \
@@ -36,6 +42,13 @@ extern void fool (long double);
fool (__builtin_##FUNC##l (ARG1##L, ARG2)); \
} while (0)
+#define TESTIT_REMQUO(ARG1, ARG2) do { \
+ int quo; \
+ foof (__builtin_remquof (ARG1##F, ARG2##F, &quo)); \
+ foo (__builtin_remquo (ARG1, ARG2, &quo)); \
+ fool (__builtin_remquol (ARG1##L, ARG2##L, &quo)); \
+} while (0)
+
void bar()
{
/* An argument of NaN is not evaluated at compile-time. */
@@ -228,6 +241,31 @@ void bar()
foof (__builtin_ilogbf (-__builtin_nanf("")));
foo (__builtin_ilogb (-__builtin_nan("")));
fool (__builtin_ilogbl (-__builtin_nanl("")));
+
+ /* The y* arg must be [0 ... Inf] EXclusive. */
+ TESTIT (y0, -1.0);
+ TESTIT (y0, 0.0);
+ TESTIT (y0, -0.0);
+
+ TESTIT (y1, -1.0);
+ TESTIT (y1, 0.0);
+ TESTIT (y1, -0.0);
+
+ TESTIT2_I1 (yn, 2, -1.0);
+ TESTIT2_I1 (yn, 2, 0.0);
+ TESTIT2_I1 (yn, 2, -0.0);
+
+ TESTIT2_I1 (yn, -3, -1.0);
+ TESTIT2_I1 (yn, -3, 0.0);
+ TESTIT2_I1 (yn, -3, -0.0);
+
+ /* The second argument of remquo/remainder/drem must not be 0. */
+ TESTIT_REMQUO (1.0, 0.0);
+ TESTIT_REMQUO (1.0, -0.0);
+ TESTIT2 (remainder, 1.0, 0.0);
+ TESTIT2 (remainder, 1.0, -0.0);
+ TESTIT2 (drem, 1.0, 0.0);
+ TESTIT2 (drem, 1.0, -0.0);
}
/* { dg-final { scan-tree-dump-times "exp2 " 9 "original" } } */
@@ -284,4 +322,22 @@ void bar()
/* { dg-final { scan-tree-dump-times "ilogb " 6 "original" } } */
/* { dg-final { scan-tree-dump-times "ilogbf" 6 "original" } } */
/* { dg-final { scan-tree-dump-times "ilogbl" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "y0 " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y0f" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y0l" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y1 " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y1f" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y1l" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "yn " 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "ynf" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "ynl" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "remquo " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remquof" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remquol" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remainder " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remainderf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remainderl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "drem " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "dremf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "dreml" 2 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-4.c b/gcc/testsuite/gcc.dg/torture/builtin-math-4.c
new file mode 100644
index 00000000000..e91f14c8220
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/builtin-math-4.c
@@ -0,0 +1,255 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the compiler. This testcase is
+ for functionality that was available as of mpfr-2.3.0.
+
+ Origin: Kaveh R. Ghazi, April 23, 2007. */
+
+/* { dg-do link } */
+/* Expect failures at least until mpfr-2.3.0 is released. */
+/* { dg-xfail-if "mpfr-2.3.0" { *-*-* } } */
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* Test that FUNC(ARG) == (RES). */
+#define TESTIT(FUNC,ARG,RES) do { \
+ if (__builtin_##FUNC##f(ARG##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) != RES \
+ || CKSGN(__builtin_##FUNC(ARG),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG) < (HI). */
+#define TESTIT_R(FUNC,ARG,LOW,HI) do { \
+ if (__builtin_##FUNC##f(ARG) <= (LOW) || __builtin_##FUNC##f(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) <= (LOW) || __builtin_##FUNC(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG) <= (LOW) || __builtin_##FUNC##l(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(ARG1, ARG2) == (RES). */
+#define TESTIT2(FUNC,ARG1,ARG2,RES) do { \
+ if (__builtin_##FUNC##f(ARG1, ARG2##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG1,ARG2##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2) != RES \
+ || CKSGN(__builtin_##FUNC(ARG1,ARG2),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1, ARG2##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG1,ARG2##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG1,ARG2) < (HI). */
+#define TESTIT2_R(FUNC,ARG1,ARG2,LOW,HI) do { \
+ if (__builtin_##FUNC##f(ARG1, ARG2##F) <= (LOW) \
+ || __builtin_##FUNC##f(ARG1, ARG2##F) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2) <= (LOW) \
+ || __builtin_##FUNC(ARG1, ARG2) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1, ARG2##L) <= (LOW) \
+ || __builtin_##FUNC##l(ARG1, ARG2##L) >= (HI)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that remquo(ARG0, ARG1, &ARG_Q) == RES and ARG_Q == RES_Q.
+ Also test remainder/drem (ARG0,ARG1) == RES. */
+#define TESTIT2_REMQUO(ARG0,ARG1,ARG_Q,RES,RES_Q) do { \
+ ARG_Q = 12345; \
+ if (__builtin_remquof(ARG0##F, ARG1##F, &ARG_Q) != RES##F \
+ || CKSGN_F(__builtin_remquof(ARG0##F, ARG1##F, &ARG_Q),RES##F) \
+ || ARG_Q != RES_Q \
+ || __builtin_remainderf(ARG0##F, ARG1##F) != RES##F \
+ || CKSGN_F(__builtin_remainderf(ARG0##F, ARG1##F),RES##F) \
+ || __builtin_dremf(ARG0##F, ARG1##F) != RES##F \
+ || CKSGN_F(__builtin_dremf(ARG0##F, ARG1##F),RES##F)) \
+ link_error(__LINE__); \
+ ARG_Q = 12345; \
+ if (__builtin_remquo(ARG0, ARG1, &ARG_Q) != RES \
+ || CKSGN(__builtin_remquo(ARG0, ARG1, &ARG_Q),RES) \
+ || ARG_Q != RES_Q \
+ || __builtin_remainder(ARG0, ARG1) != RES \
+ || CKSGN(__builtin_remainder(ARG0, ARG1),RES) \
+ || __builtin_drem(ARG0, ARG1) != RES \
+ || CKSGN(__builtin_drem(ARG0, ARG1),RES)) \
+ link_error(__LINE__); \
+ ARG_Q = 12345; \
+ if (__builtin_remquol(ARG0##L, ARG1##L, &ARG_Q) != RES##L \
+ || CKSGN_L(__builtin_remquol(ARG0##L, ARG1##L, &ARG_Q),RES##L) \
+ || ARG_Q != RES_Q \
+ || __builtin_remainderl(ARG0##L, ARG1##L) != RES##L \
+ || CKSGN_L(__builtin_remainderl(ARG0##L, ARG1##L),RES##L) \
+ || __builtin_dreml(ARG0##L, ARG1##L) != RES##L \
+ || CKSGN_L(__builtin_dreml(ARG0##L, ARG1##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+int main (void)
+{
+#ifdef __OPTIMIZE__
+ int q;
+#endif
+
+ TESTIT (j0, 0.0, 1.0); /* j0(0) == 1 */
+ TESTIT (j0, -0.0, 1.0); /* j0(-0) == 1 */
+ TESTIT_R (j0, 1.0, 0.765, 0.766); /* j0(1) == 0.7651... */
+ TESTIT_R (j0, -1.0, 0.765, 0.766); /* j0(-1) == 0.7651... */
+
+ TESTIT (j1, 0.0, 0.0); /* j1(0) == 0 */
+ TESTIT (j1, -0.0, -0.0); /* j1(-0) == -0 */
+ TESTIT_R (j1, 1.0, 0.44, 0.45); /* j1(1) == 0.440... */
+ TESTIT_R (j1, -1.0, -0.45, -0.44); /* j1(-1) == -0.440... */
+
+ TESTIT2 (jn, 5, 0.0, 0.0); /* jn(5,0) == 0 */
+ TESTIT2 (jn, 5, -0.0, -0.0); /* jn(5,-0) == -0 */
+ TESTIT2 (jn, 6, 0.0, 0.0); /* jn(6,0) == 0 */
+ TESTIT2 (jn, 6, -0.0, 0.0); /* jn(6,-0) == 0 */
+
+ TESTIT2 (jn, -5, 0.0, -0.0); /* jn(-5,0) == -0 */
+ TESTIT2 (jn, -5, -0.0, 0.0); /* jn(-5,-0) == 0 */
+ TESTIT2 (jn, -6, 0.0, 0.0); /* jn(-6,0) == 0 */
+ TESTIT2 (jn, -6, -0.0, 0.0); /* jn(-6,-0) == 0 */
+
+ TESTIT2_R (jn, 2, 1.0, 0.11, 0.12); /* jn(2,1) == 0.114... */
+ TESTIT2_R (jn, 2, -1.0, 0.11, 0.12); /* jn(2,-1) == 0.114... */
+ TESTIT2_R (jn, 3, 5.0, 0.36, 0.37); /* jn(3,5) == 0.364... */
+ TESTIT2_R (jn, 3, -5.0, -0.37, -0.36); /* jn(3,-5) == -0.364... */
+
+ TESTIT2_R (jn, -2, 1.0, 0.11, 0.12); /* jn(-2,1) == 0.114... */
+ TESTIT2_R (jn, -2, -1.0, 0.11, 0.12); /* jn(-2,-1) == 0.114... */
+ TESTIT2_R (jn, -3, 5.0, -0.37, -0.36); /* jn(-3,5) == -0.364... */
+ TESTIT2_R (jn, -3, -5.0, 0.36, 0.37); /* jn(-3,-5) == 0.364... */
+
+ TESTIT2_R (jn, 4, 3.5, 0.20, 0.21); /* jn(4,3.5) == 0.204... */
+ TESTIT2_R (jn, 4, -3.5, 0.20, 0.21); /* jn(4,-3.5) == 0.204... */
+ TESTIT2_R (jn, 5, 4.6, 0.20, 0.21); /* jn(5,4.6) == 0.207... */
+ TESTIT2_R (jn, 5, -4.6, -0.21, -0.20); /* jn(5,-4.6) == -0.207... */
+
+ TESTIT2_R (jn, -4, 3.5, 0.20, 0.21); /* jn(-4,3.5) == 0.204... */
+ TESTIT2_R (jn, -4, -3.5, 0.20, 0.21); /* jn(-4,-3.5) == 0.204... */
+ TESTIT2_R (jn, -5, 4.6, -0.21, -0.20); /* jn(-5,4.6) == -0.207... */
+ TESTIT2_R (jn, -5, -4.6, 0.20, 0.21); /* jn(-5,-4.6) == 0.207... */
+
+ TESTIT_R (y0, 5.0, -0.31, -0.30); /* y0(5) == -0.308... */
+ TESTIT_R (y0, 0.1, -1.54, -1.53); /* y0(0.1) == -1.534... */
+
+ TESTIT_R (y1, 5.0, 0.14, 0.15); /* y1(5) == 0.147... */
+ TESTIT_R (y1, 0.1, -6.46, -6.45); /* y1(0.1) == -6.458... */
+
+ TESTIT2_R (yn, -1, 3.0, -0.33, -0.32); /* yn(-1,3) == -0.324... */
+ TESTIT2_R (yn, -1, 0.25, 2.70, 2.71); /* yn(-1,0.25) == 2.704... */
+
+ TESTIT2_R (yn, 2, 4.0, 0.21, 0.22); /* yn(2,4) == 0.215... */
+ TESTIT2_R (yn, 2, 0.9, -1.95, -1.94); /* yn(2,0.9) == -1.945... */
+ TESTIT2_R (yn, -2, 4.0, 0.21, 0.22); /* yn(-2,4) == 0.215... */
+ TESTIT2_R (yn, -2, 0.9, -1.95, -1.94); /* yn(-2,0.9) == -1.945... */
+
+ TESTIT2_R (yn, 3, 6.0, 0.32, 0.33); /* yn(3,6) == 0.328... */
+ TESTIT2_R (yn, 3, 0.89, -8.03, -8.02); /* yn(3,0.89) == -8.020... */
+ TESTIT2_R (yn, -3, 8.0, -0.03, -0.02); /* yn(-3,8) == -0.026... */
+ TESTIT2_R (yn, -3, 0.99, 5.98, 5.99); /* yn(-3,0.99) == 5.982... */
+
+#ifdef __OPTIMIZE__
+ /* These tests rely on propagating the variable q, which happens
+ only when optimization is turned on. This macro also tests
+ remainder/drem. */
+ TESTIT2_REMQUO (0.0, 1.0, q, 0.0, 0); /* remquo(0,1,&q)==0, q==0 */
+ TESTIT2_REMQUO (1.0, 1.0, q, 0.0, 1); /* remquo(1,1,&q)==0, q==1 */
+ TESTIT2_REMQUO (2.0, 1.0, q, 0.0, 2); /* remquo(2,1,&q)==0, q==2 */
+ TESTIT2_REMQUO (-0.0, 1.0, q, -0.0, 0); /* remquo(-0,1,&q)==-0, q==0 */
+ TESTIT2_REMQUO (-1.0, 1.0, q, -0.0, -1); /* remquo(-1,1,&q)==-0, q==-1 */
+ TESTIT2_REMQUO (-2.0, 1.0, q, -0.0, -2); /* remquo(-2,1,&q)==-0, q==-2 */
+
+ TESTIT2_REMQUO (0.0, -1.0, q, 0.0, 0); /* remquo(0,-1,&q)==0, q==0 */
+ TESTIT2_REMQUO (1.0, -1.0, q, 0.0, -1); /* remquo(1,-1,&q)==0, q==-1 */
+ TESTIT2_REMQUO (2.0, -1.0, q, 0.0, -2); /* remquo(2,-1,&q)==0, q==-2 */
+ TESTIT2_REMQUO (-0.0, -1.0, q, -0.0, 0); /* remquo(-0,-1,&q)==-0, q==0 */
+ TESTIT2_REMQUO (-1.0, -1.0, q, -0.0, 1); /* remquo(-1,-1,&q)==-0, q==1 */
+ TESTIT2_REMQUO (-2.0, -1.0, q, -0.0, 2); /* remquo(-2,-1,&q)==-0, q==2 */
+
+ TESTIT2_REMQUO (1.0, 2.0, q, 1.0, 0); /* remquo(1,2,&q)==1, q==0 */
+ TESTIT2_REMQUO (3.0, 2.0, q, -1.0, 2); /* remquo(3,2,&q)==-1, q==2 */
+ TESTIT2_REMQUO (5.0, 2.0, q, 1.0, 2); /* remquo(5,2,&q)==1, q==2 */
+ TESTIT2_REMQUO (-1.0, 2.0, q, -1.0, 0); /* remquo(-1,2,&q)==-1, q==0 */
+ TESTIT2_REMQUO (-3.0, 2.0, q, 1.0, -2); /* remquo(-3,2,&q)==1, q==-2 */
+ TESTIT2_REMQUO (-5.0, 2.0, q, -1.0, -2); /* remquo(-5,2,&q)==-1, q==-2 */
+
+ TESTIT2_REMQUO (1.0, -2.0, q, 1.0, 0); /* remquo(1,-2,&q)==1, q==0 */
+ TESTIT2_REMQUO (3.0, -2.0, q, -1.0, -2); /* remquo(3,-2,&q)==-1, q==-2 */
+ TESTIT2_REMQUO (5.0, -2.0, q, 1.0, -2); /* remquo(5,-2,&q)==1, q==-2 */
+ TESTIT2_REMQUO (-1.0, -2.0, q, -1.0, 0); /* remquo(-1,-2,&q)==-1, q==0 */
+ TESTIT2_REMQUO (-3.0, -2.0, q, 1.0, 2); /* remquo(-3,-2,&q)==1, q==2 */
+ TESTIT2_REMQUO (-5.0, -2.0, q, -1.0, 2); /* remquo(-5,-2,&q)==-1, q==2 */
+
+ /* Test that the maximum possible value can be generated into the
+ int quotient, and check for wrap around (modulo) when that value
+ is exceeded. We can only check for this when the mantissa has
+ enough bits to hold an INT_MAX value with complete precision. */
+
+#define MAXIT(FUNC,X,R) do { \
+ q = 12345; \
+ if (__builtin_##FUNC((X), 1, &q) != 0 || q != (R)) \
+ link_error (__LINE__); \
+} while (0)
+
+ if (sizeof(int)*__CHAR_BIT__ <= __FLT_MANT_DIG__)
+ {
+ MAXIT(remquof, __INT_MAX__-1.0F, __INT_MAX__-1);
+ MAXIT(remquof, __INT_MAX__+0.0F, __INT_MAX__);
+ MAXIT(remquof, __INT_MAX__+1.0F, 0);
+ MAXIT(remquof, __INT_MAX__+2.0F, 1);
+
+ MAXIT(remquof, -(__INT_MAX__-1.0F), -(__INT_MAX__-1));
+ MAXIT(remquof, -(__INT_MAX__+0.0F), -__INT_MAX__);
+ MAXIT(remquof, -(__INT_MAX__+1.0F), 0);
+ MAXIT(remquof, -(__INT_MAX__+2.0F), -1);
+ }
+
+ if (sizeof(int)*__CHAR_BIT__ <= __DBL_MANT_DIG__)
+ {
+ MAXIT(remquo, __INT_MAX__-1.0, __INT_MAX__-1);
+ MAXIT(remquo, __INT_MAX__+0.0, __INT_MAX__);
+ MAXIT(remquo, __INT_MAX__+1.0, 0);
+ MAXIT(remquo, __INT_MAX__+2.0, 1);
+
+ MAXIT(remquo, -(__INT_MAX__-1.0), -(__INT_MAX__-1));
+ MAXIT(remquo, -(__INT_MAX__+0.0), -__INT_MAX__);
+ MAXIT(remquo, -(__INT_MAX__+1.0), 0);
+ MAXIT(remquo, -(__INT_MAX__+2.0), -1);
+ }
+
+ if (sizeof(int)*__CHAR_BIT__ <= __LDBL_MANT_DIG__)
+ {
+ MAXIT(remquo, __INT_MAX__-1.0L, __INT_MAX__-1);
+ MAXIT(remquo, __INT_MAX__+0.0L, __INT_MAX__);
+ MAXIT(remquo, __INT_MAX__+1.0L, 0);
+ MAXIT(remquo, __INT_MAX__+2.0L, 1);
+
+ MAXIT(remquol, -(__INT_MAX__-1.0L), -(__INT_MAX__-1));
+ MAXIT(remquol, -(__INT_MAX__+0.0L), -__INT_MAX__);
+ MAXIT(remquol, -(__INT_MAX__+1.0L), 0);
+ MAXIT(remquol, -(__INT_MAX__+2.0L), -1);
+ }
+#endif
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
index 7693d17d316..965e728bec2 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
@@ -1,7 +1,6 @@
/* Test floating-point conversions. __float128 type with TImode. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do run { target { ia64-*-* || { { i?86-*-* x86_64-*-*} && lp64 } } } } */
-/* { dg-xfail-if "" { i?86-*-* x86_64-*-* } { "*" } { "" } } */
/* { dg-xfail-if "" { ia64-*-linux* } { "*" } { "" } } */
/* { dg-options "" } */
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
index 0e774e0ab27..24decb86fdf 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
@@ -1,7 +1,6 @@
/* Test floating-point conversions. __float128 type. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do run { target { ia64-*-* || { { i?86-*-* x86_64-*-*} && lp64 } } } } */
-/* { dg-xfail-if "" { i?86-*-* x86_64-*-* } { "*" } { "" } } */
/* { dg-options "" } */
#include "fp-int-convert.h"
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c
new file mode 100644
index 00000000000..13699aafd62
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c
@@ -0,0 +1,21 @@
+/* PR 31885 */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-empty" } */
+
+struct s {
+ int *blah;
+};
+
+static struct s array[] = { { 0 } };
+
+void
+foo (struct s *p)
+{
+ struct s *q = &array[1];
+ while (p < q)
+ p++;
+}
+
+/* { dg-final { scan-tree-dump-times "Removing empty loop" 1 "empty" } } */
+/* { dg-final { cleanup-tree-dump "empty" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c
new file mode 100644
index 00000000000..14d58e59874
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c
@@ -0,0 +1,14 @@
+/* PR 25371 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+void
+slow_close(int n)
+{
+ int i;
+ double *mm;
+ for (i=0;i<2*n;i++)
+ for (i=0;i<2*n;i++)
+ *(mm+i*2*n+i) = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
index 420c723da7f..f517c89b185 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-forwprop2" } */
-
+/* { dg-options "-O2 -fdump-tree-forwprop" } */
struct A { int i; };
int
@@ -12,7 +11,6 @@ foo(struct A *locp, int str)
return locp->i;
}
-/* { dg-final { scan-tree-dump-times "&" 0 "forwprop2" } } */
-/* { dg-final { cleanup-tree-dump "forwprop2" } } */
-
-
+/* { dg-final { scan-tree-dump "locp.*->i =" "forwprop1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "locp.*->i =" "forwprop2" } } */
+/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c
index 6ffcfa1973a..402c102d259 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c
@@ -35,11 +35,9 @@ void foo (void)
/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
/* Second, we should thread the edge out of the loop via the break
- statement. */
-/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "vrp1" } } */
-
-/* Now if we were really good, we'd realize that the final bytes == 0
- test is totally useless. That's not likely to happen anytime soon. */
+ statement. We also realize that the final bytes == 0 test is useless,
+ and thread over it. */
+/* { dg-final { scan-tree-dump-times "Threaded jump" 2 "vrp1" } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c
new file mode 100644
index 00000000000..6aaea8ecb38
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c
@@ -0,0 +1,119 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-stats -fdump-tree-dom1-stats" } */
+
+void foo();
+void bla();
+void bar();
+
+/* In the following two cases, we should be able to thread edge through
+ the loop header. */
+
+void thread_entry_through_header (void)
+{
+ int i;
+
+ for (i = 0; i < 170; i++)
+ bla ();
+}
+
+void thread_latch_through_header (void)
+{
+ int i = 0;
+ int first = 1;
+
+ do
+ {
+ if (first)
+ foo ();
+
+ first = 0;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* This is a TODO -- it is correct to thread both entry and latch edge through
+ the header, but we do not handle this case yet. */
+
+void dont_thread_1 (void)
+{
+ int i = 0;
+ int first = 1;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = 0;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* Avoid threading in the following two cases, to prevent creating subloops. */
+
+void dont_thread_2 (int first)
+{
+ int i = 0;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = 0;
+ bla ();
+ } while (i++ < 100);
+}
+
+void dont_thread_3 (int nfirst)
+{
+ int i = 0;
+ int first = 0;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = nfirst;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* Avoid threading in this case, in order to avoid creating loop with
+ multiple entries. */
+
+void dont_thread_4 (int a, int nfirst)
+{
+ int i = 0;
+ int first;
+
+ if (a)
+ first = 0;
+ else
+ first = 1;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = nfirst;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 1" 1 "vrp1"} } */
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 2" 0 "vrp1"} } */
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 1" 0 "dom1"} } */
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 2" 1 "dom1"} } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
index a590458da6e..08ea7de124f 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -50,7 +50,7 @@ int main1 ()
abort ();
}
- /* 2. aligned on 8-bytes */
+ /* 2. aligned */
for (i = 3; i < N-1; i++)
{
tmp1[2].a.n[1][2][i] = 6;
@@ -63,7 +63,7 @@ int main1 ()
abort ();
}
- /* 3. aligned on 16-bytes */
+ /* 3. aligned */
for (i = 0; i < N; i++)
{
for (j = 0; j < N; j++)
@@ -113,8 +113,5 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* Loops 1,2,4 are unaligned on targets that require 16-byte alignment.
- Loops 1,4 are unaligned on targets that require 8-byte alignment (ia64). */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail ia64-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr22480.c b/gcc/testsuite/gcc.dg/vect/pr22480.c
index a7e238f2271..a7e238f2271 100755..100644
--- a/gcc/testsuite/gcc.dg/vect/pr22480.c
+++ b/gcc/testsuite/gcc.dg/vect/pr22480.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-102.c b/gcc/testsuite/gcc.dg/vect/vect-102.c
index af3261d01f8..49df4f9bc90 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-102.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-102.c
@@ -14,6 +14,7 @@ struct extraction
static int a[N] = {1,2,3,4,5,6,7,8,9};
static int b[N] = {2,3,4,5,6,7,8,9,9};
+volatile int foo;
int main1 (int x, int y) {
int i;
@@ -23,7 +24,7 @@ int main1 (int x, int y) {
for (i = 0; i < N; i++)
{
p->a[i] = a[i];
- if (x == 135)
+ if (foo == 135)
abort (); /* to avoid vectorization */
}
@@ -46,6 +47,7 @@ int main (void)
{
check_vect ();
+ foo = 0;
return main1 (0, N);
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-103.c b/gcc/testsuite/gcc.dg/vect/vect-103.c
index effa97e15ed..da1b69e5626 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-103.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-103.c
@@ -15,6 +15,7 @@ struct extraction
static int a[N] = {1,2,3,4,5,6,7,8,9};
static int b[N] = {17,24,7,0,2,3,4,31,82};
static int c[N] = {9,17,24,7,0,2,3,4,31};
+volatile int foo;
int main1 (int x, int y) {
int i;
@@ -25,7 +26,7 @@ int main1 (int x, int y) {
{
p->a[i] = a[i];
p->b[i] = b[i];
- if (x == 135)
+ if (foo == 135)
abort (); /* to avoid vectorization */
}
@@ -48,6 +49,7 @@ int main (void)
{
check_vect ();
+ foo = 0;
return main1 (0, N);
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-104.c b/gcc/testsuite/gcc.dg/vect/vect-104.c
index 6d16da6b32e..6ab0f23acf8 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-104.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-104.c
@@ -15,6 +15,7 @@ struct extraction
static int a[N][N] = {{1,2,3},{4,5,6},{7,8,9}};
static int b[N][N] = {{17,24,7},{0,2,3},{4,31,82}};
static int c[N][N] = {{1,2,3},{4,6,8},{8,9,9}};
+volatile int foo;
int main1 (int x) {
int i,j;
@@ -27,7 +28,7 @@ int main1 (int x) {
{
p->a[i][j] = a[i][j];
p->b[i][j] = b[i][j];
- if (x == 135)
+ if (foo == 135)
abort (); /* to avoid vectorization */
}
}
@@ -57,6 +58,7 @@ int main (void)
{
check_vect ();
+ foo = 0;
return main1 (N);
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-106.c b/gcc/testsuite/gcc.dg/vect/vect-106.c
index 04a9f6c1c68..04a9f6c1c68 100755..100644
--- a/gcc/testsuite/gcc.dg/vect/vect-106.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-106.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
new file mode 100644
index 00000000000..5d115fffb91
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int
+main1 ()
+{
+ int i;
+ double db[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+ int ia[N];
+
+ /* double -> int */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (int) db[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != (int) db[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_floatint_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
index 85a993a34c8..48f91d903b3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
@@ -1,4 +1,4 @@
-/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
#include <stdarg.h>
#include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
index c189e54ca7d..0723f8af810 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
@@ -1,4 +1,4 @@
-/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
#include <stdarg.h>
#include "tree-vect.h"
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
new file mode 100644
index 00000000000..e496e401656
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int main1 ()
+{
+ int i;
+ int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ double da[N];
+
+ /* int -> double */
+ for (i = 0; i < N; i++)
+ {
+ da[i] = (double) ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (da[i] != (double) ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
new file mode 100644
index 00000000000..e34f3458c6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int main1 ()
+{
+ int i;
+ short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30,-33,-36,-39,-42,-45};
+ float fa[N];
+
+ /* short -> float */
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = (float) sb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (fa[i] != (float) sb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
new file mode 100644
index 00000000000..72e7bf6aaa1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int main1 ()
+{
+ int i;
+ unsigned short usb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,65533,65530,65527,65524,65521,65518,65515,65512,65509,65506,65503,65500,65497,65494,65491};
+ float fa[N];
+
+ /* unsigned short -> float */
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = (float) usb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (fa[i] != (float) usb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr31628.c b/gcc/testsuite/gcc.target/i386/pr31628.c
new file mode 100644
index 00000000000..e3fb7f67817
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr31628.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-fPIC -O2" } */
+
+typedef int tt, *lptt;
+
+int __attribute__((__stdcall__)) bar(lptt);
+
+int __attribute__((__stdcall__)) bar(tt *x)
+{
+ return 0;
+}
+
+int
+foo (void)
+{
+ return bar (0);
+}
+
+int
+main()
+{
+ return foo ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr31854.c b/gcc/testsuite/gcc.target/i386/pr31854.c
new file mode 100644
index 00000000000..d5dca57ea63
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr31854.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target dfp } } */
+/* { dg-options "-O -std=gnu99" } */
+
+_Decimal128 d128;
+long double tf;
+
+void foo (void)
+{
+ d128 = tf;
+}
diff --git a/gcc/testsuite/gcc.target/m68k/interrupt_thread-1.c b/gcc/testsuite/gcc.target/m68k/interrupt_thread-1.c
new file mode 100644
index 00000000000..ee7179cd4d9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/interrupt_thread-1.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=fidoa -O2 -fomit-frame-pointer" } */
+
+/* Check that interrupt_thread attribute works. */
+
+#ifdef __mfido__
+extern void foo (void) __attribute__ ((interrupt_thread));
+
+int a, b, c, d;
+
+void bar (void);
+
+void
+foo (void)
+{
+ int w, x, y, z;
+
+ w = a;
+ x = b;
+ y = c;
+ z = d;
+
+ bar ();
+
+ a = w;
+ b = x;
+ c = y;
+ d = z;
+}
+#else
+/* If the current mutilib is, say, -mcpu=5485, the compiler gets
+ -mcpu=fidoa -mcpu=5485, where -mcpu=fidoa is overridden. In that
+ case, we just print out "sleep" in the assembly file and pretend
+ that everything is all right. */
+asm ("sleep");
+#endif
+
+/* "sleep" should be generated in place of "rts". */
+/* { dg-final { scan-assembler-times "sleep" 1 } } */
+/* { dg-final { scan-assembler-times "rts" 0 } } */
+
+/* There should be no stack adjustment. */
+/* { dg-final { scan-assembler-times "sp" 0 } } */
diff --git a/gcc/testsuite/gcc.target/m68k/interrupt_thread-2.c b/gcc/testsuite/gcc.target/m68k/interrupt_thread-2.c
new file mode 100644
index 00000000000..6f87c862fa6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/interrupt_thread-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=fidoa" } */
+
+/* Check that an error is issued for using more than one
+ interrupt_attribute at the same time. */
+
+/* If the current mutilib is, say, -mcpu=5485, the compiler gets
+ -mcpu=fidoa -mcpu=5485, where -mcpu=fidoa is overridden. In that
+ case, we just use two interrupt_handler attributes and expect the
+ same error. */
+#ifdef __mfido___
+#define IH interrupt_thread
+#else
+#define IH interrupt_handler
+#endif
+
+extern void f1 (void) __attribute__((interrupt_handler, interrupt_handler)); /* { dg-error "error: multiple interrupt attributes not allowed" } */
+
+extern void f2 (void) __attribute__((interrupt_handler, IH)); /* { dg-error "error: multiple interrupt attributes not allowed" } */
+
+extern void f3 (void) __attribute__((IH, interrupt_handler)); /* { dg-error "error: multiple interrupt attributes not allowed" } */
+
+extern void f4 (void) __attribute__((IH, IH)); /* { dg-error "error: multiple interrupt attributes not allowed" } */
diff --git a/gcc/testsuite/gcc.target/m68k/interrupt_thread-3.c b/gcc/testsuite/gcc.target/m68k/interrupt_thread-3.c
new file mode 100644
index 00000000000..cd2531eb5d7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/interrupt_thread-3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=cpu32" } */
+
+/* Check that interrupt_thread is rejected on CPUs other than
+ fido. */
+
+extern void foo (void) __attribute__((interrupt_thread)); /* { dg-error "error: interrupt_thread is available only on fido" } */
diff --git a/gcc/testsuite/gcc.target/m68k/m68k.exp b/gcc/testsuite/gcc.target/m68k/m68k.exp
index 9398d109cc6..872802d9586 100644
--- a/gcc/testsuite/gcc.target/m68k/m68k.exp
+++ b/gcc/testsuite/gcc.target/m68k/m68k.exp
@@ -17,7 +17,7 @@
# GCC testsuite that uses the `dg.exp' driver.
# Exit immediately if this isn't an m68k target.
-if ![istarget m68k*-*-*] then {
+if { ![istarget m68k*-*-*] && ![istarget fido*-*-*] } then {
return
}
diff --git a/gcc/testsuite/gcc.target/mips/msub-1.c b/gcc/testsuite/gcc.target/mips/msub-1.c
new file mode 100644
index 00000000000..d27e6479ef5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msub-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -march=vr5400 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsac\t\\\$0," 2 } } */
+
+long long
+f1 (int x, int y, long long z)
+{
+ return z - (long long) y * x;
+}
+
+long long
+f2 (int x, int y, long long z)
+{
+ long long t = (long long) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msub-2.c b/gcc/testsuite/gcc.target/mips/msub-2.c
new file mode 100644
index 00000000000..acb7efb2b43
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msub-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -march=vr5500 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
+
+long long
+f1 (int x, int y, long long z)
+{
+ return z - (long long) y * x;
+}
+
+long long
+f2 (int x, int y, long long z)
+{
+ long long t = (long long) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msub-3.c b/gcc/testsuite/gcc.target/mips/msub-3.c
new file mode 100644
index 00000000000..85cfed2febe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msub-3.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips32 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
+
+long long
+f1 (int x, int y, long long z)
+{
+ return z - (long long) y * x;
+}
+
+long long
+f2 (int x, int y, long long z)
+{
+ long long t = (long long) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msub-4.c b/gcc/testsuite/gcc.target/mips/msub-4.c
new file mode 100644
index 00000000000..8a526f8f583
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msub-4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips32r2 -mdspr2 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsub\t\\\$ac" 2 } } */
+
+long long
+f1 (int x, int y, long long z)
+{
+ return z - (long long) y * x;
+}
+
+long long
+f2 (int x, int y, long long z)
+{
+ long long t = (long long) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msubu-1.c b/gcc/testsuite/gcc.target/mips/msubu-1.c
new file mode 100644
index 00000000000..9390c473f53
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msubu-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -march=vr5400 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsacu\t\\\$0," 2 } } */
+
+typedef unsigned int ui;
+typedef unsigned long long ull;
+
+ull
+f1 (ui x, ui y, ull z)
+{
+ return z - (ull) y * x;
+}
+
+ull
+f2 (ui x, ui y, ull z)
+{
+ ull t = (ull) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msubu-2.c b/gcc/testsuite/gcc.target/mips/msubu-2.c
new file mode 100644
index 00000000000..75fb404eb97
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msubu-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -march=vr5500 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
+
+typedef unsigned int ui;
+typedef unsigned long long ull;
+
+ull
+f1 (ui x, ui y, ull z)
+{
+ return z - (ull) y * x;
+}
+
+ull
+f2 (ui x, ui y, ull z)
+{
+ ull t = (ull) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msubu-3.c b/gcc/testsuite/gcc.target/mips/msubu-3.c
new file mode 100644
index 00000000000..055ba589a95
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msubu-3.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips32 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
+
+typedef unsigned int ui;
+typedef unsigned long long ull;
+
+ull
+f1 (ui x, ui y, ull z)
+{
+ return z - (ull) y * x;
+}
+
+ull
+f2 (ui x, ui y, ull z)
+{
+ ull t = (ull) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/mips/msubu-4.c b/gcc/testsuite/gcc.target/mips/msubu-4.c
new file mode 100644
index 00000000000..ea4adb1b080
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/msubu-4.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips32r2 -mdspr2 -mgp32" } */
+/* { dg-final { scan-assembler-times "\tmsubu\t\\\$ac" 2 } } */
+
+typedef unsigned int ui;
+typedef unsigned long long ull;
+
+ull
+f1 (ui x, ui y, ull z)
+{
+ return z - (ull) y * x;
+}
+
+ull
+f2 (ui x, ui y, ull z)
+{
+ ull t = (ull) x * y;
+ int temp = 5;
+ if (temp == 5)
+ z -= t;
+ return z;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr18096-1.c b/gcc/testsuite/gcc.target/powerpc/pr18096-1.c
index 1393b12c4d2..c98b317bb04 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr18096-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr18096-1.c
@@ -5,7 +5,7 @@
void f(char*);
void mkcatdefs(char *fname)
-{ /* { dg-warning "too large" "stack frame too large" } */
+{ /* { dg-error "too large" "stack frame too large" } */
char line [2147483647];
f(line);
}
diff --git a/gcc/testsuite/gfortran.dg/actual_array_result_1.f90 b/gcc/testsuite/gfortran.dg/actual_array_result_1.f90
new file mode 100644
index 00000000000..cf79315cbb7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/actual_array_result_1.f90
@@ -0,0 +1,71 @@
+! { dg-do run }
+! PR fortan/31692
+! Passing array valued results to procedures
+!
+! Test case contributed by rakuen_himawari@yahoo.co.jp
+module one
+ integer :: flag = 0
+contains
+ function foo1 (n)
+ integer :: n
+ integer :: foo1(n)
+ if (flag == 0) then
+ call bar1 (n, foo1)
+ else
+ call bar2 (n, foo1)
+ end if
+ end function
+
+ function foo2 (n)
+ implicit none
+ integer :: n
+ integer,ALLOCATABLE :: foo2(:)
+ allocate (foo2(n))
+ if (flag == 0) then
+ call bar1 (n, foo2)
+ else
+ call bar2 (n, foo2)
+ end if
+ end function
+
+ function foo3 (n)
+ implicit none
+ integer :: n
+ integer,ALLOCATABLE :: foo3(:)
+ allocate (foo3(n))
+ foo3 = 0
+ call bar2(n, foo3(2:(n-1))) ! Check that sections are OK
+ end function
+
+ subroutine bar1 (n, array) ! Checks assumed size formal arg.
+ integer :: n
+ integer :: array(*)
+ integer :: i
+ do i = 1, n
+ array(i) = i
+ enddo
+ end subroutine
+
+ subroutine bar2(n, array) ! Checks assumed shape formal arg.
+ integer :: n
+ integer :: array(:)
+ integer :: i
+ do i = 1, size (array, 1)
+ array(i) = i
+ enddo
+ end subroutine
+end module
+
+program main
+ use one
+ integer :: n
+ n = 3
+ if(any (foo1(n) /= [ 1,2,3 ])) call abort()
+ if(any (foo2(n) /= [ 1,2,3 ])) call abort()
+ flag = 1
+ if(any (foo1(n) /= [ 1,2,3 ])) call abort()
+ if(any (foo2(n) /= [ 1,2,3 ])) call abort()
+ n = 5
+ if(any (foo3(n) /= [ 0,1,2,3,0 ])) call abort()
+end program
+! { dg-final { cleanup-modules "one" } }
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
index a56282bd1c5..7099001dc7f 100644
--- a/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
@@ -1,4 +1,4 @@
-! { dg-do run}
+! { dg-do run }
! { dg-options "-O2 -fdump-tree-original" }
!
! Check some basic functionality of allocatable components, including that they
diff --git a/gcc/testsuite/gfortran.dg/altreturn_3.f90 b/gcc/testsuite/gfortran.dg/altreturn_3.f90
index d4b5afb9ce8..999ada87a07 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_3.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_3.f90
@@ -1,4 +1,4 @@
-! { dg-do run}
+! { dg-do run }
! Tests the fix for PR30236, which was due to alternate returns
! in generic interfaces causing a segfault. They now work
! correctly.
diff --git a/gcc/testsuite/gfortran.dg/assumed_dummy_1.f90 b/gcc/testsuite/gfortran.dg/assumed_dummy_1.f90
index 97c163e8c6b..f8d7fea31a6 100644
--- a/gcc/testsuite/gfortran.dg/assumed_dummy_1.f90
+++ b/gcc/testsuite/gfortran.dg/assumed_dummy_1.f90
@@ -1,4 +1,4 @@
-! { dg do-run}
+! { dg-do run }
! Tests the fix for PRs 19358, 19477, 21211 and 21622.
!
! Note that this tests only the valid cases with explicit interfaces.
diff --git a/gcc/testsuite/gfortran.dg/besxy.f90 b/gcc/testsuite/gfortran.dg/besxy.f90
new file mode 100644
index 00000000000..5b4cbba97f2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/besxy.f90
@@ -0,0 +1,24 @@
+! { dg-do compile }
+!
+! Check whether BESXY functions take scalars and
+! arrays as arguments (PR31760).
+!
+PROGRAM test_erf
+ REAL :: r = 0.0, ra(2) = (/ 0.0, 1.0 /)
+
+ r = BESJ0(r)
+ r = BESJ1(r)
+ r = BESJN(0, r)
+
+ r = BESY0(r)
+ r = BESY1(r)
+ r = BESYN(0, r)
+
+ ra = BESJ0(ra)
+ ra = BESJ1(ra)
+ ra = BESJN(0, ra)
+
+ ra = BESY0(ra)
+ ra = BESY1(ra)
+ ra = BESYN(0, ra)
+END PROGRAM \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90 b/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90
index 938d19a6409..8617456f1e0 100644
--- a/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90
+++ b/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90
@@ -4,4 +4,4 @@
integer x(1)
x(2) = x(1) ! { dg-warning "out of bounds" }
end
-! { dg-output "out of bounds for array 'x', upper bound of dimension 1 exceeded.*at line 5" }
+! { dg-output "out of bounds for array 'x', upper bound of dimension 1 exceeded." }
diff --git a/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90 b/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
index 3796f7ee21c..7975a7e424b 100644
--- a/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
+++ b/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
@@ -1,4 +1,4 @@
-! { dg do-run }
+! { dg-do run }
! Tests passing of character array initialiser as actual argument.
! Fixes PR18109.
! Contributed by Paul Thomas pault@gcc.gnu.org
diff --git a/gcc/testsuite/gfortran.dg/char_length_3.f90 b/gcc/testsuite/gfortran.dg/char_length_3.f90
new file mode 100644
index 00000000000..cee55f65f21
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_length_3.f90
@@ -0,0 +1,49 @@
+! { dg-do compile }
+! PR fortran/25071
+! Check if actual argument is too short
+!
+ program test
+ implicit none
+ character(len=10) :: v
+ character(len=10), target :: x
+ character(len=20), target :: y
+ character(len=30), target :: z
+ character(len=10), pointer :: ptr1
+ character(len=20), pointer :: ptr2
+ character(len=30), pointer :: ptr3
+ character(len=10), allocatable :: alloc1(:)
+ character(len=20), allocatable :: alloc2(:)
+ character(len=30), allocatable :: alloc3(:)
+ call foo(v) ! { dg-error "actual argument shorter than of dummy" }
+ call foo(x) ! { dg-error "actual argument shorter than of dummy" }
+ call foo(y)
+ call foo(z)
+ ptr1 => x
+ call foo(ptr1) ! { dg-error "actual argument shorter than of dummy" }
+ call bar(ptr1) ! { dg-error "actual argument shorter than of dummy" }
+ ptr2 => y
+ call foo(ptr2)
+ call bar(ptr2)
+ ptr3 => z
+ call foo(ptr3)
+ call bar(ptr3) ! { dg-error "Character length mismatch" }
+ allocate(alloc1(1))
+ allocate(alloc2(1))
+ allocate(alloc3(1))
+ call arr(alloc1) ! { dg-error "actual argument shorter than of dummy" }
+ call arr(alloc2)
+ call arr(alloc3) ! { dg-error "Character length mismatch" }
+ contains
+ subroutine foo(y)
+ character(len=20) :: y
+ y = 'hello world'
+ end subroutine
+ subroutine bar(y)
+ character(len=20),pointer :: y
+ y = 'hello world'
+ end subroutine
+ subroutine arr(y)
+ character(len=20),allocatable :: y(:)
+ y(1) = 'hello world'
+ end subroutine
+ end
diff --git a/gcc/testsuite/gfortran.dg/char_length_4.f90 b/gcc/testsuite/gfortran.dg/char_length_4.f90
new file mode 100644
index 00000000000..13a9b781bbe
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_length_4.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! tests the fix for PR31540, in which the character lengths in
+! parentheses were not resolved.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+ subroutine pfb()
+ implicit none
+ external pfname1, pfname2
+ character ((136)) pfname1
+ character ((129+7)) pfname2
+ return
+ end
diff --git a/gcc/testsuite/gfortran.dg/char_pointer_assign_3.f90 b/gcc/testsuite/gfortran.dg/char_pointer_assign_3.f90
new file mode 100644
index 00000000000..21db2df14a8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_pointer_assign_3.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+! PR fortran/31803
+! Assigning a substring to a pointer
+
+program test
+ implicit none
+ character (len = 7), target :: textt
+ character (len = 7), pointer :: textp
+ character (len = 5), pointer :: textp2
+ textp => textt
+ textp2 => textt(1:5)
+ if(len(textp) /= 7) call abort()
+ if(len(textp2) /= 5) call abort()
+ textp = 'aaaaaaa'
+ textp2 = 'bbbbbbb'
+ if(textp /= 'bbbbbaa') call abort()
+ if(textp2 /= 'bbbbb') call abort()
+end program test
diff --git a/gcc/testsuite/gfortran.dg/char_result_2.f90 b/gcc/testsuite/gfortran.dg/char_result_2.f90
index b7ecb6669c6..4127ecf94e9 100644
--- a/gcc/testsuite/gfortran.dg/char_result_2.f90
+++ b/gcc/testsuite/gfortran.dg/char_result_2.f90
@@ -42,9 +42,11 @@ program main
character (len = 80) :: text
character (len = 70), target :: textt
character (len = 70), pointer :: textp
+ character (len = 50), pointer :: textp2
a = 42
textp => textt
+ textp2 => textt(1:50)
call test (f1 (textp), 70)
call test (f2 (textp, textp), 95)
@@ -53,7 +55,7 @@ program main
call test (f5 (textp), 140)
call test (f6 (textp), 29)
- call indirect (textp)
+ call indirect (textp2)
contains
function f3 (string)
integer, parameter :: l1 = 30
@@ -93,7 +95,6 @@ contains
call test (f1 (textp2), 50)
call test (f2 (textp2, textp), 65)
call test (f3 (textp2), 85)
- call test (f4 (textp2), 192)
call test (f5 (textp2), 100)
call test (f6 (textp2), 9)
end subroutine indirect
diff --git a/gcc/testsuite/gfortran.dg/char_type_len_2.f90 b/gcc/testsuite/gfortran.dg/char_type_len_2.f90
new file mode 100644
index 00000000000..a5cb835b028
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_type_len_2.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! PR31251 Non-integer character length leads to segfault
+! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ character(len=2.3) :: s ! { dg-error "must be of INTEGER type" }
+ character(kind=1,len=4.3) : t ! { dg-error "must be of INTEGER type" }
+ character(len=,,7.2,kind=1) : u ! { dg-error "Syntax error in CHARACTER declaration" }
+ character(len=7,kind=2) : v ! ! { dg-error "Kind 2 is not a CHARACTER kind" }
+ end
diff --git a/gcc/testsuite/gfortran.dg/default_numeric_type_1.f90 b/gcc/testsuite/gfortran.dg/default_numeric_type_1.f90
index e8f8d350736..62d633d3f5c 100644
--- a/gcc/testsuite/gfortran.dg/default_numeric_type_1.f90
+++ b/gcc/testsuite/gfortran.dg/default_numeric_type_1.f90
@@ -1,4 +1,4 @@
-! { dg-do compile}
+! { dg-do compile }
! { dg-options "-fdump-tree-original" }
! Tests the fix for PR 31222, in which the type of the arguments of abs
! and int below were not detected to be of default numeric type..
@@ -16,3 +16,4 @@ end subroutine
program testprog
call mysub1((/1.,2./),(/1.,2.,3./),-2, 3.2)
end
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/do_3.F90 b/gcc/testsuite/gfortran.dg/do_3.F90
new file mode 100644
index 00000000000..1e2e238bf7e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_3.F90
@@ -0,0 +1,110 @@
+! { dg-do run }
+! { dg-options "-std=legacy -ffree-line-length-none" }
+program test
+ integer :: count
+ integer :: i
+ integer(kind=1) :: i1
+ real :: r
+
+#define TEST_LOOP(var,from,to,step,total,test) \
+ count = 0 ; do var = from, to, step ; count = count + 1 ; end do ; \
+ if (count /= total) call abort ; \
+ if (test (from, to, step) /= total) call abort
+
+ ! Integer loops
+ TEST_LOOP(i, 0, 0, 1, 1, test_i)
+ TEST_LOOP(i, 0, 0, 2, 1, test_i)
+ TEST_LOOP(i, 0, 0, -1, 1, test_i)
+ TEST_LOOP(i, 0, 0, -2, 1, test_i)
+
+ TEST_LOOP(i, 0, 1, 1, 2, test_i)
+ TEST_LOOP(i, 0, 1, 2, 1, test_i)
+ TEST_LOOP(i, 0, 1, 3, 1, test_i)
+ TEST_LOOP(i, 0, 1, huge(0), 1, test_i)
+ TEST_LOOP(i, 0, 1, -1, 0, test_i)
+ TEST_LOOP(i, 0, 1, -2, 0, test_i)
+ TEST_LOOP(i, 0, 1, -3, 0, test_i)
+ TEST_LOOP(i, 0, 1, -huge(0), 0, test_i)
+ TEST_LOOP(i, 0, 1, -huge(0)-1, 0, test_i)
+
+ TEST_LOOP(i, 1, 0, 1, 0, test_i)
+ TEST_LOOP(i, 1, 0, 2, 0, test_i)
+ TEST_LOOP(i, 1, 0, 3, 0, test_i)
+ TEST_LOOP(i, 1, 0, huge(0), 0, test_i)
+ TEST_LOOP(i, 1, 0, -1, 2, test_i)
+ TEST_LOOP(i, 1, 0, -2, 1, test_i)
+ TEST_LOOP(i, 1, 0, -3, 1, test_i)
+ TEST_LOOP(i, 1, 0, -huge(0), 1, test_i)
+ TEST_LOOP(i, 1, 0, -huge(0)-1, 1, test_i)
+
+ TEST_LOOP(i, 0, 17, 1, 18, test_i)
+ TEST_LOOP(i, 0, 17, 2, 9, test_i)
+ TEST_LOOP(i, 0, 17, 3, 6, test_i)
+ TEST_LOOP(i, 0, 17, 4, 5, test_i)
+ TEST_LOOP(i, 0, 17, 5, 4, test_i)
+ TEST_LOOP(i, 17, 0, -1, 18, test_i)
+ TEST_LOOP(i, 17, 0, -2, 9, test_i)
+ TEST_LOOP(i, 17, 0, -3, 6, test_i)
+ TEST_LOOP(i, 17, 0, -4, 5, test_i)
+ TEST_LOOP(i, 17, 0, -5, 4, test_i)
+
+ TEST_LOOP(i1, -huge(i1)-1_1, huge(i1), 1_1, int(huge(i1))*2+2, test_i1)
+ TEST_LOOP(i1, -huge(i1)-1_1, huge(i1), 2_1, int(huge(i1))+1, test_i1)
+ TEST_LOOP(i1, -huge(i1)-1_1, huge(i1), huge(i1), 3, test_i1)
+
+ TEST_LOOP(i1, huge(i1), -huge(i1)-1_1, -1_1, int(huge(i1))*2+2, test_i1)
+ TEST_LOOP(i1, huge(i1), -huge(i1)-1_1, -2_1, int(huge(i1))+1, test_i1)
+ TEST_LOOP(i1, huge(i1), -huge(i1)-1_1, -huge(i1), 3, test_i1)
+ TEST_LOOP(i1, huge(i1), -huge(i1)-1_1, -huge(i1)-1_1, 2, test_i1)
+
+ TEST_LOOP(i1, -2_1, 3_1, huge(i1), 1, test_i1)
+ TEST_LOOP(i1, -2_1, 3_1, -huge(i1), 0, test_i1)
+ TEST_LOOP(i1, 2_1, -3_1, -huge(i1), 1, test_i1)
+ TEST_LOOP(i1, 2_1, -3_1, huge(i1), 0, test_i1)
+
+ ! Real loops
+ TEST_LOOP(r, 0.0, 1.0, 0.11, 1 + int(1.0/0.11), test_r)
+ TEST_LOOP(r, 0.0, 1.0, -0.11, 0, test_r)
+ TEST_LOOP(r, 0.0, -1.0, 0.11, 0, test_r)
+ TEST_LOOP(r, 0.0, -1.0, -0.11, 1 + int(1.0/0.11), test_r)
+ TEST_LOOP(r, 0.0, 0.0, 0.11, 1, test_r)
+ TEST_LOOP(r, 0.0, 0.0, -0.11, 1, test_r)
+
+#undef TEST_LOOP
+
+contains
+
+ function test_i1 (from, to, step) result(res)
+ integer(kind=1), intent(in) :: from, to, step
+ integer(kind=1) :: i
+ integer :: res
+
+ res = 0
+ do i = from, to, step
+ res = res + 1
+ end do
+ end function test_i1
+
+ function test_i (from, to, step) result(res)
+ integer, intent(in) :: from, to, step
+ integer :: i
+ integer :: res
+
+ res = 0
+ do i = from, to, step
+ res = res + 1
+ end do
+ end function test_i
+
+ function test_r (from, to, step) result(res)
+ real, intent(in) :: from, to, step
+ real :: i
+ integer :: res
+
+ res = 0
+ do i = from, to, step
+ res = res + 1
+ end do
+ end function test_r
+
+end program test
diff --git a/gcc/testsuite/gfortran.dg/entry_10.f90 b/gcc/testsuite/gfortran.dg/entry_10.f90
new file mode 100644
index 00000000000..154d44ea9ba
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/entry_10.f90
@@ -0,0 +1,36 @@
+! { dg-do run }
+! Test fix for PR31474, in which the use of ENTRYs as module
+! procedures in a generic interface would cause an internal error.
+!
+! Contributed by Michael Richmond <michael.a.richmond@nasa.gov>
+!
+module a
+ interface b
+ module procedure c, d
+ end interface
+contains
+ real function d (i)
+ real c, i
+ integer j
+ d = 1.0
+ return
+ entry c (j)
+ d = 2.0
+ end function
+ real function e (i)
+ real f, i
+ integer j
+ e = 3.0
+ return
+ entry f (j)
+ e = 4.0
+ end function
+end module
+
+ use a
+ if (b (1.0) .ne. 1.0) call abort ()
+ if (b (1 ) .ne. 2.0) call abort ()
+ if (e (1.0) .ne. 3.0) call abort ()
+ if (f (1 ) .ne. 4.0) call abort ()
+end
+! { dg-final { cleanup-modules "a" } }
diff --git a/gcc/testsuite/gfortran.dg/erf.f90 b/gcc/testsuite/gfortran.dg/erf.f90
new file mode 100644
index 00000000000..33d0ecc601b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/erf.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! Check whether ERF/ERFC take scalars and arrays as arguments (PR31760).
+!
+PROGRAM test_erf
+ REAL :: r = 0.0, ra(2) = (/ 0.0, 1.0 /)
+
+ r = erf(r)
+ r = erfc(r)
+
+ ra = erf(ra)
+ ra = erfc(ra)
+END PROGRAM \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90 b/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90
index 94f69a74eb3..62e5238958b 100644
--- a/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90
@@ -2,8 +2,8 @@
! PR28354 Incorrect rounding of .99999 with f3.0 format specifier
! PR30910 ES format not quite right...
! Test case derived from PR. Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
- write(*,50) -0.99999
write(*,50) 0.99999
+ write(*,50) -0.99999
write(*,50) -9.0
write(*,50) -0.99
write(*,50) -0.999
@@ -46,40 +46,40 @@
250 format(1pe7.0,"<")
300 format(1pe6.0,"<")
end
-! { dg-output "-1.<"
-! { dg-output " 1.<"
-! { dg-output "-9.<"
-! { dg-output "-1.<"
-! { dg-output "-1.<"
-! { dg-output "-1.<"
-! { dg-output "-1.<"
-! { dg-output " 0.<"
-! { dg-output " 38.<"
-! { dg-output " 10345.<"
-! { dg-output " 334.<"
-! { dg-output " 333.<"
-! { dg-output "1.E-01"
-! { dg-output "-1.E+00<"
-! { dg-output " 1.E+00<"
-! { dg-output "-9.E+00<"
-! { dg-output "-1.E+00<"
-! { dg-output "-1.E+00<"
-! { dg-output "-1.E+00<"
-! { dg-output "-6.E-01<"
-! { dg-output "-5.E-01<"
-! { dg-output " 4.E+01<"
-! { dg-output " 1.E+04<"
-! { dg-output " 3.E+02<"
-! { dg-output " 3.E+02<"
-! { dg-output "-1.E+00<"
-! { dg-output " 1.E+00<"
-! { dg-output "-9.E+00<"
-! { dg-output "-1.E+00<"
-! { dg-output "-1.E+00<"
-! { dg-output "-1.E+00<"
-! { dg-output "-6.E-01<"
-! { dg-output "-5.E-01<"
-! { dg-output "4.E+01<"
-! { dg-output "1.E+04<"
-! { dg-output "3.E+02<"
-! { dg-output "3.E+02<"
+! { dg-output " 1\\.<(\n|\r\n|\r)" }
+! { dg-output "-1\\.<(\n|\r\n|\r)" }
+! { dg-output "-9\\.<(\n|\r\n|\r)" }
+! { dg-output "-1\\.<(\n|\r\n|\r)" }
+! { dg-output "-1\\.<(\n|\r\n|\r)" }
+! { dg-output "-1\\.<(\n|\r\n|\r)" }
+! { dg-output "-1\\.<(\n|\r\n|\r)" }
+! { dg-output " 0\\.<(\n|\r\n|\r)" }
+! { dg-output " 38\\.<(\n|\r\n|\r)" }
+! { dg-output " 10345\\.<(\n|\r\n|\r)" }
+! { dg-output " 334\\.<(\n|\r\n|\r)" }
+! { dg-output " 333\\.<(\n|\r\n|\r)" }
+! { dg-output "1\\.E-01(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output " 1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-9\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-6\\.E-01<(\n|\r\n|\r)" }
+! { dg-output "-5\\.E-01<(\n|\r\n|\r)" }
+! { dg-output " 4\\.E\\+01<(\n|\r\n|\r)" }
+! { dg-output " 1\\.E\\+04<(\n|\r\n|\r)" }
+! { dg-output " 3\\.E\\+02<(\n|\r\n|\r)" }
+! { dg-output " 3\\.E\\+02<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output " 1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-9\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-1\\.E\\+00<(\n|\r\n|\r)" }
+! { dg-output "-6\\.E-01<(\n|\r\n|\r)" }
+! { dg-output "-5\\.E-01<(\n|\r\n|\r)" }
+! { dg-output "4\\.E\\+01<(\n|\r\n|\r)" }
+! { dg-output "1\\.E\\+04<(\n|\r\n|\r)" }
+! { dg-output "3\\.E\\+02<(\n|\r\n|\r)" }
+! { dg-output "3\\.E\\+02<(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/fseek.f90 b/gcc/testsuite/gfortran.dg/fseek.f90
new file mode 100644
index 00000000000..a42575c2c05
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fseek.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+
+PROGRAM test_fseek
+ INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2, fd=10
+ INTEGER :: ierr = 0
+
+ ! expected position: 12, one leading blank + 10 + newline
+ WRITE(fd, *) "1234567890"
+ IF (FTELL(fd) /= 12) CALL abort()
+
+ ! move backward from current position
+ CALL FSEEK(fd, -12, SEEK_CUR, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= 0) CALL abort()
+
+ ! move to negative position (error)
+ CALL FSEEK(fd, -1, SEEK_SET, ierr)
+ IF (ierr == 0 .OR. FTELL(fd) /= 0) CALL abort()
+
+ ! move forward from end (12 + 10)
+ CALL FSEEK(fd, 10, SEEK_END, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= 22) CALL abort()
+
+ ! set position (0)
+ CALL FSEEK(fd, 0, SEEK_SET, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= 0) CALL abort()
+
+ ! move forward from current position
+ CALL FSEEK(fd, 5, SEEK_CUR, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= 5) CALL abort()
+
+ CALL FSEEK(fd, HUGE(0_1), SEEK_SET, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= HUGE(0_1)) CALL abort()
+
+ CALL FSEEK(fd, HUGE(0_2), SEEK_SET, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= HUGE(0_2)) CALL abort()
+
+ CALL FSEEK(fd, HUGE(0_4), SEEK_SET, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= HUGE(0_4)) CALL abort()
+
+ CALL FSEEK(fd, -HUGE(0_4), SEEK_CUR, ierr)
+ IF (ierr /= 0 .OR. FTELL(fd) /= 0) CALL abort()
+END PROGRAM
+
diff --git a/gcc/testsuite/gfortran.dg/host_assoc_function_1.f90 b/gcc/testsuite/gfortran.dg/host_assoc_function_1.f90
new file mode 100644
index 00000000000..019fc617be1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/host_assoc_function_1.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+! Tests the fix for the bug PR30746, in which the reference to 'x'
+! in 'inner' wrongly host-associated with the variable 'x' rather
+! than the function.
+!
+! Testcase is due to Malcolm Cohen, NAG.
+!
+real function z (i)
+ integer :: i
+ z = real (i)**i
+end function
+
+MODULE m
+ REAL :: x(3) = (/ 1.5, 2.5, 3.5 /)
+ interface
+ real function z (i)
+ integer :: i
+ end function
+ end interface
+CONTAINS
+ SUBROUTINE s
+ if (x(2) .ne. 2.5) call abort ()
+ if (z(3) .ne. real (3)**3) call abort ()
+ CALL inner
+ CONTAINS
+ SUBROUTINE inner
+ i = 7
+ if (x(i, 7) .ne. real (7)**7) call abort ()
+ if (z(i, 7) .ne. real (7)**7) call abort ()
+ END SUBROUTINE
+ FUNCTION x(n, m)
+ x = REAL(n)**m
+ END FUNCTION
+ FUNCTION z(n, m)
+ z = REAL(n)**m
+ END FUNCTION
+
+ END SUBROUTINE
+END MODULE
+ use m
+ call s()
+end
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/inquire_iolength.f90 b/gcc/testsuite/gfortran.dg/inquire_iolength.f90
index 362746bae94..b6dfee249a9 100644
--- a/gcc/testsuite/gfortran.dg/inquire_iolength.f90
+++ b/gcc/testsuite/gfortran.dg/inquire_iolength.f90
@@ -1,4 +1,4 @@
-! { dg-do compile}
+! { dg-do compile }
! { dg-options "-std=f95" }
! PR30014 IOLENGTH does not handle KIND=8. This patch checks the constraints.
! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/iostat_4.f90 b/gcc/testsuite/gfortran.dg/iostat_4.f90
new file mode 100644
index 00000000000..34c25f962d4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/iostat_4.f90
@@ -0,0 +1,9 @@
+! { dg-do run }
+! PR31201 Too large unit number generates wrong code
+! This tests initialization of the IOSTAT variable
+ integer :: i
+ character(len=50) :: str
+ write (2_8*int(huge(0_4),kind=8)+9_8, iostat=i, iomsg=str) 555
+ if (i.ne.5005) call abort
+ if (str.ne."Unit number in I/O statement too large") call abort
+ end \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/large_unit_1.f90 b/gcc/testsuite/gfortran.dg/large_unit_1.f90
new file mode 100644
index 00000000000..60e2d1f17e8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/large_unit_1.f90
@@ -0,0 +1,17 @@
+! { dg-do run }
+! { dg-shouldfail "Unit number in I/O statement too large" }
+! PR31201 Unit number in I/O statement too large
+! Test case from PR
+ integer(kind=8) :: k= 2_8**36 + 10
+ integer(kind=4) :: j= 10
+ logical ex,op
+ INQUIRE(unit=k, exist=ex,opened=op)
+ print *, ex, op
+ IF (ex) THEN
+ OPEN(unit=k)
+ INQUIRE(unit=j, opened=op)
+ IF (op) CALL ABORT()
+ ENDIF
+ print *, k
+ close(k)
+ end
diff --git a/gcc/testsuite/gfortran.dg/large_unit_2.f90 b/gcc/testsuite/gfortran.dg/large_unit_2.f90
new file mode 100644
index 00000000000..5f3554cc5bb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/large_unit_2.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! PR31201 Too large unit number generates wrong code
+! Test case by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ integer :: i
+ logical :: l
+ character(len=60) :: s
+ open(2_8*huge(0)+20_8,file="foo",iostat=i)
+ if (i == 0) call abort
+ open(2_8*huge(0)+20_8,file="foo",err=99)
+ call abort
+ 99 inquire(unit=18,opened=l)
+ if (l) call abort
+ end
diff --git a/gcc/testsuite/gfortran.dg/min_max_conformance.f90 b/gcc/testsuite/gfortran.dg/min_max_conformance.f90
new file mode 100644
index 00000000000..565408cd26a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/min_max_conformance.f90
@@ -0,0 +1,35 @@
+! { dg-compile }
+! PR 31919: Tests for different ranks in min/max were missing.
+program pr31919
+ integer :: i4a(2, 2), i4b(2), i4c(4)
+ real(4) :: r4a(2, 2), r4b(2), r4c(4)
+ real(8) :: r8a(2, 2), r8b(2), r8c(4)
+
+ i4a = max(i4a, i4b) ! { dg-error "Incompatible ranks" }
+ i4a = max0(i4a, i4b) ! { dg-error "Incompatible ranks" }
+ r4a = amax0(i4a, i4b) ! { dg-error "Incompatible ranks" }
+ i4a = max1(r4a, r4b) ! { dg-error "Incompatible ranks" }
+ r4a = amax1(r4a, r4b) ! { dg-error "Incompatible ranks" }
+ r8a = dmax1(r8a, r8b) ! { dg-error "Incompatible ranks" }
+
+ i4a = min(i4a, i4b) ! { dg-error "Incompatible ranks" }
+ i4a = min0(i4a, i4b) ! { dg-error "Incompatible ranks" }
+ i4a = amin0(i4a, i4b) ! { dg-error "Incompatible ranks" }
+ r4a = min1(r4a, r4b) ! { dg-error "Incompatible ranks" }
+ r4a = amin1(r4a, r4b) ! { dg-error "Incompatible ranks" }
+ r8a = dmin1(r8a, r8b) ! { dg-error "Incompatible ranks" }
+
+ i4a = max(i4b, i4c) ! { dg-error "different shape for arguments" }
+ i4a = max0(i4b, i4c) ! { dg-error "different shape for arguments" }
+ r4a = amax0(i4b, i4c) ! { dg-error "different shape for arguments" }
+ i4a = max1(r4b, r4c) ! { dg-error "different shape for arguments" }
+ r4a = amax1(r4b, r4c) ! { dg-error "different shape for arguments" }
+ r8a = dmax1(r8B, r8c) ! { dg-error "different shape for arguments" }
+
+ i4a = min(i4b, i4c) ! { dg-error "different shape for arguments" }
+ i4a = min0(i4b, i4c) ! { dg-error "different shape for arguments" }
+ i4a = amin0(i4b, i4c) ! { dg-error "different shape for arguments" }
+ r4a = min1(r4b, r4c) ! { dg-error "different shape for arguments" }
+ r4a = amin1(r4b, r4c) ! { dg-error "different shape for arguments" }
+ r8a = dmin1(r8b, r8c) ! { dg-error "different shape for arguments" }
+end program
diff --git a/gcc/testsuite/gfortran.dg/module_naming_1.f90 b/gcc/testsuite/gfortran.dg/module_naming_1.f90
index 2a2d00b1d30..7b9df0a99a9 100644
--- a/gcc/testsuite/gfortran.dg/module_naming_1.f90
+++ b/gcc/testsuite/gfortran.dg/module_naming_1.f90
@@ -29,3 +29,4 @@ contains
! mangled to __m2_mod_m2_MOD_m3
end subroutine m3
end module m2_MOD_m2
+! { dg-final { cleanup-modules "m1 m1__m2 m2 m2_MOD_m2" } }
diff --git a/gcc/testsuite/gfortran.dg/namelist_29.f90 b/gcc/testsuite/gfortran.dg/namelist_29.f90
new file mode 100644
index 00000000000..55bff0c906f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_29.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+! Checks the fix for PR30878, in which the inclusion
+! of an implicit function result variable in a namelist
+! would cause an error.
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+ character(80) :: buffer
+ if (f1 (buffer) .ne. 42) call abort ()
+CONTAINS
+ INTEGER FUNCTION F1 (buffer)
+ NAMELIST /mynml/ F1
+ integer :: check
+ character(80) :: buffer
+ F1 = 42
+ write (buffer, nml = mynml)
+ F1 = 0
+ READ (buffer, nml = mynml)
+ end function
+END
diff --git a/gcc/testsuite/gfortran.dg/nested_modules_2.f90 b/gcc/testsuite/gfortran.dg/nested_modules_2.f90
index 3d0985a7eac..5bfdaddaac2 100644
--- a/gcc/testsuite/gfortran.dg/nested_modules_2.f90
+++ b/gcc/testsuite/gfortran.dg/nested_modules_2.f90
@@ -1,4 +1,4 @@
-! { dg do-run }
+! { dg-do run }
! This tests the patch for PR16861.
!
! Contributed by Paul Thomas <pault@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/new_line.f90 b/gcc/testsuite/gfortran.dg/new_line.f90
index 355ca30209b..aacabc69f6e 100644
--- a/gcc/testsuite/gfortran.dg/new_line.f90
+++ b/gcc/testsuite/gfortran.dg/new_line.f90
@@ -2,6 +2,19 @@
! Checks Fortran 2003's new_line intrinsic function
! PR fortran/28585
program new_line_check
- implicit none
- if(achar(10) /= new_line('a')) call abort()
+ implicit none
+ character(len=10) :: a1
+ character(len=10) :: a2(2)
+ character(len=10), parameter :: a3 = "1234567890"
+ character(len=10), parameter :: a4(2) = "1234567890"
+ character(len=10), parameter :: a5(2) = repeat("1234567890",2)
+
+ if(achar(10) /= new_line('a')) call abort
+
+ if (iachar(new_line(a1)) /= 10) call abort
+ if (iachar(new_line(a2)) /= 10) call abort
+ if (iachar(new_line(a3)) /= 10) call abort
+ if (iachar(new_line(a4)) /= 10) call abort
+ if (iachar(new_line(a5)) /= 10) call abort
+
end program new_line_check
diff --git a/gcc/testsuite/gfortran.dg/oldstyle_2.f90 b/gcc/testsuite/gfortran.dg/oldstyle_2.f90
index 6f1b477295b..8d840288801 100644
--- a/gcc/testsuite/gfortran.dg/oldstyle_2.f90
+++ b/gcc/testsuite/gfortran.dg/oldstyle_2.f90
@@ -1,4 +1,4 @@
-! { dg-do compile}
+! { dg-do compile }
subroutine foo(i) ! { dg-error "DATA attribute" }
integer i /10/
end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/operator_2.f90 b/gcc/testsuite/gfortran.dg/operator_2.f90
index 11540caaf8a..0e560dad794 100644
--- a/gcc/testsuite/gfortran.dg/operator_2.f90
+++ b/gcc/testsuite/gfortran.dg/operator_2.f90
@@ -38,3 +38,4 @@ contains
end function f3
end
+! { dg-final { cleanup-modules "foo" } }
diff --git a/gcc/testsuite/gfortran.dg/parameter_array_dummy.f90 b/gcc/testsuite/gfortran.dg/parameter_array_dummy.f90
index 2aa3ad8ef8c..d9a43432fd5 100644
--- a/gcc/testsuite/gfortran.dg/parameter_array_dummy.f90
+++ b/gcc/testsuite/gfortran.dg/parameter_array_dummy.f90
@@ -1,4 +1,4 @@
-! { dg-do run}
+! { dg-do run }
! PR fortran/31188
program foo_mod
implicit none
@@ -14,8 +14,8 @@ contains
write (*,*) i, "a" // letters(ivec)
end subroutine concat
end program foo_mod
-! { dg-output "1 aa" }
-! { dg-output "2 ab" }
-! { dg-output "3 aaab" }
-! { dg-output "4 abaa" }
-! { dg-output "5 ababab" }
+! { dg-output " *1 aa(\n|\r\n|\r)" }
+! { dg-output " *2 ab(\n|\r\n|\r)" }
+! { dg-output " *3 aaab(\n|\r\n|\r)" }
+! { dg-output " *4 abaa(\n|\r\n|\r)" }
+! { dg-output " *5 ababab(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/parameter_array_element_1.f90 b/gcc/testsuite/gfortran.dg/parameter_array_element_1.f90
index 8dfe544e762..f5a33f8b0db 100644
--- a/gcc/testsuite/gfortran.dg/parameter_array_element_1.f90
+++ b/gcc/testsuite/gfortran.dg/parameter_array_element_1.f90
@@ -1,4 +1,4 @@
-! { dg-do compile}
+! { dg-do compile }
! { dg-options "-fdump-tree-original" }
! Tests the fix for PR 30872, in which the array element references bo(1,1) etc.
! would be wrong for rank > 1.
diff --git a/gcc/testsuite/gfortran.dg/parameter_array_init_1.f90 b/gcc/testsuite/gfortran.dg/parameter_array_init_1.f90
new file mode 100644
index 00000000000..bb029a5b080
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/parameter_array_init_1.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! tests the fix for PR29397, in which the initializer for the parameter
+! 'J' was not expanded into an array.
+!
+! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+!
+ INTEGER :: K(3) = 1
+ INTEGER, PARAMETER :: J(3) = 2
+ IF (ANY (MAXLOC (K, J<3) .NE. 1)) CALL ABORT ()
+ IF (ANY (J .NE. 2)) CALL ABORT ()
+END
diff --git a/gcc/testsuite/gfortran.dg/parameter_array_init_2.f90 b/gcc/testsuite/gfortran.dg/parameter_array_init_2.f90
new file mode 100644
index 00000000000..bf238e5ee32
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/parameter_array_init_2.f90
@@ -0,0 +1,26 @@
+! { dg-do run }
+! { dg-options "-std=gnu" } ! suppress the warning about line 15
+! Thrashes the fix for PR29400, where the scalar initializers
+! were not expanded to arrays with the appropriate shape.
+!
+! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+!
+ integer,parameter :: i(1,1) = 0, j(2) = 42
+
+ if (any (maxloc(j+j,mask=(j==2)) .ne. 0)) call abort ()
+ if (size(j+j) .ne. 2) call abort ()
+ if (minval(j+j) .ne. 84) call abort ()
+ if (minval(j,mask=(j==2)) .ne. huge (j)) call abort ()
+ if (maxval(j+j) .ne. 84) call abort ()
+ if (maxval(j,mask=(j==2)) .ne. -huge (j)-1) call abort ()
+ if (sum(j,mask=j==2) .ne. 0) call abort ()
+ if (sum(j+j) .ne. 168) call abort ()
+ if (product(j+j) .ne. 7056) call abort ()
+ if (any(ubound(j+j) .ne. 2)) call abort ()
+ if (any(lbound(j+j) .ne. 1)) call abort ()
+ if (dot_product(j+j,j) .ne. 7056) call abort ()
+ if (dot_product(j,j+j) .ne. 7056) call abort ()
+ if (count(i==1) .ne. 0) call abort ()
+ if (any(i==1)) call abort ()
+ if (all(i==1)) call abort ()
+ end
diff --git a/gcc/testsuite/gfortran.dg/real_const_3.f90 b/gcc/testsuite/gfortran.dg/real_const_3.f90
index bab4e625634..379ecb439ee 100644
--- a/gcc/testsuite/gfortran.dg/real_const_3.f90
+++ b/gcc/testsuite/gfortran.dg/real_const_3.f90
@@ -26,16 +26,16 @@ program main
print *, z4
end program main
-!{ dg-output " +Infinity"
-!{ dg-output " 0.000000"
-!{ dg-output " -Infinity"
-!{ dg-output " NaN"
-!{ dg-output " NaN"
-!{ dg-output " -Infinity"
-!{ dg-output " -Infinity"
-!{ dg-output " +Infinity"
-!{ dg-output " NaN"
-!{ dg-output " ( NaN, NaN)"
-!{ dg-output " ( NaN, NaN)"
-!{ dg-output " ( +Infinity, -Infinity)"
-!{ dg-output " ( 0.000000 , 0.000000 )"
+!{ dg-output " \\+Infinity(\n|\r\n|\r)" }
+!{ dg-output " 0.000000 (\n|\r\n|\r)" }
+!{ dg-output " -Infinity(\n|\r\n|\r)" }
+!{ dg-output " NaN(\n|\r\n|\r)" }
+!{ dg-output " NaN(\n|\r\n|\r)" }
+!{ dg-output " -Infinity(\n|\r\n|\r)" }
+!{ dg-output " -Infinity(\n|\r\n|\r)" }
+!{ dg-output " \\+Infinity(\n|\r\n|\r)" }
+!{ dg-output " NaN(\n|\r\n|\r)" }
+!{ dg-output " \\( NaN, NaN\\)(\n|\r\n|\r)" }
+!{ dg-output " \\( NaN, NaN\\)(\n|\r\n|\r)" }
+!{ dg-output " \\( \\+Infinity, -Infinity\\)(\n|\r\n|\r)" }
+!{ dg-output " \\( 0.000000 , 0.000000 \\)(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/recursive_reference_1.f90 b/gcc/testsuite/gfortran.dg/recursive_reference_1.f90
index 3753e1a0acd..3ca6bcb1711 100644
--- a/gcc/testsuite/gfortran.dg/recursive_reference_1.f90
+++ b/gcc/testsuite/gfortran.dg/recursive_reference_1.f90
@@ -1,7 +1,9 @@
! { dg-do compile }
! Tests the patch for PR27613, in which directly recursive, scalar
! functions were generating an "unclassifiable statement" error
-! for the recursive statement(s).
+! for the recursive statement(s). This was subsequently determined
+! to be wrong code and the error on 'bad_stuff' was removed.
+! See 12.5.2.1 of the standard and PR30876.
!
! Based on PR testcase by Nicolas Bock <nicolasbock@gmail.com>
!
@@ -15,7 +17,7 @@ contains
integer :: n
original_stuff = 1
if(n < 5) then
- original_stuff = original_stuff + original_stuff (n+1)
+ original_stuff = original_stuff + original_stuff (n+1) ! { dg-error "name of a recursive function" }
endif
end function original_stuff
@@ -42,7 +44,7 @@ contains
integer :: n(2)
bad_stuff = 1
if(maxval (n) < 5) then
- bad_stuff = bad_stuff + bad_stuff (n+1) ! { dg-error "RESULT must be specified" }
+ bad_stuff = bad_stuff + bad_stuff (n+1)
endif
end function bad_stuff
end program test
diff --git a/gcc/testsuite/gfortran.dg/recursive_reference_2.f90 b/gcc/testsuite/gfortran.dg/recursive_reference_2.f90
new file mode 100644
index 00000000000..59df43cdf1a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/recursive_reference_2.f90
@@ -0,0 +1,34 @@
+! { dg-do compile }
+! Tests the fix for PR30876 in which interface derived types were
+! not always being associated.
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+MODULE M1
+CONTAINS
+ FUNCTION correct_input(i)
+ INTEGER :: i,correct_input(5), ans(5) = 0
+ IF (i<1) correct_input=test(1)
+ IF (i>5) correct_input=test(5)
+ END FUNCTION correct_input
+
+ RECURSIVE FUNCTION test(i)
+ INTEGER :: test(5),i,j
+ IF (i<1 .OR. i>5) THEN
+ test=correct_input(i)
+ ELSE
+ test=0
+ test(1:6-i)=(/(j,j=i,5)/)
+ test=test(3)
+ ENDIF
+ END FUNCTION
+
+END MODULE M1
+
+USE M1
+integer :: ans(5)
+IF (ANY(TEST(3).NE.(/5,5,5,5,5/))) CALL ABORT()
+IF (ANY(TEST(6).NE.(/0,0,0,0,0/))) CALL ABORT()
+END
+! { dg-final { cleanup-modules "m1" } }
+
diff --git a/gcc/testsuite/gfortran.dg/shift-alloc.f90 b/gcc/testsuite/gfortran.dg/shift-alloc.f90
index 2d660317235..70f1cbb660e 100644
--- a/gcc/testsuite/gfortran.dg/shift-alloc.f90
+++ b/gcc/testsuite/gfortran.dg/shift-alloc.f90
@@ -1,4 +1,4 @@
-! { dg do-run }
+! { dg-do run }
! PR 22144: eoshift1, eoshift3 and cshift1 used to lack memory
! allocation, which caused the writes to segfault.
program main
diff --git a/gcc/testsuite/gfortran.dg/substr_4.f b/gcc/testsuite/gfortran.dg/substr_4.f
new file mode 100644
index 00000000000..fadd5b32d2f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/substr_4.f
@@ -0,0 +1,69 @@
+! { dg-do run }
+ subroutine test_lower
+ implicit none
+ character(3), dimension(3) :: zsymel,zsymelr
+ common /xx/ zsymel, zsymelr
+ integer :: znsymelr
+ zsymel = (/ 'X', 'Y', ' ' /)
+ zsymelr= (/ 'X', 'Y', ' ' /)
+ znsymelr=2
+ call check_zsymel(zsymel,zsymelr,znsymelr)
+
+ contains
+
+ subroutine check_zsymel(zsymel,zsymelr,znsymelr)
+ implicit none
+ integer znsymelr, isym
+ character(*) zsymel(*),zsymelr(*)
+ character(len=80) buf
+ zsymel(3)(lenstr(zsymel(3))+1:)='X'
+ write (buf,10) (trim(zsymelr(isym)),isym=1,znsymelr)
+10 format(3(a,:,','))
+ if (trim(buf) /= 'X,Y') call abort
+ end subroutine check_zsymel
+
+ function lenstr(s)
+ character(len=*),intent(in) :: s
+ integer :: lenstr
+ if (len_trim(s) /= 0) call abort
+ lenstr = len_trim(s)
+ end function lenstr
+
+ end subroutine test_lower
+
+ subroutine test_upper
+ implicit none
+ character(3), dimension(3) :: zsymel,zsymelr
+ common /xx/ zsymel, zsymelr
+ integer :: znsymelr
+ zsymel = (/ 'X', 'Y', ' ' /)
+ zsymelr= (/ 'X', 'Y', ' ' /)
+ znsymelr=2
+ call check_zsymel(zsymel,zsymelr,znsymelr)
+
+ contains
+
+ subroutine check_zsymel(zsymel,zsymelr,znsymelr)
+ implicit none
+ integer znsymelr, isym
+ character(*) zsymel(*),zsymelr(*)
+ character(len=80) buf
+ zsymel(3)(:lenstr(zsymel(3))+1)='X'
+ write (buf,20) (trim(zsymelr(isym)),isym=1,znsymelr)
+20 format(3(a,:,','))
+ if (trim(buf) /= 'X,Y') call abort
+ end subroutine check_zsymel
+
+ function lenstr(s)
+ character(len=*),intent(in) :: s
+ integer :: lenstr
+ if (len_trim(s) /= 0) call abort
+ lenstr = len_trim(s)
+ end function lenstr
+
+ end subroutine test_upper
+
+ program test
+ call test_lower
+ call test_upper
+ end program test
diff --git a/gcc/testsuite/gfortran.dg/transfer_simplify_1.f90 b/gcc/testsuite/gfortran.dg/transfer_simplify_1.f90
new file mode 100644
index 00000000000..c1b241fb99d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/transfer_simplify_1.f90
@@ -0,0 +1,87 @@
+! { dg-do run }
+! { dg-options "-O2" }
+! Tests that the PRs caused by the lack of gfc_simplify_transfer are
+! now fixed. These were brought together in the meta-bug PR31237
+! (TRANSFER intrinsic).
+! Remaining PRs on 20070409 :-18769 30881 31194 31216 31424 31427
+!
+program simplify_transfer
+ CHARACTER(LEN=100) :: buffer="1.0 3.0"
+ call pr18769 ()
+ call pr30881 ()
+ call pr31194 ()
+ call pr31216 ()
+ call pr31427 ()
+contains
+ subroutine pr18769 ()
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+ implicit none
+ type t
+ integer :: i
+ end type t
+ type (t), parameter :: u = t (42)
+ integer, parameter :: idx_list(1) = (/ 1 /)
+ integer :: j(1) = transfer (u, idx_list)
+ if (j(1) .ne. 42) call abort ()
+ end subroutine pr18769
+
+ subroutine pr30881 ()
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+ INTEGER, PARAMETER :: K=1
+ INTEGER :: I
+ I=TRANSFER(.TRUE.,K)
+ SELECT CASE(I)
+ CASE(TRANSFER(.TRUE.,K))
+ CASE(TRANSFER(.FALSE.,K))
+ CALL ABORT()
+ CASE DEFAULT
+ CALL ABORT()
+ END SELECT
+ I=TRANSFER(.FALSE.,K)
+ SELECT CASE(I)
+ CASE(TRANSFER(.TRUE.,K))
+ CALL ABORT()
+ CASE(TRANSFER(.FALSE.,K))
+ CASE DEFAULT
+ CALL ABORT()
+ END SELECT
+ END subroutine pr30881
+
+ subroutine pr31194 ()
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+ real(kind(0d0)) :: NaN = transfer(ishft(int(z'FFF80000',8),32),0d0)
+ write (buffer,'(e12.5)') NaN
+ if (buffer(10:12) .ne. "NaN") call abort ()
+ end subroutine pr31194
+
+ subroutine pr31216 ()
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+ INTEGER :: I
+ REAL :: C,D
+ buffer = " 1.0 3.0"
+ READ(buffer,*) C,D
+ I=TRANSFER(C/D,I)
+ SELECT CASE(I)
+ CASE (TRANSFER(1.0/3.0,1))
+ CASE DEFAULT
+ CALL ABORT()
+ END SELECT
+ END subroutine pr31216
+
+ subroutine pr31427 ()
+!
+! Contributed by Michael Richmond <michael.a.richmond@nasa.gov>
+!
+ INTEGER(KIND=1) :: i(1)
+ i = (/ TRANSFER("a", 0_1) /)
+ if (i(1) .ne. ichar ("a")) call abort ()
+ END subroutine pr31427
+end program simplify_transfer
diff --git a/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90 b/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90
new file mode 100644
index 00000000000..8f0380af9d2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90
@@ -0,0 +1,155 @@
+! { dg-do run }
+! { dg-options "-O2" }
+! Tests the fix for the meta-bug PR31237 (TRANSFER intrinsic)
+! Exercises gfc_simplify_transfer a random walk through types and shapes
+! and compares its results with the middle-end version that operates on
+! variables.
+!
+ implicit none
+ call integer4_to_real4
+ call real4_to_integer8
+ call integer4_to_integer8
+ call logical4_to_real8
+ call real8_to_integer4
+ call integer8_to_real4
+ call integer8_to_complex4
+ call character16_to_complex8
+ call character16_to_real8
+ call real8_to_character2
+ call dt_to_integer1
+ call character16_to_dt
+contains
+ subroutine integer4_to_real4
+ integer(4), parameter :: i1 = 11111_4
+ integer(4) :: i2 = i1
+ real(4), parameter :: r1 = transfer (i1, 1.0_4)
+ real(4) :: r2
+
+ r2 = transfer (i2, r2);
+ if (r1 .ne. r2) call abort ()
+ end subroutine integer4_to_real4
+
+ subroutine real4_to_integer8
+ real(4), parameter :: r1(2) = (/3.14159_4, 0.0_4/)
+ real(4) :: r2(2) = r1
+ integer(8), parameter :: i1 = transfer (r1, 1_8)
+ integer(8) :: i2
+
+ i2 = transfer (r2, 1_8);
+ if (i1 .ne. i2) call abort ()
+ end subroutine real4_to_integer8
+
+ subroutine integer4_to_integer8
+ integer(4), parameter :: i1(2) = (/11111_4, 22222_4/)
+ integer(4) :: i2(2) = i1
+ integer(8), parameter :: i3 = transfer (i1, 1_8)
+ integer(8) :: i4
+
+ i4 = transfer (i2, 1_8);
+ if (i3 .ne. i4) call abort ()
+ end subroutine integer4_to_integer8
+
+ subroutine logical4_to_real8
+ logical(4), parameter :: l1(2) = (/.false., .true./)
+ logical(4) :: l2(2) = l1
+ real(8), parameter :: r1 = transfer (l1, 1_8)
+ real(8) :: r2
+
+ r2 = transfer (l2, 1_8);
+ if (r1 .ne. r2) call abort ()
+ end subroutine logical4_to_real8
+
+ subroutine real8_to_integer4
+ real(8), parameter :: r1 = 3.14159_8
+ real(8) :: r2 = r1
+ integer(4), parameter :: i1(2) = transfer (r1, 1_4, 2)
+ integer(4) :: i2(2)
+
+ i2 = transfer (r2, i2, 2);
+ if (any (i1 .ne. i2)) call abort ()
+ end subroutine real8_to_integer4
+
+ subroutine integer8_to_real4
+ integer :: k
+ integer(8), parameter :: i1(2) = transfer ((/asin (1.0_8), log (1.0_8)/), i1)
+ integer(8) :: i2(2) = i1
+ real(4), parameter :: r1(4) = transfer (i1, (/(1.0_4,k=1,4)/))
+ real(4) :: r2(4)
+
+ r2 = transfer (i2, r2);
+ if (any (r1 .ne. r2)) call abort ()
+ end subroutine integer8_to_real4
+
+ subroutine integer8_to_complex4
+ integer :: k
+ integer(8), parameter :: i1(2) = transfer ((/asin (1.0_8), log (1.0_8)/), i1)
+ integer(8) :: i2(2) = i1
+ complex(4), parameter :: z1(2) = transfer (i1, (/((1.0_4,2.0_4),k=1,2)/))
+ complex(4) :: z2(2)
+
+ z2 = transfer (i2, z2);
+ if (any (z1 .ne. z2)) call abort ()
+ end subroutine integer8_to_complex4
+
+ subroutine character16_to_complex8
+ character(16), parameter :: c1(2) = (/"abcdefghijklmnop","qrstuvwxyz1234567890"/)
+ character(16) :: c2(2) = c1
+ complex(8), parameter :: z1(2) = transfer (c1, (1.0_8,1.0_8), 2)
+ complex(8) :: z2(2)
+
+ z2 = transfer (c2, z2, 2);
+ if (any (z1 .ne. z2)) call abort ()
+ end subroutine character16_to_complex8
+
+ subroutine character16_to_real8
+ character(16), parameter :: c1 = "abcdefghijklmnop"
+ character(16) :: c2 = c1
+ real(8), parameter :: r1(2) = transfer (c1, 1.0_8, 2)
+ real(8) :: r2(2)
+
+ r2 = transfer (c2, r2, 2);
+ if (any (r1 .ne. r2)) call abort ()
+ end subroutine character16_to_real8
+
+ subroutine real8_to_character2
+ real(8), parameter :: r1 = 3.14159_8
+ real(8) :: r2 = r1
+ character(2), parameter :: c1(4) = transfer (r1, "ab", 4)
+ character(2) :: c2(4)
+
+ c2 = transfer (r2, "ab", 4);
+ if (any (c1 .ne. c2)) call abort ()
+ end subroutine real8_to_character2
+
+ subroutine dt_to_integer1
+ integer, parameter :: i1(4) = (/1_4,2_4,3_4,4_4/)
+ real, parameter :: r1(4) = (/1.0_4,2.0_4,3.0_4,4.0_4/)
+ type :: mytype
+ integer(4) :: i(4)
+ real(4) :: x(4)
+ end type mytype
+ type (mytype), parameter :: dt1 = mytype (i1, r1)
+ type (mytype) :: dt2 = dt1
+ integer(1), parameter :: i2(32) = transfer (dt1, 1_1, 32)
+ integer(1) :: i3(32)
+
+ i3 = transfer (dt2, 1_1, 32);
+ if (any (i2 .ne. i3)) call abort ()
+ end subroutine dt_to_integer1
+
+ subroutine character16_to_dt
+ character(16), parameter :: c1 = "abcdefghijklmnop"
+ character(16) :: c2 = c1
+ type :: mytype
+ real(4) :: x(2)
+ end type mytype
+
+ type (mytype), parameter :: dt1(2) = transfer (c1, mytype ((/1.0,2.0,3.0,4.0/)), 2)
+ type (mytype) :: dt2(2)
+
+ dt2 = transfer (c2, dt2);
+ if (any (dt1(1)%x .ne. dt2(1)%x)) call abort ()
+ if (any (dt1(2)%x .ne. dt2(2)%x)) call abort ()
+ end subroutine character16_to_dt
+
+end
diff --git a/gcc/testsuite/gfortran.dg/unf_io_convert_3.f90 b/gcc/testsuite/gfortran.dg/unf_io_convert_3.f90
index 40ace2a0e06..8601073544a 100644
--- a/gcc/testsuite/gfortran.dg/unf_io_convert_3.f90
+++ b/gcc/testsuite/gfortran.dg/unf_io_convert_3.f90
@@ -1,4 +1,4 @@
-! { dg-do run}
+! { dg-do run }
! { dg-require-effective-target fortran_large_real }
program main
integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
diff --git a/gcc/testsuite/gfortran.dg/unf_read_corrupted_2.f90 b/gcc/testsuite/gfortran.dg/unf_read_corrupted_2.f90
new file mode 100644
index 00000000000..1788b457d19
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unf_read_corrupted_2.f90
@@ -0,0 +1,27 @@
+! { dg-do run }
+! PR31880 silent data corruption in gfortran read statement
+! Test from PR.
+ program r3
+
+ integer(kind=4) :: a(1025),b(1025),c(1025),d(2048),e(1022)
+
+ a = 5
+ b = 6
+ c = 7
+ e = 8
+
+ do i=1,2048
+ d(i)=i
+ end do
+
+ open (3,form='unformatted', status="scratch")
+ write (3) a,b,c,d,e
+ rewind 3
+ d = 0
+ read (3) a,b,c,d
+ close (3)
+
+ if (d(1).ne.1) call abort
+ if (d(2048).ne.2048) call abort
+
+ end
diff --git a/gcc/testsuite/gfortran.dg/used_types_11.f90 b/gcc/testsuite/gfortran.dg/used_types_11.f90
index b3f4eaa56e4..b820dc5e249 100644
--- a/gcc/testsuite/gfortran.dg/used_types_11.f90
+++ b/gcc/testsuite/gfortran.dg/used_types_11.f90
@@ -35,3 +35,4 @@ end subroutine bar
x => foo ()
print *, associated (x)
end
+! { dg-final { cleanup-modules "A B" } }
diff --git a/gcc/testsuite/gfortran.dg/zero_array_components_1.f90 b/gcc/testsuite/gfortran.dg/zero_array_components_1.f90
index 514f90c5440..b1b8b5c69ab 100644
--- a/gcc/testsuite/gfortran.dg/zero_array_components_1.f90
+++ b/gcc/testsuite/gfortran.dg/zero_array_components_1.f90
@@ -1,4 +1,4 @@
-! { dg do-run }
+! { dg-do run }
! Tests the fix for PR31620, in which zeroing the component a for the array,
! would zero all the components of the array.
!
diff --git a/gcc/testsuite/gfortran.dg/zero_length_1.f90 b/gcc/testsuite/gfortran.dg/zero_length_1.f90
new file mode 100644
index 00000000000..c76d079e597
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/zero_length_1.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+! PR libfortran/31210
+program test
+ implicit none
+ integer :: l = 0
+ character(len=20) :: s
+
+ write(s,'(A,I1)') foo(), 0
+ if (trim(s) /= "0") call abort
+
+contains
+
+ function foo()
+ character(len=l) :: foo
+ foo = "XXXX"
+ end function
+
+end program test
diff --git a/gcc/testsuite/gnat.dg/opt1.adb b/gcc/testsuite/gnat.dg/opt1.adb
new file mode 100644
index 00000000000..69bb8136d04
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt1.adb
@@ -0,0 +1,29 @@
+-- { dg-do compile }
+-- { dg-options "-O -gnatws" }
+
+package body Opt1 is
+
+ function De_Linear_Index
+ (Index : Natural;
+ D : Natural;
+ Ind_Lengths : Dimention_Length)
+ return Dimension_Indexes
+ is
+ Len : Natural := 1;
+ Tmp_Ind : Natural := Index;
+ Tmp_Res : Natural;
+ Result : Dimension_Indexes (1 .. D);
+ begin
+ for J in 1 .. D loop
+ Len := Len * Ind_Lengths (J);
+ end loop;
+
+ for J in Result'Range loop
+ Result (J) := Tmp_Res;
+ Tmp_Ind := Tmp_Ind - Len * (Result (J) - 1);
+ end loop;
+
+ return Result;
+ end;
+
+end Opt1;
diff --git a/gcc/testsuite/gnat.dg/opt1.ads b/gcc/testsuite/gnat.dg/opt1.ads
new file mode 100644
index 00000000000..247e7dc639c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt1.ads
@@ -0,0 +1,13 @@
+package Opt1 is
+
+ type Dimention_Length is array (1 .. 16) of Natural;
+
+ type Dimension_Indexes is array (Positive range <>) of Positive;
+
+ function De_Linear_Index
+ (Index : Natural;
+ D : Natural;
+ Ind_Lengths : Dimention_Length)
+ return Dimension_Indexes;
+
+end Opt1;
diff --git a/gcc/timevar.c b/gcc/timevar.c
index 01cc880e595..29142ab7d4e 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -483,10 +483,9 @@ timevar_print (FILE *fp)
fprintf (fp, "Extra diagnostic checks enabled; compiler may run slowly.\n");
fprintf (fp, "Configure with --enable-checking=release to disable checks.\n");
#endif
-#ifndef ASSERT_CHECKING
- fprintf (fp, "Assert checking was disable; if you do an official compiling\n");
- fprintf (fp, "time testing please use --enable-checking=release instead of\n");
- fprintf (fp, "--disable-checking.\n");
+#ifndef ENABLE_ASSERT_CHECKING
+ fprintf (fp, "Internal checks disabled; compiler is not suited for release.\n");
+ fprintf (fp, "Configure with --enable-checking=release to enable checks.\n");
#endif
#endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME)
diff --git a/gcc/toplev.c b/gcc/toplev.c
index bdebcda624c..8afce8bc876 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1180,12 +1180,16 @@ print_version (FILE *file, const char *indent)
{
static const char fmt1[] =
#ifdef __GNUC__
- N_("%s%s%s version %s (%s)\n%s\tcompiled by GNU C version %s.\n")
+ N_("%s%s%s version %s (%s)\n%s\tcompiled by GNU C version %s, ")
#else
- N_("%s%s%s version %s (%s) compiled by CC.\n")
+ N_("%s%s%s version %s (%s) compiled by CC, ")
#endif
;
static const char fmt2[] =
+ N_("GMP version %s, MPFR version %s.\n");
+ static const char fmt3[] =
+ N_("warning: %s header version %s differs from library version %s.\n");
+ static const char fmt4[] =
N_("%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n");
#ifndef __VERSION__
#define __VERSION__ "[?]"
@@ -1195,8 +1199,32 @@ print_version (FILE *file, const char *indent)
indent, *indent != 0 ? " " : "",
lang_hooks.name, version_string, TARGET_NAME,
indent, __VERSION__);
+
+ /* We need to stringify the GMP macro values. Ugh, gmp_version has
+ two string formats, "i.j.k" and "i.j" when k is zero. */
+#define GCC_GMP_STRINGIFY_VERSION3(X) #X
+#define GCC_GMP_STRINGIFY_VERSION2(X) GCC_GMP_STRINGIFY_VERSION3(X)
+#if __GNU_MP_VERSION_PATCHLEVEL == 0
+#define GCC_GMP_STRINGIFY_VERSION GCC_GMP_STRINGIFY_VERSION2(__GNU_MP_VERSION) "." \
+ GCC_GMP_STRINGIFY_VERSION2(__GNU_MP_VERSION_MINOR)
+#else
+#define GCC_GMP_STRINGIFY_VERSION GCC_GMP_STRINGIFY_VERSION2(__GNU_MP_VERSION) "." \
+ GCC_GMP_STRINGIFY_VERSION2(__GNU_MP_VERSION_MINOR) "." \
+ GCC_GMP_STRINGIFY_VERSION2(__GNU_MP_VERSION_PATCHLEVEL)
+#endif
fprintf (file,
file == stderr ? _(fmt2) : fmt2,
+ GCC_GMP_STRINGIFY_VERSION, MPFR_VERSION_STRING);
+ if (strcmp (GCC_GMP_STRINGIFY_VERSION, gmp_version))
+ fprintf (file,
+ file == stderr ? _(fmt3) : fmt3,
+ "GMP", GCC_GMP_STRINGIFY_VERSION, gmp_version);
+ if (strcmp (MPFR_VERSION_STRING, mpfr_get_version ()))
+ fprintf (file,
+ file == stderr ? _(fmt3) : fmt3,
+ "MPFR", MPFR_VERSION_STRING, mpfr_get_version ());
+ fprintf (file,
+ file == stderr ? _(fmt4) : fmt4,
indent, *indent != 0 ? " " : "",
PARAM_VALUE (GGC_MIN_EXPAND), PARAM_VALUE (GGC_MIN_HEAPSIZE));
}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index efe0a1cb0a1..15beeabb544 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3865,7 +3865,7 @@ tree_verify_flow_info (void)
}
}
- if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ if (dom_info_state (CDI_DOMINATORS) >= DOM_NO_FAST_QUERY)
verify_dominators (CDI_DOMINATORS);
return err;
@@ -4367,7 +4367,7 @@ tree_duplicate_sese_region (edge entry, edge exit,
if (loop->header == entry->dest)
{
copying_header = true;
- loop->copy = loop->outer;
+ loop->copy = loop_outer (loop);
if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit->src))
return false;
@@ -5375,7 +5375,7 @@ remove_edge_and_dominated_blocks (edge e)
basic_block bb, dbb;
bitmap_iterator bi;
- if (!dom_computed[CDI_DOMINATORS])
+ if (!dom_info_available_p (CDI_DOMINATORS))
{
remove_edge (e);
return;
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index aaf6ce8ee26..1bf416ea768 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -609,7 +609,7 @@ cleanup_tree_cfg (void)
If dominance information is available, there cannot be any unreachable
blocks. */
- if (!dom_computed[CDI_DOMINATORS])
+ if (!dom_info_available_p (CDI_DOMINATORS))
{
changed = delete_unreachable_blocks ();
calculate_dominance_info (CDI_DOMINATORS);
@@ -624,7 +624,7 @@ cleanup_tree_cfg (void)
changed |= cleanup_tree_cfg_1 ();
- gcc_assert (dom_computed[CDI_DOMINATORS]);
+ gcc_assert (dom_info_available_p (CDI_DOMINATORS));
compact_blocks ();
#ifdef ENABLE_CHECKING
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 119a35b97c2..7abd5ad519f 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -888,11 +888,12 @@ chrec_contains_undetermined (tree chrec)
{
int i, n;
- if (chrec == chrec_dont_know
- || chrec == chrec_not_analyzed_yet
- || chrec == NULL_TREE)
+ if (chrec == chrec_dont_know)
return true;
+ if (chrec == NULL_TREE)
+ return false;
+
n = TREE_OPERAND_LENGTH (chrec);
for (i = 0; i < n; i++)
if (chrec_contains_undetermined (TREE_OPERAND (chrec, i)))
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index 95c6f384dde..6be00d63165 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -36,8 +36,7 @@ extern GTY(()) tree chrec_known;
static inline bool
automatically_generated_chrec_p (tree chrec)
{
- return (chrec == chrec_not_analyzed_yet
- || chrec == chrec_dont_know
+ return (chrec == chrec_dont_know
|| chrec == chrec_known);
}
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index ac5aa50ebbd..1a814316ebe 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -122,463 +122,9 @@ static struct datadep_stats
int num_miv_unimplemented;
} dependence_stats;
-static tree object_analysis (tree, tree, bool, struct data_reference **,
- tree *, tree *, tree *, tree *, tree *,
- struct ptr_info_def **, subvar_t *);
static bool subscript_dependence_tester_1 (struct data_dependence_relation *,
struct data_reference *,
struct data_reference *);
-
-/* Determine if PTR and DECL may alias, the result is put in ALIASED.
- Return FALSE if there is no symbol memory tag for PTR. */
-
-static bool
-ptr_decl_may_alias_p (tree ptr, tree decl,
- struct data_reference *ptr_dr,
- bool *aliased)
-{
- tree tag = NULL_TREE;
- struct ptr_info_def *pi = DR_PTR_INFO (ptr_dr);
-
- gcc_assert (TREE_CODE (ptr) == SSA_NAME && DECL_P (decl));
-
- if (pi)
- tag = pi->name_mem_tag;
- if (!tag)
- tag = symbol_mem_tag (SSA_NAME_VAR (ptr));
- if (!tag)
- tag = DR_MEMTAG (ptr_dr);
- if (!tag)
- return false;
-
- *aliased = is_aliased_with (tag, decl);
- return true;
-}
-
-
-/* Determine if two pointers may alias, the result is put in ALIASED.
- Return FALSE if there is no symbol memory tag for one of the pointers. */
-
-static bool
-ptr_ptr_may_alias_p (tree ptr_a, tree ptr_b,
- struct data_reference *dra,
- struct data_reference *drb,
- bool *aliased)
-{
- tree tag_a = NULL_TREE, tag_b = NULL_TREE;
- struct ptr_info_def *pi_a = DR_PTR_INFO (dra);
- struct ptr_info_def *pi_b = DR_PTR_INFO (drb);
- bitmap bal1, bal2;
-
- if (pi_a && pi_a->name_mem_tag && pi_b && pi_b->name_mem_tag)
- {
- tag_a = pi_a->name_mem_tag;
- tag_b = pi_b->name_mem_tag;
- }
- else
- {
- tag_a = symbol_mem_tag (SSA_NAME_VAR (ptr_a));
- if (!tag_a)
- tag_a = DR_MEMTAG (dra);
- if (!tag_a)
- return false;
-
- tag_b = symbol_mem_tag (SSA_NAME_VAR (ptr_b));
- if (!tag_b)
- tag_b = DR_MEMTAG (drb);
- if (!tag_b)
- return false;
- }
- bal1 = BITMAP_ALLOC (NULL);
- bitmap_set_bit (bal1, DECL_UID (tag_a));
- if (MTAG_P (tag_a) && MTAG_ALIASES (tag_a))
- bitmap_ior_into (bal1, MTAG_ALIASES (tag_a));
-
- bal2 = BITMAP_ALLOC (NULL);
- bitmap_set_bit (bal2, DECL_UID (tag_b));
- if (MTAG_P (tag_b) && MTAG_ALIASES (tag_b))
- bitmap_ior_into (bal2, MTAG_ALIASES (tag_b));
- *aliased = bitmap_intersect_p (bal1, bal2);
-
- BITMAP_FREE (bal1);
- BITMAP_FREE (bal2);
- return true;
-}
-
-
-/* Determine if BASE_A and BASE_B may alias, the result is put in ALIASED.
- Return FALSE if there is no symbol memory tag for one of the symbols. */
-
-static bool
-may_alias_p (tree base_a, tree base_b,
- struct data_reference *dra,
- struct data_reference *drb,
- bool *aliased)
-{
- if (TREE_CODE (base_a) == ADDR_EXPR || TREE_CODE (base_b) == ADDR_EXPR)
- {
- if (TREE_CODE (base_a) == ADDR_EXPR && TREE_CODE (base_b) == ADDR_EXPR)
- {
- *aliased = (TREE_OPERAND (base_a, 0) == TREE_OPERAND (base_b, 0));
- return true;
- }
- if (TREE_CODE (base_a) == ADDR_EXPR)
- return ptr_decl_may_alias_p (base_b, TREE_OPERAND (base_a, 0), drb,
- aliased);
- else
- return ptr_decl_may_alias_p (base_a, TREE_OPERAND (base_b, 0), dra,
- aliased);
- }
-
- return ptr_ptr_may_alias_p (base_a, base_b, dra, drb, aliased);
-}
-
-
-/* Determine if a pointer (BASE_A) and a record/union access (BASE_B)
- are not aliased. Return TRUE if they differ. */
-static bool
-record_ptr_differ_p (struct data_reference *dra,
- struct data_reference *drb)
-{
- bool aliased;
- tree base_a = DR_BASE_OBJECT (dra);
- tree base_b = DR_BASE_OBJECT (drb);
-
- if (TREE_CODE (base_b) != COMPONENT_REF)
- return false;
-
- /* Peel COMPONENT_REFs to get to the base. Do not peel INDIRECT_REFs.
- For a.b.c.d[i] we will get a, and for a.b->c.d[i] we will get a.b.
- Probably will be unnecessary with struct alias analysis. */
- while (TREE_CODE (base_b) == COMPONENT_REF)
- base_b = TREE_OPERAND (base_b, 0);
- /* Compare a record/union access (b.c[i] or p->c[i]) and a pointer
- ((*q)[i]). */
- if (TREE_CODE (base_a) == INDIRECT_REF
- && ((TREE_CODE (base_b) == VAR_DECL
- && (ptr_decl_may_alias_p (TREE_OPERAND (base_a, 0), base_b, dra,
- &aliased)
- && !aliased))
- || (TREE_CODE (base_b) == INDIRECT_REF
- && (ptr_ptr_may_alias_p (TREE_OPERAND (base_a, 0),
- TREE_OPERAND (base_b, 0), dra, drb,
- &aliased)
- && !aliased))))
- return true;
- else
- return false;
-}
-
-/* Determine if two record/union accesses are aliased. Return TRUE if they
- differ. */
-static bool
-record_record_differ_p (struct data_reference *dra,
- struct data_reference *drb)
-{
- bool aliased;
- tree base_a = DR_BASE_OBJECT (dra);
- tree base_b = DR_BASE_OBJECT (drb);
-
- if (TREE_CODE (base_b) != COMPONENT_REF
- || TREE_CODE (base_a) != COMPONENT_REF)
- return false;
-
- /* Peel COMPONENT_REFs to get to the base. Do not peel INDIRECT_REFs.
- For a.b.c.d[i] we will get a, and for a.b->c.d[i] we will get a.b.
- Probably will be unnecessary with struct alias analysis. */
- while (TREE_CODE (base_b) == COMPONENT_REF)
- base_b = TREE_OPERAND (base_b, 0);
- while (TREE_CODE (base_a) == COMPONENT_REF)
- base_a = TREE_OPERAND (base_a, 0);
-
- if (TREE_CODE (base_a) == INDIRECT_REF
- && TREE_CODE (base_b) == INDIRECT_REF
- && ptr_ptr_may_alias_p (TREE_OPERAND (base_a, 0),
- TREE_OPERAND (base_b, 0),
- dra, drb, &aliased)
- && !aliased)
- return true;
- else
- return false;
-}
-
-/* Determine if an array access (BASE_A) and a record/union access (BASE_B)
- are not aliased. Return TRUE if they differ. */
-static bool
-record_array_differ_p (struct data_reference *dra,
- struct data_reference *drb)
-{
- bool aliased;
- tree base_a = DR_BASE_OBJECT (dra);
- tree base_b = DR_BASE_OBJECT (drb);
-
- if (TREE_CODE (base_b) != COMPONENT_REF)
- return false;
-
- /* Peel COMPONENT_REFs to get to the base. Do not peel INDIRECT_REFs.
- For a.b.c.d[i] we will get a, and for a.b->c.d[i] we will get a.b.
- Probably will be unnecessary with struct alias analysis. */
- while (TREE_CODE (base_b) == COMPONENT_REF)
- base_b = TREE_OPERAND (base_b, 0);
-
- /* Compare a record/union access (b.c[i] or p->c[i]) and an array access
- (a[i]). In case of p->c[i] use alias analysis to verify that p is not
- pointing to a. */
- if (TREE_CODE (base_a) == VAR_DECL
- && (TREE_CODE (base_b) == VAR_DECL
- || (TREE_CODE (base_b) == INDIRECT_REF
- && (ptr_decl_may_alias_p (TREE_OPERAND (base_b, 0), base_a, drb,
- &aliased)
- && !aliased))))
- return true;
- else
- return false;
-}
-
-
-/* Determine if an array access (BASE_A) and a pointer (BASE_B)
- are not aliased. Return TRUE if they differ. */
-static bool
-array_ptr_differ_p (tree base_a, tree base_b,
- struct data_reference *drb)
-{
- bool aliased;
-
- /* In case one of the bases is a pointer (a[i] and (*p)[i]), we check with the
- help of alias analysis that p is not pointing to a. */
- if (TREE_CODE (base_a) == VAR_DECL && TREE_CODE (base_b) == INDIRECT_REF
- && (ptr_decl_may_alias_p (TREE_OPERAND (base_b, 0), base_a, drb, &aliased)
- && !aliased))
- return true;
- else
- return false;
-}
-
-
-/* This is the simplest data dependence test: determines whether the
- data references A and B access the same array/region. Returns
- false when the property is not computable at compile time.
- Otherwise return true, and DIFFER_P will record the result. This
- utility will not be necessary when alias_sets_conflict_p will be
- less conservative. */
-
-static bool
-base_object_differ_p (struct data_reference *a,
- struct data_reference *b,
- bool *differ_p)
-{
- tree base_a = DR_BASE_OBJECT (a);
- tree base_b = DR_BASE_OBJECT (b);
- bool aliased;
-
- if (!base_a || !base_b)
- return false;
-
- /* Determine if same base. Example: for the array accesses
- a[i], b[i] or pointer accesses *a, *b, bases are a, b. */
- if (base_a == base_b)
- {
- *differ_p = false;
- return true;
- }
-
- /* For pointer based accesses, (*p)[i], (*q)[j], the bases are (*p)
- and (*q) */
- if (TREE_CODE (base_a) == INDIRECT_REF && TREE_CODE (base_b) == INDIRECT_REF
- && TREE_OPERAND (base_a, 0) == TREE_OPERAND (base_b, 0))
- {
- *differ_p = false;
- return true;
- }
-
- /* Record/union based accesses - s.a[i], t.b[j]. bases are s.a,t.b. */
- if (TREE_CODE (base_a) == COMPONENT_REF && TREE_CODE (base_b) == COMPONENT_REF
- && TREE_OPERAND (base_a, 0) == TREE_OPERAND (base_b, 0)
- && TREE_OPERAND (base_a, 1) == TREE_OPERAND (base_b, 1))
- {
- *differ_p = false;
- return true;
- }
-
-
- /* Determine if different bases. */
-
- /* At this point we know that base_a != base_b. However, pointer
- accesses of the form x=(*p) and y=(*q), whose bases are p and q,
- may still be pointing to the same base. In SSAed GIMPLE p and q will
- be SSA_NAMES in this case. Therefore, here we check if they are
- really two different declarations. */
- if (TREE_CODE (base_a) == VAR_DECL && TREE_CODE (base_b) == VAR_DECL)
- {
- *differ_p = true;
- return true;
- }
-
- /* In case one of the bases is a pointer (a[i] and (*p)[i]), we check with the
- help of alias analysis that p is not pointing to a. */
- if (array_ptr_differ_p (base_a, base_b, b)
- || array_ptr_differ_p (base_b, base_a, a))
- {
- *differ_p = true;
- return true;
- }
-
- /* If the bases are pointers ((*q)[i] and (*p)[i]), we check with the
- help of alias analysis they don't point to the same bases. */
- if (TREE_CODE (base_a) == INDIRECT_REF && TREE_CODE (base_b) == INDIRECT_REF
- && (may_alias_p (TREE_OPERAND (base_a, 0), TREE_OPERAND (base_b, 0), a, b,
- &aliased)
- && !aliased))
- {
- *differ_p = true;
- return true;
- }
-
- /* Compare two record/union bases s.a and t.b: s != t or (a != b and
- s and t are not unions). */
- if (TREE_CODE (base_a) == COMPONENT_REF && TREE_CODE (base_b) == COMPONENT_REF
- && ((TREE_CODE (TREE_OPERAND (base_a, 0)) == VAR_DECL
- && TREE_CODE (TREE_OPERAND (base_b, 0)) == VAR_DECL
- && TREE_OPERAND (base_a, 0) != TREE_OPERAND (base_b, 0))
- || (TREE_CODE (TREE_TYPE (TREE_OPERAND (base_a, 0))) == RECORD_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (base_b, 0))) == RECORD_TYPE
- && TREE_OPERAND (base_a, 1) != TREE_OPERAND (base_b, 1))))
- {
- *differ_p = true;
- return true;
- }
-
- /* Compare a record/union access (b.c[i] or p->c[i]) and a pointer
- ((*q)[i]). */
- if (record_ptr_differ_p (a, b) || record_ptr_differ_p (b, a))
- {
- *differ_p = true;
- return true;
- }
-
- /* Compare a record/union access (b.c[i] or p->c[i]) and an array access
- (a[i]). In case of p->c[i] use alias analysis to verify that p is not
- pointing to a. */
- if (record_array_differ_p (a, b) || record_array_differ_p (b, a))
- {
- *differ_p = true;
- return true;
- }
-
- /* Compare two record/union accesses (b.c[i] or p->c[i]). */
- if (record_record_differ_p (a, b))
- {
- *differ_p = true;
- return true;
- }
-
- return false;
-}
-
-/* Function base_addr_differ_p.
-
- This is the simplest data dependence test: determines whether the
- data references DRA and DRB access the same array/region. Returns
- false when the property is not computable at compile time.
- Otherwise return true, and DIFFER_P will record the result.
-
- The algorithm:
- 1. if (both DRA and DRB are represented as arrays)
- compare DRA.BASE_OBJECT and DRB.BASE_OBJECT
- 2. else if (both DRA and DRB are represented as pointers)
- try to prove that DRA.FIRST_LOCATION == DRB.FIRST_LOCATION
- 3. else if (DRA and DRB are represented differently or 2. fails)
- only try to prove that the bases are surely different
-*/
-
-static bool
-base_addr_differ_p (struct data_reference *dra,
- struct data_reference *drb,
- bool *differ_p)
-{
- tree addr_a = DR_BASE_ADDRESS (dra);
- tree addr_b = DR_BASE_ADDRESS (drb);
- tree type_a, type_b;
- tree decl_a, decl_b;
- bool aliased;
-
- if (!addr_a || !addr_b)
- return false;
-
- type_a = TREE_TYPE (addr_a);
- type_b = TREE_TYPE (addr_b);
-
- gcc_assert (POINTER_TYPE_P (type_a) && POINTER_TYPE_P (type_b));
-
- /* 1. if (both DRA and DRB are represented as arrays)
- compare DRA.BASE_OBJECT and DRB.BASE_OBJECT. */
- if (DR_TYPE (dra) == ARRAY_REF_TYPE && DR_TYPE (drb) == ARRAY_REF_TYPE)
- return base_object_differ_p (dra, drb, differ_p);
-
- /* 2. else if (both DRA and DRB are represented as pointers)
- try to prove that DRA.FIRST_LOCATION == DRB.FIRST_LOCATION. */
- /* If base addresses are the same, we check the offsets, since the access of
- the data-ref is described by {base addr + offset} and its access function,
- i.e., in order to decide whether the bases of data-refs are the same we
- compare both base addresses and offsets. */
- if (DR_TYPE (dra) == POINTER_REF_TYPE && DR_TYPE (drb) == POINTER_REF_TYPE
- && (addr_a == addr_b
- || (TREE_CODE (addr_a) == ADDR_EXPR && TREE_CODE (addr_b) == ADDR_EXPR
- && TREE_OPERAND (addr_a, 0) == TREE_OPERAND (addr_b, 0))))
- {
- /* Compare offsets. */
- tree offset_a = DR_OFFSET (dra);
- tree offset_b = DR_OFFSET (drb);
-
- STRIP_NOPS (offset_a);
- STRIP_NOPS (offset_b);
-
- /* FORNOW: we only compare offsets that are MULT_EXPR, i.e., we don't handle
- PLUS_EXPR. */
- if (offset_a == offset_b
- || (TREE_CODE (offset_a) == MULT_EXPR
- && TREE_CODE (offset_b) == MULT_EXPR
- && TREE_OPERAND (offset_a, 0) == TREE_OPERAND (offset_b, 0)
- && TREE_OPERAND (offset_a, 1) == TREE_OPERAND (offset_b, 1)))
- {
- *differ_p = false;
- return true;
- }
- }
-
- /* 3. else if (DRA and DRB are represented differently or 2. fails)
- only try to prove that the bases are surely different. */
-
- /* Apply alias analysis. */
- if (may_alias_p (addr_a, addr_b, dra, drb, &aliased) && !aliased)
- {
- *differ_p = true;
- return true;
- }
-
- /* An instruction writing through a restricted pointer is "independent" of any
- instruction reading or writing through a different restricted pointer,
- in the same block/scope. */
- else if (TYPE_RESTRICT (type_a)
- && TYPE_RESTRICT (type_b)
- && (!DR_IS_READ (drb) || !DR_IS_READ (dra))
- && TREE_CODE (DR_BASE_ADDRESS (dra)) == SSA_NAME
- && (decl_a = SSA_NAME_VAR (DR_BASE_ADDRESS (dra)))
- && TREE_CODE (decl_a) == PARM_DECL
- && TREE_CODE (DECL_CONTEXT (decl_a)) == FUNCTION_DECL
- && TREE_CODE (DR_BASE_ADDRESS (drb)) == SSA_NAME
- && (decl_b = SSA_NAME_VAR (DR_BASE_ADDRESS (drb)))
- && TREE_CODE (decl_b) == PARM_DECL
- && TREE_CODE (DECL_CONTEXT (decl_b)) == FUNCTION_DECL
- && DECL_CONTEXT (decl_a) == DECL_CONTEXT (decl_b))
- {
- *differ_p = true;
- return true;
- }
-
- return false;
-}
-
/* Returns true iff A divides B. */
static inline bool
@@ -940,1125 +486,334 @@ dump_ddrs (FILE *file, VEC (ddr_p, heap) *ddrs)
fprintf (file, "\n\n");
}
-
+/* Expresses EXP as VAR + OFF, where off is a constant. The type of OFF
+ will be ssizetype. */
-/* Given an ARRAY_REF node REF, records its access functions.
- Example: given A[i][3], record in ACCESS_FNS the opnd1 function,
- i.e. the constant "3", then recursively call the function on opnd0,
- i.e. the ARRAY_REF "A[i]".
- The function returns the base name: "A". */
-
-static tree
-analyze_array_indexes (struct loop *loop,
- VEC(tree,heap) **access_fns,
- tree ref, tree stmt)
+static void
+split_constant_offset (tree exp, tree *var, tree *off)
{
- tree opnd0, opnd1;
- tree access_fn;
-
- opnd0 = TREE_OPERAND (ref, 0);
- opnd1 = TREE_OPERAND (ref, 1);
+ tree type = TREE_TYPE (exp), otype;
+ tree var0, var1;
+ tree off0, off1;
- /* The detection of the evolution function for this data access is
- postponed until the dependence test. This lazy strategy avoids
- the computation of access functions that are of no interest for
- the optimizers. */
- access_fn = instantiate_parameters
- (loop, analyze_scalar_evolution (loop, opnd1));
-
- VEC_safe_push (tree, heap, *access_fns, access_fn);
-
- /* Recursively record other array access functions. */
- if (TREE_CODE (opnd0) == ARRAY_REF)
- return analyze_array_indexes (loop, access_fns, opnd0, stmt);
+ *var = exp;
+ STRIP_NOPS (exp);
+ otype = TREE_TYPE (exp);
- /* Return the base name of the data access. */
- else
- return opnd0;
-}
+ switch (TREE_CODE (exp))
+ {
+ case INTEGER_CST:
+ *var = build_int_cst (type, 0);
+ *off = fold_convert (ssizetype, exp);
+ return;
-/* For a data reference REF contained in the statement STMT, initialize
- a DATA_REFERENCE structure, and return it. IS_READ flag has to be
- set to true when REF is in the right hand side of an
- assignment. */
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ split_constant_offset (TREE_OPERAND (exp, 0), &var0, &off0);
+ split_constant_offset (TREE_OPERAND (exp, 1), &var1, &off1);
+ *var = fold_convert (type, fold_build2 (TREE_CODE (exp), otype,
+ var0, var1));
+ *off = size_binop (TREE_CODE (exp), off0, off1);
+ return;
-static struct data_reference *
-init_array_ref (tree stmt, tree ref, bool is_read)
-{
- struct loop *loop = loop_containing_stmt (stmt);
- VEC(tree,heap) *acc_fns = VEC_alloc (tree, heap, 3);
- struct data_reference *res = XNEW (struct data_reference);;
+ case MULT_EXPR:
+ off1 = TREE_OPERAND (exp, 1);
+ if (TREE_CODE (off1) != INTEGER_CST)
+ break;
+
+ split_constant_offset (TREE_OPERAND (exp, 0), &var0, &off0);
+ *var = fold_convert (type, fold_build2 (MULT_EXPR, otype,
+ var0, off1));
+ *off = size_binop (MULT_EXPR, off0, fold_convert (ssizetype, off1));
+ return;
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "(init_array_ref \n");
- fprintf (dump_file, " (ref = ");
- print_generic_stmt (dump_file, ref, 0);
- fprintf (dump_file, ")\n");
- }
+ case ADDR_EXPR:
+ {
+ tree op, base, poffset;
+ HOST_WIDE_INT pbitsize, pbitpos;
+ enum machine_mode pmode;
+ int punsignedp, pvolatilep;
- DR_STMT (res) = stmt;
- DR_REF (res) = ref;
- DR_BASE_OBJECT (res) = analyze_array_indexes (loop, &acc_fns, ref, stmt);
- DR_TYPE (res) = ARRAY_REF_TYPE;
- DR_SET_ACCESS_FNS (res, acc_fns);
- DR_IS_READ (res) = is_read;
- DR_BASE_ADDRESS (res) = NULL_TREE;
- DR_OFFSET (res) = NULL_TREE;
- DR_INIT (res) = NULL_TREE;
- DR_STEP (res) = NULL_TREE;
- DR_OFFSET_MISALIGNMENT (res) = NULL_TREE;
- DR_MEMTAG (res) = NULL_TREE;
- DR_PTR_INFO (res) = NULL;
+ op = TREE_OPERAND (exp, 0);
+ if (!handled_component_p (op))
+ break;
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, ")\n");
+ base = get_inner_reference (op, &pbitsize, &pbitpos, &poffset,
+ &pmode, &punsignedp, &pvolatilep, false);
- return res;
-}
+ if (pbitpos % BITS_PER_UNIT != 0)
+ break;
+ base = build_fold_addr_expr (base);
+ off0 = ssize_int (pbitpos / BITS_PER_UNIT);
-/* For a data reference REF contained in the statement STMT, initialize
- a DATA_REFERENCE structure, and return it. */
+ if (poffset)
+ {
+ split_constant_offset (poffset, &poffset, &off1);
+ off0 = size_binop (PLUS_EXPR, off0, off1);
+ base = fold_build2 (PLUS_EXPR, TREE_TYPE (base),
+ base,
+ fold_convert (TREE_TYPE (base), poffset));
+ }
-static struct data_reference *
-init_pointer_ref (tree stmt, tree ref, tree access_fn, bool is_read,
- tree base_address, tree step, struct ptr_info_def *ptr_info)
-{
- struct data_reference *res = XNEW (struct data_reference);
- VEC(tree,heap) *acc_fns = VEC_alloc (tree, heap, 3);
+ *var = fold_convert (type, base);
+ *off = off0;
+ return;
+ }
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "(init_pointer_ref \n");
- fprintf (dump_file, " (ref = ");
- print_generic_stmt (dump_file, ref, 0);
- fprintf (dump_file, ")\n");
+ default:
+ break;
}
- DR_STMT (res) = stmt;
- DR_REF (res) = ref;
- DR_BASE_OBJECT (res) = NULL_TREE;
- DR_TYPE (res) = POINTER_REF_TYPE;
- DR_SET_ACCESS_FNS (res, acc_fns);
- VEC_quick_push (tree, DR_ACCESS_FNS (res), access_fn);
- DR_IS_READ (res) = is_read;
- DR_BASE_ADDRESS (res) = base_address;
- DR_OFFSET (res) = NULL_TREE;
- DR_INIT (res) = NULL_TREE;
- DR_STEP (res) = step;
- DR_OFFSET_MISALIGNMENT (res) = NULL_TREE;
- DR_MEMTAG (res) = NULL_TREE;
- DR_PTR_INFO (res) = ptr_info;
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, ")\n");
-
- return res;
+ *off = ssize_int (0);
}
-/* Analyze an indirect memory reference, REF, that comes from STMT.
- IS_READ is true if this is an indirect load, and false if it is
- an indirect store.
- Return a new data reference structure representing the indirect_ref, or
- NULL if we cannot describe the access function. */
+/* Returns the address ADDR of an object in a canonical shape (without nop
+ casts, and with type of pointer to the object). */
-static struct data_reference *
-analyze_indirect_ref (tree stmt, tree ref, bool is_read)
+static tree
+canonicalize_base_object_address (tree addr)
{
- struct loop *loop = loop_containing_stmt (stmt);
- tree ptr_ref = TREE_OPERAND (ref, 0);
- tree access_fn = analyze_scalar_evolution (loop, ptr_ref);
- tree init = initial_condition_in_loop_num (access_fn, loop->num);
- tree base_address = NULL_TREE, evolution, step = NULL_TREE;
- struct ptr_info_def *ptr_info = NULL;
-
- if (TREE_CODE (ptr_ref) == SSA_NAME)
- ptr_info = SSA_NAME_PTR_INFO (ptr_ref);
-
- STRIP_NOPS (init);
- if (access_fn == chrec_dont_know || !init || init == chrec_dont_know)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nBad access function of ptr: ");
- print_generic_expr (dump_file, ref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL;
- }
+ STRIP_NOPS (addr);
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nAccess function of ptr: ");
- print_generic_expr (dump_file, access_fn, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
+ if (TREE_CODE (addr) != ADDR_EXPR)
+ return addr;
- if (!expr_invariant_in_loop_p (loop, init))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\ninitial condition is not loop invariant.\n");
- }
- else
- {
- base_address = init;
- evolution = evolution_part_in_loop_num (access_fn, loop->num);
- if (evolution != chrec_dont_know)
- {
- if (!evolution)
- step = ssize_int (0);
- else
- {
- if (TREE_CODE (evolution) == INTEGER_CST)
- step = fold_convert (ssizetype, evolution);
- else
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nnon constant step for ptr access.\n");
- }
- }
- else
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nunknown evolution of ptr.\n");
- }
- return init_pointer_ref (stmt, ref, access_fn, is_read, base_address,
- step, ptr_info);
+ return build_fold_addr_expr (TREE_OPERAND (addr, 0));
}
-/* Function strip_conversions
-
- Strip conversions that don't narrow the mode. */
+/* Analyzes the behavior of the memory reference DR in the innermost loop that
+ contains it. */
-static tree
-strip_conversion (tree expr)
+static void
+dr_analyze_innermost (struct data_reference *dr)
{
- tree to, ti, oprnd0;
-
- while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR)
- {
- to = TREE_TYPE (expr);
- oprnd0 = TREE_OPERAND (expr, 0);
- ti = TREE_TYPE (oprnd0);
-
- if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti))
- return NULL_TREE;
- if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE (ti)))
- return NULL_TREE;
-
- expr = oprnd0;
- }
- return expr;
-}
-
-
-/* Function analyze_offset_expr
-
- Given an offset expression EXPR received from get_inner_reference, analyze
- it and create an expression for INITIAL_OFFSET by substituting the variables
- of EXPR with initial_condition of the corresponding access_fn in the loop.
- E.g.,
- for i
- for (j = 3; j < N; j++)
- a[j].b[i][j] = 0;
-
- For a[j].b[i][j], EXPR will be 'i * C_i + j * C_j + C'. 'i' cannot be
- substituted, since its access_fn in the inner loop is i. 'j' will be
- substituted with 3. An INITIAL_OFFSET will be 'i * C_i + C`', where
- C` = 3 * C_j + C.
-
- Compute MISALIGN (the misalignment of the data reference initial access from
- its base). Misalignment can be calculated only if all the variables can be
- substituted with constants, otherwise, we record maximum possible alignment
- in ALIGNED_TO. In the above example, since 'i' cannot be substituted, MISALIGN
- will be NULL_TREE, and the biggest divider of C_i (a power of 2) will be
- recorded in ALIGNED_TO.
-
- STEP is an evolution of the data reference in this loop in bytes.
- In the above example, STEP is C_j.
-
- Return FALSE, if the analysis fails, e.g., there is no access_fn for a
- variable. In this case, all the outputs (INITIAL_OFFSET, MISALIGN, ALIGNED_TO
- and STEP) are NULL_TREEs. Otherwise, return TRUE.
+ tree stmt = DR_STMT (dr);
+ struct loop *loop = loop_containing_stmt (stmt);
+ tree ref = DR_REF (dr);
+ HOST_WIDE_INT pbitsize, pbitpos;
+ tree base, poffset;
+ enum machine_mode pmode;
+ int punsignedp, pvolatilep;
+ affine_iv base_iv, offset_iv;
+ tree init, dinit, step;
-*/
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "analyze_innermost: ");
-static bool
-analyze_offset_expr (tree expr,
- struct loop *loop,
- tree *initial_offset,
- tree *misalign,
- tree *aligned_to,
- tree *step)
-{
- tree oprnd0;
- tree oprnd1;
- tree left_offset = ssize_int (0);
- tree right_offset = ssize_int (0);
- tree left_misalign = ssize_int (0);
- tree right_misalign = ssize_int (0);
- tree left_step = ssize_int (0);
- tree right_step = ssize_int (0);
- enum tree_code code;
- tree init, evolution;
- tree left_aligned_to = NULL_TREE, right_aligned_to = NULL_TREE;
-
- *step = NULL_TREE;
- *misalign = NULL_TREE;
- *aligned_to = NULL_TREE;
- *initial_offset = NULL_TREE;
-
- /* Strip conversions that don't narrow the mode. */
- expr = strip_conversion (expr);
- if (!expr)
- return false;
+ base = get_inner_reference (ref, &pbitsize, &pbitpos, &poffset,
+ &pmode, &punsignedp, &pvolatilep, false);
+ gcc_assert (base != NULL_TREE);
- /* Stop conditions:
- 1. Constant. */
- if (TREE_CODE (expr) == INTEGER_CST)
+ if (pbitpos % BITS_PER_UNIT != 0)
{
- *initial_offset = fold_convert (ssizetype, expr);
- *misalign = fold_convert (ssizetype, expr);
- *step = ssize_int (0);
- return true;
- }
-
- /* 2. Variable. Try to substitute with initial_condition of the corresponding
- access_fn in the current loop. */
- if (SSA_VAR_P (expr))
- {
- tree access_fn = analyze_scalar_evolution (loop, expr);
-
- if (access_fn == chrec_dont_know)
- /* No access_fn. */
- return false;
-
- init = initial_condition_in_loop_num (access_fn, loop->num);
- if (!expr_invariant_in_loop_p (loop, init))
- /* Not enough information: may be not loop invariant.
- E.g., for a[b[i]], we get a[D], where D=b[i]. EXPR is D, its
- initial_condition is D, but it depends on i - loop's induction
- variable. */
- return false;
-
- evolution = evolution_part_in_loop_num (access_fn, loop->num);
- if (evolution && TREE_CODE (evolution) != INTEGER_CST)
- /* Evolution is not constant. */
- return false;
-
- if (TREE_CODE (init) == INTEGER_CST)
- *misalign = fold_convert (ssizetype, init);
- else
- /* Not constant, misalignment cannot be calculated. */
- *misalign = NULL_TREE;
-
- *initial_offset = fold_convert (ssizetype, init);
-
- *step = evolution ? fold_convert (ssizetype, evolution) : ssize_int (0);
- return true;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "failed: bit offset alignment.\n");
+ return;
}
- /* Recursive computation. */
- if (!BINARY_CLASS_P (expr))
+ base = build_fold_addr_expr (base);
+ if (!simple_iv (loop, stmt, base, &base_iv, false))
{
- /* We expect to get binary expressions (PLUS/MINUS and MULT). */
if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nNot binary expression ");
- print_generic_expr (dump_file, expr, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return false;
+ fprintf (dump_file, "failed: evolution of base is not affine.\n");
+ return;
}
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
-
- if (!analyze_offset_expr (oprnd0, loop, &left_offset, &left_misalign,
- &left_aligned_to, &left_step)
- || !analyze_offset_expr (oprnd1, loop, &right_offset, &right_misalign,
- &right_aligned_to, &right_step))
- return false;
-
- /* The type of the operation: plus, minus or mult. */
- code = TREE_CODE (expr);
- switch (code)
+ if (!poffset)
{
- case MULT_EXPR:
- if (TREE_CODE (right_offset) != INTEGER_CST)
- /* RIGHT_OFFSET can be not constant. For example, for arrays of variable
- sized types.
- FORNOW: We don't support such cases. */
- return false;
-
- /* Strip conversions that don't narrow the mode. */
- left_offset = strip_conversion (left_offset);
- if (!left_offset)
- return false;
- /* Misalignment computation. */
- if (SSA_VAR_P (left_offset))
- {
- /* If the left side contains variables that can't be substituted with
- constants, the misalignment is unknown. However, if the right side
- is a multiple of some alignment, we know that the expression is
- aligned to it. Therefore, we record such maximum possible value.
- */
- *misalign = NULL_TREE;
- *aligned_to = ssize_int (highest_pow2_factor (right_offset));
- }
- else
- {
- /* The left operand was successfully substituted with constant. */
- if (left_misalign)
- {
- /* In case of EXPR '(i * C1 + j) * C2', LEFT_MISALIGN is
- NULL_TREE. */
- *misalign = size_binop (code, left_misalign, right_misalign);
- if (left_aligned_to && right_aligned_to)
- *aligned_to = size_binop (MIN_EXPR, left_aligned_to,
- right_aligned_to);
- else
- *aligned_to = left_aligned_to ?
- left_aligned_to : right_aligned_to;
- }
- else
- *misalign = NULL_TREE;
- }
-
- /* Step calculation. */
- /* Multiply the step by the right operand. */
- *step = size_binop (MULT_EXPR, left_step, right_offset);
- break;
-
- case PLUS_EXPR:
- case MINUS_EXPR:
- /* Combine the recursive calculations for step and misalignment. */
- *step = size_binop (code, left_step, right_step);
-
- /* Unknown alignment. */
- if ((!left_misalign && !left_aligned_to)
- || (!right_misalign && !right_aligned_to))
- {
- *misalign = NULL_TREE;
- *aligned_to = NULL_TREE;
- break;
- }
-
- if (left_misalign && right_misalign)
- *misalign = size_binop (code, left_misalign, right_misalign);
- else
- *misalign = left_misalign ? left_misalign : right_misalign;
-
- if (left_aligned_to && right_aligned_to)
- *aligned_to = size_binop (MIN_EXPR, left_aligned_to, right_aligned_to);
- else
- *aligned_to = left_aligned_to ? left_aligned_to : right_aligned_to;
-
- break;
-
- default:
- gcc_unreachable ();
+ offset_iv.base = ssize_int (0);
+ offset_iv.step = ssize_int (0);
}
-
- /* Compute offset. */
- *initial_offset = fold_convert (ssizetype,
- fold_build2 (code, TREE_TYPE (left_offset),
- left_offset,
- right_offset));
- return true;
-}
-
-/* Function address_analysis
-
- Return the BASE of the address expression EXPR.
- Also compute the OFFSET from BASE, MISALIGN and STEP.
-
- Input:
- EXPR - the address expression that is being analyzed
- STMT - the statement that contains EXPR or its original memory reference
- IS_READ - TRUE if STMT reads from EXPR, FALSE if writes to EXPR
- DR - data_reference struct for the original memory reference
-
- Output:
- BASE (returned value) - the base of the data reference EXPR.
- INITIAL_OFFSET - initial offset of EXPR from BASE (an expression)
- MISALIGN - offset of EXPR from BASE in bytes (a constant) or NULL_TREE if the
- computation is impossible
- ALIGNED_TO - maximum alignment of EXPR or NULL_TREE if MISALIGN can be
- calculated (doesn't depend on variables)
- STEP - evolution of EXPR in the loop
-
- If something unexpected is encountered (an unsupported form of data-ref),
- then NULL_TREE is returned.
- */
-
-static tree
-address_analysis (tree expr, tree stmt, bool is_read, struct data_reference *dr,
- tree *offset, tree *misalign, tree *aligned_to, tree *step)
-{
- tree oprnd0, oprnd1, base_address, offset_expr, base_addr0, base_addr1;
- tree address_offset = ssize_int (0), address_misalign = ssize_int (0);
- tree dummy, address_aligned_to = NULL_TREE;
- struct ptr_info_def *dummy1;
- subvar_t dummy2;
-
- switch (TREE_CODE (expr))
+ else if (!simple_iv (loop, stmt, poffset, &offset_iv, false))
{
- case PLUS_EXPR:
- case MINUS_EXPR:
- /* EXPR is of form {base +/- offset} (or {offset +/- base}). */
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "failed: evolution of offset is not affine.\n");
+ return;
+ }
- STRIP_NOPS (oprnd0);
- STRIP_NOPS (oprnd1);
-
- /* Recursively try to find the base of the address contained in EXPR.
- For offset, the returned base will be NULL. */
- base_addr0 = address_analysis (oprnd0, stmt, is_read, dr, &address_offset,
- &address_misalign, &address_aligned_to,
- step);
-
- base_addr1 = address_analysis (oprnd1, stmt, is_read, dr, &address_offset,
- &address_misalign, &address_aligned_to,
- step);
-
- /* We support cases where only one of the operands contains an
- address. */
- if ((base_addr0 && base_addr1) || (!base_addr0 && !base_addr1))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file,
- "\neither more than one address or no addresses in expr ");
- print_generic_expr (dump_file, expr, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
+ init = ssize_int (pbitpos / BITS_PER_UNIT);
+ split_constant_offset (base_iv.base, &base_iv.base, &dinit);
+ init = size_binop (PLUS_EXPR, init, dinit);
+ split_constant_offset (offset_iv.base, &offset_iv.base, &dinit);
+ init = size_binop (PLUS_EXPR, init, dinit);
- /* To revert STRIP_NOPS. */
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
-
- offset_expr = base_addr0 ?
- fold_convert (ssizetype, oprnd1) : fold_convert (ssizetype, oprnd0);
+ step = size_binop (PLUS_EXPR,
+ fold_convert (ssizetype, base_iv.step),
+ fold_convert (ssizetype, offset_iv.step));
- /* EXPR is of form {base +/- offset} (or {offset +/- base}). If offset is
- a number, we can add it to the misalignment value calculated for base,
- otherwise, misalignment is NULL. */
- if (TREE_CODE (offset_expr) == INTEGER_CST && address_misalign)
- {
- *misalign = size_binop (TREE_CODE (expr), address_misalign,
- offset_expr);
- *aligned_to = address_aligned_to;
- }
- else
- {
- *misalign = NULL_TREE;
- *aligned_to = NULL_TREE;
- }
+ DR_BASE_ADDRESS (dr) = canonicalize_base_object_address (base_iv.base);
- /* Combine offset (from EXPR {base + offset}) with the offset calculated
- for base. */
- *offset = size_binop (TREE_CODE (expr), address_offset, offset_expr);
- return base_addr0 ? base_addr0 : base_addr1;
+ DR_OFFSET (dr) = fold_convert (ssizetype, offset_iv.base);
+ DR_INIT (dr) = init;
+ DR_STEP (dr) = step;
- case ADDR_EXPR:
- base_address = object_analysis (TREE_OPERAND (expr, 0), stmt, is_read,
- &dr, offset, misalign, aligned_to, step,
- &dummy, &dummy1, &dummy2);
- return base_address;
+ DR_ALIGNED_TO (dr) = size_int (highest_pow2_factor (offset_iv.base));
- case SSA_NAME:
- if (!POINTER_TYPE_P (TREE_TYPE (expr)))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nnot pointer SSA_NAME ");
- print_generic_expr (dump_file, expr, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
- *aligned_to = ssize_int (TYPE_ALIGN_UNIT (TREE_TYPE (TREE_TYPE (expr))));
- *misalign = ssize_int (0);
- *offset = ssize_int (0);
- *step = ssize_int (0);
- return expr;
-
- default:
- return NULL_TREE;
- }
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "success.\n");
}
+/* Determines the base object and the list of indices of memory reference
+ DR, analysed in loop nest NEST. */
-/* Function object_analysis
-
- Create a data-reference structure DR for MEMREF.
- Return the BASE of the data reference MEMREF if the analysis is possible.
- Also compute the INITIAL_OFFSET from BASE, MISALIGN and STEP.
- E.g., for EXPR a.b[i] + 4B, BASE is a, and OFFSET is the overall offset
- 'a.b[i] + 4B' from a (can be an expression), MISALIGN is an OFFSET
- instantiated with initial_conditions of access_functions of variables,
- and STEP is the evolution of the DR_REF in this loop.
-
- Function get_inner_reference is used for the above in case of ARRAY_REF and
- COMPONENT_REF.
-
- The structure of the function is as follows:
- Part 1:
- Case 1. For handled_component_p refs
- 1.1 build data-reference structure for MEMREF
- 1.2 call get_inner_reference
- 1.2.1 analyze offset expr received from get_inner_reference
- (fall through with BASE)
- Case 2. For declarations
- 2.1 set MEMTAG
- Case 3. For INDIRECT_REFs
- 3.1 build data-reference structure for MEMREF
- 3.2 analyze evolution and initial condition of MEMREF
- 3.3 set data-reference structure for MEMREF
- 3.4 call address_analysis to analyze INIT of the access function
- 3.5 extract memory tag
-
- Part 2:
- Combine the results of object and address analysis to calculate
- INITIAL_OFFSET, STEP and misalignment info.
-
- Input:
- MEMREF - the memory reference that is being analyzed
- STMT - the statement that contains MEMREF
- IS_READ - TRUE if STMT reads from MEMREF, FALSE if writes to MEMREF
-
- Output:
- BASE_ADDRESS (returned value) - the base address of the data reference MEMREF
- E.g, if MEMREF is a.b[k].c[i][j] the returned
- base is &a.
- DR - data_reference struct for MEMREF
- INITIAL_OFFSET - initial offset of MEMREF from BASE (an expression)
- MISALIGN - offset of MEMREF from BASE in bytes (a constant) modulo alignment of
- ALIGNMENT or NULL_TREE if the computation is impossible
- ALIGNED_TO - maximum alignment of EXPR or NULL_TREE if MISALIGN can be
- calculated (doesn't depend on variables)
- STEP - evolution of the DR_REF in the loop
- MEMTAG - memory tag for aliasing purposes
- PTR_INFO - NULL or points-to aliasing info from a pointer SSA_NAME
- SUBVARS - Sub-variables of the variable
-
- If the analysis of MEMREF evolution in the loop fails, NULL_TREE is returned,
- but DR can be created anyway.
-
-*/
-
-static tree
-object_analysis (tree memref, tree stmt, bool is_read,
- struct data_reference **dr, tree *offset, tree *misalign,
- tree *aligned_to, tree *step, tree *memtag,
- struct ptr_info_def **ptr_info, subvar_t *subvars)
+static void
+dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
- tree base = NULL_TREE, base_address = NULL_TREE;
- tree object_offset = ssize_int (0), object_misalign = ssize_int (0);
- tree object_step = ssize_int (0), address_step = ssize_int (0);
- tree address_offset = ssize_int (0), address_misalign = ssize_int (0);
- HOST_WIDE_INT pbitsize, pbitpos;
- tree poffset, bit_pos_in_bytes;
- enum machine_mode pmode;
- int punsignedp, pvolatilep;
- tree ptr_step = ssize_int (0), ptr_init = NULL_TREE;
+ tree stmt = DR_STMT (dr);
struct loop *loop = loop_containing_stmt (stmt);
- struct data_reference *ptr_dr = NULL;
- tree object_aligned_to = NULL_TREE, address_aligned_to = NULL_TREE;
- tree comp_ref = NULL_TREE;
+ VEC (tree, heap) *access_fns = NULL;
+ tree ref = unshare_expr (DR_REF (dr)), aref = ref, op;
+ tree base, off, access_fn;
- *ptr_info = NULL;
-
- /* Part 1: */
- /* Case 1. handled_component_p refs. */
- if (handled_component_p (memref))
+ while (handled_component_p (aref))
{
- /* 1.1 build data-reference structure for MEMREF. */
- if (!(*dr))
- {
- if (TREE_CODE (memref) == ARRAY_REF)
- *dr = init_array_ref (stmt, memref, is_read);
- else if (TREE_CODE (memref) == COMPONENT_REF)
- comp_ref = memref;
- else
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\ndata-ref of unsupported type ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
- }
-
- /* 1.2 call get_inner_reference. */
- /* Find the base and the offset from it. */
- base = get_inner_reference (memref, &pbitsize, &pbitpos, &poffset,
- &pmode, &punsignedp, &pvolatilep, false);
- if (!base)
+ if (TREE_CODE (aref) == ARRAY_REF)
{
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nfailed to get inner ref for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
-
- /* 1.2.1 analyze offset expr received from get_inner_reference. */
- if (poffset
- && !analyze_offset_expr (poffset, loop, &object_offset,
- &object_misalign, &object_aligned_to,
- &object_step))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nfailed to compute offset or step for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
-
- /* Add bit position to OFFSET and MISALIGN. */
+ op = TREE_OPERAND (aref, 1);
+ access_fn = analyze_scalar_evolution (loop, op);
+ access_fn = resolve_mixers (nest, access_fn);
+ VEC_safe_push (tree, heap, access_fns, access_fn);
- bit_pos_in_bytes = ssize_int (pbitpos/BITS_PER_UNIT);
- /* Check that there is no remainder in bits. */
- if (pbitpos%BITS_PER_UNIT)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nbit offset alignment.\n");
- return NULL_TREE;
+ TREE_OPERAND (aref, 1) = build_int_cst (TREE_TYPE (op), 0);
}
- object_offset = size_binop (PLUS_EXPR, bit_pos_in_bytes, object_offset);
- if (object_misalign)
- object_misalign = size_binop (PLUS_EXPR, object_misalign,
- bit_pos_in_bytes);
- memref = base; /* To continue analysis of BASE. */
- /* fall through */
+ aref = TREE_OPERAND (aref, 0);
}
-
- /* Part 1: Case 2. Declarations. */
- if (DECL_P (memref))
- {
- /* We expect to get a decl only if we already have a DR, or with
- COMPONENT_REFs of type 'a[i].b'. */
- if (!(*dr))
- {
- if (comp_ref && TREE_CODE (TREE_OPERAND (comp_ref, 0)) == ARRAY_REF)
- {
- *dr = init_array_ref (stmt, TREE_OPERAND (comp_ref, 0), is_read);
- if (DR_NUM_DIMENSIONS (*dr) != 1)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\n multidimensional component ref ");
- print_generic_expr (dump_file, comp_ref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
- }
- else
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nunhandled decl ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
- }
- /* TODO: if during the analysis of INDIRECT_REF we get to an object, put
- the object in BASE_OBJECT field if we can prove that this is O.K.,
- i.e., the data-ref access is bounded by the bounds of the BASE_OBJECT.
- (e.g., if the object is an array base 'a', where 'a[N]', we must prove
- that every access with 'p' (the original INDIRECT_REF based on '&a')
- in the loop is within the array boundaries - from a[0] to a[N-1]).
- Otherwise, our alias analysis can be incorrect.
- Even if an access function based on BASE_OBJECT can't be build, update
- BASE_OBJECT field to enable us to prove that two data-refs are
- different (without access function, distance analysis is impossible).
- */
- if (SSA_VAR_P (memref) && var_can_have_subvars (memref))
- *subvars = get_subvars_for_var (memref);
- base_address = build_fold_addr_expr (memref);
- /* 2.1 set MEMTAG. */
- *memtag = memref;
- }
-
- /* Part 1: Case 3. INDIRECT_REFs. */
- else if (TREE_CODE (memref) == INDIRECT_REF)
+ if (INDIRECT_REF_P (aref))
{
- tree ptr_ref = TREE_OPERAND (memref, 0);
- if (TREE_CODE (ptr_ref) == SSA_NAME)
- *ptr_info = SSA_NAME_PTR_INFO (ptr_ref);
+ op = TREE_OPERAND (aref, 0);
+ access_fn = analyze_scalar_evolution (loop, op);
+ access_fn = resolve_mixers (nest, access_fn);
+ base = initial_condition (access_fn);
+ split_constant_offset (base, &base, &off);
+ access_fn = chrec_replace_initial_condition (access_fn,
+ fold_convert (TREE_TYPE (base), off));
+
+ TREE_OPERAND (aref, 0) = base;
+ VEC_safe_push (tree, heap, access_fns, access_fn);
+ }
- /* 3.1 build data-reference structure for MEMREF. */
- ptr_dr = analyze_indirect_ref (stmt, memref, is_read);
- if (!ptr_dr)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nfailed to create dr for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
+ DR_BASE_OBJECT (dr) = ref;
+ DR_ACCESS_FNS (dr) = access_fns;
+}
- /* 3.2 analyze evolution and initial condition of MEMREF. */
- ptr_step = DR_STEP (ptr_dr);
- ptr_init = DR_BASE_ADDRESS (ptr_dr);
- if (!ptr_init || !ptr_step || !POINTER_TYPE_P (TREE_TYPE (ptr_init)))
- {
- *dr = (*dr) ? *dr : ptr_dr;
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nbad pointer access ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
+/* Extracts the alias analysis information from the memory reference DR. */
- if (integer_zerop (ptr_step) && !(*dr))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nptr is loop invariant.\n");
- *dr = ptr_dr;
- return NULL_TREE;
-
- /* If there exists DR for MEMREF, we are analyzing the base of
- handled component (PTR_INIT), which not necessary has evolution in
- the loop. */
- }
- object_step = size_binop (PLUS_EXPR, object_step, ptr_step);
-
- /* 3.3 set data-reference structure for MEMREF. */
- if (!*dr)
- *dr = ptr_dr;
-
- /* 3.4 call address_analysis to analyze INIT of the access
- function. */
- base_address = address_analysis (ptr_init, stmt, is_read, *dr,
- &address_offset, &address_misalign,
- &address_aligned_to, &address_step);
- if (!base_address)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nfailed to analyze address ");
- print_generic_expr (dump_file, ptr_init, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL_TREE;
- }
-
- /* 3.5 extract memory tag. */
- switch (TREE_CODE (base_address))
- {
- case SSA_NAME:
- *memtag = symbol_mem_tag (SSA_NAME_VAR (base_address));
- if (!(*memtag) && TREE_CODE (TREE_OPERAND (memref, 0)) == SSA_NAME)
- *memtag = symbol_mem_tag (SSA_NAME_VAR (TREE_OPERAND (memref, 0)));
- break;
- case ADDR_EXPR:
- *memtag = TREE_OPERAND (base_address, 0);
- break;
- default:
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\nno memtag for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- *memtag = NULL_TREE;
- break;
- }
- }
-
- if (!base_address)
+static void
+dr_analyze_alias (struct data_reference *dr)
+{
+ tree stmt = DR_STMT (dr);
+ tree ref = DR_REF (dr);
+ tree base = get_base_address (ref), addr, smt = NULL_TREE;
+ ssa_op_iter it;
+ tree op;
+ bitmap vops;
+
+ if (DECL_P (base))
+ smt = base;
+ else if (INDIRECT_REF_P (base))
{
- /* MEMREF cannot be analyzed. */
- if (dump_file && (dump_flags & TDF_DETAILS))
+ addr = TREE_OPERAND (base, 0);
+ if (TREE_CODE (addr) == SSA_NAME)
{
- fprintf (dump_file, "\ndata-ref of unsupported type ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
+ smt = symbol_mem_tag (SSA_NAME_VAR (addr));
+ DR_PTR_INFO (dr) = SSA_NAME_PTR_INFO (addr);
}
- return NULL_TREE;
}
- if (comp_ref)
- DR_REF (*dr) = comp_ref;
-
- if (SSA_VAR_P (*memtag) && var_can_have_subvars (*memtag))
- *subvars = get_subvars_for_var (*memtag);
-
- /* Part 2: Combine the results of object and address analysis to calculate
- INITIAL_OFFSET, STEP and misalignment info. */
- *offset = size_binop (PLUS_EXPR, object_offset, address_offset);
+ DR_SYMBOL_TAG (dr) = smt;
+ if (var_can_have_subvars (smt))
+ DR_SUBVARS (dr) = get_subvars_for_var (smt);
- if ((!object_misalign && !object_aligned_to)
- || (!address_misalign && !address_aligned_to))
+ vops = BITMAP_ALLOC (NULL);
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, it, SSA_OP_VIRTUAL_USES)
{
- *misalign = NULL_TREE;
- *aligned_to = NULL_TREE;
- }
- else
- {
- if (object_misalign && address_misalign)
- *misalign = size_binop (PLUS_EXPR, object_misalign, address_misalign);
- else
- *misalign = object_misalign ? object_misalign : address_misalign;
- if (object_aligned_to && address_aligned_to)
- *aligned_to = size_binop (MIN_EXPR, object_aligned_to,
- address_aligned_to);
- else
- *aligned_to = object_aligned_to ?
- object_aligned_to : address_aligned_to;
+ bitmap_set_bit (vops, DECL_UID (SSA_NAME_VAR (op)));
}
- *step = size_binop (PLUS_EXPR, object_step, address_step);
- return base_address;
+ DR_VOPS (dr) = vops;
}
-/* Function analyze_offset.
-
- Extract INVARIANT and CONSTANT parts from OFFSET.
+/* Returns true if the address of DR is invariant. */
-*/
-static bool
-analyze_offset (tree offset, tree *invariant, tree *constant)
+static bool
+dr_address_invariant_p (struct data_reference *dr)
{
- tree op0, op1, constant_0, constant_1, invariant_0, invariant_1;
- enum tree_code code = TREE_CODE (offset);
-
- *invariant = NULL_TREE;
- *constant = NULL_TREE;
-
- /* Not PLUS/MINUS expression - recursion stop condition. */
- if (code != PLUS_EXPR && code != MINUS_EXPR)
- {
- if (TREE_CODE (offset) == INTEGER_CST)
- *constant = offset;
- else
- *invariant = offset;
- return true;
- }
-
- op0 = TREE_OPERAND (offset, 0);
- op1 = TREE_OPERAND (offset, 1);
-
- /* Recursive call with the operands. */
- if (!analyze_offset (op0, &invariant_0, &constant_0)
- || !analyze_offset (op1, &invariant_1, &constant_1))
- return false;
+ unsigned i;
+ tree idx;
- /* Combine the results. Add negation to the subtrahend in case of
- subtraction. */
- if (constant_0 && constant_1)
- return false;
- *constant = constant_0 ? constant_0 : constant_1;
- if (code == MINUS_EXPR && constant_1)
- *constant = fold_build1 (NEGATE_EXPR, TREE_TYPE (*constant), *constant);
+ for (i = 0; VEC_iterate (tree, DR_ACCESS_FNS (dr), i, idx); i++)
+ if (tree_contains_chrecs (idx, NULL))
+ return false;
- if (invariant_0 && invariant_1)
- *invariant =
- fold_build2 (code, TREE_TYPE (invariant_0), invariant_0, invariant_1);
- else
- {
- *invariant = invariant_0 ? invariant_0 : invariant_1;
- if (code == MINUS_EXPR && invariant_1)
- *invariant =
- fold_build1 (NEGATE_EXPR, TREE_TYPE (*invariant), *invariant);
- }
return true;
}
-/* Free the memory used by the data reference DR. */
+/* Frees data reference DR. */
static void
free_data_ref (data_reference_p dr)
{
- DR_FREE_ACCESS_FNS (dr);
+ BITMAP_FREE (DR_VOPS (dr));
+ VEC_free (tree, heap, DR_ACCESS_FNS (dr));
free (dr);
}
-/* Function create_data_ref.
-
- Create a data-reference structure for MEMREF. Set its DR_BASE_ADDRESS,
- DR_OFFSET, DR_INIT, DR_STEP, DR_OFFSET_MISALIGNMENT, DR_ALIGNED_TO,
- DR_MEMTAG, and DR_POINTSTO_INFO fields.
-
- Input:
- MEMREF - the memory reference that is being analyzed
- STMT - the statement that contains MEMREF
- IS_READ - TRUE if STMT reads from MEMREF, FALSE if writes to MEMREF
-
- Output:
- DR (returned value) - data_reference struct for MEMREF
-*/
+/* Analyzes memory reference MEMREF accessed in STMT. The reference
+ is read if IS_READ is true, write otherwise. Returns the
+ data_reference description of MEMREF. NEST is the outermost loop of the
+ loop nest in that the reference should be analysed. */
static struct data_reference *
-create_data_ref (tree memref, tree stmt, bool is_read)
+create_data_ref (struct loop *nest, tree memref, tree stmt, bool is_read)
{
- struct data_reference *dr = NULL;
- tree base_address, offset, step, misalign, memtag;
- struct loop *loop = loop_containing_stmt (stmt);
- tree invariant = NULL_TREE, constant = NULL_TREE;
- tree type_size, init_cond;
- struct ptr_info_def *ptr_info;
- subvar_t subvars = NULL;
- tree aligned_to, type = NULL_TREE, orig_offset;
-
- if (!memref)
- return NULL;
-
- base_address = object_analysis (memref, stmt, is_read, &dr, &offset,
- &misalign, &aligned_to, &step, &memtag,
- &ptr_info, &subvars);
- if (!dr || !base_address)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\ncreate_data_ref: failed to create a dr for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL;
- }
+ struct data_reference *dr;
- DR_BASE_ADDRESS (dr) = base_address;
- DR_OFFSET (dr) = offset;
- DR_INIT (dr) = ssize_int (0);
- DR_STEP (dr) = step;
- DR_OFFSET_MISALIGNMENT (dr) = misalign;
- DR_ALIGNED_TO (dr) = aligned_to;
- DR_MEMTAG (dr) = memtag;
- DR_PTR_INFO (dr) = ptr_info;
- DR_SUBVARS (dr) = subvars;
-
- type_size = fold_convert (ssizetype, TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr))));
-
- /* Extract CONSTANT and INVARIANT from OFFSET. */
- /* Remove cast from OFFSET and restore it for INVARIANT part. */
- orig_offset = offset;
- STRIP_NOPS (offset);
- if (offset != orig_offset)
- type = TREE_TYPE (orig_offset);
- if (!analyze_offset (offset, &invariant, &constant))
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\ncreate_data_ref: failed to analyze dr's");
- fprintf (dump_file, " offset for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return NULL;
+ fprintf (dump_file, "Creating dr for ");
+ print_generic_expr (dump_file, memref, TDF_SLIM);
+ fprintf (dump_file, "\n");
}
- if (type && invariant)
- invariant = fold_convert (type, invariant);
- /* Put CONSTANT part of OFFSET in DR_INIT and INVARIANT in DR_OFFSET field
- of DR. */
- if (constant)
- {
- DR_INIT (dr) = fold_convert (ssizetype, constant);
- init_cond = fold_build2 (TRUNC_DIV_EXPR, TREE_TYPE (constant),
- constant, type_size);
- }
- else
- DR_INIT (dr) = init_cond = ssize_int (0);
+ dr = XCNEW (struct data_reference);
+ DR_STMT (dr) = stmt;
+ DR_REF (dr) = memref;
+ DR_IS_READ (dr) = is_read;
- if (invariant)
- DR_OFFSET (dr) = invariant;
- else
- DR_OFFSET (dr) = ssize_int (0);
-
- /* Change the access function for INIDIRECT_REFs, according to
- DR_BASE_ADDRESS. Analyze OFFSET calculated in object_analysis. OFFSET is
- an expression that can contain loop invariant expressions and constants.
- We put the constant part in the initial condition of the access function
- (for data dependence tests), and in DR_INIT of the data-ref. The loop
- invariant part is put in DR_OFFSET.
- The evolution part of the access function is STEP calculated in
- object_analysis divided by the size of data type.
- */
- if (!DR_BASE_OBJECT (dr)
- || (TREE_CODE (memref) == COMPONENT_REF && DR_NUM_DIMENSIONS (dr) == 1))
- {
- tree access_fn;
- tree new_step;
-
- /* Update access function. */
- access_fn = DR_ACCESS_FN (dr, 0);
- if (automatically_generated_chrec_p (access_fn))
- {
- free_data_ref (dr);
- return NULL;
- }
-
- new_step = size_binop (TRUNC_DIV_EXPR,
- fold_convert (ssizetype, step), type_size);
-
- init_cond = chrec_convert (chrec_type (access_fn), init_cond, stmt);
- new_step = chrec_convert (chrec_type (access_fn), new_step, stmt);
- if (automatically_generated_chrec_p (init_cond)
- || automatically_generated_chrec_p (new_step))
- {
- free_data_ref (dr);
- return NULL;
- }
- access_fn = chrec_replace_initial_condition (access_fn, init_cond);
- access_fn = reset_evolution_in_loop (loop->num, access_fn, new_step);
-
- VEC_replace (tree, DR_ACCESS_FNS (dr), 0, access_fn);
- }
+ dr_analyze_innermost (dr);
+ dr_analyze_indices (dr, nest);
+ dr_analyze_alias (dr);
if (dump_file && (dump_flags & TDF_DETAILS))
{
- struct ptr_info_def *pi = DR_PTR_INFO (dr);
-
- fprintf (dump_file, "\nCreated dr for ");
- print_generic_expr (dump_file, memref, TDF_SLIM);
- fprintf (dump_file, "\n\tbase_address: ");
+ fprintf (dump_file, "\tbase_address: ");
print_generic_expr (dump_file, DR_BASE_ADDRESS (dr), TDF_SLIM);
fprintf (dump_file, "\n\toffset from base address: ");
print_generic_expr (dump_file, DR_OFFSET (dr), TDF_SLIM);
fprintf (dump_file, "\n\tconstant offset from base address: ");
print_generic_expr (dump_file, DR_INIT (dr), TDF_SLIM);
- fprintf (dump_file, "\n\tbase_object: ");
- print_generic_expr (dump_file, DR_BASE_OBJECT (dr), TDF_SLIM);
fprintf (dump_file, "\n\tstep: ");
print_generic_expr (dump_file, DR_STEP (dr), TDF_SLIM);
- fprintf (dump_file, "B\n\tmisalignment from base: ");
- print_generic_expr (dump_file, DR_OFFSET_MISALIGNMENT (dr), TDF_SLIM);
- if (DR_OFFSET_MISALIGNMENT (dr))
- fprintf (dump_file, "B");
- if (DR_ALIGNED_TO (dr))
- {
- fprintf (dump_file, "\n\taligned to: ");
- print_generic_expr (dump_file, DR_ALIGNED_TO (dr), TDF_SLIM);
- }
- fprintf (dump_file, "\n\tmemtag: ");
- print_generic_expr (dump_file, DR_MEMTAG (dr), TDF_SLIM);
+ fprintf (dump_file, "\n\taligned to: ");
+ print_generic_expr (dump_file, DR_ALIGNED_TO (dr), TDF_SLIM);
+ fprintf (dump_file, "\n\tbase_object: ");
+ print_generic_expr (dump_file, DR_BASE_OBJECT (dr), TDF_SLIM);
+ fprintf (dump_file, "\n\tsymbol tag: ");
+ print_generic_expr (dump_file, DR_SYMBOL_TAG (dr), TDF_SLIM);
fprintf (dump_file, "\n");
- if (pi && pi->name_mem_tag)
- {
- fprintf (dump_file, "\n\tnametag: ");
- print_generic_expr (dump_file, pi->name_mem_tag, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- }
+ }
+
+ /* FIXME -- data dependence analysis does not work correctly for objects with
+ invariant addresses. Let us fail here until the problem is fixed. */
+ if (dr_address_invariant_p (dr))
+ {
+ free_data_ref (dr);
+ dr = NULL;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\tFAILED as dr address is invariant\n");
+ }
+
return dr;
}
@@ -2259,6 +1014,180 @@ conflict_fn_no_dependence (void)
return fn;
}
+/* Returns true if the address of OBJ is invariant in LOOP. */
+
+static bool
+object_address_invariant_in_loop_p (struct loop *loop, tree obj)
+{
+ while (handled_component_p (obj))
+ {
+ if (TREE_CODE (obj) == ARRAY_REF)
+ {
+ /* Index of the ARRAY_REF was zeroed in analyze_indices, thus we only
+ need to check the stride and the lower bound of the reference. */
+ if (chrec_contains_symbols_defined_in_loop (TREE_OPERAND (obj, 2),
+ loop->num)
+ || chrec_contains_symbols_defined_in_loop (TREE_OPERAND (obj, 3),
+ loop->num))
+ return false;
+ }
+ else if (TREE_CODE (obj) == COMPONENT_REF)
+ {
+ if (chrec_contains_symbols_defined_in_loop (TREE_OPERAND (obj, 2),
+ loop->num))
+ return false;
+ }
+ obj = TREE_OPERAND (obj, 0);
+ }
+
+ if (!INDIRECT_REF_P (obj))
+ return true;
+
+ return !chrec_contains_symbols_defined_in_loop (TREE_OPERAND (obj, 0),
+ loop->num);
+}
+
+/* Returns true if A and B are accesses to different objects, or to different
+ fields of the same object. */
+
+static bool
+disjoint_objects_p (tree a, tree b)
+{
+ tree base_a, base_b;
+ VEC (tree, heap) *comp_a = NULL, *comp_b = NULL;
+ bool ret;
+
+ base_a = get_base_address (a);
+ base_b = get_base_address (b);
+
+ if (DECL_P (base_a)
+ && DECL_P (base_b)
+ && base_a != base_b)
+ return true;
+
+ if (!operand_equal_p (base_a, base_b, 0))
+ return false;
+
+ /* Compare the component references of A and B. We must start from the inner
+ ones, so record them to the vector first. */
+ while (handled_component_p (a))
+ {
+ VEC_safe_push (tree, heap, comp_a, a);
+ a = TREE_OPERAND (a, 0);
+ }
+ while (handled_component_p (b))
+ {
+ VEC_safe_push (tree, heap, comp_b, b);
+ b = TREE_OPERAND (b, 0);
+ }
+
+ ret = false;
+ while (1)
+ {
+ if (VEC_length (tree, comp_a) == 0
+ || VEC_length (tree, comp_b) == 0)
+ break;
+
+ a = VEC_pop (tree, comp_a);
+ b = VEC_pop (tree, comp_b);
+
+ /* Real and imaginary part of a variable do not alias. */
+ if ((TREE_CODE (a) == REALPART_EXPR
+ && TREE_CODE (b) == IMAGPART_EXPR)
+ || (TREE_CODE (a) == IMAGPART_EXPR
+ && TREE_CODE (b) == REALPART_EXPR))
+ {
+ ret = true;
+ break;
+ }
+
+ if (TREE_CODE (a) != TREE_CODE (b))
+ break;
+
+ /* Nothing to do for ARRAY_REFs, as the indices of array_refs in
+ DR_BASE_OBJECT are always zero. */
+ if (TREE_CODE (a) == ARRAY_REF)
+ continue;
+ else if (TREE_CODE (a) == COMPONENT_REF)
+ {
+ if (operand_equal_p (TREE_OPERAND (a, 1), TREE_OPERAND (b, 1), 0))
+ continue;
+
+ /* Different fields of unions may overlap. */
+ base_a = TREE_OPERAND (a, 0);
+ if (TREE_CODE (TREE_TYPE (base_a)) == UNION_TYPE)
+ break;
+
+ /* Different fields of structures cannot. */
+ ret = true;
+ break;
+ }
+ else
+ break;
+ }
+
+ VEC_free (tree, heap, comp_a);
+ VEC_free (tree, heap, comp_b);
+
+ return ret;
+}
+
+/* Returns false if we can prove that data references A and B do not alias,
+ true otherwise. */
+
+static bool
+dr_may_alias_p (struct data_reference *a, struct data_reference *b)
+{
+ tree addr_a = DR_BASE_ADDRESS (a);
+ tree addr_b = DR_BASE_ADDRESS (b);
+ tree type_a, type_b;
+ tree decl_a = NULL_TREE, decl_b = NULL_TREE;
+
+ /* If the sets of virtual operands are disjoint, the memory references do not
+ alias. */
+ if (!bitmap_intersect_p (DR_VOPS (a), DR_VOPS (b)))
+ return false;
+
+ /* If the accessed objects are disjoint, the memory references do not
+ alias. */
+ if (disjoint_objects_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b)))
+ return false;
+
+ if (!addr_a || !addr_b)
+ return true;
+
+ /* If the references are based on different static objects, they cannot alias
+ (PTA should be able to disambiguate such accesses, but often it fails to,
+ since currently we cannot distinguish between pointer and offset in pointer
+ arithmetics). */
+ if (TREE_CODE (addr_a) == ADDR_EXPR
+ && TREE_CODE (addr_b) == ADDR_EXPR)
+ return TREE_OPERAND (addr_a, 0) == TREE_OPERAND (addr_b, 0);
+
+ /* An instruction writing through a restricted pointer is "independent" of any
+ instruction reading or writing through a different restricted pointer,
+ in the same block/scope. */
+
+ type_a = TREE_TYPE (addr_a);
+ type_b = TREE_TYPE (addr_b);
+ gcc_assert (POINTER_TYPE_P (type_a) && POINTER_TYPE_P (type_b));
+
+ if (TREE_CODE (addr_a) == SSA_NAME)
+ decl_a = SSA_NAME_VAR (addr_a);
+ if (TREE_CODE (addr_b) == SSA_NAME)
+ decl_b = SSA_NAME_VAR (addr_b);
+
+ if (TYPE_RESTRICT (type_a) && TYPE_RESTRICT (type_b)
+ && (!DR_IS_READ (a) || !DR_IS_READ (b))
+ && decl_a && TREE_CODE (decl_a) == PARM_DECL
+ && decl_b && TREE_CODE (decl_b) == PARM_DECL
+ && TREE_CODE (DECL_CONTEXT (decl_a)) == FUNCTION_DECL
+ && DECL_CONTEXT (decl_a) == DECL_CONTEXT (decl_b))
+ return false;
+
+ return true;
+}
+
/* Initialize a data dependence relation between data accesses A and
B. NB_LOOPS is the number of loops surrounding the references: the
size of the classic distance/direction vectors. */
@@ -2269,7 +1198,6 @@ initialize_data_dependence_relation (struct data_reference *a,
VEC (loop_p, heap) *loop_nest)
{
struct data_dependence_relation *res;
- bool differ_p, known_dependence;
unsigned int i;
res = XNEW (struct data_dependence_relation);
@@ -2283,34 +1211,33 @@ initialize_data_dependence_relation (struct data_reference *a,
return res;
}
- /* When A and B are arrays and their dimensions differ, we directly
- initialize the relation to "there is no dependence": chrec_known. */
- if (DR_BASE_OBJECT (a) && DR_BASE_OBJECT (b)
- && DR_NUM_DIMENSIONS (a) != DR_NUM_DIMENSIONS (b))
+ /* If the data references do not alias, then they are independent. */
+ if (!dr_may_alias_p (a, b))
{
- DDR_ARE_DEPENDENT (res) = chrec_known;
+ DDR_ARE_DEPENDENT (res) = chrec_known;
return res;
}
- if (DR_BASE_ADDRESS (a) && DR_BASE_ADDRESS (b))
- known_dependence = base_addr_differ_p (a, b, &differ_p);
- else
- known_dependence = base_object_differ_p (a, b, &differ_p);
-
- if (!known_dependence)
+ /* If the references do not access the same object, we do not know
+ whether they alias or not. */
+ if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), 0))
{
- /* Can't determine whether the data-refs access the same memory
- region. */
DDR_ARE_DEPENDENT (res) = chrec_dont_know;
return res;
}
- if (differ_p)
+ /* If the base of the object is not invariant in the loop nest, we cannot
+ analyse it. TODO -- in fact, it would suffice to record that there may
+ be arbitrary depencences in the loops where the base object varies. */
+ if (!object_address_invariant_in_loop_p (VEC_index (loop_p, loop_nest, 0),
+ DR_BASE_OBJECT (a)))
{
- DDR_ARE_DEPENDENT (res) = chrec_known;
+ DDR_ARE_DEPENDENT (res) = chrec_dont_know;
return res;
}
-
+
+ gcc_assert (DR_NUM_DIMENSIONS (a) == DR_NUM_DIMENSIONS (b));
+
DDR_AFFINE_P (res) = true;
DDR_ARE_DEPENDENT (res) = NULL_TREE;
DDR_SUBSCRIPTS (res) = VEC_alloc (subscript_p, heap, DR_NUM_DIMENSIONS (a));
@@ -4895,6 +3822,9 @@ compute_self_dependence (struct data_dependence_relation *ddr)
unsigned int i;
struct subscript *subscript;
+ if (DDR_ARE_DEPENDENT (ddr) != NULL_TREE)
+ return;
+
for (i = 0; VEC_iterate (subscript_p, DDR_SUBSCRIPTS (ddr), i, subscript);
i++)
{
@@ -5013,10 +3943,11 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
}
/* Stores the data references in STMT to DATAREFS. If there is an unanalyzable
- reference, returns false, otherwise returns true. */
+ reference, returns false, otherwise returns true. NEST is the outermost
+ loop of the loop nest in that the references should be analysed. */
static bool
-find_data_references_in_stmt (tree stmt,
+find_data_references_in_stmt (struct loop *nest, tree stmt,
VEC (data_reference_p, heap) **datarefs)
{
unsigned i;
@@ -5033,7 +3964,7 @@ find_data_references_in_stmt (tree stmt,
for (i = 0; VEC_iterate (data_ref_loc, references, i, ref); i++)
{
- dr = create_data_ref (*ref->pos, stmt, ref->is_read);
+ dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read);
if (dr)
VEC_safe_push (data_reference_p, heap, *datarefs, dr);
else
@@ -5049,11 +3980,11 @@ find_data_references_in_stmt (tree stmt,
/* Search the data references in LOOP, and record the information into
DATAREFS. Returns chrec_dont_know when failing to analyze a
difficult case, returns NULL_TREE otherwise.
-
+
TODO: This function should be made smarter so that it can handle address
arithmetic as if they were array accesses, etc. */
-tree
+static tree
find_data_references_in_loop (struct loop *loop,
VEC (data_reference_p, heap) **datarefs)
{
@@ -5071,24 +4002,10 @@ find_data_references_in_loop (struct loop *loop,
{
tree stmt = bsi_stmt (bsi);
- if (!find_data_references_in_stmt (stmt, datarefs))
+ if (!find_data_references_in_stmt (loop, stmt, datarefs))
{
struct data_reference *res;
- res = XNEW (struct data_reference);
- DR_STMT (res) = NULL_TREE;
- DR_REF (res) = NULL_TREE;
- DR_BASE_OBJECT (res) = NULL;
- DR_TYPE (res) = ARRAY_REF_TYPE;
- DR_SET_ACCESS_FNS (res, NULL);
- DR_BASE_OBJECT (res) = NULL;
- DR_IS_READ (res) = false;
- DR_BASE_ADDRESS (res) = NULL_TREE;
- DR_OFFSET (res) = NULL_TREE;
- DR_INIT (res) = NULL_TREE;
- DR_STEP (res) = NULL_TREE;
- DR_OFFSET_MISALIGNMENT (res) = NULL_TREE;
- DR_MEMTAG (res) = NULL_TREE;
- DR_PTR_INFO (res) = NULL;
+ res = XCNEW (struct data_reference);
VEC_safe_push (data_reference_p, heap, *datarefs, res);
free (bbs);
@@ -5155,7 +4072,6 @@ compute_data_dependences_for_loop (struct loop *loop,
VEC (data_reference_p, heap) **datarefs,
VEC (ddr_p, heap) **dependence_relations)
{
- struct loop *loop_nest = loop;
VEC (loop_p, heap) *vloops = VEC_alloc (loop_p, heap, 3);
memset (&dependence_stats, 0, sizeof (dependence_stats));
@@ -5163,8 +4079,8 @@ compute_data_dependences_for_loop (struct loop *loop,
/* If the loop nest is not well formed, or one of the data references
is not computable, give up without spending time to compute other
dependences. */
- if (!loop_nest
- || !find_loop_nest (loop_nest, &vloops)
+ if (!loop
+ || !find_loop_nest (loop, &vloops)
|| find_data_references_in_loop (loop, datarefs) == chrec_dont_know)
{
struct data_dependence_relation *ddr;
@@ -5287,12 +4203,8 @@ analyze_all_data_dependences (struct loop *loop)
{
struct data_reference *a = DDR_A (ddr);
struct data_reference *b = DDR_B (ddr);
- bool differ_p;
-
- if ((DR_BASE_OBJECT (a) && DR_BASE_OBJECT (b)
- && DR_NUM_DIMENSIONS (a) != DR_NUM_DIMENSIONS (b))
- || (base_object_differ_p (a, b, &differ_p)
- && differ_p))
+
+ if (!bitmap_intersect_p (DR_VOPS (a), DR_VOPS (b)))
nb_basename_differ++;
else
nb_bot_relations++;
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index e339d9844e5..2edee2c7716 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -26,48 +26,73 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "omega.h"
/*
- The first location accessed by data-ref in the loop is the address of data-ref's
- base (BASE_ADDRESS) plus the initial offset from the base. We divide the initial offset
- into two parts: loop invariant offset (OFFSET) and constant offset (INIT).
- STEP is the stride of data-ref in the loop in bytes.
+ innermost_loop_behavior describes the evolution of the address of the memory
+ reference in the innermost enclosing loop. The address is expressed as
+ BASE + STEP * # of iteration, and base is further decomposed as the base
+ pointer (BASE_ADDRESS), loop invariant offset (OFFSET) and
+ constant offset (INIT). Examples, in loop nest
+
+ for (i = 0; i < 100; i++)
+ for (j = 3; j < 100; j++)
Example 1 Example 2
- data-ref a[j].b[i][j] a + x + 16B (a is int*)
+ data-ref a[j].b[i][j] *(p + x + 16B + 4B * j)
- First location info:
- base_address &a a
- offset j_0*D_j + i_0*D_i x
- init C_b + C_a 16
+ innermost_loop_behavior
+ base_address &a p
+ offset i * D_i x
+ init 3 * D_j + offsetof (b) 28
step D_j 4
- access_fn NULL {16, +, 1}
-
- Base object info:
- base_object a NULL
- access_fn <access_fns of indexes of b> NULL
*/
-struct first_location_in_loop
+struct innermost_loop_behavior
{
tree base_address;
tree offset;
tree init;
tree step;
- /* Access function related to first location in the loop. */
- VEC(tree,heap) *access_fns;
+
+ /* Alignment information. ALIGNED_TO is set to the largest power of two
+ that divides OFFSET. */
+ tree aligned_to;
};
-struct base_object_info
+/* Describes the evolutions of indices of the memory reference. The indices
+ are indices of the ARRAY_REFs and the operands of INDIRECT_REFs.
+ For ARRAY_REFs, BASE_OBJECT is the reference with zeroed indices
+ (note that this reference does not have to be valid, if zero does not
+ belong to the range of the array; hence it is not recommended to use
+ BASE_OBJECT in any code generation). For INDIRECT_REFs, the address is
+ set to the loop-invariant part of the address of the object, except for
+ the constant offset. For the examples above,
+
+ base_object: a[0].b[0][0] *(p + x + 4B * j_0)
+ indices: {j_0, +, 1}_2 {16, +, 4}_2
+ {i_0, +, 1}_1
+ {j_0, +, 1}_2
+*/
+
+struct indices
{
/* The object. */
tree base_object;
- /* A list of chrecs. Access functions related to BASE_OBJECT. */
+ /* A list of chrecs. Access functions of the indices. */
VEC(tree,heap) *access_fns;
};
-enum data_ref_type {
- ARRAY_REF_TYPE,
- POINTER_REF_TYPE
+struct dr_alias
+{
+ /* The alias information that should be used for new pointers to this
+ location. SYMBOL_TAG is either a DECL or a SYMBOL_MEMORY_TAG. */
+ tree symbol_tag;
+ subvar_t subvars;
+ struct ptr_info_def *ptr_info;
+
+ /* The set of virtual operands corresponding to this memory reference,
+ serving as a description of the alias information for the memory
+ reference. This could be eliminated if we had alias oracle. */
+ bitmap vops;
};
struct data_reference
@@ -75,7 +100,7 @@ struct data_reference
/* A pointer to the statement that contains this DR. */
tree stmt;
- /* A pointer to the ARRAY_REF node. */
+ /* A pointer to the memory reference. */
tree ref;
/* Auxiliary info specific to a pass. */
@@ -84,58 +109,14 @@ struct data_reference
/* True when the data reference is in RHS of a stmt. */
bool is_read;
- /* First location accessed by the data-ref in the loop. */
- struct first_location_in_loop first_location;
+ /* Behavior of the memory reference in the innermost loop. */
+ struct innermost_loop_behavior innermost;
- /* Base object related info. */
- struct base_object_info object_info;
+ /* Decomposition to indices for alias analysis. */
+ struct indices indices;
- /* Aliasing information. This field represents the symbol that
- should be aliased by a pointer holding the address of this data
- reference. If the original data reference was a pointer
- dereference, then this field contains the memory tag that should
- be used by the new vector-pointer. */
- tree memtag;
- struct ptr_info_def *ptr_info;
- subvar_t subvars;
-
- /* Alignment information.
- MISALIGNMENT is the offset of the data-reference from its base in bytes.
- ALIGNED_TO is the maximum data-ref's alignment.
-
- Example 1,
- for i
- for (j = 3; j < N; j++)
- a[j].b[i][j] = 0;
-
- For a[j].b[i][j], the offset from base (calculated in get_inner_reference()
- will be 'i * C_i + j * C_j + C'.
- We try to substitute the variables of the offset expression
- with initial_condition of the corresponding access_fn in the loop.
- 'i' cannot be substituted, since its access_fn in the inner loop is i. 'j'
- will be substituted with 3.
-
- Example 2
- for (j = 3; j < N; j++)
- a[j].b[5][j] = 0;
-
- Here the offset expression (j * C_j + C) will not contain variables after
- substitution of j=3 (3*C_j + C).
-
- Misalignment can be calculated only if all the variables can be
- substituted with constants, otherwise, we record maximum possible alignment
- in ALIGNED_TO. In Example 1, since 'i' cannot be substituted,
- MISALIGNMENT will be NULL_TREE, and the biggest divider of C_i (a power of
- 2) will be recorded in ALIGNED_TO.
-
- In Example 2, MISALIGNMENT will be the value of 3*C_j + C in bytes, and
- ALIGNED_TO will be NULL_TREE.
- */
- tree misalignment;
- tree aligned_to;
-
- /* The type of the data-ref. */
- enum data_ref_type type;
+ /* Alias information for the data reference. */
+ struct dr_alias alias;
};
typedef struct data_reference *data_reference_p;
@@ -144,37 +125,20 @@ DEF_VEC_ALLOC_P (data_reference_p, heap);
#define DR_STMT(DR) (DR)->stmt
#define DR_REF(DR) (DR)->ref
-#define DR_BASE_OBJECT(DR) (DR)->object_info.base_object
-#define DR_TYPE(DR) (DR)->type
-#define DR_ACCESS_FNS(DR)\
- (DR_TYPE(DR) == ARRAY_REF_TYPE ? \
- (DR)->object_info.access_fns : (DR)->first_location.access_fns)
+#define DR_BASE_OBJECT(DR) (DR)->indices.base_object
+#define DR_ACCESS_FNS(DR) (DR)->indices.access_fns
#define DR_ACCESS_FN(DR, I) VEC_index (tree, DR_ACCESS_FNS (DR), I)
#define DR_NUM_DIMENSIONS(DR) VEC_length (tree, DR_ACCESS_FNS (DR))
#define DR_IS_READ(DR) (DR)->is_read
-#define DR_BASE_ADDRESS(DR) (DR)->first_location.base_address
-#define DR_OFFSET(DR) (DR)->first_location.offset
-#define DR_INIT(DR) (DR)->first_location.init
-#define DR_STEP(DR) (DR)->first_location.step
-#define DR_MEMTAG(DR) (DR)->memtag
-#define DR_ALIGNED_TO(DR) (DR)->aligned_to
-#define DR_OFFSET_MISALIGNMENT(DR) (DR)->misalignment
-#define DR_PTR_INFO(DR) (DR)->ptr_info
-#define DR_SUBVARS(DR) (DR)->subvars
-#define DR_SET_ACCESS_FNS(DR, ACC_FNS) \
-{ \
- if (DR_TYPE(DR) == ARRAY_REF_TYPE) \
- (DR)->object_info.access_fns = ACC_FNS; \
- else \
- (DR)->first_location.access_fns = ACC_FNS; \
-}
-#define DR_FREE_ACCESS_FNS(DR) \
-{ \
- if (DR_TYPE(DR) == ARRAY_REF_TYPE) \
- VEC_free (tree, heap, (DR)->object_info.access_fns); \
- else \
- VEC_free (tree, heap, (DR)->first_location.access_fns); \
-}
+#define DR_BASE_ADDRESS(DR) (DR)->innermost.base_address
+#define DR_OFFSET(DR) (DR)->innermost.offset
+#define DR_INIT(DR) (DR)->innermost.init
+#define DR_STEP(DR) (DR)->innermost.step
+#define DR_SYMBOL_TAG(DR) (DR)->alias.symbol_tag
+#define DR_PTR_INFO(DR) (DR)->alias.ptr_info
+#define DR_SUBVARS(DR) (DR)->alias.subvars
+#define DR_VOPS(DR) (DR)->alias.vops
+#define DR_ALIGNED_TO(DR) (DR)->innermost.aligned_to
enum data_dependence_direction {
dir_positive,
@@ -335,8 +299,6 @@ DEF_VEC_O (data_ref_loc);
DEF_VEC_ALLOC_O (data_ref_loc, heap);
bool get_references_in_stmt (tree, VEC (data_ref_loc, heap) **);
-extern tree find_data_references_in_loop (struct loop *,
- VEC (data_reference_p, heap) **);
extern void compute_data_dependences_for_loop (struct loop *, bool,
VEC (data_reference_p, heap) **,
VEC (ddr_p, heap) **);
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index ea8f378d2d1..16f71df2028 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -803,7 +803,7 @@ static const struct dump_option_value_info dump_options[] =
{"stmtaddr", TDF_STMTADDR},
{"memsyms", TDF_MEMSYMS},
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
- | TDF_STMTADDR | TDF_GRAPH)},
+ | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC)},
{NULL, 0}
};
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index d308299897f..156ae13b43b 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -860,6 +860,8 @@ extern void debug_all_mem_sym_stats (void);
definition, a function with this prototype is called. */
typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
+/* In tree-ssa-alias-warnings.c */
+extern void strict_aliasing_warning_backend (void);
/* In tree-ssa.c */
extern void init_tree_ssa (void);
@@ -1111,7 +1113,7 @@ bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode);
unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode);
/* In tree-ssa-threadupdate.c. */
-extern bool thread_through_all_blocks (void);
+extern bool thread_through_all_blocks (bool);
extern void register_jump_thread (edge, edge);
/* In gimplify.c */
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a6dfc683d59..799b4f3fb6e 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2148,8 +2148,11 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case VEC_WIDEN_MULT_LO_EXPR:
case VEC_UNPACK_HI_EXPR:
case VEC_UNPACK_LO_EXPR:
+ case VEC_UNPACK_FLOAT_HI_EXPR:
+ case VEC_UNPACK_FLOAT_LO_EXPR:
case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
+ case VEC_PACK_FIX_TRUNC_EXPR:
case WIDEN_MULT_EXPR:
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index 76bb2dd1f28..f0dfa7ac490 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -117,7 +117,7 @@ gather_interchange_stats (VEC (ddr_p, heap) *dependence_relations,
for (j = 0; j < DDR_NUM_DIST_VECTS (ddr); j++)
{
- int dist = DDR_DIST_VECT (ddr, j)[loop->depth - first_loop->depth];
+ int dist = DDR_DIST_VECT (ddr, j)[loop_depth (loop) - loop_depth (first_loop)];
if (dist == 0)
(*nb_deps_not_carried_by_loop) += 1;
@@ -200,7 +200,7 @@ try_interchange_loops (lambda_trans_matrix trans,
loop_j;
loop_j = loop_j->inner)
for (loop_i = first_loop;
- loop_i->depth < loop_j->depth;
+ loop_depth (loop_i) < loop_depth (loop_j);
loop_i = loop_i->inner)
{
gather_interchange_stats (dependence_relations, datarefs,
@@ -230,14 +230,14 @@ try_interchange_loops (lambda_trans_matrix trans,
|| double_int_ucmp (access_strides_i, access_strides_j) < 0)
{
lambda_matrix_row_exchange (LTM_MATRIX (trans),
- loop_i->depth - first_loop->depth,
- loop_j->depth - first_loop->depth);
+ loop_depth (loop_i) - loop_depth (first_loop),
+ loop_depth (loop_j) - loop_depth (first_loop));
/* Validate the resulting matrix. When the transformation
is not valid, reverse to the previous transformation. */
if (!lambda_transform_legal_p (trans, depth, dependence_relations))
lambda_matrix_row_exchange (LTM_MATRIX (trans),
- loop_i->depth - first_loop->depth,
- loop_j->depth - first_loop->depth);
+ loop_depth (loop_i) - loop_depth (first_loop),
+ loop_depth (loop_j) - loop_depth (first_loop));
}
}
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index f1852ca5a7b..1eb09cbc50a 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -588,7 +588,9 @@ plus_expr_object_size (struct object_size_info *osi, tree var, tree value)
unsigned HOST_WIDE_INT off = tree_low_cst (op1, 1);
bytes = compute_builtin_object_size (op0, object_size_type);
- if (off > offset_limit)
+ if (bytes == unknown[object_size_type])
+ ;
+ else if (off > offset_limit)
bytes = unknown[object_size_type];
else if (off > bytes)
bytes = 0;
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 0e8390502e0..5512237b963 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -221,7 +221,10 @@ struct dump_file_info
/* Call df_finish at the end of the pass. This is done after all of
the dumpers have been allowed to run so that they have access to
the instance before it is destroyed. */
-#define TODO_df_finish (1 << 15)
+#define TODO_df_finish (1 << 16)
+
+/* Internally used for the first instance of a pass. */
+#define TODO_mark_first_instance (1 << 17)
#define TODO_update_ssa_any \
(TODO_update_ssa \
@@ -442,4 +445,13 @@ extern void execute_ipa_pass_list (struct tree_opt_pass *);
extern void print_current_pass (FILE *);
extern void debug_pass (void);
+/* Set to true if the pass is called the first time during compilation of the
+ current function. Note that using this information in the optimization
+ passes is considered not to be clean, and it should be avoided if possible.
+ This flag is currently used to prevent loops from being peeled repeatedly
+ in jump threading; it will be removed once we preserve loop structures
+ throughout the compilation -- we will be able to mark the affected loops
+ directly in jump threading, and avoid peeling them next time. */
+extern bool first_pass_instance;
+
#endif /* GCC_TREE_PASS_H */
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 09d203fa29b..991b1e11654 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -1943,6 +1943,18 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_string (buffer, " > ");
break;
+ case VEC_UNPACK_FLOAT_HI_EXPR:
+ pp_string (buffer, " VEC_UNPACK_FLOAT_HI_EXPR < ");
+ dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
+ pp_string (buffer, " > ");
+ break;
+
+ case VEC_UNPACK_FLOAT_LO_EXPR:
+ pp_string (buffer, " VEC_UNPACK_FLOAT_LO_EXPR < ");
+ dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
+ pp_string (buffer, " > ");
+ break;
+
case VEC_PACK_TRUNC_EXPR:
pp_string (buffer, " VEC_PACK_TRUNC_EXPR < ");
dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
@@ -1950,7 +1962,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_string (buffer, " > ");
break;
-
+
case VEC_PACK_SAT_EXPR:
pp_string (buffer, " VEC_PACK_SAT_EXPR < ");
dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
@@ -1958,7 +1970,15 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_string (buffer, " > ");
break;
-
+
+ case VEC_PACK_FIX_TRUNC_EXPR:
+ pp_string (buffer, " VEC_PACK_FIX_TRUNC_EXPR < ");
+ dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
+ pp_string (buffer, ", ");
+ dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
+ pp_string (buffer, " > ");
+ break;
+
case BLOCK:
{
tree t;
@@ -2352,6 +2372,8 @@ op_prio (tree op)
case VEC_RSHIFT_EXPR:
case VEC_UNPACK_HI_EXPR:
case VEC_UNPACK_LO_EXPR:
+ case VEC_UNPACK_FLOAT_HI_EXPR:
+ case VEC_UNPACK_FLOAT_LO_EXPR:
case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
return 16;
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 955240b6895..46831d7f573 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -254,12 +254,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "params.h"
static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
-static tree resolve_mixers (struct loop *, tree);
/* The cached information about a ssa name VAR, claiming that inside LOOP,
the value of VAR can be expressed as CHREC. */
-struct scev_info_str
+struct scev_info_str GTY(())
{
tree var;
tree chrec;
@@ -286,7 +285,7 @@ tree chrec_known;
static bitmap already_instantiated;
-static htab_t scalar_evolution_info;
+static GTY ((param_is (struct scev_info_str))) htab_t scalar_evolution_info;
/* Constructs a new SCEV_INFO_STR structure. */
@@ -296,7 +295,7 @@ new_scev_info_str (tree var)
{
struct scev_info_str *res;
- res = XNEW (struct scev_info_str);
+ res = GGC_NEW (struct scev_info_str);
res->var = var;
res->chrec = chrec_not_analyzed_yet;
@@ -327,7 +326,7 @@ eq_scev_info (const void *e1, const void *e2)
static void
del_scev_info (void *e)
{
- free (e);
+ ggc_free (e);
}
/* Get the index corresponding to VAR in the current LOOP. If
@@ -1534,7 +1533,7 @@ interpret_loop_phi (struct loop *loop, tree loop_phi_node)
(phi_loop, PHI_RESULT (loop_phi_node));
/* Dive one level deeper. */
- subloop = superloop_at_depth (phi_loop, loop->depth + 1);
+ subloop = superloop_at_depth (phi_loop, loop_depth (loop) + 1);
/* Interpret the subloop. */
res = compute_overall_effect_of_inner_loop (subloop, evolution_fn);
@@ -1680,7 +1679,7 @@ compute_scalar_evolution_in_loop (struct loop *wrto_loop,
if (def_loop == wrto_loop)
return ev;
- def_loop = superloop_at_depth (def_loop, wrto_loop->depth + 1);
+ def_loop = superloop_at_depth (def_loop, loop_depth (wrto_loop) + 1);
res = compute_overall_effect_of_inner_loop (def_loop, ev);
return analyze_scalar_evolution_1 (wrto_loop, res, chrec_not_analyzed_yet);
@@ -2023,7 +2022,7 @@ analyze_scalar_evolution_in_loop (struct loop *wrto_loop, struct loop *use_loop,
|| !val)
return chrec_dont_know;
- use_loop = use_loop->outer;
+ use_loop = loop_outer (use_loop);
}
}
@@ -2169,8 +2168,8 @@ instantiate_parameters_1 (struct loop *loop, tree chrec, int flags, htab_t cache
/* Don't instantiate loop-closed-ssa phi nodes. */
if (TREE_CODE (res) == SSA_NAME
&& (loop_containing_stmt (SSA_NAME_DEF_STMT (res)) == NULL
- || (loop_containing_stmt (SSA_NAME_DEF_STMT (res))->depth
- > def_loop->depth)))
+ || (loop_depth (loop_containing_stmt (SSA_NAME_DEF_STMT (res)))
+ > loop_depth (def_loop))))
{
if (res == chrec)
res = loop_closed_phi_def (chrec);
@@ -2408,7 +2407,7 @@ instantiate_parameters (struct loop *loop,
care about causing overflows, as long as they do not affect value
of an expression. */
-static tree
+tree
resolve_mixers (struct loop *loop, tree chrec)
{
htab_t cache = htab_create (10, hash_scev_info, eq_scev_info, del_scev_info);
@@ -2747,8 +2746,12 @@ scev_initialize (void)
loop_iterator li;
struct loop *loop;
- scalar_evolution_info = htab_create (100, hash_scev_info,
- eq_scev_info, del_scev_info);
+ scalar_evolution_info = htab_create_alloc (100,
+ hash_scev_info,
+ eq_scev_info,
+ del_scev_info,
+ ggc_calloc,
+ ggc_free);
already_instantiated = BITMAP_ALLOC (NULL);
initialize_scalar_evolutions_analyzer ();
@@ -2966,7 +2969,8 @@ scev_const_prop (void)
tree_block_label (exit->dest);
bsi = bsi_after_labels (exit->dest);
- ex_loop = superloop_at_depth (loop, exit->dest->loop_father->depth + 1);
+ ex_loop = superloop_at_depth (loop,
+ loop_depth (exit->dest->loop_father) + 1);
for (phi = phi_nodes (exit->dest); phi; phi = next_phi)
{
@@ -3008,3 +3012,5 @@ scev_const_prop (void)
}
return 0;
}
+
+#include "gt-tree-scalar-evolution.h"
diff --git a/gcc/tree-scalar-evolution.h b/gcc/tree-scalar-evolution.h
index 464fe8fc519..e0218cc9e06 100644
--- a/gcc/tree-scalar-evolution.h
+++ b/gcc/tree-scalar-evolution.h
@@ -31,6 +31,7 @@ extern void scev_reset (void);
extern void scev_finalize (void);
extern tree analyze_scalar_evolution (struct loop *, tree);
extern tree instantiate_parameters (struct loop *, tree);
+extern tree resolve_mixers (struct loop *, tree);
extern void gather_stats_on_scev_database (void);
extern void scev_analysis (void);
unsigned int scev_const_prop (void);
diff --git a/gcc/tree-ssa-alias-warnings.c b/gcc/tree-ssa-alias-warnings.c
new file mode 100644
index 00000000000..149731a19c5
--- /dev/null
+++ b/gcc/tree-ssa-alias-warnings.c
@@ -0,0 +1,991 @@
+/* Strict aliasing checks.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Contributed by Silvius Rus <rus@google.com>.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, 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 COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "alloc-pool.h"
+#include "tree.h"
+#include "tree-dump.h"
+#include "tree-flow.h"
+#include "params.h"
+#include "function.h"
+#include "expr.h"
+#include "toplev.h"
+#include "diagnostic.h"
+#include "tree-ssa-structalias.h"
+#include "tree-ssa-propagate.h"
+#include "langhooks.h"
+
+/* Module to issue a warning when a program uses data through a type
+ different from the type through which the data were defined.
+ Implements -Wstrict-aliasing and -Wstrict-aliasing=n.
+ These checks only happen when -fstrict-aliasing is present.
+
+ The idea is to use the compiler to identify occurrences of nonstandard
+ aliasing, and report them to programmers. Programs free of such aliasing
+ are more portable, maintainable, and can usually be optimized better.
+
+ The current, as of April 2007, C and C++ language standards forbid
+ accessing data of type A through an lvalue of another type B,
+ with certain exceptions. See the C Standard ISO/IEC 9899:1999,
+ section 6.5, paragraph 7, and the C++ Standard ISO/IEC 14882:1998,
+ section 3.10, paragraph 15.
+
+ Example 1:*a is used as int but was defined as a float, *b.
+ int* a = ...;
+ float* b = reinterpret_cast<float*> (a);
+ *b = 2.0;
+ return *a
+
+ Unfortunately, the problem is in general undecidable if we take into
+ account arithmetic expressions such as array indices or pointer arithmetic.
+ (It is at least as hard as Peano arithmetic decidability.)
+ Even ignoring arithmetic, the problem is still NP-hard, because it is
+ at least as hard as flow-insensitive may-alias analysis, which was proved
+ NP-hard by Horwitz et al, TOPLAS 1997.
+
+ It is clear that we need to choose some heuristics.
+ Unfortunately, various users have different goals which correspond to
+ different time budgets so a common approach will not suit all.
+ We present the user with three effort/accuracy levels. By accuracy, we mean
+ a common-sense mix of low count of false positives with a
+ reasonably low number of false negatives. We are heavily biased
+ towards a low count of false positives.
+ The effort (compilation time) is likely to increase with the level.
+
+ -Wstrict-aliasing=1
+ ===================
+ Most aggressive, least accurate. Possibly useful when higher levels
+ do not warn but -fstrict-aliasing still breaks the code, as
+ it has very few false negatives.
+ Warn for all bad pointer conversions, even if never dereferenced.
+ Implemented in the front end (c-common.c).
+ Uses alias_sets_might_conflict to compare types.
+
+ -Wstrict-aliasing=2
+ ===================
+ Aggressive, not too precise.
+ May still have many false positives (not as many as level 1 though),
+ and few false negatives (but possibly more than level 1).
+ Runs only in the front end. Uses alias_sets_might_conflict to
+ compare types. Does not check for pointer dereferences.
+ Only warns when an address is taken. Warns about incomplete type punning.
+
+ -Wstrict-aliasing=3 (default)
+ ===================
+ Should have very few false positives and few false negatives.
+ Takes care of the common punn+dereference pattern in the front end:
+ *(int*)&some_float.
+ Takes care of multiple statement cases in the back end,
+ using flow-sensitive points-to information (-O required).
+ Uses alias_sets_conflict_p to compare types and only warns
+ when the converted pointer is dereferenced.
+ Does not warn about incomplete type punning.
+
+ Future improvements can be included by adding higher levels.
+
+ In summary, expression level analysis is performed in the front-end,
+ and multiple-statement analysis is performed in the backend.
+ The remainder of this discussion is only about the backend analysis.
+
+ This implementation uses flow-sensitive points-to information.
+ Flow-sensitivity refers to accesses to the pointer, and not the object
+ pointed. For instance, we do not warn about the following case.
+
+ Example 2.
+ int* a = (int*)malloc (...);
+ float* b = reinterpret_cast<float*> (a);
+ *b = 2.0;
+ a = (int*)malloc (...);
+ return *a;
+
+ In SSA, it becomes clear that the INT value *A_2 referenced in the
+ return statement is not aliased to the FLOAT defined through *B_1.
+ int* a_1 = (int*)malloc (...);
+ float* b_1 = reinterpret_cast<float*> (a_1);
+ *b_1 = 2.0;
+ a_2 = (int*)malloc (...);
+ return *a_2;
+
+
+ Algorithm Outline
+ =================
+
+ ForEach (ptr, object) in the points-to table
+ If (incompatible_types (*ptr, object))
+ If (referenced (ptr, current function)
+ and referenced (object, current function))
+ Issue warning (ptr, object, reference locations)
+
+ The complexity is:
+ O (sizeof (points-to table)
+ + sizeof (function body) * lookup_time (points-to table))
+
+ Pointer dereference locations are looked up on demand. The search is
+ a single scan of the function body, in which all references to pointers
+ and objects in the points-to table are recorded. However, this dominant
+ time factor occurs rarely, only when cross-type aliasing was detected.
+
+
+ Limitations of the Proposed Implementation
+ ==========================================
+
+ 1. We do not catch the following case, because -fstrict-aliasing will
+ associate different tags with MEM while building points-to information,
+ thus before we get to analyze it.
+ XXX: this could be solved by either running with -fno-strict-aliasing
+ or by recording the points-to information before splitting the orignal
+ tag based on type.
+
+ Example 3.
+ void* mem = malloc (...);
+ int* pi = reinterpret_cast<int*> (mem);
+ float* b = reinterpret_cast<float*> (mem);
+ *b = 2.0;
+ return *pi+1;
+
+ 2. We do not check whether the two conflicting (de)references can
+ reach each other in the control flow sense. If we fixed limitation
+ 1, we would wrongly issue a warning in the following case.
+
+ Example 4.
+ void* raw = malloc (...);
+ if (...) {
+ float* b = reinterpret_cast<float*> (raw);
+ *b = 2.0;
+ return (int)*b;
+ } else {
+ int* a = reinterpret_cast<int*> (raw);
+ *a = 1;
+ return *a;
+
+ 3. Only simple types are compared, thus no structures, unions or classes
+ are analyzed. A first attempt to deal with structures introduced much
+ complication and has not showed much improvement in preliminary tests,
+ so it was left out.
+
+ 4. All analysis is intraprocedural. */
+
+
+/* Local declarations. */
+static void find_references_in_function (void);
+
+
+
+/* Get main type of tree TYPE, stripping array dimensions and qualifiers. */
+
+static tree
+get_main_type (tree type)
+{
+ while (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+ return TYPE_MAIN_VARIANT (type);
+}
+
+
+/* Get the type of the given object. If IS_PTR is true, get the type of the
+ object pointed to or referenced by OBJECT instead.
+ For arrays, return the element type. Ignore all qualifiers. */
+
+static tree
+get_otype (tree object, bool is_ptr)
+{
+ tree otype = TREE_TYPE (object);
+
+ if (is_ptr)
+ {
+ gcc_assert (POINTER_TYPE_P (otype));
+ otype = TREE_TYPE (otype);
+ }
+ return get_main_type (otype);
+}
+
+
+/* Return true if tree TYPE is struct, class or union. */
+
+static bool
+struct_class_union_p (tree type)
+{
+ return (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE
+ || TREE_CODE (type) == QUAL_UNION_TYPE);
+}
+
+
+
+/* Keep data during a search for an aliasing site.
+ RHS = object or pointer aliased. No LHS is specified because we are only
+ looking in the UseDef paths of a given variable, so LHS will always be
+ an SSA name of the same variable.
+ When IS_RHS_POINTER = true, we are looking for ... = RHS. Otherwise,
+ we are looking for ... = &RHS.
+ SITE is the output of a search, non-NULL if the search succeeded. */
+
+struct alias_match
+{
+ tree rhs;
+ bool is_rhs_pointer;
+ tree site;
+};
+
+
+/* Callback for find_alias_site. Return true if the right hand site
+ of STMT matches DATA. */
+
+static bool
+find_alias_site_helper (tree var ATTRIBUTE_UNUSED, tree stmt, void *data)
+{
+ struct alias_match *match = (struct alias_match *) data;
+ tree rhs_pointer = get_rhs (stmt);
+ tree to_match = NULL_TREE;
+
+ while (TREE_CODE (rhs_pointer) == NOP_EXPR
+ || TREE_CODE (rhs_pointer) == CONVERT_EXPR
+ || TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
+ rhs_pointer = TREE_OPERAND (rhs_pointer, 0);
+
+ if (!rhs_pointer)
+ /* Not a type conversion. */
+ return false;
+
+ if (TREE_CODE (rhs_pointer) == ADDR_EXPR && !match->is_rhs_pointer)
+ to_match = TREE_OPERAND (rhs_pointer, 0);
+ else if (POINTER_TYPE_P (rhs_pointer) && match->is_rhs_pointer)
+ to_match = rhs_pointer;
+
+ if (to_match != match->rhs)
+ /* Type conversion, but not a name match. */
+ return false;
+
+ /* Found it. */
+ match->site = stmt;
+ return true;
+}
+
+
+/* Find the statement where OBJECT1 gets aliased to OBJECT2.
+ If IS_PTR2 is true, consider OBJECT2 to be the name of a pointer or
+ reference rather than the actual aliased object.
+ For now, just implement the case where OBJECT1 is an SSA name defined
+ by a PHI statement. */
+
+static tree
+find_alias_site (tree object1, bool is_ptr1 ATTRIBUTE_UNUSED,
+ tree object2, bool is_ptr2)
+{
+ struct alias_match match;
+
+ match.rhs = object2;
+ match.is_rhs_pointer = is_ptr2;
+ match.site = NULL_TREE;
+
+ if (TREE_CODE (object1) != SSA_NAME)
+ return NULL_TREE;
+
+ walk_use_def_chains (object1, find_alias_site_helper, &match, false);
+ return match.site;
+}
+
+
+/* Structure to store temporary results when trying to figure out whether
+ an object is referenced. Just its presence in the text is not enough,
+ as we may just be taking its address. */
+
+struct match_info
+{
+ tree object;
+ bool is_ptr;
+ /* The difference between the number of references to OBJECT
+ and the number of occurences of &OBJECT. */
+ int found;
+};
+
+
+/* Return the base if EXPR is an SSA name. Return EXPR otherwise. */
+
+static tree
+get_ssa_base (tree expr)
+{
+ if (TREE_CODE (expr) == SSA_NAME)
+ return SSA_NAME_VAR (expr);
+ else
+ return expr;
+}
+
+
+/* Record references to objects and pointer dereferences across some piece of
+ code. The number of references is recorded for each item.
+ References to an object just to take its address are not counted.
+ For instance, if PTR is a pointer and OBJ is an object:
+ 1. Expression &obj + *ptr will have the following reference match structure:
+ ptrs: <ptr, 1>
+ objs: <ptr, 1>
+ OBJ does not appear as referenced because we just take its address.
+ 2. Expression ptr + *ptr will have the following reference match structure:
+ ptrs: <ptr, 1>
+ objs: <ptr, 2>
+ PTR shows up twice as an object, but is dereferenced only once.
+
+ The elements of the hash tables are tree_map objects. */
+struct reference_matches
+{
+ htab_t ptrs;
+ htab_t objs;
+};
+
+
+/* Return the match, if any. Otherwise, return NULL_TREE. It will
+ return NULL_TREE even when a match was found, if the value associated
+ to KEY is NULL_TREE. */
+
+static inline tree
+match (htab_t ref_map, tree key)
+{
+ struct tree_map *found;
+ void **slot = NULL;
+ slot = htab_find_slot (ref_map, &key, NO_INSERT);
+
+ if (!slot)
+ return NULL_TREE;
+
+ found = (struct tree_map *) *slot;
+ return found->to;
+}
+
+
+/* Set the entry corresponding to KEY, but only if the entry
+ already exists and its value is NULL_TREE. Otherwise, do nothing. */
+
+static inline void
+maybe_add_match (htab_t ref_map, struct tree_map *key)
+{
+ struct tree_map *found = htab_find (ref_map, key);
+
+ if (found && !found->to)
+ found->to = key->to;
+}
+
+
+/* Add an entry to HT, with key T and value NULL_TREE. */
+
+static void
+add_key (htab_t ht, tree t, alloc_pool references_pool)
+{
+ void **slot;
+ struct tree_map *tp = pool_alloc (references_pool);
+
+ tp->base.from = t;
+ tp->to = NULL_TREE;
+ slot = htab_find_slot (ht, &t, INSERT);
+ *slot = (void *) tp;
+}
+
+
+/* Some memory to keep the objects in the reference table. */
+
+static alloc_pool ref_table_alloc_pool = NULL;
+
+
+/* Get some memory to keep the objects in the reference table. */
+
+static inline alloc_pool
+reference_table_alloc_pool (bool build)
+{
+ if (ref_table_alloc_pool || !build)
+ return ref_table_alloc_pool;
+
+ ref_table_alloc_pool =
+ create_alloc_pool ("ref_table_alloc_pool", sizeof (struct tree_map), 20);
+
+ return ref_table_alloc_pool;
+}
+
+
+/* Initialize the reference table by adding all pointers in the points-to
+ table as keys, and NULL_TREE as associated values. */
+
+static struct reference_matches *
+build_reference_table (void)
+{
+ unsigned int i;
+ struct reference_matches *ref_table = NULL;
+ alloc_pool references_pool = reference_table_alloc_pool (true);
+
+ ref_table = XNEW (struct reference_matches);
+ ref_table->objs = htab_create (10, tree_map_base_hash, tree_map_eq, NULL);
+ ref_table->ptrs = htab_create (10, tree_map_base_hash, tree_map_eq, NULL);
+
+ for (i = 1; i < num_ssa_names; i++)
+ {
+ tree ptr = ssa_name (i);
+ struct ptr_info_def *pi;
+
+ if (ptr == NULL_TREE)
+ continue;
+
+ pi = SSA_NAME_PTR_INFO (ptr);
+
+ if (!SSA_NAME_IN_FREE_LIST (ptr) && pi && pi->name_mem_tag)
+ {
+ /* Add pointer to the interesting dereference list. */
+ add_key (ref_table->ptrs, ptr, references_pool);
+
+ /* Add all aliased names to the interesting reference list. */
+ if (pi->pt_vars)
+ {
+ unsigned ix;
+ bitmap_iterator bi;
+
+ EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix, bi)
+ {
+ tree alias = referenced_var (ix);
+ add_key (ref_table->objs, alias, references_pool);
+ }
+ }
+ }
+ }
+
+ return ref_table;
+}
+
+
+/* Reference table. */
+
+static struct reference_matches *ref_table = NULL;
+
+
+/* Clean up the reference table if allocated. */
+
+static void
+maybe_free_reference_table (void)
+{
+ if (ref_table)
+ {
+ htab_delete (ref_table->ptrs);
+ htab_delete (ref_table->objs);
+ free (ref_table);
+ ref_table = NULL;
+ }
+
+ if (ref_table_alloc_pool)
+ {
+ free_alloc_pool (ref_table_alloc_pool);
+ ref_table_alloc_pool = NULL;
+ }
+}
+
+
+/* Get the reference table. Initialize it if needed. */
+
+static inline struct reference_matches *
+reference_table (bool build)
+{
+ if (ref_table || !build)
+ return ref_table;
+
+ ref_table = build_reference_table ();
+ find_references_in_function ();
+ return ref_table;
+}
+
+
+/* Callback for find_references_in_function.
+ Check whether *TP is an object reference or pointer dereference for the
+ variables given in ((struct match_info*)DATA)->OBJS or
+ ((struct match_info*)DATA)->PTRS. The total number of references
+ is stored in the same structures. */
+
+static tree
+find_references_in_tree_helper (tree *tp,
+ int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data)
+{
+ struct tree_map match;
+ static int parent_tree_code = ERROR_MARK;
+
+ /* Do not report references just for the purpose of taking an address.
+ XXX: we rely on the fact that the tree walk is in preorder
+ and that ADDR_EXPR is not a leaf, thus cannot be carried over across
+ walks. */
+ if (parent_tree_code == ADDR_EXPR)
+ goto finish;
+
+ match.to = (tree) data;
+
+ if (TREE_CODE (*tp) == INDIRECT_REF)
+ {
+ match.base.from = TREE_OPERAND (*tp, 0);
+ maybe_add_match (reference_table (true)->ptrs, &match);
+ }
+ else
+ {
+ match.base.from = *tp;
+ maybe_add_match (reference_table (true)->objs, &match);
+ }
+
+finish:
+ parent_tree_code = TREE_CODE (*tp);
+ return NULL_TREE;
+}
+
+
+/* Find all the references to aliased variables in the current function. */
+
+static void
+find_references_in_function (void)
+{
+ basic_block bb;
+ block_stmt_iterator i;
+
+ FOR_EACH_BB (bb)
+ for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ walk_tree (bsi_stmt_ptr (i), find_references_in_tree_helper,
+ (void *) *bsi_stmt_ptr (i), NULL);
+}
+
+
+/* Find the reference site for OBJECT.
+ If IS_PTR is true, look for derferences of OBJECT instead.
+ XXX: only the first site is returned in the current
+ implementation. If there are no matching sites, return NULL_TREE. */
+
+static tree
+reference_site (tree object, bool is_ptr)
+{
+ if (is_ptr)
+ return match (reference_table (true)->ptrs, object);
+ else
+ return match (reference_table (true)->objs, object);
+}
+
+
+/* Try to get more location info when something is missing.
+ OBJECT1 and OBJECT2 are aliased names. If IS_PTR1 or IS_PTR2, the alias
+ is on the memory referenced or pointed to by OBJECT1 and OBJECT2.
+ ALIAS_SITE, DEREF_SITE1 and DEREF_SITE2 are the statements where the
+ alias takes place (some pointer assignment usually) and where the
+ alias is referenced through OBJECT1 and OBJECT2 respectively.
+ REF_TYPE1 and REF_TYPE2 will return the type of the reference at the
+ respective sites. Only the first matching reference is returned for
+ each name. If no statement is found, the function header is returned. */
+
+static void
+maybe_find_missing_stmts (tree object1, bool is_ptr1,
+ tree object2, bool is_ptr2,
+ tree *alias_site,
+ tree *deref_site1,
+ tree *deref_site2)
+{
+ if (object1 && object2)
+ {
+ if (!*alias_site || !EXPR_HAS_LOCATION (*alias_site))
+ *alias_site = find_alias_site (object1, is_ptr1, object2, is_ptr2);
+
+ if (!*deref_site1 || !EXPR_HAS_LOCATION (*deref_site1))
+ *deref_site1 = reference_site (object1, is_ptr1);
+
+ if (!*deref_site2 || !EXPR_HAS_LOCATION (*deref_site2))
+ *deref_site2 = reference_site (object2, is_ptr2);
+ }
+
+ /* If we could not find the alias site, set it to one of the dereference
+ sites, if available. */
+ if (!*alias_site)
+ {
+ if (*deref_site1)
+ *alias_site = *deref_site1;
+ else if (*deref_site2)
+ *alias_site = *deref_site2;
+ }
+
+ /* If we could not find the dereference sites, set them to the alias site,
+ if known. */
+ if (!*deref_site1 && *alias_site)
+ *deref_site1 = *alias_site;
+ if (!*deref_site2 && *alias_site)
+ *deref_site2 = *alias_site;
+}
+
+
+/* Callback for find_first_artificial_name.
+ Find out if there are no artificial names at tree node *T. */
+
+static tree
+ffan_walker (tree *t,
+ int *go_below ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ if (DECL_P (*t) && DECL_ARTIFICIAL (*t))
+ return *t;
+ else
+ return NULL_TREE;
+}
+
+/* Return the first artificial name within EXPR, or NULL_TREE if
+ none exists. */
+
+static tree
+find_first_artificial_name (tree expr)
+{
+ return walk_tree_without_duplicates (&expr, ffan_walker, NULL);
+}
+
+
+/* Get a name from the original program for VAR. */
+
+static const char *
+get_var_name (tree var)
+{
+ if (TREE_CODE (var) == SSA_NAME)
+ return get_var_name (get_ssa_base (var));
+
+ if (find_first_artificial_name (var))
+ return "{unknown}";
+
+ if (TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
+ if (DECL_NAME (var))
+ return IDENTIFIER_POINTER (DECL_NAME (var));
+
+ return "{unknown}";
+}
+
+
+/* Return "*" if OBJECT is not the actual alias but a pointer to it, or
+ "" otherwise.
+ IS_PTR is true when OBJECT is not the actual alias.
+ In addition to checking IS_PTR, we also make sure that OBJECT is a pointer
+ since IS_PTR would also be true for C++ references, but we should only
+ print a * before a pointer and not before a reference. */
+
+static const char *
+get_maybe_star_prefix (tree object, bool is_ptr)
+{
+ gcc_assert (object);
+ return (is_ptr
+ && TREE_CODE (TREE_TYPE (object)) == POINTER_TYPE) ? "*" : "";
+}
+
+
+/* Callback for contains_node_type_p.
+ Returns true if *T has tree code *(int*)DATA. */
+
+static tree
+contains_node_type_p_callback (tree *t,
+ int *go_below ATTRIBUTE_UNUSED,
+ void *data)
+{
+ return ((int) TREE_CODE (*t) == *((int *) data)) ? *t : NULL_TREE;
+}
+
+
+/* Return true if T contains a node with tree code TYPE. */
+
+static bool
+contains_node_type_p (tree t, int type)
+{
+ return (walk_tree_without_duplicates (&t, contains_node_type_p_callback,
+ (void *) &type)
+ != NULL_TREE);
+}
+
+
+/* Return true if a warning was issued in the front end at STMT. */
+
+static bool
+already_warned_in_frontend_p (tree stmt)
+{
+ tree rhs_pointer;
+
+ if (stmt == NULL_TREE)
+ return false;
+
+ rhs_pointer = get_rhs (stmt);
+
+ if ((TREE_CODE (rhs_pointer) == NOP_EXPR
+ || TREE_CODE (rhs_pointer) == CONVERT_EXPR
+ || TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
+ && TREE_NO_WARNING (rhs_pointer))
+ return true;
+ else
+ return false;
+}
+
+
+/* Return true if and only if TYPE is a function or method pointer type,
+ or pointer to a pointer to ... to a function or method. */
+
+static bool
+is_method_pointer (tree type)
+{
+ while (TREE_CODE (type) == POINTER_TYPE)
+ type = TREE_TYPE (type);
+ return TREE_CODE (type) == METHOD_TYPE || TREE_CODE (type) == FUNCTION_TYPE;
+}
+
+
+/* Issue a -Wstrict-aliasing warning.
+ OBJECT1 and OBJECT2 are aliased names.
+ If IS_PTR1 and/or IS_PTR2 is true, then the corresponding name
+ OBJECT1/OBJECT2 is a pointer or reference to the aliased memory,
+ rather than actual storage.
+ ALIAS_SITE is a statement where the alias took place. In the most common
+ case, that is where a pointer was assigned to the address of an object. */
+
+static bool
+strict_aliasing_warn (tree alias_site,
+ tree object1, bool is_ptr1,
+ tree object2, bool is_ptr2,
+ bool filter_artificials)
+{
+ tree ref_site1 = NULL_TREE;
+ tree ref_site2 = NULL_TREE;
+ const char *name1;
+ const char *name2;
+ location_t alias_loc;
+ location_t ref1_loc;
+ location_t ref2_loc;
+ gcc_assert (object1);
+ gcc_assert (object2);
+ name1 = get_var_name (object1);
+ name2 = get_var_name (object2);
+
+
+ if (is_method_pointer (get_main_type (TREE_TYPE (object2))))
+ return false;
+
+ maybe_find_missing_stmts (object1, is_ptr1, object2, is_ptr2, &alias_site,
+ &ref_site1, &ref_site2);
+
+ if (EXPR_HAS_LOCATION (alias_site))
+ alias_loc = EXPR_LOCATION (alias_site);
+ else
+ return false;
+
+ if (EXPR_HAS_LOCATION (ref_site1))
+ ref1_loc = EXPR_LOCATION (ref_site1);
+ else
+ ref1_loc = alias_loc;
+
+ if (EXPR_HAS_LOCATION (ref_site2))
+ ref2_loc = EXPR_LOCATION (ref_site2);
+ else
+ ref2_loc = alias_loc;
+
+ if (already_warned_in_frontend_p (alias_site))
+ return false;
+
+ /* If they are not SSA names, but contain SSA names, drop the warning
+ because it cannot be displayed well.
+ Also drop it if they both contain artificials.
+ XXX: this is a hack, must figure out a better way to display them. */
+ if (filter_artificials)
+ if ((find_first_artificial_name (get_ssa_base (object1))
+ && find_first_artificial_name (get_ssa_base (object2)))
+ || (TREE_CODE (object1) != SSA_NAME
+ && contains_node_type_p (object1, SSA_NAME))
+ || (TREE_CODE (object2) != SSA_NAME
+ && contains_node_type_p (object2, SSA_NAME)))
+ return false;
+
+
+ /* XXX: In the following format string, %s:%d should be replaced by %H.
+ However, in my tests only the first %H printed ok, while the
+ second and third were printed as blanks. */
+ warning (OPT_Wstrict_aliasing,
+ "%Hlikely type-punning may break strict-aliasing rules: "
+ "object %<%s%s%> of main type %qT is referenced at or around "
+ "%s:%d and may be "
+ "aliased to object %<%s%s%> of main type %qT which is referenced "
+ "at or around %s:%d.",
+ &alias_loc,
+ get_maybe_star_prefix (object1, is_ptr1),
+ name1, get_otype (object1, is_ptr1),
+ LOCATION_FILE (ref1_loc), LOCATION_LINE (ref1_loc),
+ get_maybe_star_prefix (object2, is_ptr2),
+ name2, get_otype (object2, is_ptr2),
+ LOCATION_FILE (ref2_loc), LOCATION_LINE (ref2_loc));
+
+ return true;
+}
+
+
+
+/* Return true when any objects of TYPE1 and TYPE2 respectively
+ may not be aliased according to the language standard. */
+
+static bool
+nonstandard_alias_types_p (tree type1, tree type2)
+{
+ HOST_WIDE_INT set1;
+ HOST_WIDE_INT set2;
+
+ if (VOID_TYPE_P (type1) || VOID_TYPE_P (type2))
+ return false;
+
+ set1 = get_alias_set (type1);
+ set2 = get_alias_set (type2);
+ return !alias_sets_conflict_p (set1, set2);
+}
+
+
+
+/* Returns true when *PTR may not be aliased to ALIAS.
+ See C standard 6.5p7 and C++ standard 3.10p15.
+ If PTR_PTR is true, ALIAS represents a pointer or reference to the
+ aliased storage rather than its actual name. */
+
+static bool
+nonstandard_alias_p (tree ptr, tree alias, bool ptr_ptr)
+{
+ /* Find the types to compare. */
+ tree ptr_type = get_otype (ptr, true);
+ tree alias_type = get_otype (alias, ptr_ptr);
+
+ /* XXX: for now, say it's OK if the alias escapes.
+ Not sure this is needed in general, but otherwise GCC will not
+ bootstrap. */
+ if (var_ann (get_ssa_base (alias))->escape_mask != NO_ESCAPE)
+ return false;
+
+ /* XXX: don't get into structures for now. It brings much complication
+ and little benefit. */
+ if (struct_class_union_p (ptr_type) || struct_class_union_p (alias_type))
+ return false;
+
+ /* If they are both SSA names of artificials, let it go, the warning
+ is too confusing. */
+ if (find_first_artificial_name (ptr) && find_first_artificial_name (alias))
+ return false;
+
+ /* Compare the types. */
+ return nonstandard_alias_types_p (ptr_type, alias_type);
+}
+
+
+/* Return true when we should skip analysis for pointer PTR based on the
+ fact that their alias information *PI is not considered relevant. */
+
+static bool
+skip_this_pointer (tree ptr ATTRIBUTE_UNUSED, struct ptr_info_def *pi)
+{
+ /* If it is not dereferenced, it is not a problem (locally). */
+ if (!pi->is_dereferenced)
+ return true;
+
+ /* This would probably cause too many false positives. */
+ if (pi->value_escapes_p || pi->pt_anything)
+ return true;
+
+ return false;
+}
+
+
+/* Find aliasing to named objects for pointer PTR. */
+
+static void
+dsa_named_for (tree ptr)
+{
+ struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
+
+ if (pi)
+ {
+ if (skip_this_pointer (ptr, pi))
+ return;
+
+ /* For all the variables it could be aliased to. */
+ if (pi->pt_vars)
+ {
+ unsigned ix;
+ bitmap_iterator bi;
+
+ EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix, bi)
+ {
+ tree alias = referenced_var (ix);
+
+ if (nonstandard_alias_p (ptr, alias, false))
+ strict_aliasing_warn (SSA_NAME_DEF_STMT (ptr),
+ ptr, true, alias, false, true);
+ }
+ }
+ }
+}
+
+
+/* Detect and report strict aliasing violation of named objects. */
+
+static void
+detect_strict_aliasing_named (void)
+{
+ unsigned int i;
+
+ for (i = 1; i < num_ssa_names; i++)
+ {
+ tree ptr = ssa_name (i);
+ struct ptr_info_def *pi;
+
+ if (ptr == NULL_TREE)
+ continue;
+
+ pi = SSA_NAME_PTR_INFO (ptr);
+
+ if (!SSA_NAME_IN_FREE_LIST (ptr) && pi && pi->name_mem_tag)
+ dsa_named_for (ptr);
+ }
+}
+
+
+/* Return false only the first time I see each instance of FUNC. */
+
+static bool
+processed_func_p (tree func)
+{
+ static htab_t seen = NULL;
+ void **slot = NULL;
+
+ if (!seen)
+ seen = htab_create (10, tree_map_base_hash, tree_map_eq, NULL);
+
+ slot = htab_find_slot (seen, &func, INSERT);
+ gcc_assert (slot);
+
+ if (*slot)
+ return true;
+
+ gcc_assert (slot);
+ *slot = &func;
+ return false;
+}
+
+
+/* Detect and warn about type-punning using points-to information. */
+
+void
+strict_aliasing_warning_backend (void)
+{
+ if (flag_strict_aliasing && warn_strict_aliasing == 3
+ && !processed_func_p (current_function_decl))
+ {
+ detect_strict_aliasing_named ();
+ maybe_free_reference_table ();
+ }
+}
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index ee03ffa2e6b..2ecad8bafdf 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -97,6 +97,7 @@ static void set_pt_anything (tree);
void debug_mp_info (VEC(mem_sym_stats_t,heap) *);
+
/* Return memory reference stats for symbol VAR. Create a new slot in
cfun->gimple_df->mem_sym_stats if needed. */
@@ -1605,6 +1606,9 @@ compute_may_aliases (void)
dump_referenced_vars (dump_file);
}
+ /* Report strict aliasing violations. */
+ strict_aliasing_warning_backend ();
+
/* Deallocate memory used by aliasing data structures. */
delete_alias_info (ai);
@@ -3932,7 +3936,7 @@ create_structure_vars (void)
update_stmt (stmt);
}
}
-
+
return 0;
}
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 7da5cdffbb0..381a3429e07 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -591,7 +591,7 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
basic_block post_dom_bb;
/* The post dominance info has to be up-to-date. */
- gcc_assert (dom_computed[CDI_POST_DOMINATORS] == DOM_OK);
+ gcc_assert (dom_info_state (CDI_POST_DOMINATORS) == DOM_OK);
/* Get the immediate post dominator of bb. */
post_dom_bb = get_immediate_dominator (CDI_POST_DOMINATORS, bb);
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 6e1387f7157..87270fc8e08 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -275,26 +275,19 @@ tree_ssa_dominator_optimize (void)
init_walk_dominator_tree (&walk_data);
calculate_dominance_info (CDI_DOMINATORS);
+ cfg_altered = false;
- /* We need to know which edges exit loops so that we can
- aggressively thread through loop headers to an exit
- edge. */
- loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
- if (current_loops)
- {
- mark_loop_exit_edges ();
- loop_optimizer_finalize ();
- }
-
- /* Clean up the CFG so that any forwarder blocks created by loop
- canonicalization are removed. */
- cleanup_tree_cfg ();
- calculate_dominance_info (CDI_DOMINATORS);
+ /* We need to know loop structures in order to avoid destroying them
+ in jump threading. Note that we still can e.g. thread through loop
+ headers to an exit edge, or through loop header to the loop body, assuming
+ that we update the loop info. */
+ loop_optimizer_init (LOOPS_HAVE_SIMPLE_LATCHES);
/* We need accurate information regarding back edges in the CFG
- for jump threading. */
+ for jump threading; this may include back edes that are not part of
+ a single loop. */
mark_dfs_back_edges ();
-
+
/* Recursively walk the dominator tree optimizing statements. */
walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
@@ -318,19 +311,19 @@ tree_ssa_dominator_optimize (void)
free_all_edge_infos ();
/* Thread jumps, creating duplicate blocks as needed. */
- cfg_altered |= thread_through_all_blocks ();
+ cfg_altered |= thread_through_all_blocks (first_pass_instance);
+
+ if (cfg_altered)
+ free_dominance_info (CDI_DOMINATORS);
/* Removal of statements may make some EH edges dead. Purge
such edges from the CFG as needed. */
if (!bitmap_empty_p (need_eh_cleanup))
{
- cfg_altered |= tree_purge_all_dead_eh_edges (need_eh_cleanup);
+ tree_purge_all_dead_eh_edges (need_eh_cleanup);
bitmap_zero (need_eh_cleanup);
}
- if (cfg_altered)
- free_dominance_info (CDI_DOMINATORS);
-
/* Finally, remove everything except invariants in SSA_NAME_VALUE.
Long term we will be able to let everything in SSA_NAME_VALUE
@@ -352,6 +345,8 @@ tree_ssa_dominator_optimize (void)
if (dump_file && (dump_flags & TDF_STATS))
dump_dominator_optimization_stats (dump_file);
+ loop_optimizer_finalize ();
+
/* Delete our main hashtable. */
htab_delete (avail_exprs);
@@ -2336,7 +2331,7 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
te->count += e->count;
remove_edge (e);
- cfg_altered = 1;
+ cfg_altered = true;
}
else
ei_next (&ei);
@@ -2485,6 +2480,9 @@ eliminate_degenerate_phis (void)
interesting_names = BITMAP_ALLOC (NULL);
interesting_names1 = BITMAP_ALLOC (NULL);
+ calculate_dominance_info (CDI_DOMINATORS);
+ cfg_altered = false;
+
/* First phase. Eliminate degenerate PHIs via a dominator
walk of the CFG.
@@ -2493,7 +2491,6 @@ eliminate_degenerate_phis (void)
phase in dominator order. Presumably this is because walking
in dominator order leaves fewer PHIs for later examination
by the worklist phase. */
- calculate_dominance_info (CDI_DOMINATORS);
eliminate_degenerate_phis_1 (ENTRY_BLOCK_PTR, interesting_names);
/* Second phase. Eliminate second order degenerate PHIs as well
@@ -2522,18 +2519,19 @@ eliminate_degenerate_phis (void)
}
}
+ if (cfg_altered)
+ free_dominance_info (CDI_DOMINATORS);
+
/* Propagation of const and copies may make some EH edges dead. Purge
such edges from the CFG as needed. */
if (!bitmap_empty_p (need_eh_cleanup))
{
- cfg_altered |= tree_purge_all_dead_eh_edges (need_eh_cleanup);
+ tree_purge_all_dead_eh_edges (need_eh_cleanup);
BITMAP_FREE (need_eh_cleanup);
}
BITMAP_FREE (interesting_names);
BITMAP_FREE (interesting_names1);
- if (cfg_altered)
- free_dominance_info (CDI_DOMINATORS);
return 0;
}
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index bb5d14d78f9..596d4a8ee6b 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -237,6 +237,59 @@ memory_address_same (tree store1, tree store2)
== NULL);
}
+/* Return the use stmt for the lhs of STMT following the virtual
+ def-use chains. Returns the MODIFY_EXPR stmt which lhs is equal to
+ the lhs of STMT or NULL_TREE if no such stmt can be found. */
+static tree
+get_use_of_stmt_lhs (tree stmt,
+ use_operand_p * first_use_p,
+ use_operand_p * use_p, tree * use_stmt)
+{
+ tree usevar, lhs;
+ def_operand_p def_p;
+
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ return NULL_TREE;
+
+ lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+
+ /* The stmt must have a single VDEF. */
+ def_p = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_VDEF);
+ if (def_p == NULL_DEF_OPERAND_P)
+ return NULL_TREE;
+
+ if (!has_single_use (DEF_FROM_PTR (def_p)))
+ return NULL_TREE;
+ /* Get the immediate use of the def. */
+ single_imm_use (DEF_FROM_PTR (def_p), use_p, use_stmt);
+ gcc_assert (*use_p != NULL_USE_OPERAND_P);
+ first_use_p = use_p;
+ if (TREE_CODE (*use_stmt) != GIMPLE_MODIFY_STMT)
+ return NULL_TREE;
+
+ do
+ {
+ /* Look at the use stmt and see if it's LHS matches
+ stmt's lhs SSA_NAME. */
+ def_p = SINGLE_SSA_DEF_OPERAND (*use_stmt, SSA_OP_VDEF);
+ if (def_p == NULL_DEF_OPERAND_P)
+ return NULL_TREE;
+
+ usevar = GIMPLE_STMT_OPERAND (*use_stmt, 0);
+ if (operand_equal_p (usevar, lhs, 0))
+ return *use_stmt;
+
+ if (!has_single_use (DEF_FROM_PTR (def_p)))
+ return NULL_TREE;
+ single_imm_use (DEF_FROM_PTR (def_p), use_p, use_stmt);
+ gcc_assert (*use_p != NULL_USE_OPERAND_P);
+ if (TREE_CODE (*use_stmt) != GIMPLE_MODIFY_STMT)
+ return NULL_TREE;
+ }
+ while (1);
+
+ return NULL_TREE;
+}
/* A helper of dse_optimize_stmt.
Given a GIMPLE_MODIFY_STMT in STMT, check that each VDEF has one
@@ -593,10 +646,29 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
/* If this is a partial store into an aggregate, record it. */
dse_record_partial_aggregate_store (stmt, dse_gd);
- /* If we have precisely one immediate use at this point, then we may
- have found redundant store. Make sure that the stores are to
- the same memory location. This includes checking that any
- SSA-form variables in the address will have the same values. */
+ if (use_p != NULL_USE_OPERAND_P
+ && bitmap_bit_p (dse_gd->stores, get_stmt_uid (use_stmt))
+ && (!operand_equal_p (GIMPLE_STMT_OPERAND (stmt, 0),
+ GIMPLE_STMT_OPERAND (use_stmt, 0), 0)
+ && !dse_partial_kill_p (stmt, dse_gd))
+ && memory_address_same (stmt, use_stmt))
+ {
+ /* If we have precisely one immediate use at this point, but
+ the stores are not to the same memory location then walk the
+ virtual def-use chain to get the stmt which stores to that same
+ memory location. */
+ if (get_use_of_stmt_lhs (stmt, &first_use_p, &use_p, &use_stmt) ==
+ NULL_TREE)
+ {
+ record_voperand_set (dse_gd->stores, &bd->stores, ann->uid);
+ return;
+ }
+ }
+
+ /* If we have precisely one immediate use at this point and the
+ stores are to the same memory location or there is a chain of
+ virtual uses from stmt and the stmt which stores to that same
+ memory location, then we may have found redundant store. */
if (use_p != NULL_USE_OPERAND_P
&& bitmap_bit_p (dse_gd->stores, get_stmt_uid (use_stmt))
&& (operand_equal_p (GIMPLE_STMT_OPERAND (stmt, 0),
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index d91aa89325d..2afdd9a6332 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -727,7 +727,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
continue;
}
- /* If the use is in a deeper loop nest, then we do not want
+ /* If the use is in a deeper loop nest, then we do not want
to propagate the ADDR_EXPR into the loop as that is likely
adding expression evaluations into the loop. */
if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth)
@@ -735,7 +735,14 @@ forward_propagate_addr_expr (tree name, tree rhs)
all = false;
continue;
}
-
+
+ /* If the use_stmt has side-effects, don't propagate into it. */
+ if (stmt_ann (use_stmt)->has_volatile_ops)
+ {
+ all = false;
+ continue;
+ }
+
push_stmt_changes (&use_stmt);
result = forward_propagate_addr_expr_1 (name, rhs, use_stmt,
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index c5578cfc9e3..c3fb5424591 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -316,10 +316,10 @@ outermost_invariant_loop (tree def, struct loop *loop)
if (LIM_DATA (def_stmt) && LIM_DATA (def_stmt)->max_loop)
max_loop = find_common_loop (max_loop,
- LIM_DATA (def_stmt)->max_loop->outer);
+ loop_outer (LIM_DATA (def_stmt)->max_loop));
if (max_loop == loop)
return NULL;
- max_loop = superloop_at_depth (loop, max_loop->depth + 1);
+ max_loop = superloop_at_depth (loop, loop_depth (max_loop) + 1);
return max_loop;
}
@@ -525,7 +525,7 @@ set_level (tree stmt, struct loop *orig_loop, struct loop *level)
stmt_loop = find_common_loop (orig_loop, stmt_loop);
if (LIM_DATA (stmt) && LIM_DATA (stmt)->tgt_loop)
stmt_loop = find_common_loop (stmt_loop,
- LIM_DATA (stmt)->tgt_loop->outer);
+ loop_outer (LIM_DATA (stmt)->tgt_loop));
if (flow_loop_nested_p (stmt_loop, level))
return;
@@ -709,12 +709,12 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
bool maybe_never = ALWAYS_EXECUTED_IN (bb) == NULL;
struct loop *outermost = ALWAYS_EXECUTED_IN (bb);
- if (!bb->loop_father->outer)
+ if (!loop_outer (bb->loop_father))
return;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Basic block %d (loop %d -- depth %d):\n\n",
- bb->index, bb->loop_father->num, bb->loop_father->depth);
+ bb->index, bb->loop_father->num, loop_depth (bb->loop_father));
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
@@ -774,7 +774,7 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
{
print_generic_stmt_indented (dump_file, stmt, 0, 2);
fprintf (dump_file, " invariant up to level %d, cost %d.\n\n",
- LIM_DATA (stmt)->max_loop->depth,
+ loop_depth (LIM_DATA (stmt)->max_loop),
LIM_DATA (stmt)->cost);
}
@@ -794,6 +794,7 @@ determine_invariantness (void)
struct dom_walk_data walk_data;
memset (&walk_data, 0, sizeof (struct dom_walk_data));
+ walk_data.dom_direction = CDI_DOMINATORS;
walk_data.before_dom_children_before_stmts = determine_invariantness_stmt;
init_walk_dominator_tree (&walk_data);
@@ -814,7 +815,7 @@ move_computations_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
tree stmt;
unsigned cost = 0;
- if (!bb->loop_father->outer)
+ if (!loop_outer (bb->loop_father))
return;
for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
@@ -864,6 +865,7 @@ move_computations (void)
struct dom_walk_data walk_data;
memset (&walk_data, 0, sizeof (struct dom_walk_data));
+ walk_data.dom_direction = CDI_DOMINATORS;
walk_data.before_dom_children_before_stmts = move_computations_stmt;
init_walk_dominator_tree (&walk_data);
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 3416df32d3c..16b126dc457 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -244,7 +244,7 @@ find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks,
def_loop = def_bb->loop_father;
/* If the definition is not inside loop, it is not interesting. */
- if (!def_loop->outer)
+ if (!loop_outer (def_loop))
return;
if (!use_blocks[ver])
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 814b23a7843..301b6e340e6 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -2364,7 +2364,7 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound,
list. */
if (upper)
{
- struct nb_iter_bound *elt = XNEW (struct nb_iter_bound);
+ struct nb_iter_bound *elt = GGC_NEW (struct nb_iter_bound);
elt->bound = i_bound;
elt->stmt = at_stmt;
@@ -3023,7 +3023,7 @@ free_numbers_of_iterations_estimates_loop (struct loop *loop)
for (bound = loop->bounds; bound; bound = next)
{
next = bound->next;
- free (bound);
+ ggc_free (bound);
}
loop->bounds = NULL;
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 7457e5396d9..c5724cbcf86 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -171,7 +171,8 @@ struct tree_opt_pass pass_tree_unswitch =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */
+ TODO_ggc_collect | TODO_dump_func
+ | TODO_verify_loops, /* todo_flags_finish */
0 /* letter */
};
@@ -202,7 +203,8 @@ struct tree_opt_pass pass_vectorize =
0, /* properties_provided */
0, /* properties_destroyed */
TODO_verify_loops, /* todo_flags_start */
- TODO_dump_func | TODO_update_ssa, /* todo_flags_finish */
+ TODO_dump_func | TODO_update_ssa
+ | TODO_ggc_collect, /* todo_flags_finish */
0 /* letter */
};
@@ -237,7 +239,8 @@ struct tree_opt_pass pass_linear_transform =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */
+ TODO_dump_func | TODO_verify_loops
+ | TODO_ggc_collect, /* todo_flags_finish */
0 /* letter */
};
@@ -361,7 +364,8 @@ struct tree_opt_pass pass_empty_loop =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */
+ TODO_dump_func | TODO_verify_loops
+ | TODO_ggc_collect, /* todo_flags_finish */
0 /* letter */
};
@@ -427,7 +431,8 @@ struct tree_opt_pass pass_complete_unroll =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */
+ TODO_dump_func | TODO_verify_loops
+ | TODO_ggc_collect, /* todo_flags_finish */
0 /* letter */
};
@@ -496,9 +501,8 @@ struct tree_opt_pass pass_iv_optimize =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func
- | TODO_verify_loops
- | TODO_update_ssa, /* todo_flags_finish */
+ TODO_dump_func | TODO_verify_loops
+ | TODO_update_ssa | TODO_ggc_collect, /* todo_flags_finish */
0 /* letter */
};
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 04658aa71b6..5e76f45cd25 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1075,8 +1075,8 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
newexpr->base.ann = NULL;
vn_lookup_or_add_with_vuses (newexpr, tvuses);
expr = newexpr;
- phi_trans_add (oldexpr, newexpr, pred, tvuses);
}
+ phi_trans_add (oldexpr, expr, pred, tvuses);
}
}
return expr;
@@ -1188,8 +1188,8 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
vn_lookup_or_add_with_vuses (newexpr, newvuses);
}
expr = newexpr;
- phi_trans_add (oldexpr, newexpr, pred, newvuses);
}
+ phi_trans_add (oldexpr, expr, pred, newvuses);
}
return expr;
break;
@@ -1233,8 +1233,8 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
vn_lookup_or_add (newexpr, NULL);
}
expr = newexpr;
- phi_trans_add (oldexpr, newexpr, pred, NULL);
}
+ phi_trans_add (oldexpr, expr, pred, NULL);
}
return expr;
@@ -1266,8 +1266,8 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
vn_lookup_or_add (newexpr, NULL);
}
expr = newexpr;
- phi_trans_add (oldexpr, newexpr, pred, NULL);
}
+ phi_trans_add (oldexpr, expr, pred, NULL);
}
return expr;
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index c6b52095716..22266bd355c 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -315,6 +315,7 @@ create_edge_and_update_destination_phis (struct redirection_data *rd)
e->probability = REG_BR_PROB_BASE;
e->count = rd->dup_block->count;
+ e->aux = rd->outgoing_edge->aux;
/* If there are any PHI nodes at the destination of the outgoing edge
from the duplicate block, then we will need to add a new argument
@@ -385,199 +386,6 @@ fixup_template_block (void **slot, void *data)
return 1;
}
-/* Not all jump threading requests are useful. In particular some
- jump threading requests can create irreducible regions which are
- undesirable.
-
- This routine will examine the BB's incoming edges for jump threading
- requests which, if acted upon, would create irreducible regions. Any
- such jump threading requests found will be pruned away. */
-
-static void
-prune_undesirable_thread_requests (basic_block bb)
-{
- edge e;
- edge_iterator ei;
- bool may_create_irreducible_region = false;
- unsigned int num_outgoing_edges_into_loop = 0;
-
- /* For the heuristics below, we need to know if BB has more than
- one outgoing edge into a loop. */
- FOR_EACH_EDGE (e, ei, bb->succs)
- num_outgoing_edges_into_loop += ((e->flags & EDGE_LOOP_EXIT) == 0);
-
- if (num_outgoing_edges_into_loop > 1)
- {
- edge backedge = NULL;
-
- /* Consider the effect of threading the edge (0, 1) to 2 on the left
- CFG to produce the right CFG:
-
-
- 0 0
- | |
- 1<--+ 2<--------+
- / \ | | |
- 2 3 | 4<----+ |
- \ / | / \ | |
- 4---+ E 1-- | --+
- | | |
- E 3---+
-
-
- Threading the (0, 1) edge to 2 effectively creates two loops
- (2, 4, 1) and (4, 1, 3) which are neither disjoint nor nested.
- This is not good.
-
- However, we do need to be able to thread (0, 1) to 2 or 3
- in the left CFG below (which creates the middle and right
- CFGs with nested loops).
-
- 0 0 0
- | | |
- 1<--+ 2<----+ 3<-+<-+
- /| | | | | | |
- 2 | | 3<-+ | 1--+ |
- \| | | | | | |
- 3---+ 1--+--+ 2-----+
-
-
- A safe heuristic appears to be to only allow threading if BB
- has a single incoming backedge from one of its direct successors. */
-
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- if (e->flags & EDGE_DFS_BACK)
- {
- if (backedge)
- {
- backedge = NULL;
- break;
- }
- else
- {
- backedge = e;
- }
- }
- }
-
- if (backedge && find_edge (bb, backedge->src))
- ;
- else
- may_create_irreducible_region = true;
- }
- else
- {
- edge dest = NULL;
-
- /* If we thread across the loop entry block (BB) into the
- loop and BB is still reached from outside the loop, then
- we would create an irreducible CFG. Consider the effect
- of threading the edge (1, 4) to 5 on the left CFG to produce
- the right CFG
-
- 0 0
- / \ / \
- 1 2 1 2
- \ / | |
- 4<----+ 5<->4
- / \ | |
- E 5---+ E
-
-
- Threading the (1, 4) edge to 5 creates two entry points
- into the loop (4, 5) (one from block 1, the other from
- block 2). A classic irreducible region.
-
- So look at all of BB's incoming edges which are not
- backedges and which are not threaded to the loop exit.
- If that subset of incoming edges do not all thread
- to the same block, then threading any of them will create
- an irreducible region. */
-
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- edge e2;
-
- /* We ignore back edges for now. This may need refinement
- as threading a backedge creates an inner loop which
- we would need to verify has a single entry point.
-
- If all backedges thread to new locations, then this
- block will no longer have incoming backedges and we
- need not worry about creating irreducible regions
- by threading through BB. I don't think this happens
- enough in practice to worry about it. */
- if (e->flags & EDGE_DFS_BACK)
- continue;
-
- /* If the incoming edge threads to the loop exit, then it
- is clearly safe. */
- e2 = e->aux;
- if (e2 && (e2->flags & EDGE_LOOP_EXIT))
- continue;
-
- /* E enters the loop header and is not threaded. We can
- not allow any other incoming edges to thread into
- the loop as that would create an irreducible region. */
- if (!e2)
- {
- may_create_irreducible_region = true;
- break;
- }
-
- /* We know that this incoming edge threads to a block inside
- the loop. This edge must thread to the same target in
- the loop as any previously seen threaded edges. Otherwise
- we will create an irreducible region. */
- if (!dest)
- dest = e2;
- else if (e2 != dest)
- {
- may_create_irreducible_region = true;
- break;
- }
- }
- }
-
- /* If we might create an irreducible region, then cancel any of
- the jump threading requests for incoming edges which are
- not backedges and which do not thread to the exit block. */
- if (may_create_irreducible_region)
- {
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- edge e2;
-
- /* Ignore back edges. */
- if (e->flags & EDGE_DFS_BACK)
- continue;
-
- e2 = e->aux;
-
- /* If this incoming edge was not threaded, then there is
- nothing to do. */
- if (!e2)
- continue;
-
- /* If this incoming edge threaded to the loop exit,
- then it can be ignored as it is safe. */
- if (e2->flags & EDGE_LOOP_EXIT)
- continue;
-
- if (e2)
- {
- /* This edge threaded into the loop and the jump thread
- request must be cancelled. */
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " Not threading jump %d --> %d to %d\n",
- e->src->index, e->dest->index, e2->dest->index);
- e->aux = NULL;
- }
- }
- }
-}
-
/* Hash table traversal callback to redirect each incoming edge
associated with this hash table element to its new destination. */
@@ -620,11 +428,8 @@ redirect_edges (void **slot, void *data)
/* Redirect the incoming edge to the appropriate duplicate
block. */
e2 = redirect_edge_and_branch (e, rd->dup_block);
+ gcc_assert (e == e2);
flush_pending_stmts (e2);
-
- if ((dump_file && (dump_flags & TDF_DETAILS))
- && e->src != e2->src)
- fprintf (dump_file, " basic block %d created\n", e2->src->index);
}
else
{
@@ -696,46 +501,23 @@ redirection_block_p (basic_block bb)
successor of BB. We then revector the incoming edges into BB to
the appropriate duplicate of BB.
- BB and its duplicates will have assignments to the same set of
- SSA_NAMEs. Right now, we just call into update_ssa to update the
- SSA graph for those names.
-
- We are also going to experiment with a true incremental update
- scheme for the duplicated resources. One of the interesting
- properties we can exploit here is that all the resources set
- in BB will have the same IDFS, so we have one IDFS computation
- per block with incoming threaded edges, which can lower the
- cost of the true incremental update algorithm. */
+ If NOLOOP_ONLY is true, we only perform the threading as long as it
+ does not affect the structure of the loops in a nontrivial way. */
static bool
-thread_block (basic_block bb)
+thread_block (basic_block bb, bool noloop_only)
{
/* E is an incoming edge into BB that we may or may not want to
redirect to a duplicate of BB. */
- edge e;
+ edge e, e2;
edge_iterator ei;
struct local_info local_info;
-
- /* FOUND_BACKEDGE indicates that we found an incoming backedge
- into BB, in which case we may ignore certain jump threads
- to avoid creating irreducible regions. */
- bool found_backedge = false;
+ struct loop *loop = bb->loop_father;
/* ALL indicates whether or not all incoming edges into BB should
be threaded to a duplicate of BB. */
bool all = true;
- /* If optimizing for size, only thread this block if we don't have
- to duplicate it or it's an otherwise empty redirection block. */
- if (optimize_size
- && EDGE_COUNT (bb->preds) > 1
- && !redirection_block_p (bb))
- {
- FOR_EACH_EDGE (e, ei, bb->preds)
- e->aux = NULL;
- return false;
- }
-
/* To avoid scanning a linear array for the element we need we instead
use a hash table. For normal code there should be no noticeable
difference. However, if we have a block with a large number of
@@ -745,35 +527,45 @@ thread_block (basic_block bb)
redirection_data_eq,
free);
- FOR_EACH_EDGE (e, ei, bb->preds)
- found_backedge |= ((e->flags & EDGE_DFS_BACK) != 0);
+ /* If we thread the latch of the loop to its exit, the loop ceases to
+ exist. Make sure we do not restrict ourselves in order to preserve
+ this loop. */
+ if (current_loops && loop->header == bb)
+ {
+ e = loop_latch_edge (loop);
+ e2 = e->aux;
- /* If BB has incoming backedges, then threading across BB might
- introduce an irreducible region, which would be undesirable
- as that inhibits various optimizations later. Prune away
- any jump threading requests which we know will result in
- an irreducible region. */
- if (found_backedge)
- prune_undesirable_thread_requests (bb);
+ if (e2 && loop_exit_edge_p (loop, e2))
+ {
+ loop->header = NULL;
+ loop->latch = NULL;
+ }
+ }
/* Record each unique threaded destination into a hash table for
efficient lookups. */
FOR_EACH_EDGE (e, ei, bb->preds)
{
- if (!e->aux)
+ e2 = e->aux;
+
+ if (!e2
+ /* If NOLOOP_ONLY is true, we only allow threading through the
+ header of a loop to exit edges. */
+ || (noloop_only
+ && current_loops
+ && bb == bb->loop_father->header
+ && !loop_exit_edge_p (bb->loop_father, e2)))
{
all = false;
+ continue;
}
- else
- {
- edge e2 = e->aux;
- update_bb_profile_for_threading (e->dest, EDGE_FREQUENCY (e),
- e->count, e->aux);
- /* Insert the outgoing edge into the hash table if it is not
- already in the hash table. */
- lookup_redirection_data (e2, e, INSERT);
- }
+ update_bb_profile_for_threading (e->dest, EDGE_FREQUENCY (e),
+ e->count, e->aux);
+
+ /* Insert the outgoing edge into the hash table if it is not
+ already in the hash table. */
+ lookup_redirection_data (e2, e, INSERT);
}
/* If we are going to thread all incoming edges to an outgoing edge, then
@@ -821,6 +613,339 @@ thread_block (basic_block bb)
return local_info.jumps_threaded;
}
+/* Threads edge E through E->dest to the edge E->aux. Returns the copy
+ of E->dest created during threading, or E->dest if it was not necessary
+ to copy it (E is its single predecessor). */
+
+static basic_block
+thread_single_edge (edge e)
+{
+ basic_block bb = e->dest;
+ edge eto = e->aux;
+ struct redirection_data rd;
+ struct local_info local_info;
+
+ e->aux = NULL;
+
+ thread_stats.num_threaded_edges++;
+
+ if (single_pred_p (bb))
+ {
+ /* If BB has just a single predecessor, we should only remove the
+ control statements at its end, and successors except for ETO. */
+ remove_ctrl_stmt_and_useless_edges (bb, eto->dest);
+ return bb;
+ }
+
+ /* Otherwise, we need to create a copy. */
+ update_bb_profile_for_threading (bb, EDGE_FREQUENCY (e), e->count, eto);
+
+ local_info.bb = bb;
+ rd.outgoing_edge = eto;
+
+ create_block_for_threading (bb, &rd);
+ create_edge_and_update_destination_phis (&rd);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Threaded jump %d --> %d to %d\n",
+ e->src->index, e->dest->index, rd.dup_block->index);
+
+ rd.dup_block->count = e->count;
+ rd.dup_block->frequency = EDGE_FREQUENCY (e);
+ single_succ_edge (rd.dup_block)->count = e->count;
+ redirect_edge_and_branch (e, rd.dup_block);
+ flush_pending_stmts (e);
+
+ return rd.dup_block;
+}
+
+/* Callback for dfs_enumerate_from. Returns true if BB is different
+ from STOP and DBDS_CE_STOP. */
+
+static basic_block dbds_ce_stop;
+static bool
+dbds_continue_enumeration_p (basic_block bb, void *stop)
+{
+ return (bb != (basic_block) stop
+ && bb != dbds_ce_stop);
+}
+
+/* Evaluates the dominance relationship of latch of the LOOP and BB, and
+ returns the state. */
+
+enum bb_dom_status
+{
+ /* BB does not dominate latch of the LOOP. */
+ DOMST_NONDOMINATING,
+ /* The LOOP is broken (there is no path from the header to its latch. */
+ DOMST_LOOP_BROKEN,
+ /* BB dominates the latch of the LOOP. */
+ DOMST_DOMINATING
+};
+
+static enum bb_dom_status
+determine_bb_domination_status (struct loop *loop, basic_block bb)
+{
+ basic_block *bblocks;
+ unsigned nblocks, i;
+ bool bb_reachable = false;
+ edge_iterator ei;
+ edge e;
+
+#ifdef ENABLE_CHECKING
+ /* This function assumes BB is a successor of LOOP->header. */
+ {
+ bool ok = false;
+
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ {
+ if (e->src == loop->header)
+ {
+ ok = true;
+ break;
+ }
+ }
+
+ gcc_assert (ok);
+ }
+#endif
+
+ if (bb == loop->latch)
+ return DOMST_DOMINATING;
+
+ /* Check that BB dominates LOOP->latch, and that it is back-reachable
+ from it. */
+
+ bblocks = XCNEWVEC (basic_block, loop->num_nodes);
+ dbds_ce_stop = loop->header;
+ nblocks = dfs_enumerate_from (loop->latch, 1, dbds_continue_enumeration_p,
+ bblocks, loop->num_nodes, bb);
+ for (i = 0; i < nblocks; i++)
+ FOR_EACH_EDGE (e, ei, bblocks[i]->preds)
+ {
+ if (e->src == loop->header)
+ {
+ free (bblocks);
+ return DOMST_NONDOMINATING;
+ }
+ if (e->src == bb)
+ bb_reachable = true;
+ }
+
+ free (bblocks);
+ return (bb_reachable ? DOMST_DOMINATING : DOMST_LOOP_BROKEN);
+}
+
+/* Thread jumps through the header of LOOP. Returns true if cfg changes.
+ If MAY_PEEL_LOOP_HEADERS is false, we avoid threading from entry edges
+ to the inside of the loop. */
+
+static bool
+thread_through_loop_header (struct loop *loop, bool may_peel_loop_headers)
+{
+ basic_block header = loop->header;
+ edge e, tgt_edge, latch = loop_latch_edge (loop);
+ edge_iterator ei;
+ basic_block tgt_bb, atgt_bb;
+ enum bb_dom_status domst;
+
+ /* We have already threaded through headers to exits, so all the threading
+ requests now are to the inside of the loop. We need to avoid creating
+ irreducible regions (i.e., loops with more than one entry block), and
+ also loop with several latch edges, or new subloops of the loop (although
+ there are cases where it might be appropriate, it is difficult to decide,
+ and doing it wrongly may confuse other optimizers).
+
+ We could handle more general cases here. However, the intention is to
+ preserve some information about the loop, which is impossible if its
+ structure changes significantly, in a way that is not well understood.
+ Thus we only handle few important special cases, in which also updating
+ of the loop-carried information should be feasible:
+
+ 1) Propagation of latch edge to a block that dominates the latch block
+ of a loop. This aims to handle the following idiom:
+
+ first = 1;
+ while (1)
+ {
+ if (first)
+ initialize;
+ first = 0;
+ body;
+ }
+
+ After threading the latch edge, this becomes
+
+ first = 1;
+ if (first)
+ initialize;
+ while (1)
+ {
+ first = 0;
+ body;
+ }
+
+ The original header of the loop is moved out of it, and we may thread
+ the remaining edges through it without further constraints.
+
+ 2) All entry edges are propagated to a single basic block that dominates
+ the latch block of the loop. This aims to handle the following idiom
+ (normally created for "for" loops):
+
+ i = 0;
+ while (1)
+ {
+ if (i >= 100)
+ break;
+ body;
+ i++;
+ }
+
+ This becomes
+
+ i = 0;
+ while (1)
+ {
+ body;
+ i++;
+ if (i >= 100)
+ break;
+ }
+ */
+
+ /* Threading through the header won't improve the code if the header has just
+ one successor. */
+ if (single_succ_p (header))
+ goto fail;
+
+ if (latch->aux)
+ {
+ tgt_edge = latch->aux;
+ tgt_bb = tgt_edge->dest;
+ }
+ else if (!may_peel_loop_headers
+ && !redirection_block_p (loop->header))
+ goto fail;
+ else
+ {
+ tgt_bb = NULL;
+ tgt_edge = NULL;
+ FOR_EACH_EDGE (e, ei, header->preds)
+ {
+ if (!e->aux)
+ {
+ if (e == latch)
+ continue;
+
+ /* If latch is not threaded, and there is a header
+ edge that is not threaded, we would create loop
+ with multiple entries. */
+ goto fail;
+ }
+
+ tgt_edge = e->aux;
+ atgt_bb = tgt_edge->dest;
+ if (!tgt_bb)
+ tgt_bb = atgt_bb;
+ /* Two targets of threading would make us create loop
+ with multiple entries. */
+ else if (tgt_bb != atgt_bb)
+ goto fail;
+ }
+
+ if (!tgt_bb)
+ {
+ /* There are no threading requests. */
+ return false;
+ }
+
+ /* Redirecting to empty loop latch is useless. */
+ if (tgt_bb == loop->latch
+ && empty_block_p (loop->latch))
+ goto fail;
+ }
+
+ /* The target block must dominate the loop latch, otherwise we would be
+ creating a subloop. */
+ domst = determine_bb_domination_status (loop, tgt_bb);
+ if (domst == DOMST_NONDOMINATING)
+ goto fail;
+ if (domst == DOMST_LOOP_BROKEN)
+ {
+ /* If the loop ceased to exist, mark it as such, and thread through its
+ original header. */
+ loop->header = NULL;
+ loop->latch = NULL;
+ return thread_block (header, false);
+ }
+
+ if (tgt_bb->loop_father->header == tgt_bb)
+ {
+ /* If the target of the threading is a header of a subloop, we need
+ to create a preheader for it, so that the headers of the two loops
+ do not merge. */
+ if (EDGE_COUNT (tgt_bb->preds) > 2)
+ {
+ tgt_bb = create_preheader (tgt_bb->loop_father, 0);
+ gcc_assert (tgt_bb != NULL);
+ }
+ else
+ tgt_bb = split_edge (tgt_edge);
+ }
+
+ if (latch->aux)
+ {
+ /* First handle the case latch edge is redirected. */
+ loop->latch = thread_single_edge (latch);
+ gcc_assert (single_succ (loop->latch) == tgt_bb);
+ loop->header = tgt_bb;
+
+ /* Thread the remaining edges through the former header. */
+ thread_block (header, false);
+ }
+ else
+ {
+ basic_block new_preheader;
+
+ /* Now consider the case entry edges are redirected to the new entry
+ block. Remember one entry edge, so that we can find the new
+ preheader (its destination after threading). */
+ FOR_EACH_EDGE (e, ei, header->preds)
+ {
+ if (e->aux)
+ break;
+ }
+
+ /* The duplicate of the header is the new preheader of the loop. Ensure
+ that it is placed correctly in the loop hierarchy. */
+ loop->copy = loop_outer (loop);
+
+ thread_block (header, false);
+ loop->copy = NULL;
+ new_preheader = e->dest;
+
+ /* Create the new latch block. This is always necessary, as the latch
+ must have only a single successor, but the original header had at
+ least two successors. */
+ loop->latch = NULL;
+ mfb_kj_edge = single_succ_edge (new_preheader);
+ loop->header = mfb_kj_edge->dest;
+ latch = make_forwarder_block (tgt_bb, mfb_keep_just, NULL);
+ loop->header = latch->dest;
+ loop->latch = latch->src;
+ }
+
+ return true;
+
+fail:
+ /* We failed to thread anything. Cancel the requests. */
+ FOR_EACH_EDGE (e, ei, header->preds)
+ {
+ e->aux = NULL;
+ }
+ return false;
+}
+
/* Walk through the registered jump threads and convert them into a
form convenient for this pass.
@@ -838,6 +963,11 @@ static void
mark_threaded_blocks (bitmap threaded_blocks)
{
unsigned int i;
+ bitmap_iterator bi;
+ bitmap tmp = BITMAP_ALLOC (NULL);
+ basic_block bb;
+ edge e;
+ edge_iterator ei;
for (i = 0; i < VEC_length (edge, threaded_edges); i += 2)
{
@@ -845,8 +975,30 @@ mark_threaded_blocks (bitmap threaded_blocks)
edge e2 = VEC_index (edge, threaded_edges, i + 1);
e->aux = e2;
- bitmap_set_bit (threaded_blocks, e->dest->index);
+ bitmap_set_bit (tmp, e->dest->index);
+ }
+
+ /* If optimizing for size, only thread through block if we don't have
+ to duplicate it or it's an otherwise empty redirection block. */
+ if (optimize_size)
+ {
+ EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, bi)
+ {
+ bb = BASIC_BLOCK (i);
+ if (EDGE_COUNT (bb->preds) > 1
+ && !redirection_block_p (bb))
+ {
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ e->aux = NULL;
+ }
+ else
+ bitmap_set_bit (threaded_blocks, i);
+ }
}
+ else
+ bitmap_copy (threaded_blocks, tmp);
+
+ BITMAP_FREE(tmp);
}
@@ -856,15 +1008,20 @@ mark_threaded_blocks (bitmap threaded_blocks)
It is the caller's responsibility to fix the dominance information
and rewrite duplicated SSA_NAMEs back into SSA form.
+ If MAY_PEEL_LOOP_HEADERS is false, we avoid threading edges through
+ loop headers if it does not simplify the loop.
+
Returns true if one or more edges were threaded, false otherwise. */
bool
-thread_through_all_blocks (void)
+thread_through_all_blocks (bool may_peel_loop_headers)
{
bool retval = false;
unsigned int i;
bitmap_iterator bi;
bitmap threaded_blocks;
+ struct loop *loop;
+ loop_iterator li;
if (threaded_edges == NULL)
return false;
@@ -874,14 +1031,38 @@ thread_through_all_blocks (void)
mark_threaded_blocks (threaded_blocks);
+ if (current_loops)
+ FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
+ loop->copy = NULL;
+
+ /* First perform the threading requests that do not affect
+ loop structure. */
EXECUTE_IF_SET_IN_BITMAP (threaded_blocks, 0, i, bi)
{
basic_block bb = BASIC_BLOCK (i);
if (EDGE_COUNT (bb->preds) > 0)
- retval |= thread_block (bb);
+ retval |= thread_block (bb, true);
+ }
+
+ /* Then perform the threading through loop headers. We start with the
+ innermost loop, so that the changes in cfg we perform won't affect
+ further threading. */
+ if (current_loops)
+ {
+ FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
+ {
+ if (!loop->header
+ || !bitmap_bit_p (threaded_blocks, loop->header->index))
+ continue;
+
+ retval |= thread_through_loop_header (loop, may_peel_loop_headers);
+ }
}
+ if (retval)
+ free_dominance_info (CDI_DOMINATORS);
+
if (dump_file && (dump_flags & TDF_STATS))
fprintf (dump_file, "\nJumps threaded: %lu\n",
thread_stats.num_threaded_edges);
@@ -890,6 +1071,7 @@ thread_through_all_blocks (void)
threaded_blocks = NULL;
VEC_free (edge, heap, threaded_edges);
threaded_edges = NULL;
+
return retval;
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 51e1fa2af4b..3dfc34f05b9 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -606,7 +606,7 @@ verify_ssa (bool check_modified_stmt)
basic_block *definition_block = XCNEWVEC (basic_block, num_ssa_names);
ssa_op_iter iter;
tree op;
- enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS];
+ enum dom_state orig_dom_state = dom_info_state (CDI_DOMINATORS);
bitmap names_defined_in_bb = BITMAP_ALLOC (NULL);
gcc_assert (!need_ssa_update_p ());
@@ -747,7 +747,7 @@ verify_ssa (bool check_modified_stmt)
if (orig_dom_state == DOM_NONE)
free_dominance_info (CDI_DOMINATORS);
else
- dom_computed[CDI_DOMINATORS] = orig_dom_state;
+ set_dom_info_availability (CDI_DOMINATORS, orig_dom_state);
BITMAP_FREE (names_defined_in_bb);
timevar_pop (TV_TREE_SSA_VERIFY);
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 3a4841d2c05..f928973a408 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -1130,15 +1130,14 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
/* Initialize misalignment to unknown. */
DR_MISALIGNMENT (dr) = -1;
- misalign = DR_OFFSET_MISALIGNMENT (dr);
+ misalign = DR_INIT (dr);
aligned_to = DR_ALIGNED_TO (dr);
base_addr = DR_BASE_ADDRESS (dr);
base = build_fold_indirect_ref (base_addr);
vectype = STMT_VINFO_VECTYPE (stmt_info);
alignment = ssize_int (TYPE_ALIGN (vectype)/BITS_PER_UNIT);
- if ((aligned_to && tree_int_cst_compare (aligned_to, alignment) < 0)
- || !misalign)
+ if (tree_int_cst_compare (aligned_to, alignment) < 0)
{
if (vect_print_dump_info (REPORT_DETAILS))
{
@@ -2044,7 +2043,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
}
return false;
}
- if (!DR_MEMTAG (dr))
+ if (!DR_SYMBOL_TAG (dr))
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
{
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 0b9b91f6d9a..e955c44743c 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -421,8 +421,11 @@ expand_vector_operations_1 (block_stmt_iterator *bsi)
|| code == VEC_WIDEN_MULT_LO_EXPR
|| code == VEC_UNPACK_HI_EXPR
|| code == VEC_UNPACK_LO_EXPR
+ || code == VEC_UNPACK_FLOAT_HI_EXPR
+ || code == VEC_UNPACK_FLOAT_LO_EXPR
|| code == VEC_PACK_TRUNC_EXPR
- || code == VEC_PACK_SAT_EXPR)
+ || code == VEC_PACK_SAT_EXPR
+ || code == VEC_PACK_FIX_TRUNC_EXPR)
type = TREE_TYPE (TREE_OPERAND (rhs, 0));
/* Optabs will try converting a negation into a subtraction, so
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 0ecbba59e84..30e7211354c 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -210,7 +210,7 @@ vect_create_addr_base_for_vector_ref (tree stmt,
accessed in the loop by STMT, along with the def-use update chain to
appropriately advance the pointer through the loop iterations. Also set
aliasing information for the pointer. This vector pointer is used by the
- callers to this function to create a memory reference expression for vector
+ callers to this function to create a memory reference expression for vector
load/store access.
Input:
@@ -298,7 +298,7 @@ vect_create_data_ref_ptr (tree stmt,
/** (2) Add aliasing information to the new vector-pointer:
(The points-to info (DR_PTR_INFO) may be defined later.) **/
- tag = DR_MEMTAG (dr);
+ tag = DR_SYMBOL_TAG (dr);
gcc_assert (tag);
/* If tag is a variable (and NOT_A_TAG) than a new symbol memory
@@ -1931,6 +1931,64 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
}
+/* Function vect_gen_widened_results_half
+
+ Create a vector stmt whose code, type, number of arguments, and result
+ variable are CODE, VECTYPE, OP_TYPE, and VEC_DEST, and its arguments are
+ VEC_OPRND0 and VEC_OPRND1. The new vector stmt is to be inserted at BSI.
+ In the case that CODE is a CALL_EXPR, this means that a call to DECL
+ needs to be created (DECL is a function-decl of a target-builtin).
+ STMT is the original scalar stmt that we are vectorizing. */
+
+static tree
+vect_gen_widened_results_half (enum tree_code code, tree vectype, tree decl,
+ tree vec_oprnd0, tree vec_oprnd1, int op_type,
+ tree vec_dest, block_stmt_iterator *bsi,
+ tree stmt)
+{
+ tree expr;
+ tree new_stmt;
+ tree new_temp;
+ tree sym;
+ ssa_op_iter iter;
+
+ /* Generate half of the widened result: */
+ if (code == CALL_EXPR)
+ {
+ /* Target specific support */
+ if (op_type == binary_op)
+ expr = build_call_expr (decl, 2, vec_oprnd0, vec_oprnd1);
+ else
+ expr = build_call_expr (decl, 1, vec_oprnd0);
+ }
+ else
+ {
+ /* Generic support */
+ gcc_assert (op_type == TREE_CODE_LENGTH (code));
+ if (op_type == binary_op)
+ expr = build2 (code, vectype, vec_oprnd0, vec_oprnd1);
+ else
+ expr = build1 (code, vectype, vec_oprnd0);
+ }
+ new_stmt = build_gimple_modify_stmt (vec_dest, expr);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ vect_finish_stmt_generation (stmt, new_stmt, bsi);
+
+ if (code == CALL_EXPR)
+ {
+ FOR_EACH_SSA_TREE_OPERAND (sym, new_stmt, iter, SSA_OP_ALL_VIRTUALS)
+ {
+ if (TREE_CODE (sym) == SSA_NAME)
+ sym = SSA_NAME_VAR (sym);
+ mark_sym_for_renaming (sym);
+ }
+ }
+
+ return new_stmt;
+}
+
+
/* Function vectorizable_conversion.
Check if STMT performs a conversion operation, that can be vectorized.
@@ -1946,21 +2004,24 @@ vectorizable_conversion (tree stmt, block_stmt_iterator * bsi,
tree scalar_dest;
tree operation;
tree op0;
- tree vec_oprnd0 = NULL_TREE;
+ tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- enum tree_code code;
+ enum tree_code code, code1 = CODE_FOR_nothing, code2 = CODE_FOR_nothing;
+ tree decl1 = NULL_TREE, decl2 = NULL_TREE;
tree new_temp;
tree def, def_stmt;
enum vect_def_type dt0;
tree new_stmt;
+ stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
- int ncopies, j;
tree vectype_out, vectype_in;
+ int ncopies, j;
+ tree expr;
tree rhs_type, lhs_type;
tree builtin_decl;
- stmt_vec_info prev_stmt_info;
+ enum { NARROW, NONE, WIDEN } modifier;
/* Is STMT a vectorizable conversion? */
@@ -1998,23 +2059,36 @@ vectorizable_conversion (tree stmt, block_stmt_iterator * bsi,
scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
lhs_type = TREE_TYPE (scalar_dest);
vectype_out = get_vectype_for_scalar_type (lhs_type);
- gcc_assert (STMT_VINFO_VECTYPE (stmt_info) == vectype_out);
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
- /* FORNOW: need to extend to support short<->float conversions as well. */
- if (nunits_out != nunits_in)
+ /* FORNOW */
+ if (nunits_in == nunits_out / 2)
+ modifier = NARROW;
+ else if (nunits_out == nunits_in)
+ modifier = NONE;
+ else if (nunits_out == nunits_in / 2)
+ modifier = WIDEN;
+ else
return false;
+ if (modifier == NONE)
+ gcc_assert (STMT_VINFO_VECTYPE (stmt_info) == vectype_out);
+
/* Bail out if the types are both integral or non-integral */
if ((INTEGRAL_TYPE_P (rhs_type) && INTEGRAL_TYPE_P (lhs_type))
|| (!INTEGRAL_TYPE_P (rhs_type) && !INTEGRAL_TYPE_P (lhs_type)))
return false;
+ if (modifier == NARROW)
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+
/* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
gcc_assert (ncopies >= 1);
+ /* Check the operands of the operation. */
if (!vect_is_simple_use (op0, loop_vinfo, &def_stmt, &def, &dt0))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -2023,21 +2097,31 @@ vectorizable_conversion (tree stmt, block_stmt_iterator * bsi,
}
/* Supportable by target? */
- if (!targetm.vectorize.builtin_conversion (code, vectype_in))
+ if ((modifier == NONE
+ && !targetm.vectorize.builtin_conversion (code, vectype_in))
+ || (modifier == WIDEN
+ && !supportable_widening_operation (code, stmt, vectype_in,
+ &decl1, &decl2,
+ &code1, &code2))
+ || (modifier == NARROW
+ && !supportable_narrowing_operation (code, stmt, vectype_in,
+ &code1)))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "op not supported by target.");
return false;
}
+ if (modifier != NONE)
+ STMT_VINFO_VECTYPE (stmt_info) = vectype_in;
+
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
return true;
}
- /** Transform. **/
-
+ /** Transform. **/
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "transform conversion.");
@@ -2045,37 +2129,113 @@ vectorizable_conversion (tree stmt, block_stmt_iterator * bsi,
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
prev_stmt_info = NULL;
- for (j = 0; j < ncopies; j++)
+ switch (modifier)
{
- tree sym;
- ssa_op_iter iter;
+ case NONE:
+ for (j = 0; j < ncopies; j++)
+ {
+ tree sym;
+ ssa_op_iter iter;
- if (j == 0)
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
- else
- vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt0, vec_oprnd0);
+ if (j == 0)
+ vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
+ else
+ vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt0, vec_oprnd0);
- builtin_decl =
- targetm.vectorize.builtin_conversion (code, vectype_in);
- new_stmt = build_call_expr (builtin_decl, 1, vec_oprnd0);
+ builtin_decl =
+ targetm.vectorize.builtin_conversion (code, vectype_in);
+ new_stmt = build_call_expr (builtin_decl, 1, vec_oprnd0);
- /* Arguments are ready. create the new vector stmt. */
- new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
- FOR_EACH_SSA_TREE_OPERAND (sym, new_stmt, iter, SSA_OP_ALL_VIRTUALS)
- {
- if (TREE_CODE (sym) == SSA_NAME)
- sym = SSA_NAME_VAR (sym);
- mark_sym_for_renaming (sym);
- }
+ /* Arguments are ready. create the new vector stmt. */
+ new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ FOR_EACH_SSA_TREE_OPERAND (sym, new_stmt, iter, SSA_OP_ALL_VIRTUALS)
+ {
+ if (TREE_CODE (sym) == SSA_NAME)
+ sym = SSA_NAME_VAR (sym);
+ mark_sym_for_renaming (sym);
+ }
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
- else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
- prev_stmt_info = vinfo_for_stmt (new_stmt);
+ if (j == 0)
+ STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ break;
+
+ case WIDEN:
+ /* In case the vectorization factor (VF) is bigger than the number
+ of elements that we can fit in a vectype (nunits), we have to
+ generate more than one vector stmt - i.e - we need to "unroll"
+ the vector stmt by a factor VF/nunits. */
+ for (j = 0; j < ncopies; j++)
+ {
+ if (j == 0)
+ vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
+ else
+ vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt0, vec_oprnd0);
+
+ STMT_VINFO_VECTYPE (stmt_info) = vectype_in;
+
+ /* Generate first half of the widened result: */
+ new_stmt
+ = vect_gen_widened_results_half (code1, vectype_out, decl1,
+ vec_oprnd0, vec_oprnd1,
+ unary_op, vec_dest, bsi, stmt);
+ if (j == 0)
+ STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+
+ /* Generate second half of the widened result: */
+ new_stmt
+ = vect_gen_widened_results_half (code2, vectype_out, decl2,
+ vec_oprnd0, vec_oprnd1,
+ unary_op, vec_dest, bsi, stmt);
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ break;
+
+ case NARROW:
+ /* In case the vectorization factor (VF) is bigger than the number
+ of elements that we can fit in a vectype (nunits), we have to
+ generate more than one vector stmt - i.e - we need to "unroll"
+ the vector stmt by a factor VF/nunits. */
+ for (j = 0; j < ncopies; j++)
+ {
+ /* Handle uses. */
+ if (j == 0)
+ {
+ vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
+ vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt0, vec_oprnd0);
+ }
+ else
+ {
+ vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt0, vec_oprnd1);
+ vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt0, vec_oprnd0);
+ }
+
+ /* Arguments are ready. Create the new vector stmt. */
+ expr = build2 (code1, vectype_out, vec_oprnd0, vec_oprnd1);
+ new_stmt = build_gimple_modify_stmt (vec_dest, expr);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ vect_finish_stmt_generation (stmt, new_stmt, bsi);
+
+ if (j == 0)
+ STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+
+ *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
}
return true;
}
@@ -2525,7 +2685,7 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
bool
vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
- tree *vec_stmt)
+ tree *vec_stmt)
{
tree vec_dest;
tree scalar_dest;
@@ -2534,7 +2694,7 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
tree vec_oprnd0=NULL, vec_oprnd1=NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- enum tree_code code;
+ enum tree_code code, code1 = CODE_FOR_nothing;
tree new_temp;
tree def, def_stmt;
enum vect_def_type dt0;
@@ -2548,8 +2708,6 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
tree expr;
tree vectype_in;
tree scalar_type;
- optab optab;
- enum machine_mode vec_mode;
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -2607,13 +2765,7 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
}
/* Supportable by target? */
- code = VEC_PACK_TRUNC_EXPR;
- optab = optab_for_tree_code (code, vectype_in);
- if (!optab)
- return false;
-
- vec_mode = TYPE_MODE (vectype_in);
- if (optab->handlers[(int) vec_mode].insn_code == CODE_FOR_nothing)
+ if (!supportable_narrowing_operation (code, stmt, vectype_in, &code1))
return false;
STMT_VINFO_VECTYPE (stmt_info) = vectype_in;
@@ -2652,7 +2804,7 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
}
/* Arguments are ready. Create the new vector stmt. */
- expr = build2 (code, vectype_out, vec_oprnd0, vec_oprnd1);
+ expr = build2 (code1, vectype_out, vec_oprnd0, vec_oprnd1);
new_stmt = build_gimple_modify_stmt (vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
@@ -2671,64 +2823,6 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
}
-/* Function vect_gen_widened_results_half
-
- Create a vector stmt whose code, type, number of arguments, and result
- variable are CODE, VECTYPE, OP_TYPE, and VEC_DEST, and its arguments are
- VEC_OPRND0 and VEC_OPRND1. The new vector stmt is to be inserted at BSI.
- In the case that CODE is a CALL_EXPR, this means that a call to DECL
- needs to be created (DECL is a function-decl of a target-builtin).
- STMT is the original scalar stmt that we are vectorizing. */
-
-static tree
-vect_gen_widened_results_half (enum tree_code code, tree vectype, tree decl,
- tree vec_oprnd0, tree vec_oprnd1, int op_type,
- tree vec_dest, block_stmt_iterator *bsi,
- tree stmt)
-{
- tree expr;
- tree new_stmt;
- tree new_temp;
- tree sym;
- ssa_op_iter iter;
-
- /* Generate half of the widened result: */
- if (code == CALL_EXPR)
- {
- /* Target specific support */
- if (op_type == binary_op)
- expr = build_call_expr (decl, 2, vec_oprnd0, vec_oprnd1);
- else
- expr = build_call_expr (decl, 1, vec_oprnd0);
- }
- else
- {
- /* Generic support */
- gcc_assert (op_type == TREE_CODE_LENGTH (code));
- if (op_type == binary_op)
- expr = build2 (code, vectype, vec_oprnd0, vec_oprnd1);
- else
- expr = build1 (code, vectype, vec_oprnd0);
- }
- new_stmt = build_gimple_modify_stmt (vec_dest, expr);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
-
- if (code == CALL_EXPR)
- {
- FOR_EACH_SSA_TREE_OPERAND (sym, new_stmt, iter, SSA_OP_ALL_VIRTUALS)
- {
- if (TREE_CODE (sym) == SSA_NAME)
- sym = SSA_NAME_VAR (sym);
- mark_sym_for_renaming (sym);
- }
- }
-
- return new_stmt;
-}
-
-
/* Function vectorizable_type_promotion
Check if STMT performs a binary or unary operation that involves
@@ -2785,7 +2879,8 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
operation = GIMPLE_STMT_OPERAND (stmt, 1);
code = TREE_CODE (operation);
- if (code != NOP_EXPR && code != WIDEN_MULT_EXPR)
+ if (code != NOP_EXPR && code != CONVERT_EXPR
+ && code != WIDEN_MULT_EXPR)
return false;
op0 = TREE_OPERAND (operation, 0);
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index f635334f19d..df884f42242 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -832,7 +832,7 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
}
/* Generate new loop structure. */
- new_loop = duplicate_loop (loop, loop->outer);
+ new_loop = duplicate_loop (loop, loop_outer (loop));
if (!new_loop)
{
free (bbs);
@@ -962,7 +962,7 @@ slpeel_can_duplicate_loop_p (struct loop *loop, edge e)
if (loop->inner
/* All loops have an outer scope; the only case loop->outer is NULL is for
the function itself. */
- || !loop->outer
+ || !loop_outer (loop)
|| loop->num_nodes != 2
|| !empty_block_p (loop->latch)
|| !single_exit (loop)
@@ -1736,10 +1736,10 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def_stmt,
widening operation that is supported by the target platform in
vector form (i.e., when operating on arguments of type VECTYPE).
- The two kinds of widening operations we currently support are
- NOP and WIDEN_MULT. This function checks if these operations
- are supported by the target platform either directly (via vector
- tree-codes), or via target builtins.
+ Widening operations we currently support are NOP (CONVERT), FLOAT
+ and WIDEN_MULT. This function checks if these operations are supported
+ by the target platform either directly (via vector tree-codes), or via
+ target builtins.
Output:
- CODE1 and CODE2 are codes of vector operations to be used when
@@ -1815,6 +1815,7 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
break;
case NOP_EXPR:
+ case CONVERT_EXPR:
if (BYTES_BIG_ENDIAN)
{
c1 = VEC_UNPACK_HI_EXPR;
@@ -1827,6 +1828,19 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
}
break;
+ case FLOAT_EXPR:
+ if (BYTES_BIG_ENDIAN)
+ {
+ c1 = VEC_UNPACK_FLOAT_HI_EXPR;
+ c2 = VEC_UNPACK_FLOAT_LO_EXPR;
+ }
+ else
+ {
+ c2 = VEC_UNPACK_FLOAT_HI_EXPR;
+ c1 = VEC_UNPACK_FLOAT_LO_EXPR;
+ }
+ break;
+
default:
gcc_unreachable ();
}
@@ -1851,6 +1865,63 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
}
+/* Function supportable_narrowing_operation
+
+ Check whether an operation represented by the code CODE is a
+ narrowing operation that is supported by the target platform in
+ vector form (i.e., when operating on arguments of type VECTYPE).
+
+ Narrowing operations we currently support are NOP (CONVERT) and
+ FIX_TRUNC. This function checks if these operations are supported by
+ the target platform directly via vector tree-codes.
+
+ Output:
+ - CODE1 is the code of a vector operation to be used when
+ vectorizing the operation, if available. */
+
+bool
+supportable_narrowing_operation (enum tree_code code,
+ tree stmt, tree vectype,
+ enum tree_code *code1)
+{
+ enum machine_mode vec_mode;
+ enum insn_code icode1;
+ optab optab1;
+ tree expr = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree type = TREE_TYPE (expr);
+ tree narrow_vectype = get_vectype_for_scalar_type (type);
+ enum tree_code c1;
+
+ switch (code)
+ {
+ case NOP_EXPR:
+ case CONVERT_EXPR:
+ c1 = VEC_PACK_TRUNC_EXPR;
+ break;
+
+ case FIX_TRUNC_EXPR:
+ c1 = VEC_PACK_FIX_TRUNC_EXPR;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ *code1 = c1;
+ optab1 = optab_for_tree_code (c1, vectype);
+
+ if (!optab1)
+ return false;
+
+ vec_mode = TYPE_MODE (vectype);
+ if ((icode1 = optab1->handlers[(int) vec_mode].insn_code) == CODE_FOR_nothing
+ || insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
+ return false;
+
+ return true;
+}
+
+
/* Function reduction_code_for_scalar_code
Input:
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 8d80aeb2ba7..dd8e2b8ad56 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -398,6 +398,9 @@ extern enum dr_alignment_support vect_supportable_dr_alignment
extern bool reduction_code_for_scalar_code (enum tree_code, enum tree_code *);
extern bool supportable_widening_operation (enum tree_code, tree, tree,
tree *, tree *, enum tree_code *, enum tree_code *);
+extern bool supportable_narrowing_operation (enum tree_code, tree, tree,
+ enum tree_code *);
+
/* Creation and deletion of loop and stmt info structs. */
extern loop_vec_info new_loop_vec_info (struct loop *loop);
extern void destroy_loop_vec_info (loop_vec_info);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index a9141d76ed2..efb4f6890d8 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -358,7 +358,7 @@ set_value_range_to_varying (value_range_t *vr)
infinity when we shouldn't. */
static inline void
-set_value_range_to_value (value_range_t *vr, tree val)
+set_value_range_to_value (value_range_t *vr, tree val, bitmap equiv)
{
gcc_assert (is_gimple_min_invariant (val));
if (is_overflow_infinity (val))
@@ -374,7 +374,7 @@ set_value_range_to_value (value_range_t *vr, tree val)
val = TYPE_MIN_VALUE (TREE_TYPE (val));
}
}
- set_value_range (vr, VR_RANGE, val, val, NULL);
+ set_value_range (vr, VR_RANGE, val, val, equiv);
}
/* Set value range VR to a non-negative range of type TYPE.
@@ -418,8 +418,7 @@ set_value_range_to_nonnull (value_range_t *vr, tree type)
static inline void
set_value_range_to_null (value_range_t *vr, tree type)
{
- tree zero = build_int_cst (type, 0);
- set_value_range (vr, VR_RANGE, zero, zero, vr->equiv);
+ set_value_range_to_value (vr, build_int_cst (type, 0), vr->equiv);
}
@@ -1702,7 +1701,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
if (TREE_CODE (op0) == SSA_NAME)
vr0 = *(get_value_range (op0));
else if (is_gimple_min_invariant (op0))
- set_value_range_to_value (&vr0, op0);
+ set_value_range_to_value (&vr0, op0, NULL);
else
set_value_range_to_varying (&vr0);
@@ -1710,7 +1709,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
if (TREE_CODE (op1) == SSA_NAME)
vr1 = *(get_value_range (op1));
else if (is_gimple_min_invariant (op1))
- set_value_range_to_value (&vr1, op1);
+ set_value_range_to_value (&vr1, op1, NULL);
else
set_value_range_to_varying (&vr1);
@@ -2107,7 +2106,7 @@ extract_range_from_unary_expr (value_range_t *vr, tree expr)
if (TREE_CODE (op0) == SSA_NAME)
vr0 = *(get_value_range (op0));
else if (is_gimple_min_invariant (op0))
- set_value_range_to_value (&vr0, op0);
+ set_value_range_to_value (&vr0, op0, NULL);
else
set_value_range_to_varying (&vr0);
@@ -2490,7 +2489,7 @@ extract_range_from_cond_expr (value_range_t *vr, tree expr)
if (TREE_CODE (op0) == SSA_NAME)
vr0 = *(get_value_range (op0));
else if (is_gimple_min_invariant (op0))
- set_value_range_to_value (&vr0, op0);
+ set_value_range_to_value (&vr0, op0, NULL);
else
set_value_range_to_varying (&vr0);
@@ -2498,7 +2497,7 @@ extract_range_from_cond_expr (value_range_t *vr, tree expr)
if (TREE_CODE (op1) == SSA_NAME)
vr1 = *(get_value_range (op1));
else if (is_gimple_min_invariant (op1))
- set_value_range_to_value (&vr1, op1);
+ set_value_range_to_value (&vr1, op1, NULL);
else
set_value_range_to_varying (&vr1);
@@ -2528,7 +2527,10 @@ extract_range_from_comparison (value_range_t *vr, tree expr)
its type may be different from _Bool. Convert VAL to EXPR's
type. */
val = fold_convert (TREE_TYPE (expr), val);
- set_value_range (vr, VR_RANGE, val, val, vr->equiv);
+ if (is_gimple_min_invariant (val))
+ set_value_range_to_value (vr, val, vr->equiv);
+ else
+ set_value_range (vr, VR_RANGE, val, val, vr->equiv);
}
else
/* The result of a comparison is always true or false. */
@@ -2562,7 +2564,7 @@ extract_range_from_expr (value_range_t *vr, tree expr)
else if (TREE_CODE_CLASS (code) == tcc_comparison)
extract_range_from_comparison (vr, expr);
else if (is_gimple_min_invariant (expr))
- set_value_range_to_value (vr, expr);
+ set_value_range_to_value (vr, expr, NULL);
else
set_value_range_to_varying (vr);
@@ -5865,13 +5867,7 @@ identify_jump_threads (void)
static void
finalize_jump_threads (void)
{
- bool cfg_altered = false;
- cfg_altered = thread_through_all_blocks ();
-
- /* If we threaded jumps, then we need to recompute the dominance
- information. */
- if (cfg_altered)
- free_dominance_info (CDI_DOMINATORS);
+ thread_through_all_blocks (false);
VEC_free (tree, heap, stack);
}
@@ -5990,22 +5986,19 @@ vrp_finalize (void)
static unsigned int
execute_vrp (void)
{
- insert_range_assertions ();
-
- loop_optimizer_init (LOOPS_NORMAL);
+ loop_optimizer_init (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS);
if (current_loops)
- scev_initialize ();
+ {
+ rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
+ scev_initialize ();
+ }
+
+ insert_range_assertions ();
vrp_initialize ();
ssa_propagate (vrp_visit_stmt, vrp_visit_phi_node);
vrp_finalize ();
- if (current_loops)
- {
- scev_finalize ();
- loop_optimizer_finalize ();
- }
-
/* ASSERT_EXPRs must be removed before finalizing jump threads
as finalizing jump threads calls the CFG cleanup code which
does not properly handle ASSERT_EXPRs. */
@@ -6019,6 +6012,12 @@ execute_vrp (void)
update_ssa (TODO_update_ssa);
finalize_jump_threads ();
+ if (current_loops)
+ {
+ scev_finalize ();
+ loop_optimizer_finalize ();
+ }
+
return 0;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index b636de61384..2d96bd7af87 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7731,14 +7731,22 @@ int_cst_value (tree x)
}
+/* Return an unsigned type the same as TYPE in other respects. */
+
+static tree
+get_unsigned_type (tree type)
+{
+ return get_signed_or_unsigned_type (1, type);
+}
+
/* Returns unsigned variant of TYPE. */
tree
unsigned_type_for (tree type)
{
if (POINTER_TYPE_P (type))
- return lang_hooks.types.unsigned_type (size_type_node);
- return lang_hooks.types.unsigned_type (type);
+ return get_unsigned_type (size_type_node);
+ return get_unsigned_type (type);
}
/* Returns signed variant of TYPE. */
diff --git a/gcc/tree.def b/gcc/tree.def
index feeab3fce1f..e1f5fef063e 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -1085,13 +1085,20 @@ DEFTREECODE (GIMPLE_MODIFY_STMT, "gimple_modify_stmt", tcc_gimple_stmt, 2)
DEFTREECODE (VEC_WIDEN_MULT_HI_EXPR, "widen_mult_hi_expr", tcc_binary, 2)
DEFTREECODE (VEC_WIDEN_MULT_LO_EXPR, "widen_mult_hi_expr", tcc_binary, 2)
-/* Unpack (extract and promote/widen) the high/low elements of the input vector
- into the output vector. The input vector has twice as many elements
- as the output vector, that are half the size of the elements
+/* Unpack (extract and promote/widen) the high/low elements of the input
+ vector into the output vector. The input vector has twice as many
+ elements as the output vector, that are half the size of the elements
of the output vector. This is used to support type promotion. */
DEFTREECODE (VEC_UNPACK_HI_EXPR, "vec_unpack_hi_expr", tcc_unary, 1)
DEFTREECODE (VEC_UNPACK_LO_EXPR, "vec_unpack_lo_expr", tcc_unary, 1)
+/* Unpack (extract) the high/low elements of the input vector, convert
+ fixed point values to floating point and widen elements into the
+ output vector. The input vector has twice as many elements as the output
+ vector, that are half the size of the elements of the output vector. */
+DEFTREECODE (VEC_UNPACK_FLOAT_HI_EXPR, "vec_unpack_float_hi_expr", tcc_unary, 1)
+DEFTREECODE (VEC_UNPACK_FLOAT_LO_EXPR, "vec_unpack_float_lo_expr", tcc_unary, 1)
+
/* Pack (demote/narrow and merge) the elements of the two input vectors
into the output vector using truncation/saturation.
The elements of the input vectors are twice the size of the elements of the
@@ -1099,6 +1106,12 @@ DEFTREECODE (VEC_UNPACK_LO_EXPR, "vec_unpack_lo_expr", tcc_unary, 1)
DEFTREECODE (VEC_PACK_TRUNC_EXPR, "vec_pack_trunc_expr", tcc_binary, 2)
DEFTREECODE (VEC_PACK_SAT_EXPR, "vec_pack_sat_expr", tcc_binary, 2)
+/* Convert floating point values of the two input vectors to integer
+ and pack (narrow and merge) the elements into the output vector. The
+ elements of the input vector are twice the size of the elements of
+ the output vector. */
+DEFTREECODE (VEC_PACK_FIX_TRUNC_EXPR, "vec_pack_fix_trunc_expr", tcc_binary, 2)
+
/* Extract even/odd fields from vectors. */
DEFTREECODE (VEC_EXTRACT_EVEN_EXPR, "vec_extracteven_expr", tcc_binary, 2)
DEFTREECODE (VEC_EXTRACT_ODD_EXPR, "vec_extractodd_expr", tcc_binary, 2)
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index 2903de6d788..b74851c9487 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * treetree.c (tree_lang_unsigned_type): Remove.
+ (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+
2007-03-30 Rafael Avila de Espindola <espindola@google.com>
* treetree.c (tree_lang_signed_or_unsigned_type): Remove.
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index 0645b9d1da5..d288c0eda97 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -127,7 +127,6 @@ struct language_function GTY(())
static bool tree_mark_addressable (tree exp);
static tree tree_lang_type_for_size (unsigned precision, int unsignedp);
static tree tree_lang_type_for_mode (enum machine_mode mode, int unsignedp);
-static tree tree_lang_unsigned_type (tree type_node);
static tree tree_lang_signed_type (tree type_node);
/* Functions to keep track of the current scope. */
@@ -153,8 +152,6 @@ static void treelang_expand_function (tree fndecl);
#define LANG_HOOKS_MARK_ADDRESSABLE tree_mark_addressable
#undef LANG_HOOKS_SIGNED_TYPE
#define LANG_HOOKS_SIGNED_TYPE tree_lang_signed_type
-#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE tree_lang_unsigned_type
#undef LANG_HOOKS_TYPE_FOR_MODE
#define LANG_HOOKS_TYPE_FOR_MODE tree_lang_type_for_mode
#undef LANG_HOOKS_TYPE_FOR_SIZE
@@ -865,14 +862,6 @@ tree_lang_type_for_mode (enum machine_mode mode, int unsignedp)
return NULL_TREE;
}
-/* Return the unsigned version of a TYPE_NODE, a scalar type. */
-
-static tree
-tree_lang_unsigned_type (tree type_node)
-{
- return tree_lang_type_for_size (TYPE_PRECISION (type_node), 1);
-}
-
/* Return the signed version of a TYPE_NODE, a scalar type. */
static tree
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f8ce7263065..743c3f1e244 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1097,11 +1097,22 @@ align_variable (tree decl, bool dont_output_data)
if (! DECL_USER_ALIGN (decl))
{
#ifdef DATA_ALIGNMENT
- align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+ unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+ /* Don't increase alignment too much for TLS variables - TLS space
+ is too precious. */
+ if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
+ align = data_align;
#endif
#ifdef CONSTANT_ALIGNMENT
if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node)
- align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
+ {
+ unsigned int const_align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl),
+ align);
+ /* Don't increase alignment too much for TLS variables - TLS space
+ is too precious. */
+ if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
+ align = const_align;
+ }
#endif
}
diff --git a/include/ChangeLog b/include/ChangeLog
index 5fcce7210bf..b4112bfc7be 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ * libiberty.h (writeargv): Declare.
+
2007-04-25 Mark Mitchell <mark@codesourcery.com>
* demangle.h: Change license to LGPL + exception.
diff --git a/include/libiberty.h b/include/libiberty.h
index 7a58b711c37..4e697343fb6 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -86,6 +86,10 @@ extern char **dupargv (char **) ATTRIBUTE_MALLOC;
extern void expandargv PARAMS ((int *, char ***));
+/* Write argv to an @-file, inserting necessary quoting. */
+
+extern int writeargv PARAMS ((char **, FILE *));
+
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently
across different systems, sometimes as "char *" and sometimes as
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index cc5a71692c7..31d96e8b684 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-14 Janis Johnson <janis187@us.ibm.com>
+
+ * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
+
+ PR c/31924
+ * expr.c (interpret_float_suffix): Check for invalid suffix.
+
2007-05-02 Eric Christopher <echristo@apple.com>
* expr.c (num_div_op): Don't overflow if the result is
diff --git a/libcpp/expr.c b/libcpp/expr.c
index a00614026c2..20090195acc 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -87,16 +87,19 @@ interpret_float_suffix (const uchar *s, size_t len)
while (len--)
switch (s[len])
{
- case 'f': case 'F': f++; break;
- case 'l': case 'L': l++; break;
- case 'i': case 'I':
- case 'j': case 'J': i++; break;
- case 'd': case 'D':
- /* Disallow fd, ld suffixes. */
- if (d && (f || l))
+ case 'f': case 'F':
+ if (d > 0)
+ return 0;
+ f++;
+ break;
+ case 'l': case 'L':
+ if (d > 0)
return 0;
- d++;
+ l++;
break;
+ case 'i': case 'I':
+ case 'j': case 'J': i++; break;
+ case 'd': case 'D': d++; break;
default:
return 0;
}
@@ -270,6 +273,10 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
return CPP_N_INVALID;
}
+ if ((result & CPP_N_DFLOAT) && CPP_PEDANTIC (pfile))
+ cpp_error (pfile, CPP_DL_PEDWARN,
+ "decimal float constants are a GCC extension");
+
result |= CPP_N_FLOATING;
}
else
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 333b5b68edb..1f49a27e555 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,26 @@
+2007-05-10 Roman Zippel <zippel@linux-m68k.org>
+
+ * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV,
+ ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support.
+ * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise.
+ * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
+ (FFI_CLOSURES): Enable closure support.
+
+2007-05-10 Roman Zippel <zippel@linux-m68k.org>
+
+ * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
+ * configure: Regenerate.
+ * fficonfig.h.in: Regenerate.
+ * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
+ CFI_OFFSET,CFI_DEF_CFA): New macros.
+ (ffi_call_SYSV): Add callframe annotation.
+
+2007-05-10 Roman Zippel <zippel@linux-m68k.org>
+
+ * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix
+ numerous test suite failures.
+ * src/m68k/sysv.S (ffi_call_SYSV): Likewise.
+
2007-04-11 Paolo Bonzini <bonzini@gnu.org>
* Makefile.am (EXTRA_DIST): Bring up to date.
diff --git a/libffi/configure b/libffi/configure
index 0b8c79ccb38..2c4706e11ff 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -7444,6 +7444,70 @@ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
esac
+echo "$as_me:$LINENO: checking assembler .cfi pseudo-op support" >&5
+echo $ECHO_N "checking assembler .cfi pseudo-op support... $ECHO_C" >&6
+if test "${libffi_cv_as_cfi_pseudo_op+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ libffi_cv_as_cfi_pseudo_op=unknown
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+asm (".cfi_startproc\n\t.cfi_endproc");
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ libffi_cv_as_cfi_pseudo_op=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+libffi_cv_as_cfi_pseudo_op=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $libffi_cv_as_cfi_pseudo_op" >&5
+echo "${ECHO_T}$libffi_cv_as_cfi_pseudo_op" >&6
+if test "x$libffi_cv_as_cfi_pseudo_op" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_CFI_PSEUDO_OP 1
+_ACEOF
+
+fi
+
if test x$TARGET = xSPARC; then
echo "$as_me:$LINENO: checking assembler and linker support unaligned pc related relocs" >&5
echo $ECHO_N "checking assembler and linker support unaligned pc related relocs... $ECHO_C" >&6
diff --git a/libffi/configure.ac b/libffi/configure.ac
index c171d922f8b..92c5678c934 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -201,6 +201,18 @@ AC_SUBST(HAVE_LONG_DOUBLE)
AC_C_BIGENDIAN
+AC_CACHE_CHECK([assembler .cfi pseudo-op support],
+ libffi_cv_as_cfi_pseudo_op, [
+ libffi_cv_as_cfi_pseudo_op=unknown
+ AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
+ [libffi_cv_as_cfi_pseudo_op=yes],
+ [libffi_cv_as_cfi_pseudo_op=no])
+])
+if test "x$libffi_cv_as_cfi_pseudo_op" = xyes; then
+ AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
+ [Define if your assembler supports .cfi_* directives.])
+fi
+
if test x$TARGET = xSPARC; then
AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
libffi_cv_as_sparc_ua_pcrel, [
diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in
index f982707344f..d32d488ed12 100644
--- a/libffi/fficonfig.h.in
+++ b/libffi/fficonfig.h.in
@@ -27,6 +27,9 @@
*/
#undef HAVE_ALLOCA_H
+/* Define if your assembler supports .cfi_* directives. */
+#undef HAVE_AS_CFI_PSEUDO_OP
+
/* Define if your assembler supports .register. */
#undef HAVE_AS_REGISTER_PSEUDO_OP
diff --git a/libffi/src/m68k/ffi.c b/libffi/src/m68k/ffi.c
index 55f3a988bc4..600cf20527f 100644
--- a/libffi/src/m68k/ffi.c
+++ b/libffi/src/m68k/ffi.c
@@ -8,11 +8,23 @@
#include <ffi_common.h>
#include <stdlib.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <asm/cachectl.h>
+
+void ffi_call_SYSV (extended_cif *,
+ unsigned, unsigned,
+ void *, void (*fn) ());
+void *ffi_prep_args (void *stack, extended_cif *ecif);
+void ffi_closure_SYSV (ffi_closure *);
+void ffi_closure_struct_SYSV (ffi_closure *);
+unsigned int ffi_closure_SYSV_inner (ffi_closure *closure,
+ void *resp, void *args);
/* ffi_prep_args is called by the assembly routine once stack space has
been allocated for the function's arguments. */
-static void *
+void *
ffi_prep_args (void *stack, extended_cif *ecif)
{
unsigned int i;
@@ -24,7 +36,7 @@ ffi_prep_args (void *stack, extended_cif *ecif)
argp = stack;
if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
- && ecif->cif->rtype->size > 8)
+ && !ecif->cif->flags)
struct_value_ptr = ecif->rvalue;
else
struct_value_ptr = NULL;
@@ -37,44 +49,47 @@ ffi_prep_args (void *stack, extended_cif *ecif)
{
size_t z;
- /* Align if necessary. */
- if (((*p_arg)->alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN (argp, (*p_arg)->alignment);
-
- z = (*p_arg)->size;
- if (z < sizeof (int))
+ z = (*p_arg)->size;
+ if (z < sizeof (int))
+ {
+ switch ((*p_arg)->type)
{
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy (argp + sizeof (int) - z, *p_argv, z);
- break;
-
- default:
- FFI_ASSERT (0);
- }
- z = sizeof (int);
+ case FFI_TYPE_SINT8:
+ *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
+ break;
+
+ case FFI_TYPE_UINT8:
+ *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
+ break;
+
+ case FFI_TYPE_SINT16:
+ *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
+ break;
+
+ case FFI_TYPE_UINT16:
+ *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
+ break;
+
+ case FFI_TYPE_STRUCT:
+ memcpy (argp + sizeof (int) - z, *p_argv, z);
+ break;
+
+ default:
+ FFI_ASSERT (0);
}
- else
- memcpy (argp, *p_argv, z);
- p_argv++;
- argp += z;
+ z = sizeof (int);
+ }
+ else
+ {
+ memcpy (argp, *p_argv, z);
+
+ /* Align if necessary. */
+ if ((sizeof(int) - 1) & z)
+ z = ALIGN(z, sizeof(int));
+ }
+
+ p_argv++;
+ argp += z;
}
return struct_value_ptr;
@@ -86,7 +101,8 @@ ffi_prep_args (void *stack, extended_cif *ecif)
#define CIF_FLAGS_DOUBLE 8
#define CIF_FLAGS_LDOUBLE 16
#define CIF_FLAGS_POINTER 32
-#define CIF_FLAGS_STRUCT 64
+#define CIF_FLAGS_STRUCT1 64
+#define CIF_FLAGS_STRUCT2 128
/* Perform machine dependent cif processing */
ffi_status
@@ -100,12 +116,24 @@ ffi_prep_cif_machdep (ffi_cif *cif)
break;
case FFI_TYPE_STRUCT:
- if (cif->rtype->size > 4 && cif->rtype->size <= 8)
- cif->flags = CIF_FLAGS_DINT;
- else if (cif->rtype->size <= 4)
- cif->flags = CIF_FLAGS_STRUCT;
- else
- cif->flags = 0;
+ switch (cif->rtype->size)
+ {
+ case 1:
+ cif->flags = CIF_FLAGS_STRUCT1;
+ break;
+ case 2:
+ cif->flags = CIF_FLAGS_STRUCT2;
+ break;
+ case 4:
+ cif->flags = CIF_FLAGS_INT;
+ break;
+ case 8:
+ cif->flags = CIF_FLAGS_DINT;
+ break;
+ default:
+ cif->flags = 0;
+ break;
+ }
break;
case FFI_TYPE_FLOAT:
@@ -137,11 +165,6 @@ ffi_prep_cif_machdep (ffi_cif *cif)
return FFI_OK;
}
-extern void ffi_call_SYSV (void *(*) (void *, extended_cif *),
- extended_cif *,
- unsigned, unsigned, unsigned,
- void *, void (*fn) ());
-
void
ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
{
@@ -149,7 +172,7 @@ ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
ecif.cif = cif;
ecif.avalue = avalue;
-
+
/* If the return value is a struct and we don't have a return value
address then we need to make one. */
@@ -159,13 +182,11 @@ ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
ecif.rvalue = alloca (cif->rtype->size);
else
ecif.rvalue = rvalue;
-
-
- switch (cif->abi)
+
+ switch (cif->abi)
{
case FFI_SYSV:
- ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes,
- cif->flags, cif->rtype->size * 8,
+ ffi_call_SYSV (&ecif, cif->bytes, cif->flags,
ecif.rvalue, fn);
break;
@@ -174,3 +195,84 @@ ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
break;
}
}
+
+static void
+ffi_prep_incoming_args_SYSV (char *stack, void **avalue, ffi_cif *cif)
+{
+ unsigned int i;
+ void **p_argv;
+ char *argp;
+ ffi_type **p_arg;
+
+ argp = stack;
+ p_argv = avalue;
+
+ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
+ {
+ size_t z;
+
+ z = (*p_arg)->size;
+ if (z <= 4)
+ {
+ *p_argv = (void *) (argp + 4 - z);
+
+ z = 4;
+ }
+ else
+ {
+ *p_argv = (void *) argp;
+
+ /* Align if necessary */
+ if ((sizeof(int) - 1) & z)
+ z = ALIGN(z, sizeof(int));
+ }
+
+ p_argv++;
+ argp += z;
+ }
+}
+
+unsigned int
+ffi_closure_SYSV_inner (ffi_closure *closure, void *resp, void *args)
+{
+ ffi_cif *cif;
+ void **arg_area;
+
+ cif = closure->cif;
+ arg_area = (void**) alloca (cif->nargs * sizeof (void *));
+
+ ffi_prep_incoming_args_SYSV(args, arg_area, cif);
+
+ (closure->fun) (cif, resp, arg_area, closure->user_data);
+
+ return cif->flags;
+}
+
+ffi_status
+ffi_prep_closure_loc (ffi_closure* closure,
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*,void*,void**,void*),
+ void *user_data,
+ void *codeloc)
+{
+ FFI_ASSERT (cif->abi == FFI_SYSV);
+
+ *(unsigned short *)closure->tramp = 0x207c;
+ *(void **)(closure->tramp + 2) = codeloc;
+ *(unsigned short *)(closure->tramp + 6) = 0x4ef9;
+ if (cif->rtype->type == FFI_TYPE_STRUCT
+ && !cif->flags)
+ *(void **)(closure->tramp + 8) = ffi_closure_struct_SYSV;
+ else
+ *(void **)(closure->tramp + 8) = ffi_closure_SYSV;
+
+ syscall(SYS_cacheflush, codeloc, FLUSH_SCOPE_LINE,
+ FLUSH_CACHE_BOTH, FFI_TRAMPOLINE_SIZE);
+
+ closure->cif = cif;
+ closure->user_data = user_data;
+ closure->fun = fun;
+
+ return FFI_OK;
+}
+
diff --git a/libffi/src/m68k/ffitarget.h b/libffi/src/m68k/ffitarget.h
index aca7facc50a..9a072db404f 100644
--- a/libffi/src/m68k/ffitarget.h
+++ b/libffi/src/m68k/ffitarget.h
@@ -40,7 +40,8 @@ typedef enum ffi_abi {
/* ---- Definitions for closures ----------------------------------------- */
-#define FFI_CLOSURES 0
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 16
#define FFI_NATIVE_RAW_API 0
#endif
diff --git a/libffi/src/m68k/sysv.S b/libffi/src/m68k/sysv.S
index d019a377e5b..d2a4ff1c64a 100644
--- a/libffi/src/m68k/sysv.S
+++ b/libffi/src/m68k/sysv.S
@@ -8,40 +8,60 @@
#include <fficonfig.h>
#include <ffi.h>
+#ifdef HAVE_AS_CFI_PSEUDO_OP
+#define CFI_STARTPROC() .cfi_startproc
+#define CFI_OFFSET(reg,off) .cfi_offset reg,off
+#define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off
+#define CFI_ENDPROC() .cfi_endproc
+#else
+#define CFI_STARTPROC()
+#define CFI_OFFSET(reg,off)
+#define CFI_DEF_CFA(reg,off)
+#define CFI_ENDPROC()
+#endif
+
.text
.globl ffi_call_SYSV
.type ffi_call_SYSV,@function
+ .align 4
ffi_call_SYSV:
+ CFI_STARTPROC()
link %fp,#0
+ CFI_OFFSET(14,-8)
+ CFI_DEF_CFA(14,8)
move.l %d2,-(%sp)
+ CFI_OFFSET(2,-12)
| Make room for all of the new args.
- sub.l 16(%fp),%sp
+ sub.l 12(%fp),%sp
| Call ffi_prep_args
- move.l 12(%fp),-(%sp)
+ move.l 8(%fp),-(%sp)
pea 4(%sp)
- move.l 8(%fp),%a0
- jsr (%a0)
+#if !defined __PIC__
+ jsr ffi_prep_args
+#else
+ bsr.l ffi_prep_args@PLTPC
+#endif
addq.l #8,%sp
| Pass pointer to struct value, if any
move.l %a0,%a1
| Call the function
- move.l 32(%fp),%a0
+ move.l 24(%fp),%a0
jsr (%a0)
| Remove the space we pushed for the args
- add.l 16(%fp),%sp
+ add.l 12(%fp),%sp
| Load the pointer to storage for the return value
- move.l 28(%fp),%a1
+ move.l 20(%fp),%a1
| Load the return type code
- move.l 20(%fp),%d2
+ move.l 16(%fp),%d2
| If the return value pointer is NULL, assume no return value.
tst.l %a1
@@ -79,19 +99,111 @@ retlongdouble:
retpointer:
btst #5,%d2
- jbeq retstruct
+ jbeq retstruct1
move.l %a0,(%a1)
jbra epilogue
-retstruct:
+retstruct1:
btst #6,%d2
+ jbeq retstruct2
+ move.b %d0,(%a1)
+ jbra epilogue
+
+retstruct2:
+ btst #7,%d2
jbeq noretval
- move.l 24(%fp),%d2
- bfins %d0,(%a1){#0,%d2}
+ move.w %d0,(%a1)
noretval:
epilogue:
move.l (%sp)+,%d2
- unlk %a6
+ unlk %fp
rts
+ CFI_ENDPROC()
.size ffi_call_SYSV,.-ffi_call_SYSV
+
+ .globl ffi_closure_SYSV
+ .type ffi_closure_SYSV, @function
+ .align 4
+
+ffi_closure_SYSV:
+ CFI_STARTPROC()
+ link %fp,#-12
+ CFI_OFFSET(14,-8)
+ CFI_DEF_CFA(14,8)
+ move.l %sp,-12(%fp)
+ pea 8(%fp)
+ pea -12(%fp)
+ move.l %a0,-(%sp)
+#if !defined __PIC__
+ jsr ffi_closure_SYSV_inner
+#else
+ bsr.l ffi_closure_SYSV_inner@PLTPC
+#endif
+
+ lsr.l #1,%d0
+ jne 1f
+ jcc .Lcls_epilogue
+ move.l -12(%fp),%d0
+.Lcls_epilogue:
+ unlk %fp
+ rts
+1:
+ lea -12(%fp),%a0
+ lsr.l #2,%d0
+ jne 1f
+ jcs .Lcls_ret_float
+ move.l (%a0)+,%d0
+ move.l (%a0),%d1
+ jra .Lcls_epilogue
+.Lcls_ret_float:
+ fmove.s (%a0),%fp0
+ jra .Lcls_epilogue
+1:
+ lsr.l #2,%d0
+ jne 1f
+ jcs .Lcls_ret_ldouble
+ fmove.d (%a0),%fp0
+ jra .Lcls_epilogue
+.Lcls_ret_ldouble:
+ fmove.x (%a0),%fp0
+ jra .Lcls_epilogue
+1:
+ lsr.l #2,%d0
+ jne .Lcls_ret_struct2
+ jcs .Lcls_ret_struct1
+ move.l (%a0),%a0
+ move.l %a0,%d0
+ jra .Lcls_epilogue
+.Lcls_ret_struct1:
+ move.b (%a0),%d0
+ jra .Lcls_epilogue
+.Lcls_ret_struct2:
+ move.w (%a0),%d0
+ jra .Lcls_epilogue
+ CFI_ENDPROC()
+
+ .size ffi_closure_SYSV,.-ffi_closure_SYSV
+
+ .globl ffi_closure_struct_SYSV
+ .type ffi_closure_struct_SYSV, @function
+ .align 4
+
+ffi_closure_struct_SYSV:
+ CFI_STARTPROC()
+ link %fp,#0
+ CFI_OFFSET(14,-8)
+ CFI_DEF_CFA(14,8)
+ move.l %sp,-12(%fp)
+ pea 8(%fp)
+ move.l %a1,-(%sp)
+ move.l %a0,-(%sp)
+#if !defined __PIC__
+ jsr ffi_closure_SYSV_inner
+#else
+ bsr.l ffi_closure_SYSV_inner@PLTPC
+#endif
+ unlk %fp
+ rts
+ CFI_ENDPROC()
+ .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 7e3afaccbfa..8baa49f82e2 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-10 Richard Sandiford <richard@codesourcery.com>
+
+ * config.host (sparc-wrs-vxworks): New target.
+
2007-04-14 Kazu Hirata <kazu@codesourcery.com>
* config.host: Recognize fido.
diff --git a/libgcc/config.host b/libgcc/config.host
index f43de44bbd6..4de74cf203e 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -594,6 +594,8 @@ sparc-*-sysv4*)
;;
sparc64-*-elf*)
;;
+sparc-wrs-vxworks)
+ ;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*)
;;
sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 409c20d64a0..6d3e78e360f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,76 @@
+2007-05-17 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/31917
+ * runtime/environ.c (mark_range): Fix setting default convert unit.
+
+2007-05-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/31922
+ * intrinsics/string_intrinsics.c (string_trim): Set result to null if
+ string length is zero.
+
+2007-05-15 Tobias Burnus <burnus@net-b.de>
+
+ PR libfortran/31915
+ * io/transfer.c (unformatted_read): Use proper size for real(10).
+ (unformatted_write): Ditto.
+
+2007-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/30723
+ * runtime/memory.c (internal_malloc, internal_malloc64,
+ internal_free): Remove.
+ * runtime/error.c (os_error): Export function.
+ * intrinsics/move_alloc.c: Include stdlib.h.
+ (move_alloc): Call free instead of internal_free.
+ (move_alloc_c): Wrap long lines.
+ * libgfortran.h (os_error): Export prototype.
+ (internal_free): Remove prototype.
+ * gfortran.map (GFORTRAN_1.0): Remove _gfortran_internal_free,
+ _gfortran_internal_malloc and _gfortran_internal_malloc64.
+ Add _gfortran_os_error.
+
+2007-05-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/31880
+ * io/unix.c (fd_alloc_r_at): Fix calculation of physical offset.
+
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/31607
+ * intrinsics/system.c (system_sub): Call flush_all_units.
+ * io/io.h (flush_all_units): Move prototype to libgfortran.h.
+ * libgfortran.h (flush_all_units): Add prototype.
+
+2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/31201
+ * runtime/error.c (runtime_error_at): New function.
+ (generate_error): Export this function.
+ * gfortran.map: Add _gfortran_generate_error and
+ _gfortran_runtime_error_at.
+ * libgfortran.h: Add comment to reference error codes in front end.
+ (library_start): Locate prototype with library_end macro and add
+ a new comment. Add prototype for runtime_error_at. Export prototype for
+ generate_error.
+ * io/lock.c (library_start): Fix check for error condition.
+ * io/transfer.c (data_transfer_init): Add library check.
+
+2007-05-04 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/22359
+ * io/intrinsics.c (fseek_sub): New.
+ * io/unix.c (fd_fseek): Change logical and physical offsets only
+ if seek succeeds.
+ * gfortran.map (fseek_sub): New.
+
+2007-05-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/31210
+ * io/transfer.c (transfer_character): Avoid passing a NULL
+ pointer as source to the transfer routines, if the string length
+ is zero.
+
2007-04-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/31501
diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map
index 830651f87eb..f67192db1d8 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -128,6 +128,7 @@ GFORTRAN_1.0 {
_gfortran_fraction_r4;
_gfortran_fraction_r8;
_gfortran_free;
+ _gfortran_fseek_sub;
_gfortran_fstat_i4;
_gfortran_fstat_i4_sub;
_gfortran_fstat_i8;
@@ -137,6 +138,7 @@ GFORTRAN_1.0 {
_gfortran_ftell_i2_sub;
_gfortran_ftell_i4_sub;
_gfortran_ftell_i8_sub;
+ _gfortran_generate_error;
_gfortran_gerror;
_gfortran_getarg_i4;
_gfortran_getarg_i8;
@@ -164,9 +166,6 @@ GFORTRAN_1.0 {
_gfortran_idate_i8;
_gfortran_ierrno_i4;
_gfortran_ierrno_i8;
- _gfortran_internal_free;
- _gfortran_internal_malloc;
- _gfortran_internal_malloc64;
_gfortran_internal_pack;
_gfortran_internal_realloc;
_gfortran_internal_realloc64;
@@ -500,6 +499,7 @@ GFORTRAN_1.0 {
_gfortran_nearest_r16;
_gfortran_nearest_r4;
_gfortran_nearest_r8;
+ _gfortran_os_error;
_gfortran_pack;
_gfortran_pack_char;
_gfortran_pack_s;
@@ -581,6 +581,7 @@ GFORTRAN_1.0 {
_gfortran_rrspacing_r4;
_gfortran_rrspacing_r8;
_gfortran_runtime_error;
+ _gfortran_runtime_error_at;
_gfortran_secnds;
_gfortran_second;
_gfortran_second_sub;
diff --git a/libgfortran/intrinsics/move_alloc.c b/libgfortran/intrinsics/move_alloc.c
index b73ef4b77a0..24baf3971cd 100644
--- a/libgfortran/intrinsics/move_alloc.c
+++ b/libgfortran/intrinsics/move_alloc.c
@@ -28,8 +28,13 @@ License along with libgfortran; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
+#include "config.h"
#include "libgfortran.h"
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
extern void move_alloc (gfc_array_char *, gfc_array_char *);
export_proto(move_alloc);
@@ -38,7 +43,8 @@ move_alloc (gfc_array_char * from, gfc_array_char * to)
{
int i;
- internal_free (to->data);
+ if (to->data)
+ free (to->data);
for (i = 0; i < GFC_DESCRIPTOR_RANK (from); i++)
{
@@ -60,8 +66,10 @@ extern void move_alloc_c (gfc_array_char *, GFC_INTEGER_4,
export_proto(move_alloc_c);
void
-move_alloc_c (gfc_array_char * from, GFC_INTEGER_4 from_length __attribute__((unused)),
- gfc_array_char * to, GFC_INTEGER_4 to_length __attribute__((unused)))
+move_alloc_c (gfc_array_char * from,
+ GFC_INTEGER_4 from_length __attribute__((unused)),
+ gfc_array_char * to,
+ GFC_INTEGER_4 to_length __attribute__((unused)))
{
move_alloc (from, to);
}
diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c
index 1a4b1593270..7c22c16abfe 100644
--- a/libgfortran/intrinsics/string_intrinsics.c
+++ b/libgfortran/intrinsics/string_intrinsics.c
@@ -171,6 +171,8 @@ string_trim (GFC_INTEGER_4 * len, void ** dest, GFC_INTEGER_4 slen,
/* copy string if necessary. */
memmove (*dest, src, *len);
}
+ else
+ *dest = NULL;
}
diff --git a/libgfortran/intrinsics/system.c b/libgfortran/intrinsics/system.c
index 73f937142f6..49a5ba2a6d5 100644
--- a/libgfortran/intrinsics/system.c
+++ b/libgfortran/intrinsics/system.c
@@ -49,6 +49,9 @@ system_sub (const char *fcmd, GFC_INTEGER_4 *status, gfc_charlen_type cmd_len)
char cmd[cmd_len + 1];
int stat;
+ /* Flush all I/O units before executing the command. */
+ flush_all_units();
+
memcpy (cmd, fcmd, cmd_len);
cmd[cmd_len] = '\0';
diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c
index ab99b25e5a5..2402f486926 100644
--- a/libgfortran/io/intrinsics.c
+++ b/libgfortran/io/intrinsics.c
@@ -228,6 +228,34 @@ flush_i8 (GFC_INTEGER_8 *unit)
}
}
+/* FSEEK intrinsic */
+
+extern void fseek_sub (int *, GFC_IO_INT *, int *, int *);
+export_proto(fseek_sub);
+
+void
+fseek_sub (int * unit, GFC_IO_INT * offset, int * whence, int * status)
+{
+ gfc_unit * u = find_unit (*unit);
+ try result = FAILURE;
+
+ if (u != NULL && is_seekable(u->s))
+ {
+ if (*whence == 0)
+ result = sseek(u->s, *offset); /* SEEK_SET */
+ else if (*whence == 1)
+ result = sseek(u->s, file_position(u->s) + *offset); /* SEEK_CUR */
+ else if (*whence == 2)
+ result = sseek(u->s, file_length(u->s) + *offset); /* SEEK_END */
+
+ unlock_unit (u);
+ }
+
+ if (status)
+ *status = (result == FAILURE ? -1 : 0);
+}
+
+
/* FTELL intrinsic */
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 181c1816b61..a1138cffac0 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -586,9 +586,6 @@ internal_proto(compare_file_filename);
extern gfc_unit *find_file (const char *file, gfc_charlen_type file_len);
internal_proto(find_file);
-extern void flush_all_units (void);
-internal_proto(flush_all_units);
-
extern int stream_at_bof (stream *);
internal_proto(stream_at_bof);
diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c
index c39188f9d61..39bb67090d8 100644
--- a/libgfortran/io/lock.c
+++ b/libgfortran/io/lock.c
@@ -38,8 +38,8 @@ Boston, MA 02110-1301, USA. */
void
library_start (st_parameter_common *cmp)
{
- if ((cmp->flags & IOPARM_HAS_IOSTAT) != 0)
- *cmp->iostat = ERROR_OK;
+ if ((cmp->flags & IOPARM_LIBRETURN_ERROR) != 0)
+ return;
cmp->flags &= ~IOPARM_LIBRETURN_MASK;
}
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 13bb27206fd..6d23e5e81b9 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -721,12 +721,13 @@ unformatted_read (st_parameter_dt *dtp, bt type,
p = dest;
/* By now, all complex variables have been split into their
- constituent reals. For types with padding, we only need to
- read kind bytes. We don't care about the contents
- of the padding. If we hit a short record, then sz is
- adjusted accordingly, making later reads no-ops. */
+ constituent reals. */
- sz = kind;
+ if (type == BT_REAL || type == BT_COMPLEX)
+ sz = size_from_real_kind (kind);
+ else
+ sz = kind;
+
for (i=0; i<nelems; i++)
{
read_block_direct (dtp, buffer, &sz);
@@ -767,11 +768,13 @@ unformatted_write (st_parameter_dt *dtp, bt type,
p = source;
/* By now, all complex variables have been split into their
- constituent reals. For types with padding, we only need to
- read kind bytes. We don't care about the contents
- of the padding. */
+ constituent reals. */
+
+ if (type == BT_REAL || type == BT_COMPLEX)
+ sz = size_from_real_kind (kind);
+ else
+ sz = kind;
- sz = kind;
for (i=0; i<nelems; i++)
{
reverse_memcpy(buffer, p, size);
@@ -1401,8 +1404,17 @@ transfer_logical (st_parameter_dt *dtp, void *p, int kind)
void
transfer_character (st_parameter_dt *dtp, void *p, int len)
{
+ static char *empty_string[0];
+
if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
return;
+
+ /* Strings of zero length can have p == NULL, which confuses the
+ transfer routines into thinking we need more data elements. To avoid
+ this, we give them a nice pointer. */
+ if (len == 0 && p == NULL)
+ p = empty_string;
+
/* Currently we support only 1 byte chars, and the library is a bit
confused of character kind vs. length, so we kludge it by setting
kind = length. */
@@ -1699,6 +1711,9 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
dtp->u.p.ionml = ionml;
dtp->u.p.mode = read_flag ? READING : WRITING;
+ if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
+ return;
+
if ((cf & IOPARM_DT_HAS_SIZE) != 0)
dtp->u.p.size_used = 0; /* Initialize the count. */
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 458983c4595..38d4adfef63 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -492,7 +492,7 @@ fd_alloc_r_at (unix_stream * s, int *len, gfc_offset where)
if (n < 0)
return NULL;
- s->physical_offset = where + n;
+ s->physical_offset = m + n;
s->active += n;
}
else
@@ -503,7 +503,7 @@ fd_alloc_r_at (unix_stream * s, int *len, gfc_offset where)
if (do_read (s, s->buffer + s->active, &n) != 0)
return NULL;
- s->physical_offset = where + n;
+ s->physical_offset = m + n;
s->active += n;
}
@@ -601,10 +601,14 @@ fd_seek (unix_stream * s, gfc_offset offset)
return SUCCESS;
}
- s->physical_offset = s->logical_offset = offset;
- s->active = 0;
+ if (lseek (s->fd, offset, SEEK_SET) >= 0)
+ {
+ s->physical_offset = s->logical_offset = offset;
+ s->active = 0;
+ return SUCCESS;
+ }
- return (lseek (s->fd, offset, SEEK_SET) < 0) ? FAILURE : SUCCESS;
+ return FAILURE;
}
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 3703949d17a..fd510ee5fa1 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -401,7 +401,9 @@ typedef struct
}
st_option;
-/* Runtime errors. The EOR and EOF errors are required to be negative. */
+/* Runtime errors. The EOR and EOF errors are required to be negative.
+ These codes must be kept sychronized with their equivalents in
+ gcc/fortran/gfortran.h . */
typedef enum
{
@@ -534,17 +536,19 @@ st_parameter_common;
#define IOPARM_OPEN_HAS_PAD (1 << 16)
#define IOPARM_OPEN_HAS_CONVERT (1 << 17)
-
-/* main.c */
-
-extern void stupid_function_name_for_static_linking (void);
-internal_proto(stupid_function_name_for_static_linking);
+/* library start function and end macro. These can be expanded if needed
+ in the future. cmp is st_parameter_common *cmp */
extern void library_start (st_parameter_common *);
internal_proto(library_start);
#define library_end()
+/* main.c */
+
+extern void stupid_function_name_for_static_linking (void);
+internal_proto(stupid_function_name_for_static_linking);
+
extern void set_args (int, char **);
export_proto(set_args);
@@ -579,7 +583,7 @@ extern const char *xtoa (GFC_UINTEGER_LARGEST, char *, size_t);
internal_proto(xtoa);
extern void os_error (const char *) __attribute__ ((noreturn));
-internal_proto(os_error);
+iexport_proto(os_error);
extern void show_locus (st_parameter_common *);
internal_proto(show_locus);
@@ -587,6 +591,10 @@ internal_proto(show_locus);
extern void runtime_error (const char *) __attribute__ ((noreturn));
iexport_proto(runtime_error);
+extern void runtime_error_at (const char *, const char *)
+__attribute__ ((noreturn));
+iexport_proto(runtime_error_at);
+
extern void internal_error (st_parameter_common *, const char *)
__attribute__ ((noreturn));
internal_proto(internal_error);
@@ -602,7 +610,7 @@ extern const char *translate_error (int);
internal_proto(translate_error);
extern void generate_error (st_parameter_common *, int, const char *);
-internal_proto(generate_error);
+iexport_proto(generate_error);
extern try notify_std (st_parameter_common *, int, const char *);
internal_proto(notify_std);
@@ -626,9 +634,6 @@ internal_proto(free_mem);
extern void *internal_malloc_size (size_t);
internal_proto(internal_malloc_size);
-extern void internal_free (void *);
-iexport_proto(internal_free);
-
/* environ.c */
extern int check_buffered (int);
@@ -658,6 +663,11 @@ internal_proto(fstrcpy);
extern void cf_strcpy (char *, int, const char *);
internal_proto(cf_strcpy);
+/* io/intrinsics.c */
+
+extern void flush_all_units (void);
+internal_proto(flush_all_units);
+
/* io.c */
extern void init_units (void);
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index c9c1e27f3a2..388383c9a81 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -868,14 +868,13 @@ mark_range (int unit1, int unit2)
static int
do_parse (void)
{
- int tok, def;
+ int tok;
int unit1;
int continue_ulist;
char *start;
unit_count = 0;
- def = 0;
start = p;
/* Parse the string. First, let's look for a default. */
@@ -930,6 +929,7 @@ do_parse (void)
break;
case END:
+ def = endian;
goto end;
break;
@@ -946,6 +946,18 @@ do_parse (void)
tok = next_token ();
switch (tok)
{
+ case NATIVE:
+ if (next_token () != ':')
+ goto error;
+ endian = CONVERT_NATIVE;
+ break;
+
+ case SWAP:
+ if (next_token () != ':')
+ goto error;
+ endian = CONVERT_SWAP;
+ break;
+
case LITTLE:
if (next_token () != ':')
goto error;
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c
index 3c44d218963..bd3c306bc2f 100644
--- a/libgfortran/runtime/error.c
+++ b/libgfortran/runtime/error.c
@@ -285,6 +285,7 @@ os_error (const char *message)
st_printf ("Operating system error: %s\n%s\n", get_oserror (), message);
sys_exit (1);
}
+iexport(os_error);
/* void runtime_error()-- These are errors associated with an
@@ -299,6 +300,19 @@ runtime_error (const char *message)
}
iexport(runtime_error);
+/* void runtime_error_at()-- These are errors associated with a
+ * run time error generated by the front end compiler. */
+
+void
+runtime_error_at (const char *where, const char *message)
+{
+ recursion_check ();
+ st_printf ("%s\n", where);
+ st_printf ("Fortran runtime error: %s\n", message);
+ sys_exit (2);
+}
+iexport(runtime_error_at);
+
/* void internal_error()-- These are this-can't-happen errors
* that indicate something deeply wrong. */
@@ -475,7 +489,7 @@ generate_error (st_parameter_common *cmp, int family, const char *message)
st_printf ("Fortran runtime error: %s\n", message);
sys_exit (2);
}
-
+iexport(generate_error);
/* Whether, for a feature included in a given standard set (GFC_STD_*),
we should issue an error or a warning, or be quiet. */
diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c
index 58395303440..fe76675c9ad 100644
--- a/libgfortran/runtime/memory.c
+++ b/libgfortran/runtime/memory.c
@@ -77,46 +77,6 @@ internal_malloc_size (size_t size)
return get_mem (size);
}
-extern void *internal_malloc (GFC_INTEGER_4);
-export_proto(internal_malloc);
-
-void *
-internal_malloc (GFC_INTEGER_4 size)
-{
-#ifdef GFC_CHECK_MEMORY
- /* Under normal circumstances, this is _never_ going to happen! */
- if (size < 0)
- runtime_error ("Attempt to allocate a negative amount of memory.");
-
-#endif
- return internal_malloc_size ((size_t) size);
-}
-
-extern void *internal_malloc64 (GFC_INTEGER_8);
-export_proto(internal_malloc64);
-
-void *
-internal_malloc64 (GFC_INTEGER_8 size)
-{
-#ifdef GFC_CHECK_MEMORY
- /* Under normal circumstances, this is _never_ going to happen! */
- if (size < 0)
- runtime_error ("Attempt to allocate a negative amount of memory.");
-#endif
- return internal_malloc_size ((size_t) size);
-}
-
-
-/* Free internally allocated memory. Pointer is NULLified. Also used to
- free user allocated memory. */
-
-void
-internal_free (void *mem)
-{
- if (mem != NULL)
- free (mem);
-}
-iexport(internal_free);
/* Reallocate internal memory MEM so it has SIZE bytes of data.
Allocate a new block if MEM is zero, and free the block if
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index a234aa4d9a8..5e5f927cf79 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-04 Jakub Jelinek <jakub@redhat.com>
+
+ * config/linux/proc.c: New file.
+
+ PR libgomp/28482
+ * configure.tgt: Don't link with -Wl,-z,nodlopen even on Linux.
+
2007-04-19 Daniel Franke <franke.daniel@gmail.com>
* libgomp.texi (GOMP_CPU_AFFINITY): Updated.
diff --git a/libgomp/config/linux/proc.c b/libgomp/config/linux/proc.c
new file mode 100644
index 00000000000..2267cfbd2d1
--- /dev/null
+++ b/libgomp/config/linux/proc.c
@@ -0,0 +1,179 @@
+/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp 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 Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ 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. */
+
+/* This file contains system specific routines related to counting
+ online processors and dynamic load balancing. */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+#include "libgomp.h"
+#include <sched.h>
+#include <stdlib.h>
+#include <unistd.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+# endif
+#endif
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+static unsigned long
+cpuset_popcount (cpu_set_t *cpusetp)
+{
+#ifdef CPU_COUNT
+ /* glibc 2.6 and above provide a macro for this. */
+ return CPU_COUNT (cpusetp);
+#else
+ size_t i;
+ unsigned long ret = 0;
+ extern int check[sizeof (cpusetp->__bits[0]) == sizeof (unsigned long int)];
+
+ (void) check;
+ for (i = 0; i < sizeof (*cpusetp) / sizeof (cpusetp->__bits[0]); i++)
+ {
+ unsigned long int mask = cpusetp->__bits[i];
+ if (mask == 0)
+ continue;
+ ret += __builtin_popcountl (mask);
+ }
+ return ret;
+#endif
+}
+#endif
+
+/* At startup, determine the default number of threads. It would seem
+ this should be related to the number of cpus online. */
+
+void
+gomp_init_num_threads (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+ cpu_set_t cpuset;
+
+ if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset) == 0)
+ {
+ /* Count only the CPUs this process can use. */
+ gomp_nthreads_var = cpuset_popcount (&cpuset);
+ if (gomp_nthreads_var == 0)
+ gomp_nthreads_var = 1;
+ return;
+ }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+ gomp_nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
+#endif
+}
+
+static int
+get_num_procs (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+ cpu_set_t cpuset;
+
+ if (gomp_cpu_affinity == NULL)
+ {
+ /* Count only the CPUs this process can use. */
+ if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset),
+ &cpuset) == 0)
+ {
+ int ret = cpuset_popcount (&cpuset);
+ return ret != 0 ? ret : 1;
+ }
+ }
+ else
+ {
+ size_t idx;
+ static int affinity_cpus;
+
+ /* We can't use pthread_getaffinity_np in this case
+ (we have changed it ourselves, it binds to just one CPU).
+ Count instead the number of different CPUs we are
+ using. */
+ CPU_ZERO (&cpuset);
+ if (affinity_cpus == 0)
+ {
+ int cpus = 0;
+ for (idx = 0; idx < gomp_cpu_affinity_len; idx++)
+ if (! CPU_ISSET (gomp_cpu_affinity[idx], &cpuset))
+ {
+ cpus++;
+ CPU_SET (gomp_cpu_affinity[idx], &cpuset);
+ }
+ affinity_cpus = cpus;
+ }
+ return affinity_cpus;
+ }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+ return sysconf (_SC_NPROCESSORS_ONLN);
+#else
+ return gomp_nthreads_var;
+#endif
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+ threads we should spawn for this team. */
+/* ??? I have no idea what best practice for this is. Surely some
+ function of the number of processors that are *still* online and
+ the load average. Here I use the number of processors online
+ minus the 15 minute load average. */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+ unsigned n_onln, loadavg;
+
+ n_onln = get_num_procs ();
+ if (n_onln > gomp_nthreads_var)
+ n_onln = gomp_nthreads_var;
+
+ loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+ {
+ double dloadavg[3];
+ if (getloadavg (dloadavg, 3) == 3)
+ {
+ /* Add 0.1 to get a kind of biased rounding. */
+ loadavg = dloadavg[2] + 0.1;
+ }
+ }
+#endif
+
+ if (loadavg >= n_onln)
+ return 1;
+ else
+ return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+ return get_num_procs ();
+}
+
+ialias (omp_get_num_procs)
diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index 4790d66d8c6..f46210c3647 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -11,14 +11,11 @@
# XLDFLAGS Add extra link flags to use.
# Optimize TLS usage by avoiding the overhead of dynamic allocation.
-# This does require that the library be present during process
-# startup, so mark the library as not to be dlopened.
if test $have_tls = yes ; then
case "${target}" in
*-*-linux*)
XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
- XLDFLAGS="${XLDFLAGS} -Wl,-z,nodlopen"
;;
esac
fi
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 9e218b59fb4..a4217845c73 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,21 @@
+2007-05-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ * argv.c (writeargv): New function.
+
+2007-05-05 Geoffrey Keating <geoffk@apple.com>
+
+ * cp-demangle.c (d_name): Detect local-source-name.
+ (d_prefix): Likewise.
+ (d_unqualified_name): Implement local-source-name.
+
+2007-05-03 Joel Brobecker <brobecker@adacore.com>
+
+ * filename_cmp.c: Replace include of ctype.h by include of
+ safe-ctype.h.
+ (filename_cmp): Use TOLOWER instead of tolower for conversions
+ that are locale-independent.
+ * Makefile.in (filename_cmp.o): Add dependency on safe-ctype.h.
+
2007-04-11 Thomas Neumann tneumann@users.sourceforge.net
* argv.c: Use ANSI C declarations.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 4f5e2152783..735f1e632d9 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -651,7 +651,8 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
-./filename_cmp.o: $(srcdir)/filename_cmp.c $(INCDIR)/filenames.h
+./filename_cmp.o: $(srcdir)/filename_cmp.c $(INCDIR)/filenames.h \
+ $(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
else true; fi
diff --git a/libiberty/argv.c b/libiberty/argv.c
index e76c1f825d2..a04f50d7f49 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -290,6 +290,62 @@ char **buildargv (const char *input)
/*
+@deftypefn Extension int writeargv (const char **@var{argv}, FILE *@{file})
+
+Write each member of ARGV, handling all necessary quoting, to the file
+named by FILE, separated by whitespace. Return 0 on success, non-zero
+if an error occurred while writing to FILE.
+
+@end deftypefn
+
+*/
+
+int
+writeargv (char **argv, FILE *f)
+{
+ int status = 0;
+
+ if (f == NULL)
+ return 1;
+
+ while (*argv != NULL)
+ {
+ int ret;
+ const char *arg = *argv;
+
+ while (*arg != EOS)
+ {
+ char c = *arg;
+
+ if (ISSPACE(c) || c == '\\' || c == '\'' || c == '"')
+ if (EOF == fputc ('\\', f))
+ {
+ status = 1;
+ goto done;
+ }
+
+ if (EOF == fputc (c, f))
+ {
+ status = 1;
+ goto done;
+ }
+ arg++;
+ }
+
+ if (EOF == fputc ('\n', f))
+ {
+ status = 1;
+ goto done;
+ }
+ argv++;
+ }
+
+ done:
+ return status;
+}
+
+/*
+
@deftypefn Extension void expandargv (int *@var{argcp}, char ***@var{argvp})
The @var{argcp} and @code{argvp} arguments are pointers to the usual
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 5c930c6ab3f..992b3580bf7 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1100,6 +1100,9 @@ d_name (struct d_info *di)
case 'Z':
return d_local_name (di);
+ case 'L':
+ return d_unqualified_name (di);
+
case 'S':
{
int subst;
@@ -1220,7 +1223,8 @@ d_prefix (struct d_info *di)
if (IS_DIGIT (peek)
|| IS_LOWER (peek)
|| peek == 'C'
- || peek == 'D')
+ || peek == 'D'
+ || peek == 'L')
dc = d_unqualified_name (di);
else if (peek == 'S')
dc = d_substitution (di, 1);
@@ -1254,6 +1258,9 @@ d_prefix (struct d_info *di)
/* <unqualified-name> ::= <operator-name>
::= <ctor-dtor-name>
::= <source-name>
+ ::= <local-source-name>
+
+ <local-source-name> ::= L <source-name> <discriminator>
*/
static struct demangle_component *
@@ -1275,6 +1282,19 @@ d_unqualified_name (struct d_info *di)
}
else if (peek == 'C' || peek == 'D')
return d_ctor_dtor_name (di);
+ else if (peek == 'L')
+ {
+ struct demangle_component * ret;
+
+ d_advance (di, 1);
+
+ ret = d_source_name (di);
+ if (ret == NULL)
+ return NULL;
+ if (! d_discriminator (di))
+ return NULL;
+ return ret;
+ }
else
return NULL;
}
diff --git a/libiberty/filename_cmp.c b/libiberty/filename_cmp.c
index 59bb726b90e..0a4d0d85091 100644
--- a/libiberty/filename_cmp.c
+++ b/libiberty/filename_cmp.c
@@ -24,8 +24,8 @@
#include <string.h>
#endif
-#include <ctype.h>
#include "filenames.h"
+#include "safe-ctype.h"
/*
@@ -55,8 +55,8 @@ filename_cmp (const char *s1, const char *s2)
#else
for (;;)
{
- int c1 = tolower (*s1);
- int c2 = tolower (*s2);
+ int c1 = TOLOWER (*s1);
+ int c2 = TOLOWER (*s2);
/* On DOS-based file systems, the '/' and the '\' are equivalent. */
if (c1 == '/')
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 471819e26c0..f1afc45c8c9 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3842,3 +3842,19 @@ _ZNT
--format=gnu-v3
_Z1aMark
_Z1aMark
+# <local-source-name> test 1
+--format=gnu-v3
+_ZL3foo_2
+foo
+# <local-source-name> test 2
+--format=gnu-v3
+_ZZL3foo_2vE4var1
+foo()::var1
+# <local-source-name> test 3
+--format=gnu-v3
+_ZZL3foo_2vE4var1_0
+foo()::var1
+# <local-source-name> test 4
+--format=gnu-v3
+_ZZN7myspaceL3foo_1EvEN11localstruct1fEZNS_3fooEvE16otherlocalstruct
+myspace::foo()::localstruct::f(myspace::foo()::otherlocalstruct)
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 5c6ad81e1b3..cfc04bd40f0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,189 @@
+2007-05-17 Kyle Galloway <kgallowa@redhat.com>
+
+ * classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
+ (executeMethods): Remove cast to ClassReferenceTypeId.
+ * classpath/lib/gnu/classpath/jdwp/processor/
+ ReferenceTypeCommandSet.class: Rebuilt.
+
+2007-05-17 Kyle Galloway <kgallowa@redhat.com>
+
+ * gnu/classpath/jdwp/natVMMethod.cc (getModifiers): Check for native
+ classes and mark methods as native appropriately.
+
+2007-05-17 Kyle Galloway <kgallowa@redhat.com>
+
+ * gnu/classpath/jdwp/VMFrame.java (<init>): Add parameter for "this"
+ pointer.
+ * gnu/classpath/jdwp/VMFrame.h: Regenerated.
+ * classpath/lib/gnu/classpath/jdwp/VMFrame.class: Rebuilt.
+ * gnu/classpath/jdwp/natVMVirtualMachine.cc (getFrame): Use new
+ VMFrame constructor.
+
+2007-05-16 David Daney <ddaney@avtrex.com>
+
+ * include/java-stack.h (_Jv_FrameInfo): Remove union definition.
+ (_Jv_StackFrame): Remove commented out code.
+ (_Jv_UnwindState): Remove superfluous 'typedef'.
+ * sun/misc/natUnsafe.cc (spinlock): Add white space to quiet
+ compiler warnings.
+ * gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
+ (getCollectionUsage): Don't declare unused parameter n.
+ (getMemoryManagerNames): Same.
+ * gnu/gcj/util/natGCInfo.cc (gc_debug_info): Remove superfluous
+ 'typedef'.
+
+2007-05-16 Keith Seitz <keiths@redhat.com>
+
+ * include/java-interp.h (breakpoint_at): Declare.
+ * interpret.cc (breakpoint_at): New function.
+ * gnu/classpath/jdwp/VMVirtualMachine.java (_event_list):
+ New member.
+ * gnu/classpath/jdwp/natVMVirtualMachine.cc (initialize):
+ Initialize _event_list.
+ (handle_single_step): If there is a breakpoint at the
+ location at which we are stopping, do not send the notification.
+ Instead add the event to a list of events that occur at this
+ location.
+ (jdwpBreakpointCB): If the event list is not empty, send
+ whatever events are in it and the breakpoint event in a single
+ notification.
+ Mark parameter jni_env as MAYBE_UNUSED.
+ * classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class:
+ Regenerated.
+ * gnu/classpath/jdwp/VMVirtualMachine.h: Regenerated.
+
+2007-05-15 David Daney <ddaney@avtrex.com>
+
+ * classpath/lib/javax/swing/text/html/HTMLEditorKit.class: Regenerate
+ * gnu/java/awt/peer/gtk/ComponentGraphics.h: Same.
+
+2007-05-15 Keith Seitz <keiths@redhat.com>
+
+ * interpret.cc (STOREA): Rewrite using temporary variable to
+ avoid double-macro expansion side-effects.
+ (STOREI): Likewise.
+ (STOREF): Likewise.
+ (STOREL)[SIZEOF_VOID_P == 8]: Likewise.
+ (STORED)[SIZEOF_VOID_P == 8]: Likewise.
+ (STOREL)[SIZEOF_VOID_P != 8]: Likewise.
+ (STORED)[SIZEOF_VOID_P != 8]: Likewise.
+ (POKEI): Likewise.
+
+2007-05-12 David Daney <ddaney@avtrex.com>
+
+ PR libgcj/29324
+ * include/posix-threads.h (_Jv_BlockSigchld): Declare.
+ (_Jv_UnBlockSigchld): Same.
+ * posix-threads.cc: Include posix-threads.h.
+ (block_sigchld) Rename to...
+ (_Jv_BlockSigchld) ... this.
+ (_Jv_UnBlockSigchld): New function.
+ (_Jv_InitThreads): Call _Jv_BlockSigchld in place of block_sigchld.
+ (_Jv_ThreadStart): Same.
+ * java/lang/PosixProcess$ProcessManager.h: Regenerate.
+ * java/lang/PosixProcess.java: Clean up imports.
+ (ProcessManager): Make final.
+ (ProcessManager.queue): Genericise and make private.
+ (ProcessManager.pidToProcess): Remove.
+ (ProcessManager.liveProcesses): New field.
+ (ProcessManager.reaperPID): Remove.
+ (ProcessManager.nativeData): New field.
+ (ProcessManager.removeProcessFromMap): Remove.
+ (ProcessManager.addProcessToMap):Remove.
+ (ProcessManager.addToLiveProcesses): New method.
+ (ProcessManager.run): Rewritten.
+ (ProcessManager.reap): Change method signature,
+ (getErrorStream): Correct formatting.
+ (getInputStream): Same.
+ (spawn): Add process to liveProcesses list.
+ (pid): Make package private.
+ * java/lang/PosixProcess.h: Regenerate.
+ * java/lang/natPosixProcess.cc: Include posix.h and posix-threads.h.
+ Add useing namespace java::lang.
+ (ProcessManagerInternal): New struct.
+ (sigchld_handler): Rewritten.
+ (init): Rewritten.
+ (waitForSignal): Same.
+ (reap): Same.
+ (signalReaper): Same.
+ (nativeDestroy): Call kill as ::kill.
+ (nativeSpawn): Correct formatting.
+ * classpath/lib/java/lang/PosixProcess$EOFInputStream.class: Regenerate.
+ * classpath/lib/java/lang/PosixProcess.class: Same.
+ * classpath/lib/java/lang/PosixProcess$ProcessManager.class: Same.
+
+2007-05-07 Ian Lance Taylor <iant@google.com>
+
+ PR java/31842
+ * java/lang/natString.cc (_Jv_FormatInt): Avoid undefined signed
+ overflow.
+
+2007-05-07 Keith Seitz <keiths@redhat.com>
+
+ * classpath/lib/gnu/classpath/jdwp/Jdwp.class: Regenerate.
+ * classpath/lib/gnu/classpath/jdwp/Jdwp$1.class: Regenerate.
+ * classpath/lib/gnu/classpath/jdwp/event/Event.class:
+ Regenerate.
+ * classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class:
+ Regenerate.
+ * gnu/classpath/jdwp/Jdwp.h: Regenerate.
+ * gnu/classpath/jdwp/event/Event.h: Regenerate.
+ * gnu/classpath/jdwp/transport/JdwpConnection.h: Regenerate.
+
+2007-05-04 Kyle Galloway <kgallowa@redhat.com>
+
+ * gnu/classpath/jdwp/natVMVirtualMachine.cc (getClassMethod): Change
+ to use JVMTI.
+
+2007-05-03 Keith Seitz <keiths@redhat.com>
+
+ * interpret.cc: Don't include ExceptionEvent.h.
+ * gnu/gcj/jvmti/natExceptionEvent.cc: Remove.
+ * Makefile.am (nat_source_files): Remove natExceptionEvent.cc.
+ * Makefile.in: Regenerated.
+
+2007-05-03 Keith Seitz <keiths@redhat.com>
+
+ * include/jvmti-int.h (_Jv_ReportJVMTIExceptionThrow):
+ Declare.
+ * interpret.cc (_Jv_ReportJVMTIExceptionThrow): New function.
+ (find_catch_location): New function.
+ (REPORT_EXCEPTION): New macro.
+ (throw_internal_error): Use REPORT_EXCEPTION.
+ (throw_incompatible_class_change_error): Likewise.
+ (throw_null_pointer_exception): Likewise.
+ (throw_class_format_error): Likewise.
+ * interpret-run.cc (INTERP_REPORT_EXCEPTION)[DEBUG]: Set
+ to REPORT_EXCEPTION.
+ (INTERP_REPORT_EXCEPTION)[!DEBUG]: Make nop.
+ (insn_new): Use INTERP_REPORT_EXCEPTION.
+ (insn_athrow): Likewise.
+ Remove previous JVMTI exception notifications.
+ Add JVMTI ExceptionCatch notificatin.
+ * jni.cc (_Jv_PopSystemFrame): Notify JVMTI clients of
+ exception throw.
+ * gnu/gcj/jvmti/ExceptionEvent.java: Removed.
+ * gnu/gcj/jvmti/ExceptionEvent.h: Removed.
+ * classpath/lib/gnu/gcj/jvmti/ExceptionEvent.class: Removed.
+ * gnu/classpath/jdwp/natVMVirtualMachine.cc
+ (jdwpExceptionCB): New function.
+ (jdwpVMInitCB): Set Exception event handler and enable.
+ * sources.am: Regenerated.
+ * Makefile.in: Regenerated.
+
+2007-05-03 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=237304
+ * Makefile.in: Regenerate.
+ * scripts/makemake.tcl (scan_directory): Treat default.css as a
+ property file.
+ * classpath/javax/swing/text/html/default.css: Move to...
+ * classpath/resource/javax/swing/text/html/default.css: New file.
+ * classpath/javax/swing/text/html/HTMLEditorKit.java
+ (getStyleSheet): Throw RuntimeException when style loading fails.
+ * sources.am (property_files): Add
+ classpath/resource/javax/swing/text/html/default.css.
+
2007-05-02 Tom Tromey <tromey@redhat.com>
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=238755
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 97b38ee347d..3af6492a964 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -851,7 +851,6 @@ gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
-gnu/gcj/jvmti/natExceptionEvent.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index b454a4ae7bc..4b1086c78c4 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -302,7 +302,6 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc jvmti.cc exception.cc \
gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
- gnu/gcj/jvmti/natExceptionEvent.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
@@ -365,7 +364,6 @@ am__objects_2 = gnu/classpath/jdwp/natVMFrame.lo \
gnu/gcj/convert/natOutput_SJIS.lo \
gnu/gcj/io/natSimpleSHSStream.lo gnu/gcj/io/shs.lo \
gnu/gcj/jvmti/natBreakpoint.lo \
- gnu/gcj/jvmti/natExceptionEvent.lo \
gnu/gcj/runtime/natFinalizerThread.lo \
gnu/gcj/runtime/natSharedLibLoader.lo \
gnu/gcj/runtime/natSystemClassLoader.lo \
@@ -1349,7 +1347,6 @@ gnu_gcj_io_header_files = $(patsubst %.java,%.h,$(gnu_gcj_io_source_files))
gnu_gcj_jvmti_source_files = \
gnu/gcj/jvmti/Breakpoint.java \
gnu/gcj/jvmti/BreakpointManager.java \
-gnu/gcj/jvmti/ExceptionEvent.java \
gnu/gcj/jvmti/Location.java
gnu_gcj_jvmti_header_files = $(patsubst %.java,%.h,$(gnu_gcj_jvmti_source_files))
@@ -7786,6 +7783,7 @@ property_files = \
classpath/resource/gnu/javax/security/auth/callback/MessagesBundle.properties \
classpath/resource/java/util/iso4217.properties \
classpath/resource/javax/imageio/plugins/jpeg/MessagesBundle.properties \
+ classpath/resource/javax/swing/text/html/default.css \
classpath/resource/org/ietf/jgss/MessagesBundle.properties \
classpath/resource/sun/rmi/rmic/messages.properties \
classpath/resource/com/sun/tools/javac/messages.properties \
@@ -7985,7 +7983,6 @@ gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
gnu/gcj/jvmti/natBreakpoint.cc \
-gnu/gcj/jvmti/natExceptionEvent.cc \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \
@@ -8381,8 +8378,6 @@ gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp):
@: > gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/jvmti/natBreakpoint.lo: gnu/gcj/jvmti/$(am__dirstamp) \
gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
-gnu/gcj/jvmti/natExceptionEvent.lo: gnu/gcj/jvmti/$(am__dirstamp) \
- gnu/gcj/jvmti/$(DEPDIR)/$(am__dirstamp)
gnu/gcj/runtime/$(am__dirstamp):
@$(mkdir_p) gnu/gcj/runtime
@: > gnu/gcj/runtime/$(am__dirstamp)
@@ -8862,8 +8857,6 @@ mostlyclean-compile:
-rm -f gnu/gcj/io/shs.lo
-rm -f gnu/gcj/jvmti/natBreakpoint.$(OBJEXT)
-rm -f gnu/gcj/jvmti/natBreakpoint.lo
- -rm -f gnu/gcj/jvmti/natExceptionEvent.$(OBJEXT)
- -rm -f gnu/gcj/jvmti/natExceptionEvent.lo
-rm -f gnu/gcj/natCore.$(OBJEXT)
-rm -f gnu/gcj/natCore.lo
-rm -f gnu/gcj/runtime/natFinalizerThread.$(OBJEXT)
@@ -9082,7 +9075,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/io/$(DEPDIR)/natSimpleSHSStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/io/$(DEPDIR)/shs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/jvmti/$(DEPDIR)/natBreakpoint.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/jvmti/$(DEPDIR)/natExceptionEvent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/runtime/$(DEPDIR)/natFinalizerThread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/runtime/$(DEPDIR)/natSharedLibLoader.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/gcj/runtime/$(DEPDIR)/natStringBuffer.Plo@am__quote@
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index ad9f9082912..526b254ca2a 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,3 +1,28 @@
+2007-05-07 Keith Seitz <keiths@redhat.com>
+
+ * gnu/classpath/jdwp/Jdwp.java (notify): Rewrite to call
+ new array-based method.
+ (notify): New function.
+ (sendEvent): Rewrite to use sendEvents.
+ (sendEvents): New method.
+ * gnu/classpath/jdwp/event/Event.java (toPacket): Make static.
+ Change parameters to use arrays for events and requests.
+ Add suspendPolicy parameter.
+ Move per-event data transformation to...
+ (_toData): ... here.
+ * gnu/classpath/jdwp/transport/JdwpConnection.java
+ (sendEvent): Renamed to ...
+ (sendEvents): ... this.
+ Change parameters to use arrays for events and requests.
+ Add suspendPolicy parameter.
+
+2007-05-03 Andrew Haley <aph@redhat.com>
+
+ * gnu/javax/management/Server.java (Server): Record the delegate.
+ (registerMBean): Notify the delegate.
+ (unregisterMBean): Likewise.
+ (notify): New method.
+
2007-04-04 Francis Kung <fkung@redhat.com>
* gnu/java/awt/peer/gtk/ComponentGraphics.java
diff --git a/libjava/classpath/gnu/classpath/jdwp/Jdwp.java b/libjava/classpath/gnu/classpath/jdwp/Jdwp.java
index ca92f2f0d55..1d2329255cb 100644
--- a/libjava/classpath/gnu/classpath/jdwp/Jdwp.java
+++ b/libjava/classpath/gnu/classpath/jdwp/Jdwp.java
@@ -51,6 +51,7 @@ import gnu.classpath.jdwp.transport.TransportFactory;
import java.io.IOException;
import java.security.AccessController;
+import java.util.ArrayList;
import java.util.HashMap;
/**
@@ -207,7 +208,6 @@ public class Jdwp
* The event is filtered through the event manager before being
* sent.
*
- * FIXME: Probably need logic to send multiple (different) events
* @param event the event to report
*/
public static void notify(Event event)
@@ -235,6 +235,62 @@ public class Jdwp
}
/**
+ * Notify the debugger of "co-located" events. This method should
+ * not be called if debugging is not active (but it would not
+ * cause any harm). Places where event notifications occur
+ * should check isDebugging before doing anything.
+ *
+ * The events are filtered through the event manager before being
+ * sent.
+ *
+ * @param events the events to report
+ */
+ public static void notify(Event[] events)
+ {
+ Jdwp jdwp = getDefault();
+
+ if (jdwp != null)
+ {
+ byte suspendPolicy = JdwpConstants.SuspendPolicy.NONE;
+ EventManager em = EventManager.getDefault();
+ ArrayList allEvents = new ArrayList ();
+ ArrayList allRequests = new ArrayList ();
+ for (int i = 0; i < events.length; ++i)
+ {
+ EventRequest[] r = em.getEventRequests(events[i]);
+ for (int j = 0; j < r.length; ++j)
+ {
+ /* This is hacky, but it's not clear whether this
+ can really happen, and if it does, what should
+ occur. */
+ allEvents.add (events[i]);
+ allRequests.add (r[j]);
+
+ // Perhaps this is overkill?
+ if (r[j].getSuspendPolicy() > suspendPolicy)
+ suspendPolicy = r[j].getSuspendPolicy();
+ }
+ }
+
+ try
+ {
+ Event[] e = new Event[allEvents.size()];
+ allEvents.toArray(e);
+ EventRequest[] r = new EventRequest[allRequests.size()];
+ allRequests.toArray(r);
+ sendEvents(r, e, suspendPolicy);
+ jdwp._enforceSuspendPolicy(suspendPolicy);
+ }
+ catch (Exception e)
+ {
+ /* Really not much we can do. For now, just print out
+ a warning to the user. */
+ System.out.println ("Jdwp.notify: caught exception: " + e);
+ }
+ }
+ }
+
+ /**
* Sends the event to the debugger.
*
* This method bypasses the event manager's filtering.
@@ -246,13 +302,30 @@ public class Jdwp
public static void sendEvent (EventRequest request, Event event)
throws IOException
{
- Jdwp jdwp = getDefault ();
+ sendEvents (new EventRequest[] { request }, new Event[] { event },
+ request.getSuspendPolicy());
+ }
+
+ /**
+ * Sends the events to the debugger.
+ *
+ * This method bypasses the event manager's filtering.
+ *
+ * @param requests list of debugger requests for the events
+ * @param events the events to send
+ * @param suspendPolicy the suspendPolicy enforced by the VM
+ * @throws IOException if a communications failure occurs
+ */
+ public static void sendEvents (EventRequest[] requests, Event[] events,
+ byte suspendPolicy)
+ throws IOException
+ {
+ Jdwp jdwp = getDefault();
if (jdwp != null)
{
- // !! May need to implement send queue?
synchronized (jdwp._connection)
{
- jdwp._connection.sendEvent (request, event);
+ jdwp._connection.sendEvents (requests, events, suspendPolicy);
}
}
}
diff --git a/libjava/classpath/gnu/classpath/jdwp/event/Event.java b/libjava/classpath/gnu/classpath/jdwp/event/Event.java
index e91108a61a8..c89b25cb93b 100644
--- a/libjava/classpath/gnu/classpath/jdwp/event/Event.java
+++ b/libjava/classpath/gnu/classpath/jdwp/event/Event.java
@@ -1,5 +1,5 @@
/* Event.java -- a base class for all event types
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2007 Free Software Foundation
This file is part of GNU Classpath.
@@ -135,25 +135,30 @@ public abstract class Event
public abstract Object getParameter (int type);
/**
- * Converts this event into to a JDWP packet
+ * Converts the events into to a single JDWP Event.COMPOSITE packet
*
* @param dos the stream to which to write data
- * @param request the request the wanted this notification
+ * @param events the events to package into the packet
+ * @param requests the corresponding event requests
+ * @param suspendPolicy the suspend policy enforced by the VM
* @returns a <code>JdwpPacket</code> of the events
*/
- public JdwpPacket toPacket (DataOutputStream dos, EventRequest request)
+ public static JdwpPacket toPacket (DataOutputStream dos,
+ Event[] events,
+ EventRequest[] requests,
+ byte suspendPolicy)
{
JdwpPacket pkt;
try
{
- dos.writeByte (request.getSuspendPolicy ());
- dos.writeInt (1);
- dos.writeByte (_eventKind);
- dos.writeInt (request.getId ());
- _writeData (dos);
-
- pkt = new JdwpCommandPacket (JdwpConstants.CommandSet.Event.CS_VALUE,
- JdwpConstants.CommandSet.Event.COMPOSITE);
+ dos.writeByte (suspendPolicy);
+ dos.writeInt (events.length);
+ for (int i = 0; i < events.length; ++i)
+ _toData (dos, events[i], requests[i]);
+
+ pkt
+ = new JdwpCommandPacket (JdwpConstants.CommandSet.Event.CS_VALUE,
+ JdwpConstants.CommandSet.Event.COMPOSITE);
}
catch (IOException ioe)
{
@@ -162,4 +167,14 @@ public abstract class Event
return pkt;
}
+
+ // Helper function for toPacket
+ private static void _toData (DataOutputStream dos, Event event,
+ EventRequest request)
+ throws IOException
+ {
+ dos.writeByte (event._eventKind);
+ dos.writeInt (request.getId ());
+ event._writeData (dos);
+ }
}
diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
index 8e8b74b9d43..c9b329869d7 100644
--- a/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
+++ b/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
@@ -183,8 +183,7 @@ public class ReferenceTypeCommandSet
private void executeMethods(ByteBuffer bb, DataOutputStream os)
throws JdwpException, IOException
{
- ClassReferenceTypeId refId
- = (ClassReferenceTypeId) idMan.readReferenceTypeId(bb);
+ ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
Class clazz = refId.getType();
VMMethod[] methods = VMVirtualMachine.getAllClassMethods(clazz);
diff --git a/libjava/classpath/gnu/classpath/jdwp/transport/JdwpConnection.java b/libjava/classpath/gnu/classpath/jdwp/transport/JdwpConnection.java
index 82a2380bb7b..44158aa26ec 100644
--- a/libjava/classpath/gnu/classpath/jdwp/transport/JdwpConnection.java
+++ b/libjava/classpath/gnu/classpath/jdwp/transport/JdwpConnection.java
@@ -1,5 +1,5 @@
/* JdwpConnection.java -- A JDWP-speaking connection
- Copyright (C) 2005, 2006 Free Software Foundation
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation
This file is part of GNU Classpath.
@@ -267,13 +267,17 @@ public class JdwpConnection
}
/**
- * Send an event notification to the debugger
+ * Send an event notification to the debugger. Note that this
+ * method will only send out one notification: all the events
+ * are passed in a single Event.COMPOSITE packet.
*
- * @param request the debugger request that wanted this event
- * @param event the event
+ * @param requests debugger requests for events
+ * @param events the events to send
+ * @param suspendPolicy the suspend policy enforced by the VM
* @throws IOException
*/
- public void sendEvent (EventRequest request, Event event)
+ public void sendEvents(EventRequest[] requests, Event[] events,
+ byte suspendPolicy)
throws IOException
{
JdwpPacket pkt;
@@ -281,7 +285,7 @@ public class JdwpConnection
synchronized (_bytes)
{
_bytes.reset ();
- pkt = event.toPacket (_doStream, request);
+ pkt = Event.toPacket (_doStream, events, requests, suspendPolicy);
pkt.setData (_bytes.toByteArray ());
}
diff --git a/libjava/classpath/gnu/javax/management/Server.java b/libjava/classpath/gnu/javax/management/Server.java
index aa39c75ad46..616854e95bd 100644
--- a/libjava/classpath/gnu/javax/management/Server.java
+++ b/libjava/classpath/gnu/javax/management/Server.java
@@ -53,6 +53,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
import javax.management.Attribute;
import javax.management.AttributeList;
@@ -75,6 +76,7 @@ import javax.management.MBeanRegistration;
import javax.management.MBeanRegistrationException;
import javax.management.MBeanServer;
import javax.management.MBeanServerDelegate;
+import javax.management.MBeanServerNotification;
import javax.management.MBeanTrustPermission;
import javax.management.NotCompliantMBeanException;
import javax.management.Notification;
@@ -137,6 +139,15 @@ public class Server
private Map listeners;
/**
+ * An MBean that emits notifications when an MBean is registered and
+ * unregistered with this server.
+ *
+ */
+ private final MBeanServerDelegate delegate;
+
+ static private final AtomicLong sequenceNumber = new AtomicLong(1);
+
+ /**
* Initialise the delegate name.
*/
static
@@ -171,6 +182,7 @@ public class Server
{
this.defaultDomain = defaultDomain;
this.outer = outer;
+ this.delegate = delegate;
try
{
registerMBean(delegate, DELEGATE_NAME);
@@ -1703,6 +1715,7 @@ public class Server
beans.put(name, new ServerInfo(obji, obj));
if (register != null)
register.postRegister(Boolean.TRUE);
+ notify(name, MBeanServerNotification.REGISTRATION_NOTIFICATION);
return obji;
}
@@ -2088,10 +2101,18 @@ public class Server
}
}
beans.remove(name);
+ notify(name, MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
if (register != null)
register.postDeregister();
}
+ private void notify(ObjectName name, String type)
+ {
+ delegate.sendNotification
+ (new MBeanServerNotification
+ (type, DELEGATE_NAME, sequenceNumber.getAndIncrement(), name));
+ }
+
/**
* Input stream which deserializes using the given classloader.
*/
diff --git a/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java b/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
index 0ede1c74ed9..cc61889d76f 100644
--- a/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
+++ b/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
@@ -1462,7 +1462,7 @@ public class HTMLEditorKit
}
catch (IOException ex)
{
- // No style available.
+ throw new RuntimeException("No style available.", ex);
}
}
return styleSheet;
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class
index ce9e9a32bf2..8cca3300eba 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class
index 616beaa1fab..b0f3dc257c3 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class
index cf8f695204e..ce46cf0b91b 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class
index 09c69bf4234..f62976a99f5 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class
index d7230bd5ab3..f8a27d334c1 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class
index 25ff1a94d72..4783f59bf80 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class
index 2f1c37d2fd5..335411555c1 100644
--- a/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/jvmti/ExceptionEvent.class b/libjava/classpath/lib/gnu/gcj/jvmti/ExceptionEvent.class
deleted file mode 100644
index bfdedd08155..00000000000
--- a/libjava/classpath/lib/gnu/gcj/jvmti/ExceptionEvent.class
+++ /dev/null
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
index 08402446059..66a0933e81e 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
index 134351e7b96..13e6231a5ae 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
index dd98c5beb34..99d0cdcee3d 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server.class b/libjava/classpath/lib/gnu/javax/management/Server.class
index 41154ad8bf3..386f48e4c68 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class b/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class
index a7103f81a1c..c4cc6c37ccb 100644
--- a/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class
+++ b/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class b/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class
index 2e260c35813..1d80a2d4cc1 100644
--- a/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class
+++ b/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/PosixProcess.class b/libjava/classpath/lib/java/lang/PosixProcess.class
index 0227add131e..0241ae74f9e 100644
--- a/libjava/classpath/lib/java/lang/PosixProcess.class
+++ b/libjava/classpath/lib/java/lang/PosixProcess.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class
index 6d826cf4248..06a0122d3a4 100644
--- a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class
Binary files differ
diff --git a/libjava/classpath/javax/swing/text/html/default.css b/libjava/classpath/resource/javax/swing/text/html/default.css
index f2a44f8c8bf..f2a44f8c8bf 100644
--- a/libjava/classpath/javax/swing/text/html/default.css
+++ b/libjava/classpath/resource/javax/swing/text/html/default.css
diff --git a/libjava/gnu/classpath/jdwp/Jdwp.h b/libjava/gnu/classpath/jdwp/Jdwp.h
index 0d851371f88..ba10ead722c 100644
--- a/libjava/gnu/classpath/jdwp/Jdwp.h
+++ b/libjava/gnu/classpath/jdwp/Jdwp.h
@@ -7,6 +7,8 @@
#pragma interface
#include <java/lang/Thread.h>
+#include <gcj/array.h>
+
extern "Java"
{
namespace gnu
@@ -48,7 +50,9 @@ private:
public:
virtual void shutdown();
static void notify(::gnu::classpath::jdwp::event::Event *);
+ static void notify(JArray< ::gnu::classpath::jdwp::event::Event * > *);
static void sendEvent(::gnu::classpath::jdwp::event::EventRequest *, ::gnu::classpath::jdwp::event::Event *);
+ static void sendEvents(JArray< ::gnu::classpath::jdwp::event::EventRequest * > *, JArray< ::gnu::classpath::jdwp::event::Event * > *, jbyte);
private:
void _enforceSuspendPolicy(jbyte);
public:
diff --git a/libjava/gnu/classpath/jdwp/VMFrame.h b/libjava/gnu/classpath/jdwp/VMFrame.h
index 0108e7b96d5..737f39de28b 100644
--- a/libjava/gnu/classpath/jdwp/VMFrame.h
+++ b/libjava/gnu/classpath/jdwp/VMFrame.h
@@ -33,7 +33,7 @@ class gnu::classpath::jdwp::VMFrame : public ::java::lang::Object
{
public:
- VMFrame(::java::lang::Thread *, jlong, ::gnu::classpath::jdwp::util::Location *);
+ VMFrame(::java::lang::Thread *, jlong, ::gnu::classpath::jdwp::util::Location *, ::java::lang::Object *);
virtual ::gnu::classpath::jdwp::util::Location * getLocation();
virtual ::gnu::classpath::jdwp::value::Value * getValue(jint, jbyte);
virtual void setValue(jint, ::gnu::classpath::jdwp::value::Value *);
diff --git a/libjava/gnu/classpath/jdwp/VMFrame.java b/libjava/gnu/classpath/jdwp/VMFrame.java
index 4b144af75c3..de2640c85ff 100644
--- a/libjava/gnu/classpath/jdwp/VMFrame.java
+++ b/libjava/gnu/classpath/jdwp/VMFrame.java
@@ -74,11 +74,13 @@ public class VMFrame
* @param frame_id a long, the jframeID of this frame
* @param frame_loc a Location, the location of this frame
*/
- public VMFrame(Thread thr, long frame_id, Location frame_loc)
+ public VMFrame(Thread thr, long frame_id, Location frame_loc,
+ Object frame_obj)
{
thread = thr;
id = frame_id;
loc = frame_loc;
+ obj = frame_obj;
}
/**
diff --git a/libjava/gnu/classpath/jdwp/VMVirtualMachine.h b/libjava/gnu/classpath/jdwp/VMVirtualMachine.h
index dd316940996..f4ff5e8620d 100644
--- a/libjava/gnu/classpath/jdwp/VMVirtualMachine.h
+++ b/libjava/gnu/classpath/jdwp/VMVirtualMachine.h
@@ -86,6 +86,7 @@ private:
static ::java::util::Hashtable * _jdwp_suspend_counts;
public: // actually package-private
static ::java::util::Hashtable * _stepping_threads;
+ static ::java::util::ArrayList * _event_list;
public:
static ::java::lang::Class class$;
};
diff --git a/libjava/gnu/classpath/jdwp/VMVirtualMachine.java b/libjava/gnu/classpath/jdwp/VMVirtualMachine.java
index a1249d1938e..91e9965d0e2 100644
--- a/libjava/gnu/classpath/jdwp/VMVirtualMachine.java
+++ b/libjava/gnu/classpath/jdwp/VMVirtualMachine.java
@@ -83,6 +83,9 @@ public class VMVirtualMachine
// List of stepping threads: maps Thread -> stepping info
static Hashtable _stepping_threads;
+ // List of co-located JVMTI events
+ static ArrayList _event_list;
+
public static native void initialize ();
/**
diff --git a/libjava/gnu/classpath/jdwp/event/Event.h b/libjava/gnu/classpath/jdwp/event/Event.h
index 19dc07847c3..132d6b50dfc 100644
--- a/libjava/gnu/classpath/jdwp/event/Event.h
+++ b/libjava/gnu/classpath/jdwp/event/Event.h
@@ -7,6 +7,8 @@
#pragma interface
#include <java/lang/Object.h>
+#include <gcj/array.h>
+
extern "Java"
{
namespace gnu
@@ -39,7 +41,10 @@ public: // actually protected
virtual void _writeData(::java::io::DataOutputStream *) = 0;
public:
virtual ::java::lang::Object * getParameter(jint) = 0;
- virtual ::gnu::classpath::jdwp::transport::JdwpPacket * toPacket(::java::io::DataOutputStream *, ::gnu::classpath::jdwp::event::EventRequest *);
+ static ::gnu::classpath::jdwp::transport::JdwpPacket * toPacket(::java::io::DataOutputStream *, JArray< ::gnu::classpath::jdwp::event::Event * > *, JArray< ::gnu::classpath::jdwp::event::EventRequest * > *, jbyte);
+private:
+ static void _toData(::java::io::DataOutputStream *, ::gnu::classpath::jdwp::event::Event *, ::gnu::classpath::jdwp::event::EventRequest *);
+public:
static const jint EVENT_CLASS = 1;
static const jint EVENT_THREAD = 2;
static const jint EVENT_LOCATION = 3;
diff --git a/libjava/gnu/classpath/jdwp/natVMMethod.cc b/libjava/gnu/classpath/jdwp/natVMMethod.cc
index 76fd0a64168..1cea54dae9d 100644
--- a/libjava/gnu/classpath/jdwp/natVMMethod.cc
+++ b/libjava/gnu/classpath/jdwp/natVMMethod.cc
@@ -14,6 +14,7 @@ details. */
#include <jvmti.h>
#include "jvmti-int.h"
+#include <java/lang/reflect/Modifier.h>
#include <gnu/classpath/jdwp/VMMethod.h>
#include <gnu/classpath/jdwp/exception/AbsentInformationException.h>
#include <gnu/classpath/jdwp/exception/InvalidMethodException.h>
@@ -65,6 +66,12 @@ gnu::classpath::jdwp::VMMethod::getModifiers ()
jmethodID method = reinterpret_cast<jmethodID> (_methodId);
jint flags;
env->GetMethodModifiers (method, &flags);
+
+ // If this class is compiled, as far as JDWP is concerned, its methods are
+ // native. This will set the native flag for these methods.
+ if (!_Jv_IsInterpretedClass (getDeclaringClass ()))
+ flags |= ::java::lang::reflect::Modifier::NATIVE;
+
return flags;
}
diff --git a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
index 1dfc52995e0..db33781378e 100644
--- a/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
+++ b/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
@@ -21,6 +21,7 @@ details. */
#include <java/lang/String.h>
#include <java/lang/StringBuilder.h>
#include <java/lang/Thread.h>
+#include <java/lang/Throwable.h>
#include <java/nio/ByteBuffer.h>
#include <java/nio/ByteBufferImpl.h>
#include <java/util/ArrayList.h>
@@ -37,6 +38,7 @@ details. */
#include <gnu/classpath/jdwp/VMVirtualMachine.h>
#include <gnu/classpath/jdwp/event/BreakpointEvent.h>
#include <gnu/classpath/jdwp/event/ClassPrepareEvent.h>
+#include <gnu/classpath/jdwp/event/ExceptionEvent.h>
#include <gnu/classpath/jdwp/event/EventManager.h>
#include <gnu/classpath/jdwp/event/EventRequest.h>
#include <gnu/classpath/jdwp/event/SingleStepEvent.h>
@@ -82,6 +84,9 @@ static void handle_single_step (jvmtiEnv *, struct step_info *, jthread,
static void JNICALL jdwpBreakpointCB (jvmtiEnv *, JNIEnv *, jthread,
jmethodID, jlocation);
static void JNICALL jdwpClassPrepareCB (jvmtiEnv *, JNIEnv *, jthread, jclass);
+static void JNICALL jdwpExceptionCB (jvmtiEnv *, JNIEnv *jni_env, jthread,
+ jmethodID, jlocation, jobject,
+ jmethodID, jlocation);
static void JNICALL jdwpSingleStepCB (jvmtiEnv *, JNIEnv *, jthread,
jmethodID, jlocation);
static void JNICALL jdwpThreadEndCB (jvmtiEnv *, JNIEnv *, jthread);
@@ -111,6 +116,7 @@ gnu::classpath::jdwp::VMVirtualMachine::initialize ()
{
_jdwp_suspend_counts = new ::java::util::Hashtable ();
_stepping_threads = new ::java::util::Hashtable ();
+ _event_list = new ::java::util::ArrayList ();
JavaVM *vm = _Jv_GetJavaVM ();
union
@@ -505,12 +511,25 @@ gnu::classpath::jdwp::VMMethod *
gnu::classpath::jdwp::VMVirtualMachine::
getClassMethod (jclass klass, jlong id)
{
- jmethodID method = reinterpret_cast<jmethodID> (id);
- _Jv_MethodBase *bmeth = _Jv_FindInterpreterMethod (klass, method);
- if (bmeth != NULL)
- return new gnu::classpath::jdwp::VMMethod (klass, id);
+ jint count;
+ jmethodID *methods;
+ jvmtiError err = _jdwp_jvmtiEnv->GetClassMethods (klass, &count, &methods);
+ if (err != JVMTI_ERROR_NONE)
+ throw_jvmti_error (err);
+
+ jmethodID meth_id = reinterpret_cast<jmethodID> (id);
- throw new gnu::classpath::jdwp::exception::InvalidMethodException (id);
+ using namespace gnu::classpath::jdwp;
+
+ // Check if this method is defined for the given class and if so return a
+ // VMMethod representing it.
+ for (int i = 0; i < count; i++)
+ {
+ if (methods[i] == meth_id)
+ return new VMMethod (klass, reinterpret_cast<jlong> (meth_id));
+ }
+
+ throw new exception::InvalidMethodException (id);
}
java::util::ArrayList *
@@ -599,12 +618,22 @@ getFrame (Thread *thread, jlong frameID)
VMMethod *meth
= getClassMethod (klass, reinterpret_cast<jlong> (info.method));
+ jobject this_obj;
+
if (info.location == -1)
- loc = new Location (meth, 0);
+ {
+ loc = new Location (meth, 0);
+ this_obj = NULL;
+ }
else
- loc = new Location (meth, info.location);
+ {
+ loc = new Location (meth, info.location);
+ _Jv_InterpFrame *iframe = reinterpret_cast<_Jv_InterpFrame *> (vm_frame);
+ this_obj = iframe->get_this_ptr ();
+ }
- return new VMFrame (thread, reinterpret_cast<jlong> (vm_frame), loc);
+ return new VMFrame (thread, reinterpret_cast<jlong> (vm_frame), loc,
+ this_obj);
}
jint
@@ -877,7 +906,23 @@ handle_single_step (jvmtiEnv *env, struct step_info *sinfo, jthread thread,
jobject instance = iframe->get_this_ptr ();
event::SingleStepEvent *event
= new event::SingleStepEvent (thread, loc, instance);
- Jdwp::notify (event);
+
+ // We only want to send the notification (and consequently
+ // suspend) if we are not about to execute a breakpoint.
+ _Jv_InterpMethod *im = reinterpret_cast<_Jv_InterpMethod *> (iframe->self);
+ if (im->breakpoint_at (location))
+ {
+ // Next insn is a breakpoint -- record event and
+ // wait for the JVMTI breakpoint notification to
+ // enforce a suspension policy.
+ VMVirtualMachine::_event_list->add (event);
+ }
+ else
+ {
+ // Next insn is not a breakpoint, so send notification
+ // and enforce the suspend policy.
+ Jdwp::notify (event);
+ }
}
static void
@@ -907,6 +952,7 @@ jdwpBreakpointCB (jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env,
JvAssert (err == JVMTI_ERROR_NONE);
using namespace gnu::classpath::jdwp;
+ using namespace gnu::classpath::jdwp::event;
jlong methodId = reinterpret_cast<jlong> (method);
VMMethod *meth = VMVirtualMachine::getClassMethod (klass, methodId);
@@ -915,9 +961,16 @@ jdwpBreakpointCB (jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env,
_Jv_InterpFrame *iframe
= reinterpret_cast<_Jv_InterpFrame *> (thread->interp_frame);
jobject instance = iframe->get_this_ptr ();
- event::BreakpointEvent *event
- = new event::BreakpointEvent (thread, loc, instance);
- Jdwp::notify (event);
+ BreakpointEvent *event = new BreakpointEvent (thread, loc, instance);
+
+ VMVirtualMachine::_event_list->add (event);
+ JArray<Event *> *events
+ = ((JArray<Event *> *)
+ JvNewObjectArray (VMVirtualMachine::_event_list->size (),
+ &Event::class$, NULL));
+ VMVirtualMachine::_event_list->toArray ((jobjectArray) events);
+ VMVirtualMachine::_event_list->clear ();
+ Jdwp::notify (events);
}
static void JNICALL
@@ -933,7 +986,57 @@ jdwpClassPrepareCB (MAYBE_UNUSED jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env,
}
static void JNICALL
-jdwpSingleStepCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
+jdwpExceptionCB (jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env, jthread thread,
+ jmethodID method, jlocation location, jobject exception,
+ jmethodID catch_method, jlocation catch_location)
+{
+ using namespace gnu::classpath::jdwp;
+ jclass throw_klass;
+ jvmtiError err = env->GetMethodDeclaringClass (method, &throw_klass);
+ if (err != JVMTI_ERROR_NONE)
+ {
+ fprintf (stderr, "libgcj: internal error: could not find class for ");
+ fprintf (stderr, "method throwing exception -- continuing\n");
+ return;
+ }
+
+ VMMethod *vmmethod = new VMMethod (throw_klass,
+ reinterpret_cast<jlong> (method));
+ Location *throw_loc = new Location (vmmethod, location);
+ Location *catch_loc = NULL;
+ if (catch_method == 0)
+ catch_loc = Location::getEmptyLocation ();
+ else
+ {
+ jclass catch_klass;
+ err = env->GetMethodDeclaringClass (catch_method, &catch_klass);
+ if (err != JVMTI_ERROR_NONE)
+ {
+ fprintf (stderr,
+ "libgcj: internal error: could not find class for ");
+ fprintf (stderr,
+ "method catching exception -- ignoring\n");
+ }
+ else
+ {
+ vmmethod = new VMMethod (catch_klass,
+ reinterpret_cast<jlong> (catch_method));
+ catch_loc = new Location (vmmethod, catch_location);
+ }
+ }
+
+ _Jv_InterpFrame *iframe
+ = reinterpret_cast<_Jv_InterpFrame *> (thread->interp_frame);
+ jobject instance = (iframe == NULL) ? NULL : iframe->get_this_ptr ();
+ Throwable *throwable = reinterpret_cast<Throwable *> (exception);
+ event::ExceptionEvent *e = new ExceptionEvent (throwable, thread,
+ throw_loc, catch_loc,
+ throw_klass, instance);
+ Jdwp::notify (e);
+}
+
+static void JNICALL
+jdwpSingleStepCB (jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env, jthread thread,
jmethodID method, jlocation location)
{
jobject si =
@@ -1034,6 +1137,7 @@ jdwpVMInitCB (MAYBE_UNUSED jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env,
jvmtiEventCallbacks callbacks;
DEFINE_CALLBACK (callbacks, Breakpoint);
DEFINE_CALLBACK (callbacks, ClassPrepare);
+ DEFINE_CALLBACK (callbacks, Exception);
DEFINE_CALLBACK (callbacks, SingleStep);
DEFINE_CALLBACK (callbacks, ThreadEnd);
DEFINE_CALLBACK (callbacks, ThreadStart);
@@ -1043,6 +1147,7 @@ jdwpVMInitCB (MAYBE_UNUSED jvmtiEnv *env, MAYBE_UNUSED JNIEnv *jni_env,
// Enable callbacks
ENABLE_EVENT (BREAKPOINT, NULL);
ENABLE_EVENT (CLASS_PREPARE, NULL);
+ ENABLE_EVENT (EXCEPTION, NULL);
// SingleStep is enabled only when needed
ENABLE_EVENT (THREAD_END, NULL);
ENABLE_EVENT (THREAD_START, NULL);
diff --git a/libjava/gnu/classpath/jdwp/transport/JdwpConnection.h b/libjava/gnu/classpath/jdwp/transport/JdwpConnection.h
index aa6a0272a6f..a8333af9ca1 100644
--- a/libjava/gnu/classpath/jdwp/transport/JdwpConnection.h
+++ b/libjava/gnu/classpath/jdwp/transport/JdwpConnection.h
@@ -48,7 +48,7 @@ private:
public:
virtual ::gnu::classpath::jdwp::transport::JdwpPacket * getPacket();
virtual void sendPacket(::gnu::classpath::jdwp::transport::JdwpPacket *);
- virtual void sendEvent(::gnu::classpath::jdwp::event::EventRequest *, ::gnu::classpath::jdwp::event::Event *);
+ virtual void sendEvents(JArray< ::gnu::classpath::jdwp::event::EventRequest * > *, JArray< ::gnu::classpath::jdwp::event::Event * > *, jbyte);
virtual void shutdown();
private:
static JArray< jbyte > * _HANDSHAKE;
diff --git a/libjava/gnu/gcj/jvmti/ExceptionEvent.h b/libjava/gnu/gcj/jvmti/ExceptionEvent.h
deleted file mode 100644
index 825c33951d7..00000000000
--- a/libjava/gnu/gcj/jvmti/ExceptionEvent.h
+++ /dev/null
@@ -1,44 +0,0 @@
-
-// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
-
-#ifndef __gnu_gcj_jvmti_ExceptionEvent__
-#define __gnu_gcj_jvmti_ExceptionEvent__
-
-#pragma interface
-
-#include <java/lang/Object.h>
-extern "Java"
-{
- namespace gnu
- {
- namespace gcj
- {
- namespace jvmti
- {
- class ExceptionEvent;
- }
- }
- }
-}
-
-class gnu::gcj::jvmti::ExceptionEvent : public ::java::lang::Object
-{
-
- ExceptionEvent(::java::lang::Thread *, jlong, jlong, ::java::lang::Throwable *, jlong, jlong);
-public:
- static void postExceptionEvent(::java::lang::Thread *, jlong, jlong, ::java::lang::Throwable *, jlong, jlong);
- virtual void sendEvent();
- virtual void checkCatch();
-private:
- jlong __attribute__((aligned(__alignof__( ::java::lang::Object)))) _throwMeth;
- jlong _throwLoc;
- jlong _catchMeth;
- jlong _catchLoc;
- ::java::lang::Thread * _thread;
- ::java::lang::Throwable * _ex;
- static ::java::util::WeakHashMap * _exMap;
-public:
- static ::java::lang::Class class$;
-};
-
-#endif // __gnu_gcj_jvmti_ExceptionEvent__
diff --git a/libjava/gnu/gcj/jvmti/ExceptionEvent.java b/libjava/gnu/gcj/jvmti/ExceptionEvent.java
deleted file mode 100644
index 26ddec213f9..00000000000
--- a/libjava/gnu/gcj/jvmti/ExceptionEvent.java
+++ /dev/null
@@ -1,96 +0,0 @@
-// ExceptionEvent - an exception event for JVMTI
-
-/* Copyright (C) 2007 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-package gnu.gcj.jvmti;
-
-import java.util.WeakHashMap;
-
-/**
- * Class to create and send JVMTI Exception events
- *
- * @author Kyle Galloway (kgallowa@redhat.com)
- */
-public class ExceptionEvent
-{
- // Information about where the exception was thrown
- private long _throwMeth, _throwLoc;
-
- // Information about where the exception was or can be caught
- private long _catchMeth, _catchLoc;
-
- // Thread where the exception occurred
- private Thread _thread;
-
- // The exception
- private Throwable _ex;
-
- // A hash map of the exceptions we've already seen in a thread's call stack
- private static WeakHashMap<Thread, Throwable> _exMap = new WeakHashMap<Thread, Throwable>();
-
- /**
- * Constructs a new ExceptionEvent and sends it. If it is not caught
- * within the frame where it was thrown (catchMeth and catchLoc are null),
- * check_catch will check for a possible catch further up the call stack
- * before marking it uncaught.
- *
- * @param thr the thread where the exception occurred
- * @param throwMeth the method of the throw (a jmethodID)
- * @param throwLoc the location of the throw (a jlocation)
- * @param ex the exception
- * @param catchMeth the method of the catch (a jmethodID), null indicates
- * that the exception was not caught in the frame where it was thrown
- * @param catchLoc the location of the catch (a jlocation), null indicates
- * that the exception was not caught in the frame where it was thrown
- */
- private ExceptionEvent(Thread thr, long throwMeth, long throwLoc,
- Throwable ex, long catchMeth, long catchLoc)
- {
- this._thread = thr;
- this._ex = ex;
- this._throwMeth = throwMeth;
- this._throwLoc = throwLoc;
- this._catchMeth = catchMeth;
- this._catchLoc = catchLoc;
- }
-
- public static void postExceptionEvent(Thread thr, long throwMeth,
- long throwLoc, Throwable ex,
- long catchMeth, long catchLoc)
- {
- // Check to see if there is an entry for this Thread thr in the has map.
- // If not, add the thread to the hash map and send an ExceptionEvent.
- if (_exMap.containsKey(thr))
- {
- // Check to see if we are receiving events for the same exception, or a
- // new one. If it is not the same exception beign rethrown, send a new
- // event.
- if (!(_exMap.get(thr) == ex))
- {
- _exMap.put(thr, ex);
- ExceptionEvent event = new ExceptionEvent(thr, throwMeth,
- throwLoc, ex, catchMeth,
- catchLoc);
- event.sendEvent ();
- }
- }
- else
- {
- _exMap.put(thr, ex);
- ExceptionEvent event = new ExceptionEvent(thr, throwMeth,
- throwLoc, ex, catchMeth,
- catchLoc);
- event.sendEvent();
- }
- }
-
- public native void sendEvent();
-
- public native void checkCatch();
-}
diff --git a/libjava/gnu/gcj/jvmti/natExceptionEvent.cc b/libjava/gnu/gcj/jvmti/natExceptionEvent.cc
deleted file mode 100644
index dfc8e669dd8..00000000000
--- a/libjava/gnu/gcj/jvmti/natExceptionEvent.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// natExceptionEvent.cc - C++ code for JVMTI Exception events
-
-/* Copyright (C) 2007 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-#include <gcj/cni.h>
-#include <gcj/method.h>
-#include <java-interp.h>
-#include <java-insns.h>
-#include <java-assert.h>
-#include <jvmti.h>
-#include <jvmti-int.h>
-
-#include <gnu/gcj/jvmti/ExceptionEvent.h>
-
-void
-gnu::gcj::jvmti::ExceptionEvent::sendEvent ()
-{
- // Check if the exception is caught somewhere in the interpreted call stack
- if (_catchMeth == 0 || _catchLoc == 0)
- checkCatch ();
-
- JNIEnv *jni = _Jv_GetCurrentJNIEnv ();
-
- _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION, _thread, jni,
- reinterpret_cast<jmethodID> (_throwMeth),
- static_cast<jlocation> (_throwLoc), _ex,
- reinterpret_cast<jmethodID> (_catchMeth),
- static_cast<jlocation> (_catchLoc));
-}
-
-// This method looks up the interpreted call stack to see if the exception will
-// eventually be caught by some java method.
-void
-gnu::gcj::jvmti::ExceptionEvent::checkCatch ()
-{
- _Jv_InterpFrame *frame
- = reinterpret_cast<_Jv_InterpFrame *> (_thread->interp_frame);
-
- while ((frame = frame->next_interp))
- {
- _Jv_InterpMethod *meth
- = reinterpret_cast<_Jv_InterpMethod *> (frame->self);
- pc_t pc = frame->pc;
-
- if (meth->check_handler (&pc, meth, _ex))
- {
- _catchMeth = reinterpret_cast<jlong> (meth->get_method ());
- _catchLoc = meth->insn_index (pc);
- break;
- }
- }
-}
diff --git a/libjava/gnu/gcj/util/natGCInfo.cc b/libjava/gnu/gcj/util/natGCInfo.cc
index 7e5c6fbb845..8fe049aace0 100644
--- a/libjava/gnu/gcj/util/natGCInfo.cc
+++ b/libjava/gnu/gcj/util/natGCInfo.cc
@@ -66,7 +66,7 @@ extern "C" {
static int gc_ok = 1;
-typedef struct gc_debug_info
+struct gc_debug_info
{
int used;
int free;
diff --git a/libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h b/libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h
index 534834bd1f4..ce5a55849a7 100644
--- a/libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h
+++ b/libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h
@@ -26,7 +26,6 @@ extern "Java"
namespace gtk
{
class ComponentGraphics;
- class GdkFontPeer;
class GtkComponentPeer;
class GtkImage;
}
@@ -110,9 +109,6 @@ private:
public: // actually protected
virtual ::java::awt::image::ColorModel * getNativeCM();
virtual jlong init(jlong);
-public:
- virtual void disposeNative(jlong);
-public: // actually protected
virtual void drawPixels(jlong, JArray< jint > *, jint, jint, jint, JArray< jdouble > *, jdouble, jint);
virtual void setGradient(jlong, jdouble, jdouble, jdouble, jdouble, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
virtual void setPaintPixels(jlong, JArray< jint > *, jint, jint, jint, jboolean, jint, jint);
@@ -123,8 +119,6 @@ public: // actually protected
virtual void cairoSetFillRule(jlong, jint);
virtual void cairoSetLine(jlong, jdouble, jint, jint, jdouble);
virtual void cairoSetDash(jlong, JArray< jdouble > *, jint, jdouble);
- virtual void cairoDrawGlyphVector(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *, jfloat, jfloat, jint, JArray< jint > *, JArray< jfloat > *);
- virtual void cairoSetFont(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *);
virtual void cairoRectangle(jlong, jdouble, jdouble, jdouble, jdouble);
virtual void cairoArc(jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
virtual void cairoSave(jlong);
diff --git a/libjava/gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc b/libjava/gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
index b7a250955ad..7bc0162d3d9 100644
--- a/libjava/gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
+++ b/libjava/gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
@@ -20,7 +20,7 @@ details. */
#include <java/lang/UnsupportedOperationException.h>
::java::lang::management::MemoryUsage *
-gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage(jstring n)
+gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage(jstring)
{
throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 ("gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage (::java::lang::String *) not implemented"));
}
@@ -41,7 +41,7 @@ gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsageThreshold
JArray< ::java::lang::String *> *
-gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getMemoryManagerNames(jstring n)
+gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getMemoryManagerNames(jstring)
{
return (JArray<jstring>*)
JvNewObjectArray(1, &::java::lang::String::class$, JvNewStringLatin1("BoehmGC"));
diff --git a/libjava/gnu/javax/management/Server.h b/libjava/gnu/javax/management/Server.h
index eb396d72ad5..2d9495630a5 100644
--- a/libjava/gnu/javax/management/Server.h
+++ b/libjava/gnu/javax/management/Server.h
@@ -89,12 +89,15 @@ public:
virtual ::javax::management::AttributeList * setAttributes(::javax::management::ObjectName *, ::javax::management::AttributeList *);
virtual void unregisterMBean(::javax::management::ObjectName *);
private:
+ void notify(::javax::management::ObjectName *, ::java::lang::String *);
static ::javax::management::ObjectName * DELEGATE_NAME;
::java::util::Map * __attribute__((aligned(__alignof__( ::java::lang::Object)))) beans;
::java::lang::String * defaultDomain;
::javax::management::MBeanServer * outer;
::javax::management::loading::ClassLoaderRepository * repository;
::java::util::Map * listeners;
+ ::javax::management::MBeanServerDelegate * delegate;
+ static ::java::util::concurrent::atomic::AtomicLong * sequenceNumber;
public:
static ::java::lang::Class class$;
};
diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h
index 4bded047bb3..52a04e78e1d 100644
--- a/libjava/include/java-interp.h
+++ b/libjava/include/java-interp.h
@@ -274,6 +274,9 @@ class _Jv_InterpMethod : public _Jv_MethodBase
the insn or NULL if index is invalid. */
pc_t set_insn (jlong index, pc_t insn);
+ // Is the given location in this method a breakpoint?
+ bool breakpoint_at (jlong index);
+
#ifdef DIRECT_THREADED
friend void _Jv_CompileMethod (_Jv_InterpMethod*);
#endif
diff --git a/libjava/include/java-stack.h b/libjava/include/java-stack.h
index 49e68412be6..40ce825b01f 100644
--- a/libjava/include/java-stack.h
+++ b/libjava/include/java-stack.h
@@ -49,10 +49,6 @@ struct _Jv_InterpFrameInfo
};
#endif
-union _Jv_FrameInfo
-{
-};
-
struct _Jv_StackFrame
{
_Jv_FrameType type; /* Native or interpreted. */
@@ -69,12 +65,11 @@ struct _Jv_StackFrame
void *start_ip;
};
};
-// _Jv_FrameInfo info; /* Frame-type specific data. */
jclass klass;
_Jv_Method *meth;
};
-typedef struct _Jv_UnwindState;
+struct _Jv_UnwindState;
typedef _Unwind_Reason_Code (*_Jv_TraceFn) (_Jv_UnwindState *);
struct _Jv_UnwindState
diff --git a/libjava/include/jvmti-int.h b/libjava/include/jvmti-int.h
index f868655734a..6b09c837659 100644
--- a/libjava/include/jvmti-int.h
+++ b/libjava/include/jvmti-int.h
@@ -89,4 +89,6 @@ extern void _Jv_JVMTI_PostEvent (jvmtiEvent type, jthread event_thread, ...)
// Returns the jvmtiEnv used by the JDWP backend
extern jvmtiEnv *_Jv_GetJDWP_JVMTIEnv (void);
+// Reports JVMTI excpetions
+extern void _Jv_ReportJVMTIExceptionThrow (jthrowable);
#endif /* __GCJ_JVMTI_INT_H__ */
diff --git a/libjava/include/posix-threads.h b/libjava/include/posix-threads.h
index d5f64957c22..806ee556011 100644
--- a/libjava/include/posix-threads.h
+++ b/libjava/include/posix-threads.h
@@ -92,6 +92,14 @@ _Jv_GetPlatformThreadID(_Jv_Thread_t *t)
}
//
+// Signal helpers.
+//
+
+void _Jv_BlockSigchld();
+void _Jv_UnBlockSigchld();
+
+
+//
// Condition variables.
//
diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc
index f95198186e7..9be08df488b 100644
--- a/libjava/interpret-run.cc
+++ b/libjava/interpret-run.cc
@@ -377,7 +377,9 @@ details. */
} \
while (0)
-#else
+#undef INTERP_REPORT_EXCEPTION
+#define INTERP_REPORT_EXCEPTION(Jthrowable) REPORT_EXCEPTION (Jthrowable)
+#else // !DEBUG
#undef NEXT_INSN
#define NEXT_INSN goto *((pc++)->insn)
#define REWRITE_INSN(INSN,SLOT,VALUE) \
@@ -386,7 +388,10 @@ details. */
pc[-1].SLOT = VALUE; \
} \
while (0)
-#endif
+
+#undef INTERP_REPORT_EXCEPTION
+#define INTERP_REPORT_EXCEPTION(Jthrowable) /* not needed when not debugging */
+#endif // !DEBUG
#define INTVAL() ((pc++)->int_val)
#define AVAL() ((pc++)->datum)
@@ -2355,7 +2360,11 @@ details. */
/* VM spec, section 3.11.5 */
if ((klass->getModifiers() & Modifier::ABSTRACT)
|| klass->isInterface())
- throw new java::lang::InstantiationException;
+ {
+ jthrowable t = new java::lang::InstantiationException;
+ INTERP_REPORT_EXCEPTION (t);
+ throw t;
+ }
jobject res = _Jv_AllocObject (klass);
PUSHA (res);
@@ -2422,7 +2431,9 @@ details. */
insn_athrow:
{
jobject value = POPA();
- throw static_cast<jthrowable>(value);
+ jthrowable t = static_cast<jthrowable> (value);
+ INTERP_REPORT_EXCEPTION (t);
+ throw t;
}
NEXT_INSN;
@@ -2639,10 +2650,6 @@ details. */
}
catch (java::lang::Throwable *ex)
{
-#ifdef DEBUG
- // This needs to be done before the pc is changed.
- jlong throw_loc = meth->insn_index (pc);
-#endif
// Check if the exception is handled and, if so, set the pc to the start
// of the appropriate catch block.
if (meth->check_handler (&pc, meth, ex))
@@ -2650,27 +2657,19 @@ details. */
sp = stack;
sp++->o = ex; // Push exception.
#ifdef DEBUG
- if (JVMTI_REQUESTED_EVENT (Exception))
+ if (JVMTI_REQUESTED_EVENT (ExceptionCatch))
{
using namespace gnu::gcj::jvmti;
- jlong throw_meth = reinterpret_cast<jlong> (meth->get_method ());
+ jlong catch_meth = reinterpret_cast<jlong> (meth->get_method ());
jlong catch_loc = meth->insn_index (pc);
- ExceptionEvent::postExceptionEvent (thread, throw_meth,
- throw_loc, ex, throw_meth,
- catch_loc);
+ _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION_CATCH, thread,
+ _Jv_GetCurrentJNIEnv (), catch_meth,
+ catch_loc, ex);
}
#endif
NEXT_INSN;
}
-#ifdef DEBUG
- if (JVMTI_REQUESTED_EVENT (Exception))
- {
- using namespace gnu::gcj::jvmti;
- jlong throw_meth = reinterpret_cast<jlong> (meth->get_method ());
- ExceptionEvent::postExceptionEvent (thread, throw_meth, throw_loc,
- ex, NULL, NULL);
- }
-#endif
+
// No handler, so re-throw.
throw ex;
}
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index ac23b060240..18b4ae0e3e9 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -40,10 +40,8 @@ details. */
#include <jvmti.h>
#include "jvmti-int.h"
-#include <gnu/classpath/jdwp/Jdwp.h>
#include <gnu/gcj/jvmti/Breakpoint.h>
#include <gnu/gcj/jvmti/BreakpointManager.h>
-#include <gnu/gcj/jvmti/ExceptionEvent.h>
#ifdef INTERPRETER
@@ -66,6 +64,16 @@ static void throw_class_format_error (jstring msg)
static void throw_class_format_error (const char *msg)
__attribute__ ((__noreturn__));
+static void find_catch_location (jthrowable, jthread, jmethodID *, jlong *);
+
+// A macro to facilitate JVMTI exception reporting
+#define REPORT_EXCEPTION(Jthrowable) \
+ do { \
+ if (JVMTI_REQUESTED_EVENT (Exception)) \
+ _Jv_ReportJVMTIExceptionThrow (Jthrowable); \
+ } \
+ while (0)
+
#ifdef DIRECT_THREADED
// Lock to ensure that methods are not compiled concurrently.
// We could use a finer-grained lock here, however it is not safe to use
@@ -172,60 +180,81 @@ convert (FROM val, TO min, TO max)
# define LOADD(I) LOADL(I)
#endif
-#define STOREA(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'o'); \
- locals[I].o = (--sp)->o; \
- } while (0)
-#define STOREI(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'i'); \
- locals[I].i = (--sp)->i; \
- } while (0)
-#define STOREF(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'f'); \
- locals[I].f = (--sp)->f; \
+#define STOREA(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'o'); \
+ locals[__idx].o = (--sp)->o; \
+ } \
+ while (0)
+#define STOREI(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'i'); \
+ locals[__idx].i = (--sp)->i; \
} while (0)
+#define STOREF(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'f'); \
+ locals[__idx].f = (--sp)->f; \
+ } \
+ while (0)
#if SIZEOF_VOID_P == 8
-# define STOREL(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'l'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- (sp -= 2, locals[I].l = sp->l); \
- } while (0)
-# define STORED(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'd'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- (sp -= 2, locals[I].d = sp->d); \
- } while (0)
+# define STOREL(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'l'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ (sp -= 2, locals[__idx].l = sp->l); \
+ } \
+ while (0)
+# define STORED(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'd'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ (sp -= 2, locals[__idx].d = sp->d); \
+ } \
+ while (0)
#else
-# define STOREL(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'l'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- jint __idx = (I); \
- locals[__idx+1].ia[0] = (--sp)->ia[0]; \
- locals[__idx].ia[0] = (--sp)->ia[0]; \
- } while (0)
-# define STORED(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'd'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- jint __idx = (I); \
- locals[__idx+1].ia[0] = (--sp)->ia[0]; \
- locals[__idx].ia[0] = (--sp)->ia[0]; \
+# define STOREL(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'l'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ locals[__idx + 1].ia[0] = (--sp)->ia[0]; \
+ locals[__idx].ia[0] = (--sp)->ia[0]; \
+ } \
+ while (0)
+# define STORED(I) \
+ do { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'd'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ locals[__idx + 1].ia[0] = (--sp)->ia[0]; \
+ locals[__idx].ia[0] = (--sp)->ia[0]; \
} while (0)
#endif
#define PEEKI(I) (locals+(I))->i
#define PEEKA(I) (locals+(I))->o
-#define POKEI(I,V) \
- DEBUG_LOCALS_INSN(I,'i'); \
- ((locals+(I))->i = (V))
+#define POKEI(I,V) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'i'); \
+ ((locals + __idx)->i = (V)); \
+ } \
+ while (0)
#define BINOPI(OP) { \
@@ -956,19 +985,25 @@ _Jv_InterpMethod::run_debug (void *retp, ffi_raw *args, _Jv_InterpMethod *meth)
static void
throw_internal_error (const char *msg)
{
- throw new java::lang::InternalError (JvNewStringLatin1 (msg));
+ jthrowable t = new java::lang::InternalError (JvNewStringLatin1 (msg));
+ REPORT_EXCEPTION (t);
+ throw t;
}
static void
throw_incompatible_class_change_error (jstring msg)
{
- throw new java::lang::IncompatibleClassChangeError (msg);
+ jthrowable t = new java::lang::IncompatibleClassChangeError (msg);
+ REPORT_EXCEPTION (t);
+ throw t;
}
static void
throw_null_pointer_exception ()
{
- throw new java::lang::NullPointerException;
+ jthrowable t = new java::lang::NullPointerException;
+ REPORT_EXCEPTION (t);
+ throw t;
}
/* Look up source code line number for given bytecode (or direct threaded
@@ -1545,6 +1580,23 @@ _Jv_InterpMethod::set_insn (jlong index, pc_t insn)
return &code[index];
}
+bool
+_Jv_InterpMethod::breakpoint_at (jlong index)
+{
+ pc_t insn = get_insn (index);
+ if (insn != NULL)
+ {
+#ifdef DIRECT_THREADED
+ return (insn->insn == breakpoint_insn->insn);
+#else
+ pc_t code = reinterpret_cast<pc_t> (bytecode ());
+ return (code[index] == breakpoint_insn);
+#endif
+ }
+
+ return false;
+}
+
void *
_Jv_JNIMethod::ncode (jclass klass)
{
@@ -1613,9 +1665,11 @@ _Jv_JNIMethod::ncode (jclass klass)
static void
throw_class_format_error (jstring msg)
{
- throw (msg
+ jthrowable t = (msg
? new java::lang::ClassFormatError (msg)
: new java::lang::ClassFormatError);
+ REPORT_EXCEPTION (t);
+ throw t;
}
static void
@@ -1624,6 +1678,70 @@ throw_class_format_error (const char *msg)
throw_class_format_error (JvNewStringLatin1 (msg));
}
+/* This function finds the method and location where the exception EXC
+ is caught in the stack frame. On return, it sets CATCH_METHOD and
+ CATCH_LOCATION with the method and location where the catch will
+ occur. If the exception is not caught, these are set to 0.
+
+ This function should only be used with the DEBUG interpreter. */
+static void
+find_catch_location (::java::lang::Throwable *exc, jthread thread,
+ jmethodID *catch_method, jlong *catch_loc)
+{
+ *catch_method = 0;
+ *catch_loc = 0;
+
+ _Jv_InterpFrame *frame
+ = reinterpret_cast<_Jv_InterpFrame *> (thread->interp_frame);
+ while (frame != NULL)
+ {
+ pc_t pc = frame->get_pc ();
+ _Jv_InterpMethod *imeth
+ = reinterpret_cast<_Jv_InterpMethod *> (frame->self);
+ if (imeth->check_handler (&pc, imeth, exc))
+ {
+ // This method handles the exception.
+ *catch_method = imeth->get_method ();
+ *catch_loc = imeth->insn_index (pc);
+ return;
+ }
+
+ frame = frame->next_interp;
+ }
+}
+
+/* This method handles JVMTI notifications of thrown exceptions. It
+ calls find_catch_location to figure out where the exception is
+ caught (if it is caught).
+
+ Like find_catch_location, this should only be called with the
+ DEBUG interpreter. Since a few exceptions occur outside the
+ interpreter proper, it is important to not call this function
+ without checking JVMTI_REQUESTED_EVENT(Exception) first. */
+void
+_Jv_ReportJVMTIExceptionThrow (jthrowable ex)
+{
+ jthread thread = ::java::lang::Thread::currentThread ();
+ _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ jmethodID throw_meth = frame->self->get_method ();
+ jlocation throw_loc = -1;
+ if (frame->frame_type == frame_interpreter)
+ {
+ _Jv_InterpFrame * iframe
+ = reinterpret_cast<_Jv_InterpFrame *> (frame);
+ _Jv_InterpMethod *imeth
+ = reinterpret_cast<_Jv_InterpMethod *> (frame->self);
+ throw_loc = imeth->insn_index (iframe->get_pc ());
+ }
+
+ jlong catch_loc;
+ jmethodID catch_method;
+ find_catch_location (ex, thread, &catch_method, &catch_loc);
+ _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION, thread,
+ _Jv_GetCurrentJNIEnv (), throw_meth, throw_loc,
+ ex, catch_method, catch_loc);
+}
+
void
diff --git a/libjava/java/lang/PosixProcess$ProcessManager.h b/libjava/java/lang/PosixProcess$ProcessManager.h
index d8d0d594232..4b3b62e13dd 100644
--- a/libjava/java/lang/PosixProcess$ProcessManager.h
+++ b/libjava/java/lang/PosixProcess$ProcessManager.h
@@ -7,31 +7,37 @@
#pragma interface
#include <java/lang/Thread.h>
+extern "Java"
+{
+ namespace gnu
+ {
+ namespace gcj
+ {
+ class RawDataManaged;
+ }
+ }
+}
class java::lang::PosixProcess$ProcessManager : public ::java::lang::Thread
{
public: // actually package-private
PosixProcess$ProcessManager();
-private:
- ::java::lang::PosixProcess * removeProcessFromMap(jlong);
-public: // actually package-private
- virtual void addProcessToMap(::java::lang::PosixProcess *);
- virtual void startExecuting(::java::lang::PosixProcess *);
- virtual void waitUntilReady();
+ void addToLiveProcesses(::java::lang::PosixProcess *);
+ void startExecuting(::java::lang::PosixProcess *);
+ void waitUntilReady();
public:
- virtual void run();
+ void run();
private:
void init();
void waitForSignal();
- jboolean reap();
+ jboolean reap(::java::lang::PosixProcess *);
void signalReaper();
-public: // actually package-private
- ::java::util::List * __attribute__((aligned(__alignof__( ::java::lang::Thread)))) queue;
-private:
- ::java::util::Map * pidToProcess;
+ ::java::util::LinkedList * __attribute__((aligned(__alignof__( ::java::lang::Thread)))) queue;
+ ::java::util::LinkedList * liveProcesses;
jboolean ready;
- jlong reaperPID;
+public: // actually package-private
+ static ::gnu::gcj::RawDataManaged * nativeData;
public:
static ::java::lang::Class class$;
};
diff --git a/libjava/java/lang/PosixProcess.h b/libjava/java/lang/PosixProcess.h
index a43fa0739d5..3254f5224ce 100644
--- a/libjava/java/lang/PosixProcess.h
+++ b/libjava/java/lang/PosixProcess.h
@@ -32,17 +32,16 @@ private:
void nativeSpawn();
public: // actually package-private
PosixProcess(JArray< ::java::lang::String * > *, JArray< ::java::lang::String * > *, ::java::io::File *, jboolean);
- static jlong access$0(::java::lang::PosixProcess *);
- static ::java::lang::Object * access$1();
- static void access$2(::java::lang::PosixProcess$ProcessManager *);
+ static ::java::lang::Object * access$0();
+ static void access$1(::java::lang::PosixProcess$ProcessManager *);
private:
JArray< ::java::lang::String * > * __attribute__((aligned(__alignof__( ::java::lang::Process)))) progarray;
JArray< ::java::lang::String * > * envp;
::java::io::File * dir;
jboolean redirect;
::java::lang::Throwable * exception;
- jlong pid;
public: // actually package-private
+ jlong pid;
static const jint STATE_WAITING_TO_START = 0;
static const jint STATE_RUNNING = 1;
static const jint STATE_TERMINATED = 2;
diff --git a/libjava/java/lang/PosixProcess.java b/libjava/java/lang/PosixProcess.java
index 6b1496426dd..dd59e7b93a1 100644
--- a/libjava/java/lang/PosixProcess.java
+++ b/libjava/java/lang/PosixProcess.java
@@ -13,11 +13,10 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.HashMap;
+import java.util.Iterator;
import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import gnu.gcj.RawDataManaged;
/**
* @author Tom Tromey <tromey@cygnus.com>
@@ -27,7 +26,7 @@ import java.util.Map;
*/
final class PosixProcess extends Process
{
- static class ProcessManager extends Thread
+ static final class ProcessManager extends Thread
{
/**
* A list of {@link PosixProcess PosixProcesses} to be
@@ -35,10 +34,12 @@ final class PosixProcess extends Process
* for all process related operations. To avoid dead lock
* ensure queueLock is obtained before PosixProcess.
*/
- List queue = new LinkedList();
- private Map pidToProcess = new HashMap();
+ private LinkedList<PosixProcess> queue = new LinkedList<PosixProcess>();
+ private LinkedList<PosixProcess> liveProcesses =
+ new LinkedList<PosixProcess>();
private boolean ready = false;
- private long reaperPID;
+
+ static RawDataManaged nativeData;
ProcessManager()
{
@@ -53,27 +54,14 @@ final class PosixProcess extends Process
}
/**
- * Get the PosixProcess object with the given pid and
- * remove it from the map. This method is called from the
- * native code for {@link #reap()). The mapping is removed so
- * the PosixProcesses can be GCed after they terminate.
- *
- * @param p The pid of the process.
- */
- private PosixProcess removeProcessFromMap(long p)
- {
- return (PosixProcess) pidToProcess.remove(new Long(p));
- }
-
- /**
- * Put the given PosixProcess in the map using the Long
- * value of its pid as the key.
+ * Add a process to the list of running processes. This must only
+ * be called with the queueLock held.
*
* @param p The PosixProcess.
*/
- void addProcessToMap(PosixProcess p)
+ void addToLiveProcesses(PosixProcess p)
{
- pidToProcess.put(new Long(p.pid), p);
+ liveProcesses.add(p);
}
/**
@@ -122,61 +110,66 @@ final class PosixProcess extends Process
// Now ready to accept requests.
synchronized (this)
{
- ready = true;
- this.notifyAll();
+ ready = true;
+ this.notifyAll();
}
for (;;)
{
- try
- {
- synchronized (queueLock)
- {
- boolean haveMoreChildren = reap();
- if (! haveMoreChildren && queue.size() == 0)
- {
- // This reaper thread could exit, but we
- // keep it alive for a while in case
- // someone wants to start more Processes.
- try
- {
- queueLock.wait(1000L);
- if (queue.size() == 0)
- {
- processManager = null;
- return; // Timed out.
- }
- }
- catch (InterruptedException ie)
- {
- // Ignore and exit the thread.
- return;
- }
- }
- while (queue.size() > 0)
- {
- PosixProcess p = (PosixProcess) queue.remove(0);
- p.spawn(this);
- }
- }
-
- // Wait for a SIGCHLD from either an exiting
- // process or the startExecuting() method. This
- // is done outside of the synchronized block to
- // allow other threads to enter and submit more
- // jobs.
- waitForSignal();
- }
- catch (Exception ex)
- {
- ex.printStackTrace(System.err);
- }
+ try
+ {
+ synchronized (queueLock)
+ {
+ Iterator<PosixProcess> processIterator =
+ liveProcesses.iterator();
+ while (processIterator.hasNext())
+ {
+ boolean reaped = reap(processIterator.next());
+ if (reaped)
+ processIterator.remove();
+ }
+ if (liveProcesses.size() == 0 && queue.size() == 0)
+ {
+ // This reaper thread could exit, but we keep it
+ // alive for a while in case someone wants to
+ // start more Processes.
+ try
+ {
+ queueLock.wait(1000L);
+ if (queue.size() == 0)
+ {
+ processManager = null;
+ return; // Timed out.
+ }
+ }
+ catch (InterruptedException ie)
+ {
+ // Ignore and exit the thread.
+ return;
+ }
+ }
+ while (queue.size() > 0)
+ {
+ PosixProcess p = queue.remove(0);
+ p.spawn(this);
+ }
+ }
+
+ // Wait for a SIGCHLD from either an exiting process or
+ // the startExecuting() method. This is done outside of
+ // the synchronized block to allow other threads to
+ // enter and submit more jobs.
+ waitForSignal();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace(System.err);
+ }
}
}
/**
* Setup native signal handlers and other housekeeping things.
- *
*/
private native void init();
@@ -187,12 +180,14 @@ final class PosixProcess extends Process
private native void waitForSignal();
/**
- * Try to reap as many children as possible without blocking.
+ * Try to reap the specified child without blocking.
+ *
+ * @param p the process to try to reap.
*
- * @return true if more live children exist.
+ * @return true if the process terminated.
*
*/
- private native boolean reap();
+ private native boolean reap(PosixProcess p);
/**
* Send SIGCHLD to the reaper thread.
@@ -295,7 +290,7 @@ final class PosixProcess extends Process
returnedErrorStream = EOFInputStream.instance;
else
returnedErrorStream = errorStream;
-
+
return returnedErrorStream;
}
@@ -308,7 +303,7 @@ final class PosixProcess extends Process
returnedInputStream = EOFInputStream.instance;
else
returnedInputStream = inputStream;
-
+
return returnedInputStream;
}
@@ -329,7 +324,7 @@ final class PosixProcess extends Process
/**
* Start this process running. This should only be called by the
- * ProcessManager.
+ * ProcessManager with the queueLock held.
*
* @param pm The ProcessManager that made the call.
*/
@@ -342,7 +337,7 @@ final class PosixProcess extends Process
// There is no race with reap() in the pidToProcess map
// because this is always called from the same thread
// doing the reaping.
- pm.addProcessToMap(this);
+ pm.addToLiveProcesses(this);
state = STATE_RUNNING;
// Notify anybody waiting on state change.
this.notifyAll();
@@ -426,7 +421,7 @@ final class PosixProcess extends Process
private Throwable exception;
/** The process id. This is cast to a pid_t on the native side. */
- private long pid;
+ long pid;
// FIXME: Why doesn't the friend declaration in PosixProcess.h
// allow PosixProcess$ProcessManager native code access these
diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc
index 252da6e80ab..c7b8b6e5eb0 100644
--- a/libjava/java/lang/natPosixProcess.cc
+++ b/libjava/java/lang/natPosixProcess.cc
@@ -30,6 +30,8 @@ details. */
#include <gcj/cni.h>
#include <jvm.h>
+#include <posix.h>
+#include <posix-threads.h>
#include <java/lang/PosixProcess$ProcessManager.h>
#include <java/lang/PosixProcess.h>
@@ -48,6 +50,7 @@ details. */
#include <java/lang/PosixProcess$EOFInputStream.h>
using gnu::java::nio::channels::FileChannelImpl;
+using namespace java::lang;
extern char **environ;
@@ -91,13 +94,37 @@ myclose (int &fd)
fd = -1;
}
+namespace
+{
+ struct ProcessManagerInternal
+ {
+ int pipe_ends[2];
+ struct sigaction old_sigaction;
+ };
+}
+
+
// There has to be a signal handler in order to be able to
// sigwait() on SIGCHLD. The information passed is ignored as it
// will be recovered by the waitpid() call.
static void
-sigchld_handler (int)
+sigchld_handler (int sig, siginfo_t *si, void *third)
{
- // Ignore.
+ if (PosixProcess$ProcessManager::nativeData != NULL)
+ {
+ ProcessManagerInternal *pmi =
+ (ProcessManagerInternal *)PosixProcess$ProcessManager::nativeData;
+ char c = 0;
+ ::write(pmi->pipe_ends[1], &c, 1);
+ if (pmi->old_sigaction.sa_handler != SIG_DFL
+ && pmi->old_sigaction.sa_handler != SIG_IGN)
+ {
+ if ((pmi->old_sigaction.sa_flags & SA_SIGINFO) != 0)
+ pmi->old_sigaction.sa_sigaction(sig, si, third);
+ else
+ (*pmi->old_sigaction.sa_handler)(sig);
+ }
+ }
}
@@ -105,22 +132,35 @@ sigchld_handler (int)
void
java::lang::PosixProcess$ProcessManager::init ()
{
- using namespace java::lang;
- // Remenber our PID so other threads can kill us.
- reaperPID = (jlong) pthread_self ();
+ // The nativeData is static to avoid races installing the signal
+ // handler in the case that it is chained.
+ if (nativeData == NULL )
+ {
+ ProcessManagerInternal *pmi =
+ (ProcessManagerInternal *)JvAllocBytes(sizeof(ProcessManagerInternal));
- // SIGCHLD is blocked in all threads in posix-threads.cc.
- // Setup the SIGCHLD handler.
- struct sigaction sa;
- memset (&sa, 0, sizeof (sa));
+ if (0 != ::pipe(pmi->pipe_ends))
+ goto error;
- sa.sa_handler = sigchld_handler;
- // We only want signals when the things exit.
- sa.sa_flags = SA_NOCLDSTOP;
+ // Make writing non-blocking so that the signal handler will
+ // never block.
+ int fl = ::fcntl(pmi->pipe_ends[1], F_GETFL);
+ ::fcntl(pmi->pipe_ends[1], F_SETFL, fl | O_NONBLOCK);
- if (-1 == sigaction (SIGCHLD, &sa, NULL))
- goto error;
+ nativeData = (::gnu::gcj::RawDataManaged *)pmi;
+ // SIGCHLD is blocked in all threads in posix-threads.cc.
+ // Setup the SIGCHLD handler.
+ struct sigaction sa;
+ memset (&sa, 0, sizeof (sa));
+
+ sa.sa_sigaction = sigchld_handler;
+ // We only want signals when the things exit.
+ sa.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
+
+ if (-1 == sigaction (SIGCHLD, &sa, &pmi->old_sigaction))
+ goto error;
+ }
// All OK.
return;
@@ -132,79 +172,52 @@ void
java::lang::PosixProcess$ProcessManager::waitForSignal ()
{
// Wait for SIGCHLD
- sigset_t mask;
- pthread_sigmask (0, NULL, &mask);
- sigdelset (&mask, SIGCHLD);
+ _Jv_UnBlockSigchld();
+ ProcessManagerInternal *pmi = (ProcessManagerInternal *)nativeData;
- // Use sigsuspend() instead of sigwait() as sigwait() doesn't play
- // nicely with the GC's use of signals.
- sigsuspend (&mask);
+ // Try to read multiple (64) notifications in one go.
+ char c[64];
+ ::read(pmi->pipe_ends[0], c, sizeof (c));
- // Do not check sigsuspend return value. The only legitimate return
- // is EINTR, but there is a known kernel bug affecting alpha-linux
- // wrt sigsuspend+handler+sigreturn that can result in a return value
- // of __NR_sigsuspend and errno unset. Don't fail unnecessarily on
- // older kernel versions.
+ _Jv_BlockSigchld();
- // All OK.
return;
}
-jboolean java::lang::PosixProcess$ProcessManager::reap ()
+jboolean java::lang::PosixProcess$ProcessManager::reap (PosixProcess *p)
{
- using namespace java::lang;
-
- pid_t pid;
-
- for (;;)
- {
- // Get the return code from a dead child process.
- int status;
- pid = waitpid ((pid_t) - 1, &status, WNOHANG);
- if (pid == -1)
- {
- if (errno == ECHILD)
- return false;
- else
- goto error;
- }
-
- if (pid == 0)
- return true; // No children to wait for.
-
- // Look up the process in our pid map.
- PosixProcess * process = removeProcessFromMap ((jlong) pid);
-
- // Note that if process==NULL, then we have an unknown child.
- // This is not common, but can happen, and isn't an error.
- if (process)
- {
- JvSynchronize sync (process);
- process->status = WIFEXITED (status) ? WEXITSTATUS (status) : -1;
- process->state = PosixProcess::STATE_TERMINATED;
- process->processTerminationCleanup();
- process->notifyAll ();
- }
- }
-
-error:
- throw new InternalError (JvNewStringUTF (strerror (errno)));
+ pid_t rv;
+
+ // Try to get the return code from the child process.
+ int status;
+ rv = ::waitpid ((pid_t)p->pid, &status, WNOHANG);
+ if (rv == -1)
+ throw new InternalError (JvNewStringUTF (strerror (errno)));
+
+ if (rv == 0)
+ return false; // No children to wait for.
+
+ JvSynchronize sync (p);
+ p->status = WIFEXITED (status) ? WEXITSTATUS (status) : -1;
+ p->state = PosixProcess::STATE_TERMINATED;
+ p->processTerminationCleanup();
+ p->notifyAll ();
+ return true;
}
void
java::lang::PosixProcess$ProcessManager::signalReaper ()
{
- int c = pthread_kill ((pthread_t) reaperPID, SIGCHLD);
- if (c == 0)
- return;
- // pthread_kill() failed.
- throw new InternalError (JvNewStringUTF (strerror (c)));
+ ProcessManagerInternal *pmi = (ProcessManagerInternal *)nativeData;
+ char c = 0;
+ ::write(pmi->pipe_ends[1], &c, 1);
+ // Ignore errors. If EPIPE the reaper has already exited.
}
void
java::lang::PosixProcess::nativeDestroy ()
{
- int c = kill ((pid_t) pid, SIGKILL);
+ int c = ::kill ((pid_t) pid, SIGKILL);
if (c == 0)
return;
// kill() failed.
@@ -427,9 +440,9 @@ java::lang::PosixProcess::nativeSpawn ()
char c;
int r = read (msgp[0], &c, 1);
if (r == -1)
- throw new IOException (JvNewStringUTF (strerror (errno)));
+ throw new IOException (JvNewStringUTF (strerror (errno)));
else if (r != 0)
- throw new IOException (JvNewStringUTF (strerror (c)));
+ throw new IOException (JvNewStringUTF (strerror (c)));
}
catch (java::lang::Throwable *thrown)
{
diff --git a/libjava/java/lang/natString.cc b/libjava/java/lang/natString.cc
index 39590a3e4e0..f177c23ccc4 100644
--- a/libjava/java/lang/natString.cc
+++ b/libjava/java/lang/natString.cc
@@ -371,11 +371,11 @@ _Jv_FormatInt (jchar* bufend, jint num)
if (num < 0)
{
isNeg = true;
- num = -(num);
- if (num < 0)
+ if (num != (jint) -2147483648U)
+ num = -(num);
+ else
{
- // Must be MIN_VALUE, so handle this special case.
- // FIXME use 'unsigned jint' for num.
+ // Handle special case of MIN_VALUE.
*--ptr = '8';
num = 214748364;
}
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 9e33be6e69f..549d4fb06d3 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -23,6 +23,7 @@ details. */
#include <jvmpi.h>
#endif
#include <jvmti.h>
+#include "jvmti-int.h"
#include <java/lang/Class.h>
#include <java/lang/ClassLoader.h>
@@ -456,6 +457,8 @@ _Jv_JNI_PopSystemFrame (JNIEnv *env)
{
jthrowable t = env->ex;
env->ex = NULL;
+ if (JVMTI_REQUESTED_EVENT (Exception))
+ _Jv_ReportJVMTIExceptionThrow (t);
throw t;
}
}
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc
index 6ea724b3be8..287d6b79a6f 100644
--- a/libjava/posix-threads.cc
+++ b/libjava/posix-threads.cc
@@ -14,6 +14,7 @@ details. */
#include <config.h>
#include "posix.h"
+#include "posix-threads.h"
// If we're using the Boehm GC, then we need to override some of the
// thread primitives. This is fairly gross.
@@ -472,8 +473,8 @@ handle_intr (int)
// Do nothing.
}
-static void
-block_sigchld()
+void
+_Jv_BlockSigchld()
{
sigset_t mask;
sigemptyset (&mask);
@@ -484,6 +485,17 @@ block_sigchld()
}
void
+_Jv_UnBlockSigchld()
+{
+ sigset_t mask;
+ sigemptyset (&mask);
+ sigaddset (&mask, SIGCHLD);
+ int c = pthread_sigmask (SIG_UNBLOCK, &mask, NULL);
+ if (c != 0)
+ JvFail (strerror (c));
+}
+
+void
_Jv_InitThreads (void)
{
pthread_key_create (&_Jv_ThreadKey, NULL);
@@ -501,7 +513,7 @@ _Jv_InitThreads (void)
// Block SIGCHLD here to ensure that any non-Java threads inherit the new
// signal mask.
- block_sigchld();
+ _Jv_BlockSigchld();
// Check/set the thread stack size.
size_t min_ss = 32 * 1024;
@@ -581,7 +593,7 @@ _Jv_ThreadRegister (_Jv_Thread_t *data)
}
# endif
// Block SIGCHLD which is used in natPosixProcess.cc.
- block_sigchld();
+ _Jv_BlockSigchld();
}
void
@@ -629,7 +641,7 @@ _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data,
// Block SIGCHLD which is used in natPosixProcess.cc.
// The current mask is inherited by the child thread.
- block_sigchld();
+ _Jv_BlockSigchld();
param.sched_priority = thread->getPriority();
diff --git a/libjava/scripts/makemake.tcl b/libjava/scripts/makemake.tcl
index 0fc06fce15d..ab8a85d2c29 100755
--- a/libjava/scripts/makemake.tcl
+++ b/libjava/scripts/makemake.tcl
@@ -228,6 +228,9 @@ proc scan_directory {basedir subdir} {
# We assume there aren't any overrides.
lappend properties_files $basedir/$subdir/$file
}
+ } elseif {[string match *.css $file]} {
+ # Special case for default.css needed by javax.swing.text.html.
+ lappend properties_files $basedir/$subdir/$file
} elseif {[file isdirectory $file]} {
lappend subdirs $subdir/$file
} elseif {$subdir == "META-INF/services"} {
diff --git a/libjava/sources.am b/libjava/sources.am
index de98ee6ce10..caba875f87e 100644
--- a/libjava/sources.am
+++ b/libjava/sources.am
@@ -538,7 +538,6 @@ gnu/gcj/io.list: $(gnu_gcj_io_source_files)
gnu_gcj_jvmti_source_files = \
gnu/gcj/jvmti/Breakpoint.java \
gnu/gcj/jvmti/BreakpointManager.java \
-gnu/gcj/jvmti/ExceptionEvent.java \
gnu/gcj/jvmti/Location.java
gnu_gcj_jvmti_header_files = $(patsubst %.java,%.h,$(gnu_gcj_jvmti_source_files))
@@ -9005,6 +9004,7 @@ property_files = \
classpath/resource/gnu/javax/security/auth/callback/MessagesBundle.properties \
classpath/resource/java/util/iso4217.properties \
classpath/resource/javax/imageio/plugins/jpeg/MessagesBundle.properties \
+ classpath/resource/javax/swing/text/html/default.css \
classpath/resource/org/ietf/jgss/MessagesBundle.properties \
classpath/resource/sun/rmi/rmic/messages.properties \
classpath/resource/com/sun/tools/javac/messages.properties \
diff --git a/libjava/sun/misc/natUnsafe.cc b/libjava/sun/misc/natUnsafe.cc
index 7aa422e58dc..cc57dd59889 100644
--- a/libjava/sun/misc/natUnsafe.cc
+++ b/libjava/sun/misc/natUnsafe.cc
@@ -31,7 +31,8 @@ public:
spinlock ()
{
- while (! compare_and_swap (&lock, 0, 1));
+ while (! compare_and_swap (&lock, 0, 1))
+ ;
}
~spinlock ()
{
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 48a0494cb5b..6d5c5d413e2 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,427 @@
+2007-05-17 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/c_locale.h: Do not include <libintl.h>.
+ * config/locale/gnu/messages_members.h: Do it here.
+
+ * config/locale/gnu/c_locale.h: Do not include <cstdio>, use
+ the builtins.
+ * config/locale/generic/c_locale.h: Likewise.
+
+2007-05-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Add -g to
+ compile flags, move code to test to global scope.
+ * configure: Regenerate.
+
+2007-05-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc:
+ Fix dg bits.
+ * testsuite/21_strings/char_traits/requirements/char/typedefs.cc: Same.
+
+2007-05-17 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_algobase.h (mismatch): Move...
+ * include/bits/stl_algo.h: ... here.
+
+2007-05-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/tr1/cmath: Guard special math with
+ __GXX_EXPERIMENTAL_CXX0X__.
+ * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc:
+ Remove xfail.
+
+2007-05-17 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (__pad<>::_S_pad): Minor tweaks, avoid
+ unnecessary casts, do widenings just in time.
+
+2007-05-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Add a function
+ to the test code compiled with -ffunction-sections -fdata-sections.
+ * configure: Regenerate.
+
+ * testsuite/22_locale/ctype/scan/wchar_t/1.cc: Remove
+ _GLIBCXX_USE_WCHAR_T guards as superfluous.
+
+ * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Add
+ _GLIBCXX_USE_WCHAR_T guards.
+ * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Same.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Same.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Same.
+
+ * testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc:
+ Add.
+ * testsuite/21_strings/char_traits/typedefs/char/1.cc: Move...
+ * testsuite/21_strings/char_traits/requirements/char/typedefs.cc:
+ ...here.
+ * testsuite/21_strings/char_traits/typedefs: Remove.
+ * testsuite/21_strings/char_traits/typedefs/char: Remove.
+
+2007-05-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/html/abi.html: Update for gcc-4.1.2 and gcc-4.2.0.
+
+2007-05-14 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * testsuite/tr1/5_numerical_facilities/special_functions/
+ 17_hyperg/check_nan.cc: Add -mieee for sh.
+
+2007-05-14 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/util/testsuite_io.h: Only include <ios>.
+
+2007-05-14 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/allocator.h: Do not include cpp_type_traits.h.
+
+2007-05-14 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/postypes.h (class fpos<>): Remove redundant forward
+ declaration.
+
+2007-05-13 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_tempbuf.h (return_temporary_buffer(_Tp*)): Inline.
+
+2007-05-13 Paolo Carlini <pcarlini@suse.de>
+
+ * include/tr1/type_traitsfwd.h: Fix include guard typo.
+
+2007-05-11 Paolo Carlini <pcarlini@suse.de>
+
+ * include/ext/pod_char_traits.h (char_traits<>::move):
+ Use __builtin_memmove.
+ * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name,
+ collate_byname(const char*, size_t)): Use __builtin_strcmp.
+ * include/bits/locale_facets.h: Use __builtin_mem* and
+ __builtin_str* everywhere.
+ * include/bits/codecvt.h (codecvt_byname(const char*, size_t)):
+ Use __builtin_strcmp.
+ * include/bits/char_traits.h: Use __builtin_mem* everywhere.
+ * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue):
+ Use __builtin_memcpy and __builtin_memmove.
+ * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*,
+ size_t __refs)): Use __builtin_strcmp.
+ * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset.
+ * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp,
+ and __builtin_memcpy.
+ * config/locale/gnu/messages_members.h: Likewise.
+ * config/locale/gnu/time_members.h: Likewise.
+ * config/locale/generic/c_locale.h: Likewise.
+ * config/locale/generic/messages_members.h: Likewise.
+ * config/locale/generic/time_members.h: Likewise.
+ * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup.
+ * config/os/tpf/ctype_noninline.h: Likewise.
+ * config/locale/generic/codecvt_members.cc: Include <cstring>.
+ * config/locale/generic/ctype_members.cc: Likewise.
+ * config/locale/generic/collate_members.cc: Likewise.
+ * config/locale/gnu/c++locale_internal.h: Likewise.
+ * config/locale/darwin/ctype_members.cc: Likewise.
+ * src/ctype.cc: Likewise.
+ * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise.
+ * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise.
+ * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise.
+ * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise.
+ * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise.
+ * config/locale/gnu/messages_members.cc: Avoid strdup.
+ * config/locale/gnu/monetary_members.cc: Likewise.
+ * config/locale/gnu/time_members.cc: Likewise.
+ * config/locale/gnu/time_members.cc: Likewise.
+ * config/locale/generic/c_locale.cc: Likewise.
+
+2007-05-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/stdexcept: Remove extra spacing.
+
+ * testsuite/19_diagnostics/stdexceptions.cc: Break into...
+ * testsuite/19_diagnostics/bad_exception: ...this. Populate.
+ * testsuite/19_diagnostics/logic_error: ... this.
+ * testsuite/19_diagnostics/logic_error/what-1.cc: ...this.
+ * testsuite/19_diagnostics/logic_error/what-2.cc: ...this.
+ * testsuite/19_diagnostics/runtime_error: ...this.
+ * testsuite/19_diagnostics/runtime_error/what-1.cc: ...this.
+ * testsuite/19_diagnostics/runtime_error/what-2.cc: ...this.
+ * testsuite/19_diagnostics/runtime_error/what-3.cc: ...this.
+ * testsuite/19_diagnostics/23591_thread-1.c: Move...
+ * testsuite/19_diagnostics/bad_exception/23591_thread-1.c: ...here.
+
+2007-05-10 Paolo Carlini <pcarlini@suse.de>
+
+ * 27_io/objects/wchar_t/11.cc: Include <cstring>.
+ * 27_io/objects/wchar_t/10.cc: Likewise.
+ * 27_io/objects/wchar_t/12.cc: Likewise.
+ * 27_io/basic_streambuf/sputbackc/char/9538.cc: Likewise.
+ * 27_io/basic_streambuf/sgetn/char/1.cc: Likewise.
+ * 27_io/basic_streambuf/overflow/char/1.cc: Likewise.
+ * 27_io/basic_streambuf/sgetc/char/1.cc: Likewise.
+ * 27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise.
+ * 27_io/basic_streambuf/sputn/char/1.cc: Likewise.
+ * 27_io/basic_ios/cons/char/3.cc: Likewise.
+ * 27_io/basic_stringbuf/setbuf/char/2.cc: Likewise.
+ * 27_io/basic_stringbuf/setbuf/char/3.cc: Likewise.
+ * 27_io/basic_stringbuf/setbuf/char/4.cc: Likewise.
+ * 27_io/basic_istream/extractors_character/char/4.cc: Likewise.
+ * 27_io/fpos/mbstate_t/1.cc: Likewise.
+ * 27_io/basic_filebuf/setbuf/char/2.cc: Likewise.
+ * 27_io/basic_filebuf/setbuf/char/3.cc: Likewise.
+ * 25_algorithms/copy/streambuf_iterators/char/2.cc: Likewise.
+ * 25_algorithms/copy/streambuf_iterators/char/4.cc: Likewise.
+ * 19_diagnostics/stdexceptions.cc: Likewise.
+ * 21_strings/char_traits/requirements/short/1.cc: Likewise.
+ * 21_strings/basic_string/compare/char/1.cc: Likewise.
+ * 21_strings/basic_string/capacity/1.cc: Likewise.
+ * ext/codecvt/char-1.cc: Likewise.
+ * ext/codecvt/char-2.cc: Likewise.
+ * ext/codecvt/1.cc: Likewise.
+ * ext/stdio_sync_filebuf/wchar_t/1.cc: Likewise.
+ * ext/stdio_sync_filebuf/char/1.cc: Likewise.
+ * ext/stdio_filebuf/char/2.cc: Likewise.
+ * ext/stdio_filebuf/char/10063-1.cc: Likewise.
+ * 22_locale/ctype/narrow/char/19955.cc: Likewise.
+ * 22_locale/codecvt/unshift/wchar_t/1.cc: Likewise.
+ * 22_locale/codecvt/unshift/wchar_t/2.cc: Likewise.
+ * 22_locale/codecvt/unshift/wchar_t/3.cc: Likewise.
+ * 22_locale/codecvt/unshift/wchar_t/4.cc: Likewise.
+ * 22_locale/codecvt/unshift/char/1.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/1.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/2.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/3.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/4.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/5.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/6.cc: Likewise.
+ * 22_locale/codecvt/length/wchar_t/7.cc: Likewise.
+ * 22_locale/codecvt/always_noconv/char/1.cc: Likewise.
+ * 22_locale/codecvt/encoding/char/1.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/1.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/2.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/3.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/4.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/5.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/6.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/7.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/8.cc: Likewise.
+ * 22_locale/codecvt/in/wchar_t/9.cc: Likewise.
+ * 22_locale/codecvt/in/char/1.cc: Likewise.
+ * 22_locale/codecvt/max_length/char/1.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/1.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/2.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/3.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/4.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/5.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/6.cc: Likewise.
+ * 22_locale/codecvt/out/wchar_t/7.cc: Likewise.
+ * 22_locale/codecvt/out/char/1.cc: Likewise.
+ * 22_locale/locale/cons/5.cc: Likewise.
+ * 22_locale/collate_byname/named_equivalence.cc: Likewise.
+
+2007-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * libstdc++-v3/libsupc++/cxxabi.h (_GLIBCXX_NOTHROW): New macro.
+ (__cxa_atexit): Use it.
+
+ * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): For
+ installed-tree testing, search more include directories.
+
+2007-05-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/type_traits (make_signed): Remove specializations
+ for floating point types.
+ (make_unsigned): Same.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Fix.
+ * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Same.
+ * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Same.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Same.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Same.
+
+2007-05-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: New.
+
+2007-05-08 Jason Merrill <jason@redhat.com>
+
+ * libsupc++/cxxabi-internal.h: Remove, to be replaced by...
+ * libsupc++/cxxabi-forced.h: ...this new file.
+ * include/ext/vstring.tcc: Include cxxabi-forced.h instead.
+ * include/bits/istream.tcc: Likewise.
+ * include/bits/ostream.tcc: Likewise.
+ * include/bits/basic_string.tcc: Likewise.
+ * include/bits/ostream_insert.h: Likewise.
+ * include/bits/fstream.tcc: Likewise.
+ * include/std/bitset: Likewise.
+ * libsupc++/cxxabi.h: Restore previous contents.
+ * Makefile.am (headers): Add cxxabi-forced.h.
+ * Makefile.in: Regenerate.
+
+2007-05-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/util/testsuite_abi.cc: Add CXXABI_1.3.2.
+
+ * libsupc++/cxxabi-internal.h (__foreign_exception::__pure): To
+ __pure_virtual.
+
+2007-05-07 Jason Merrill <jason@redhat.com>
+
+ * include/bits/ostream.tcc (operator<<(char*)): Add __s.
+
+ * config/abi/pre/gnu.ver: Fix symbol versions.
+ * config/abi/pre/gnu-versioned-namespace.ver: Likewise.
+
+2007-05-07 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/os/mingw32/os_defines.h (NOMINMAX): Update comment.
+
+2007-05-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/28145
+ * libsupc++/cxxabi.h (__forced_unwind, __foreign_exception):
+ New classes.
+ * libsupc++/eh_exception.cc: Define their destructors.
+ * config/abi/pre/gnu.ver: Export their type_infos.
+ * config/abi/pre/gnu-versioned-namespace.ver: Likewise.
+ * libsupc++/eh_personality.cc: A handler for abi::__forced_unwind
+ matches a forced unwind, and a handler for abi::__foreign_exception
+ matches a foreign exception.
+
+ * include/bits/istream.tcc: Rethrow forced unwind.
+ * include/bits/ostream.tcc: Likewise.
+ * include/bits/ostream_insert.h: Likewise.
+ * include/bits/basic_string.tcc (operator>>, getline): Likewise.
+ * include/bits/fstream.tcc (basic_filebuf::close): Likewise.
+ * include/ext/vstring.cc (operator>>, getline): Likewise.
+ * src/istream.cc: Likewise.
+ * src/compatibility.cc (basic_istream::ignore): Likewise.
+ * include/std/bitset (operator>>): Likewise.
+ * include/std/fstream (basic_filebuf::close): Remove throw() spec.
+ * libsupc++/cxxabi-internal.h: Split out from...
+ * libsupc++/cxxabi.h: ...here.
+
+2007-05-07 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_algobase.h: Do not include <cstring>.
+ (copy(const _Tp*, const _Tp*, _Tp*), __copy_b(const _Tp*, const _Tp*,
+ _Tp*)): Use __builtin_memmove.
+ (__fill_aux): Use __builtin_memset.
+ (equal(const _Tp*, const _Tp*, const _Tp*),
+ lexicographical_compare(const unsigned char*, const unsigned char*,
+ const unsigned char*, const unsigned char*)): Use __builtin_memcmp.
+ * include/bits/valarray_array.h: Do not include <cstring>.
+ (_Array_default_ctor<, true>::_S_do_it): Use __builtin_memset.
+ (_Array_copy_ctor<, true>::_S_do_it, _Array_copier<, true>::_S_do_it):
+ Use __builtin_memcpy.
+ * include/ext/algorithm
+ (__lexicographical_compare_3way(const unsigned char*,
+ const unsigned char*, const unsigned char*, const unsigned char*)):
+ Use __builtin_memcmp.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_1_neg.cc: Adjust dg-error line number.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+
+2007-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): For
+ installed-tree testing, search more include directories.
+
+ * testsuite/22_locale/num_put/put/char/14220.cc: XFAIL on Solaris
+ 2.10.
+ * testsuite/22_locale/num_put/put/wchar_t/14220.cc: Likewise.
+
+ * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): In
+ installed-tree testing, use "remote_exec host", not "remote_exec
+ exec". Trip trailing newlines from output of -dumpversion and
+ -dumpmachine.
+
+2007-05-07 Benjamin Kosnik <bkoz@redhat.com>
+ Howard Hinnant <hhinnant@apple.com>
+
+ * include/std/type_traits: (make_signed, make_unsigned): Adjust
+ for enum sizes.
+ * testsuite/20_util/make_unsigned/requirements/typedefs.cc: Move to...
+ * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: ...here.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Add,
+ compile with -funsigned-char -fshort-enums.
+ * testsuite/20_util/make_signed/requirements/typedefs.cc: Move to...
+ * testsuite/20_util/make_signed/requirements/typedefs-1.cc: ...here.
+ * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Add,
+ compile with -funsigned-char -fshort-enums.
+
+ * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc:
+ Add a temporary xfail to this test for all platforms.
+
+2007-05-06 Paolo Carlini <pcarlini@suse.de>
+
+ * include/std/complex: Add missing extern template declarations.
+ * testsuite/26_numerics/complex/complex_inserters_extractors.cc:
+ Move...
+ * testsuite/26_numerics/complex/inserters_extractors/char/1.cc:
+ ... here.
+ * testsuite/26_numerics/complex/inserters_extractors/wchar_t/1.cc:
+ New.
+
+2007-05-06 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/31834
+ * testsuite/17_intro/headers/c++200x/all.cc: Protect inclusion
+ of C99 headers.
+ * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc:
+ Likewise.
+
+2007-05-06 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/generic/c_locale.cc: Don't use __builtin_huge_val*
+ when __*_HAS_INFINITY__ is false.
+
+2007-05-04 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_raw_storage_iter.h (class raw_storage_iterator):
+ Adjust template parameter name.
+
+2007-05-04 Mark Mitchell <mark@codesourcery.com>
+
+ * libsupc++/cxxabi.h (__cxa_atexit): Conditionalize exception
+ specification on #ifdef __cplusplus.
+
+2007-05-04 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_memory.h: Rename to stl_auto_ptr.h.
+ (__get_temporary_buffer, get_temporary_buffer,
+ return_temporary_buffer): Move...
+ * include/bits/stl_tempbuf.h: ... here.
+ * include/std/memory: Adjust includes.
+ * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust dg-error line
+ numbers.
+ * include/Makefile.am: Adjust.
+ * include/Makefile.in: Regenerate.
+
+ * testsuite/util/testsuite_iterators.h: Do not include the entire
+ <iterator>.
+ * include/bits/stl_iterator_base_types.h: Adjust includes.
+ * testsuite/25_algorithms/unique_copy/2.cc: Include <functional>.
+
+2007-05-04 Mark Mitchell <mark@codesourcery.com>
+
+ * libsupc++/atexit_arm.cc: New file.
+ * libsupc++/vec.cc (__aeabi_atexit): Remove.
+ * libsupc++/cxxabi.h (__cxa_atexit): Add exception specification.
+
+ * libsupc++/Makefile.am: Add atexit_arm.cc.
+ * libsupc++/Makefile.in: Regenerated.
+
+2007-05-04 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_construct.h (_Destroy(_ForwardIterator,
+ _ForwardIterator __last, _Allocator)): Change the last parameter
+ to _Allocator&.
+ * include/bits/stl_uninitialized.h (__uninitialized_copy_a,
+ __uninitialized_fill_a, __uninitialized_fill_n_a,
+ __uninitialized_fill_copy, __uninitialized_copy_fill,
+ __uninitialized_copy_copy): Likewise.
+ * include/ext/rope: Adjust everywhere.
+ * include/ext/ropeimpl.h: Likewise.
+
2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
* include/std/type_traits (enable_if): New.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 18d1840ceb2..8198041203d 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -170,8 +170,8 @@ AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [
# Check for -ffunction-sections -fdata-sections
AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
- CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
- AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
+ CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections'
+ AC_TRY_COMPILE([int foo; void bar() { };],, [ac_fdsections=yes], [ac_fdsections=no])
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS="$ac_save_CXXFLAGS"
else
diff --git a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
index 3b9b475dcf1..4613f4e53d4 100644
--- a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
+++ b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
@@ -1,6 +1,6 @@
## Linker script for GNU namespace versioning.
##
-## Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+## Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
##
@@ -200,3 +200,11 @@ CXXABI_1.7 {
local:
*;
};
+
+CXXABI_1.7.1 {
+
+ # typeinfo structures
+ _ZTIN10__cxxabiv115__forced_unwindE;
+ _ZTIN10__cxxabiv119__foreign_exceptionE;
+
+} CXXABI_1.7;
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 1748f3addb5..92c85e5e9f3 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -821,3 +821,11 @@ CXXABI_1.3.1 {
__cxa_get_exception_ptr;
} CXXABI_1.3;
+
+CXXABI_1.3.2 {
+
+ # typeinfo structures
+ _ZTIN10__cxxabiv115__forced_unwindE;
+ _ZTIN10__cxxabiv119__foreign_exceptionE;
+
+} CXXABI_1.3.1;
diff --git a/libstdc++-v3/config/locale/darwin/ctype_members.cc b/libstdc++-v3/config/locale/darwin/ctype_members.cc
index b50bd35d67e..ebd83219af3 100644
--- a/libstdc++-v3/config/locale/darwin/ctype_members.cc
+++ b/libstdc++-v3/config/locale/darwin/ctype_members.cc
@@ -37,6 +37,7 @@
#include <locale>
#include <bits/c++locale_internal.h>
#include <cstdlib>
+#include <cstring>
namespace std
{
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index d1c66b6462d..732b60955f4 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -34,10 +34,13 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <cerrno> // For errno
#include <cmath> // For isinf, finite, finitef, fabs
#include <cstdlib> // For strof, strtold
+#include <cstring>
#include <locale>
#include <limits>
+#include <cstddef>
#ifdef _GLIBCXX_HAVE_IEEEFP_H
#include <ieeefp.h>
@@ -52,9 +55,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __c_locale&)
{
// Assumes __s formatted for "C" locale.
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __len = strlen(__old) + 1;
+ char* __sav = new char[__len];
+ memcpy(__sav, __old, __len);
setlocale(LC_ALL, "C");
char* __sanity;
+
+#if !__FLT_HAS_INFINITY__
+ errno = 0;
+#endif
+
#if defined(_GLIBCXX_HAVE_STRTOF)
float __f = strtof(__s, &__sanity);
#else
@@ -62,25 +73,31 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
float __f = static_cast<float>(__d);
#ifdef _GLIBCXX_HAVE_FINITEF
if (!finitef (__f))
- __f = __builtin_huge_valf();
+ __s = __sanity;
#elif defined (_GLIBCXX_HAVE_FINITE)
if (!finite (static_cast<double> (__f)))
- __f = __builtin_huge_valf();
+ __s = __sanity;
#elif defined (_GLIBCXX_HAVE_ISINF)
if (isinf (static_cast<double> (__f)))
- __f = __builtin_huge_valf();
+ __s = __sanity;
#else
if (fabs(__d) > numeric_limits<float>::max())
- __f = __builtin_huge_valf();
+ __s = __sanity;
#endif
#endif
- if (__sanity != __s && __f != __builtin_huge_valf()
- && __f != -__builtin_huge_valf())
+
+ if (__sanity != __s
+#if !__FLT_HAS_INFINITY__
+ && errno != ERANGE)
+#else
+ && __f != __builtin_huge_valf() && __f != -__builtin_huge_valf())
+#endif
__v = __f;
else
__err |= ios_base::failbit;
- setlocale(LC_ALL, __old);
- free(__old);
+
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
}
template<>
@@ -89,17 +106,31 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __c_locale&)
{
// Assumes __s formatted for "C" locale.
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __len = strlen(__old) + 1;
+ char* __sav = new char[__len];
+ memcpy(__sav, __old, __len);
setlocale(LC_ALL, "C");
char* __sanity;
+
+#if !__DBL_HAS_INFINITY__
+ errno = 0;
+#endif
+
double __d = strtod(__s, &__sanity);
- if (__sanity != __s && __d != __builtin_huge_val()
- && __d != -__builtin_huge_val())
+
+ if (__sanity != __s
+#if !__DBL_HAS_INFINITY__
+ && errno != ERANGE)
+#else
+ && __d != __builtin_huge_val() && __d != -__builtin_huge_val())
+#endif
__v = __d;
else
__err |= ios_base::failbit;
- setlocale(LC_ALL, __old);
- free(__old);
+
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
}
template<>
@@ -108,27 +139,47 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
ios_base::iostate& __err, const __c_locale&)
{
// Assumes __s formatted for "C" locale.
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __len = strlen(__old) + 1;
+ char* __sav = new char[__len];
+ memcpy(__sav, __old, __len);
setlocale(LC_ALL, "C");
+
+#if !__LDBL_HAS_INFINITY__
+ errno = 0;
+#endif
+
#if defined(_GLIBCXX_HAVE_STRTOLD)
char* __sanity;
long double __ld = strtold(__s, &__sanity);
- if (__sanity != __s && __ld != __builtin_huge_vall()
- && __ld != -__builtin_huge_vall())
+
+ if (__sanity != __s
+#if !__LDBL_HAS_INFINITY__
+ && errno != ERANGE)
+#else
+ && __ld != __builtin_huge_vall() && __ld != -__builtin_huge_vall())
+#endif
__v = __ld;
+
#else
typedef char_traits<char>::int_type int_type;
long double __ld;
int __p = sscanf(__s, "%Lf", &__ld);
+
if (__p && static_cast<int_type>(__p) != char_traits<char>::eof()
- && __ld != __builtin_huge_vall()
- && __ld != -__builtin_huge_vall())
+#if !__LDBL_HAS_INFINITY__
+ && errno != ERANGE)
+#else
+ && __ld != __builtin_huge_vall() && __ld != -__builtin_huge_vall())
+#endif
__v = __ld;
+
#endif
else
__err |= ios_base::failbit;
- setlocale(LC_ALL, __old);
- free(__old);
+
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
}
void
diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
index 1b7fc6ddb10..ac5ce772fad 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.h
+++ b/libstdc++-v3/config/locale/generic/c_locale.h
@@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -45,9 +45,8 @@
#pragma GCC system_header
#include <clocale>
-#include <cstring> // get std::strlen
-#include <cstdio> // get std::vsnprintf or std::vsprintf
#include <cstdarg>
+#include <cstddef>
#define _GLIBCXX_NUM_CATEGORIES 0
@@ -66,10 +65,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
char* __old = std::setlocale(LC_NUMERIC, NULL);
char* __sav = NULL;
- if (std::strcmp(__old, "C"))
+ if (__builtin_strcmp(__old, "C"))
{
- __sav = new char[std::strlen(__old) + 1];
- std::strcpy(__sav, __old);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
std::setlocale(LC_NUMERIC, "C");
}
@@ -77,9 +77,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
va_start(__args, __fmt);
#ifdef _GLIBCXX_USE_C99
- const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
#else
- const int __ret = std::vsprintf(__out, __fmt, __args);
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
#endif
va_end(__args);
diff --git a/libstdc++-v3/config/locale/generic/codecvt_members.cc b/libstdc++-v3/config/locale/generic/codecvt_members.cc
index 7b03b5b60ba..da4448d00e5 100644
--- a/libstdc++-v3/config/locale/generic/codecvt_members.cc
+++ b/libstdc++-v3/config/locale/generic/codecvt_members.cc
@@ -37,6 +37,7 @@
#include <locale>
#include <cstdlib> // For MB_CUR_MAX
#include <climits> // For MB_LEN_MAX
+#include <cstring>
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/config/locale/generic/collate_members.cc b/libstdc++-v3/config/locale/generic/collate_members.cc
index f614037a238..6f3115d3637 100644
--- a/libstdc++-v3/config/locale/generic/collate_members.cc
+++ b/libstdc++-v3/config/locale/generic/collate_members.cc
@@ -1,6 +1,7 @@
// std::collate implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -34,6 +35,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
+#include <cstring>
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/config/locale/generic/ctype_members.cc b/libstdc++-v3/config/locale/generic/ctype_members.cc
index 3c7209d65fb..ae1c7cf1d0f 100644
--- a/libstdc++-v3/config/locale/generic/ctype_members.cc
+++ b/libstdc++-v3/config/locale/generic/ctype_members.cc
@@ -36,6 +36,7 @@
#include <locale>
#include <cstdlib>
+#include <cstring>
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/config/locale/generic/messages_members.h b/libstdc++-v3/config/locale/generic/messages_members.h
index 40986886e8b..f82f2f2b646 100644
--- a/libstdc++-v3/config/locale/generic/messages_members.h
+++ b/libstdc++-v3/config/locale/generic/messages_members.h
@@ -1,6 +1,7 @@
// std::messages implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -83,7 +84,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
: messages<_CharT>(__refs)
{
- if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
{
this->_S_destroy_c_locale(this->_M_c_locale_messages);
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
diff --git a/libstdc++-v3/config/locale/generic/time_members.cc b/libstdc++-v3/config/locale/generic/time_members.cc
index b8ebb746b1b..08fd7a1be4f 100644
--- a/libstdc++-v3/config/locale/generic/time_members.cc
+++ b/libstdc++-v3/config/locale/generic/time_members.cc
@@ -37,6 +37,7 @@
#include <locale>
#include <cstdlib>
+#include <cstring>
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -46,11 +47,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_put(char* __s, size_t __maxlen, const char* __format,
const tm* __tm) const
{
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __llen = strlen(__old) + 1;
+ char* __sav = new char[__llen];
+ memcpy(__sav, __old, __llen);
setlocale(LC_ALL, _M_name_timepunct);
const size_t __len = strftime(__s, __maxlen, __format, __tm);
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
// Make sure __s is null terminated.
if (__len == 0)
__s[0] = '\0';
@@ -128,11 +132,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
const tm* __tm) const
{
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __llen = strlen(__old) + 1;
+ char* __sav = new char[__llen];
+ memcpy(__sav, __old, __llen);
setlocale(LC_ALL, _M_name_timepunct);
const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
// Make sure __s is null terminated.
if (__len == 0)
__s[0] = L'\0';
diff --git a/libstdc++-v3/config/locale/generic/time_members.h b/libstdc++-v3/config/locale/generic/time_members.h
index 8c868c01495..dc387691d9a 100644
--- a/libstdc++-v3/config/locale/generic/time_members.h
+++ b/libstdc++-v3/config/locale/generic/time_members.h
@@ -1,6 +1,7 @@
// std::time_get, std::time_put implementation, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -62,9 +63,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
size_t __refs)
: facet(__refs), _M_data(NULL)
{
- const size_t __len = std::strlen(__s) + 1;
+ const size_t __len = __builtin_strlen(__s) + 1;
char* __tmp = new char[__len];
- std::memcpy(__tmp, __s, __len);
+ __builtin_memcpy(__tmp, __s, __len);
_M_name_timepunct = __tmp;
try
diff --git a/libstdc++-v3/config/locale/gnu/c++locale_internal.h b/libstdc++-v3/config/locale/gnu/c++locale_internal.h
index cbce1690f46..80a1df92d9c 100644
--- a/libstdc++-v3/config/locale/gnu/c++locale_internal.h
+++ b/libstdc++-v3/config/locale/gnu/c++locale_internal.h
@@ -38,6 +38,8 @@
#include <bits/c++config.h>
#include <clocale>
#include <cstdlib>
+#include <cstring>
+#include <cstddef>
#include <langinfo.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
diff --git a/libstdc++-v3/config/locale/gnu/c_locale.h b/libstdc++-v3/config/locale/gnu/c_locale.h
index 7a71b013eee..fae7ffec59a 100644
--- a/libstdc++-v3/config/locale/gnu/c_locale.h
+++ b/libstdc++-v3/config/locale/gnu/c_locale.h
@@ -44,11 +44,9 @@
#pragma GCC system_header
-#include <cstring> // get std::strlen
-#include <cstdio> // get std::vsnprintf or std::vsprintf
#include <clocale>
-#include <libintl.h> // For messages
#include <cstdarg>
+#include <cstddef>
#define _GLIBCXX_C_LOCALE_GNU 1
@@ -80,8 +78,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__c_locale __old = __gnu_cxx::__uselocale(__cloc);
#else
char* __old = std::setlocale(LC_ALL, NULL);
- char* __sav = new char[std::strlen(__old) + 1];
- std::strcpy(__sav, __old);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
std::setlocale(LC_ALL, "C");
#endif
@@ -89,9 +88,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
va_start(__args, __fmt);
#ifdef _GLIBCXX_USE_C99
- const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
#else
- const int __ret = std::vsprintf(__out, __fmt, __args);
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
#endif
va_end(__args);
diff --git a/libstdc++-v3/config/locale/gnu/messages_members.cc b/libstdc++-v3/config/locale/gnu/messages_members.cc
index f206e44a636..cbecc56225b 100644
--- a/libstdc++-v3/config/locale/gnu/messages_members.cc
+++ b/libstdc++-v3/config/locale/gnu/messages_members.cc
@@ -49,11 +49,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__uselocale(__old);
return string(__msg);
#else
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __len = strlen(__old) + 1;
+ char* __sav = new char[__len];
+ memcpy(__sav, __old, __len);
setlocale(LC_ALL, _M_name_messages);
const char* __msg = gettext(__dfault.c_str());
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
return string(__msg);
#endif
}
@@ -69,11 +72,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__uselocale(__old);
return _M_convert_from_char(__msg);
# else
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __len = strlen(__old) + 1;
+ char* __sav = new char[__len];
+ memcpy(__sav, __old, __len);
setlocale(LC_ALL, _M_name_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
return _M_convert_from_char(__msg);
# endif
}
diff --git a/libstdc++-v3/config/locale/gnu/messages_members.h b/libstdc++-v3/config/locale/gnu/messages_members.h
index 31504e58bdc..bfe25333697 100644
--- a/libstdc++-v3/config/locale/gnu/messages_members.h
+++ b/libstdc++-v3/config/locale/gnu/messages_members.h
@@ -1,6 +1,7 @@
// std::messages implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -38,6 +39,8 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <libintl.h>
+
_GLIBCXX_BEGIN_NAMESPACE(std)
// Non-virtual member functions.
@@ -52,9 +55,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
size_t __refs)
: facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
{
- const size_t __len = std::strlen(__s) + 1;
+ const size_t __len = __builtin_strlen(__s) + 1;
char* __tmp = new char[__len];
- std::memcpy(__tmp, __s, __len);
+ __builtin_memcpy(__tmp, __s, __len);
_M_name_messages = __tmp;
// Last to avoid leaking memory if new throws.
@@ -102,11 +105,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
if (this->_M_name_messages != locale::facet::_S_get_c_name())
delete [] this->_M_name_messages;
- char* __tmp = new char[std::strlen(__s) + 1];
- std::strcpy(__tmp, __s);
+ const size_t __len = __builtin_strlen(__s) + 1;
+ char* __tmp = new char[__len];
+ __builtin_memcpy(__tmp, __s, __len);
this->_M_name_messages = __tmp;
- if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
{
this->_S_destroy_c_locale(this->_M_c_locale_messages);
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
diff --git a/libstdc++-v3/config/locale/gnu/monetary_members.cc b/libstdc++-v3/config/locale/gnu/monetary_members.cc
index b3cd05d8305..28683b5fae4 100644
--- a/libstdc++-v3/config/locale/gnu/monetary_members.cc
+++ b/libstdc++-v3/config/locale/gnu/monetary_members.cc
@@ -383,7 +383,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__c_locale __old = __uselocale(__cloc);
#else
// Switch to named locale so that mbsrtowcs will work.
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __llen = strlen(__old) + 1;
+ char* __sav = new char[__llen];
+ memcpy(__sav, __old, __llen);
setlocale(LC_ALL, __name);
#endif
@@ -448,7 +451,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_data->_M_curr_symbol = L"";
_M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
}
- catch (...)
+ catch(...)
{
delete _M_data;
_M_data = 0;
@@ -457,8 +460,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#else
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
#endif
__throw_exception_again;
}
@@ -478,8 +481,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#else
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
#endif
}
}
@@ -525,7 +528,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__c_locale __old = __uselocale(__cloc);
#else
// Switch to named locale so that mbsrtowcs will work.
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __llen = strlen(__old) + 1;
+ char* __sav = new char[__llen];
+ memcpy(__sav, __old, __llen);
setlocale(LC_ALL, __name);
#endif
@@ -591,7 +597,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_data->_M_curr_symbol = L"";
_M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
}
- catch (...)
+ catch(...)
{
delete _M_data;
_M_data = 0;
@@ -600,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#else
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
#endif
__throw_exception_again;
}
@@ -620,8 +626,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#else
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
#endif
}
}
diff --git a/libstdc++-v3/config/locale/gnu/time_members.cc b/libstdc++-v3/config/locale/gnu/time_members.cc
index 10faa8fe470..3c9a61fabaa 100644
--- a/libstdc++-v3/config/locale/gnu/time_members.cc
+++ b/libstdc++-v3/config/locale/gnu/time_members.cc
@@ -1,6 +1,7 @@
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -49,11 +50,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
_M_c_locale_timepunct);
#else
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __llen = strlen(__old) + 1;
+ char* __sav = new char[__llen];
+ memcpy(__sav, __old, __llen);
setlocale(LC_ALL, _M_name_timepunct);
const size_t __len = strftime(__s, __maxlen, __format, __tm);
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
#endif
// Make sure __s is null terminated.
if (__len == 0)
@@ -202,11 +206,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
_M_c_locale_timepunct);
#else
- char* __old = strdup(setlocale(LC_ALL, NULL));
+ char* __old = setlocale(LC_ALL, NULL);
+ const size_t __llen = strlen(__old) + 1;
+ char* __sav = new char[__llen];
+ memcpy(__sav, __old, __llen);
setlocale(LC_ALL, _M_name_timepunct);
const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
- setlocale(LC_ALL, __old);
- free(__old);
+ setlocale(LC_ALL, __sav);
+ delete [] __sav;
#endif
// Make sure __s is null terminated.
if (__len == 0)
diff --git a/libstdc++-v3/config/locale/gnu/time_members.h b/libstdc++-v3/config/locale/gnu/time_members.h
index b03aa57561d..7f97bcbbd7b 100644
--- a/libstdc++-v3/config/locale/gnu/time_members.h
+++ b/libstdc++-v3/config/locale/gnu/time_members.h
@@ -1,6 +1,7 @@
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -59,9 +60,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
_M_name_timepunct(NULL)
{
- const size_t __len = std::strlen(__s) + 1;
+ const size_t __len = __builtin_strlen(__s) + 1;
char* __tmp = new char[__len];
- std::memcpy(__tmp, __s, __len);
+ __builtin_memcpy(__tmp, __s, __len);
_M_name_timepunct = __tmp;
try
diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
index 0b895e2956e..779b26a0d49 100644
--- a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
+++ b/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
@@ -1,6 +1,7 @@
// Locale support -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -48,15 +49,18 @@
ctype<char>::classic_table() throw()
{
const ctype_base::mask* __ret;
- char* __old = strdup(setlocale(LC_CTYPE, NULL));
+ char* __old = setlocale(LC_CTYPE, NULL);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__ret = *__ctype_b_loc();
#else
__ret = __ctype_b;
#endif
- setlocale(LC_CTYPE, __old);
- free(__old);
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
return __ret;
}
#endif
@@ -71,8 +75,8 @@
_M_table(__table ? __table : _M_c_locale_ctype->__ctype_b),
_M_widen_ok(0), _M_narrow_ok(0)
{
- memset(_M_widen, 0, sizeof(_M_widen));
- memset(_M_narrow, 0, sizeof(_M_narrow));
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
}
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
@@ -80,7 +84,10 @@
: facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
_M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
{
- char* __old=strdup(setlocale(LC_CTYPE, NULL));
+ char* __old = setlocale(LC_CTYPE, NULL);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_M_toupper = *__ctype_toupper_loc();
@@ -91,10 +98,10 @@
_M_tolower = __ctype_tolower;
_M_table = __table ? __table : __ctype_b;
#endif
- setlocale(LC_CTYPE, __old);
- free(__old);
- memset(_M_widen, 0, sizeof(_M_widen));
- memset(_M_narrow, 0, sizeof(_M_narrow));
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
}
#endif
@@ -107,15 +114,18 @@
_M_table(__table ? __table : _M_c_locale_ctype->__ctype_b),
_M_widen_ok(0), _M_narrow_ok(0)
{
- memset(_M_widen, 0, sizeof(_M_widen));
- memset(_M_narrow, 0, sizeof(_M_narrow));
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
}
#else
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
_M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
{
- char* __old=strdup(setlocale(LC_CTYPE, NULL));
+ char* __old = setlocale(LC_CTYPE, NULL);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_M_toupper = *__ctype_toupper_loc();
@@ -126,10 +136,10 @@
_M_tolower = __ctype_tolower;
_M_table = __table ? __table : __ctype_b;
#endif
- setlocale(LC_CTYPE, __old);
- free(__old);
- memset(_M_widen, 0, sizeof(_M_widen));
- memset(_M_narrow, 0, sizeof(_M_narrow));
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
}
#endif
diff --git a/libstdc++-v3/config/os/mingw32/os_defines.h b/libstdc++-v3/config/os/mingw32/os_defines.h
index 6f041b35821..3ac8fff5252 100644
--- a/libstdc++-v3/config/os/mingw32/os_defines.h
+++ b/libstdc++-v3/config/os/mingw32/os_defines.h
@@ -45,7 +45,7 @@
#endif
// Don't let win32api windef.h define min and max as macros
-// if included after stl_algobase.h.
+// if included after c++config.h.
#undef NOMINMAX
#define NOMINMAX 1
diff --git a/libstdc++-v3/config/os/tpf/ctype_noninline.h b/libstdc++-v3/config/os/tpf/ctype_noninline.h
index 3a42ba085c6..e2136742456 100644
--- a/libstdc++-v3/config/os/tpf/ctype_noninline.h
+++ b/libstdc++-v3/config/os/tpf/ctype_noninline.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007 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
@@ -42,11 +42,14 @@
ctype<char>::classic_table() throw()
{
const ctype_base::mask* __ret;
- char* __old = strdup(setlocale(LC_CTYPE, NULL));
+ char* __old = setlocale(LC_CTYPE, NULL);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
setlocale(LC_CTYPE, "C");
__ret = *__ctype_b_loc();
- setlocale(LC_CTYPE, __old);
- free(__old);
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
return __ret;
}
@@ -54,26 +57,32 @@
size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del)
{
- char* __old=strdup(setlocale(LC_CTYPE, NULL));
+ char* __old = setlocale(LC_CTYPE, NULL);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
setlocale(LC_CTYPE, "C");
_M_toupper = *__ctype_toupper_loc();
_M_tolower = *__ctype_tolower_loc();
_M_table = __table ? __table : *__ctype_b_loc();
- setlocale(LC_CTYPE, __old);
- free(__old);
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
_M_c_locale_ctype = _S_get_c_locale();
}
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del)
{
- char* __old=strdup(setlocale(LC_CTYPE, NULL));
+ char* __old = setlocale(LC_CTYPE, NULL);
+ const size_t __len = __builtin_strlen(__old) + 1;
+ char* __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
setlocale(LC_CTYPE, "C");
_M_toupper = *__ctype_toupper_loc();
_M_tolower = *__ctype_tolower_loc();
_M_table = __table ? __table : *__ctype_b_loc();
- setlocale(LC_CTYPE, __old);
- free(__old);
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
_M_c_locale_ctype = _S_get_c_locale();
}
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 6ca6b63d861..a9f61693c45 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -8272,18 +8272,18 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# Check for -ffunction-sections -fdata-sections
echo "$as_me:$LINENO: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
echo $ECHO_N "checking for g++ that supports -ffunction-sections -fdata-sections... $ECHO_C" >&6
- CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
+ CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections'
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
+int foo; void bar() { };
int
main ()
{
-int foo;
+
;
return 0;
}
@@ -56567,18 +56567,18 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# Check for -ffunction-sections -fdata-sections
echo "$as_me:$LINENO: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
echo $ECHO_N "checking for g++ that supports -ffunction-sections -fdata-sections... $ECHO_C" >&6
- CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
+ CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections'
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
+int foo; void bar() { };
int
main ()
{
-int foo;
+
;
return 0;
}
diff --git a/libstdc++-v3/docs/html/abi.html b/libstdc++-v3/docs/html/abi.html
index dcbd4388491..59828e5dd0b 100644
--- a/libstdc++-v3/docs/html/abi.html
+++ b/libstdc++-v3/docs/html/abi.html
@@ -168,8 +168,8 @@ on ELF systems).</p>
<li>gcc-3.3.1: libgcc_s.so.1</li>
<li>gcc-3.3.2: libgcc_s.so.1</li>
<li>gcc-3.3.3: libgcc_s.so.1</li>
- <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x: on m68k-linux and hppa-linux
- this is either libgcc_s.so.1 (when configuring
+ <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x, gcc-4.2.x: on m68k-linux and
+ hppa-linux this is either libgcc_s.so.1 (when configuring
<code>--with-sjlj-exceptions</code>) or libgcc_s.so.2. For all
others, this is libgcc_s.so.1. </li> </ul>
<p></p>
@@ -194,6 +194,7 @@ on ELF systems).</p>
<li>gcc-3.4.4: GCC_3.4.4</li>
<li>gcc-4.0.0: GCC_4.0.0</li>
<li>gcc-4.1.0: GCC_4.1.0</li>
+ <li>gcc-4.2.0: GCC_4.2.0</li>
</ul>
<p></p>
</li>
@@ -231,6 +232,8 @@ on ELF systems).</p>
<li>gcc-4.0.3: libstdc++.so.6.0.7</li>
<li>gcc-4.1.0: libstdc++.so.6.0.7</li>
<li>gcc-4.1.1: libstdc++.so.6.0.8</li>
+ <li>gcc-4.1.2: libstdc++.so.6.0.8</li>
+ <li>gcc-4.2.0: libstdc++.so.6.0.9</li>
</ul>
<p></p>
</li>
@@ -274,6 +277,7 @@ on ELF systems).</p>
<li>gcc-4.0.2: GLIBCXX_3.4.6</li>
<li>gcc-4.0.3: GLIBCXX_3.4.7</li>
<li>gcc-4.1.1: GLIBCXX_3.4.8</li>
+ <li>gcc-4.2.0: GLIBCXX_3.4.9</li>
</ul>
<p></p>
</li>
@@ -301,9 +305,9 @@ on ELF systems).</p>
<li>gcc-3.1.x: 100 (Error, should be 101)</li>
<li>gcc-3.2.x: 102</li>
<li>gcc-3.3.x: 102</li>
- <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x: 102 (when n=1)</li>
- <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x: 1000 + n (when n&gt;1)</li>
- <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x: 999999 (when n=0)</li>
+ <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x, gcc-4.2.x: 102 (when n=1)</li>
+ <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x, gcc-4.2.x: 1000 + n (when n&gt;1)</li>
+ <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x, gcc-4.2.x: 999999 (when n=0)</li>
</ul>
<p></p>
</li>
@@ -320,7 +324,7 @@ on ELF systems).</p>
<li>gcc-3.1.x: (Error, not versioned) </li>
<li>gcc-3.2.x: <code>-fabi-version=1</code></li>
<li>gcc-3.3.x: <code>-fabi-version=1</code></li>
- <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x: <code>-fabi-version=2</code></li>
+ <li>gcc-3.4.x, gcc-4.0.x, gcc-4.1.x, gcc-4.2.x: <code>-fabi-version=2</code></li>
</ul>
<p></p>
</li>
@@ -372,6 +376,8 @@ on ELF systems).</p>
<li>gcc-4.0.3: 20060309</li>
<li>gcc-4.1.0: 20060228</li>
<li>gcc-4.1.1: 20060524</li>
+ <li>gcc-4.1.2: 20070214</li>
+ <li>gcc-4.2.0: 20070514</li>
</ul>
<p></p>
</li>
@@ -414,6 +420,7 @@ on ELF systems).</p>
<li>gcc-3.4.x: "version-unused"</li>
<li>gcc-4.0.x: "version-unused"</li>
<li>gcc-4.1.x: "version-unused"</li>
+ <li>gcc-4.2.x: "version-unused"</li>
</ul>
<p></p>
</li>
@@ -463,6 +470,8 @@ on ELF systems).</p>
<li>gcc-4.0.3: include/c++/4.0.3</li>
<li>gcc-4.1.0: include/c++/4.1.0</li>
<li>gcc-4.1.1: include/c++/4.1.1</li>
+ <li>gcc-4.1.2: include/c++/4.1.2</li>
+ <li>gcc-4.2.0: include/c++/4.2.0</li>
</ul>
<p></p>
</li>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index ea27464432e..cfa995e4000 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -115,7 +115,7 @@ bits_headers = \
${bits_srcdir}/stl_iterator_base_types.h \
${bits_srcdir}/stl_list.h \
${bits_srcdir}/stl_map.h \
- ${bits_srcdir}/stl_memory.h \
+ ${bits_srcdir}/stl_auto_ptr.h \
${bits_srcdir}/stl_multimap.h \
${bits_srcdir}/stl_multiset.h \
${bits_srcdir}/stl_numeric.h \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 4402d84c67f..c14ac8bbe23 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -349,7 +349,7 @@ bits_headers = \
${bits_srcdir}/stl_iterator_base_types.h \
${bits_srcdir}/stl_list.h \
${bits_srcdir}/stl_map.h \
- ${bits_srcdir}/stl_memory.h \
+ ${bits_srcdir}/stl_auto_ptr.h \
${bits_srcdir}/stl_multimap.h \
${bits_srcdir}/stl_multiset.h \
${bits_srcdir}/stl_numeric.h \
diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h
index 94f43ce23f3..e233430e54f 100644
--- a/libstdc++-v3/include/bits/allocator.h
+++ b/libstdc++-v3/include/bits/allocator.h
@@ -52,8 +52,6 @@
// Define the base class to std::allocator.
#include <bits/c++allocator.h>
-#include <bits/cpp_type_traits.h> // for __is_empty
-
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _Tp>
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 7483371cfdb..062b02b5982 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -46,6 +46,8 @@
#pragma GCC system_header
+#include <cxxabi-forced.h>
+
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits, typename _Alloc>
@@ -1015,6 +1017,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= __ios_base::eofbit;
__in.width(0);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -1074,6 +1081,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= __ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index 03d744c643a..a4b4e3a0d64 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -43,7 +43,6 @@
#pragma GCC system_header
-#include <cstring> // For memmove, memset, memchr
#include <bits/stl_algobase.h> // For copy, fill_n
#include <bits/postypes.h> // For streampos
#include <cstdio> // For EOF
@@ -186,8 +185,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
char_traits<_CharT>::
move(char_type* __s1, const char_type* __s2, std::size_t __n)
{
- return static_cast<_CharT*>(std::memmove(__s1, __s2,
- __n * sizeof(char_type)));
+ return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+ __n * sizeof(char_type)));
}
template<typename _CharT>
@@ -254,27 +253,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
- { return memcmp(__s1, __s2, __n); }
+ { return __builtin_memcmp(__s1, __s2, __n); }
static size_t
length(const char_type* __s)
- { return strlen(__s); }
+ { return __builtin_strlen(__s); }
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
- { return static_cast<const char_type*>(memchr(__s, __a, __n)); }
+ { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
- { return static_cast<char_type*>(memmove(__s1, __s2, __n)); }
+ { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
- { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
+ { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
- { return static_cast<char_type*>(memset(__s, __a, __n)); }
+ { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
static char_type
to_char_type(const int_type& __c)
diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h
index 930c798331a..d8d33070ff7 100644
--- a/libstdc++-v3/include/bits/codecvt.h
+++ b/libstdc++-v3/include/bits/codecvt.h
@@ -457,7 +457,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
codecvt_byname(const char* __s, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__refs)
{
- if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
{
this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index 54e75dba8ed..28dde161490 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -1,6 +1,7 @@
// File based streams -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+// 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -42,6 +43,8 @@
#pragma GCC system_header
+#include <cxxabi-forced.h>
+
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>
@@ -127,36 +130,51 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
- close() throw()
+ close()
{
- __filebuf_type* __ret = NULL;
- if (this->is_open())
+ if (!this->is_open())
+ return NULL;
+
+ bool __testfail = false;
+ {
+ // NB: Do this here so that re-opened filebufs will be cool...
+ struct __close_sentry
{
- bool __testfail = false;
- try
- {
- if (!_M_terminate_output())
- __testfail = true;
- }
- catch(...)
- { __testfail = true; }
-
- // NB: Do this here so that re-opened filebufs will be cool...
- _M_mode = ios_base::openmode(0);
- _M_pback_init = false;
- _M_destroy_internal_buffer();
- _M_reading = false;
- _M_writing = false;
- _M_set_buffer(-1);
- _M_state_last = _M_state_cur = _M_state_beg;
-
- if (!_M_file.close())
- __testfail = true;
-
- if (!__testfail)
- __ret = this;
- }
- return __ret;
+ basic_filebuf *__fb;
+ __close_sentry (basic_filebuf *__fbi): __fb(__fbi) { }
+ ~__close_sentry ()
+ {
+ __fb->_M_mode = ios_base::openmode(0);
+ __fb->_M_pback_init = false;
+ __fb->_M_destroy_internal_buffer();
+ __fb->_M_reading = false;
+ __fb->_M_writing = false;
+ __fb->_M_set_buffer(-1);
+ __fb->_M_state_last = __fb->_M_state_cur = __fb->_M_state_beg;
+ }
+ } __cs (this);
+
+ try
+ {
+ if (!_M_terminate_output())
+ __testfail = true;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ _M_file.close();
+ __throw_exception_again;
+ }
+ catch(...)
+ { __testfail = true; }
+ }
+
+ if (!_M_file.close())
+ __testfail = true;
+
+ if (__testfail)
+ return NULL;
+ else
+ return this;
}
template<typename _CharT, typename _Traits>
@@ -245,14 +263,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
char* __buf = new char[__blen];
if (__remainder)
- std::memcpy(__buf, _M_ext_next, __remainder);
+ __builtin_memcpy(__buf, _M_ext_next, __remainder);
delete [] _M_ext_buf;
_M_ext_buf = __buf;
_M_ext_buf_size = __blen;
}
else if (__remainder)
- std::memmove(_M_ext_buf, _M_ext_next, __remainder);
+ __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
_M_ext_next = _M_ext_buf;
_M_ext_end = _M_ext_buf + __remainder;
@@ -870,7 +888,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
this->gptr() - this->eback());
const streamsize __remainder = _M_ext_end - _M_ext_next;
if (__remainder)
- std::memmove(_M_ext_buf, _M_ext_next, __remainder);
+ __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
_M_ext_next = _M_ext_buf;
_M_ext_end = _M_ext_buf + __remainder;
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index 4588b9c858a..2e65b4847b9 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -43,6 +43,8 @@
#pragma GCC system_header
+#include <cxxabi-forced.h>
+
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>
@@ -98,6 +100,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __v);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -163,6 +170,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (__ineof)
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::failbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::failbit); }
}
@@ -194,6 +206,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -226,6 +243,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -264,6 +286,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__c, __eof))
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -307,6 +334,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__c, __eof))
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -355,6 +387,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= ios_base::failbit;
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -392,6 +429,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
_M_gcount = 1;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -449,6 +491,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__c, __eof))
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -509,6 +556,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__sb->sbumpc();
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -534,6 +586,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__c, traits_type::eof()))
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -558,6 +615,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (_M_gcount != __n)
__err |= (ios_base::eofbit | ios_base::failbit);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -585,6 +647,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else if (__num == -1)
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -613,6 +680,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|| traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
__err |= ios_base::badbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -641,6 +713,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|| traits_type::eq_int_type(__sb->sungetc(), __eof))
__err |= ios_base::badbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -672,6 +749,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__ret = 0;
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -694,6 +776,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
ios_base::in);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
return __ret;
@@ -720,6 +807,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= ios_base::failbit;
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -748,6 +840,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= ios_base::failbit;
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -775,6 +872,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= (ios_base::eofbit | ios_base::failbit);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ __in._M_setstate(ios_base::badbit); }
if (__err)
@@ -828,6 +930,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*__s = char_type();
__in.width(0);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ __in._M_setstate(ios_base::badbit); }
}
diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h
index 141f44cc147..60de2695677 100644
--- a/libstdc++-v3/include/bits/locale_classes.h
+++ b/libstdc++-v3/include/bits/locale_classes.h
@@ -44,7 +44,6 @@
#pragma GCC system_header
#include <bits/localefwd.h>
-#include <cstring> // For strcmp.
#include <string>
#include <ext/atomicity.h>
@@ -409,7 +408,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
try
{ delete this; }
- catch (...)
+ catch(...)
{ }
}
}
@@ -537,7 +536,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (_M_names[1])
// We must actually compare all the _M_names: can be all equal!
for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
- __ret = std::strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+ __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
return __ret;
}
@@ -810,7 +809,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
collate_byname(const char* __s, size_t __refs = 0)
: collate<_CharT>(__refs)
{
- if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
{
this->_S_destroy_c_locale(this->_M_c_locale_collate);
this->_S_create_c_locale(this->_M_c_locale_collate, __s);
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 42865a69c37..7a89927fadd 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -899,7 +899,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
if (_M_widen_ok == 1)
{
- memcpy(__to, __lo, __hi - __lo);
+ __builtin_memcpy(__to, __lo, __hi - __lo);
return __hi;
}
if (!_M_widen_ok)
@@ -964,7 +964,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
if (__builtin_expect(_M_narrow_ok == 1, true))
{
- memcpy(__to, __lo, __hi - __lo);
+ __builtin_memcpy(__to, __lo, __hi - __lo);
return __hi;
}
if (!_M_narrow_ok)
@@ -1101,7 +1101,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const
{
- memcpy(__dest, __lo, __hi - __lo);
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
@@ -1154,7 +1154,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
do_narrow(const char_type* __lo, const char_type* __hi,
char, char* __dest) const
{
- memcpy(__dest, __lo, __hi - __lo);
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
@@ -1169,7 +1169,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_widen_ok = 1;
// Set _M_widen_ok to 2 if memcpy can't be used.
- if (memcmp(__tmp, _M_widen, sizeof(_M_widen)))
+ if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
_M_widen_ok = 2;
}
@@ -1184,7 +1184,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
_M_narrow_ok = 1;
- if (memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
+ if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
_M_narrow_ok = 2;
else
{
@@ -1922,7 +1922,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
numpunct_byname(const char* __s, size_t __refs = 0)
: numpunct<_CharT>(__refs)
{
- if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
{
__c_locale __tmp;
this->_S_create_c_locale(__tmp, __s);
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 481362af15f..1b714adf8fe 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -1200,7 +1200,7 @@ _GLIBCXX_END_LDBL_NAMESPACE
// Padding last.
if (__adjust == ios_base::left)
{
- _Traits::copy(__news, const_cast<_CharT*>(__olds), __oldlen);
+ _Traits::copy(__news, __olds, __oldlen);
_Traits::assign(__news + __oldlen, __plen, __fill);
return;
}
@@ -1214,30 +1214,27 @@ _GLIBCXX_END_LDBL_NAMESPACE
const locale& __loc = __io._M_getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
- const bool __testsign = (__ctype.widen('-') == __olds[0]
- || __ctype.widen('+') == __olds[0]);
- const bool __testhex = (__ctype.widen('0') == __olds[0]
- && __oldlen > 1
- && (__ctype.widen('x') == __olds[1]
- || __ctype.widen('X') == __olds[1]));
- if (__testhex)
+ if (__ctype.widen('-') == __olds[0]
+ || __ctype.widen('+') == __olds[0])
{
__news[0] = __olds[0];
- __news[1] = __olds[1];
- __mod = 2;
- __news += 2;
+ __mod = 1;
+ ++__news;
}
- else if (__testsign)
+ else if (__ctype.widen('0') == __olds[0]
+ && __oldlen > 1
+ && (__ctype.widen('x') == __olds[1]
+ || __ctype.widen('X') == __olds[1]))
{
__news[0] = __olds[0];
- __mod = 1;
- ++__news;
+ __news[1] = __olds[1];
+ __mod = 2;
+ __news += 2;
}
// else Padding first.
}
_Traits::assign(__news, __plen, __fill);
- _Traits::copy(__news + __plen, const_cast<_CharT*>(__olds + __mod),
- __oldlen - __mod);
+ _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
}
bool
diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.h b/libstdc++-v3/include/bits/locale_facets_nonio.h
index 15de0834fbe..31c90e3b43c 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.h
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.h
@@ -1320,7 +1320,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
moneypunct_byname(const char* __s, size_t __refs = 0)
: moneypunct<_CharT, _Intl>(__refs)
{
- if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
{
__c_locale __tmp;
this->_S_create_c_locale(__tmp, __s);
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc
index 8ef9d89025b..06facc0360b 100644
--- a/libstdc++-v3/include/bits/ostream.tcc
+++ b/libstdc++-v3/include/bits/ostream.tcc
@@ -43,6 +43,8 @@
#pragma GCC system_header
+#include <cxxabi-forced.h>
+
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>
@@ -76,6 +78,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (__np.put(*this, *this, this->fill(), __v).failed())
__err |= ios_base::badbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -126,6 +133,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (!__copy_streambufs(__sbin, this->rdbuf()))
__err |= ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::failbit); }
}
@@ -157,7 +169,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__put, traits_type::eof()))
__err |= ios_base::badbit;
}
- catch (...)
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
this->setstate(__err);
@@ -182,7 +199,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
try
{ _M_write(__s, __n); }
- catch (...)
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
return *this;
@@ -202,6 +224,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
__err |= ios_base::badbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -220,6 +247,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (!this->fail())
__ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
return __ret;
@@ -245,6 +277,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= ios_base::failbit;
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -272,6 +309,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= ios_base::failbit;
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -289,31 +331,29 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 167. Improper use of traits_type::length()
- const size_t __clen = char_traits<char>::length(__s);
- _CharT* __ws = 0;
+ const size_t __clen = char_traits<char>::length(__s);
try
- {
- __ws = new _CharT[__clen];
- for (size_t __i = 0; __i < __clen; ++__i)
- __ws[__i] = __out.widen(__s[__i]);
- }
- catch(...)
{
- delete [] __ws;
- __out._M_setstate(ios_base::badbit);
- return __out;
- }
+ struct __ptr_guard
+ {
+ _CharT *__p;
+ __ptr_guard (_CharT *__ip): __p(__ip) { }
+ ~__ptr_guard() { delete[] __p; }
+ _CharT* __get() { return __p; }
+ } __pg (new _CharT[__clen]);
- try
- {
+ _CharT *__ws = __pg.__get();
+ for (size_t __i = 0; __i < __clen; ++__i)
+ __ws[__i] = __out.widen(__s[__i]);
__ostream_insert(__out, __ws, __clen);
- delete [] __ws;
}
- catch(...)
+ catch(__cxxabiv1::__forced_unwind&)
{
- delete [] __ws;
+ __out._M_setstate(ios_base::badbit);
__throw_exception_again;
}
+ catch(...)
+ { __out._M_setstate(ios_base::badbit); }
}
return __out;
}
diff --git a/libstdc++-v3/include/bits/ostream_insert.h b/libstdc++-v3/include/bits/ostream_insert.h
index e9e83fbc51f..5f63263c297 100644
--- a/libstdc++-v3/include/bits/ostream_insert.h
+++ b/libstdc++-v3/include/bits/ostream_insert.h
@@ -38,6 +38,7 @@
#pragma GCC system_header
#include <iosfwd>
+#include <cxxabi-forced.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -103,6 +104,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__ostream_write(__out, __s, __n);
__out.width(0);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ __out._M_setstate(__ios_base::badbit); }
}
diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h
index 40570d988e7..8fc8cf986bb 100644
--- a/libstdc++-v3/include/bits/postypes.h
+++ b/libstdc++-v3/include/bits/postypes.h
@@ -1,6 +1,7 @@
// Position types -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -77,9 +78,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/// Integral type for I/O operation counts and buffer sizes.
typedef ptrdiff_t streamsize; // Signed integral type
- template<typename _StateT>
- class fpos;
-
/**
* @brief Class representing stream positions.
*
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 0621261e827..1d743ab94b4 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -450,6 +450,72 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
/**
+ * @brief Finds the places in ranges which don't match.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using @c == and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ while (__first1 != __last1 && *__first1 == *__first2)
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link s20_3_1_base functor@endlink.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _BinaryPredicate>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+ /**
* @brief Search a sequence for a matching sub-sequence.
* @param first1 A forward iterator.
* @param last1 A forward iterator.
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 6be1eb123e1..f9f58373aff 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -63,7 +63,6 @@
#define _ALGOBASE_H 1
#include <bits/c++config.h>
-#include <cstring>
#include <cstddef>
#include <bits/functexcept.h>
#include <bits/stl_pair.h>
@@ -348,7 +347,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static _Tp*
copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
- std::memmove(__result, __first, sizeof(_Tp) * (__last - __first));
+ __builtin_memmove(__result, __first,
+ sizeof(_Tp) * (__last - __first));
return __result + (__last - __first);
}
};
@@ -464,7 +464,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__copy_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
const ptrdiff_t _Num = __last - __first;
- std::memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
+ __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
return __result - _Num;
}
};
@@ -560,15 +560,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Specialization: for char types we can use memset.
inline void
__fill_aux(unsigned char* __first, unsigned char* __last, unsigned char __c)
- { std::memset(__first, __c, __last - __first); }
+ { __builtin_memset(__first, __c, __last - __first); }
inline void
__fill_aux(signed char* __first, signed char* __last, signed char __c)
- { std::memset(__first, static_cast<unsigned char>(__c), __last - __first); }
+ { __builtin_memset(__first, static_cast<unsigned char>(__c),
+ __last - __first); }
inline void
__fill_aux(char* __first, char* __last, char __c)
- { std::memset(__first, static_cast<unsigned char>(__c), __last - __first); }
+ { __builtin_memset(__first, static_cast<unsigned char>(__c),
+ __last - __first); }
/**
* @brief Fills the range [first,last) with copies of value.
@@ -676,72 +678,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__value));
}
- /**
- * @brief Finds the places in ranges which don't match.
- * @param first1 An input iterator.
- * @param last1 An input iterator.
- * @param first2 An input iterator.
- * @return A pair of iterators pointing to the first mismatch.
- *
- * This compares the elements of two ranges using @c == and returns a pair
- * of iterators. The first iterator points into the first range, the
- * second iterator points into the second range, and the elements pointed
- * to by the iterators are not equal.
- */
- template<typename _InputIterator1, typename _InputIterator2>
- pair<_InputIterator1, _InputIterator2>
- mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2)
- {
- // concept requirements
- __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
- __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
- __glibcxx_function_requires(_EqualOpConcept<
- typename iterator_traits<_InputIterator1>::value_type,
- typename iterator_traits<_InputIterator2>::value_type>)
- __glibcxx_requires_valid_range(__first1, __last1);
-
- while (__first1 != __last1 && *__first1 == *__first2)
- {
- ++__first1;
- ++__first2;
- }
- return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
- }
-
- /**
- * @brief Finds the places in ranges which don't match.
- * @param first1 An input iterator.
- * @param last1 An input iterator.
- * @param first2 An input iterator.
- * @param binary_pred A binary predicate @link s20_3_1_base functor@endlink.
- * @return A pair of iterators pointing to the first mismatch.
- *
- * This compares the elements of two ranges using the binary_pred
- * parameter, and returns a pair
- * of iterators. The first iterator points into the first range, the
- * second iterator points into the second range, and the elements pointed
- * to by the iterators are not equal.
- */
- template<typename _InputIterator1, typename _InputIterator2,
- typename _BinaryPredicate>
- pair<_InputIterator1, _InputIterator2>
- mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _BinaryPredicate __binary_pred)
- {
- // concept requirements
- __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
- __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
- __glibcxx_requires_valid_range(__first1, __last1);
-
- while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
- {
- ++__first1;
- ++__first2;
- }
- return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
- }
-
template<bool _BoolType>
struct __equal
@@ -764,8 +700,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static bool
equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
{
- return !std::memcmp(__first1, __first2, sizeof(_Tp)
- * (__last1 - __first1));
+ return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
+ * (__last1 - __first1));
}
};
@@ -931,8 +867,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const size_t __len1 = __last1 - __first1;
const size_t __len2 = __last2 - __first2;
- const int __result = std::memcmp(__first1, __first2,
- std::min(__len1, __len2));
+ const int __result = __builtin_memcmp(__first1, __first2,
+ std::min(__len1, __len2));
return __result != 0 ? __result < 0 : __len1 < __len2;
}
diff --git a/libstdc++-v3/include/bits/stl_memory.h b/libstdc++-v3/include/bits/stl_auto_ptr.h
index 7dbd32324e4..6e0f9c7e2ae 100644
--- a/libstdc++-v3/include/bits/stl_memory.h
+++ b/libstdc++-v3/include/bits/stl_auto_ptr.h
@@ -1,4 +1,4 @@
-// Memory implementation -*- C++ -*-
+// auto_ptr implementation -*- C++ -*-
// Copyright (C) 2007 Free Software Foundation, Inc.
//
@@ -27,86 +27,20 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-/** @file stl_memory.h
+/** @file stl_auto_ptr.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
-#ifndef _STL_MEMORY_H
-#define _STL_MEMORY_H 1
+#ifndef _STL_AUTO_PTR_H
+#define _STL_AUTO_PTR_H 1
-#include <bits/stl_algobase.h>
-#include <bits/allocator.h>
-#include <bits/stl_construct.h>
-#include <bits/stl_uninitialized.h>
-#include <bits/stl_raw_storage_iter.h>
+#include <bits/c++config.h>
#include <debug/debug.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
/**
- * @if maint
- * This is a helper function. The unused second parameter exists to
- * permit the real get_temporary_buffer to use template parameter deduction.
- *
- * XXX This should perhaps use the pool.
- * @endif
- */
- template<typename _Tp>
- pair<_Tp*, ptrdiff_t>
- __get_temporary_buffer(ptrdiff_t __len, _Tp*)
- {
- const ptrdiff_t __max =
- __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
- if (__len > __max)
- __len = __max;
-
- while (__len > 0)
- {
- _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
- nothrow));
- if (__tmp != 0)
- return pair<_Tp*, ptrdiff_t>(__tmp, __len);
- __len /= 2;
- }
- return pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
- }
-
- /**
- * @brief Allocates a temporary buffer.
- * @param len The number of objects of type Tp.
- * @return See full description.
- *
- * Reinventing the wheel, but this time with prettier spokes!
- *
- * This function tries to obtain storage for @c len adjacent Tp
- * objects. The objects themselves are not constructed, of course.
- * A pair<> is returned containing "the buffer s address and
- * capacity (in the units of sizeof(Tp)), or a pair of 0 values if
- * no storage can be obtained." Note that the capacity obtained
- * may be less than that requested if the memory is unavailable;
- * you should compare len with the .second return value.
- *
- * Provides the nothrow exception guarantee.
- */
- template<typename _Tp>
- inline pair<_Tp*, ptrdiff_t>
- get_temporary_buffer(ptrdiff_t __len)
- { return std::__get_temporary_buffer(__len, static_cast<_Tp*>(0)); }
-
- /**
- * @brief The companion to get_temporary_buffer().
- * @param p A buffer previously allocated by get_temporary_buffer.
- * @return None.
- *
- * Frees the memory pointed to by p.
- */
- template<typename _Tp>
- void
- return_temporary_buffer(_Tp* __p)
- { ::operator delete(__p, nothrow); }
-
- /**
* A wrapper class to provide auto_ptr with reference semantics.
* For example, an auto_ptr can be assigned (or constructed from)
* the result of a function which returns an auto_ptr by value.
@@ -364,4 +298,4 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
-#endif /* _STL_MEMORY_H */
+#endif /* _STL_AUTO_PTR_H */
diff --git a/libstdc++-v3/include/bits/stl_construct.h b/libstdc++-v3/include/bits/stl_construct.h
index d80ade782f0..188efa92781 100644
--- a/libstdc++-v3/include/bits/stl_construct.h
+++ b/libstdc++-v3/include/bits/stl_construct.h
@@ -137,7 +137,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _ForwardIterator, typename _Allocator>
void
_Destroy(_ForwardIterator __first, _ForwardIterator __last,
- _Allocator __alloc)
+ _Allocator& __alloc)
{
for (; __first != __last; ++__first)
__alloc.destroy(&*__first);
@@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _ForwardIterator, typename _Tp>
inline void
_Destroy(_ForwardIterator __first, _ForwardIterator __last,
- allocator<_Tp>)
+ allocator<_Tp>&)
{
_Destroy(__first, __last);
}
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h
index c02cd261d8d..1b746692eeb 100644
--- a/libstdc++-v3/include/bits/stl_iterator_base_types.h
+++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h
@@ -1,6 +1,7 @@
// Types used in iterator implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -66,6 +67,9 @@
#pragma GCC system_header
+#include <bits/c++config.h>
+#include <cstddef>
+
_GLIBCXX_BEGIN_NAMESPACE(std)
//@{
diff --git a/libstdc++-v3/include/bits/stl_raw_storage_iter.h b/libstdc++-v3/include/bits/stl_raw_storage_iter.h
index 615da28524e..08e6c58f6b4 100644
--- a/libstdc++-v3/include/bits/stl_raw_storage_iter.h
+++ b/libstdc++-v3/include/bits/stl_raw_storage_iter.h
@@ -1,6 +1,7 @@
// -*- C++ -*-
-// Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -67,16 +68,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* This iterator class lets algorithms store their results into
* uninitialized memory.
*/
- template <class _ForwardIterator, class _Tp>
+ template <class _OutputIterator, class _Tp>
class raw_storage_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
- _ForwardIterator _M_iter;
+ _OutputIterator _M_iter;
public:
explicit
- raw_storage_iterator(_ForwardIterator __x)
+ raw_storage_iterator(_OutputIterator __x)
: _M_iter(__x) {}
raw_storage_iterator&
@@ -89,17 +90,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this;
}
- raw_storage_iterator<_ForwardIterator, _Tp>&
+ raw_storage_iterator<_OutputIterator, _Tp>&
operator++()
{
++_M_iter;
return *this;
}
- raw_storage_iterator<_ForwardIterator, _Tp>
+ raw_storage_iterator<_OutputIterator, _Tp>
operator++(int)
{
- raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
+ raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
++_M_iter;
return __tmp;
}
diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h
index 5663844f143..9cf16203a76 100644
--- a/libstdc++-v3/include/bits/stl_tempbuf.h
+++ b/libstdc++-v3/include/bits/stl_tempbuf.h
@@ -62,12 +62,75 @@
#ifndef _TEMPBUF_H
#define _TEMPBUF_H 1
-#include <bits/stl_memory.h>
+#include <bits/stl_algobase.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
/**
* @if maint
+ * This is a helper function. The unused second parameter exists to
+ * permit the real get_temporary_buffer to use template parameter deduction.
+ * @endif
+ */
+ template<typename _Tp>
+ pair<_Tp*, ptrdiff_t>
+ __get_temporary_buffer(ptrdiff_t __len, _Tp*)
+ {
+ const ptrdiff_t __max =
+ __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
+ if (__len > __max)
+ __len = __max;
+
+ while (__len > 0)
+ {
+ _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
+ std::nothrow));
+ if (__tmp != 0)
+ return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
+ __len /= 2;
+ }
+ return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
+ }
+
+ /**
+ * @brief Allocates a temporary buffer.
+ * @param len The number of objects of type Tp.
+ * @return See full description.
+ *
+ * Reinventing the wheel, but this time with prettier spokes!
+ *
+ * This function tries to obtain storage for @c len adjacent Tp
+ * objects. The objects themselves are not constructed, of course.
+ * A pair<> is returned containing "the buffer s address and
+ * capacity (in the units of sizeof(Tp)), or a pair of 0 values if
+ * no storage can be obtained." Note that the capacity obtained
+ * may be less than that requested if the memory is unavailable;
+ * you should compare len with the .second return value.
+ *
+ * Provides the nothrow exception guarantee.
+ */
+ template<typename _Tp>
+ inline pair<_Tp*, ptrdiff_t>
+ get_temporary_buffer(ptrdiff_t __len)
+ { return std::__get_temporary_buffer(__len, static_cast<_Tp*>(0)); }
+
+ /**
+ * @brief The companion to get_temporary_buffer().
+ * @param p A buffer previously allocated by get_temporary_buffer.
+ * @return None.
+ *
+ * Frees the memory pointed to by p.
+ */
+ template<typename _Tp>
+ inline void
+ return_temporary_buffer(_Tp* __p)
+ { ::operator delete(__p, std::nothrow); }
+
+
+ /**
+ * @if maint
* This class is used in two places: stl_algo.h and ext/memory,
* where it is wrapped as the temporary_buffer class. See
* temporary_buffer docs for more notes.
@@ -131,7 +194,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
operator=(const _Temporary_buffer&);
};
-
template<typename _ForwardIterator, typename _Tp>
_Temporary_buffer<_ForwardIterator, _Tp>::
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
@@ -140,8 +202,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
try
{
- pair<pointer, size_type> __p(get_temporary_buffer<
- value_type>(_M_original_len));
+ std::pair<pointer, size_type> __p(std::get_temporary_buffer<
+ value_type>(_M_original_len));
_M_buffer = __p.first;
_M_len = __p.second;
if (!__is_pod(_Tp) && _M_len > 0)
diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h
index c460a56d021..8b5548e213f 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -198,8 +198,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typename _Allocator>
_ForwardIterator
__uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
- _ForwardIterator __result,
- _Allocator __alloc)
+ _ForwardIterator __result, _Allocator& __alloc)
{
_ForwardIterator __cur = __result;
try
@@ -218,14 +217,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
inline _ForwardIterator
__uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
- _ForwardIterator __result,
- allocator<_Tp>)
+ _ForwardIterator __result, allocator<_Tp>&)
{ return std::uninitialized_copy(__first, __last, __result); }
template<typename _ForwardIterator, typename _Tp, typename _Allocator>
void
__uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
- const _Tp& __x, _Allocator __alloc)
+ const _Tp& __x, _Allocator& __alloc)
{
_ForwardIterator __cur = __first;
try
@@ -243,15 +241,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _ForwardIterator, typename _Tp, typename _Tp2>
inline void
__uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
- const _Tp& __x, allocator<_Tp2>)
+ const _Tp& __x, allocator<_Tp2>&)
{ std::uninitialized_fill(__first, __last, __x); }
template<typename _ForwardIterator, typename _Size, typename _Tp,
typename _Allocator>
void
__uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
- const _Tp& __x,
- _Allocator __alloc)
+ const _Tp& __x, _Allocator& __alloc)
{
_ForwardIterator __cur = __first;
try
@@ -270,8 +267,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typename _Tp2>
inline void
__uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
- const _Tp& __x,
- allocator<_Tp2>)
+ const _Tp& __x, allocator<_Tp2>&)
{ std::uninitialized_fill_n(__first, __n, __x); }
@@ -292,7 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_InputIterator2 __first2,
_InputIterator2 __last2,
_ForwardIterator __result,
- _Allocator __alloc)
+ _Allocator& __alloc)
{
_ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
__result,
@@ -316,8 +312,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
inline _ForwardIterator
__uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid,
const _Tp& __x, _InputIterator __first,
- _InputIterator __last,
- _Allocator __alloc)
+ _InputIterator __last, _Allocator& __alloc)
{
std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
try
@@ -340,7 +335,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__uninitialized_copy_fill(_InputIterator __first1, _InputIterator __last1,
_ForwardIterator __first2,
_ForwardIterator __last2, const _Tp& __x,
- _Allocator __alloc)
+ _Allocator& __alloc)
{
_ForwardIterator __mid2 = std::__uninitialized_copy_a(__first1, __last1,
__first2,
diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h
index 84f9a749067..128b9deae8d 100644
--- a/libstdc++-v3/include/bits/valarray_array.h
+++ b/libstdc++-v3/include/bits/valarray_array.h
@@ -1,7 +1,8 @@
// The template and inlines for the -*- C++ -*- internal _Array helper class.
-// Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007
-// Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
+// 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
@@ -43,7 +44,6 @@
#include <bits/c++config.h>
#include <bits/cpp_type_traits.h>
#include <cstdlib>
-#include <cstring>
#include <new>
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -91,7 +91,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// For fundamental types, it suffices to say 'memset()'
inline static void
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
- { std::memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
+ { __builtin_memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
};
template<typename _Tp>
@@ -160,7 +160,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
inline static void
_S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
_Tp* __restrict__ __o)
- { std::memcpy(__o, __b, (__e - __b)*sizeof(_Tp)); }
+ { __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp)); }
};
template<typename _Tp>
@@ -267,7 +267,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
inline static void
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
- { std::memcpy (__b, __a, __n * sizeof (_Tp)); }
+ { __builtin_memcpy(__b, __a, __n * sizeof (_Tp)); }
};
// Copy a plain array __a[<__n>] into a play array __b[<>]
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 79142d9ef2a..6e523b882d4 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -313,7 +313,7 @@ namespace __debug
return iterator(_Base::erase(__first.base(), __last.base()),
this);
}
- catch (...)
+ catch(...)
{
this->_M_revalidate_singular();
__throw_exception_again;
diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm
index 712a4edc7fd..10ca58aa2fd 100644
--- a/libstdc++-v3/include/ext/algorithm
+++ b/libstdc++-v3/include/ext/algorithm
@@ -1,6 +1,7 @@
// Algorithm extensions -*- C++ -*-
-// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -161,7 +162,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
- const int __result = std::memcmp(__first1, __first2, min(__len1, __len2));
+ const int __result = __builtin_memcmp(__first1, __first2,
+ min(__len1, __len2));
return __result != 0 ? __result
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
index aa29e07e154..9c6737515cb 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
@@ -265,7 +265,7 @@ set_loads(std::pair<float, float> load_pair)
m_load_max = load_pair.second;
do_resize(static_cast<size_type>(size_base::get_size() / ((m_load_min + m_load_max) / 2)));
}
- catch (...)
+ catch(...)
{
m_load_min = old_load_min;
m_load_max = old_load_max;
diff --git a/libstdc++-v3/include/ext/pod_char_traits.h b/libstdc++-v3/include/ext/pod_char_traits.h
index ab3d99e12ef..64bd7df4b59 100644
--- a/libstdc++-v3/include/ext/pod_char_traits.h
+++ b/libstdc++-v3/include/ext/pod_char_traits.h
@@ -140,8 +140,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{
- return static_cast<char_type*>(std::memmove(__s1, __s2,
- __n * sizeof(char_type)));
+ return static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type)));
}
static char_type*
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index 0bc371cd116..e0f0aa39036 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -533,6 +533,14 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
get_allocator() const
{ return *static_cast<const _Alloc*>(this); }
+ allocator_type&
+ _M_get_allocator()
+ { return *static_cast<_Alloc*>(this); }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
_Rope_rep_base(size_t __size, const allocator_type&)
: _M_size(__size) { }
@@ -572,9 +580,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
allocator_type;
using _Rope_rep_base<_CharT, _Alloc>::get_allocator;
+ using _Rope_rep_base<_CharT, _Alloc>::_M_get_allocator;
_Rope_RopeRep(__detail::_Tag __t, int __d, bool __b, size_t __size,
- allocator_type __a)
+ const allocator_type& __a)
: _Rope_rep_base<_CharT, _Alloc>(__size, __a),
#ifndef __GC
_Refcount_Base(1),
@@ -595,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#endif
static void
_S_free_string(__GC_CONST _CharT*, size_t __len,
- allocator_type __a);
+ allocator_type& __a);
#define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a);
// Deallocate data section of a leaf.
// This shouldn't be a member function.
@@ -689,7 +698,7 @@ protected:
allocator_type;
_Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size,
- allocator_type __a)
+ const allocator_type& __a)
: _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_leaf, 0, true,
__size, __a), _M_data(__d)
{
@@ -708,7 +717,7 @@ protected:
if (_M_data != this->_M_c_string)
this->_M_free_c_string();
- __STL_FREE_STRING(_M_data, this->_M_size, this->get_allocator());
+ __STL_FREE_STRING(_M_data, this->_M_size, this->_M_get_allocator());
}
#endif
protected:
@@ -731,7 +740,7 @@ protected:
_Rope_RopeConcatenation(_Rope_RopeRep<_CharT, _Alloc>* __l,
_Rope_RopeRep<_CharT, _Alloc>* __r,
- allocator_type __a)
+ const allocator_type& __a)
: _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_concat,
std::max(__l->_M_depth,
__r->_M_depth) + 1,
@@ -779,7 +788,7 @@ protected:
allocator_type;
_Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
- bool __d, allocator_type __a)
+ bool __d, const allocator_type& __a)
: _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_function, 0, true, __size, __a)
, _M_fn(__f)
#ifndef __GC
@@ -856,7 +865,7 @@ protected:
allocator_type;
_Rope_RopeSubstring(_Rope_RopeRep<_CharT, _Alloc>* __b, size_t __s,
- size_t __l, allocator_type __a)
+ size_t __l, const allocator_type& __a)
: _Rope_RopeFunction<_CharT, _Alloc>(this, __l, false, __a),
char_producer<_CharT>(), _M_base(__b), _M_start(__s)
{
@@ -1444,6 +1453,14 @@ protected:
get_allocator() const
{ return *static_cast<const _Alloc*>(this); }
+ allocator_type&
+ _M_get_allocator()
+ { return *static_cast<_Alloc*>(this); }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
// The one in _Base may not be visible due to template rules.
@@ -1504,6 +1521,7 @@ protected:
typedef typename _Base::allocator_type allocator_type;
using _Base::_M_tree_ptr;
using _Base::get_allocator;
+ using _Base::_M_get_allocator;
typedef __GC_CONST _CharT* _Cstrptr;
static _CharT _S_empty_c_str[1];
@@ -1614,7 +1632,7 @@ protected:
// Takes ownership of s instead of copying.
static _RopeLeaf*
_S_new_RopeLeaf(__GC_CONST _CharT *__s,
- size_t __size, allocator_type __a)
+ size_t __size, allocator_type& __a)
{
_RopeLeaf* __space = typename _Base::_LAlloc(__a).allocate(1);
return new(__space) _RopeLeaf(__s, __size, __a);
@@ -1622,7 +1640,7 @@ protected:
static _RopeConcatenation*
_S_new_RopeConcatenation(_RopeRep* __left, _RopeRep* __right,
- allocator_type __a)
+ allocator_type& __a)
{
_RopeConcatenation* __space = typename _Base::_CAlloc(__a).allocate(1);
return new(__space) _RopeConcatenation(__left, __right, __a);
@@ -1630,7 +1648,7 @@ protected:
static _RopeFunction*
_S_new_RopeFunction(char_producer<_CharT>* __f,
- size_t __size, bool __d, allocator_type __a)
+ size_t __size, bool __d, allocator_type& __a)
{
_RopeFunction* __space = typename _Base::_FAlloc(__a).allocate(1);
return new(__space) _RopeFunction(__f, __size, __d, __a);
@@ -1638,7 +1656,7 @@ protected:
static _RopeSubstring*
_S_new_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
- size_t __l, allocator_type __a)
+ size_t __l, allocator_type& __a)
{
_RopeSubstring* __space = typename _Base::_SAlloc(__a).allocate(1);
return new(__space) _RopeSubstring(__b, __s, __l, __a);
@@ -1646,7 +1664,7 @@ protected:
static _RopeLeaf*
_S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s,
- size_t __size, allocator_type __a)
+ size_t __size, allocator_type& __a)
#define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
_S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
{
@@ -1768,22 +1786,31 @@ protected:
{ return _S_compare(this->_M_tree_ptr, __y._M_tree_ptr); }
rope(const _CharT* __s, const allocator_type& __a = allocator_type())
- : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s),
- __a), __a)
- { }
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s),
+ _M_get_allocator());
+ }
rope(const _CharT* __s, size_t __len,
const allocator_type& __a = allocator_type())
- : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, __a), __a)
- { }
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, _M_get_allocator());
+ }
// Should perhaps be templatized with respect to the iterator type
// and use Sequence_buffer. (It should perhaps use sequence_buffer
// even now.)
- rope(const _CharT *__s, const _CharT *__e,
+ rope(const _CharT* __s, const _CharT* __e,
const allocator_type& __a = allocator_type())
- : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, __a), __a)
- { }
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, _M_get_allocator());
+ }
rope(const const_iterator& __s, const const_iterator& __e,
const allocator_type& __a = allocator_type())
@@ -1802,12 +1829,15 @@ protected:
{
_CharT* __buf = this->_Data_allocate(_S_rounded_up_size(1));
- get_allocator().construct(__buf, __c);
+ _M_get_allocator().construct(__buf, __c);
try
- { this->_M_tree_ptr = _S_new_RopeLeaf(__buf, 1, __a); }
+ {
+ this->_M_tree_ptr = _S_new_RopeLeaf(__buf, 1,
+ _M_get_allocator());
+ }
catch(...)
{
- _RopeRep::__STL_FREE_STRING(__buf, 1, __a);
+ _RopeRep::__STL_FREE_STRING(__buf, 1, _M_get_allocator());
__throw_exception_again;
}
}
@@ -1878,7 +1908,7 @@ protected:
{
_RopeRep* __old = this->_M_tree_ptr;
_RopeRep* __left =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, this->get_allocator());
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, _M_get_allocator());
try
{
this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr);
@@ -1916,7 +1946,7 @@ protected:
void
copy(_CharT* __buffer) const
{
- _Destroy(__buffer, __buffer + size(), get_allocator());
+ _Destroy(__buffer, __buffer + size(), _M_get_allocator());
_S_flatten(this->_M_tree_ptr, __buffer);
}
@@ -1931,7 +1961,7 @@ protected:
size_t __size = size();
size_t __len = (__pos + __n > __size? __size - __pos : __n);
- _Destroy(__buffer, __buffer + __len, get_allocator());
+ _Destroy(__buffer, __buffer + __len, _M_get_allocator());
_S_flatten(this->_M_tree_ptr, __pos, __len, __buffer);
return __len;
}
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index bbe6b9970bf..95dd8c2f722 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -1,6 +1,6 @@
// SGI's rope class implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -347,7 +347,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
if (0 != __cstr)
{
size_t __size = this->_M_size + 1;
- _Destroy(__cstr, __cstr + __size, get_allocator());
+ _Destroy(__cstr, __cstr + __size, _M_get_allocator());
this->_Data_deallocate(__cstr, __size);
}
}
@@ -355,7 +355,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
template <class _CharT, class _Alloc>
inline void
_Rope_RopeRep<_CharT, _Alloc>::
- _S_free_string(_CharT* __s, size_t __n, allocator_type __a)
+ _S_free_string(_CharT* __s, size_t __n, allocator_type& __a)
{
if (!_S_is_basic_char_type((_CharT*)0))
_Destroy(__s, __s + __n, __a);
@@ -442,12 +442,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
try
{
__result = _S_new_RopeLeaf(__new_data, __old_len + __len,
- __r->get_allocator());
+ __r->_M_get_allocator());
}
catch(...)
{
_RopeRep::__STL_FREE_STRING(__new_data, __old_len + __len,
- __r->get_allocator());
+ __r->_M_get_allocator());
__throw_exception_again;
}
return __result;
@@ -498,7 +498,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
_RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
__left->
- get_allocator());
+ _M_get_allocator());
size_t __depth = __result->_M_depth;
if (__depth > 20
@@ -540,7 +540,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
- __r->get_allocator());
+ __r->_M_get_allocator());
if (__r->_M_tag == __detail::_S_leaf
&& __r->_M_size + __slen <= size_t(_S_copy_max))
{
@@ -570,7 +570,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
}
_RopeRep* __nright =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator());
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
try
{
__r->_M_ref_nonnil();
@@ -594,7 +594,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_RopeRep* __result;
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
- __r->get_allocator());
+ __r->_M_get_allocator());
size_t __count = __r->_M_ref_count;
size_t __orig_size = __r->_M_size;
if (__count > 1)
@@ -636,7 +636,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
}
_RopeRep* __right =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator());
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
__r->_M_ref_nonnil();
try
{ __result = _S_tree_concat(__r, __right); }
@@ -775,14 +775,14 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#ifdef __GC
const _CharT* __section = __l->_M_data + __start;
__result = _S_new_RopeLeaf(__section, __result_len,
- __base->get_allocator());
+ __base->_M_get_allocator());
__result->_M_c_string = 0; // Not eos terminated.
#else
// We should sometimes create substring node instead.
__result = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__l->_M_data + __start,
__result_len,
__base->
- get_allocator());
+ _M_get_allocator());
#endif
return __result;
}
@@ -800,7 +800,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_S_new_RopeSubstring(__old->_M_base,
__start + __old->_M_start,
__adj_endp1 - __start,
- __base->get_allocator());
+ __base->_M_get_allocator());
return __result;
} // *** else fall through: ***
@@ -823,19 +823,19 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
catch(...)
{
_RopeRep::__STL_FREE_STRING(__section, __result_len,
- __base->get_allocator());
+ __base->_M_get_allocator());
__throw_exception_again;
}
_S_cond_store_eos(__section[__result_len]);
return _S_new_RopeLeaf(__section, __result_len,
- __base->get_allocator());
+ __base->_M_get_allocator());
}
}
lazy:
{
// Create substring node.
return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start,
- __base->get_allocator());
+ __base->_M_get_allocator());
}
}
@@ -1550,13 +1550,15 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
__rest_buffer = this->_Data_allocate(_S_rounded_up_size(__rest));
__uninitialized_fill_n_a(__rest_buffer, __rest, __c,
- get_allocator());
+ _M_get_allocator());
_S_cond_store_eos(__rest_buffer[__rest]);
try
- { __remainder = _S_new_RopeLeaf(__rest_buffer, __rest, __a); }
+ { __remainder = _S_new_RopeLeaf(__rest_buffer, __rest,
+ _M_get_allocator()); }
catch(...)
{
- _RopeRep::__STL_FREE_STRING(__rest_buffer, __rest, __a);
+ _RopeRep::__STL_FREE_STRING(__rest_buffer, __rest,
+ _M_get_allocator());
__throw_exception_again;
}
}
@@ -1568,17 +1570,19 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_RopeLeaf* __base_leaf;
rope __base_rope;
__uninitialized_fill_n_a(__base_buffer, __exponentiate_threshold, __c,
- get_allocator());
+ _M_get_allocator());
_S_cond_store_eos(__base_buffer[__exponentiate_threshold]);
try
{
__base_leaf = _S_new_RopeLeaf(__base_buffer,
- __exponentiate_threshold, __a);
+ __exponentiate_threshold,
+ _M_get_allocator());
}
catch(...)
{
_RopeRep::__STL_FREE_STRING(__base_buffer,
- __exponentiate_threshold, __a);
+ __exponentiate_threshold,
+ _M_get_allocator());
__throw_exception_again;
}
__base_rope._M_tree_ptr = __base_leaf;
@@ -1646,7 +1650,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_unref_nonnil();
this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s,
- this->get_allocator());
+ this->_M_get_allocator());
return(__result);
}
diff --git a/libstdc++-v3/include/ext/vstring.tcc b/libstdc++-v3/include/ext/vstring.tcc
index 7d03017f80b..8d5b1b5e775 100644
--- a/libstdc++-v3/include/ext/vstring.tcc
+++ b/libstdc++-v3/include/ext/vstring.tcc
@@ -38,6 +38,8 @@
#pragma GCC system_header
+#include <cxxabi-forced.h>
+
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
template<typename _CharT, typename _Traits, typename _Alloc,
@@ -598,6 +600,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= __ios_base::eofbit;
__in.width(0);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -669,6 +676,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= __ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset
index 9c869bf5559..9ead05915dc 100644
--- a/libstdc++-v3/include/std/bitset
+++ b/libstdc++-v3/include/std/bitset
@@ -51,11 +51,11 @@
#pragma GCC system_header
#include <cstddef> // For size_t
-#include <cstring> // For memset
#include <string>
#include <bits/functexcept.h> // For invalid_argument, out_of_range,
// overflow_error
#include <iosfwd>
+#include <cxxabi-forced.h>
#define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long))
#define _GLIBCXX_BITSET_WORDS(__n) \
@@ -164,7 +164,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
void
_M_do_reset()
- { std::memset(_M_w, 0, _Nw * sizeof(_WordT)); }
+ { __builtin_memset(_M_w, 0, _Nw * sizeof(_WordT)); }
bool
_M_is_equal(const _Base_bitset<_Nw>& __x) const
@@ -1271,6 +1271,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
}
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __is._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ __is._M_setstate(__ios_base::badbit); }
}
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index b91732b0c85..04a6c69ba75 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1,6 +1,7 @@
// The template and inlines for the -*- C++ -*- complex number classes.
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -1484,6 +1485,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
complex<long double>::complex(const complex<double>& __z)
: _M_value(__z.__rep()) { }
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template istream& operator>>(istream&, complex<float>&);
+ extern template ostream& operator<<(ostream&, const complex<float>&);
+ extern template istream& operator>>(istream&, complex<double>&);
+ extern template ostream& operator<<(ostream&, const complex<double>&);
+ extern template istream& operator>>(istream&, complex<long double>&);
+ extern template ostream& operator<<(ostream&, const complex<long double>&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wistream& operator>>(wistream&, complex<float>&);
+ extern template wostream& operator<<(wostream&, const complex<float>&);
+ extern template wistream& operator>>(wistream&, complex<double>&);
+ extern template wostream& operator<<(wostream&, const complex<double>&);
+ extern template wistream& operator>>(wistream&, complex<long double>&);
+ extern template wostream& operator<<(wostream&, const complex<long double>&);
+#endif
+#endif
+
_GLIBCXX_END_NAMESPACE
#ifdef __GXX_EXPERIMENTAL_CXX0X__
diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream
index cab18c1fcb1..18c24be4633 100644
--- a/libstdc++-v3/include/std/fstream
+++ b/libstdc++-v3/include/std/fstream
@@ -275,7 +275,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* If any operations fail, this function also fails.
*/
__filebuf_type*
- close() throw();
+ close();
protected:
void
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index 33bc2169f73..28b8d85d0e2 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -51,8 +51,13 @@
#pragma GCC system_header
-#include <bits/c++config.h>
-#include <bits/stl_memory.h>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_tempbuf.h>
+#include <bits/stl_auto_ptr.h>
+#include <bits/stl_raw_storage_iter.h>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/memory>
diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept
index d246428f4de..e47adb38989 100644
--- a/libstdc++-v3/include/std/stdexcept
+++ b/libstdc++-v3/include/std/stdexcept
@@ -1,6 +1,6 @@
// Standard exception classes -*- C++ -*-
-// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2005, 2007 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
@@ -57,7 +57,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
public:
/** Takes a character string describing the error. */
explicit
- logic_error(const string& __arg);
+ logic_error(const string& __arg);
virtual
~logic_error() throw();
@@ -73,14 +73,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
class domain_error : public logic_error
{
public:
- explicit domain_error(const string& __arg);
+ explicit domain_error(const string& __arg);
};
/** Thrown to report invalid arguments to functions. */
class invalid_argument : public logic_error
{
public:
- explicit invalid_argument(const string& __arg);
+ explicit invalid_argument(const string& __arg);
};
/** Thrown when an object is constructed that would exceed its maximum
@@ -88,7 +88,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
class length_error : public logic_error
{
public:
- explicit length_error(const string& __arg);
+ explicit length_error(const string& __arg);
};
/** This represents an argument whose value is not within the expected
@@ -96,7 +96,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
class out_of_range : public logic_error
{
public:
- explicit out_of_range(const string& __arg);
+ explicit out_of_range(const string& __arg);
};
/** Runtime errors represent problems outside the scope of a program;
@@ -111,7 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
public:
/** Takes a character string describing the error. */
explicit
- runtime_error(const string& __arg);
+ runtime_error(const string& __arg);
virtual
~runtime_error() throw();
@@ -126,21 +126,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
class range_error : public runtime_error
{
public:
- explicit range_error(const string& __arg);
+ explicit range_error(const string& __arg);
};
/** Thrown to indicate arithmetic overflow. */
class overflow_error : public runtime_error
{
public:
- explicit overflow_error(const string& __arg);
+ explicit overflow_error(const string& __arg);
};
/** Thrown to indicate arithmetic underflow. */
class underflow_error : public runtime_error
{
public:
- explicit underflow_error(const string& __arg);
+ explicit underflow_error(const string& __arg);
};
_GLIBCXX_END_NAMESPACE
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 0d7e85e5300..6806ebc255e 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -186,33 +186,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
};
template<typename _Tp>
- struct __make_unsigned_selector<_Tp, false, true, false>
- {
- private:
- // GNU floating point types start with sizeof int.
- static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned int);
- static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned long);
- typedef conditional<__b2, unsigned long, unsigned long long> __cond;
- typedef typename __cond::type __cond_type;
- typedef unsigned int __ui_type;
-
- public:
- typedef typename conditional<__b1, __ui_type, __cond_type>::type __type;
- };
-
- template<typename _Tp>
struct __make_unsigned_selector<_Tp, false, false, true>
{
private:
- // GNU enums start with sizeof int.
- static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned int);
- static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned long);
- typedef conditional<__b2, unsigned long, unsigned long long> __cond;
+ // GNU enums start with sizeof short.
+ typedef unsigned short __smallest;
+ static const bool __b1 = sizeof(_Tp) <= sizeof(__smallest);
+ static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
+ typedef conditional<__b2, unsigned int, unsigned long> __cond;
typedef typename __cond::type __cond_type;
- typedef unsigned int __ui_type;
public:
- typedef typename conditional<__b1, __ui_type, __cond_type>::type __type;
+ typedef typename conditional<__b1, __smallest, __cond_type>::type __type;
};
// Primary class template.
@@ -260,7 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ typedef signed long long __type; };
- // Select between arithmetic and enum: not possible to be both.
+ // Select between integral and enum: not possible to be both.
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
bool _IsSigned = is_signed<_Tp>::value,
@@ -284,32 +269,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
};
template<typename _Tp>
- struct __make_signed_selector<_Tp, false, true, false>
- {
- // GNU floating point types start with sizeof int.
- static const bool __b1 = sizeof(_Tp) <= sizeof(signed int);
- static const bool __b2 = sizeof(_Tp) <= sizeof(signed long);
- typedef conditional<__b2, signed long, signed long long> __cond;
- typedef typename __cond::type __cond_type;
- typedef unsigned int __i_type;
-
- public:
- typedef typename conditional<__b1, __i_type, __cond_type>::type __type;
- };
-
- template<typename _Tp>
struct __make_signed_selector<_Tp, false, false, true>
{
private:
- // GNU enums start with sizeof int.
- static const bool __b1 = sizeof(_Tp) <= sizeof(signed int);
- static const bool __b2 = sizeof(_Tp) <= sizeof(signed long);
- typedef conditional<__b2, signed long, signed long long> __cond;
+ // GNU enums start with sizeof short.
+ typedef signed short __smallest;
+ static const bool __b1 = sizeof(_Tp) <= sizeof(__smallest);
+ static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
+ typedef conditional<__b2, signed int, signed long> __cond;
typedef typename __cond::type __cond_type;
- typedef int __i_type;
public:
- typedef typename conditional<__b1, __i_type, __cond_type>::type __type;
+ typedef typename conditional<__b1, __smallest, __cond_type>::type __type;
};
// Primary class template.
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index 36845bb124f..f1cb1e658f7 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -943,12 +943,13 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_GLIBCXX_END_NAMESPACE
}
- /**
- * @defgroup tr1_math_spec_func Mathematical Special Functions
- * A collection of advanced mathematical special functions.
- * @{
- */
+/**
+ * @defgroup tr1_math_spec_func Mathematical Special Functions
+ * A collection of advanced mathematical special functions.
+ * @{
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
#include <tr1/gamma.tcc>
#include <tr1/bessel_function.tcc>
#include <tr1/beta_function.tcc>
@@ -1409,4 +1410,6 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_GLIBCXX_END_NAMESPACE
}
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
#endif
diff --git a/libstdc++-v3/include/tr1/hypergeometric.tcc b/libstdc++-v3/include/tr1/hypergeometric.tcc
index d54e6fecde3..c0d676fa89a 100644
--- a/libstdc++-v3/include/tr1/hypergeometric.tcc
+++ b/libstdc++-v3/include/tr1/hypergeometric.tcc
@@ -613,7 +613,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__sgn_g1cb = __log_gamma_sign(__c - __b);
__ln_g1cb = __log_gamma(__c - __b);
}
- catch (...)
+ catch(...)
{
__ok1 = false;
}
@@ -628,7 +628,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__sgn_g2b = __log_gamma_sign(__b);
__ln_g2b = __log_gamma(__b);
}
- catch (...)
+ catch(...)
{
__ok2 = false;
}
diff --git a/libstdc++-v3/include/tr1/type_traitsfwd.h b/libstdc++-v3/include/tr1/type_traitsfwd.h
index 497801447b1..9cf2de66359 100644
--- a/libstdc++-v3/include/tr1/type_traitsfwd.h
+++ b/libstdc++-v3/include/tr1/type_traitsfwd.h
@@ -33,7 +33,7 @@
*/
#ifndef _TYPE_TRAITSFWD_H
-#define _TYPE_TRAIT_FWD_H 1
+#define _TYPE_TRAITSFWD_H 1
#include <cstddef>
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index a30115e8713..366efa27428 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the GNU C++ Support library.
##
-## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007
## Free Software Foundation, Inc.
##
## Process this file with automake to produce Makefile.in.
@@ -33,7 +33,7 @@ noinst_LTLIBRARIES = libsupc++convenience.la
headers = \
- exception new typeinfo cxxabi.h exception_defines.h
+ exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h
if GLIBCXX_HOSTED
c_sources = \
@@ -42,6 +42,7 @@ endif
sources = \
array_type_info.cc \
+ atexit_arm.cc \
bad_cast.cc \
bad_typeid.cc \
class_type_info.cc \
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 8a27bec7a4f..85ae2006cde 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -69,21 +69,21 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \
toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
libsupc___la_LIBADD =
-am__libsupc___la_SOURCES_DIST = array_type_info.cc bad_cast.cc \
- bad_typeid.cc class_type_info.cc del_op.cc del_opnt.cc \
- del_opv.cc del_opvnt.cc dyncast.cc eh_alloc.cc eh_arm.cc \
- eh_aux_runtime.cc eh_call.cc eh_catch.cc eh_exception.cc \
- eh_globals.cc eh_personality.cc eh_term_handler.cc \
- eh_terminate.cc eh_throw.cc eh_type.cc eh_unex_handler.cc \
- enum_type_info.cc function_type_info.cc \
+am__libsupc___la_SOURCES_DIST = array_type_info.cc atexit_arm.cc \
+ bad_cast.cc bad_typeid.cc class_type_info.cc del_op.cc \
+ del_opnt.cc del_opv.cc del_opvnt.cc dyncast.cc eh_alloc.cc \
+ eh_arm.cc eh_aux_runtime.cc eh_call.cc eh_catch.cc \
+ eh_exception.cc eh_globals.cc eh_personality.cc \
+ eh_term_handler.cc eh_terminate.cc eh_throw.cc eh_type.cc \
+ eh_unex_handler.cc enum_type_info.cc function_type_info.cc \
fundamental_type_info.cc guard.cc new_handler.cc new_op.cc \
new_opnt.cc new_opv.cc new_opvnt.cc pbase_type_info.cc \
pmem_type_info.cc pointer_type_info.cc pure.cc \
si_class_type_info.cc tinfo.cc tinfo2.cc vec.cc \
vmi_class_type_info.cc vterminate.cc cp-demangle.c
-am__objects_1 = array_type_info.lo bad_cast.lo bad_typeid.lo \
- class_type_info.lo del_op.lo del_opnt.lo del_opv.lo \
- del_opvnt.lo dyncast.lo eh_alloc.lo eh_arm.lo \
+am__objects_1 = array_type_info.lo atexit_arm.lo bad_cast.lo \
+ bad_typeid.lo class_type_info.lo del_op.lo del_opnt.lo \
+ del_opv.lo del_opvnt.lo dyncast.lo eh_alloc.lo eh_arm.lo \
eh_aux_runtime.lo eh_call.lo eh_catch.lo eh_exception.lo \
eh_globals.lo eh_personality.lo eh_term_handler.lo \
eh_terminate.lo eh_throw.lo eh_type.lo eh_unex_handler.lo \
@@ -98,9 +98,9 @@ am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2)
libsupc___la_OBJECTS = $(am_libsupc___la_OBJECTS)
libsupc__convenience_la_LIBADD =
am__libsupc__convenience_la_SOURCES_DIST = array_type_info.cc \
- bad_cast.cc bad_typeid.cc class_type_info.cc del_op.cc \
- del_opnt.cc del_opv.cc del_opvnt.cc dyncast.cc eh_alloc.cc \
- eh_arm.cc eh_aux_runtime.cc eh_call.cc eh_catch.cc \
+ atexit_arm.cc bad_cast.cc bad_typeid.cc class_type_info.cc \
+ del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc dyncast.cc \
+ eh_alloc.cc eh_arm.cc eh_aux_runtime.cc eh_call.cc eh_catch.cc \
eh_exception.cc eh_globals.cc eh_personality.cc \
eh_term_handler.cc eh_terminate.cc eh_throw.cc eh_type.cc \
eh_unex_handler.cc enum_type_info.cc function_type_info.cc \
@@ -335,13 +335,14 @@ toolexeclib_LTLIBRARIES = libsupc++.la
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la
headers = \
- exception new typeinfo cxxabi.h exception_defines.h
+ exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h
@GLIBCXX_HOSTED_TRUE@c_sources = \
@GLIBCXX_HOSTED_TRUE@ cp-demangle.c
sources = \
array_type_info.cc \
+ atexit_arm.cc \
bad_cast.cc \
bad_typeid.cc \
class_type_info.cc \
diff --git a/libstdc++-v3/libsupc++/atexit_arm.cc b/libstdc++-v3/libsupc++/atexit_arm.cc
new file mode 100644
index 00000000000..fe2143b42b1
--- /dev/null
+++ b/libstdc++-v3/libsupc++/atexit_arm.cc
@@ -0,0 +1,44 @@
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, 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 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.
+
+#include <cxxabi.h>
+
+#if defined(__arm__) && defined(__ARM_EABI__)
+
+namespace __aeabiv1
+{
+ extern "C" int
+ __aeabi_atexit (void *object,
+ void (*destructor) (void *),
+ void *dso_handle) throw ()
+ {
+ return abi::__cxa_atexit(destructor, object, dso_handle);
+ }
+} // namespace __aeabiv1
+
+#endif // defined(__arm__) && defined(__ARM_EABI__)
diff --git a/libstdc++-v3/libsupc++/cxxabi-forced.h b/libstdc++-v3/libsupc++/cxxabi-forced.h
new file mode 100644
index 00000000000..523ccba01a6
--- /dev/null
+++ b/libstdc++-v3/libsupc++/cxxabi-forced.h
@@ -0,0 +1,51 @@
+// cxxabi.h subset for inclusion by other library headers -*- C++ -*-
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, 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 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.
+
+#ifndef _CXXABI_FORCED_H
+#define _CXXABI_FORCED_H 1
+
+#pragma GCC visibility push(default)
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ // A magic placeholder class that can be caught by reference
+ // to recognize forced unwinding.
+ class __forced_unwind
+ {
+ virtual ~__forced_unwind() throw();
+ virtual void __pure_dummy() = 0; // prevent catch by value
+ };
+}
+#endif // __cplusplus
+
+#pragma GCC visibility pop
+
+#endif // __CXXABI_FORCED_H
diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h
index c0418d82588..d75515e07c4 100644
--- a/libstdc++-v3/libsupc++/cxxabi.h
+++ b/libstdc++-v3/libsupc++/cxxabi.h
@@ -1,6 +1,6 @@
// new abi support -*- C++ -*-
-// Copyright (C) 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -50,8 +50,15 @@
#include <stddef.h>
#include <bits/cxxabi_tweaks.h>
+#include <cxxabi-forced.h>
#ifdef __cplusplus
+#define _GLIBCXX_NOTHROW throw()
+#else
+#define _GLIBCXX_NOTHROW __attribute__((nothrow))
+#endif
+
+#ifdef __cplusplus
namespace __cxxabiv1
{
extern "C"
@@ -136,7 +143,7 @@ namespace __cxxabiv1
// DSO destruction.
int
- __cxa_atexit(void (*)(void*), void*, void*);
+ __cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW;
int
__cxa_finalize(void*);
@@ -525,6 +532,15 @@ namespace __cxxabiv1
// null if there is none.
extern "C" std::type_info*
__cxa_current_exception_type();
+
+ // A magic placeholder class that can be caught by reference
+ // to recognize foreign exceptions.
+ class __foreign_exception
+ {
+ virtual ~__foreign_exception() throw();
+ virtual void __pure_dummy() = 0; // prevent catch by value
+ };
+
} // namespace __cxxabiv1
// User programs should use the alias `abi'.
diff --git a/libstdc++-v3/libsupc++/eh_exception.cc b/libstdc++-v3/libsupc++/eh_exception.cc
index 40bb839bb7a..0de89304394 100644
--- a/libstdc++-v3/libsupc++/eh_exception.cc
+++ b/libstdc++-v3/libsupc++/eh_exception.cc
@@ -31,12 +31,16 @@
#include "typeinfo"
#include "exception"
-#include "unwind-cxx.h"
+#include <cxxabi.h>
std::exception::~exception() throw() { }
std::bad_exception::~bad_exception() throw() { }
+abi::__forced_unwind::~__forced_unwind() throw() { }
+
+abi::__foreign_exception::~__foreign_exception() throw() { }
+
const char*
std::exception::what() const throw()
{
diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
index 2bdb017908b..bbcc0072730 100644
--- a/libstdc++-v3/libsupc++/eh_personality.cc
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -30,6 +30,7 @@
#include <bits/c++config.h>
#include <cstdlib>
#include <exception_defines.h>
+#include <cxxabi.h>
#include "unwind-cxx.h"
using namespace __cxxabiv1;
@@ -541,13 +542,19 @@ PERSONALITY_FUNCTION (int version,
bool saw_cleanup = false;
bool saw_handler = false;
- // During forced unwinding, we only run cleanups. With a foreign
- // exception class, there's no exception type.
- // ??? What to do about GNU Java and GNU Ada exceptions.
-
- if ((actions & _UA_FORCE_UNWIND)
- || foreign_exception)
- throw_type = 0;
+ // During forced unwinding, match a magic exception type.
+ if (actions & _UA_FORCE_UNWIND)
+ {
+ throw_type = &typeid(abi::__forced_unwind);
+ thrown_ptr = 0;
+ }
+ // With a foreign exception class, there's no exception type.
+ // ??? What to do about GNU Java and GNU Ada exceptions?
+ else if (foreign_exception)
+ {
+ throw_type = &typeid(abi::__foreign_exception);
+ thrown_ptr = 0;
+ }
else
#ifdef __ARM_EABI_UNWINDER__
throw_type = ue_header;
@@ -590,7 +597,9 @@ PERSONALITY_FUNCTION (int version,
// object to stuff bits in for __cxa_call_unexpected to use.
// Allow them iff the exception spec is non-empty. I.e.
// a throw() specification results in __unexpected.
- if (throw_type
+ if ((throw_type
+ && !(actions & _UA_FORCE_UNWIND)
+ && !foreign_exception)
? ! check_exception_spec (&info, throw_type, thrown_ptr,
ar_filter)
: empty_exception_spec (&info, ar_filter))
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index 08a710718b0..67caec86627 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -499,14 +499,6 @@ namespace __aeabiv1
2 * sizeof (std::size_t),
/*destructor=*/NULL, dealloc);
}
-
- extern "C" int
- __aeabi_atexit (void *object,
- void (*destructor) (void *),
- void *dso_handle)
- {
- return abi::__cxa_atexit(destructor, object, dso_handle);
- }
} // namespace __aeabiv1
#endif // defined(__arm__) && defined(__ARM_EABI__)
diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc
index 83b20b96706..b29040c429a 100644
--- a/libstdc++-v3/src/compatibility.cc
+++ b/libstdc++-v3/src/compatibility.cc
@@ -114,6 +114,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__c, __eof))
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -180,6 +185,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
if (traits_type::eq_int_type(__c, __eof))
__err |= ios_base::eofbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
diff --git a/libstdc++-v3/src/ctype.cc b/libstdc++-v3/src/ctype.cc
index 4a2e896f7bb..a77e8e5b010 100644
--- a/libstdc++-v3/src/ctype.cc
+++ b/libstdc++-v3/src/ctype.cc
@@ -29,6 +29,7 @@
#include <locale>
#include <cstdlib>
+#include <cstring>
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index 3fbee2cad4e..fc140c0c3c3 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -127,7 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__newsize = __ix + 1;
try
{ __words = new _Words[__newsize]; }
- catch (...)
+ catch(...)
{
_M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
@@ -172,7 +172,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
try
{ (*__p->_M_fn) (__e, *this, __p->_M_index); }
- catch (...)
+ catch(...)
{ }
__p = __p->_M_next;
}
diff --git a/libstdc++-v3/src/ios_init.cc b/libstdc++-v3/src/ios_init.cc
index 5c7ab2e8322..62d42ee65b6 100644
--- a/libstdc++-v3/src/ios_init.cc
+++ b/libstdc++-v3/src/ios_init.cc
@@ -142,7 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
wclog.flush();
#endif
}
- catch (...)
+ catch(...)
{ }
}
}
diff --git a/libstdc++-v3/src/istream.cc b/libstdc++-v3/src/istream.cc
index 0f24340e031..319202ee4c3 100644
--- a/libstdc++-v3/src/istream.cc
+++ b/libstdc++-v3/src/istream.cc
@@ -91,6 +91,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -177,6 +182,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__sb->sbumpc();
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -251,6 +261,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*__s = __char_type();
__in.width(0);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ __in._M_setstate(ios_base::badbit); }
}
@@ -321,6 +336,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__err |= ios_base::eofbit;
__in.width(0);
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -401,6 +421,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -473,6 +498,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
}
@@ -559,6 +589,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__sb->sbumpc();
}
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@@ -632,6 +667,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__err |= ios_base::failbit;
}
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
catch(...)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc
index 6e3d111bb82..76566d0ac91 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc
@@ -49,12 +49,18 @@
// "C" compatibility headers
#include <assert.h>
+#ifdef _GLIBCXX_HAVE_COMPLEX_H
#include <complex.h>
+#endif
#include <ctype.h>
#include <errno.h>
+#ifdef _GLIBCXX_HAVE_FENV_H
#include <fenv.h>
+#endif
#include <float.h>
+#ifdef _GLIBCXX_HAVE_INTTYPES_H
#include <inttypes.h>
+#endif
#include <iso646.h>
#include <limits.h>
#include <locale.h>
@@ -62,13 +68,19 @@
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
+#ifdef _GLIBCXX_HAVE_STDBOOL_H
#include <stdbool.h>
+#endif
#include <stddef.h>
+#ifdef _GLIBCXX_HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef _GLIBCXX_HAVE_TGMATH_H
#include <tgmath.h>
+#endif
#include <time.h>
#include <wchar.h>
#include <wctype.h>
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc
index f87ff666895..d788be21578 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc
@@ -49,12 +49,18 @@
// "C" compatibility headers
#include <assert.h>
+#ifdef _GLIBCXX_HAVE_COMPLEX_H
#include <complex.h>
+#endif
#include <ctype.h>
#include <errno.h>
+#ifdef _GLIBCXX_HAVE_FENV_H
#include <fenv.h>
+#endif
#include <float.h>
+#ifdef _GLIBCXX_HAVE_INTTYPES_H
#include <inttypes.h>
+#endif
#include <iso646.h>
#include <limits.h>
#include <locale.h>
@@ -62,13 +68,19 @@
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
+#ifdef _GLIBCXX_HAVE_STDBOOL_H
#include <stdbool.h>
+#endif
#include <stddef.h>
+#ifdef _GLIBCXX_HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef _GLIBCXX_HAVE_TGMATH_H
#include <tgmath.h>
+#endif
#include <time.h>
#include <wchar.h>
#include <wctype.h>
@@ -143,12 +155,18 @@
// "C" compatibility headers
#include <assert.h>
+#ifdef _GLIBCXX_HAVE_COMPLEX_H
#include <complex.h>
+#endif
#include <ctype.h>
#include <errno.h>
+#ifdef _GLIBCXX_HAVE_FENV_H
#include <fenv.h>
+#endif
#include <float.h>
+#ifdef _GLIBCXX_HAVE_INTTYPES_H
#include <inttypes.h>
+#endif
#include <iso646.h>
#include <limits.h>
#include <locale.h>
@@ -156,13 +174,19 @@
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
+#ifdef _GLIBCXX_HAVE_STDBOOL_H
#include <stdbool.h>
+#endif
#include <stddef.h>
+#ifdef _GLIBCXX_HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef _GLIBCXX_HAVE_TGMATH_H
#include <tgmath.h>
+#endif
#include <time.h>
#include <wchar.h>
#include <wctype.h>
diff --git a/libstdc++-v3/testsuite/19_diagnostics/23591_thread-1.c b/libstdc++-v3/testsuite/19_diagnostics/bad_exception/23591_thread-1.c
index 8c953eaed0e..8c953eaed0e 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/23591_thread-1.c
+++ b/libstdc++-v3/testsuite/19_diagnostics/bad_exception/23591_thread-1.c
diff --git a/libstdc++-v3/testsuite/19_diagnostics/logic_error/what-1.cc b/libstdc++-v3/testsuite/19_diagnostics/logic_error/what-1.cc
new file mode 100644
index 00000000000..d5e36d2df84
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/logic_error/what-1.cc
@@ -0,0 +1,59 @@
+// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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.
+
+// 19.1 Exception classes
+
+#include <string>
+#include <stdexcept>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+// libstdc++/1972
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::string s("lack of sunlight, no water error");
+
+ // 1
+ std::logic_error obj1 = std::logic_error(s);
+
+ // 2
+ std::logic_error obj2(s);
+
+ VERIFY( std::strcmp(obj1.what(), s.data()) == 0 );
+ VERIFY( std::strcmp(obj2.what(), s.data()) == 0 );
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ std::string s("lack of sunlight error");
+ std::domain_error x(s);
+
+ VERIFY( std::strcmp(x.what(), s.data()) == 0 );
+}
+
+int main(void)
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/logic_error/what-2.cc b/libstdc++-v3/testsuite/19_diagnostics/logic_error/what-2.cc
new file mode 100644
index 00000000000..030b5e8f61f
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/logic_error/what-2.cc
@@ -0,0 +1,51 @@
+// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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.
+
+// 19.1 Exception classes
+
+#include <string>
+#include <stdexcept>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+// libstdc++/2089
+class fuzzy_logic : public std::logic_error
+{
+public:
+ fuzzy_logic() : std::logic_error("whoa") { }
+};
+
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ try
+ { throw fuzzy_logic(); }
+ catch(const fuzzy_logic& obj)
+ { VERIFY( std::strcmp("whoa", obj.what()) == 0 ); }
+ catch(...)
+ { VERIFY( false ); }
+}
+
+int main(void)
+{
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-1.cc b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-1.cc
new file mode 100644
index 00000000000..a46a421db2e
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-1.cc
@@ -0,0 +1,59 @@
+// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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.
+
+// 19.1 Exception classes
+
+#include <string>
+#include <stdexcept>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+// libstdc++/1972
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::string s("lack of sunlight, no water error");
+
+ // 1
+ std::runtime_error obj1 = std::runtime_error(s);
+
+ // 2
+ std::runtime_error obj2(s);
+
+ VERIFY( std::strcmp(obj1.what(), s.data()) == 0 );
+ VERIFY( std::strcmp(obj2.what(), s.data()) == 0 );
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ std::string s("lack of sunlight error");
+ std::range_error x(s);
+
+ VERIFY( std::strcmp(x.what(), s.data()) == 0 );
+}
+
+int main(void)
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-2.cc b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-2.cc
new file mode 100644
index 00000000000..779c1f51806
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-2.cc
@@ -0,0 +1,51 @@
+// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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.
+
+// 19.1 Exception classes
+
+#include <string>
+#include <stdexcept>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+// libstdc++/2089
+class fuzzy_logic : public std::runtime_error
+{
+public:
+ fuzzy_logic() : std::runtime_error("whoa") { }
+};
+
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ try
+ { throw fuzzy_logic(); }
+ catch(const fuzzy_logic& obj)
+ { VERIFY( std::strcmp("whoa", obj.what()) == 0 ); }
+ catch(...)
+ { VERIFY( false ); }
+}
+
+int main(void)
+{
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-3.cc
index af06cbea9d4..04b85c0c5fe 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-3.cc
@@ -1,6 +1,7 @@
// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,50 +23,9 @@
#include <string>
#include <stdexcept>
+#include <cstring>
#include <testsuite_hooks.h>
-// libstdc++/1972
-void test01()
-{
- bool test __attribute__((unused)) = true;
- std::string s("lack of sunlight, no water error");
-
- // 1
- std::logic_error obj = std::logic_error(s);
-
- // 2
- // std::logic_error obj((std::string)strlit);
-
- VERIFY( std::strcmp(obj.what(), s.data()) == 0 );
-}
-
-void test02()
-{
- bool test __attribute__((unused)) = true;
- std::string s("lack of sunlight error");
- std::domain_error x(s);
-
- VERIFY( std::strcmp(x.what(), s.data()) == 0 );
-}
-
-// libstdc++/2089
-class fuzzy_logic : public std::logic_error
-{
-public:
- fuzzy_logic() : std::logic_error("whoa") { }
-};
-
-void test03()
-{
- bool test __attribute__((unused)) = true;
- try
- { throw fuzzy_logic(); }
- catch(const fuzzy_logic& obj)
- { VERIFY( std::strcmp("whoa", obj.what()) == 0 ); }
- catch(...)
- { VERIFY( false ); }
-}
-
// test copy ctors and assignment operators
// libstdc++/1972
// via Greg Bumgardner <bumgard@roguewave.com>
@@ -105,10 +65,6 @@ void test04()
int main(void)
{
- test01();
- test02();
- test03();
test04();
-
return 0;
}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
index 5ce62eeac3b..ffca8986fad 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
@@ -46,5 +46,5 @@ main()
test01();
return 0;
}
-// { dg-error "candidates" "" { target *-*-* } 207 }
-// { dg-error "::auto_ptr" "" { target *-*-* } 337 }
+// { dg-error "candidates" "" { target *-*-* } 141 }
+// { dg-error "::auto_ptr" "" { target *-*-* } 271 }
diff --git a/libstdc++-v3/testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc b/libstdc++-v3/testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc
index 37c5a0346d1..baeb71e0072 100644
--- a/libstdc++-v3/testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc
@@ -30,8 +30,8 @@ namespace gnu
using std::has_nothrow_copy;
}
-// { dg-error "has not been declared" "" { target *-*-* } 27 }
-// { dg-error "has not been declared" "" { target *-*-* } 28 }
-// { dg-error "has not been declared" "" { target *-*-* } 29 }
-// { dg-error "has not been declared" "" { target *-*-* } 30 }
+// { dg-error "has not been declared" "" { xfail *-*-* } 27 }
+// { dg-error "has not been declared" "" { xfail *-*-* } 28 }
+// { dg-error "has not been declared" "" { xfail *-*-* } 29 }
+// { dg-error "has not been declared" "" { xfail *-*-* } 30 }
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
index 826e47ed3e8..0dea4ca073b 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
@@ -47,14 +47,9 @@ void test01()
typedef make_signed<const char>::type test22_type;
VERIFY( (is_same<test22_type, const signed char>::value) );
+#ifdef _GLIBCXX_USE_WCHAR_T
typedef make_signed<volatile wchar_t>::type test23_type;
VERIFY( (is_same<test23_type, volatile signed wchar_t>::value) );
-
-#if 0
- // XXX
- // When is_signed works for floating points types this should pass
- typedef make_signed<volatile float>::type test24_type;
- VERIFY( (is_same<test24_type, volatile int>::value) );
#endif
typedef make_signed<test_enum>::type test25_type;
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
new file mode 100644
index 00000000000..377d1d17758
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
@@ -0,0 +1,63 @@
+// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
+
+// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
+//
+// Copyright (C) 2007 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.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+
+enum test_enum { first_selection };
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using std::make_signed;
+ using std::is_same;
+
+ // Positive tests.
+ typedef make_signed<const int>::type test2_type;
+ VERIFY( (is_same<test2_type, const int>::value) );
+
+ typedef make_signed<const unsigned int>::type test21c_type;
+ VERIFY( (is_same<test21c_type, const signed int>::value) );
+
+ typedef make_signed<volatile unsigned int>::type test21v_type;
+ VERIFY( (is_same<test21v_type, volatile signed int>::value) );
+
+ typedef make_signed<const volatile unsigned int>::type test21cv_type;
+ VERIFY( (is_same<test21cv_type, const volatile signed int>::value) );
+
+ typedef make_signed<const char>::type test22_type;
+ VERIFY( (is_same<test22_type, const signed char>::value) );
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef make_signed<volatile wchar_t>::type test23_type;
+ VERIFY( (is_same<test23_type, volatile signed wchar_t>::value) );
+#endif
+
+ typedef make_signed<test_enum>::type test25_type;
+ VERIFY( (is_same<test25_type, short>::value) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index aa94f2a4708..063c12eb30b 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -39,15 +39,18 @@ void test01()
typedef void (fn_type) ();
typedef make_signed<fn_type>::type test4_type;
+
+ typedef make_signed<float>::type test5_type;
}
// { dg-error "does not name a type" "" { target *-*-* } 34 }
// { dg-error "instantiated from here" "" { target *-*-* } 36 }
// { dg-error "instantiated from here" "" { target *-*-* } 38 }
// { dg-error "instantiated from here" "" { target *-*-* } 41 }
+// { dg-error "instantiated from here" "" { target *-*-* } 43 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 320 }
-// { dg-error "declaration of" "" { target *-*-* } 268 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 291 }
+// { dg-error "declaration of" "" { target *-*-* } 253 }
// { dg-excess-errors "At global scope" }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
index b09d3e93aa4..1270729bedf 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
@@ -47,14 +47,9 @@ void test01()
typedef make_unsigned<const char>::type test22_type;
VERIFY( (is_same<test22_type, const unsigned char>::value) );
+#ifdef _GLIBCXX_USE_WCHAR_T
typedef make_unsigned<volatile wchar_t>::type test23_type;
VERIFY( (is_same<test23_type, volatile unsigned wchar_t>::value) );
-
-#if 0
- // XXX
- // When is_unsigned works for floating points types this should pass
- typedef make_unsigned<volatile float>::type test24_type;
- VERIFY( (is_same<test24_type, volatile unsigned int>::value) );
#endif
typedef make_unsigned<test_enum>::type test25_type;
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
new file mode 100644
index 00000000000..1715d36c44a
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
@@ -0,0 +1,63 @@
+// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
+
+// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
+//
+// Copyright (C) 2007 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.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+
+enum test_enum { first_selection };
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using std::make_unsigned;
+ using std::is_same;
+
+ // Positive tests.
+ typedef make_unsigned<const unsigned int>::type test2_type;
+ VERIFY( (is_same<test2_type, const unsigned int>::value) );
+
+ typedef make_unsigned<const signed int>::type test21c_type;
+ VERIFY( (is_same<test21c_type, const unsigned int>::value) );
+
+ typedef make_unsigned<volatile signed int>::type test21v_type;
+ VERIFY( (is_same<test21v_type, volatile unsigned int>::value) );
+
+ typedef make_unsigned<const volatile signed int>::type test21cv_type;
+ VERIFY( (is_same<test21cv_type, const volatile unsigned int>::value) );
+
+ typedef make_unsigned<const char>::type test22_type;
+ VERIFY( (is_same<test22_type, const unsigned char>::value) );
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef make_unsigned<volatile wchar_t>::type test23_type;
+ VERIFY( (is_same<test23_type, volatile unsigned wchar_t>::value) );
+#endif
+
+ typedef make_unsigned<test_enum>::type test25_type;
+ VERIFY( (is_same<test25_type, unsigned short>::value) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index cc07d616954..79277a7b0c6 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -39,14 +39,17 @@ void test01()
typedef void (fn_type) ();
typedef make_unsigned<fn_type>::type test4_type;
+
+ typedef make_unsigned<float>::type test5_type;
}
// { dg-error "does not name a type" "" { target *-*-* } 34 }
// { dg-error "instantiated from here" "" { target *-*-* } 36 }
// { dg-error "instantiated from here" "" { target *-*-* } 38 }
// { dg-error "instantiated from here" "" { target *-*-* } 41 }
+// { dg-error "instantiated from here" "" { target *-*-* } 43 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 223 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 208 }
// { dg-error "declaration of" "" { target *-*-* } 170 }
// { dg-excess-errors "At global scope" }
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc
index 70b25ed8624..783f9cdcf59 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc
@@ -1,6 +1,7 @@
// 1999-05-11 bkoz
-// Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -21,6 +22,7 @@
// 21.3.3 string capacity
#include <string>
+#include <cstring>
#include <testsuite_hooks.h>
template<typename T>
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc
index 128add3fbb5..afa726dc675 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc
@@ -1,6 +1,8 @@
// 980930 bkoz work with libstdc++v3
-// Copyright (C) 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -31,6 +33,7 @@
// things would be sorted in a dictionary.
#include <string>
+#include <cstring>
#include <testsuite_hooks.h>
enum want_value {lt=0, z=1, gt=2};
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/typedefs/char/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc
index 5373d6a4be3..333142018e4 100644
--- a/libstdc++-v3/testsuite/21_strings/char_traits/typedefs/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc
@@ -1,7 +1,9 @@
+// { dg-do compile }
+// { dg-options "-ansi -pedantic-errors" }
// 2001-02-11 gdr
// Origin: Craig Rodrigues <rodrigc@mediaone.net>
-// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -25,10 +27,17 @@
int main()
{
+ // Check for required typedefs.
+ typedef std::char_traits<char> test_type;
+ typedef test_type::char_type char_type;
+ typedef test_type::int_type int_type;
+ typedef test_type::off_type off_type;
+ typedef test_type::pos_type pos_type;
+ typedef test_type::state_type state_type;
+
// 21.1.3: char_traits<char>::int_type == int
- // dg-options -ansi -pedantic-err
- std::char_traits<char>::int_type* p = 0;
- int* q __attribute__((unused)) = p; // dg-do compile
+ test_type::int_type* p = 0;
+ int* q __attribute__((unused)) = p;
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc
index dd2283cbe29..3a0394daf1f 100644
--- a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc
@@ -1,7 +1,8 @@
// 1999-06-03 bkoz
// 2003-07-22 Matt Austern
-// Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -25,6 +26,7 @@
// satisfy the requirements of 21.1.1.
#include <string>
+#include <cstring>
#include <testsuite_hooks.h>
void test02(void)
@@ -139,7 +141,7 @@ void test02(void)
// short* X::assign(short* s, size_t n, short c)
len = sizeof(array2) / sizeof(short);
- memset(array2, 0xaf, len * sizeof(short));
+ std::memset(array2, 0xaf, len * sizeof(short));
VERIFY( array2[0] != 0x15a8 );
pc1 = std::char_traits<short>::assign (array2, len, 0x15a8);
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc
new file mode 100644
index 00000000000..6026eac89af
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc
@@ -0,0 +1,43 @@
+// { dg-do compile }
+// { dg-options "-ansi -pedantic-errors" }
+// 2001-02-11 gdr
+// Origin: Craig Rodrigues <rodrigc@mediaone.net>
+
+// Copyright (C) 2001, 2003, 2007 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.
+
+// 21.1.2: char_traits typedefs
+
+#include <string>
+
+int main()
+{
+ // Check for required typedefs.
+ typedef std::char_traits<wchar_t> test_type;
+ typedef test_type::char_type char_type;
+ typedef test_type::int_type int_type;
+ typedef test_type::off_type off_type;
+ typedef test_type::pos_type pos_type;
+ typedef test_type::state_type state_type;
+
+ // 21.1.3: char_traits<wchar_t>::int_type == wint_t
+ test_type::int_type* p = 0;
+ wint_t* q __attribute__((unused)) = p;
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc
index 7881eb7d49e..b51855234d1 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc
index 927e7f0db3d..6b41d24c0df 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc
index 0eaadcc6d36..a784ee044a2 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc
index c75e4a89821..efbb14ddb1e 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003, 2006 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
index 1ee107512f4..404504658a1 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
index 0fb4f491099..34a57e7c9d6 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc
index 65b9a7b38c7..6633540704e 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/5.cc
index 25b95667991..cf267543fee 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/5.cc
@@ -1,6 +1,6 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2006 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/6.cc
index 79cd9828f35..699a70f51f8 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/6.cc
@@ -1,6 +1,6 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2006 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc
index 26c47cdbc78..8b587e9ac55 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc
index b0e5d02fab2..dddee2c3b78 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc
index 71cc6caeee2..f1f06f594f1 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc
index c62cf0e6cbd..502bf2a74c8 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
index 03c07a0b22d..2bee2455d7c 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
index d8e1d1efad5..adb99d6367b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc
index 85eb97013b2..1c42a218781 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/5.cc
index d8da6e3bdfa..9df9bb5aeba 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/5.cc
@@ -1,6 +1,6 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/6.cc
index 081feb790df..5a777703d57 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/6.cc
@@ -1,6 +1,6 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc
index f32b26502eb..c39d3947db3 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc
index 57565b7e3ba..f17eb5e7991 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc
index 4993718dce7..efef386bbba 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc
index 454d5a98721..1e3914b9445 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
index ad1799b01a7..ae79679573e 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
index 59da76c4251..c0edc46bacc 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc
index f85a296e642..71ab8c6fa38 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/5.cc
index 8038796e00d..faac58fafc1 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/5.cc
@@ -1,6 +1,6 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/6.cc
index 45c0035a552..a92582096c3 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/6.cc
@@ -1,6 +1,6 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
index a8e369a579f..131a8d5d304 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc
index 2853c431d20..cb3ec744e56 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/1.cc
index 0faa76f5263..60b167f7542 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/1.cc
@@ -1,6 +1,7 @@
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
index 9630a7a66fc..2b2921c475b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
index dc1de83ba01..19886d56deb 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc
index cea86ea38e3..71f09f5a3a4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc
@@ -2,7 +2,7 @@
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
diff --git a/libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc b/libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc
index 0b194c50b4b..42852af3317 100644
--- a/libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc
@@ -2,7 +2,8 @@
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2005 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +24,7 @@
// 22.2.4.2 Template class collate_byname
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/19955.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/19955.cc
index 9f944cc1dfb..37cd76e1c1f 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/19955.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/19955.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 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
@@ -28,6 +28,7 @@
// 22.2.1.3.2 ctype<char> members
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
class Ctype1
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc
index a1e41d86b71..dce0d951c4d 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc
@@ -1,6 +1,6 @@
// 2002-05-10 ghazi
-// Copyright (C) 2002 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2007 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
@@ -47,7 +47,6 @@ class gnu_ctype: public std::ctype<char_type> { };
VERIFY(gctype.scan_not((MASK), (STRING), \
(STRING) + traits_type::length(STRING)) == (EXPECTED))
-#ifdef _GLIBCXX_USE_WCHAR_T
// Sanity check scan_is() and scan_not().
void test01()
{
@@ -341,12 +340,9 @@ void test01()
VERIFY_SCAN_NOT (std::ctype_base::upper, p2, p2);
VERIFY_SCAN_NOT (std::ctype_base::xdigit, p2, p2);
}
-#endif
int main()
{
-#ifdef _GLIBCXX_USE_WCHAR_T
test01();
-#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
index 85610958894..08b53aab371 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
@@ -24,6 +24,7 @@
// 22.1.1.2 locale constructors and destructors [lib.locale.cons]
#include <cwchar> // for mbstate_t
+#include <cstring>
#include <cstdlib>
#include <locale>
#include <stdexcept>
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc
index 71fae508ab1..d22179d8156 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc
@@ -20,6 +20,12 @@
// 22.2.2.2.1 num_put members
+// On Solaris 10 x86, this test crashes in libc. Inside libstdc++,
+// we call sprintf like so:
+// sprintf (buffer, "%.*f", 1000, 1.0)
+// which crashes.
+// { dg-do run { xfail { i?86*-*-solaris2.10 } } }
+
#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/14220.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/14220.cc
index 8e4a86051de..c880e1e51b8 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/14220.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/14220.cc
@@ -24,6 +24,12 @@
#include <sstream>
#include <testsuite_hooks.h>
+// On Solaris 10 x86, this test crashes in libc. Inside libstdc++,
+// we call sprintf like so:
+// sprintf (buffer, "%.*f", 1000, 1.0)
+// which crashes.
+// { dg-do run { xfail { i?86*-*-solaris2.10 } } }
+
// libstdc++/14220
void test01()
{
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 b850c71cf84..79e339d3841 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 match" "" { target *-*-* } 620 }
+// { dg-error "no match" "" { target *-*-* } 622 }
// { 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 194da7342a4..bcc4f4755cc 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 match" "" { target *-*-* } 620 }
+// { dg-error "no match" "" { target *-*-* } 622 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/2.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/2.cc
index 333ad1ee30a..191143fe6d9 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/2.cc
@@ -1,6 +1,6 @@
// 2006-03-20 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -21,6 +21,7 @@
#include <iterator>
#include <sstream>
#include <algorithm>
+#include <cstring>
#include <testsuite_hooks.h>
// In the occasion of libstdc++/25482
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
index 2af78d5415b..378583ac83c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
@@ -1,6 +1,6 @@
// 2006-03-20 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -21,6 +21,7 @@
#include <iterator>
#include <fstream>
#include <algorithm>
+#include <cstring>
#include <testsuite_hooks.h>
// In the occasion of libstdc++/25482
diff --git a/libstdc++-v3/testsuite/25_algorithms/unique_copy/2.cc b/libstdc++-v3/testsuite/25_algorithms/unique_copy/2.cc
index 13500916542..2c67cee1e60 100644
--- a/libstdc++-v3/testsuite/25_algorithms/unique_copy/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/unique_copy/2.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -19,6 +19,7 @@
// 25.2.8 [lib.alg.unique]
#include <algorithm>
+#include <functional>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/complex_inserters_extractors.cc b/libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/char/1.cc
index c9333f561af..9253f3ac61c 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex/complex_inserters_extractors.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/char/1.cc
@@ -137,7 +137,3 @@ main()
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/wchar_t/1.cc b/libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/wchar_t/1.cc
new file mode 100644
index 00000000000..d49b2e6f5c3
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/complex/inserters_extractors/wchar_t/1.cc
@@ -0,0 +1,137 @@
+// Copyright (C) 2007 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 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.
+
+
+#include <iostream>
+#include <string>
+#include <sstream>
+#include <complex>
+#include <testsuite_hooks.h>
+#include <cmath>
+
+template<typename R>
+inline bool flteq(R x, R y)
+{
+ if (x == R(0)) return y == R(0);
+ else return std::fabs(x-y) < 1e-6*std::fabs(x);
+}
+
+template<typename R>
+int
+test_good(std::wstring str, R x, R y)
+{
+ bool test __attribute__((unused)) = true;
+ std::complex<R> z;
+ wchar_t ch;
+ std::wistringstream iss(str);
+ iss >> z >> ch;
+ VERIFY( iss.good() );
+ VERIFY( flteq(z.real(), x) );
+ VERIFY( flteq(z.imag(), y) );
+ VERIFY( ch == L'#' );
+ return 0;
+}
+
+template<typename R>
+int
+test_fail(std::wstring str)
+{
+ bool test __attribute__((unused)) = true;
+ std::complex<R> z;
+ std::wistringstream iss(str);
+ iss >> z;
+ VERIFY( iss.fail() && !iss.bad() );
+ return 0;
+}
+
+template<typename R>
+int
+testall()
+{
+ test_good<R>(L"(-1.1,3.7)#", -1.1, 3.7);
+ test_good<R>(L"( .7e6 , \n-3.1)#", .7e6, -3.1);
+ test_good<R>(L"(\t0,-1)#", 0.0, -1.0);
+ test_good<R>(L"(-3.14)#", -3.14, 0.0);
+ test_good<R>(L"-.1#", -.1, 0.0);
+ test_good<R>(L" ( -2.7e3 )#", -2.7e3, 0.0);
+ test_good<R>(L" -.1#", -.1, 0.0);
+ test_fail<R>(L"(a,1)");
+ test_fail<R>(L"(,1)");
+ test_fail<R>(L"(1,a)");
+ test_fail<R>(L"(1, )");
+ test_fail<R>(L"|1,1)");
+ test_fail<R>(L"(1|1)");
+ test_fail<R>(L"(1,1|");
+ return 0;
+}
+
+// libstdc++/2970
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ complex<float> cf01(-1.1, -333.2);
+ wstringstream ss;
+ ss << cf01;
+ wstring str = ss.str();
+ VERIFY( str == L"(-1.1,-333.2)" );
+}
+
+// libstdc++/2985
+struct gnu_char_traits : public std::char_traits<wchar_t>
+{ };
+
+typedef std::basic_ostringstream<wchar_t, gnu_char_traits> gnu_sstream;
+template class std::basic_string<wchar_t, gnu_char_traits,
+ std::allocator<wchar_t> >;
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ // Construct locale with specialized facets.
+ typedef gnu_sstream::__num_put_type numput_type;
+ typedef gnu_sstream::__num_get_type numget_type;
+ std::locale loc_c = std::locale::classic();
+ std::locale loc_1(loc_c, new numput_type);
+ std::locale loc_2(loc_1, new numget_type);
+ VERIFY( std::has_facet<numput_type>(loc_2) );
+ VERIFY( std::has_facet<numget_type>(loc_2) );
+
+ gnu_sstream sstr;
+ sstr.imbue(loc_2);
+
+
+ std::complex<double> x(3, 4);
+ sstr << x;
+ VERIFY( sstr.str() == L"(3,4)" );
+}
+
+int
+main()
+{
+ testall<float>();
+ testall<double>();
+ testall<long double>();
+
+ test01();
+ test02();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc
new file mode 100644
index 00000000000..78343129fb2
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc
@@ -0,0 +1,74 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007 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.
+
+#include <cmath>
+
+namespace gnu
+{
+ // C++0x changes from TR1.
+ using std::assoc_laguerre;
+ using std::assoc_legendre;
+ using std::beta;
+ using std::comp_ellint_1;
+ using std::comp_ellint_2;
+ using std::comp_ellint_3;
+ using std::conf_hyperg;
+ using std::cyl_bessel_i;
+ using std::cyl_bessel_j;
+ using std::cyl_bessel_k;
+ using std::cyl_neumann;
+ using std::ellint_1;
+ using std::ellint_2;
+ using std::ellint_3;
+ using std::expint;
+ using std::hermite;
+ using std::hyperg;
+ using std::laguerre;
+ using std::legendre;
+ using std::riemann_zeta;
+ using std::sph_bessel;
+ using std::sph_legendre;
+ using std::sph_neumann;
+}
+
+// { dg-error "has not been declared" "" { target *-*-* } 27 }
+// { dg-error "has not been declared" "" { target *-*-* } 28 }
+// { dg-error "has not been declared" "" { target *-*-* } 29 }
+// { dg-error "has not been declared" "" { target *-*-* } 30 }
+// { dg-error "has not been declared" "" { target *-*-* } 31 }
+// { dg-error "has not been declared" "" { target *-*-* } 32 }
+// { dg-error "has not been declared" "" { target *-*-* } 33 }
+// { dg-error "has not been declared" "" { target *-*-* } 34 }
+// { dg-error "has not been declared" "" { target *-*-* } 35 }
+// { dg-error "has not been declared" "" { target *-*-* } 36 }
+// { dg-error "has not been declared" "" { target *-*-* } 37 }
+// { dg-error "has not been declared" "" { target *-*-* } 38 }
+// { dg-error "has not been declared" "" { target *-*-* } 39 }
+// { dg-error "has not been declared" "" { target *-*-* } 40 }
+// { dg-error "has not been declared" "" { target *-*-* } 41 }
+// { dg-error "has not been declared" "" { target *-*-* } 42 }
+// { dg-error "has not been declared" "" { target *-*-* } 43 }
+// { dg-error "has not been declared" "" { target *-*-* } 44 }
+// { dg-error "has not been declared" "" { target *-*-* } 45 }
+// { dg-error "has not been declared" "" { target *-*-* } 46 }
+// { dg-error "has not been declared" "" { target *-*-* } 47 }
+// { dg-error "has not been declared" "" { target *-*-* } 48 }
+// { dg-error "has not been declared" "" { target *-*-* } 49 }
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
index f69d24c9446..a9eb009a59d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
@@ -1,6 +1,7 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -23,6 +24,7 @@
// { dg-require-fileio "" }
#include <fstream>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
index 1bb1a7aa70c..af1f2617b0d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
@@ -1,6 +1,7 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -23,6 +24,7 @@
// { dg-require-fileio "" }
#include <fstream>
+#include <cstring>
#include <testsuite_hooks.h>
void test03()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc
index ca6ca4f1386..6c79f900afc 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc
@@ -32,6 +32,7 @@
#include <sstream>
#include <typeinfo>
+#include <cstring>
#include <testsuite_hooks.h>
// char_traits specialization
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/4.cc
index 95f22894cb5..fcfd11f7cc2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/4.cc
@@ -26,6 +26,7 @@
#include <string>
#include <fstream>
#include <cstdlib>
+#include <cstring>
#include <testsuite_hooks.h>
using namespace std;
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
index cdada7b16d7..85f8dcf0a5d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
@@ -1,6 +1,7 @@
// 1999-10-11 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -30,6 +31,7 @@
// 27.5.2 template class basic_streambuf
#include <streambuf>
+#include <cstring>
#include <testsuite_hooks.h>
class testbuf : public std::streambuf
@@ -94,7 +96,7 @@ void test01()
bool test __attribute__((unused)) = true;
char lit01[52];
- strcpy(lit01, "chicago underground trio/possible cube on delmark");
+ std::strcpy(lit01, "chicago underground trio/possible cube on delmark");
testbuf buf01;
// pbackfail
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
index b4b42edf532..ca3f919a823 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
@@ -1,6 +1,7 @@
// 1999-10-11 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -30,6 +31,7 @@
// 27.5.2 template class basic_streambuf
#include <streambuf>
+#include <cstring>
#include <testsuite_hooks.h>
class testbuf : public std::streambuf
@@ -94,7 +96,7 @@ void test01()
bool test __attribute__((unused)) = true;
char lit01[52];
- strcpy(lit01, "chicago underground trio/possible cube on delmark");
+ std::strcpy(lit01, "chicago underground trio/possible cube on delmark");
testbuf buf01;
// 27.5.2.3.1 get area
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
index 6f7abe94924..bf51095e4a8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
@@ -1,6 +1,6 @@
// 1999-10-11 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -31,6 +31,7 @@
// 27.5.2 template class basic_streambuf
#include <streambuf>
+#include <cstring>
#include <testsuite_hooks.h>
class testbuf : public std::streambuf
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
index 204323f740f..b63ad4489cd 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
@@ -1,6 +1,7 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
#include <streambuf>
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
class MyTraits : public std::char_traits<char>
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
index 1651f3cf98d..ebaa7af5df6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
@@ -1,6 +1,6 @@
// 1999-10-11 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -31,6 +31,7 @@
// 27.5.2 template class basic_streambuf
#include <streambuf>
+#include <cstring>
#include <testsuite_hooks.h>
class testbuf : public std::streambuf
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc
index 4f6a4915b57..3af81031434 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc
@@ -1,6 +1,6 @@
// 1999-10-11 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -32,6 +32,7 @@
#include <streambuf>
#include <cwchar>
+#include <cstring>
#include <testsuite_hooks.h>
class testbuf : public std::wstreambuf
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc
index 87baa2dd491..b267a3756ba 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc
@@ -1,6 +1,7 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -21,6 +22,7 @@
// 27.8.1.4 Overridden virtual functions
#include <sstream>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc
index 4a406cabea5..d31cc70d217 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc
@@ -1,6 +1,7 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -21,6 +22,7 @@
// 27.8.1.4 Overridden virtual functions
#include <sstream>
+#include <cstring>
#include <testsuite_hooks.h>
void test02()
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/4.cc
index d6d1a5d4f37..dc9995e4603 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/4.cc
@@ -1,6 +1,6 @@
// 2004-10-06 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007 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
@@ -21,6 +21,7 @@
// 27.8.1.4 Overridden virtual functions
#include <sstream>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/1.cc b/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/1.cc
index cb07381ea55..6240a381537 100644
--- a/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/1.cc
@@ -1,6 +1,7 @@
// 1999-09-20 bkoz
-// Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -31,6 +32,7 @@
#include <cwchar> // for mbstate_t
#include <ios>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
@@ -55,7 +57,7 @@ void test01()
// place.
pos01.state(state02);
state01 = pos01.state();
- test = memcmp(&state01, &state02, sizeof(state_type)) == 0;
+ test = std::memcmp(&state01, &state02, sizeof(state_type)) == 0;
VERIFY( test );
}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
index 0677a43848c..fddb0b25a69 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
@@ -2,7 +2,7 @@
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 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
@@ -22,6 +22,7 @@
#include <iostream>
#include <cstdio>
+#include <cstring>
#include <testsuite_hooks.h>
// Test handling of UTF-8 in wcin
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc
index 96beecba8cc..7f09694798d 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc
@@ -2,7 +2,7 @@
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 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
@@ -22,6 +22,7 @@
#include <iostream>
#include <cstdio>
+#include <cstring>
#include <testsuite_hooks.h>
// Test handling of UTF-8 in wcout
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc
index 60106508e2d..b4be3f3cda0 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc
@@ -2,7 +2,7 @@
// 2003-09-04 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 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
@@ -27,6 +27,7 @@
#include <iostream>
#include <cstdio>
+#include <cstring>
#include <testsuite_hooks.h>
// Test handling of UTF-8 in wcout
diff --git a/libstdc++-v3/testsuite/ext/codecvt/1.cc b/libstdc++-v3/testsuite/ext/codecvt/1.cc
index 2e3fb746bef..d5884cbabdb 100644
--- a/libstdc++-v3/testsuite/ext/codecvt/1.cc
+++ b/libstdc++-v3/testsuite/ext/codecvt/1.cc
@@ -2,7 +2,7 @@
// { dg-require-iconv "ISO-8859-15" }
// 2003-02-06 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2007 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +23,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
#include <ext/codecvt_specializations.h>
diff --git a/libstdc++-v3/testsuite/ext/codecvt/char-1.cc b/libstdc++-v3/testsuite/ext/codecvt/char-1.cc
index 507d7136ee7..c428eedcedb 100644
--- a/libstdc++-v3/testsuite/ext/codecvt/char-1.cc
+++ b/libstdc++-v3/testsuite/ext/codecvt/char-1.cc
@@ -3,7 +3,8 @@
// 2000-08-22 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2001, 2002, 2003, 2007 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +24,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
#include <ext/codecvt_specializations.h>
diff --git a/libstdc++-v3/testsuite/ext/codecvt/char-2.cc b/libstdc++-v3/testsuite/ext/codecvt/char-2.cc
index 19e28aa024b..2916048419a 100644
--- a/libstdc++-v3/testsuite/ext/codecvt/char-2.cc
+++ b/libstdc++-v3/testsuite/ext/codecvt/char-2.cc
@@ -3,7 +3,8 @@
// 2000-08-22 Benjamin Kosnik <bkoz@cygnus.com>
-// Copyright (C) 2000, 2001, 2002, 2003, 2007 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +24,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
+#include <cstring>
#include <testsuite_hooks.h>
#include <ext/codecvt_specializations.h>
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc
index 1c448311047..45d4f1e8031 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -20,6 +21,7 @@
#include <cstdio>
#include <fstream>
+#include <cstring>
#include <ext/stdio_filebuf.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/2.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/2.cc
index 8ac0dc8a742..a351f913c94 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/2.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/2.cc
@@ -1,6 +1,6 @@
// 2003-04-12 Paolo Carlini <pcarlini at unitus dot it>
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -25,6 +25,7 @@
#include <ext/stdio_filebuf.h>
#include <cstdio>
#include <fstream>
+#include <cstring>
#include <testsuite_hooks.h>
// Small stack-based buffers (i.e., using _M_unbuf) were not flushed
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/1.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/1.cc
index 41f5acca5d5..7b37aa1bb4c 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/1.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/1.cc
@@ -1,6 +1,6 @@
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
// { dg-require-fileio "" }
#include <ext/stdio_sync_filebuf.h>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc
index 0da20bea79c..a9ef935dd61 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc
@@ -1,6 +1,6 @@
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
-// Copyright (C) 2003, 2006 Free Software Foundation
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -19,6 +19,7 @@
// USA.
#include <ext/stdio_sync_filebuf.h>
+#include <cstring>
#include <testsuite_hooks.h>
void test01()
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 70f2cb6f3d2..7a27ad1977d 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -398,13 +398,24 @@ proc v3_target_compile_as_c { source dest type options } {
# the includes variable is not likely to include the necessary
# info.
if { ![file exists $flags_file] } {
+ # ??? We need a --print-include-dirs option to GCC, so that
+ # we can avoid these hacks. The heuristics here will not
+ # work with non-standard --with-includedir= options.
set version [remote_exec host ${cc} -dumpversion]
- set version [lindex $version 1]
- set machine [remote_exec exec ${cc} -dumpmachine]
- set machine [lindex $machine 1]
+ # Remove the trailing newline from the output.
+ set version [string trimright [lindex $version 1]]
+ set machine [remote_exec host ${cc} -dumpmachine]
+ set machine [string trimright [lindex $machine 1]]
set comp_base_dir [remote_exec host ${cc} --print-prog-name=cc1]
set comp_base_dir [lindex $comp_base_dir 1]
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname $comp_base_dir]]]]]
+ # For a cross compiler, the header files will be located in a
+ # machine-specific subdirectory.
+ set crossbase "${comp_base_dir}/${machine}/include/c++/${version}"
+ set crosstarget "${crossbase}/${machine}"
+ set cc_final [concat $cc_final "-I$crossbase -I$crosstarget"]
+ # For a native compiler, the header files will be located at
+ # the top level.
set includesbase "${comp_base_dir}/include/c++/${version}"
set includestarget "${includesbase}/${machine}"
set cc_final [concat $cc_final "-I$includesbase -I$includestarget"]
diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc
index e120e520355..0f49f4d6594 100644
--- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc
+++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc
@@ -1,4 +1,5 @@
// { dg-require-c-std "" }
+// { dg-options "-mieee" { target sh*-*-* } }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index ffd88c41d76..64c90118821 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -193,6 +193,7 @@ check_version(symbol& test, bool added)
known_versions.push_back("GLIBCXX_LDBL_3.4.7");
known_versions.push_back("CXXABI_1.3");
known_versions.push_back("CXXABI_1.3.1");
+ known_versions.push_back("CXXABI_1.3.2");
known_versions.push_back("CXXABI_LDBL_1.3");
}
compat_list::iterator begin = known_versions.begin();
diff --git a/libstdc++-v3/testsuite/util/testsuite_io.h b/libstdc++-v3/testsuite/util/testsuite_io.h
index e6f1c03d622..2dc3caded63 100644
--- a/libstdc++-v3/testsuite/util/testsuite_io.h
+++ b/libstdc++-v3/testsuite/util/testsuite_io.h
@@ -1,7 +1,7 @@
// -*- C++ -*-
// Testing streambuf/filebuf/stringbuf for the C++ library testsuite.
//
-// Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -31,8 +31,7 @@
#ifndef _GLIBCXX_TESTSUITE_IO_H
#define _GLIBCXX_TESTSUITE_IO_H
-#include <fstream>
-#include <sstream>
+#include <ios>
namespace __gnu_test
{
diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index 7119783c93b..073be0beb94 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -1,7 +1,7 @@
// -*- C++ -*-
// Iterator Wrappers for the C++ library testsuite.
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007 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
@@ -37,7 +37,7 @@
// test_container, which is given two pointers to T and an iterator type.
#include <testsuite_hooks.h>
-#include <iterator>
+#include <bits/stl_iterator_base_types.h>
#ifndef _TESTSUITE_ITERATORS
#define _TESTSUITE_ITERATORS