aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2009-09-25 20:51:40 +0000
committerCary Coutant <ccoutant@google.com>2009-09-25 20:51:40 +0000
commit90ff80ffce47736ab7319058a44a0704a7fdb31e (patch)
tree3de65ba61f89a48c0ec028672acb475ea3f1819b
parentebd9739bcfd2dc4c6409fb0b96d95894191b2c28 (diff)
Merged revisions 151950:152181 from trunk.dwarf4
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/dwarf4@152186 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog21
-rw-r--r--MAINTAINERS3
-rw-r--r--Makefile.in2
-rw-r--r--Makefile.tpl2
-rwxr-xr-xconfig.guess121
-rwxr-xr-xconfig.sub10
-rwxr-xr-xconfigure5
-rw-r--r--configure.ac5
-rw-r--r--gcc/ChangeLog779
-rw-r--r--gcc/ChangeLog.dwarf48
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/ada/ChangeLog59
-rw-r--r--gcc/ada/gcc-interface/Makefile.in2
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h7
-rw-r--r--gcc/ada/gcc-interface/ada.h6
-rw-r--r--gcc/ada/gcc-interface/decl.c102
-rw-r--r--gcc/ada/gcc-interface/gigi.h34
-rw-r--r--gcc/ada/gcc-interface/misc.c5
-rw-r--r--gcc/ada/gcc-interface/trans.c174
-rw-r--r--gcc/ada/gcc-interface/utils.c259
-rw-r--r--gcc/ada/gcc-interface/utils2.c68
-rw-r--r--gcc/alias.c12
-rw-r--r--gcc/builtins.c61
-rw-r--r--gcc/c-common.c25
-rw-r--r--gcc/c-common.h1
-rw-r--r--gcc/c-decl.c7
-rw-r--r--gcc/c-parser.c5
-rw-r--r--gcc/c-typeck.c1
-rw-r--r--gcc/calls.c16
-rw-r--r--gcc/cfgexpand.c59
-rw-r--r--gcc/common.opt8
-rw-r--r--gcc/config.gcc5
-rw-r--r--gcc/config/alpha/alpha.c88
-rw-r--r--gcc/config/alpha/alpha.h29
-rw-r--r--gcc/config/alpha/alpha.md2
-rw-r--r--gcc/config/alpha/vms.h20
-rw-r--r--gcc/config/arc/arc.c41
-rw-r--r--gcc/config/arc/arc.h33
-rw-r--r--gcc/config/arm/arm.c88
-rw-r--r--gcc/config/arm/arm.h91
-rw-r--r--gcc/config/avr/avr.c5
-rw-r--r--gcc/config/avr/avr.h11
-rw-r--r--gcc/config/bfin/bfin-protos.h1
-rw-r--r--gcc/config/bfin/bfin.c71
-rw-r--r--gcc/config/bfin/bfin.h24
-rw-r--r--gcc/config/cris/cris.c105
-rw-r--r--gcc/config/cris/cris.h99
-rw-r--r--gcc/config/crx/crx.h5
-rw-r--r--gcc/config/darwin.c5
-rw-r--r--gcc/config/darwin.h4
-rw-r--r--gcc/config/darwin10.h25
-rw-r--r--gcc/config/fr30/fr30.c51
-rw-r--r--gcc/config/fr30/fr30.h36
-rw-r--r--gcc/config/freebsd-spec.h9
-rw-r--r--gcc/config/frv/frv-protos.h1
-rw-r--r--gcc/config/frv/frv.c10
-rw-r--r--gcc/config/frv/frv.h7
-rw-r--r--gcc/config/h8300/h8300.c53
-rw-r--r--gcc/config/h8300/h8300.h49
-rw-r--r--gcc/config/i386/cygming.h2
-rw-r--r--gcc/config/i386/cygwin.h4
-rw-r--r--gcc/config/i386/i386.c306
-rw-r--r--gcc/config/i386/i386.h51
-rw-r--r--gcc/config/i386/mingw32.h4
-rw-r--r--gcc/config/ia64/ia64-protos.h1
-rw-r--r--gcc/config/ia64/ia64.c53
-rw-r--r--gcc/config/ia64/ia64.h30
-rw-r--r--gcc/config/iq2000/iq2000.c50
-rw-r--r--gcc/config/iq2000/iq2000.h40
-rw-r--r--gcc/config/m32c/m32c-protos.h1
-rw-r--r--gcc/config/m32c/m32c.c18
-rw-r--r--gcc/config/m32c/m32c.h4
-rw-r--r--gcc/config/m32r/m32r.c35
-rw-r--r--gcc/config/m32r/m32r.h32
-rw-r--r--gcc/config/m68hc11/m68hc11-protos.h2
-rw-r--r--gcc/config/m68hc11/m68hc11.c46
-rw-r--r--gcc/config/m68hc11/m68hc11.h9
-rw-r--r--gcc/config/m68k/m68k.c50
-rw-r--r--gcc/config/m68k/m68k.h14
-rw-r--r--gcc/config/m68k/netbsd-elf.h34
-rw-r--r--gcc/config/mcore/mcore.c49
-rw-r--r--gcc/config/mcore/mcore.h30
-rw-r--r--gcc/config/mep/mep-protos.h1
-rw-r--r--gcc/config/mep/mep.c12
-rw-r--r--gcc/config/mep/mep.h4
-rw-r--r--gcc/config/mips/mips.c65
-rw-r--r--gcc/config/mips/mips.h60
-rw-r--r--gcc/config/mmix/mmix-protos.h3
-rw-r--r--gcc/config/mmix/mmix.c53
-rw-r--r--gcc/config/mmix/mmix.h9
-rw-r--r--gcc/config/mn10300/mn10300.c42
-rw-r--r--gcc/config/mn10300/mn10300.h24
-rw-r--r--gcc/config/moxie/moxie.c56
-rw-r--r--gcc/config/moxie/moxie.h36
-rw-r--r--gcc/config/netbsd.h2
-rw-r--r--gcc/config/pa/pa-protos.h1
-rw-r--r--gcc/config/pa/pa.c189
-rw-r--r--gcc/config/pa/pa.h168
-rw-r--r--gcc/config/pdp11/pdp11.c32
-rw-r--r--gcc/config/pdp11/pdp11.h33
-rw-r--r--gcc/config/picochip/picochip-protos.h2
-rw-r--r--gcc/config/picochip/picochip.c16
-rw-r--r--gcc/config/picochip/picochip.h15
-rw-r--r--gcc/config/rs6000/predicates.md4
-rw-r--r--gcc/config/rs6000/rs6000-protos.h2
-rw-r--r--gcc/config/rs6000/rs6000.c81
-rw-r--r--gcc/config/rs6000/rs6000.h22
-rw-r--r--gcc/config/rs6000/rs6000.md2
-rw-r--r--gcc/config/rs6000/vsx.md86
-rw-r--r--gcc/config/s390/s390-protos.h2
-rw-r--r--gcc/config/s390/s390.c31
-rw-r--r--gcc/config/s390/s390.h10
-rw-r--r--gcc/config/score/score-protos.h1
-rw-r--r--gcc/config/score/score.c28
-rw-r--r--gcc/config/score/score.h44
-rw-r--r--gcc/config/score/score3.c41
-rw-r--r--gcc/config/score/score3.h3
-rw-r--r--gcc/config/score/score7.c38
-rw-r--r--gcc/config/score/score7.h3
-rw-r--r--gcc/config/sh/sh-protos.h1
-rw-r--r--gcc/config/sh/sh.c26
-rw-r--r--gcc/config/sh/sh.h17
-rw-r--r--gcc/config/sparc/sparc-protos.h3
-rw-r--r--gcc/config/sparc/sparc.c58
-rw-r--r--gcc/config/sparc/sparc.h10
-rw-r--r--gcc/config/sparc/sparc.md1
-rw-r--r--gcc/config/spu/spu-protos.h3
-rw-r--r--gcc/config/spu/spu.c30
-rw-r--r--gcc/config/spu/spu.h4
-rw-r--r--gcc/config/stormy16/stormy16.c27
-rw-r--r--gcc/config/stormy16/stormy16.h5
-rw-r--r--gcc/config/t-freebsd5
-rw-r--r--gcc/config/v850/v850.c55
-rw-r--r--gcc/config/v850/v850.h31
-rw-r--r--gcc/config/vax/vax.c49
-rw-r--r--gcc/config/vax/vax.h34
-rw-r--r--gcc/config/xtensa/xtensa-protos.h2
-rw-r--r--gcc/config/xtensa/xtensa.c41
-rw-r--r--gcc/config/xtensa/xtensa.h18
-rw-r--r--gcc/cp/ChangeLog36
-rw-r--r--gcc/cp/cp-lang.c9
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/decl.c16
-rw-r--r--gcc/cp/lex.c5
-rw-r--r--gcc/cp/method.c4
-rw-r--r--gcc/cp/pt.c53
-rw-r--r--gcc/crtstuff.c9
-rw-r--r--gcc/df-scan.c44
-rw-r--r--gcc/doc/install.texi9
-rw-r--r--gcc/doc/invoke.texi16
-rw-r--r--gcc/doc/tm.texi105
-rw-r--r--gcc/dwarf2out.c459
-rw-r--r--gcc/emit-rtl.c24
-rw-r--r--gcc/expr.h2
-rw-r--r--gcc/final.c58
-rw-r--r--gcc/fold-const.c71
-rw-r--r--gcc/fortran/ChangeLog16
-rw-r--r--gcc/fortran/error.c6
-rw-r--r--gcc/fortran/parse.c5
-rw-r--r--gcc/fortran/simplify.c12
-rw-r--r--gcc/function.c95
-rw-r--r--gcc/function.h22
-rw-r--r--gcc/gengtype.c156
-rw-r--r--gcc/langhooks-def.h7
-rw-r--r--gcc/langhooks.h12
-rw-r--r--gcc/libgcc2.c2
-rw-r--r--gcc/objcp/ChangeLog8
-rw-r--r--gcc/objcp/Make-lang.in2
-rw-r--r--gcc/objcp/objcp-lang.c20
-rw-r--r--gcc/print-tree.c4
-rw-r--r--gcc/reload1.c57
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/stmt.c6
-rw-r--r--gcc/system.h3
-rw-r--r--gcc/target-def.h13
-rw-r--r--gcc/target.h15
-rw-r--r--gcc/targhooks.c38
-rw-r--r--gcc/targhooks.h2
-rw-r--r--gcc/testsuite/ChangeLog243
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C13
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C14
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C16
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C14
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr41429.C5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr38747.C19
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr19637.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr41428.C15
-rw-r--r--gcc/testsuite/g++.dg/vect/vect.exp4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39779.c5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/980526-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41395-1.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41395-2.c35
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41463.c56
-rw-r--r--gcc/testsuite/gcc.dg/20090922-1.c65
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr40209.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr41248.c27
-rw-r--r--gcc/testsuite/gcc.dg/pr41295.c91
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-math-7.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr12329.c38
-rw-r--r--gcc/testsuite/gcc.target/mips/code-readable-1.c4
-rw-r--r--gcc/testsuite/gcc.target/mips/code-readable-2.c4
-rw-r--r--gcc/testsuite/gcc.target/mips/code-readable-3.c4
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-1.c54
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-2.c64
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-3.c60
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-4.c60
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-5.c60
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-6.c64
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-7.c64
-rw-r--r--gcc/testsuite/gcc.target/vsx-vectorize-8.c64
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f2
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr37738.f2
-rw-r--r--gcc/testsuite/gfortran.dg/empty_label.f5
-rw-r--r--gcc/testsuite/gfortran.dg/empty_label.f905
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect.exp4
-rw-r--r--gcc/testsuite/gfortran.dg/warnings_are_errors_1.f2
-rw-r--r--gcc/testsuite/gnat.dg/array7.adb15
-rw-r--r--gcc/testsuite/gnat.dg/array7.ads18
-rw-r--r--gcc/testsuite/gnat.dg/nested_proc.adb33
-rw-r--r--gcc/testsuite/gnat.dg/sse_nolib.adb49
-rw-r--r--gcc/testsuite/lib/profopt.exp8
-rw-r--r--gcc/testsuite/lib/scanasm.exp31
-rw-r--r--gcc/testsuite/lib/target-supports.exp8
-rw-r--r--gcc/testsuite/objc.dg/dwarf-2.m2
-rw-r--r--gcc/toplev.c5
-rw-r--r--gcc/tree-cfg.c6
-rw-r--r--gcc/tree-complex.c8
-rw-r--r--gcc/tree-dfa.c53
-rw-r--r--gcc/tree-flow.h4
-rw-r--r--gcc/tree-into-ssa.c2
-rw-r--r--gcc/tree-nested.c52
-rw-r--r--gcc/tree-ssa-ccp.c31
-rw-r--r--gcc/tree-ssa-copy.c2
-rw-r--r--gcc/tree-ssa-forwprop.c4
-rw-r--r--gcc/tree-ssa-propagate.c108
-rw-r--r--gcc/tree-ssa-propagate.h3
-rw-r--r--gcc/tree-vect-stmts.c2
-rw-r--r--gcc/tree-vrp.c78
-rw-r--r--gcc/tree.h5
-rw-r--r--gcc/unwind-dw2-fde-glibc.c10
-rw-r--r--gcc/value-prof.c5
-rw-r--r--gcc/var-tracking.c22
-rw-r--r--gcc/varasm.c20
-rw-r--r--include/ChangeLog19
-rw-r--r--include/dwarf2.h30
-rw-r--r--libcpp/ChangeLog10
-rwxr-xr-xlibcpp/configure2
-rw-r--r--libcpp/configure.ac2
-rw-r--r--libcpp/files.c6
-rw-r--r--libffi/ChangeLog9
-rw-r--r--libffi/src/arm/sysv.S23
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/config.h.in54
-rwxr-xr-xlibgfortran/configure812
-rw-r--r--libgfortran/configure.ac20
-rw-r--r--libiberty/ChangeLog8
-rw-r--r--libiberty/choose-temp.c4
-rw-r--r--libiberty/cplus-dem.c5
-rw-r--r--libjava/ChangeLog43
-rw-r--r--libjava/Makefile.am221
-rw-r--r--libjava/Makefile.in322
-rwxr-xr-xlibjava/configure111
-rw-r--r--libjava/configure.ac36
-rw-r--r--libjava/configure.host6
-rw-r--r--libjava/libltdl/ChangeLog7
-rw-r--r--libjava/libltdl/Makefile.am2
-rw-r--r--libjava/libltdl/Makefile.in2
-rw-r--r--libjava/libltdl/ltdl.h2
-rw-r--r--libjava/sysdep/i386/backtrace.h11
-rw-r--r--libmudflap/ChangeLog6
-rw-r--r--libmudflap/mf-runtime.c13
-rw-r--r--libstdc++-v3/ChangeLog61
-rw-r--r--libstdc++-v3/include/parallel/algo.h156
-rw-r--r--libstdc++-v3/include/parallel/algobase.h26
-rw-r--r--libstdc++-v3/include/parallel/base.h20
-rw-r--r--libstdc++-v3/include/parallel/checkers.h87
-rw-r--r--libstdc++-v3/include/parallel/equally_split.h2
-rw-r--r--libstdc++-v3/include/parallel/find.h2
-rw-r--r--libstdc++-v3/include/parallel/find_selectors.h8
-rw-r--r--libstdc++-v3/include/parallel/for_each.h8
-rw-r--r--libstdc++-v3/include/parallel/for_each_selectors.h8
-rw-r--r--libstdc++-v3/include/parallel/list_partition.h2
-rw-r--r--libstdc++-v3/include/parallel/losertree.h24
-rw-r--r--libstdc++-v3/include/parallel/merge.h8
-rw-r--r--libstdc++-v3/include/parallel/multiseq_selection.h74
-rw-r--r--libstdc++-v3/include/parallel/multiway_merge.h102
-rw-r--r--libstdc++-v3/include/parallel/multiway_mergesort.h10
-rw-r--r--libstdc++-v3/include/parallel/numeric88
-rw-r--r--libstdc++-v3/include/parallel/numericfwd.h2
-rw-r--r--libstdc++-v3/include/parallel/omp_loop.h8
-rw-r--r--libstdc++-v3/include/parallel/omp_loop_static.h6
-rw-r--r--libstdc++-v3/include/parallel/par_loop.h8
-rw-r--r--libstdc++-v3/include/parallel/partition.h49
-rw-r--r--libstdc++-v3/include/parallel/random_shuffle.h36
-rw-r--r--libstdc++-v3/include/parallel/search.h2
-rw-r--r--libstdc++-v3/include/parallel/sort.h18
-rw-r--r--libstdc++-v3/include/parallel/workstealing.h28
307 files changed, 7992 insertions, 3284 deletions
diff --git a/ChangeLog b/ChangeLog
index 596cfc774f5..a15f772261a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2009-09-23 Nick Clifton <nickc@redhat.com>
+
+ * config.sub, config.guess: Update from upstream sources.
+
+2009-09-22 Loren J. Rittle <ljrittle@acm.org>
+
+ * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Remove stray $$r/.
+ * Makefile.in: Rebuilt.
+
+2009-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR bootstrap/32272
+ * configure.ac: Error out if $srcdir isn't '.' but contains
+ host-${host_noncanonical}.
+ * configure: Regenerate.
+
+2009-09-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * MAINTAINERS (OS Port Maintainers): Add myself as Solaris
+ maintainer.
+
2009-09-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac: If bootstrapping a combined tree with
diff --git a/MAINTAINERS b/MAINTAINERS
index d1c5886b657..1f339cf6042 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -111,7 +111,7 @@ freebsd Loren J. Rittle ljrittle@acm.org
GNU/Hurd Thomas Schwinge tschwinge@gnu.org
hpux John David Anglin dave.anglin@nrc-cnrc.gc.ca
hpux Steve Ellcey sje@cup.hp.com
-irix, osf Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
+irix, osf, solaris Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
netbsd Jason Thorpe thorpej@netbsd.org
netbsd Krister Walfridsson krister.walfridsson@gmail.com
sh-linux-gnu Kaz Kojima kkojima@gcc.gnu.org
@@ -263,6 +263,7 @@ Fortran Janus Weil janus@gcc.gnu.org
Graphite Daniel Berlin dberlin@dberlin.org
Graphite Tobias Grosser grosser@fim.uni-passau.de
Graphite Sebastian Pop sebastian.pop@amd.com
+Plug-in Rafael Espíndola rafael.espindola@gmail.com
register allocation Peter Bergner bergner@vnet.ibm.com
register allocation Vladimir Makarov vmakarov@redhat.com
register allocation Kenneth Zadeck zadeck@naturalbridge.com
diff --git a/Makefile.in b/Makefile.in
index 044f849d0aa..354193c4db2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -235,7 +235,7 @@ POSTSTAGE1_HOST_EXPORTS = \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
- -I$$r/$(srcdir)/libstdc++-v3/libsupc++ \
+ -I$(srcdir)/libstdc++-v3/libsupc++ \
-L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \
CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
diff --git a/Makefile.tpl b/Makefile.tpl
index 6c63d950fc6..28ac9879b1b 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -238,7 +238,7 @@ POSTSTAGE1_HOST_EXPORTS = \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
- -I$$r/$(srcdir)/libstdc++-v3/libsupc++ \
+ -I$(srcdir)/libstdc++-v3/libsupc++ \
-L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \
CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
diff --git a/config.guess b/config.guess
index e3a2116a7dc..4ac8133b848 100755
--- a/config.guess
+++ b/config.guess
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
-timestamp='2009-06-10'
+timestamp='2009-09-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@ timestamp='2009-06-10'
# the same distribution terms that you use for the rest of that program.
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -854,6 +854,20 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -876,6 +890,9 @@ EOF
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-gnu
+ exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
@@ -911,29 +928,12 @@ EOF
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -942,8 +942,11 @@ EOF
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
@@ -966,58 +969,6 @@ EOF
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
@@ -1247,6 +1198,16 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
diff --git a/config.sub b/config.sub
index 32d764c386b..b26b47a0e0a 100755
--- a/config.sub
+++ b/config.sub
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
-timestamp='2009-08-17'
+timestamp='2009-09-23'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@ timestamp='2009-08-17'
# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -284,6 +287,7 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
+ | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
@@ -368,7 +372,7 @@ case $basic_machine in
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
- | romp-* | rs6000-* \
+ | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
diff --git a/configure b/configure
index 720fa239c05..667b514b72c 100755
--- a/configure
+++ b/configure
@@ -2743,6 +2743,11 @@ fi
# No prefix.
target_subdir=${target_noncanonical}
+# Be sure to cover against remnants of an in-tree build.
+if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
+ as_fn_error "building out of tree but $srcdir contains host-${host_noncanonical}.
+Use a pristine source tree when building in a separate tree" "$LINENO" 5
+fi
# Skipdirs are removed silently.
skipdirs=
diff --git a/configure.ac b/configure.ac
index 794a4191d56..e7d44db83dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,11 @@ fi
# Find the build and target subdir names.
GCC_TOPLEV_SUBDIRS
+# Be sure to cover against remnants of an in-tree build.
+if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
+ AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
+Use a pristine source tree when building in a separate tree])
+fi
# Skipdirs are removed silently.
skipdirs=
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6acac677a09..53a8332c267 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,759 @@
+2009-09-25 Anatoly Sokolov <aesok@post.ru>
+
+ * config/v850/v850.h (FUNCTION_VALUE): Remove.
+ * config/v850/v850.c (v850_function_value): New function.
+ (TARGET_FUNCTION_VALUE): Define.
+
+2009-09-25 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-vect-stmts.c (vectorizable_call): Call
+ mark_symbols_for_renaming after vect_finish_stmt_generation.
+
+ * dwarf2out.c (tls_mem_loc_descriptor): Pass 1 instead of 2
+ to loc_descriptor_from_tree.
+ (add_location_or_const_value_attribute): Pass 0 instead of 2
+ for decl_by_reference_p decls.
+
+2009-09-25 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41463
+ * tree-dfa.c (get_ref_base_and_extent): Fix issue with trailing
+ arrays again.
+
+2009-09-25 Ben Elliston <bje@au.ibm.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Add missing comma
+ after `power7'.
+
+2009-09-25 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.md (load_toc_v4_PIC_3c): Correct POWER
+ form of instruction.
+
+2009-09-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ PR middle-end/41435
+ * fold-const.c (const_binop): Handle complex int division.
+ * tree-complex.c (expand_complex_div_straight,
+ expand_complex_div_wide): Update comments.
+
+2009-09-24 DJ Delorie <dj@redhat.com>
+
+ PR target/41456
+ * config/m32c/m32c.h (REG_CLASS_CONTENTS): Add R13.
+ (reg_class): Likewise.
+ (REG_CLASS_NAMES): Likewise.
+ * config/m32c/m32c.c (m32c_reg_class_from_constraint): Likewise.
+
+ * config/m32c/m32c.c (m32c_override_options): Disable -fivopts for
+ M32C.
+
+2009-09-24 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * config/rs6000/predicates.md (indexed_or_indirect_operand):
+ Delete VSX load/store with update support.
+ * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Ditto.
+ * config/rs6000/vsx.md (vsx_mov<mode>): Ditto.
+ (vsx_movti): Ditto.
+ (VSX_U): Delete.
+ (VSbit): Ditto.
+ (VStype_load_update): Ditto.
+ (VStype_store_update): Ditto.
+ (vsx_load<VSX_U:mode>_update_<P:mptrsize>): Ditto.
+ (vsx_store<VSX_U:mode>_update_<P:mptrsize>): Ditto.
+
+ * config/rs6000/rs6000.h (enum rs6000_builtins): Delete VSX
+ load/store with update builtins.
+
+2009-09-24 Kai Tietz <kai.tietz@onevision.com>
+
+ * libgcc2.c (L_trampoline): Prototype for getpagesize
+ and mprotect in WINNT case.
+
+2009-09-24 Anatoly Sokolov <aesok@post.ru>
+
+ * config/rs6000/rs6000.h (FUNCTION_VALUE): Remove macro.
+ * config/rs6000/rs6000-protos.h (rs6000_function_value): Remove.
+ * config/rs6000/rs6000.c (rs6000_function_value): Make static, add
+ 'outgoing' argument.
+ (TARGET_FUNCTION_VALUE): Define.
+
+2009-09-24 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ * config/darwin.h (DWARF2_DEBUGGING_INFO): Define as 1.
+
+2009-09-24 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR bootstrap/41405
+ * common.opt: Initialize dwarf_strict to -1.
+ * toplev.c (process_options): Catch unset dwarf_strict
+ and set to 0 for all targets not overriding.
+ * config/darwin.c (darwin_override_options): Catch unset
+ dwarf_strict and override to 1.
+
+2009-09-24 Jeff Law <law@redhat.com>
+
+ * tree-into-ssa.c (rewrite_into_ssa): Free interesting_blocks.
+
+2009-09-24 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36143
+ PR tree-optimization/38747
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Only
+ create VIEW_CONVERT_EXPRs for TBAA compatible accesses.
+
+2009-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/41457
+ * dwarf2out.c (add_const_value_attribute): For HIGH and CONST_FIXED,
+ return false instead of gcc_unreachable (). For CONST return the
+ value returned by recursive call instead of always returning true.
+ (tree_add_const_value_attribute): Return the value returned by
+ add_const_value_attribute instead of always returning true if rtl
+ is non-NULL.
+
+2009-09-23 Justin Seyster <jrseys@gmail.com>
+
+ * Makefile.in (PLUGIN_HEADERS): Include real.h.
+
+2009-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ * cgraphunit.c (cgraph_lower_function): Revert last change.
+ * targhooks.c (default_static_chain): Use !DECL_STATIC_CHAIN
+ instead of DECL_NO_STATIC_CHAIN.
+ * tree-cfg.c (verify_gimple_call): Likewise.
+ * tree-nested.c (get_chain_decl, get_chain_field,
+ convert_tramp_reference_op, convert_gimple_call): Likewise.
+ (convert_all_function_calls): Likewise. Always set or clear
+ DECL_STATIC_CHAIN initially, for !n->outer clear it.
+ (lower_nested_functions): Remove DECL_NO_STATIC_CHAIN checking code.
+ * c-parser.c (c_parser_declaration_or_fndef): Set DECL_STATIC_CHAIN
+ if nested.
+ * print-tree.c (print_node): Handle DECL_STATIC_CHAIN instead of
+ DECL_NO_STATIC_CHAIN.
+ * config/i386/i386.c (ix86_static_chain): Use !DECL_STATIC_CHAIN
+ instead of DECL_NO_STATIC_CHAIN.
+ (ix86_function_regparm, find_drap_reg): Likewise. Don't test
+ decl_function_context.
+ * varasm.c (initializer_constant_valid_p): Likewise.
+ * tree.h (DECL_NO_STATIC_CHAIN): Renamed to ...
+ (DECL_STATIC_CHAIN): ... this.
+ * config/moxie/moxie.c (moxie_static_chain): Use !DECL_STATIC_CHAIN
+ instead of DECL_NO_STATIC_CHAIN.
+
+2009-09-23 Basile Starynkevitch <basile@starynkevitch.net>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * gengtype.c (nb_plugin_files): Make it unsigned to match
+ num_gt_files. Adjust other variables to avoid warnings.
+ (main): Allocate an all zero lang_bitmap before each plugin file name
+ to match regular file names.
+
+2009-09-23 Richard Henderson <rth@redhat.com>
+
+ * doc/tm.texi (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove.
+ (TARGET_STATIC_CHAIN): Mention that this hook must be used for
+ static chain passed in memory.
+ * system.h (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Poison.
+ * targhooks.c (default_static_chain): Don't handle STATIC_CHAIN,
+ STATIC_CHAIN_INCOMING. Issue a sorry if there's no
+ STATIC_CHAIN_REGNUM defined.
+
+ * config/picochip/picochip-protos.h: s/class/klass/.
+ * config/picochip/picochip.c (TARGET_STATIC_CHAIN): New.
+ (picochip_static_chain): New.
+ * config/picochip/picochip.h (STATIC_CHAIN): Remove.
+ (STATIC_CHAIN_INCOMING): Remove.
+
+ * config/xtensa/xtensa.c (TARGET_STATIC_CHAIN): New.
+ (xtensa_static_chain): New.
+ * config/xtensa/xtensa.h (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove.
+
+2009-09-23 Anatoly Sokolov <aesok@post.ru>
+
+ * config/pa/pa.h (FUNCTION_VALUE): Remove macro.
+ * config/pa/pa-protos.h (function_value): Remove.
+ * config/pa/pa.c (pa_function_value): Rename from function_value.
+ Make static, add 'outgoing' argument.
+ (TARGET_FUNCTION_VALUE): Define.
+
+2009-09-23 Anatoly Sokolov <aesok@post.ru>
+
+ * config/avr/avr.c (avr_regs_to_save): Use current_function_is_leaf
+ instead of cfun->machine->is_leaf.
+ * config/avr/avr.h (machine_function): Remove is_leaf field.
+
+2009-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41439
+ * dwarf2out.c (address_of_int_loc_descriptor): Don't emit
+ DW_OP_piece after DW_OP_stack_value, adjust size calculations
+ for it, when DW_OP_stack_value and DW_OP_implicit_value has
+ the same size, prefer DW_OP_stack_value.
+ (loc_descriptor, loc_list_for_address_of_addr_expr_of_indirect_ref,
+ loc_list_from_tree): Don't emit DW_OP_piece after DW_OP_stack_value.
+
+2009-09-23 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41353
+ * var-tracking.c (add_with_sets): Sort MO_VAL_LOC last among uses.
+
+2009-09-23 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41248
+ * cfgexpand.c (convert_debug_memory_address): New.
+ (expand_debug_expr): Convert base address and offset to the same
+ mode. Use it to convert addresses to other modes. Accept
+ ptr_mode addresses.
+
+2009-09-23 Richard Guenther <rguenther@suse.de>
+
+ * alias.c (ao_ref_from_mem): Correct for negative MEM_OFFSET
+ produced for bigendian targets with promoted subregs.
+
+2009-09-23 Richard Guenther <rguenther@suse.de>
+
+ * value-prof.c (gimple_ic): Purge old EH edges only after building
+ the new ones.
+
+2009-09-23 Nick Clifton <nickc@redhat.com>
+
+ * config/arc/arc.c (arc_trampoline_init): Fix typo.
+
+2009-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/41405
+ * doc/invoke.texi: Document -gstrict-dwarf and -gno-strict-dwarf.
+
+ PR bootstrap/41436
+ * cgraphunit.c (cgraph_lower_function): Set DECL_NO_STATIC_CHAIN
+ on non-nested functions.
+
+2009-09-23 Jakub Jelinek <jakub@redhat.com>
+ Jan Hubicka <jh@suse.cz>
+
+ * dwarf2out.c (loc_list_plus_const): Only define if
+ DWARF2_DEBUGGING_INFO.
+ (address_of_int_loc_descriptor): Likewise.
+
+ PR debug/41411
+ * dwarf2out.c (mem_loc_descriptor): Handle HIGH.
+
+2009-09-23 Uros Bizjak <ubizjak@gmail.com>
+
+ PR c/39779
+ * c-typeck.c (build_binary_op) <short_shift>: Check that integer
+ constant is more than zero.
+
+2009-09-23 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/40473
+ * config/rs6000/rs6000.c (rs6000_output_function_prologue): Don't
+ call final to emit non-scheduled prologue, instead insert at entry.
+
+2009-09-22 Loren J. Rittle <ljrittle@acm.org>
+ Joseph S. Myers <joseph@codesourcery.com>
+
+ * doc/install.texi (*-*-freebsd*): Add proper format codes.
+
+2009-09-22 Basile Starynkevitch <basile@starynkevitch.net>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * gengtype.c (is_file_equal): New function.
+ (close_output_files): Use is_file_equal. Free of->buf.
+
+2009-09-22 Basile Starynkevitch <basile@starynkevitch.net>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * gengtype.c (write_types, write_local): Add the output_header
+ argument. Update all callers.
+
+2009-09-22 Dodji Seketeli <dodji@redhat.com>
+
+ * dwarf2out.c (template_parameter_pack_die,
+ gen_formal_parameter_pack_die ): New functions.
+ (make_ith_pack_parameter_name): Remove this function.
+ (dwarf_tag_name): Support printing DW_TAG_template_parameter_pack and
+ DW_TAG_formal_parameter_pack.
+ (gen_generic_params_dies): Represent each template parameter pack
+ by a DW_TAG_template_parameter_pack DIE. Argument pack elements are
+ represented by usual DW_TAG_template_*_parameter DIEs that are
+ children of the DW_TAG_template_parameter_pack element DIE.
+ (generic_parameter_die): This doesn't deal with parameter pack
+ names anymore. Don't generate DW_AT_name for some DIEs, e.g. children
+ of parameter pack DIEs.
+ (gen_formal_parameter_die): Add a flag to not emit DW_AT_name
+ in certain cases, e.g. for pack elements.
+ (gen_formal_types_die, gen_decl_die): Adjust usage of
+ gen_formal_parameter_die.
+ (gen_subprogram_die): Represent each function parameter pack by a
+ DW_TAG_formal_parameter_pack DIE. Arguments of of the pack are
+ represented by usual DW_TAG_formal_parameter DIEs that are children
+ of the DW_TAG_formal_parameter_pack DIE. Remove references to
+ ____builtin_va_alist decls as no part of the compiler uses those
+ anymore.
+ * langhooks.h (struct lang_hooks_for_decls): Add
+ function_parm_expanded_from_pack_p, get_generic_function_decl
+ and function_parameter_pack_p hooks. Fix comment for
+ get_innermost_generic_parms hook.
+ * langhooks-def.h (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
+ LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P ): Declare new hook
+ macros and use them to initialize lang_hook.
+
+2009-09-22 Richard Henderson <rth@redhat.com>
+
+ * system.h (TRAMPOLINE_TEMPLATE, INITIALIZE_TRAMPOLINE): Poison.
+ (TRAMPOLINE_ADJUST_ADDRESS): Poison.
+ * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): Don't conditionalize
+ on TRAMPOLINE_TEMPLATE.
+ (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Don't conditionalize on
+ TRAMPOLINE_ADJUST_ADDRESS.
+ * targhooks.c (default_asm_trampoline_template): Remove.
+ (default_trampoline_adjust_address): Remove.
+ (default_trampoline_init): Don't handle INITIALIZE_TRAMPOLINE.
+ * targhooks.h: Update decls.
+
+2009-09-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * config/i386/cygming.h (TARGET_USE_JCR_SECTION): Enable.
+ * config/i386/cygwin.h (LIBGCJ_SONAME): Define.
+ * config/i386/mingw32.h (LIBGCJ_SONAME): Likewise.
+
+2009-09-22 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41295
+ * reload1.c (reload): Reset debug insns with pseudos without
+ equivalences.
+
+2009-09-22 Janis Johnson <janis187@us.ibm.com>
+
+ * config/i386/i386.c (ix86_scalar_mode_supported_p): Don't return
+ unconditional true for decimal float modes.
+ * config/rs6000/rs6000.c (rs6000_scalar_mode_supported_p): Ditto.
+ * config/s390/s390.c (s390_scalar_mode_supported_p): Ditto.
+
+2009-09-22 Loren J. Rittle <ljrittle@acm.org>
+
+ * unwind-dw2-fde-glibc.c: Define and use USE_PT_GNU_EH_FRAME.
+ Enable a new case for __FreeBSD__ >= 7.
+ * crtstuff.c: Define USE_PT_GNU_EH_FRAME for __FreeBSD__ >= 7.
+ * config/t-freebsd: Define LIB2ADDEH and LIB2ADDEHDEP.
+ * config/freebsd-spec.h: Conditionally define LINK_EH_SPEC
+ and USE_LD_AS_NEEDED.
+
+ * doc/install.texi (*-*-freebsd*): Update target information.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41395
+ * tree-dfa.c (get_ref_base_and_extent): Handle trailing
+ arrays really properly.
+
+2009-09-22 Richard Henderson <rth@redhat.com>
+
+ PR target/41246
+ * target.h (struct gcc_target): Add asm_out.trampoline_template,
+ calls.static_chain, calls.trampoline_init,
+ calls.trampoline_adjust_address.
+ * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New.
+ (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
+ * builtins.c (expand_builtin_setjmp_receiver): Use
+ targetm.calls.static_chain; only clobber registers.
+ (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init;
+ set up memory attributes properly for the trampoline block.
+ (expand_builtin_adjust_trampoline): Use
+ targetm.calls.trampoline_adjust_address.
+ * calls.c (prepare_call_address): Add fndecl argument. Use
+ targetm.calls.static_chain.
+ * df-scan.c (df_need_static_chain_reg): Remove.
+ (df_get_entry_block_def_set): Use targetm.calls.static_chain;
+ consolodate static chain handling.
+ * doc/tm.texi: Document new hooks.
+ * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove.
+ (init_emit_regs): Don't initialize them.
+ * expr.h (prepare_call_address): Update decl.
+ * final.c (profile_function): Use targetm.calls.static_chain.
+ * function.c (expand_function_start): Likewise.
+ * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove.
+ * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain;
+ only clobber registers.
+ * targhooks.c (default_static_chain): New.
+ (default_asm_trampoline_template, default_trampoline_init): New.
+ (default_trampoline_adjust_address): New.
+ * targhooks.h: Declare them.
+ * varasm.c (assemble_trampoline_template): Use
+ targetm.asm_out.trampoline_template. Make the memory block const
+ and set its size.
+
+ * config/alpha/alpha.c (alpha_trampoline_init): Rename from
+ alpha_initialize_trampoline. Make static. Merge VMS parameter
+ differences into the TARGET_ABI_OPEN_VMS code block.
+ (TARGET_TRAMPOLINE_INIT): New.
+ * config/alpha/alpha.h (TRAMPOLINE_TEMPLATE): Remove.
+ (TRAMPOLINE_SECTION, INITIALIZE_TRAMPOLINE): Remove.
+ * config/alpha/vms.h (TRAMPOLINE_SIZE, TRAMPOLINE_ALIGNMENT): Remove.
+ (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/arc/arc.h (TRAMPOLINE_ALIGNMENT): New.
+ (TRAMPOLINE_TEMPLATE): Merge with ...
+ (INITIALIZE_TRAMPOLINE): ... this and move ...
+ * config/arc/arc.c (arc_trampoline_init): ... here.
+ (TARGET_TRAMPOLINE_INIT): New.
+
+ * config/arm/arm.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT, TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
+ (arm_asm_trampoline_template): New.
+ (arm_trampoline_init, arm_trampoline_adjust_address): New.
+ * config/arm/arm.h (TRAMPOLINE_TEMPLATE, ARM_TRAMPOLINE_TEMPLATE,
+ THUMB2_TRAMPOLINE_TEMPLATE, THUMB1_TRAMPOLINE_TEMPLATE): Move all
+ code to arm_asm_trampoline_template.
+ (TRAMPOLINE_ADJUST_ADDRESS): Move code to
+ arm_trampoline_adjust_address.
+ (INITIALIZE_TRAMPOLINE): Move code to arm_trampoline_init;
+ adjust for target hook parameters.
+
+ * config/avr/avr.h (TRAMPOLINE_TEMPLATE, INITIALIZE_TRAMPOLINE):
+ Remove.
+
+ * config/bfin/bfin-protos.h (initialize_trampoline): Remove.
+ * config/bfin/bfin.c (bfin_asm_trampoline_template): New.
+ (bfin_trampoline_init): Rename from initialize_trampoline;
+ make static; update for target hook parameters.
+ (TARGET_ASM_TRAMPOLINE_TEMPLATE, TARGET_TRAMPOLINE_INIT): New.
+ * config/bfin/bfin.h (TRAMPOLINE_TEMPLATE): Move code to
+ bfin_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/cris/cris.c (TARGET_ASM_TRAMPOLINE_TEMPLATE,
+ TARGET_TRAMPOLINE_INIT, cris_asm_trampoline_template,
+ cris_trampoline_init): New.
+ * config/cris/cris.h (TRAMPOLINE_TEMPLATE): Move code to
+ cris_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to cris_trampoline_init;
+ adjust for target hook parameters.
+
+ * config/crx/crx.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/fr30/fr30.c (TARGET_ASM_TRAMPOLINE_TEMPLATE,
+ TARGET_TRAMPOLINE_INIT, fr30_asm_trampoline_template,
+ fr30_trampoline_init): New.
+ * config/fr30/fr30.h (TRAMPOLINE_TEMPLATE): Move code to
+ fr30_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to fr30_trampoline_init;
+ adjust for target hook parameters.
+
+ * config/frv/frv.c (TARGET_TRAMPOLINE_INIT): New.
+ (frv_trampoline_init): Rename from frv_initialize_trampoline;
+ make static, adjust arguments for TARGET_TRAMPOLINE_INIT hook.
+ * config/frv/frv.h (INITIALIZE_TRAMPOLINE): Remove.
+ * config/frv/frv-protos.h (frv_initialize_trampoline): Remove.
+
+ * config/h8300/h8300.c (h8300_trampoline_init): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ * config/h8300/h8300.h (INITIALIZE_TRAMPOLINE): Move code
+ to h8300_trampoline_init and adjust for hook parameters.
+
+ * config/ia64/ia64-protos.h (ia64_initialize_trampoline): Remove.
+ * config/ia64/ia64.c (TARGET_TRAMPOLINE_INIT): New.
+ (ia64_trampoline_init): Rename from ia64_initialize_trampoline;
+ make static; adjust for hook parameters.
+ * config/ia64/ia64.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/iq2000/iq2000.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (iq2000_asm_trampoline_template, iq2000_trampoline_init): New.
+ * config/iq2000/iq2000.h (TRAMPOLINE_TEMPLATE): Move code to
+ iq2000_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to iq2000_trampoline_init.
+ (TRAMPOLINE_CODE_SIZE): New.
+ (TRAMPOLINE_SIZE): Use it.
+ (TRAMPOLINE_ALIGNMENT): Follow Pmode.
+
+ * config/m32c/m32c-protos.h (m32c_initialize_trampoline): Remove.
+ * config/m32c/m32c.c (TARGET_TRAMPOLINE_INIT): New.
+ (m32c_trampoline_init): Rename from m32c_initialize_trampoline;
+ adjust for hook parameters.
+ * config/m32c/m32c.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/m32r/m32r.c (TARGET_TRAMPOLINE_INIT): New.
+ (m32r_trampoline_init): New.
+ * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Move code to
+ m32r_trampoline_init.
+
+ * config/m68hc11/m68hc11.c (TARGET_TRAMPOLINE_INIT): New.
+ (m68hc11_trampoline_init): Rename from m68hc11_initialize_trampoline;
+ make static; update for hook parameters.
+ * config/m68hc11/m68hc11-protos.h: Update.
+ * config/m68hc11/m68hc11.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/mcore/mcore.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (mcore_function_value): Fix typo.
+ (mcore_asm_trampoline_template, mcore_trampoline_init): New.
+ * config/mcore/mcore.h (TRAMPOLINE_TEMPLATE): Move code
+ to mcore_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to mcore_trampoline_init.
+
+ * config/mep/mep.h (INITIALIZE_TRAMPOLINE): Remove.
+ * config/mep/mep.c (TARGET_TRAMPOLINE_INIT): New.
+ (mep_trampoline_init): Rename from mep_init_trampoline; make static;
+ update for hook parameters.
+ * config/mep/mep-protos.h (mep_init_trampoline): Remove.
+
+ * config/mips/mips.c (TARGET_ASM_TRAMPOLINE_TEMPLATE,
+ mips_asm_trampoline_template, TARGET_TRAMPOLINE_INIT,
+ mips_trampoline_init): New.
+ * config/mips/mips.h (TRAMPOLINE_TEMPLATE): Move code to
+ mips_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to mips_trampoline_init;
+ update for hook parameters.
+
+ * gcc/config/mmix/mmix.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (mmix_trampoline_size): Remove.
+ (mmix_asm_trampoline_template): Rename from mmix_trampoline_template;
+ make static. Remove out-of-date tetra vs octa comment.
+ (mmix_trampoline_init): Rename from mmix_initialize_trampoline;
+ make static; update for hook parameters.
+ * config/mmix/mmix.h (TRAMPOLINE_TEMPLATE): Remove.
+ (INITIALIZE_TRAMPOLINE): Remove.
+ (TRAMPOLINE_SIZE): Use a constant instead of mmix_trampoline_size.
+ (TRAMPOLINE_ALIGNMENT): New.
+ * gcc/config/mmix/mmix-protos.h: Update.
+
+ * config/mn10300/mn10300.c (TARGET_ASM_TRAMPOLINE_TEMPLATE,
+ mn10300_asm_trampoline_template, TARGET_TRAMPOLINE_INIT,
+ mn10300_trampoline_init): New.
+ * config/mn10300/mn10300.h (TRAMPOLINE_TEMPLATE): Move code to
+ mn10300_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to mn10300_trampoline_init.
+
+ * config/moxie/moxie.c (moxie_static_chain,
+ moxie_asm_trampoline_template, moxie_trampoline_init,
+ TARGET_STATIC_CHAIN, TARGET_ASM_TRAMPOLINE_TEMPLATE,
+ TARGET_TRAMPOLINE_INIT): New.
+ * config/moxie/moxie.h (INITIALIZE_TRAMPOLINE): Move code to
+ moxie_trampoline_init.
+ (TRAMPOLINE_TEMPLATE): Move code to moxie_asm_trampoline_template.
+ (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove.
+
+ * gcc/config/pa/pa.c (TARGET_ASM_TRAMPOLINE_TEMPLATE,
+ pa_asm_trampoline_template, TARGET_TRAMPOLINE_INIT,
+ pa_trampoline_init, TARGET_TRAMPOLINE_ADJUST_ADDRESS,
+ pa_trampoline_adjust_address): New.
+ * config/pa/pa.h (TRAMPOLINE_TEMPLATE): Move code to
+ pa_asm_trampoline_template.
+ (TRAMPOLINE_ALIGNMENT): New.
+ (TRAMPOLINE_CODE_SIZE): Move to pa.c.
+ (INITIALIZE_TRAMPOLINE): Move code to pa_trampoline_init;
+ adjust for hook parameters.
+ (TRAMPOLINE_ADJUST_ADDRESS): Move code to pa_trampoline_adjust_address.
+
+ * config/pdp11/pdp11.c (pdp11_trampoline_init): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Remove.
+ (INITIALIZE_TRAMPOLINE): Move code to pdp11_trampoline_init.
+
+ * config/picochip/picochip.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/rs6000/rs6000-protos.h (rs6000_initialize_trampoline): Remove.
+ * config/rs6000/rs6000.c (TARGET_TRAMPOLINE_INIT): New.
+ (rs6000_trampoline_init): Rename from rs6000_initialize_trampoline;
+ make static; adjust parameters for the hook.
+ * config/rs6000/rs6000.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/s390/s390.c (s390_asm_trampoline_template): Rename from
+ s390_trampoline_template; make static.
+ (s390_trampoline_init): Rename from s390_initialize_trampoline;
+ make static; adjust for target hook.
+ (TARGET_ASM_TRAMPOLINE_TEMPLATE, TARGET_TRAMPOLINE_INIT): New.
+ * config/s390/s390-protos.h: Remove trampoline decls.
+ * config/s390/s390.h (INITIALIZE_TRAMPOLINE): Remove.
+ (TRAMPOLINE_TEMPLATE): Remove.
+ (TRAMPOLINE_ALIGNMENT): New.
+
+ * config/score/score-protos.h (score_initialize_trampoline): Remove.
+ * config/score/score.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (score_asm_trampoline_template): New.
+ (score_trampoline_init): Rename from score_initialize_trampoline;
+ make static; adjust for hook parameters.
+ * config/score/score.h (TRAMPOLINE_TEMPLATE): Move code to
+ score[37]_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Remove.
+ * config/score/score3.c (score3_asm_trampoline_template): New.
+ (score3_trampoline_init): Rename from score3_initialize_trampoline;
+ adjust for target hook.
+ * config/score/score7.c (score7_asm_trampoline_template): New.
+ (score7_trampoline_init): Rename from score7_initialize_trampoline;
+ adjust for target hook.
+ * config/score/score3.h, config/score/score7.h: Update.
+
+ * config/sh/sh-protos.h (sh_initialize_trampoline): Remove.
+ * config/sh/sh.c (TARGET_TRAMPOLINE_INIT): New.
+ (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
+ (sh_trampoline_init): Rename from sh_initialize_trampoline;
+ make static; adjust for target hook parameters.
+ (sh_trampoline_adjust_address): New.
+ * config/sh/sh.h (INITIALIZE_TRAMPOLINE): New.
+ (TRAMPOLINE_ADJUST_ADDRESS): Move code to sh_trampoline_adjust_address.
+
+ * config/sparc/sparc.c (TARGET_TRAMPOLINE_INIT): New.
+ (sparc32_initialize_trampoline): Rename from
+ sparc_initialize_trampoline; make static; replace tramp parameter
+ with m_tramp and update memory accesses.
+ (sparc64_initialize_trampoline): Similarly.
+ (sparc_trampoline_init): New.
+ * config/sparc/sparc-protos.h: Remove trampoline decls.
+ * config/sparc/sparc.h (INITIALIZE_TRAMPOLINE): Remove.
+ * config/sparc/sparc.md (nonlocal_goto): Don't use static_chain_rtx.
+
+ * config/spu/spu.c (TARGET_TRAMPOLINE_INIT): New.
+ (array_to_constant): Make ARR parameter const.
+ (spu_trampoline_init): Rename from spu_initialize_trampoline;
+ make static; update for hook parameters.
+ * config/spu/spu-protos.h: Update decls.
+ * config/spu/spu.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/stormy16/stormy16.c (xstormy16_trampoline_init): Rename
+ from xstormy16_initialize_trampoline; make static; update for
+ hook parameters.
+ (TARGET_TRAMPOLINE_INIT): New.
+ * config/stormy16/stormy16.h (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/v850/v850.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (v850_can_eliminate): Make static.
+ (v850_asm_trampoline_template, v850_trampoline_init): New.
+ * config/v850/v850.h (TRAMPOLINE_TEMPLATE): Move code to
+ v850_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to v850_trampoline_init
+ and adjust for target hook parameters.
+
+ * config/vax/vax.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (vax_asm_trampoline_template, vax_trampoline_init): New.
+ * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Move code to
+ vax_asm_trampoline_template.
+ (INITIALIZE_TRAMPOLINE): Move code to vax_trampoline_init.
+
+ * config/xtensa/xtensa.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
+ (TARGET_TRAMPOLINE_INIT): New.
+ (xtensa_asm_trampoline_template): Rename from
+ xtensa_trampoline_template; make static.
+ (xtensa_trampoline_init): Rename from xtensa_initialize_trampoline;
+ make static; update for hook parameters.
+ * config/xtensa/xtensa-protos.h: Remove trampoline decls.
+ * config/xtensa/xtensa.h (TRAMPOLINE_TEMPLATE): Remove.
+ (INITIALIZE_TRAMPOLINE): Remove.
+
+ * config/i386/i386.c (ix86_function_regparm): Do not issue an
+ error for nested functions with regparm=3.
+ (ix86_compute_frame_layout): Adjust frame pointer offset for
+ ix86_static_chain_on_stack.
+ (ix86_expand_prologue): Handle ix86_static_chain_on_stack.
+ (ix86_emit_restore_reg_using_pop): Increment ix86_cfa_state->offset,
+ don't reset to UNITS_PER_WORD.
+ (ix86_emit_leave): Adjust ix86_cfa_state.
+ (ix86_expand_epilogue): Handle ix86_static_chain_on_stack.
+ (ix86_static_chain): New.
+ (ix86_trampoline_init): Rename from x86_initialize_trampoline;
+ make static; update for target hook parameters; use ix86_static_chain.
+ (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New.
+ * config/i386/i386.h (STATIC_CHAIN_REGNUM): Remove.
+ (INITIALIZE_TRAMPOLINE): Remove.
+ (TRAMPOLINE_SIZE): Use 24 for 64-bit.
+ (struct machine_function): Use BOOL_BITFIELD; rearrange bitfields
+ to the end. Add static_chain_on_stack.
+ (ix86_static_chain_on_stack): New.
+
+ * config/m68k/m68k.c (TARGET_TRAMPOLINE_INIT): New.
+ (m68k_output_mi_thunk): Don't use static_chain_rtx.
+ (m68k_trampoline_init): New.
+ * config/m68k/m68k.h (INITIALIZE_TRAMPOLINE): Move code to
+ m68k_trampoline_init and adjust for hook parameters.
+ * config/m68k/netbsd-elf.h (TRAMPOLINE_TEMPLATE): Remove.
+ (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Remove.
+
+2009-09-22 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes
+ for __builtin_altivec_vcmpgt{sb,uh,sh,uw}.
+
+ * reload1.c (reload): Call wrap_constant when substituting
+ reg for equiv inside of DEBUG_INSNs.
+
+ PR bootstrap/41405
+ * dwarf2out.c (base_type_die, record_type_tag, gen_subprogram_die,
+ add_call_src_coords_attributes, add_high_low_attributes,
+ gen_compile_unit_die, gen_type_die_with_usage force_decl_die,
+ gen_decl_die, dwarf2out_imported_module_or_decl_1, dwarf2out_finish,
+ dwarf2out_imported_module_or_decl): Avoid using DWARF3 additions
+ when -gdwarf-2 -gstrict-dwarf.
+ (loc_list_from_tree): Likewise. Avoid using DWARF4 additions when
+ -gdwarf-[23] -gstrict-dwarf.
+ (address_of_int_loc_descriptor, loc_descriptor,
+ loc_list_for_address_of_addr_expr_of_indirect_ref): Avoid using
+ DWARF4 additions when -gdwarf-[23] -gstrict-dwarf.
+ * common.opt (gno-strict-dwarf, gstrict-dwarf): New options.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41428
+ * tree-ssa-ccp.c (ccp_fold_stmt): New function.
+ (ccp_finalize): Pass it to substitute_and_fold.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-propagate.h (ssa_prop_fold_stmt_fn): Declare.
+ (substitute_and_fold): Adjust prototype.
+ * tree-vrp.c (vrp_evaluate_conditional): Make static.
+ (simplify_stmt_using_ranges): Likewise.
+ (fold_predicate_in): Move here from tree-ssa-propagate.c.
+ (vrp_fold_stmt): New function.
+ (vrp_finalize): Pass it to substitute_and_fold.
+ * tree-flow.h (vrp_evaluate_conditional): Remove.
+ (simplify_stmt_using_ranges): Likewise.
+ * tree-ssa-ccp.c (ccp_finalize): Adjust call to substitute_and_fold.
+ * tree-ssa-copy.c (fini_copy_prop): Likewise.
+ * tree-ssa-propagate.c (struct prop_stats_d): Rename num_pred_folded
+ member.
+ (fold_predicate_in): Move to tree-vrp.c.
+ (substitute_and_fold): Use the callback instead of calling into
+ tree-vrp.c functions directly.
+
+2009-09-22 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (address_of_int_loc_descriptor): Avoid signed/unsigned
+ comparison warning on rs6000.
+
+ PR middle-end/41429
+ * tree-cfg.c (remove_useless_stmts_tc): Call gsi_next (gsi) even for
+ GIMPLE_EH_MUST_NOT_THROW cleanup.
+ (verify_types_in_gimple_stmt): Handle GIMPLE_EH_MUST_NOT_THROW.
+
+2009-09-22 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR middle-end/41260
+ * gcc/config.gcc: Use darwin9.h and darwin10.h on darwin10 and later.
+ * gcc/config/darwin10.h: Add file to pass -no_compact_unwind on
+ LIB_SPEC for darwin10 and later since it always uses the unwinder in
+ libSystem which is derived from the gcc 4.2.1 unwinder.
+
+2009-09-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR middle-end/41357
+ * varasm.c (default_encode_section_info): Copy TLS model into
+ sym_ref flags regardless of backend support for TLS, for all
+ model types except TLS_MODEL_EMULATED.
+
+2009-09-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR bootstrap/41404
+ * dwarf2out.c (mem_loc_descriptor): Punt on CONST_STRING until
+ we can handle it correctly.
+
2009-09-21 Gerald Pfeifer <gerald@pfeifer.com>
* doc/install.texi (os2): Remove section.
@@ -8,8 +764,8 @@
2009-09-21 Giuseppe Scrivano <gscrivano@gnu.org>
- * tree-tailcall.c (process_assignment): Don't check if a multiplication
- or an addition are already present.
+ * tree-tailcall.c (process_assignment): Don't check if a
+ multiplication or an addition are already present.
(find_tail_calls): Combine multiple additions and multiplications.
(adjust_accumulator_values): Emit accumulators.
@@ -45,7 +801,8 @@
2009-09-20 Jan Hubicka <jh@suse.cz>
* dwarf2out.c (add_const_value_attribute): Return true if successful.
- (add_location_or_const_value_attribute): Rewrite using loc_list_from_tree.
+ (add_location_or_const_value_attribute): Rewrite using
+ loc_list_from_tree.
(tree_add_const_value_attribute): Return true if successful.
(tree_add_const_value_attribute_for_decl): Likewise.
@@ -143,8 +900,7 @@
* configure: Regenerate.
* doc/invoke.texi (Option Summary): Add -mrelax-pic-calls
and -mno-relax-pic-calls.
- (MIPS Options): Document -mrelax-pic-calls
- and -mno-relax-pic-calls.
+ (MIPS Options): Document -mrelax-pic-calls and -mno-relax-pic-calls.
2009-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
@@ -187,7 +943,6 @@
INTERESTING_STRINGOP_TO_PROFILE_P to find size argument.
* value-prof.c (gimple_stringops_transform): Update call sites to
INTERESTING_STRINGOP_TO_PROFILE_P to reflect parameter change.
- * testsuite/gcc.dg/tree-prof/val-prof-7.c: Added test case.
2009-09-18 Uros Bizjak <ubizjak@gmail.com>
@@ -4916,12 +5671,6 @@
(graphite_carried_dependence_level_k): Free unused objects before
returning.
- * testsuite/gcc.dg/graphite/interchange-1.c: XFAILed.
- * testsuite/gcc.dg/graphite/interchange-2.c: XFAILed.
- * testsuite/gcc.dg/graphite/interchange-3.c: XFAILed.
- * testsuite/gcc.dg/graphite/interchange-4.c: XFAILed.
- * testsuite/gcc.dg/graphite/interchange-7.c: XFAILed.
-
2009-08-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (scop_do_strip_mine): Call store_scattering.
@@ -11575,8 +12324,6 @@
* config/m68k/linux.h (HAVE_GAS_BALIGN_AND_P2ALIGN): Move to ...
* config/m68k/m68k.h: ... here.
- * testsuite/gcc.dg/falign-labels.c (dg-options): Don't restrict for
- m68k and fido.
2009-06-03 Martin Jambor <mjambor@suse.cz>
@@ -20230,8 +20977,6 @@
PR target/39501
* arm.md (movsfcc): Disable if not TARGET_HARD_FLOAT.
- * testsuite/gcc.c-torture/execute/pr39501.c: New file.
- * testsuite/gcc.c-torture/execute/pr39501.x: New file.
2009-04-04 Richard Guenther <rguenther@suse.de>
@@ -24291,7 +25036,6 @@
(struct scop): Remove bbs_b bitmap and loop2cloog_loop.
(loop_domain_dim, loop_iteration_vector_dim): Remove.
(SCOP_BBS_B, bb_in_scop_p, loop_in_scop_p): Removed.
- * testsuite/gcc.dg/graphite/scop-19.c: New
2009-02-04 Paolo Bonzini <bonzini@gnu.org>
Hans-Peter Nilsson <hp@axis.com>
@@ -25328,7 +26072,6 @@
PR middlend/38385
* tree-loop-distribution.c (prop_phis): New function.
(generate_builtin): Call prop_phis.
- * testsuite/gcc.dg/tree-ssa/pr38385.c: New file.
2009-01-12 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/ChangeLog.dwarf4 b/gcc/ChangeLog.dwarf4
index e91368d3f9d..ff0d35ccb99 100644
--- a/gcc/ChangeLog.dwarf4
+++ b/gcc/ChangeLog.dwarf4
@@ -1,3 +1,11 @@
+2009-09-25 Cary Coutant <ccoutant@google.com>
+
+ Merged revisions 151950:152181 from trunk.
+
+2009-09-23 Cary Coutant <ccoutant@google.com>
+
+ Merged revisions 144680:151949 from trunk.
+
2009-08-18 Cary Coutant <ccoutant@google.com>
* dwarf2out.c (copy_ancestor_tree): Move use of slot pointer
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 1e5e45b24d3..c53e97861f6 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20090921
+20090925
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index fde75ca3198..eb5ac93453f 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -4175,7 +4175,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \
intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) $(C_COMMON_H) $(C_PRETTY_PRINT_H) \
tree-iterator.h $(PLUGIN_H) $(TREE_FLOW_H) langhooks.h incpath.h \
- tree-ssa-sccvn.h
+ tree-ssa-sccvn.h real.h
# Install the headers needed to build a plugin.
install-plugin: installdirs lang.install-plugin
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index dddef52d6f4..121aac7c591 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,4 +1,61 @@
-2009-09-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+2009-09-25 Olivier Hainquqe <hainque@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (TYPE_REPRESENTATIVE_ARRAY): New language
+ specific node. Representative array type for VECTOR_TYPE entities.
+ * gcc-interface/utils.c (handle_vector_type_attribute): New handler.
+ Turn an ARRAY_TYPE entity into a VECTOR_TYPE.
+ (gnat_types_compatible_p): Handle VECTOR_TYPEs.
+ (convert): Likewise. Arrange to produce VECTOR_CST out of constant
+ array aggregates for VECTOR_TYPE entities.
+ (unchecked_convert): Likewise.
+ (maybe_vector_array): New function. If EXP has VECTOR_TYPE, return EXP
+ converted to the associated TYPE_REPRESENTATIVE_ARRAY.
+ (handle_pure_attribute, handle_sentinel_attribute,
+ handle_noreturn_attribute, handle_malloc_attribute,
+ handle_vector_size_attribute): Replace uses of qE format by qs.
+ Remove GCC_DIAG_STYLE definition.
+ * gcc-interface/trans.c (gnat_to_gnu) <N_Indexed_Component>: Convert
+ vector input to representative array type on entry.
+ <N_Op_Eq, etc>: Likewise.
+ * gcc-interface/gigi.h (maybe_vector_array): Declare.
+ (VECTOR_TYPE_P): New predicate.
+ * gcc-interface/misc.c (gnat_print_type): Handle VECTOR_TYPE.
+
+2009-09-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada.h: Fix outdated comment.
+ * gcc-interface/ada-tree.h (SET_TYPE_RM_VALUE): Use MARK_VISITED in
+ lieu of mark_visited.
+ * gcc-interface/gigi.h (mark_visited): Change type of parameter.
+ (MARK_VISITED): New macro.
+ (gnat_truthvalue_conversion): Delete.
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Use MARK_VISITED in lieu
+ of mark_visited.
+ (annotate_rep): Fix formatting and tidy.
+ (compute_field_positions): Get rid of useless variable.
+ * gcc-interface/trans.c (gnat_to_gnu): Retrieve the Nkind of the GNAT
+ node only once. Use IN operator for the Nkind in more cases.
+ Remove calls to gnat_truthvalue_conversion.
+ (mark_visited): Change type of parameter and adjust.
+ (mark_visited_r): Dereference TP only once.
+ (add_decl_expr): Use MARK_VISITED in lieu of mark_visited.
+ * gcc-interface/utils2.c (gnat_truthvalue_conversion): Delete.
+ (build_binary_op): Remove calls to gnat_truthvalue_conversion.
+ (build_unary_op): Likewise.
+
+2009-09-24 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS): Simplify test for
+ a-except% in target pairs list; don't (implicitly) compare whitespace.
+
+2009-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc-interface/utils.c (gnat_pushdecl): Don't set
+ DECL_NO_STATIC_CHAIN, set DECL_STATIC_CHAIN for
+ nested functions.
+
+2009-09-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* s-osinte-rtems.ad[bs]: Get_Page_Size cannot return 0.
Bind to getpagesize() in RTEMS 4.10 and newer.
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index bc2ad926eff..cf717ac39cd 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2128,7 +2128,7 @@ endif
# These base versions lack Ada 2005 additions which would cause bootstrap
# problems if included in the compiler and other basic tools.
-ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
+ifeq ($(filter a-except%,$(LIBGNAT_TARGET_PAIRS)),)
LIBGNAT_TARGET_PAIRS += \
a-except.ads<a-except-2005.ads \
a-except.adb<a-except-2005.adb
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 18eb41657cf..94b18bde6b5 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -195,6 +195,10 @@ do { \
refer to the routine gnat_to_gnu_entity. */
#define TYPE_CI_CO_LIST(NODE) TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE))
+/* For a VECTOR_TYPE, this is the representative array type. */
+#define TYPE_REPRESENTATIVE_ARRAY(NODE) \
+ TYPE_LANG_SLOT_1 (VECTOR_TYPE_CHECK (NODE))
+
/* For numerical types, this holds various RM-defined values. */
#define TYPE_RM_VALUES(NODE) TYPE_LANG_SLOT_1 (NUMERICAL_TYPE_CHECK (NODE))
@@ -210,8 +214,7 @@ do { \
TYPE_RM_VALUES (NODE) = make_tree_vec (3); \
/* ??? The field is not visited by the generic \
code so we need to mark it manually. */ \
- if (!TREE_CONSTANT (tmp)) \
- mark_visited (&tmp); \
+ MARK_VISITED (tmp); \
TREE_VEC_ELT (TYPE_RM_VALUES (NODE), (N)) = tmp; \
} while (0)
diff --git a/gcc/ada/gcc-interface/ada.h b/gcc/ada/gcc-interface/ada.h
index 6c2a1419f53..095dec3d6ad 100644
--- a/gcc/ada/gcc-interface/ada.h
+++ b/gcc/ada/gcc-interface/ada.h
@@ -62,9 +62,9 @@
enum { CAT (SUBTYPE,__First) = FIRST, \
CAT (SUBTYPE,__Last) = LAST };
-/* The following definitions provide the equivalent of the Ada IN and NOT IN
- operators, assuming that the subtype involved has been defined using the
- SUBTYPE macro defined above. */
+/* The following definition provides the equivalent of the Ada IN operator,
+ assuming that the subtype involved has been defined using the SUBTYPE
+ macro defined above. */
#define IN(VALUE,SUBTYPE) \
(((VALUE) >= (SUBTYPE) CAT (SUBTYPE,__First)) \
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 58c07a777d7..1e54f38b0a5 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -898,11 +898,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (stable)
{
- gnu_decl = maybe_stable_expr;
/* ??? No DECL_EXPR is created so we need to mark
the expression manually lest it is shared. */
if (global_bindings_p ())
- mark_visited (&gnu_decl);
+ MARK_VISITED (maybe_stable_expr);
+ gnu_decl = maybe_stable_expr;
save_gnu_tree (gnat_entity, gnu_decl, true);
saved = true;
annotate_object (gnat_entity, gnu_type, NULL_TREE,
@@ -2465,7 +2465,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* ??? create_type_decl is not invoked on the inner types so
the MULT_EXPR node built above will never be marked. */
- mark_visited (&TYPE_SIZE_UNIT (gnu_arr_type));
+ MARK_VISITED (TYPE_SIZE_UNIT (gnu_arr_type));
}
}
@@ -4631,7 +4631,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
the MULT_EXPR node built above may not be marked by the call
to create_type_decl below. */
if (global_bindings_p ())
- mark_visited (&DECL_FIELD_OFFSET (gnu_field));
+ MARK_VISITED (DECL_FIELD_OFFSET (gnu_field));
}
}
@@ -7271,78 +7271,76 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
UI_From_Int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT));
}
-/* Given GNAT_ENTITY, a record type, and GNU_TYPE, its corresponding
- GCC type, set Component_Bit_Offset and Esize to the position and size
- used by Gigi. */
+/* Given GNAT_ENTITY, a record type, and GNU_TYPE, its corresponding GCC type,
+ set Component_Bit_Offset and Esize of the components to the position and
+ size used by Gigi. */
static void
annotate_rep (Entity_Id gnat_entity, tree gnu_type)
{
- tree gnu_list;
- tree gnu_entry;
Entity_Id gnat_field;
+ tree gnu_list;
- /* We operate by first making a list of all fields and their positions
- (we can get the sizes easily at any time) by a recursive call
- and then update all the sizes into the tree. */
- gnu_list = compute_field_positions (gnu_type, NULL_TREE,
- size_zero_node, bitsize_zero_node,
- BIGGEST_ALIGNMENT);
+ /* We operate by first making a list of all fields and their position (we
+ can get the size easily) and then update all the sizes in the tree. */
+ gnu_list = compute_field_positions (gnu_type, NULL_TREE, size_zero_node,
+ bitsize_zero_node, BIGGEST_ALIGNMENT);
- for (gnat_field = First_Entity (gnat_entity); Present (gnat_field);
+ for (gnat_field = First_Entity (gnat_entity);
+ Present (gnat_field);
gnat_field = Next_Entity (gnat_field))
- if ((Ekind (gnat_field) == E_Component
- || (Ekind (gnat_field) == E_Discriminant
- && !Is_Unchecked_Union (Scope (gnat_field)))))
+ if (Ekind (gnat_field) == E_Component
+ || (Ekind (gnat_field) == E_Discriminant
+ && !Is_Unchecked_Union (Scope (gnat_field))))
{
- tree parent_offset = bitsize_zero_node;
+ tree parent_offset, t;
- gnu_entry = purpose_member (gnat_to_gnu_field_decl (gnat_field),
- gnu_list);
-
- if (gnu_entry)
+ t = purpose_member (gnat_to_gnu_field_decl (gnat_field), gnu_list);
+ if (t)
{
if (type_annotate_only && Is_Tagged_Type (gnat_entity))
{
- /* In this mode the tag and parent components have not been
+ /* In this mode the tag and parent components are not
generated, so we add the appropriate offset to each
component. For a component appearing in the current
extension, the offset is the size of the parent. */
- if (Is_Derived_Type (gnat_entity)
- && Original_Record_Component (gnat_field) == gnat_field)
- parent_offset
- = UI_To_gnu (Esize (Etype (Base_Type (gnat_entity))),
- bitsizetype);
- else
- parent_offset = bitsize_int (POINTER_SIZE);
+ if (Is_Derived_Type (gnat_entity)
+ && Original_Record_Component (gnat_field) == gnat_field)
+ parent_offset
+ = UI_To_gnu (Esize (Etype (Base_Type (gnat_entity))),
+ bitsizetype);
+ else
+ parent_offset = bitsize_int (POINTER_SIZE);
}
+ else
+ parent_offset = bitsize_zero_node;
- Set_Component_Bit_Offset
- (gnat_field,
- annotate_value
- (size_binop (PLUS_EXPR,
- bit_from_pos (TREE_PURPOSE (TREE_VALUE (gnu_entry)),
- TREE_VALUE (TREE_VALUE
- (TREE_VALUE (gnu_entry)))),
- parent_offset)));
+ Set_Component_Bit_Offset
+ (gnat_field,
+ annotate_value
+ (size_binop (PLUS_EXPR,
+ bit_from_pos (TREE_PURPOSE (TREE_VALUE (t)),
+ TREE_VALUE (TREE_VALUE
+ (TREE_VALUE (t)))),
+ parent_offset)));
Set_Esize (gnat_field,
- annotate_value (DECL_SIZE (TREE_PURPOSE (gnu_entry))));
+ annotate_value (DECL_SIZE (TREE_PURPOSE (t))));
}
- else if (Is_Tagged_Type (gnat_entity)
- && Is_Derived_Type (gnat_entity))
+ else if (Is_Tagged_Type (gnat_entity) && Is_Derived_Type (gnat_entity))
{
- /* If there is no gnu_entry, this is an inherited component whose
+ /* If there is no entry, this is an inherited component whose
position is the same as in the parent type. */
Set_Component_Bit_Offset
(gnat_field,
Component_Bit_Offset (Original_Record_Component (gnat_field)));
+
Set_Esize (gnat_field,
Esize (Original_Record_Component (gnat_field)));
}
}
}
-
+
/* Scan all fields in GNU_TYPE and build entries where TREE_PURPOSE is the
FIELD_DECL and TREE_VALUE a TREE_LIST with TREE_PURPOSE being the byte
position and TREE_VALUE being a TREE_LIST with TREE_PURPOSE the value to be
@@ -7356,9 +7354,9 @@ compute_field_positions (tree gnu_type, tree gnu_list, tree gnu_pos,
tree gnu_bitpos, unsigned int offset_align)
{
tree gnu_field;
- tree gnu_result = gnu_list;
- for (gnu_field = TYPE_FIELDS (gnu_type); gnu_field;
+ for (gnu_field = TYPE_FIELDS (gnu_type);
+ gnu_field;
gnu_field = TREE_CHAIN (gnu_field))
{
tree gnu_our_bitpos = size_binop (PLUS_EXPR, gnu_bitpos,
@@ -7368,22 +7366,22 @@ compute_field_positions (tree gnu_type, tree gnu_list, tree gnu_pos,
unsigned int our_offset_align
= MIN (offset_align, DECL_OFFSET_ALIGN (gnu_field));
- gnu_result
+ gnu_list
= tree_cons (gnu_field,
tree_cons (gnu_our_offset,
tree_cons (size_int (our_offset_align),
gnu_our_bitpos, NULL_TREE),
NULL_TREE),
- gnu_result);
+ gnu_list);
if (DECL_INTERNAL_P (gnu_field))
- gnu_result
- = compute_field_positions (TREE_TYPE (gnu_field), gnu_result,
+ gnu_list
+ = compute_field_positions (TREE_TYPE (gnu_field), gnu_list,
gnu_our_offset, gnu_our_bitpos,
our_offset_align);
}
- return gnu_result;
+ return gnu_list;
}
/* UINT_SIZE is a Uint giving the specified size for an object of GNU_TYPE
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index a6171b26578..ea1a65d485b 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -75,10 +75,19 @@ extern void set_block_for_group (tree);
Get SLOC from GNAT_ENTITY. */
extern void add_decl_expr (tree gnu_decl, Entity_Id gnat_entity);
-/* Mark nodes rooted at *TP with TREE_VISITED and types as having their
+/* Mark nodes rooted at T with TREE_VISITED and types as having their
sized gimplified. We use this to indicate all variable sizes and
positions in global types may not be shared by any subprogram. */
-extern void mark_visited (tree *tp);
+extern void mark_visited (tree t);
+
+/* This macro calls the above function but short-circuits the common
+ case of a constant to save time and also checks for NULL. */
+
+#define MARK_VISITED(EXP) \
+do { \
+ if((EXP) && !TREE_CONSTANT (EXP)) \
+ mark_visited (EXP); \
+} while (0)
/* Finalize any From_With_Type incomplete types. We do this after processing
our compilation unit and after processing its spec, if this is a body. */
@@ -741,6 +750,10 @@ extern tree remove_conversions (tree exp, bool true_address);
likewise return an expression pointing to the underlying array. */
extern tree maybe_unconstrained_array (tree exp);
+/* If EXP's type is a VECTOR_TYPE, return EXP converted to the associated
+ TYPE_REPRESENTATIVE_ARRAY. */
+extern tree maybe_vector_array (tree exp);
+
/* Return an expression that does an unchecked conversion of EXPR to TYPE.
If NOTRUNC_P is true, truncation operations should be suppressed. */
extern tree unchecked_convert (tree type, tree expr, bool notrunc_p);
@@ -767,20 +780,6 @@ extern bool is_double_scalar_or_array (Entity_Id gnat_type,
component of an aggregate type. */
extern bool type_for_nonaliased_component_p (tree gnu_type);
-/* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
- operation.
-
- This preparation consists of taking the ordinary
- representation of an expression EXPR and producing a valid tree
- boolean expression describing whether EXPR is nonzero. We could
- simply always do build_binary_op (NE_EXPR, expr, integer_zero_node, 1),
- but we optimize comparisons, &&, ||, and !.
-
- The resulting type should always be the same as the input type.
- This function is simpler than the corresponding C version since
- the only possible operands will be things of Boolean type. */
-extern tree gnat_truthvalue_conversion (tree expr);
-
/* Return the base type of TYPE. */
extern tree get_base_type (tree type);
@@ -956,3 +955,6 @@ extern Nat get_target_double_scalar_alignment (void);
#ifndef TARGET_MALLOC64
#define TARGET_MALLOC64 0
#endif
+
+/* Convenient shortcuts. */
+#define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 26df68de581..67823789ab3 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -521,6 +521,11 @@ gnat_print_type (FILE *file, tree node, int indent)
print_node (file,"actual bounds", TYPE_ACTUAL_BOUNDS (node), indent + 4);
break;
+ case VECTOR_TYPE:
+ print_node (file,"representative array",
+ TYPE_REPRESENTATIVE_ARRAY (node), indent + 4);
+ break;
+
case RECORD_TYPE:
if (TYPE_IS_FAT_POINTER_P (node) || TYPE_CONTAINS_TEMPLATE_P (node))
print_node (file, "unconstrained array",
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index a90a7a060bc..7037a6ef990 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -3454,64 +3454,55 @@ unchecked_conversion_lhs_nop (Node_Id gnat_node)
return false;
}
-/* This function is the driver of the GNAT to GCC tree transformation
- process. It is the entry point of the tree transformer. GNAT_NODE is the
- root of some GNAT tree. Return the root of the corresponding GCC tree.
- If this is an expression, return the GCC equivalent of the expression. If
- it is a statement, return the statement. In the case when called for a
- statement, it may also add statements to the current statement group, in
- which case anything it returns is to be interpreted as occurring after
- anything `it already added. */
+/* This function is the driver of the GNAT to GCC tree transformation process.
+ It is the entry point of the tree transformer. GNAT_NODE is the root of
+ some GNAT tree. Return the root of the corresponding GCC tree. If this
+ is an expression, return the GCC equivalent of the expression. If this
+ is a statement, return the statement or add it to the current statement
+ group, in which case anything returned is to be interpreted as occurring
+ after anything added. */
tree
gnat_to_gnu (Node_Id gnat_node)
{
+ const Node_Kind kind = Nkind (gnat_node);
bool went_into_elab_proc = false;
tree gnu_result = error_mark_node; /* Default to no value. */
tree gnu_result_type = void_type_node;
- tree gnu_expr;
- tree gnu_lhs, gnu_rhs;
+ tree gnu_expr, gnu_lhs, gnu_rhs;
Node_Id gnat_temp;
/* Save node number for error message and set location information. */
error_gnat_node = gnat_node;
Sloc_to_locus (Sloc (gnat_node), &input_location);
- if (type_annotate_only
- && IN (Nkind (gnat_node), N_Statement_Other_Than_Procedure_Call))
+ /* If this node is a statement and we are only annotating types, return an
+ empty statement list. */
+ if (type_annotate_only && IN (kind, N_Statement_Other_Than_Procedure_Call))
return alloc_stmt_list ();
- /* If this node is a non-static subexpression and we are only
- annotating types, make this into a NULL_EXPR. */
+ /* If this node is a non-static subexpression and we are only annotating
+ types, make this into a NULL_EXPR. */
if (type_annotate_only
- && IN (Nkind (gnat_node), N_Subexpr)
- && Nkind (gnat_node) != N_Identifier
+ && IN (kind, N_Subexpr)
+ && kind != N_Identifier
&& !Compile_Time_Known_Value (gnat_node))
return build1 (NULL_EXPR, get_unpadded_type (Etype (gnat_node)),
build_call_raise (CE_Range_Check_Failed, gnat_node,
N_Raise_Constraint_Error));
- /* If this is a Statement and we are at top level, it must be part of the
- elaboration procedure, so mark us as being in that procedure and push our
- context.
-
- If we are in the elaboration procedure, check if we are violating a
- No_Elaboration_Code restriction by having a statement there. */
- if ((IN (Nkind (gnat_node), N_Statement_Other_Than_Procedure_Call)
- && Nkind (gnat_node) != N_Null_Statement
- && Nkind (gnat_node) != N_SCIL_Dispatch_Table_Object_Init
- && Nkind (gnat_node) != N_SCIL_Dispatch_Table_Tag_Init
- && Nkind (gnat_node) != N_SCIL_Dispatching_Call
- && Nkind (gnat_node) != N_SCIL_Tag_Init)
- || Nkind (gnat_node) == N_Procedure_Call_Statement
- || Nkind (gnat_node) == N_Label
- || Nkind (gnat_node) == N_Implicit_Label_Declaration
- || Nkind (gnat_node) == N_Handled_Sequence_Of_Statements
- || ((Nkind (gnat_node) == N_Raise_Constraint_Error
- || Nkind (gnat_node) == N_Raise_Storage_Error
- || Nkind (gnat_node) == N_Raise_Program_Error)
- && (Ekind (Etype (gnat_node)) == E_Void)))
+ if ((IN (kind, N_Statement_Other_Than_Procedure_Call)
+ && !IN (kind, N_SCIL_Node)
+ && kind != N_Null_Statement)
+ || kind == N_Procedure_Call_Statement
+ || kind == N_Label
+ || kind == N_Implicit_Label_Declaration
+ || kind == N_Handled_Sequence_Of_Statements
+ || (IN (kind, N_Raise_xxx_Error) && Ekind (Etype (gnat_node)) == E_Void))
{
+ /* If this is a statement and we are at top level, it must be part of
+ the elaboration procedure, so mark us as being in that procedure
+ and push our context. */
if (!current_function_decl)
{
current_function_decl = TREE_VALUE (gnu_elab_proc_stack);
@@ -3520,18 +3511,19 @@ gnat_to_gnu (Node_Id gnat_node)
went_into_elab_proc = true;
}
- /* Don't check for a possible No_Elaboration_Code restriction violation
- on N_Handled_Sequence_Of_Statements, as we want to signal an error on
+ /* If we are in the elaboration procedure, check if we are violating a
+ No_Elaboration_Code restriction by having a statement there. Don't
+ check for a possible No_Elaboration_Code restriction violation on
+ N_Handled_Sequence_Of_Statements, as we want to signal an error on
every nested real statement instead. This also avoids triggering
spurious errors on dummy (empty) sequences created by the front-end
for package bodies in some cases. */
-
if (current_function_decl == TREE_VALUE (gnu_elab_proc_stack)
- && Nkind (gnat_node) != N_Handled_Sequence_Of_Statements)
+ && kind != N_Handled_Sequence_Of_Statements)
Check_Elaboration_Code_Allowed (gnat_node);
}
- switch (Nkind (gnat_node))
+ switch (kind)
{
/********************************/
/* Chapter 2: Lexical Elements */
@@ -3743,8 +3735,7 @@ gnat_to_gnu (Node_Id gnat_node)
break;
if (Present (Expression (gnat_node))
- && !(Nkind (gnat_node) == N_Object_Declaration
- && No_Initialization (gnat_node))
+ && !(kind == N_Object_Declaration && No_Initialization (gnat_node))
&& (!type_annotate_only
|| Compile_Time_Known_Value (Expression (gnat_node))))
{
@@ -3841,6 +3832,11 @@ gnat_to_gnu (Node_Id gnat_node)
Node_Id *gnat_expr_array;
gnu_array_object = maybe_implicit_deref (gnu_array_object);
+
+ /* Convert vector inputs to their representative array type, to fit
+ what the code below expects. */
+ gnu_array_object = maybe_vector_array (gnu_array_object);
+
gnu_array_object = maybe_unconstrained_array (gnu_array_object);
/* If we got a padded type, remove it too. */
@@ -4086,6 +4082,8 @@ gnat_to_gnu (Node_Id gnat_node)
&& TYPE_CONTAINS_TEMPLATE_P (gnu_result_type))
gnu_aggr_type
= TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_result_type)));
+ else if (TREE_CODE (gnu_result_type) == VECTOR_TYPE)
+ gnu_aggr_type = TYPE_REPRESENTATIVE_ARRAY (gnu_result_type);
if (Null_Record_Present (gnat_node))
gnu_result = gnat_build_constructor (gnu_aggr_type, NULL_TREE);
@@ -4136,7 +4134,7 @@ gnat_to_gnu (Node_Id gnat_node)
= convert_with_check (Etype (gnat_node), gnu_result,
Do_Overflow_Check (gnat_node),
Do_Range_Check (Expression (gnat_node)),
- Nkind (gnat_node) == N_Type_Conversion
+ kind == N_Type_Conversion
&& Float_Truncate (gnat_node), gnat_node);
break;
@@ -4224,7 +4222,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_object, gnu_high));
}
- if (Nkind (gnat_node) == N_Not_In)
+ if (kind == N_Not_In)
gnu_result = invert_truthvalue (gnu_result);
}
break;
@@ -4248,8 +4246,8 @@ gnat_to_gnu (Node_Id gnat_node)
Modular_Integer_Kind))
{
enum tree_code code
- = (Nkind (gnat_node) == N_Op_Or ? BIT_IOR_EXPR
- : Nkind (gnat_node) == N_Op_And ? BIT_AND_EXPR
+ = (kind == N_Op_Or ? BIT_IOR_EXPR
+ : kind == N_Op_And ? BIT_AND_EXPR
: BIT_XOR_EXPR);
gnu_lhs = gnat_to_gnu (Left_Opnd (gnat_node));
@@ -4273,7 +4271,7 @@ gnat_to_gnu (Node_Id gnat_node)
case N_Op_Shift_Right_Arithmetic:
case N_And_Then: case N_Or_Else:
{
- enum tree_code code = gnu_codes[Nkind (gnat_node)];
+ enum tree_code code = gnu_codes[kind];
bool ignore_lhs_overflow = false;
tree gnu_type;
@@ -4281,6 +4279,12 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_rhs = gnat_to_gnu (Right_Opnd (gnat_node));
gnu_type = gnu_result_type = get_unpadded_type (Etype (gnat_node));
+ /* Pending generic support for efficient vector logical operations in
+ GCC, convert vectors to their representative array type view and
+ fallthrough. */
+ gnu_lhs = maybe_vector_array (gnu_lhs);
+ gnu_rhs = maybe_vector_array (gnu_rhs);
+
/* If this is a comparison operator, convert any references to
an unconstrained array value into a reference to the
actual array. */
@@ -4299,18 +4303,16 @@ gnat_to_gnu (Node_Id gnat_node)
/* If this is a shift whose count is not guaranteed to be correct,
we need to adjust the shift count. */
- if (IN (Nkind (gnat_node), N_Op_Shift)
- && !Shift_Count_OK (gnat_node))
+ if (IN (kind, N_Op_Shift) && !Shift_Count_OK (gnat_node))
{
tree gnu_count_type = get_base_type (TREE_TYPE (gnu_rhs));
tree gnu_max_shift
= convert (gnu_count_type, TYPE_SIZE (gnu_type));
- if (Nkind (gnat_node) == N_Op_Rotate_Left
- || Nkind (gnat_node) == N_Op_Rotate_Right)
+ if (kind == N_Op_Rotate_Left || kind == N_Op_Rotate_Right)
gnu_rhs = build_binary_op (TRUNC_MOD_EXPR, gnu_count_type,
gnu_rhs, gnu_max_shift);
- else if (Nkind (gnat_node) == N_Op_Shift_Right_Arithmetic)
+ else if (kind == N_Op_Shift_Right_Arithmetic)
gnu_rhs
= build_binary_op
(MIN_EXPR, gnu_count_type,
@@ -4326,13 +4328,12 @@ gnat_to_gnu (Node_Id gnat_node)
so we may need to choose a different type. In this case,
we have to ignore integer overflow lest it propagates all
the way down and causes a CE to be explicitly raised. */
- if (Nkind (gnat_node) == N_Op_Shift_Right
- && !TYPE_UNSIGNED (gnu_type))
+ if (kind == N_Op_Shift_Right && !TYPE_UNSIGNED (gnu_type))
{
gnu_type = gnat_unsigned_type (gnu_type);
ignore_lhs_overflow = true;
}
- else if (Nkind (gnat_node) == N_Op_Shift_Right_Arithmetic
+ else if (kind == N_Op_Shift_Right_Arithmetic
&& TYPE_UNSIGNED (gnu_type))
{
gnu_type = gnat_signed_type (gnu_type);
@@ -4355,9 +4356,9 @@ gnat_to_gnu (Node_Id gnat_node)
do overflow checking, do it here. The goal is to push
the expansions further into the back end over time. */
if (Do_Overflow_Check (gnat_node) && Backend_Overflow_Checks_On_Target
- && (Nkind (gnat_node) == N_Op_Add
- || Nkind (gnat_node) == N_Op_Subtract
- || Nkind (gnat_node) == N_Op_Multiply)
+ && (kind == N_Op_Add
+ || kind == N_Op_Subtract
+ || kind == N_Op_Multiply)
&& !TYPE_UNSIGNED (gnu_type)
&& !FLOAT_TYPE_P (gnu_type))
gnu_result = build_binary_op_trapv (code, gnu_type,
@@ -4368,8 +4369,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* If this is a logical shift with the shift count not verified,
we must return zero if it is too large. We cannot compensate
above in this case. */
- if ((Nkind (gnat_node) == N_Op_Shift_Left
- || Nkind (gnat_node) == N_Op_Shift_Right)
+ if ((kind == N_Op_Shift_Left || kind == N_Op_Shift_Right)
&& !Shift_Count_OK (gnat_node))
gnu_result
= build_cond_expr
@@ -4391,9 +4391,8 @@ gnat_to_gnu (Node_Id gnat_node)
= gnat_to_gnu (Next (Next (First (Expressions (gnat_node)))));
gnu_result_type = get_unpadded_type (Etype (gnat_node));
- gnu_result = build_cond_expr (gnu_result_type,
- gnat_truthvalue_conversion (gnu_cond),
- gnu_true, gnu_false);
+ gnu_result
+ = build_cond_expr (gnu_result_type, gnu_cond, gnu_true, gnu_false);
}
break;
@@ -4432,10 +4431,10 @@ gnat_to_gnu (Node_Id gnat_node)
&& !TYPE_UNSIGNED (gnu_result_type)
&& !FLOAT_TYPE_P (gnu_result_type))
gnu_result
- = build_unary_op_trapv (gnu_codes[Nkind (gnat_node)],
+ = build_unary_op_trapv (gnu_codes[kind],
gnu_result_type, gnu_expr, gnat_node);
else
- gnu_result = build_unary_op (gnu_codes[Nkind (gnat_node)],
+ gnu_result = build_unary_op (gnu_codes[kind],
gnu_result_type, gnu_expr);
break;
@@ -5204,8 +5203,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_result_type = get_unpadded_type (Etype (gnat_node));
gnu_result
- = build_call_raise (UI_To_Int (Reason (gnat_node)), gnat_node,
- Nkind (gnat_node));
+ = build_call_raise (UI_To_Int (Reason (gnat_node)), gnat_node, kind);
/* If the type is VOID, this is a statement, so we need to
generate the code for the call. Handle a Condition, if there
@@ -5564,14 +5562,14 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity)
/* Mark everything as used to prevent node sharing with subprograms.
Note that walk_tree knows how to deal with TYPE_DECL, but neither
VAR_DECL nor CONST_DECL. This appears to be somewhat arbitrary. */
- mark_visited (&gnu_stmt);
+ MARK_VISITED (gnu_stmt);
if (TREE_CODE (gnu_decl) == VAR_DECL
|| TREE_CODE (gnu_decl) == CONST_DECL)
{
- mark_visited (&DECL_SIZE (gnu_decl));
- mark_visited (&DECL_SIZE_UNIT (gnu_decl));
- mark_visited (&DECL_INITIAL (gnu_decl));
+ MARK_VISITED (DECL_SIZE (gnu_decl));
+ MARK_VISITED (DECL_SIZE_UNIT (gnu_decl));
+ MARK_VISITED (DECL_INITIAL (gnu_decl));
}
}
else
@@ -5611,20 +5609,32 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity)
static tree
mark_visited_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
- if (TREE_VISITED (*tp))
+ tree t = *tp;
+
+ if (TREE_VISITED (t))
*walk_subtrees = 0;
/* Don't mark a dummy type as visited because we want to mark its sizes
and fields once it's filled in. */
- else if (!TYPE_IS_DUMMY_P (*tp))
- TREE_VISITED (*tp) = 1;
+ else if (!TYPE_IS_DUMMY_P (t))
+ TREE_VISITED (t) = 1;
- if (TYPE_P (*tp))
- TYPE_SIZES_GIMPLIFIED (*tp) = 1;
+ if (TYPE_P (t))
+ TYPE_SIZES_GIMPLIFIED (t) = 1;
return NULL_TREE;
}
+/* Mark nodes rooted at T with TREE_VISITED and types as having their
+ sized gimplified. We use this to indicate all variable sizes and
+ positions in global types may not be shared by any subprogram. */
+
+void
+mark_visited (tree t)
+{
+ walk_tree (&t, mark_visited_r, NULL, NULL);
+}
+
/* Utility function to unshare expressions wrapped up in a SAVE_EXPR. */
static tree
@@ -5639,16 +5649,6 @@ unshare_save_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
return NULL_TREE;
}
-/* Mark nodes rooted at *TP with TREE_VISITED and types as having their
- sized gimplified. We use this to indicate all variable sizes and
- positions in global types may not be shared by any subprogram. */
-
-void
-mark_visited (tree *tp)
-{
- walk_tree (tp, mark_visited_r, NULL, NULL);
-}
-
/* Add GNU_CLEANUP, a cleanup action, to the current code group and
set its location to that of GNAT_NODE if present. */
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 31f24ce0340..abc0b7b557c 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -23,10 +23,6 @@
* *
****************************************************************************/
-/* We have attribute handlers using C specific format specifiers in warning
- messages. Make sure they are properly recognized. */
-#define GCC_DIAG_STYLE __gcc_cdiag__
-
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -101,6 +97,7 @@ static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
static tree handle_malloc_attribute (tree *, tree, tree, int, bool *);
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
static tree handle_vector_size_attribute (tree *, tree, tree, int, bool *);
+static tree handle_vector_type_attribute (tree *, tree, tree, int, bool *);
/* Fake handler for attributes we don't properly support, typically because
they'd require dragging a lot of the common-c front-end circuitry. */
@@ -122,6 +119,7 @@ const struct attribute_spec gnat_internal_attribute_table[] =
{ "type generic", 0, 0, false, true, true, handle_type_generic_attribute },
{ "vector_size", 1, 1, false, true, false, handle_vector_size_attribute },
+ { "vector_type", 0, 0, false, true, false, handle_vector_type_attribute },
{ "may_alias", 0, 0, false, true, false, NULL },
/* ??? format and format_arg are heavy and not supported, which actually
@@ -439,9 +437,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
{
DECL_CONTEXT (decl) = current_function_decl;
- /* Functions imported in another function are not really nested. */
- if (TREE_CODE (decl) == FUNCTION_DECL && TREE_PUBLIC (decl))
- DECL_NO_STATIC_CHAIN (decl) = 1;
+ /* Functions imported in another function are not really nested.
+ For really nested functions mark them initially as needing
+ a static chain for uses of that flag before unnesting;
+ lower_nested_functions will then recompute it. */
+ if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl))
+ DECL_STATIC_CHAIN (decl) = 1;
}
TREE_NO_WARNING (decl) = (gnat_node == Empty || Warnings_Off (gnat_node));
@@ -2266,6 +2267,14 @@ gnat_types_compatible_p (tree t1, tree t2)
if ((code = TREE_CODE (t1)) != TREE_CODE (t2))
return 0;
+ /* Vector types are also compatible if they have the same number of subparts
+ and the same form of (scalar) element type. */
+ if (code == VECTOR_TYPE
+ && TYPE_VECTOR_SUBPARTS (t1) == TYPE_VECTOR_SUBPARTS (t2)
+ && TREE_CODE (TREE_TYPE (t1)) == TREE_CODE (TREE_TYPE (t2))
+ && TYPE_PRECISION (TREE_TYPE (t1)) == TYPE_PRECISION (TREE_TYPE (t2)))
+ return 1;
+
/* Array types are also compatible if they are constrained and have
the same component type and the same domain. */
if (code == ARRAY_TYPE
@@ -3978,6 +3987,16 @@ convert (tree type, tree expr)
}
break;
+ case VECTOR_CST:
+ /* If we are converting a VECTOR_CST to a mere variant type, just make
+ a new one in the proper type. */
+ if (code == ecode && gnat_types_compatible_p (type, etype))
+ {
+ expr = copy_node (expr);
+ TREE_TYPE (expr) = type;
+ return expr;
+ }
+
case CONSTRUCTOR:
/* If we are converting a CONSTRUCTOR to a mere variant type, just make
a new one in the proper type. */
@@ -4040,6 +4059,52 @@ convert (tree type, tree expr)
return expr;
}
}
+
+ /* Likewise for a conversion between array type and vector type with a
+ compatible representative array. */
+ else if (code == VECTOR_TYPE
+ && ecode == ARRAY_TYPE
+ && gnat_types_compatible_p (TYPE_REPRESENTATIVE_ARRAY (type),
+ etype))
+ {
+ VEC(constructor_elt,gc) *e = CONSTRUCTOR_ELTS (expr);
+ unsigned HOST_WIDE_INT len = VEC_length (constructor_elt, e);
+ VEC(constructor_elt,gc) *v;
+ unsigned HOST_WIDE_INT ix;
+ tree value;
+
+ /* Build a VECTOR_CST from a *constant* array constructor. */
+ if (TREE_CONSTANT (expr))
+ {
+ bool constant_p = true;
+
+ /* Iterate through elements and check if all constructor
+ elements are *_CSTs. */
+ FOR_EACH_CONSTRUCTOR_VALUE (e, ix, value)
+ if (!CONSTANT_CLASS_P (value))
+ {
+ constant_p = false;
+ break;
+ }
+
+ if (constant_p)
+ return build_vector_from_ctor (type,
+ CONSTRUCTOR_ELTS (expr));
+ }
+
+ /* Otherwise, build a regular vector constructor. */
+ v = VEC_alloc (constructor_elt, gc, len);
+ FOR_EACH_CONSTRUCTOR_VALUE (e, ix, value)
+ {
+ constructor_elt *elt = VEC_quick_push (constructor_elt, v, NULL);
+ elt->index = NULL_TREE;
+ elt->value = value;
+ }
+ expr = copy_node (expr);
+ TREE_TYPE (expr) = type;
+ CONSTRUCTOR_ELTS (expr) = v;
+ return expr;
+ }
break;
case UNCONSTRAINED_ARRAY_REF:
@@ -4068,10 +4133,11 @@ convert (tree type, tree expr)
if (type == TREE_TYPE (op0))
return op0;
- /* Otherwise, if we're converting between two aggregate types, we
- might be allowed to substitute the VIEW_CONVERT_EXPR target type
- in place or to just convert the inner expression. */
- if (AGGREGATE_TYPE_P (type) && AGGREGATE_TYPE_P (etype))
+ /* Otherwise, if we're converting between two aggregate or vector
+ types, we might be allowed to substitute the VIEW_CONVERT_EXPR
+ target type in place or to just convert the inner expression. */
+ if ((AGGREGATE_TYPE_P (type) && AGGREGATE_TYPE_P (etype))
+ || (VECTOR_TYPE_P (type) && VECTOR_TYPE_P (etype)))
{
/* If we are converting between mere variants, we can just
substitute the VIEW_CONVERT_EXPR in place. */
@@ -4114,11 +4180,16 @@ convert (tree type, tree expr)
if (TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype))
return convert_to_fat_pointer (type, expr);
- /* If we are converting between two aggregate types that are mere
- variants, just make a VIEW_CONVERT_EXPR. */
- else if (code == ecode
- && AGGREGATE_TYPE_P (type)
- && gnat_types_compatible_p (type, etype))
+ /* If we are converting between two aggregate or vector types that are mere
+ variants, just make a VIEW_CONVERT_EXPR. Likewise when we are converting
+ to a vector type from its representative array type. */
+ else if ((code == ecode
+ && (AGGREGATE_TYPE_P (type) || VECTOR_TYPE_P (type))
+ && gnat_types_compatible_p (type, etype))
+ || (code == VECTOR_TYPE
+ && ecode == ARRAY_TYPE
+ && gnat_types_compatible_p (TYPE_REPRESENTATIVE_ARRAY (type),
+ etype)))
return build1 (VIEW_CONVERT_EXPR, type, expr);
/* In all other cases of related types, make a NOP_EXPR. */
@@ -4234,6 +4305,15 @@ convert (tree type, tree expr)
return unchecked_convert (type, expr, false);
case UNCONSTRAINED_ARRAY_TYPE:
+ /* If the input is a VECTOR_TYPE, convert to the representative
+ array type first. */
+ if (ecode == VECTOR_TYPE)
+ {
+ expr = convert (TYPE_REPRESENTATIVE_ARRAY (etype), expr);
+ etype = TREE_TYPE (expr);
+ ecode = TREE_CODE (etype);
+ }
+
/* If EXPR is a constrained array, take its address, convert it to a
fat pointer, and then dereference it. Likewise if EXPR is a
record containing both a template and a constrained array.
@@ -4363,6 +4443,20 @@ maybe_unconstrained_array (tree exp)
return exp;
}
+
+/* If EXP's type is a VECTOR_TYPE, return EXP converted to the associated
+ TYPE_REPRESENTATIVE_ARRAY. */
+
+tree
+maybe_vector_array (tree exp)
+{
+ tree etype = TREE_TYPE (exp);
+
+ if (VECTOR_TYPE_P (etype))
+ exp = convert (TYPE_REPRESENTATIVE_ARRAY (etype), exp);
+
+ return exp;
+}
/* Return true if EXPR is an expression that can be folded as an operand
of a VIEW_CONVERT_EXPR. See ada-tree.h for a complete rationale. */
@@ -4498,15 +4592,24 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
expr = unchecked_convert (type, expr, notrunc_p);
}
- /* We have a special case when we are converting between two
- unconstrained array types. In that case, take the address,
- convert the fat pointer types, and dereference. */
+ /* We have a special case when we are converting between two unconstrained
+ array types. In that case, take the address, convert the fat pointer
+ types, and dereference. */
else if (TREE_CODE (etype) == UNCONSTRAINED_ARRAY_TYPE
&& TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
expr = build_unary_op (INDIRECT_REF, NULL_TREE,
build1 (VIEW_CONVERT_EXPR, TREE_TYPE (type),
build_unary_op (ADDR_EXPR, NULL_TREE,
expr)));
+
+ /* Another special case is when we are converting to a vector type from its
+ representative array type; this a regular conversion. */
+ else if (TREE_CODE (type) == VECTOR_TYPE
+ && TREE_CODE (etype) == ARRAY_TYPE
+ && gnat_types_compatible_p (TYPE_REPRESENTATIVE_ARRAY (type),
+ etype))
+ expr = convert (type, expr);
+
else
{
expr = maybe_unconstrained_array (expr);
@@ -5057,7 +5160,8 @@ handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* ??? TODO: Support types. */
else
{
- warning (OPT_Wattributes, "%qE attribute ignored", name);
+ warning (OPT_Wattributes, "%qs attribute ignored",
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@@ -5172,7 +5276,8 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (!params)
{
warning (OPT_Wattributes,
- "%qE attribute requires prototypes with named arguments", name);
+ "%qs attribute requires prototypes with named arguments",
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else
@@ -5183,7 +5288,8 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (VOID_TYPE_P (TREE_VALUE (params)))
{
warning (OPT_Wattributes,
- "%qE attribute only applies to variadic functions", name);
+ "%qs attribute only applies to variadic functions",
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
}
@@ -5230,7 +5336,8 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TYPE_READONLY (TREE_TYPE (type)), 1));
else
{
- warning (OPT_Wattributes, "%qE attribute ignored", name);
+ warning (OPT_Wattributes, "%qs attribute ignored",
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@@ -5249,7 +5356,8 @@ handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_IS_MALLOC (*node) = 1;
else
{
- warning (OPT_Wattributes, "%qE attribute ignored", name);
+ warning (OPT_Wattributes, "%qs attribute ignored",
+ IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@@ -5308,7 +5416,8 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
if (!host_integerp (size, 1))
{
- warning (OPT_Wattributes, "%qE attribute ignored", name);
+ warning (OPT_Wattributes, "%qs attribute ignored",
+ IDENTIFIER_POINTER (name));
return NULL_TREE;
}
@@ -5342,7 +5451,8 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
|| !host_integerp (TYPE_SIZE_UNIT (type), 1)
|| TREE_CODE (type) == BOOLEAN_TYPE)
{
- error ("invalid vector type for attribute %qE", name);
+ error ("invalid vector type for attribute %qs",
+ IDENTIFIER_POINTER (name));
return NULL_TREE;
}
@@ -5374,6 +5484,103 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
+/* Handle a "vector_type" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool *no_add_attrs)
+{
+ /* Vector representative type and size. */
+ tree rep_type = *node;
+ tree rep_size = TYPE_SIZE_UNIT (rep_type);
+ tree rep_name;
+
+ /* Vector size in bytes and number of units. */
+ unsigned HOST_WIDE_INT vec_bytes, vec_units;
+
+ /* Vector element type and mode. */
+ tree elem_type;
+ enum machine_mode elem_mode;
+
+ *no_add_attrs = true;
+
+ /* Get the representative array type, possibly nested within a
+ padding record e.g. for alignment purposes. */
+
+ if (TREE_CODE (rep_type) == RECORD_TYPE && TYPE_IS_PADDING_P (rep_type))
+ rep_type = TREE_TYPE (TYPE_FIELDS (rep_type));
+
+ if (TREE_CODE (rep_type) != ARRAY_TYPE)
+ {
+ error ("attribute %qs applies to array types only",
+ IDENTIFIER_POINTER (name));
+ return NULL_TREE;
+ }
+
+ /* Silently punt on variable sizes. We can't make vector types for them,
+ need to ignore them on front-end generated subtypes of unconstrained
+ bases, and this attribute is for binding implementors, not end-users, so
+ we should never get there from legitimate explicit uses. */
+
+ if (!host_integerp (rep_size, 1))
+ return NULL_TREE;
+
+ /* Get the element type/mode and check this is something we know
+ how to make vectors of. */
+
+ elem_type = TREE_TYPE (rep_type);
+ elem_mode = TYPE_MODE (elem_type);
+
+ if ((!INTEGRAL_TYPE_P (elem_type)
+ && !SCALAR_FLOAT_TYPE_P (elem_type)
+ && !FIXED_POINT_TYPE_P (elem_type))
+ || (!SCALAR_FLOAT_MODE_P (elem_mode)
+ && GET_MODE_CLASS (elem_mode) != MODE_INT
+ && !ALL_SCALAR_FIXED_POINT_MODE_P (elem_mode))
+ || !host_integerp (TYPE_SIZE_UNIT (elem_type), 1))
+ {
+ error ("invalid element type for attribute %qs",
+ IDENTIFIER_POINTER (name));
+ return NULL_TREE;
+ }
+
+ /* Sanity check the vector size and element type consistency. */
+
+ vec_bytes = tree_low_cst (rep_size, 1);
+
+ if (vec_bytes % tree_low_cst (TYPE_SIZE_UNIT (elem_type), 1))
+ {
+ error ("vector size not an integral multiple of component size");
+ return NULL;
+ }
+
+ if (vec_bytes == 0)
+ {
+ error ("zero vector size");
+ return NULL;
+ }
+
+ vec_units = vec_bytes / tree_low_cst (TYPE_SIZE_UNIT (elem_type), 1);
+ if (vec_units & (vec_units - 1))
+ {
+ error ("number of components of the vector not a power of two");
+ return NULL_TREE;
+ }
+
+ /* Build the vector type and replace. */
+
+ *node = build_vector_type (elem_type, vec_units);
+ rep_name = TYPE_NAME (rep_type);
+ if (TREE_CODE (rep_name) == TYPE_DECL)
+ rep_name = DECL_NAME (rep_name);
+ TYPE_NAME (*node) = rep_name;
+ TYPE_REPRESENTATIVE_ARRAY (*node) = rep_type;
+
+ return NULL_TREE;
+}
+
/* ----------------------------------------------------------------------- *
* BUILTIN FUNCTIONS *
* ----------------------------------------------------------------------- */
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index b8ca814b6aa..f8a3dfbd525 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -55,63 +55,6 @@ static tree compare_arrays (tree, tree, tree);
static tree nonbinary_modular_operation (enum tree_code, tree, tree, tree);
static tree build_simple_component_ref (tree, tree, tree, bool);
-/* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
- operation.
-
- This preparation consists of taking the ordinary representation of
- an expression expr and producing a valid tree boolean expression
- describing whether expr is nonzero. We could simply always do
-
- build_binary_op (NE_EXPR, expr, integer_zero_node, 1),
-
- but we optimize comparisons, &&, ||, and !.
-
- The resulting type should always be the same as the input type.
- This function is simpler than the corresponding C version since
- the only possible operands will be things of Boolean type. */
-
-tree
-gnat_truthvalue_conversion (tree expr)
-{
- tree type = TREE_TYPE (expr);
-
- switch (TREE_CODE (expr))
- {
- case EQ_EXPR: case NE_EXPR: case LE_EXPR: case GE_EXPR:
- case LT_EXPR: case GT_EXPR:
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_XOR_EXPR:
- case ERROR_MARK:
- return expr;
-
- case INTEGER_CST:
- return (integer_zerop (expr)
- ? build_int_cst (type, 0)
- : build_int_cst (type, 1));
-
- case REAL_CST:
- return (real_zerop (expr)
- ? fold_convert (type, integer_zero_node)
- : fold_convert (type, integer_one_node));
-
- case COND_EXPR:
- /* Distribute the conversion into the arms of a COND_EXPR. */
- {
- tree arg1 = gnat_truthvalue_conversion (TREE_OPERAND (expr, 1));
- tree arg2 = gnat_truthvalue_conversion (TREE_OPERAND (expr, 2));
- return fold_build3 (COND_EXPR, type, TREE_OPERAND (expr, 0),
- arg1, arg2);
- }
-
- default:
- return build_binary_op (NE_EXPR, type, expr,
- fold_convert (type, integer_zero_node));
- }
-}
-
/* Return the base type of TYPE. */
tree
@@ -970,15 +913,6 @@ build_binary_op (enum tree_code op_code, tree result_type,
left_operand = convert (operation_type, left_operand);
break;
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_XOR_EXPR:
- left_operand = gnat_truthvalue_conversion (left_operand);
- right_operand = gnat_truthvalue_conversion (right_operand);
- goto common;
-
case BIT_AND_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
@@ -1120,7 +1054,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
case TRUTH_NOT_EXPR:
gcc_assert (result_type == base_type);
- result = invert_truthvalue (gnat_truthvalue_conversion (operand));
+ result = invert_truthvalue (operand);
break;
case ATTR_ADDR_EXPR:
diff --git a/gcc/alias.c b/gcc/alias.c
index eaa127ec8e5..6bb051e62b5 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -309,6 +309,18 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
ref->offset = 0;
ref->max_size = -1;
}
+ else if (INTVAL (MEM_OFFSET (mem)) < 0
+ && MEM_EXPR (mem) != get_spill_slot_decl (false))
+ {
+ /* Negative MEM_OFFSET happens for promoted subregs on bigendian
+ targets. We need to compensate both the size and the offset here,
+ which get_ref_base_and_extent will have done based on the MEM_EXPR
+ already. */
+ gcc_assert (((INTVAL (MEM_SIZE (mem)) + INTVAL (MEM_OFFSET (mem)))
+ * BITS_PER_UNIT)
+ == ref->size);
+ return true;
+ }
else
{
ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT;
diff --git a/gcc/builtins.c b/gcc/builtins.c
index fddb36c7a4d..7227481b426 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -755,13 +755,17 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label)
void
expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED)
{
+ rtx chain;
+
/* Clobber the FP when we get here, so we have to make sure it's
marked as used by this function. */
emit_use (hard_frame_pointer_rtx);
/* Mark the static chain as clobbered here so life information
doesn't get messed up for it. */
- emit_clobber (static_chain_rtx);
+ chain = targetm.calls.static_chain (current_function_decl, true);
+ if (chain && REG_P (chain))
+ emit_clobber (chain);
/* Now put in the code to restore the frame pointer, and argument
pointer, if needed. */
@@ -839,11 +843,8 @@ expand_builtin_longjmp (rtx buf_addr, rtx value)
buf_addr = force_reg (Pmode, buf_addr);
- /* We used to store value in static_chain_rtx, but that fails if pointers
- are smaller than integers. We instead require that the user must pass
- a second argument of 1, because that is what builtin_setjmp will
- return. This also makes EH slightly more efficient, since we are no
- longer copying around a value that we don't care about. */
+ /* We require that the user must pass a second argument of 1, because
+ that is what builtin_setjmp will return. */
gcc_assert (value == const1_rtx);
last = get_last_insn ();
@@ -1590,7 +1591,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
}
/* All arguments and registers used for the call are set up by now! */
- function = prepare_call_address (function, NULL, &call_fusage, 0, 0);
+ function = prepare_call_address (NULL, function, NULL, &call_fusage, 0, 0);
/* Ensure address is valid. SYMBOL_REF is already valid, so no need,
and we don't want to load it into a register as an optimization,
@@ -5815,10 +5816,7 @@ static rtx
expand_builtin_init_trampoline (tree exp)
{
tree t_tramp, t_func, t_chain;
- rtx r_tramp, r_func, r_chain;
-#ifdef TRAMPOLINE_TEMPLATE
- rtx blktramp;
-#endif
+ rtx m_tramp, r_tramp, r_chain, tmp;
if (!validate_arglist (exp, POINTER_TYPE, POINTER_TYPE,
POINTER_TYPE, VOID_TYPE))
@@ -5829,20 +5827,36 @@ expand_builtin_init_trampoline (tree exp)
t_chain = CALL_EXPR_ARG (exp, 2);
r_tramp = expand_normal (t_tramp);
- r_func = expand_normal (t_func);
+ m_tramp = gen_rtx_MEM (BLKmode, r_tramp);
+ MEM_NOTRAP_P (m_tramp) = 1;
+
+ /* The TRAMP argument should be the address of a field within the
+ local function's FRAME decl. Let's see if we can fill in the
+ to fill in the MEM_ATTRs for this memory. */
+ if (TREE_CODE (t_tramp) == ADDR_EXPR)
+ set_mem_attributes_minus_bitpos (m_tramp, TREE_OPERAND (t_tramp, 0),
+ true, 0);
+
+ tmp = round_trampoline_addr (r_tramp);
+ if (tmp != r_tramp)
+ {
+ m_tramp = change_address (m_tramp, BLKmode, tmp);
+ set_mem_align (m_tramp, TRAMPOLINE_ALIGNMENT);
+ set_mem_size (m_tramp, GEN_INT (TRAMPOLINE_SIZE));
+ }
+
+ /* The FUNC argument should be the address of the nested function.
+ Extract the actual function decl to pass to the hook. */
+ gcc_assert (TREE_CODE (t_func) == ADDR_EXPR);
+ t_func = TREE_OPERAND (t_func, 0);
+ gcc_assert (TREE_CODE (t_func) == FUNCTION_DECL);
+
r_chain = expand_normal (t_chain);
/* Generate insns to initialize the trampoline. */
- r_tramp = round_trampoline_addr (r_tramp);
-#ifdef TRAMPOLINE_TEMPLATE
- blktramp = gen_rtx_MEM (BLKmode, r_tramp);
- set_mem_align (blktramp, TRAMPOLINE_ALIGNMENT);
- emit_block_move (blktramp, assemble_trampoline_template (),
- GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
-#endif
- trampolines_created = 1;
- INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
+ targetm.calls.trampoline_init (m_tramp, t_func, r_chain);
+ trampolines_created = 1;
return const0_rtx;
}
@@ -5856,9 +5870,8 @@ expand_builtin_adjust_trampoline (tree exp)
tramp = expand_normal (CALL_EXPR_ARG (exp, 0));
tramp = round_trampoline_addr (tramp);
-#ifdef TRAMPOLINE_ADJUST_ADDRESS
- TRAMPOLINE_ADJUST_ADDRESS (tramp);
-#endif
+ if (targetm.calls.trampoline_adjust_address)
+ tramp = targetm.calls.trampoline_adjust_address (tramp);
return tramp;
}
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 25c0c0137d1..a9e12864010 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -9182,6 +9182,31 @@ is_typedef_decl (tree x)
&& DECL_ORIGINAL_TYPE (x) != NULL_TREE);
}
+/* Record the types used by the current global variable declaration
+ being parsed, so that we can decide later to emit their debug info.
+ Those types are in types_used_by_cur_var_decl, and we are going to
+ store them in the types_used_by_vars_hash hash table.
+ DECL is the declaration of the global variable that has been parsed. */
+
+void
+record_types_used_by_current_var_decl (tree decl)
+{
+ gcc_assert (decl && DECL_P (decl) && TREE_STATIC (decl));
+
+ if (types_used_by_cur_var_decl)
+ {
+ tree node;
+ for (node = types_used_by_cur_var_decl;
+ node;
+ node = TREE_CHAIN (node))
+ {
+ tree type = TREE_PURPOSE (node);
+ types_used_by_var_decl_insert (type, decl);
+ }
+ types_used_by_cur_var_decl = NULL;
+ }
+}
+
/* The C and C++ parsers both use vectors to hold function arguments.
For efficiency, we keep a cache of unused vectors. This is the
cache. */
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 9b7905b5a30..6a02e046209 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -1130,6 +1130,7 @@ extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree);
/* Not in c-omp.c; provided by the front end. */
extern bool c_omp_sharing_predetermined (tree);
extern tree c_omp_remap_decl (tree, bool);
+extern void record_types_used_by_current_var_decl (tree);
/* In order for the format checking to accept the C frontend
diagnostic framework extensions, you must include this file before
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index c44e35cff46..e237332f174 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4064,6 +4064,13 @@ finish_decl (tree decl, location_t init_loc, tree init,
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);
+ if (TREE_CODE (decl) == VAR_DECL
+ && TREE_STATIC (decl)
+ && global_bindings_p ())
+ /* So decl is a global variable. Record the types it uses
+ so that we can decide later to emit debug info for them. */
+ record_types_used_by_current_var_decl (decl);
+
/* If `start_decl' didn't like having an initialization, ignore it now. */
if (init != 0 && DECL_INITIAL (decl) == 0)
init = 0;
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index d9ea159c4e5..3f6e949fe8e 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1323,6 +1323,11 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
if (nested)
{
tree decl = current_function_decl;
+ /* Mark nested functions as needing static-chain initially.
+ lower_nested_functions will recompute it but the
+ DECL_STATIC_CHAIN flag is also used before that happens,
+ by initializer_constant_valid_p. See gcc.dg/nested-fn-2.c. */
+ DECL_STATIC_CHAIN (decl) = 1;
add_stmt (fnbody);
finish_function ();
c_pop_function_context ();
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 411b9ec2aa2..1b2b8585823 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -9465,6 +9465,7 @@ build_binary_op (location_t location, enum tree_code code,
unsigned_arg = TYPE_UNSIGNED (TREE_TYPE (op0));
if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
+ && tree_int_cst_sgn (op1) > 0
/* We can shorten only if the shift count is less than the
number of bits in the smaller type size. */
&& compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0
diff --git a/gcc/calls.c b/gcc/calls.c
index 16229cc4def..f28fb513ce2 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -166,7 +166,7 @@ static void restore_fixed_argument_area (rtx, rtx, int, int);
CALL_INSN_FUNCTION_USAGE information. */
rtx
-prepare_call_address (rtx funexp, rtx static_chain_value,
+prepare_call_address (tree fndecl, rtx funexp, rtx static_chain_value,
rtx *call_fusage, int reg_parm_seen, int sibcallp)
{
/* Make a valid memory address and copy constants through pseudo-regs,
@@ -187,11 +187,15 @@ prepare_call_address (rtx funexp, rtx static_chain_value,
if (static_chain_value != 0)
{
+ rtx chain;
+
+ gcc_assert (fndecl);
+ chain = targetm.calls.static_chain (fndecl, false);
static_chain_value = convert_memory_address (Pmode, static_chain_value);
- emit_move_insn (static_chain_rtx, static_chain_value);
- if (REG_P (static_chain_rtx))
- use_reg (call_fusage, static_chain_rtx);
+ emit_move_insn (chain, static_chain_value);
+ if (REG_P (chain))
+ use_reg (call_fusage, chain);
}
return funexp;
@@ -2807,7 +2811,7 @@ expand_call (tree exp, rtx target, int ignore)
}
after_args = get_last_insn ();
- funexp = prepare_call_address (funexp, static_chain_value,
+ funexp = prepare_call_address (fndecl, funexp, static_chain_value,
&call_fusage, reg_parm_seen, pass == 0);
load_register_parameters (args, num_actuals, &call_fusage, flags,
@@ -3735,7 +3739,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
else
argnum = 0;
- fun = prepare_call_address (fun, NULL, &call_fusage, 0, 0);
+ fun = prepare_call_address (NULL, fun, NULL, &call_fusage, 0, 0);
/* Now load any reg parms into their regs. */
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 0ed6bd5903d..f4a9f5e478c 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2234,6 +2234,38 @@ unwrap_constant (rtx x)
return ret;
}
+/* Convert X to MODE, that must be Pmode or ptr_mode, without emitting
+ any rtl. */
+
+static rtx
+convert_debug_memory_address (enum machine_mode mode, rtx x)
+{
+ enum machine_mode xmode = GET_MODE (x);
+
+#ifndef POINTERS_EXTEND_UNSIGNED
+ gcc_assert (mode == Pmode);
+ gcc_assert (xmode == mode || xmode == VOIDmode);
+#else
+ gcc_assert (mode == Pmode || mode == ptr_mode);
+
+ if (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode)
+ return x;
+
+ if (GET_MODE_BITSIZE (mode) < GET_MODE_BITSIZE (xmode))
+ x = simplify_gen_subreg (mode, x, xmode,
+ subreg_lowpart_offset
+ (mode, xmode));
+ else if (POINTERS_EXTEND_UNSIGNED > 0)
+ x = gen_rtx_ZERO_EXTEND (mode, x);
+ else if (!POINTERS_EXTEND_UNSIGNED)
+ x = gen_rtx_SIGN_EXTEND (mode, x);
+ else
+ gcc_unreachable ();
+#endif /* POINTERS_EXTEND_UNSIGNED */
+
+ return x;
+}
+
/* Return an RTX equivalent to the value of the tree expression
EXP. */
@@ -2410,6 +2442,7 @@ expand_debug_expr (tree exp)
return NULL;
gcc_assert (GET_MODE (op0) == Pmode
+ || GET_MODE (op0) == ptr_mode
|| GET_CODE (op0) == CONST_INT
|| GET_CODE (op0) == CONST_DOUBLE);
@@ -2436,6 +2469,7 @@ expand_debug_expr (tree exp)
return NULL;
gcc_assert (GET_MODE (op0) == Pmode
+ || GET_MODE (op0) == ptr_mode
|| GET_CODE (op0) == CONST_INT
|| GET_CODE (op0) == CONST_DOUBLE);
@@ -2468,13 +2502,32 @@ expand_debug_expr (tree exp)
if (offset)
{
+ enum machine_mode addrmode, offmode;
+
gcc_assert (MEM_P (op0));
+ op0 = XEXP (op0, 0);
+ addrmode = GET_MODE (op0);
+ if (addrmode == VOIDmode)
+ addrmode = Pmode;
+
op1 = expand_debug_expr (offset);
if (!op1)
return NULL;
- op0 = gen_rtx_MEM (mode, gen_rtx_PLUS (Pmode, XEXP (op0, 0), op1));
+ offmode = GET_MODE (op1);
+ if (offmode == VOIDmode)
+ offmode = TYPE_MODE (TREE_TYPE (offset));
+
+ if (addrmode != offmode)
+ op1 = simplify_gen_subreg (addrmode, op1, offmode,
+ subreg_lowpart_offset (addrmode,
+ offmode));
+
+ /* Don't use offset_address here, we don't need a
+ recognizable address, and we don't want to generate
+ code. */
+ op0 = gen_rtx_MEM (mode, gen_rtx_PLUS (addrmode, op0, op1));
}
if (MEM_P (op0))
@@ -2785,7 +2838,9 @@ expand_debug_expr (tree exp)
if (!op0 || !MEM_P (op0))
return NULL;
- return XEXP (op0, 0);
+ op0 = convert_debug_memory_address (mode, XEXP (op0, 0));
+
+ return op0;
case VECTOR_CST:
exp = build_constructor_from_list (TREE_TYPE (exp),
diff --git a/gcc/common.opt b/gcc/common.opt
index 0befadd9d25..189f476a09e 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1472,6 +1472,14 @@ gstabs+
Common JoinedOrMissing Negative(gvms)
Generate debug information in extended STABS format
+gno-strict-dwarf
+Common RejectNegative Var(dwarf_strict,0) Init(-1)
+Emit DWARF additions beyond selected version
+
+gstrict-dwarf
+Common Report RejectNegative Var(dwarf_strict,1) VarExists
+Don't emit DWARF additions beyond selected version
+
gtoggle
Common Report Var(flag_gtoggle)
Toggle debug information generation
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 00025638ceb..2e28ea26b7d 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -400,9 +400,12 @@ case ${target} in
*-*-darwin*)
tm_file="${tm_file} darwin.h"
case ${target} in
- *-*-darwin[912]*)
+ *-*-darwin9*)
tm_file="${tm_file} darwin9.h"
;;
+ *-*-darwin[12][0-9]*)
+ tm_file="${tm_file} darwin9.h darwin10.h"
+ ;;
esac
tm_file="${tm_file} ${cpu_type}/darwin.h"
tm_p_file="${tm_p_file} darwin-protos.h"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 46ad8f4be2d..86fd1ee5599 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5541,34 +5541,23 @@ print_operand_address (FILE *file, rtx addr)
}
/* Emit RTL insns to initialize the variable parts of a trampoline at
- TRAMP. FNADDR is an RTX for the address of the function's pure
- code. CXT is an RTX for the static chain value for the function.
+ M_TRAMP. FNDECL is target function's decl. CHAIN_VALUE is an rtx
+ for the static chain value for the function. */
- The three offset parameters are for the individual template's
- layout. A JMPOFS < 0 indicates that the trampoline does not
- contain instructions at all.
-
- We assume here that a function will be called many more times than
- its address is taken (e.g., it might be passed to qsort), so we
- take the trouble to initialize the "hint" field in the JMP insn.
- Note that the hint field is PC (new) + 4 * bits 13:0. */
-
-void
-alpha_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt,
- int fnofs, int cxtofs, int jmpofs)
+static void
+alpha_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
- rtx addr;
- /* VMS really uses DImode pointers in memory at this point. */
- enum machine_mode mode = TARGET_ABI_OPEN_VMS ? Pmode : ptr_mode;
+ rtx fnaddr, mem, word1, word2;
+
+ fnaddr = XEXP (DECL_RTL (fndecl), 0);
#ifdef POINTERS_EXTEND_UNSIGNED
- fnaddr = convert_memory_address (mode, fnaddr);
- cxt = convert_memory_address (mode, cxt);
+ fnaddr = convert_memory_address (Pmode, fnaddr);
+ chain_value = convert_memory_address (Pmode, chain_value);
#endif
if (TARGET_ABI_OPEN_VMS)
{
- rtx temp1, traddr;
const char *fnname;
char *trname;
@@ -5577,37 +5566,48 @@ alpha_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt,
trname = (char *) alloca (strlen (fnname) + 5);
strcpy (trname, fnname);
strcat (trname, "..tr");
- traddr = gen_rtx_SYMBOL_REF
- (mode, ggc_alloc_string (trname, strlen (trname) + 1));
+ fnname = ggc_alloc_string (trname, strlen (trname) + 1);
+ word2 = gen_rtx_SYMBOL_REF (Pmode, fnname);
/* Trampoline (or "bounded") procedure descriptor is constructed from
the function's procedure descriptor with certain fields zeroed IAW
the VMS calling standard. This is stored in the first quadword. */
- temp1 = force_reg (DImode, gen_rtx_MEM (DImode, fnaddr));
- temp1 = expand_and (DImode, temp1,
- GEN_INT (0xffff0fff0000fff0), NULL_RTX);
- addr = memory_address (mode, plus_constant (tramp, 0));
- emit_move_insn (gen_rtx_MEM (DImode, addr), temp1);
-
- /* Trampoline transfer address is stored in the second quadword
- of the trampoline. */
- addr = memory_address (mode, plus_constant (tramp, 8));
- emit_move_insn (gen_rtx_MEM (mode, addr), traddr);
+ word1 = force_reg (DImode, gen_const_mem (DImode, fnaddr));
+ word1 = expand_and (DImode, word1, GEN_INT (0xffff0fff0000fff0), NULL);
}
+ else
+ {
+ /* These 4 instructions are:
+ ldq $1,24($27)
+ ldq $27,16($27)
+ jmp $31,($27),0
+ nop
+ We don't bother setting the HINT field of the jump; the nop
+ is merely there for padding. */
+ word1 = GEN_INT (0xa77b0010a43b0018);
+ word2 = GEN_INT (0x47ff041f6bfb0000);
+ }
+
+ /* Store the first two words, as computed above. */
+ mem = adjust_address (m_tramp, DImode, 0);
+ emit_move_insn (mem, word1);
+ mem = adjust_address (m_tramp, DImode, 8);
+ emit_move_insn (mem, word2);
+
+ /* Store function address and static chain value. */
+ mem = adjust_address (m_tramp, Pmode, 16);
+ emit_move_insn (mem, fnaddr);
+ mem = adjust_address (m_tramp, Pmode, 24);
+ emit_move_insn (mem, chain_value);
- /* Store function address and CXT. */
- addr = memory_address (mode, plus_constant (tramp, fnofs));
- emit_move_insn (gen_rtx_MEM (mode, addr), fnaddr);
- addr = memory_address (mode, plus_constant (tramp, cxtofs));
- emit_move_insn (gen_rtx_MEM (mode, addr), cxt);
-
+ if (!TARGET_ABI_OPEN_VMS)
+ {
+ emit_insn (gen_imb ());
#ifdef ENABLE_EXECUTE_STACK
- emit_library_call (init_one_libfunc ("__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
+ emit_library_call (init_one_libfunc ("__enable_execute_stack"),
+ LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
#endif
-
- if (jmpofs >= 0)
- emit_insn (gen_imb ());
+ }
}
/* Determine where to put an argument to a function.
@@ -11114,6 +11114,8 @@ alpha_init_libfuncs (void)
#define TARGET_GIMPLIFY_VA_ARG_EXPR alpha_gimplify_va_arg
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES alpha_arg_partial_bytes
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT alpha_trampoline_init
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD alpha_secondary_reload
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index cd8c11e3286..6235d9ff90a 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -838,28 +838,6 @@ extern int alpha_memory_latency;
#define EPILOGUE_USES(REGNO) ((REGNO) == 26)
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts.
-
- The trampoline should set the static chain pointer to value placed
- into the trampoline and should branch to the specified routine.
- Note that $27 has been set to the address of the trampoline, so we can
- use it for addressability of the two data items. */
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
-do { \
- fprintf (FILE, "\tldq $1,24($27)\n"); \
- fprintf (FILE, "\tldq $27,16($27)\n"); \
- fprintf (FILE, "\tjmp $31,($27),0\n"); \
- fprintf (FILE, "\tnop\n"); \
- fprintf (FILE, "\t.quad 0,0\n"); \
-} while (0)
-
-/* Section in which to place the trampoline. On Alpha, instructions
- may only be placed in a text segment. */
-
-#define TRAMPOLINE_SECTION text_section
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 32
@@ -868,13 +846,6 @@ do { \
#define TRAMPOLINE_ALIGNMENT 64
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, 8)
-
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index ca9032750f3..277300828c9 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4869,7 +4869,7 @@
"jmp $31,(%0),0"
[(set_attr "type" "ibr")])
-;; Cache flush. Used by INITIALIZE_TRAMPOLINE. 0x86 is PAL_imb, but we don't
+;; Cache flush. Used by alpha_trampoline_init. 0x86 is PAL_imb, but we don't
;; want to have to include pal.h in our .s file.
(define_insn "imb"
[(unspec_volatile [(const_int 0)] UNSPECV_IMB)]
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index cb84a040eee..c0b20f89d61 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -225,26 +225,6 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
vms_output_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN)
-#undef TRAMPOLINE_TEMPLATE
-
-/* Length in units of the trampoline for entering a nested function. */
-
-#undef TRAMPOLINE_SIZE
-#define TRAMPOLINE_SIZE 32
-
-/* The alignment of a trampoline, in bits. */
-
-#undef TRAMPOLINE_ALIGNMENT
-#define TRAMPOLINE_ALIGNMENT 64
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#undef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, -1)
-
/* Control how constructors and destructors are emitted. */
#define TARGET_ASM_CONSTRUCTOR vms_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR vms_asm_out_destructor
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index f53c8988b4f..fc7c463468a 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -94,6 +94,8 @@ static void arc_external_libcall (rtx);
static bool arc_return_in_memory (const_tree, const_tree);
static bool arc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
+static void arc_trampoline_init (rtx, tree, rtx);
+
/* ARC specific attributs. */
@@ -151,6 +153,9 @@ static const struct attribute_spec arc_attribute_table[] =
#undef TARGET_EXPAND_BUILTIN_VA_START
#define TARGET_EXPAND_BUILTIN_VA_START arc_va_start
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT arc_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -2343,3 +2348,39 @@ arc_pass_by_reference (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
return size > 8;
}
+
+/* Trampolines. */
+/* ??? This doesn't work yet because GCC will use as the address of a nested
+ function the address of the trampoline. We need to use that address
+ right shifted by 2. It looks like we'll need PSImode after all. :-(
+
+ ??? The above comment sounds like it's doable via
+ TARGET_TRAMPOLINE_ADJUST_ADDRESS; no PSImode needed.
+
+ On the ARC, the trampoline is quite simple as we have 32-bit immediate
+ constants.
+
+ mov r24,STATIC
+ j.nd FUNCTION
+*/
+
+static void
+arc_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ mem = adjust_address (m_tramp, SImode, 0);
+ emit_move_insn (mem, GEN_INT (0x631f7c00));
+
+ mem = adjust_address (m_tramp, SImode, 4);
+ emit_move_insn (mem, chain_value);
+
+ mem = adjust_address (m_tramp, SImode, 8);
+ emit_move_insn (mem, GEN_INT (0x381f0000));
+
+ mem = adjust_address (m_tramp, SImode, 12);
+ emit_move_insn (mem, fnaddr);
+
+ emit_insn (gen_flush_icache (m_tramp));
+}
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index e19048d9a84..5127a123e31 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -657,39 +657,8 @@ arc_eligible_for_epilogue_delay (TRIAL, SLOTS_FILLED)
for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO)
-/* Trampolines. */
-/* ??? This doesn't work yet because GCC will use as the address of a nested
- function the address of the trampoline. We need to use that address
- right shifted by 2. It looks like we'll need PSImode after all. :-( */
-
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts. */
-/* On the ARC, the trampoline is quite simple as we have 32-bit immediate
- constants.
-
- mov r24,STATIC
- j.nd FUNCTION
-*/
-#define TRAMPOLINE_TEMPLATE(FILE) \
-do { \
- assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x631f7c00)); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
- assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x381f0000)); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
-} while (0)
-
-/* Length in units of the trampoline for entering a nested function. */
+#define TRAMPOLINE_ALIGNMENT 32
#define TRAMPOLINE_SIZE 16
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-do { \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), FNADDR); \
- emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)))); \
-} while (0)
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 1cc9557361a..efc329b823b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -219,6 +219,9 @@ static tree arm_convert_to_type (tree type, tree expr);
static bool arm_scalar_mode_supported_p (enum machine_mode);
static bool arm_frame_pointer_required (void);
static bool arm_can_eliminate (const int, const int);
+static void arm_asm_trampoline_template (FILE *);
+static void arm_trampoline_init (rtx, tree, rtx);
+static rtx arm_trampoline_adjust_address (rtx);
/* Table of machine attributes. */
@@ -366,6 +369,13 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS arm_allocate_stack_slots_for_args
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE arm_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT arm_trampoline_init
+#undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
+#define TARGET_TRAMPOLINE_ADJUST_ADDRESS arm_trampoline_adjust_address
+
#undef TARGET_DEFAULT_SHORT_ENUMS
#define TARGET_DEFAULT_SHORT_ENUMS arm_default_short_enums
@@ -1986,6 +1996,84 @@ arm_allocate_stack_slots_for_args (void)
}
+/* Output assembler code for a block containing the constant parts
+ of a trampoline, leaving space for the variable parts.
+
+ On the ARM, (if r8 is the static chain regnum, and remembering that
+ referencing pc adds an offset of 8) the trampoline looks like:
+ ldr r8, [pc, #0]
+ ldr pc, [pc]
+ .word static chain value
+ .word function's address
+ XXX FIXME: When the trampoline returns, r8 will be clobbered. */
+
+static void
+arm_asm_trampoline_template (FILE *f)
+{
+ if (TARGET_ARM)
+ {
+ asm_fprintf (f, "\tldr\t%r, [%r, #0]\n", STATIC_CHAIN_REGNUM, PC_REGNUM);
+ asm_fprintf (f, "\tldr\t%r, [%r, #0]\n", PC_REGNUM, PC_REGNUM);
+ }
+ else if (TARGET_THUMB2)
+ {
+ /* The Thumb-2 trampoline is similar to the arm implementation.
+ Unlike 16-bit Thumb, we enter the stub in thumb mode. */
+ asm_fprintf (f, "\tldr.w\t%r, [%r, #4]\n",
+ STATIC_CHAIN_REGNUM, PC_REGNUM);
+ asm_fprintf (f, "\tldr.w\t%r, [%r, #4]\n", PC_REGNUM, PC_REGNUM);
+ }
+ else
+ {
+ ASM_OUTPUT_ALIGN (f, 2);
+ fprintf (f, "\t.code\t16\n");
+ fprintf (f, ".Ltrampoline_start:\n");
+ asm_fprintf (f, "\tpush\t{r0, r1}\n");
+ asm_fprintf (f, "\tldr\tr0, [%r, #8]\n", PC_REGNUM);
+ asm_fprintf (f, "\tmov\t%r, r0\n", STATIC_CHAIN_REGNUM);
+ asm_fprintf (f, "\tldr\tr0, [%r, #8]\n", PC_REGNUM);
+ asm_fprintf (f, "\tstr\tr0, [%r, #4]\n", SP_REGNUM);
+ asm_fprintf (f, "\tpop\t{r0, %r}\n", PC_REGNUM);
+ }
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx);
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx);
+}
+
+/* Emit RTL insns to initialize the variable parts of a trampoline. */
+
+static void
+arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr, mem, a_tramp;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12);
+ emit_move_insn (mem, chain_value);
+
+ mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16);
+ fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ emit_move_insn (mem, fnaddr);
+
+ a_tramp = XEXP (m_tramp, 0);
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
+ LCT_NORMAL, VOIDmode, 2, a_tramp, Pmode,
+ plus_constant (a_tramp, TRAMPOLINE_SIZE), Pmode);
+}
+
+/* Thumb trampolines should be entered in thumb mode, so set
+ the bottom bit of the address. */
+
+static rtx
+arm_trampoline_adjust_address (rtx addr)
+{
+ if (TARGET_THUMB)
+ addr = expand_simple_binop (Pmode, IOR, addr, const1_rtx,
+ NULL, 0, OPTAB_LIB_WIDEN);
+ return addr;
+}
+
/* Return 1 if it is possible to return using a single instruction.
If SIBLING is non-null, this is a test for a return before a sibling
call. SIBLING is the call insn, so we can examine its register usage. */
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 215c9fba789..9272ca51cba 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1861,102 +1861,11 @@ typedef struct
once for every function before code is generated. */
#define INIT_EXPANDERS arm_init_expanders ()
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts.
-
- On the ARM, (if r8 is the static chain regnum, and remembering that
- referencing pc adds an offset of 8) the trampoline looks like:
- ldr r8, [pc, #0]
- ldr pc, [pc]
- .word static chain value
- .word function's address
- XXX FIXME: When the trampoline returns, r8 will be clobbered. */
-#define ARM_TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
- STATIC_CHAIN_REGNUM, PC_REGNUM); \
- asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
- PC_REGNUM, PC_REGNUM); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
-}
-
-/* The Thumb-2 trampoline is similar to the arm implementation.
- Unlike 16-bit Thumb, we enter the stub in thumb mode. */
-#define THUMB2_TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- asm_fprintf (FILE, "\tldr.w\t%r, [%r, #4]\n", \
- STATIC_CHAIN_REGNUM, PC_REGNUM); \
- asm_fprintf (FILE, "\tldr.w\t%r, [%r, #4]\n", \
- PC_REGNUM, PC_REGNUM); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
-}
-
-#define THUMB1_TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- ASM_OUTPUT_ALIGN(FILE, 2); \
- fprintf (FILE, "\t.code\t16\n"); \
- fprintf (FILE, ".Ltrampoline_start:\n"); \
- asm_fprintf (FILE, "\tpush\t{r0, r1}\n"); \
- asm_fprintf (FILE, "\tldr\tr0, [%r, #8]\n", \
- PC_REGNUM); \
- asm_fprintf (FILE, "\tmov\t%r, r0\n", \
- STATIC_CHAIN_REGNUM); \
- asm_fprintf (FILE, "\tldr\tr0, [%r, #8]\n", \
- PC_REGNUM); \
- asm_fprintf (FILE, "\tstr\tr0, [%r, #4]\n", \
- SP_REGNUM); \
- asm_fprintf (FILE, "\tpop\t{r0, %r}\n", \
- PC_REGNUM); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
- assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
-}
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
- if (TARGET_ARM) \
- ARM_TRAMPOLINE_TEMPLATE (FILE) \
- else if (TARGET_THUMB2) \
- THUMB2_TRAMPOLINE_TEMPLATE (FILE) \
- else \
- THUMB1_TRAMPOLINE_TEMPLATE (FILE)
-
-/* Thumb trampolines should be entered in thumb mode, so set the bottom bit
- of the address. */
-#define TRAMPOLINE_ADJUST_ADDRESS(ADDR) do \
-{ \
- if (TARGET_THUMB) \
- (ADDR) = expand_simple_binop (Pmode, IOR, (ADDR), GEN_INT(1), \
- gen_reg_rtx (Pmode), 0, OPTAB_LIB_WIDEN); \
-} while(0)
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE (TARGET_32BIT ? 16 : 20)
/* Alignment required for a trampoline in bits. */
#define TRAMPOLINE_ALIGNMENT 32
-
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-#ifndef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, \
- TARGET_32BIT ? 8 : 12)), \
- CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, \
- TARGET_32BIT ? 12 : 16)), \
- FNADDR); \
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
- LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \
- plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \
-}
-#endif
-
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT 1
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 2c562e9a18f..76df476f4c4 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -393,9 +393,6 @@ avr_regs_to_save (HARD_REG_SET *set)
int int_or_sig_p = (interrupt_function_p (current_function_decl)
|| signal_function_p (current_function_decl));
- if (!reload_completed)
- cfun->machine->is_leaf = leaf_function_p ();
-
if (set)
CLEAR_HARD_REG_SET (*set);
count = 0;
@@ -414,7 +411,7 @@ avr_regs_to_save (HARD_REG_SET *set)
if (fixed_regs[reg])
continue;
- if ((int_or_sig_p && !cfun->machine->is_leaf && call_used_regs[reg])
+ if ((int_or_sig_p && !current_function_is_leaf && call_used_regs[reg])
|| (df_regs_ever_live_p (reg)
&& (int_or_sig_p || !call_used_regs[reg])
&& !(frame_pointer_needed
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index ff409398249..0927e3928c1 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -722,16 +722,8 @@ fprintf (STREAM, "\t.skip %lu,0\n", (unsigned long)(N))
#define NO_DOLLAR_IN_LABEL 1
-#define TRAMPOLINE_TEMPLATE(FILE) \
- internal_error ("trampolines not supported")
-
#define TRAMPOLINE_SIZE 4
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 2)), CXT); \
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 6)), FNADDR); \
-}
/* Store in cc_status the expressions
that the condition codes will describe
after execution of an instruction whose pattern is EXP.
@@ -849,9 +841,6 @@ mmcu=*:-mmcu=%*}"
This is added to the cfun structure. */
struct GTY(()) machine_function
{
- /* 'true' - if the current function is a leaf function. */
- int is_leaf;
-
/* 'true' - if current function is a naked function. */
int is_naked;
diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h
index b2d3d8c2dbd..4a9b7a11768 100644
--- a/gcc/config/bfin/bfin-protos.h
+++ b/gcc/config/bfin/bfin-protos.h
@@ -110,7 +110,6 @@ extern void asm_conditional_branch (rtx, rtx *, int, int);
extern rtx bfin_gen_compare (rtx, Mmode);
extern int bfin_local_alignment (tree, int);
-extern void initialize_trampoline (rtx, rtx, rtx);
extern rtx bfin_va_arg (tree, tree);
extern void bfin_expand_prologue (void);
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 92aaf5770c4..32d72abc2aa 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -2094,37 +2094,67 @@ bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
return !called_func->local || this_func->local;
}
+/* Write a template for a trampoline to F. */
+
+static void
+bfin_asm_trampoline_template (FILE *f)
+{
+ if (TARGET_FDPIC)
+ {
+ fprintf (f, "\t.dd\t0x00000000\n"); /* 0 */
+ fprintf (f, "\t.dd\t0x00000000\n"); /* 0 */
+ fprintf (f, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */
+ fprintf (f, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */
+ fprintf (f, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */
+ fprintf (f, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */
+ fprintf (f, "\t.dw\t0xac4b\n"); /* p3 = [p1 + 4] */
+ fprintf (f, "\t.dw\t0x9149\n"); /* p1 = [p1] */
+ fprintf (f, "\t.dw\t0x0051\n"); /* jump (p1)*/
+ }
+ else
+ {
+ fprintf (f, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */
+ fprintf (f, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */
+ fprintf (f, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */
+ fprintf (f, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */
+ fprintf (f, "\t.dw\t0x0051\n"); /* jump (p1)*/
+ }
+}
+
/* Emit RTL insns to initialize the variable parts of a trampoline at
- TRAMP. FNADDR is an RTX for the address of the function's pure
- code. CXT is an RTX for the static chain value for the function. */
+ M_TRAMP. FNDECL is the target function. CHAIN_VALUE is an RTX for
+ the static chain value for the function. */
-void
-initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+bfin_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
- rtx t1 = copy_to_reg (fnaddr);
- rtx t2 = copy_to_reg (cxt);
- rtx addr;
+ rtx t1 = copy_to_reg (XEXP (DECL_RTL (fndecl), 0));
+ rtx t2 = copy_to_reg (chain_value);
+ rtx mem;
int i = 0;
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
if (TARGET_FDPIC)
{
- rtx a = memory_address (Pmode, plus_constant (tramp, 8));
- addr = memory_address (Pmode, tramp);
- emit_move_insn (gen_rtx_MEM (SImode, addr), a);
+ rtx a = force_reg (Pmode, plus_constant (XEXP (m_tramp, 0), 8));
+ mem = adjust_address (m_tramp, Pmode, 0);
+ emit_move_insn (mem, a);
i = 8;
}
- addr = memory_address (Pmode, plus_constant (tramp, i + 2));
- emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t1));
+ mem = adjust_address (m_tramp, HImode, i + 2);
+ emit_move_insn (mem, gen_lowpart (HImode, t1));
emit_insn (gen_ashrsi3 (t1, t1, GEN_INT (16)));
- addr = memory_address (Pmode, plus_constant (tramp, i + 6));
- emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t1));
+ mem = adjust_address (m_tramp, HImode, i + 6);
+ emit_move_insn (mem, gen_lowpart (HImode, t1));
- addr = memory_address (Pmode, plus_constant (tramp, i + 10));
- emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t2));
+ mem = adjust_address (m_tramp, HImode, i + 10);
+ emit_move_insn (mem, gen_lowpart (HImode, t2));
emit_insn (gen_ashrsi3 (t2, t2, GEN_INT (16)));
- addr = memory_address (Pmode, plus_constant (tramp, i + 14));
- emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t2));
+ mem = adjust_address (m_tramp, HImode, i + 14);
+ emit_move_insn (mem, gen_lowpart (HImode, t2));
}
/* Emit insns to move operands[1] into operands[0]. */
@@ -6619,4 +6649,9 @@ bfin_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE bfin_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE bfin_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT bfin_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index 34032b28225..03a279036f3 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -386,30 +386,6 @@ extern const char *bfin_library_id_string;
&& (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
#define TRAMPOLINE_SIZE (TARGET_FDPIC ? 30 : 18)
-#define TRAMPOLINE_TEMPLATE(FILE) \
- if (TARGET_FDPIC) \
- { \
- fprintf(FILE, "\t.dd\t0x00000000\n"); /* 0 */ \
- fprintf(FILE, "\t.dd\t0x00000000\n"); /* 0 */ \
- fprintf(FILE, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */ \
- fprintf(FILE, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */ \
- fprintf(FILE, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */ \
- fprintf(FILE, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */ \
- fprintf(FILE, "\t.dw\t0xac4b\n"); /* p3 = [p1 + 4] */ \
- fprintf(FILE, "\t.dw\t0x9149\n"); /* p1 = [p1] */ \
- fprintf(FILE, "\t.dw\t0x0051\n"); /* jump (p1)*/ \
- } \
- else \
- { \
- fprintf(FILE, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */ \
- fprintf(FILE, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */ \
- fprintf(FILE, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */ \
- fprintf(FILE, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */ \
- fprintf(FILE, "\t.dw\t0x0051\n"); /* jump (p1)*/ \
- }
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- initialize_trampoline (TRAMP, FNADDR, CXT)
/* Definitions for register eliminations.
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 6b3fd0fcfca..bf00a57a3b6 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -127,6 +127,9 @@ static bool cris_handle_option (size_t, const char *, int);
static bool cris_frame_pointer_required (void);
+static void cris_asm_trampoline_template (FILE *);
+static void cris_trampoline_init (rtx, tree, rtx);
+
/* This is the parsed result of the "-max-stack-stackframe=" option. If
it (still) is zero, then there was no such option given. */
int cris_max_stackframe = 0;
@@ -189,6 +192,11 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED cris_frame_pointer_required
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE cris_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT cris_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Helper for cris_load_multiple_op and cris_ret_movem_op. */
@@ -3853,6 +3861,103 @@ cris_frame_pointer_required (void)
return !current_function_sp_is_unchanging;
}
+/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE.
+
+ This looks too complicated, and it is. I assigned r7 to be the
+ static chain register, but it is call-saved, so we have to save it,
+ and come back to restore it after the call, so we have to save srp...
+ Anyway, trampolines are rare enough that we can cope with this
+ somewhat lack of elegance.
+ (Do not be tempted to "straighten up" whitespace in the asms; the
+ assembler #NO_APP state mandates strict spacing). */
+/* ??? See the i386 regparm=3 implementation that pushes the static
+ chain value to the stack in the trampoline, and uses a call-saved
+ register when called directly. */
+
+static void
+cris_asm_trampoline_template (FILE *f)
+{
+ if (TARGET_V32)
+ {
+ /* This normally-unused nop insn acts as an instruction to
+ the simulator to flush its instruction cache. None of
+ the other instructions in the trampoline template suits
+ as a trigger for V32. The pc-relative addressing mode
+ works nicely as a trigger for V10.
+ FIXME: Have specific V32 template (possibly avoiding the
+ use of a special instruction). */
+ fprintf (f, "\tclearf x\n");
+ /* We have to use a register as an intermediate, choosing
+ semi-randomly R1 (which has to not be the STATIC_CHAIN_REGNUM),
+ so we can use it for address indirection and jsr target. */
+ fprintf (f, "\tmove $r1,$mof\n");
+ /* +4 */
+ fprintf (f, "\tmove.d 0,$r1\n");
+ fprintf (f, "\tmove.d $%s,[$r1]\n", reg_names[STATIC_CHAIN_REGNUM]);
+ fprintf (f, "\taddq 6,$r1\n");
+ fprintf (f, "\tmove $mof,[$r1]\n");
+ fprintf (f, "\taddq 6,$r1\n");
+ fprintf (f, "\tmove $srp,[$r1]\n");
+ /* +20 */
+ fprintf (f, "\tmove.d 0,$%s\n", reg_names[STATIC_CHAIN_REGNUM]);
+ /* +26 */
+ fprintf (f, "\tmove.d 0,$r1\n");
+ fprintf (f, "\tjsr $r1\n");
+ fprintf (f, "\tsetf\n");
+ /* +36 */
+ fprintf (f, "\tmove.d 0,$%s\n", reg_names[STATIC_CHAIN_REGNUM]);
+ /* +42 */
+ fprintf (f, "\tmove.d 0,$r1\n");
+ /* +48 */
+ fprintf (f, "\tmove.d 0,$r9\n");
+ fprintf (f, "\tjump $r9\n");
+ fprintf (f, "\tsetf\n");
+ }
+ else
+ {
+ fprintf (f, "\tmove.d $%s,[$pc+20]\n", reg_names[STATIC_CHAIN_REGNUM]);
+ fprintf (f, "\tmove $srp,[$pc+22]\n");
+ fprintf (f, "\tmove.d 0,$%s\n", reg_names[STATIC_CHAIN_REGNUM]);
+ fprintf (f, "\tjsr 0\n");
+ fprintf (f, "\tmove.d 0,$%s\n", reg_names[STATIC_CHAIN_REGNUM]);
+ fprintf (f, "\tjump 0\n");
+ }
+}
+
+/* Implement TARGET_TRAMPOLINE_INIT. */
+
+static void
+cris_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx tramp = XEXP (m_tramp, 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ if (TARGET_V32)
+ {
+ mem = adjust_address (m_tramp, SImode, 6);
+ emit_move_insn (mem, plus_constant (tramp, 38));
+ mem = adjust_address (m_tramp, SImode, 22);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 28);
+ emit_move_insn (mem, fnaddr);
+ }
+ else
+ {
+ mem = adjust_address (m_tramp, SImode, 10);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 16);
+ emit_move_insn (mem, fnaddr);
+ }
+
+ /* Note that there is no need to do anything with the cache for
+ sake of a trampoline. */
+}
+
+
#if 0
/* Various small functions to replace macros. Only called from a
debugger. They might collide with gcc functions or system functions,
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 39291079662..586f7ff2077 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -935,108 +935,11 @@ struct cum_args {int regs;};
/* Node: Trampolines */
-/* This looks too complicated, and it is. I assigned r7 to be the
- static chain register, but it is call-saved, so we have to save it,
- and come back to restore it after the call, so we have to save srp...
- Anyway, trampolines are rare enough that we can cope with this
- somewhat lack of elegance.
- (Do not be tempted to "straighten up" whitespace in the asms; the
- assembler #NO_APP state mandates strict spacing). */
-#define TRAMPOLINE_TEMPLATE(FILE) \
- do \
- { \
- if (TARGET_V32) \
- { \
- /* This normally-unused nop insn acts as an instruction to \
- the simulator to flush its instruction cache. None of \
- the other instructions in the trampoline template suits \
- as a trigger for V32. The pc-relative addressing mode \
- works nicely as a trigger for V10. \
- FIXME: Have specific V32 template (possibly avoiding the \
- use of a special instruction). */ \
- fprintf (FILE, "\tclearf x\n"); \
- /* We have to use a register as an intermediate, choosing \
- semi-randomly R1 (which has to not be the \
- STATIC_CHAIN_REGNUM), so we can use it for address \
- indirection and jsr target. */ \
- fprintf (FILE, "\tmove $r1,$mof\n"); \
- /* +4 */ \
- fprintf (FILE, "\tmove.d 0,$r1\n"); \
- fprintf (FILE, "\tmove.d $%s,[$r1]\n", \
- reg_names[STATIC_CHAIN_REGNUM]); \
- fprintf (FILE, "\taddq 6,$r1\n"); \
- fprintf (FILE, "\tmove $mof,[$r1]\n"); \
- fprintf (FILE, "\taddq 6,$r1\n"); \
- fprintf (FILE, "\tmove $srp,[$r1]\n"); \
- /* +20 */ \
- fprintf (FILE, "\tmove.d 0,$%s\n", \
- reg_names[STATIC_CHAIN_REGNUM]); \
- /* +26 */ \
- fprintf (FILE, "\tmove.d 0,$r1\n"); \
- fprintf (FILE, "\tjsr $r1\n"); \
- fprintf (FILE, "\tsetf\n"); \
- /* +36 */ \
- fprintf (FILE, "\tmove.d 0,$%s\n", \
- reg_names[STATIC_CHAIN_REGNUM]); \
- /* +42 */ \
- fprintf (FILE, "\tmove.d 0,$r1\n"); \
- /* +48 */ \
- fprintf (FILE, "\tmove.d 0,$r9\n"); \
- fprintf (FILE, "\tjump $r9\n"); \
- fprintf (FILE, "\tsetf\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tmove.d $%s,[$pc+20]\n", \
- reg_names[STATIC_CHAIN_REGNUM]); \
- fprintf (FILE, "\tmove $srp,[$pc+22]\n"); \
- fprintf (FILE, "\tmove.d 0,$%s\n", \
- reg_names[STATIC_CHAIN_REGNUM]); \
- fprintf (FILE, "\tjsr 0\n"); \
- fprintf (FILE, "\tmove.d 0,$%s\n", \
- reg_names[STATIC_CHAIN_REGNUM]); \
- fprintf (FILE, "\tjump 0\n"); \
- } \
- } \
- while (0)
-
#define TRAMPOLINE_SIZE (TARGET_V32 ? 58 : 32)
-/* CRIS wants instructions on word-boundary.
- Note that due to a bug (reported) in 2.7.2 and earlier, this is
- actually treated as alignment in _bytes_, not _bits_. (Obviously
- this is not fatal, only a slight waste of stack space). */
+/* CRIS wants instructions on word-boundary. */
#define TRAMPOLINE_ALIGNMENT 16
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- do \
- if (TARGET_V32) \
- { \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, 6)), \
- plus_constant (TRAMP, 38)); \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, 22)), \
- CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, 28)), \
- FNADDR); \
- } \
- else \
- { \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, 10)), \
- CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (TRAMP, 16)), \
- FNADDR); \
- } \
- while (0)
-
-/* Note that there is no need to do anything with the cache for sake of
- a trampoline. */
-
-
/* Node: Library Calls */
/* If you change this, you have to check whatever libraries and systems
diff --git a/gcc/config/crx/crx.h b/gcc/config/crx/crx.h
index ed6d3d6edd2..1d5cb87af3e 100644
--- a/gcc/config/crx/crx.h
+++ b/gcc/config/crx/crx.h
@@ -369,11 +369,6 @@ struct cumulative_args
#define TRAMPOLINE_SIZE 32
-#define INITIALIZE_TRAMPOLINE(addr, fnaddr, static_chain) \
-{ \
- sorry ("Trampoline support for CRX"); \
-}
-
/*****************************************************************************/
/* ADDRESSING MODES */
/*****************************************************************************/
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index c8bb508e8aa..a8933e66348 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1692,6 +1692,11 @@ darwin_kextabi_p (void) {
void
darwin_override_options (void)
{
+ /* Don't emit DWARF3/4 unless specifically selected. This is a
+ workaround for tool bugs. */
+ if (dwarf_strict < 0)
+ dwarf_strict = 1;
+
if (flag_mkernel || flag_apple_kext)
{
/* -mkernel implies -fapple-kext for C++ */
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 6fb1ec0c176..f67144286df 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -446,7 +446,7 @@ extern GTY(()) int darwin_ms_struct;
#define DBX_DEBUGGING_INFO 1
-#define DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 1
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug"
@@ -982,7 +982,7 @@ void add_framework_path (char *);
#endif
/* Attempt to turn on execute permission for the stack. This may be
- used by INITIALIZE_TRAMPOLINE of the target needs it (that is,
+ used by TARGET_TRAMPOLINE_INIT if the target needs it (that is,
if the target machine can change execute permissions on a page).
There is no way to query the execute permission of the stack, so
diff --git a/gcc/config/darwin10.h b/gcc/config/darwin10.h
new file mode 100644
index 00000000000..65ba2632a8f
--- /dev/null
+++ b/gcc/config/darwin10.h
@@ -0,0 +1,25 @@
+/* Target definitions for Darwin (Mac OS X) systems.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Jack Howarth <howarth@bromo.med.uc.edu>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Fix PR41260 by passing -no_compact_unwind on darwin10 and later until
+unwinder in libSystem is fixed to digest new epilog unwinding notes. */
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!static:-no_compact_unwind -lSystem}"
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index 431af8f63f9..faa637cddec 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -121,6 +121,8 @@ static int fr30_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static bool fr30_frame_pointer_required (void);
static bool fr30_can_eliminate (const int, const int);
+static void fr30_asm_trampoline_template (FILE *);
+static void fr30_trampoline_init (rtx, tree, rtx);
#define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM))
#define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM))
@@ -165,6 +167,11 @@ static bool fr30_can_eliminate (const int, const int);
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE fr30_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE fr30_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT fr30_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -924,6 +931,50 @@ fr30_frame_pointer_required (void)
}
/*}}}*/
+/*{{{ Trampoline Output Routines */
+
+/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE.
+ On the FR30, the trampoline is:
+
+ nop
+ ldi:32 STATIC, r12
+ nop
+ ldi:32 FUNCTION, r0
+ jmp @r0
+
+ The no-ops are to guarantee that the static chain and final
+ target are 32 bit aligned within the trampoline. That allows us to
+ initialize those locations with simple SImode stores. The alternative
+ would be to use HImode stores. */
+
+static void
+fr30_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\tnop\n");
+ fprintf (f, "\tldi:32\t#0, %s\n", reg_names [STATIC_CHAIN_REGNUM]);
+ fprintf (f, "\tnop\n");
+ fprintf (f, "\tldi:32\t#0, %s\n", reg_names [COMPILER_SCRATCH_REGISTER]);
+ fprintf (f, "\tjmp\t@%s\n", reg_names [COMPILER_SCRATCH_REGISTER]);
+}
+
+/* Implement TARGET_TRAMPOLINE_INIT. */
+
+static void
+fr30_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, SImode, 4);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 12);
+ emit_move_insn (mem, fnaddr);
+}
+
+/*}}}*/
/* Local Variables: */
/* folded-file: t */
/* End: */
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index f055a1a05dc..20e157173d8 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -730,31 +730,6 @@ enum reg_class
/*}}}*/
/*{{{ Trampolines for Nested Functions. */
-/* On the FR30, the trampoline is:
-
- nop
- ldi:32 STATIC, r12
- nop
- ldi:32 FUNCTION, r0
- jmp @r0
-
- The no-ops are to guarantee that the static chain and final
- target are 32 bit aligned within the trampoline. That allows us to
- initialize those locations with simple SImode stores. The alternative
- would be to use HImode stores. */
-
-/* A C statement to output, on the stream FILE, assembler code for a block of
- data that contains the constant parts of a trampoline. This code should not
- include a label--the label is taken care of automatically. */
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- fprintf (FILE, "\tnop\n"); \
- fprintf (FILE, "\tldi:32\t#0, %s\n", reg_names [STATIC_CHAIN_REGNUM]); \
- fprintf (FILE, "\tnop\n"); \
- fprintf (FILE, "\tldi:32\t#0, %s\n", reg_names [COMPILER_SCRATCH_REGISTER]); \
- fprintf (FILE, "\tjmp\t@%s\n", reg_names [COMPILER_SCRATCH_REGISTER]); \
-}
-
/* A C expression for the size in bytes of the trampoline, as an integer. */
#define TRAMPOLINE_SIZE 18
@@ -763,17 +738,6 @@ enum reg_class
the trampoline is also aligned on a 32bit boundary. */
#define TRAMPOLINE_ALIGNMENT 32
-/* A C statement to initialize the variable parts of a trampoline. ADDR is an
- RTX for the address of the trampoline; FNADDR is an RTX for the address of
- the nested function; STATIC_CHAIN is an RTX for the static chain value that
- should be passed to the function when it is called. */
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
-do \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (ADDR, 4)), STATIC_CHAIN);\
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (ADDR, 12)), FNADDR); \
-} while (0);
-
/*}}}*/
/*{{{ Addressing Modes. */
diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
index c726a158c6b..84d81278af8 100644
--- a/gcc/config/freebsd-spec.h
+++ b/gcc/config/freebsd-spec.h
@@ -148,3 +148,12 @@ is built with the --enable-threads configure-time option.} \
#else
#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
#endif
+
+#if defined(HAVE_LD_EH_FRAME_HDR)
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+#endif
+
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h
index 8734694e0cd..2bfdc65f654 100644
--- a/gcc/config/frv/frv-protos.h
+++ b/gcc/config/frv/frv-protos.h
@@ -100,7 +100,6 @@ extern void frv_ifcvt_modify_final (ce_if_block_t *);
extern void frv_ifcvt_modify_cancel (ce_if_block_t *);
#endif
extern int frv_trampoline_size (void);
-extern void frv_initialize_trampoline (rtx, rtx, rtx);
extern enum reg_class frv_secondary_reload_class
(enum reg_class,
enum machine_mode, rtx);
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 63e65fb8bbf..d8901e9a68e 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -383,6 +383,7 @@ static bool frv_secondary_reload (bool, rtx, enum reg_class,
secondary_reload_info *);
static bool frv_frame_pointer_required (void);
static bool frv_can_eliminate (const int, const int);
+static void frv_trampoline_init (rtx, tree, rtx);
/* Allow us to easily change the default for -malloc-cc. */
#ifndef DEFAULT_NO_ALLOC_CC
@@ -479,6 +480,9 @@ static bool frv_can_eliminate (const int, const int);
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE frv_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT frv_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
#define FRV_SYMBOL_REF_TLS_P(RTX) \
@@ -6300,9 +6304,11 @@ frv_trampoline_size (void)
sethi #0, <static_chain>
jmpl @(gr0,<jmp_reg>) */
-void
-frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
+static void
+frv_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
{
+ rtx addr = XEXP (m_tramp, 0);
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx sc_reg = force_reg (Pmode, static_chain);
emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"),
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 0516ecf2cac..53966de50b7 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1840,13 +1840,6 @@ typedef struct frv_stack {
aligning trampolines. */
#define TRAMPOLINE_ALIGNMENT (TARGET_FDPIC ? 64 : 32)
-/* A C statement to initialize the variable parts of a trampoline. ADDR is an
- RTX for the address of the trampoline; FNADDR is an RTX for the address of
- the nested function; STATIC_CHAIN is an RTX for the static chain value that
- should be passed to the function when it is called. */
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
- frv_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
-
/* Define this macro if trampolines need a special subroutine to do their work.
The macro should expand to a series of `asm' statements which will be
compiled with GCC. They go in a library function named
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 02b3ff6094a..404595405f3 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -5773,6 +5773,56 @@ h8300_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
|| GET_MODE_SIZE (TYPE_MODE (type)) > (TARGET_H8300 ? 4 : 8));
}
+/* We emit the entire trampoline here. Depending on the pointer size,
+ we use a different trampoline.
+
+ Pmode == HImode
+ vvvv context
+ 1 0000 7903xxxx mov.w #0x1234,r3
+ 2 0004 5A00xxxx jmp @0x1234
+ ^^^^ function
+
+ Pmode == SImode
+ vvvvvvvv context
+ 2 0000 7A03xxxxxxxx mov.l #0x12345678,er3
+ 3 0006 5Axxxxxx jmp @0x123456
+ ^^^^^^ function
+*/
+
+static void
+h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ if (Pmode == HImode)
+ {
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, GEN_INT (0x7903));
+ mem = adjust_address (m_tramp, Pmode, 2);
+ emit_move_insn (mem, cxt);
+ mem = adjust_address (m_tramp, HImode, 4);
+ emit_move_insn (mem, GEN_INT (0x5a00));
+ mem = adjust_address (m_tramp, Pmode, 6);
+ emit_move_insn (mem, fnaddr);
+ }
+ else
+ {
+ rtx tem;
+
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, GEN_INT (0x7a03));
+ mem = adjust_address (m_tramp, Pmode, 2);
+ emit_move_insn (mem, cxt);
+
+ tem = copy_to_reg (fnaddr);
+ emit_insn (gen_andsi3 (tem, tem, GEN_INT (0x00ffffff)));
+ emit_insn (gen_iorsi3 (tem, tem, GEN_INT (0x5a000000)));
+ mem = adjust_address (m_tramp, SImode, 6);
+ emit_move_insn (mem, tem);
+ }
+}
+
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE h8300_attribute_table
@@ -5818,4 +5868,7 @@ h8300_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE h8300_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT h8300_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 884e49a9d4a..e0f0ea62f4e 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -672,58 +672,9 @@ struct cum_arg
#define EXIT_IGNORE_STACK 0
-/* We emit the entire trampoline with INITIALIZE_TRAMPOLINE.
- Depending on the pointer size, we use a different trampoline.
-
- Pmode == HImode
- vvvv context
- 1 0000 7903xxxx mov.w #0x1234,r3
- 2 0004 5A00xxxx jmp @0x1234
- ^^^^ function
-
- Pmode == SImode
- vvvvvvvv context
- 2 0000 7A03xxxxxxxx mov.l #0x12345678,er3
- 3 0006 5Axxxxxx jmp @0x123456
- ^^^^^^ function
-*/
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12)
-
-/* Emit RTL insns to build a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- do \
- { \
- if (Pmode == HImode) \
- { \
- emit_move_insn (gen_rtx_MEM (HImode, (TRAMP)), GEN_INT (0x7903)); \
- emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), \
- (CXT)); \
- emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 4)), \
- GEN_INT (0x5a00)); \
- emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), \
- (FNADDR)); \
- } \
- else \
- { \
- rtx tem = gen_reg_rtx (Pmode); \
- \
- emit_move_insn (gen_rtx_MEM (HImode, (TRAMP)), GEN_INT (0x7a03)); \
- emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), \
- (CXT)); \
- emit_move_insn (tem, (FNADDR)); \
- emit_insn (gen_andsi3 (tem, tem, GEN_INT (0x00ffffff))); \
- emit_insn (gen_iorsi3 (tem, tem, GEN_INT (0x5a000000))); \
- emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), \
- tem); \
- } \
- } \
- while (0)
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 5fc0c1d41c5..43003cc5cad 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -383,7 +383,7 @@ do { \
/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
but for .jcr section to work we also need crtbegin and crtend
objects. */
-#define TARGET_USE_JCR_SECTION 0
+#define TARGET_USE_JCR_SECTION 1
/* Decide whether it is safe to use a local alias for a virtual function
when constructing thunks. */
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index d1d00f7a79b..933263769f9 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -267,3 +267,7 @@ while (0)
#define LIBGCC_EH_EXTN "-sjlj"
#endif
#define LIBGCC_SONAME "cyggcc_s" LIBGCC_EH_EXTN "-1.dll"
+
+/* We should find a way to not have to update this manually. */
+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-11.dll"
+
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 335a5260bd1..3b11b915194 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1879,6 +1879,7 @@ static bool ext_80387_constants_init = 0;
static struct machine_function * ix86_init_machine_status (void);
static rtx ix86_function_value (const_tree, const_tree, bool);
+static rtx ix86_static_chain (const_tree, bool);
static int ix86_function_regparm (const_tree, const_tree);
static void ix86_compute_frame_layout (struct ix86_frame *);
static bool ix86_expand_vector_init_one_nonzero (bool, enum machine_mode,
@@ -4472,8 +4473,6 @@ ix86_function_regparm (const_tree type, const_tree decl)
tree attr;
int regparm;
- static bool error_issued;
-
if (TARGET_64BIT)
return (ix86_function_type_abi (type) == SYSV_ABI
? X86_64_REGPARM_MAX : X86_64_MS_REGPARM_MAX);
@@ -4482,23 +4481,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type));
if (attr)
{
- regparm
- = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
-
- if (decl && TREE_CODE (decl) == FUNCTION_DECL)
- {
- /* We can't use regparm(3) for nested functions because
- these pass static chain pointer in %ecx register. */
- if (!error_issued && regparm == 3
- && decl_function_context (decl)
- && !DECL_NO_STATIC_CHAIN (decl))
- {
- error ("nested functions are limited to 2 register parameters");
- error_issued = true;
- return 0;
- }
- }
-
+ regparm = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
return regparm;
}
@@ -4512,7 +4495,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
&& !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
- struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
+ struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE (decl));
if (i && i->local)
{
int local_regparm, globals = 0, regno;
@@ -4523,11 +4506,9 @@ ix86_function_regparm (const_tree type, const_tree decl)
if (fixed_regs[local_regparm])
break;
- /* We can't use regparm(3) for nested functions as these use
- static chain pointer in third argument. */
- if (local_regparm == 3
- && decl_function_context (decl)
- && !DECL_NO_STATIC_CHAIN (decl))
+ /* We don't want to use regparm(3) for nested functions as
+ these use a static chain pointer in the third argument. */
+ if (local_regparm == 3 && DECL_STATIC_CHAIN (decl))
local_regparm = 2;
/* Each fixed register usage increases register pressure,
@@ -7873,9 +7854,16 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
else
frame->save_regs_using_mov = false;
+ /* Skip return address. */
+ offset = UNITS_PER_WORD;
- /* Skip return address and saved base pointer. */
- offset = frame_pointer_needed ? UNITS_PER_WORD * 2 : UNITS_PER_WORD;
+ /* Skip pushed static chain. */
+ if (ix86_static_chain_on_stack)
+ offset += UNITS_PER_WORD;
+
+ /* Skip saved base pointer. */
+ if (frame_pointer_needed)
+ offset += UNITS_PER_WORD;
frame->hard_frame_pointer_offset = offset;
@@ -8138,9 +8126,7 @@ find_drap_reg (void)
Since function with tail call may use any caller-saved
registers in epilogue, DRAP must not use caller-saved
register in such case. */
- if ((decl_function_context (decl)
- && !DECL_NO_STATIC_CHAIN (decl))
- || crtl->tail_call_emit)
+ if (DECL_STATIC_CHAIN (decl) || crtl->tail_call_emit)
return R13_REG;
return R10_REG;
@@ -8151,9 +8137,7 @@ find_drap_reg (void)
Since function with tail call may use any caller-saved
registers in epilogue, DRAP must not use caller-saved
register in such case. */
- if ((decl_function_context (decl)
- && !DECL_NO_STATIC_CHAIN (decl))
- || crtl->tail_call_emit)
+ if (DECL_STATIC_CHAIN (decl) || crtl->tail_call_emit)
return DI_REG;
/* Reuse static chain register if it isn't used for parameter
@@ -8297,20 +8281,42 @@ ix86_expand_prologue (void)
ix86_compute_frame_layout (&frame);
+ /* The first insn of a function that accepts its static chain on the
+ stack is to push the register that would be filled in by a direct
+ call. This insn will be skipped by the trampoline. */
+ if (ix86_static_chain_on_stack)
+ {
+ rtx t;
+
+ insn = emit_insn (gen_push (ix86_static_chain (cfun->decl, false)));
+ emit_insn (gen_blockage ());
+
+ /* We don't want to interpret this push insn as a register save,
+ only as a stack adjustment. The real copy of the register as
+ a save will be done later, if needed. */
+ t = plus_constant (stack_pointer_rtx, -UNITS_PER_WORD);
+ t = gen_rtx_SET (VOIDmode, stack_pointer_rtx, t);
+ add_reg_note (insn, REG_CFA_ADJUST_CFA, t);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
/* Emit prologue code to adjust stack alignment and setup DRAP, in case
of DRAP is needed and stack realignment is really needed after reload */
if (crtl->drap_reg && crtl->stack_realign_needed)
{
rtx x, y;
int align_bytes = crtl->stack_alignment_needed / BITS_PER_UNIT;
- int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)]
- ? 0 : UNITS_PER_WORD);
+ int param_ptr_offset = UNITS_PER_WORD;
+
+ if (ix86_static_chain_on_stack)
+ param_ptr_offset += UNITS_PER_WORD;
+ if (!call_used_regs[REGNO (crtl->drap_reg)])
+ param_ptr_offset += UNITS_PER_WORD;
gcc_assert (stack_realign_drap);
/* Grab the argument pointer. */
- x = plus_constant (stack_pointer_rtx,
- (UNITS_PER_WORD + param_ptr_offset));
+ x = plus_constant (stack_pointer_rtx, param_ptr_offset);
y = crtl->drap_reg;
/* Only need to push parameter pointer reg if it is caller
@@ -8519,14 +8525,18 @@ ix86_expand_prologue (void)
/* vDRAP is setup but after reload it turns out stack realign
isn't necessary, here we will emit prologue to setup DRAP
without stack realign adjustment */
+ rtx x;
int drap_bp_offset = UNITS_PER_WORD * 2;
- rtx x = plus_constant (hard_frame_pointer_rtx, drap_bp_offset);
+
+ if (ix86_static_chain_on_stack)
+ drap_bp_offset += UNITS_PER_WORD;
+ x = plus_constant (hard_frame_pointer_rtx, drap_bp_offset);
insn = emit_insn (gen_rtx_SET (VOIDmode, crtl->drap_reg, x));
}
/* Prevent instructions from being scheduled into register save push
sequence when access to the redzone area is done through frame pointer.
- The offset betweeh the frame pointer and the stack pointer is calculated
+ The offset between the frame pointer and the stack pointer is calculated
relative to the value of the stack pointer at the end of the function
prologue, and moving instructions that access redzone area via frame
pointer inside push sequence violates this assumption. */
@@ -8575,11 +8585,11 @@ ix86_emit_restore_reg_using_pop (rtx reg, HOST_WIDE_INT red_offset)
&& reg == hard_frame_pointer_rtx)
{
ix86_cfa_state->reg = stack_pointer_rtx;
- ix86_cfa_state->offset = UNITS_PER_WORD;
+ ix86_cfa_state->offset -= UNITS_PER_WORD;
add_reg_note (insn, REG_CFA_DEF_CFA,
gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (UNITS_PER_WORD)));
+ GEN_INT (ix86_cfa_state->offset)));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -8613,6 +8623,9 @@ ix86_emit_leave (HOST_WIDE_INT red_offset)
if (ix86_cfa_state->reg == hard_frame_pointer_rtx)
{
+ ix86_cfa_state->reg = stack_pointer_rtx;
+ ix86_cfa_state->offset -= UNITS_PER_WORD;
+
add_reg_note (insn, REG_CFA_ADJUST_CFA,
copy_rtx (XVECEXP (PATTERN (insn), 0, 0)));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -8757,6 +8770,8 @@ ix86_expand_epilogue (int style)
else if (stack_realign_fp)
red_offset -= crtl->stack_alignment_needed / BITS_PER_UNIT
- UNITS_PER_WORD;
+ if (ix86_static_chain_on_stack)
+ red_offset -= UNITS_PER_WORD;
if (frame_pointer_needed)
red_offset -= UNITS_PER_WORD;
@@ -8829,6 +8844,8 @@ ix86_expand_epilogue (int style)
/* Stack align doesn't work with eh_return. */
gcc_assert (!crtl->stack_realign_needed);
+ /* Neither does regparm nested functions. */
+ gcc_assert (!ix86_static_chain_on_stack);
if (frame_pointer_needed)
{
@@ -8961,29 +8978,50 @@ ix86_expand_epilogue (int style)
if (using_drap)
{
- int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)]
- ? 0 : UNITS_PER_WORD);
+ int param_ptr_offset = UNITS_PER_WORD;
rtx insn;
gcc_assert (stack_realign_drap);
+ if (ix86_static_chain_on_stack)
+ param_ptr_offset += UNITS_PER_WORD;
+ if (!call_used_regs[REGNO (crtl->drap_reg)])
+ param_ptr_offset += UNITS_PER_WORD;
+
insn = emit_insn ((*ix86_gen_add3) (stack_pointer_rtx,
crtl->drap_reg,
- GEN_INT (-(UNITS_PER_WORD
- + param_ptr_offset))));
+ GEN_INT (-param_ptr_offset)));
ix86_cfa_state->reg = stack_pointer_rtx;
- ix86_cfa_state->offset = UNITS_PER_WORD + param_ptr_offset;
+ ix86_cfa_state->offset = param_ptr_offset;
add_reg_note (insn, REG_CFA_DEF_CFA,
gen_rtx_PLUS (Pmode, ix86_cfa_state->reg,
GEN_INT (ix86_cfa_state->offset)));
RTX_FRAME_RELATED_P (insn) = 1;
- if (param_ptr_offset)
+ if (!call_used_regs[REGNO (crtl->drap_reg)])
ix86_emit_restore_reg_using_pop (crtl->drap_reg, -UNITS_PER_WORD);
}
+ /* Remove the saved static chain from the stack. The use of ECX is
+ merely as a scratch register, not as the actual static chain. */
+ if (ix86_static_chain_on_stack)
+ {
+ rtx r, insn;
+
+ gcc_assert (ix86_cfa_state->reg == stack_pointer_rtx);
+ ix86_cfa_state->offset += UNITS_PER_WORD;
+
+ r = gen_rtx_REG (Pmode, CX_REG);
+ insn = emit_insn (ix86_gen_pop1 (r));
+
+ r = plus_constant (stack_pointer_rtx, UNITS_PER_WORD);
+ r = gen_rtx_SET (VOIDmode, stack_pointer_rtx, r);
+ add_reg_note (insn, REG_CFA_ADJUST_CFA, r);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
/* Sibcall epilogues don't want a return instruction. */
if (style == 0)
{
@@ -19759,66 +19797,162 @@ ix86_minimum_alignment (tree exp, enum machine_mode mode,
return align;
}
+/* Find a location for the static chain incoming to a nested function.
+ This is a register, unless all free registers are used by arguments. */
+
+static rtx
+ix86_static_chain (const_tree fndecl, bool incoming_p)
+{
+ unsigned regno;
+
+ if (!DECL_STATIC_CHAIN (fndecl))
+ return NULL;
+
+ if (TARGET_64BIT)
+ {
+ /* We always use R10 in 64-bit mode. */
+ regno = R10_REG;
+ }
+ else
+ {
+ tree fntype;
+ /* By default in 32-bit mode we use ECX to pass the static chain. */
+ regno = CX_REG;
+
+ fntype = TREE_TYPE (fndecl);
+ if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (fntype)))
+ {
+ /* Fastcall functions use ecx/edx for arguments, which leaves
+ us with EAX for the static chain. */
+ regno = AX_REG;
+ }
+ else if (ix86_function_regparm (fntype, fndecl) == 3)
+ {
+ /* For regparm 3, we have no free call-clobbered registers in
+ which to store the static chain. In order to implement this,
+ we have the trampoline push the static chain to the stack.
+ However, we can't push a value below the return address when
+ we call the nested function directly, so we have to use an
+ alternate entry point. For this we use ESI, and have the
+ alternate entry point push ESI, so that things appear the
+ same once we're executing the nested function. */
+ if (incoming_p)
+ {
+ if (fndecl == current_function_decl)
+ ix86_static_chain_on_stack = true;
+ return gen_frame_mem (SImode,
+ plus_constant (arg_pointer_rtx, -8));
+ }
+ regno = SI_REG;
+ }
+ }
+
+ return gen_rtx_REG (Pmode, regno);
+}
+
/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-void
-x86_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+ FNDECL is the decl of the target address; M_TRAMP is a MEM for
+ the trampoline, and CHAIN_VALUE is an RTX for the static chain
+ to be passed to the target function. */
+
+static void
+ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
+ rtx mem, fnaddr;
+
+ fnaddr = XEXP (DECL_RTL (fndecl), 0);
+
if (!TARGET_64BIT)
{
- /* Compute offset from the end of the jmp to the target function. */
- rtx disp = expand_binop (SImode, sub_optab, fnaddr,
- plus_constant (tramp, 10),
- NULL_RTX, 1, OPTAB_DIRECT);
- emit_move_insn (gen_rtx_MEM (QImode, tramp),
- gen_int_mode (0xb9, QImode));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 1)), cxt);
- emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 5)),
- gen_int_mode (0xe9, QImode));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 6)), disp);
+ rtx disp, chain;
+ int opcode;
+
+ /* Depending on the static chain location, either load a register
+ with a constant, or push the constant to the stack. All of the
+ instructions are the same size. */
+ chain = ix86_static_chain (fndecl, true);
+ if (REG_P (chain))
+ {
+ if (REGNO (chain) == CX_REG)
+ opcode = 0xb9;
+ else if (REGNO (chain) == AX_REG)
+ opcode = 0xb8;
+ else
+ gcc_unreachable ();
+ }
+ else
+ opcode = 0x68;
+
+ mem = adjust_address (m_tramp, QImode, 0);
+ emit_move_insn (mem, gen_int_mode (opcode, QImode));
+
+ mem = adjust_address (m_tramp, SImode, 1);
+ emit_move_insn (mem, chain_value);
+
+ /* Compute offset from the end of the jmp to the target function.
+ In the case in which the trampoline stores the static chain on
+ the stack, we need to skip the first insn which pushes the
+ (call-saved) register static chain; this push is 1 byte. */
+ disp = expand_binop (SImode, sub_optab, fnaddr,
+ plus_constant (XEXP (m_tramp, 0),
+ MEM_P (chain) ? 9 : 10),
+ NULL_RTX, 1, OPTAB_DIRECT);
+
+ mem = adjust_address (m_tramp, QImode, 5);
+ emit_move_insn (mem, gen_int_mode (0xe9, QImode));
+
+ mem = adjust_address (m_tramp, SImode, 6);
+ emit_move_insn (mem, disp);
}
else
{
int offset = 0;
- /* Try to load address using shorter movl instead of movabs.
- We may want to support movq for kernel mode, but kernel does not use
- trampolines at the moment. */
+
+ /* Load the function address to r11. Try to load address using
+ the shorter movl instead of movabs. We may want to support
+ movq for kernel mode, but kernel does not use trampolines at
+ the moment. */
if (x86_64_zext_immediate_operand (fnaddr, VOIDmode))
{
fnaddr = copy_to_mode_reg (DImode, fnaddr);
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, offset)),
- gen_int_mode (0xbb41, HImode));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, offset + 2)),
- gen_lowpart (SImode, fnaddr));
+
+ mem = adjust_address (m_tramp, HImode, offset);
+ emit_move_insn (mem, gen_int_mode (0xbb41, HImode));
+
+ mem = adjust_address (m_tramp, SImode, offset + 2);
+ emit_move_insn (mem, gen_lowpart (SImode, fnaddr));
offset += 6;
}
else
{
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, offset)),
- gen_int_mode (0xbb49, HImode));
- emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, offset + 2)),
- fnaddr);
+ mem = adjust_address (m_tramp, HImode, offset);
+ emit_move_insn (mem, gen_int_mode (0xbb49, HImode));
+
+ mem = adjust_address (m_tramp, DImode, offset + 2);
+ emit_move_insn (mem, fnaddr);
offset += 10;
}
+
/* Load static chain using movabs to r10. */
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, offset)),
- gen_int_mode (0xba49, HImode));
- emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, offset + 2)),
- cxt);
+ mem = adjust_address (m_tramp, HImode, offset);
+ emit_move_insn (mem, gen_int_mode (0xba49, HImode));
+
+ mem = adjust_address (m_tramp, DImode, offset + 2);
+ emit_move_insn (mem, chain_value);
offset += 10;
- /* Jump to the r11 */
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, offset)),
- gen_int_mode (0xff49, HImode));
- emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, offset+2)),
- gen_int_mode (0xe3, QImode));
- offset += 3;
+
+ /* Jump to r11; the last (unused) byte is a nop, only there to
+ pad the write out to a single 32-bit store. */
+ mem = adjust_address (m_tramp, SImode, offset);
+ emit_move_insn (mem, gen_int_mode (0x90e3ff49, SImode));
+ offset += 4;
+
gcc_assert (offset <= TRAMPOLINE_SIZE);
}
#ifdef ENABLE_EXECUTE_STACK
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
+ LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
#endif
}
@@ -27926,7 +28060,7 @@ static bool
ix86_scalar_mode_supported_p (enum machine_mode mode)
{
if (DECIMAL_FLOAT_MODE_P (mode))
- return true;
+ return default_decimal_float_supported_p ();
else if (mode == TFmode)
return true;
else
@@ -29229,6 +29363,10 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
#define TARGET_GET_DRAP_RTX ix86_get_drap_rtx
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
+#undef TARGET_STATIC_CHAIN
+#define TARGET_STATIC_CHAIN ix86_static_chain
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT ix86_trampoline_init
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index e898a651fc9..f825948048a 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1131,11 +1131,6 @@ enum target_cpu_default
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM 16
-/* Register in which static-chain is passed to a function.
- We do use ECX as static chain register for 32 bit ABI. On the
- 64bit ABI, ECX is an argument register, so we use R10 instead. */
-#define STATIC_CHAIN_REGNUM (TARGET_64BIT ? R10_REG : CX_REG)
-
/* Register to hold the addressing base for position independent
code access to data items. We don't use PIC pointer for 64bit
mode. Define the regnum to dummy value to prevent gcc from
@@ -1659,14 +1654,7 @@ typedef struct ix86_args {
/* Length in units of the trampoline for entering a nested function. */
-#define TRAMPOLINE_SIZE (TARGET_64BIT ? 23 : 10)
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- x86_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 24 : 10)
/* Definitions for register eliminations.
@@ -2365,15 +2353,29 @@ struct GTY(()) machine_function {
const char *some_ld_name;
int varargs_gpr_size;
int varargs_fpr_size;
- int accesses_prev_frame;
int optimize_mode_switching[MAX_386_ENTITIES];
- int needs_cld;
+
+ /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE
+ has been computed for. */
+ int use_fast_prologue_epilogue_nregs;
+
+ /* The CFA state at the end of the prologue. */
+ struct machine_cfa_state cfa;
+
+ /* This value is used for amd64 targets and specifies the current abi
+ to be used. MS_ABI means ms abi. Otherwise SYSV_ABI means sysv abi. */
+ enum calling_abi call_abi;
+
+ /* Nonzero if the function accesses a previous frame. */
+ BOOL_BITFIELD accesses_prev_frame : 1;
+
+ /* Nonzero if the function requires a CLD in the prologue. */
+ BOOL_BITFIELD needs_cld : 1;
+
/* Set by ix86_compute_frame_layout and used by prologue/epilogue
expander to determine the style used. */
- int use_fast_prologue_epilogue;
- /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
- for. */
- int use_fast_prologue_epilogue_nregs;
+ BOOL_BITFIELD use_fast_prologue_epilogue : 1;
+
/* If true, the current function needs the default PIC register, not
an alternate register (on x86) and must not use the red zone (on
x86_64), even if it's a leaf function. We don't want the
@@ -2383,11 +2385,11 @@ struct GTY(()) machine_function {
if all such instructions are optimized away. Use the
ix86_current_function_calls_tls_descriptor macro for a better
approximation. */
- int tls_descriptor_call_expanded_p;
- /* This value is used for amd64 targets and specifies the current abi
- to be used. MS_ABI means ms abi. Otherwise SYSV_ABI means sysv abi. */
- enum calling_abi call_abi;
- struct machine_cfa_state cfa;
+ BOOL_BITFIELD tls_descriptor_call_expanded_p : 1;
+
+ /* If true, the current function has a STATIC_CHAIN is placed on the
+ stack below the return address. */
+ BOOL_BITFIELD static_chain_on_stack : 1;
};
#endif
@@ -2406,6 +2408,7 @@ struct GTY(()) machine_function {
#define ix86_current_function_calls_tls_descriptor \
(ix86_tls_descriptor_calls_expanded_in_cfun && df_regs_ever_live_p (SP_REG))
#define ix86_cfa_state (&cfun->machine->cfa)
+#define ix86_static_chain_on_stack (cfun->machine->static_chain_on_stack)
/* Control behavior of x86_file_start. */
#define X86_FILE_START_VERSION_DIRECTIVE false
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index e856ecdbc97..9dcc5ba1f67 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -221,3 +221,7 @@ __enable_execute_stack (void *addr) \
#define LIBGCC_EH_EXTN "_sjlj"
#endif
#define LIBGCC_SONAME "libgcc_s" LIBGCC_EH_EXTN "-1.dll"
+
+/* We should find a way to not have to update this manually. */
+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-11.dll"
+
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 6d9440ef0d4..3c6a153498e 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -54,7 +54,6 @@ extern int ia64_direct_return (void);
extern bool ia64_expand_load_address (rtx, rtx);
extern int ia64_hard_regno_rename_ok (int, int);
-extern void ia64_initialize_trampoline (rtx, rtx, rtx);
extern void ia64_print_operand_address (FILE *, rtx);
extern void ia64_print_operand (FILE *, rtx, int);
extern enum reg_class ia64_preferred_reload_class (rtx, enum reg_class);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 7e757523381..75c8f0ee6c4 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -302,6 +302,7 @@ static enum machine_mode ia64_promote_function_mode (const_tree,
int *,
const_tree,
int);
+static void ia64_trampoline_init (rtx, tree, rtx);
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
@@ -532,6 +533,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE ia64_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT ia64_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
typedef enum
@@ -3945,10 +3949,35 @@ ia64_dbx_register_number (int regno)
return regno;
}
-void
-ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
+/* Implement TARGET_TRAMPOLINE_INIT.
+
+ The trampoline should set the static chain pointer to value placed
+ into the trampoline and should branch to the specified routine.
+ To make the normal indirect-subroutine calling convention work,
+ the trampoline must look like a function descriptor; the first
+ word being the target address and the second being the target's
+ global pointer.
+
+ We abuse the concept of a global pointer by arranging for it
+ to point to the data we need to load. The complete trampoline
+ has the following form:
+
+ +-------------------+ \
+ TRAMP: | __ia64_trampoline | |
+ +-------------------+ > fake function descriptor
+ | TRAMP+16 | |
+ +-------------------+ /
+ | target descriptor |
+ +-------------------+
+ | static link |
+ +-------------------+
+*/
+
+static void
+ia64_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
{
- rtx addr_reg, tramp, eight = GEN_INT (8);
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx addr, addr_reg, tramp, eight = GEN_INT (8);
/* The Intel assembler requires that the global __ia64_trampoline symbol
be declared explicitly */
@@ -3965,13 +3994,13 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
}
/* Make sure addresses are Pmode even if we are in ILP32 mode. */
- addr = convert_memory_address (Pmode, addr);
+ addr = convert_memory_address (Pmode, XEXP (m_tramp, 0));
fnaddr = convert_memory_address (Pmode, fnaddr);
static_chain = convert_memory_address (Pmode, static_chain);
/* Load up our iterator. */
- addr_reg = gen_reg_rtx (Pmode);
- emit_move_insn (addr_reg, addr);
+ addr_reg = copy_to_reg (addr);
+ m_tramp = adjust_automodify_address (m_tramp, Pmode, addr_reg, 0);
/* The first two words are the fake descriptor:
__ia64_trampoline, ADDR+16. */
@@ -3989,19 +4018,21 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
emit_move_insn (reg, gen_rtx_MEM (Pmode, reg));
tramp = reg;
}
- emit_move_insn (gen_rtx_MEM (Pmode, addr_reg), tramp);
+ emit_move_insn (m_tramp, tramp);
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
+ m_tramp = adjust_automodify_address (m_tramp, VOIDmode, NULL, 8);
- emit_move_insn (gen_rtx_MEM (Pmode, addr_reg),
- copy_to_reg (plus_constant (addr, 16)));
+ emit_move_insn (m_tramp, force_reg (Pmode, plus_constant (addr, 16)));
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
+ m_tramp = adjust_automodify_address (m_tramp, VOIDmode, NULL, 8);
/* The third word is the target descriptor. */
- emit_move_insn (gen_rtx_MEM (Pmode, addr_reg), fnaddr);
+ emit_move_insn (m_tramp, force_reg (Pmode, fnaddr));
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
+ m_tramp = adjust_automodify_address (m_tramp, VOIDmode, NULL, 8);
/* The fourth word is the static chain. */
- emit_move_insn (gen_rtx_MEM (Pmode, addr_reg), static_chain);
+ emit_move_insn (m_tramp, static_chain);
}
/* Do any needed setup for a variadic function. CUM has not been updated
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 40c85501cda..53bbda2b1ed 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1247,31 +1247,6 @@ do { \
#define STACK_SAVEAREA_MODE(LEVEL) \
((LEVEL) == SAVE_NONLOCAL ? OImode : Pmode)
-/* Output assembler code for a block containing the constant parts of
- a trampoline, leaving space for the variable parts.
-
- The trampoline should set the static chain pointer to value placed
- into the trampoline and should branch to the specified routine.
- To make the normal indirect-subroutine calling convention work,
- the trampoline must look like a function descriptor; the first
- word being the target address and the second being the target's
- global pointer.
-
- We abuse the concept of a global pointer by arranging for it
- to point to the data we need to load. The complete trampoline
- has the following form:
-
- +-------------------+ \
- TRAMP: | __ia64_trampoline | |
- +-------------------+ > fake function descriptor
- | TRAMP+16 | |
- +-------------------+ /
- | target descriptor |
- +-------------------+
- | static link |
- +-------------------+
-*/
-
/* A C expression for the size in bytes of the trampoline, as an integer. */
#define TRAMPOLINE_SIZE 32
@@ -1279,11 +1254,6 @@ do { \
/* Alignment required for trampolines, in bits. */
#define TRAMPOLINE_ALIGNMENT 64
-
-/* A C statement to initialize the variable parts of a trampoline. */
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
- ia64_initialize_trampoline((ADDR), (FNADDR), (STATIC_CHAIN))
/* Addressing Modes */
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 85a8e5ac9f4..2e2f29aaeb7 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -166,6 +166,8 @@ static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
static void iq2000_va_start (tree, rtx);
static bool iq2000_legitimate_address_p (enum machine_mode, rtx, bool);
static bool iq2000_can_eliminate (const int, const int);
+static void iq2000_asm_trampoline_template (FILE *);
+static void iq2000_trampoline_init (rtx, tree, rtx);
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS iq2000_init_builtins
@@ -218,6 +220,11 @@ static bool iq2000_can_eliminate (const int, const int);
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE iq2000_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE iq2000_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT iq2000_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Return nonzero if we split the address into high and low parts. */
@@ -3410,4 +3417,47 @@ iq2000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int * total,
return true;
}
+/* Worker for TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+static void
+iq2000_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\t.word\t0x03e00821\t\t# move $1,$31\n");
+ fprintf (f, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# nop\n");
+ if (Pmode == DImode)
+ {
+ fprintf (f, "\t.word\t0xdfe30014\t\t# ld $3,20($31)\n");
+ fprintf (f, "\t.word\t0xdfe2001c\t\t# ld $2,28($31)\n");
+ }
+ else
+ {
+ fprintf (f, "\t.word\t0x8fe30014\t\t# lw $3,20($31)\n");
+ fprintf (f, "\t.word\t0x8fe20018\t\t# lw $2,24($31)\n");
+ }
+ fprintf (f, "\t.word\t0x0060c821\t\t# move $25,$3 (abicalls)\n");
+ fprintf (f, "\t.word\t0x00600008\t\t# jr $3\n");
+ fprintf (f, "\t.word\t0x0020f821\t\t# move $31,$1\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# <function address>\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# <static chain value>\n");
+}
+
+/* Worker for TARGET_TRAMPOLINE_INIT. */
+
+static void
+iq2000_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_CODE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, Pmode, TRAMPOLINE_CODE_SIZE);
+ emit_move_insn (mem, fnaddr);
+ mem = adjust_address (m_tramp, Pmode,
+ TRAMPOLINE_CODE_SIZE + GET_MODE_SIZE (Pmode));
+ emit_move_insn (mem, chain_value);
+}
+
#include "gt-iq2000.h"
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index 43bacfdd28e..4dadbdb5472 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -469,43 +469,9 @@ typedef struct iq2000_args
/* Trampolines for Nested Functions. */
-/* A C statement to output, on the stream FILE, assembler code for a
- block of data that contains the constant parts of a trampoline.
- This code should not include a label--the label is taken care of
- automatically. */
-
-#define TRAMPOLINE_TEMPLATE(STREAM) \
-{ \
- fprintf (STREAM, "\t.word\t0x03e00821\t\t# move $1,$31\n"); \
- fprintf (STREAM, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# nop\n"); \
- if (Pmode == DImode) \
- { \
- fprintf (STREAM, "\t.word\t0xdfe30014\t\t# ld $3,20($31)\n"); \
- fprintf (STREAM, "\t.word\t0xdfe2001c\t\t# ld $2,28($31)\n"); \
- } \
- else \
- { \
- fprintf (STREAM, "\t.word\t0x8fe30014\t\t# lw $3,20($31)\n"); \
- fprintf (STREAM, "\t.word\t0x8fe20018\t\t# lw $2,24($31)\n"); \
- } \
- fprintf (STREAM, "\t.word\t0x0060c821\t\t# move $25,$3 (abicalls)\n"); \
- fprintf (STREAM, "\t.word\t0x00600008\t\t# jr $3\n"); \
- fprintf (STREAM, "\t.word\t0x0020f821\t\t# move $31,$1\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# <function address>\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# <static chain value>\n"); \
-}
-
-#define TRAMPOLINE_SIZE (40)
-
-#define TRAMPOLINE_ALIGNMENT 32
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
-{ \
- rtx addr = ADDR; \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 32)), FUNC); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 36)), CHAIN);\
-}
+#define TRAMPOLINE_CODE_SIZE (8*4)
+#define TRAMPOLINE_SIZE (TRAMPOLINE_CODE_SIZE + 2*GET_MODE_SIZE (Pmode))
+#define TRAMPOLINE_ALIGNMENT GET_MODE_ALIGNMENT (Pmode)
/* Addressing Modes. */
diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h
index d332475784f..e571fe9d25e 100644
--- a/gcc/config/m32c/m32c-protos.h
+++ b/gcc/config/m32c/m32c-protos.h
@@ -73,7 +73,6 @@ int m32c_hard_regno_ok (int, MM);
bool m32c_illegal_subreg_p (rtx);
bool m32c_immd_dbl_mov (rtx *, MM);
rtx m32c_incoming_return_addr_rtx (void);
-void m32c_initialize_trampoline (rtx, rtx, rtx);
int m32c_legitimate_constant_p (rtx);
int m32c_legitimize_reload_address (rtx *, MM, int, int, int);
rtx m32c_libcall_value (MM);
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 1bf3d1bcb2f..4eeedb183e7 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -422,6 +422,9 @@ m32c_override_options (void)
}
else
target_memregs = 16;
+
+ if (TARGET_A24)
+ flag_ivopts = 0;
}
/* Defining data structures for per-function information */
@@ -638,6 +641,8 @@ m32c_reg_class_from_constraint (char c ATTRIBUTE_UNUSED, const char *s)
return R3_REGS;
if (memcmp (s, "R02", 3) == 0)
return R02_REGS;
+ if (memcmp (s, "R13", 3) == 0)
+ return R13_REGS;
if (memcmp (s, "R03", 3) == 0)
return R03_REGS;
if (memcmp (s, "Rdi", 3) == 0)
@@ -1717,11 +1722,16 @@ m32c_trampoline_alignment (void)
return 2;
}
-/* Implements INITIALIZE_TRAMPOLINE. */
-void
-m32c_initialize_trampoline (rtx tramp, rtx function, rtx chainval)
+/* Implements TARGET_TRAMPOLINE_INIT. */
+
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT m32c_trampoline_init
+static void
+m32c_trampoline_init (rtx m_tramp, tree fndecl, rtx chainval)
{
-#define A0(m,i) gen_rtx_MEM (m, plus_constant (tramp, i))
+ rtx function = XEXP (DECL_RTL (fndecl), 0);
+
+#define A0(m,i) adjust_address (m_tramp, m, i)
if (TARGET_A16)
{
/* Note: we subtract a "word" because the moves want signed
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index ee092a56525..0f12158c0e4 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -277,6 +277,7 @@ machine_function;
{ 0x00000002 }, /* R2 - r2 */\
{ 0x00000008 }, /* R3 - r3 */\
{ 0x00000003 }, /* R02 - r0r2 */\
+ { 0x0000000c }, /* R13 - r1r3 */\
{ 0x00000005 }, /* HL - r0 r1 */\
{ 0x00000005 }, /* QI - r0 r1 */\
{ 0x0000000a }, /* R23 - r2 r3 */\
@@ -316,6 +317,7 @@ enum reg_class
R2_REGS,
R3_REGS,
R02_REGS,
+ R13_REGS,
HL_REGS,
QI_REGS,
R23_REGS,
@@ -357,6 +359,7 @@ enum reg_class
"R2_REGS", \
"R3_REGS", \
"R02_REGS", \
+"R13_REGS", \
"HL_REGS", \
"QI_REGS", \
"R23_REGS", \
@@ -555,7 +558,6 @@ typedef struct m32c_cumulative_args
#define TRAMPOLINE_SIZE m32c_trampoline_size ()
#define TRAMPOLINE_ALIGNMENT m32c_trampoline_alignment ()
-#define INITIALIZE_TRAMPOLINE(a,fn,sc) m32c_initialize_trampoline (a, fn, sc)
/* Addressing Modes */
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index fdd89bc27a5..36a652acdf3 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -88,6 +88,7 @@ static bool m32r_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
static int m32r_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static bool m32r_can_eliminate (const int, const int);
+static void m32r_trampoline_init (rtx, tree, rtx);
/* M32R specific attributes. */
@@ -155,6 +156,9 @@ static const struct attribute_spec m32r_attribute_table[] =
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE m32r_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT m32r_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -2630,3 +2634,34 @@ m32r_return_addr (int count)
return get_hard_reg_initial_val (Pmode, RETURN_ADDR_REGNUM);
}
+
+static void
+m32r_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ emit_move_insn (adjust_address (m_tramp, SImode, 0),
+ gen_int_mode (TARGET_LITTLE_ENDIAN ?
+ 0x017e8e17 : 0x178e7e01, SImode));
+ emit_move_insn (adjust_address (m_tramp, SImode, 4),
+ gen_int_mode (TARGET_LITTLE_ENDIAN ?
+ 0x0c00ae86 : 0x86ae000c, SImode));
+ emit_move_insn (adjust_address (m_tramp, SImode, 8),
+ gen_int_mode (TARGET_LITTLE_ENDIAN ?
+ 0xe627871e : 0x1e8727e6, SImode));
+ emit_move_insn (adjust_address (m_tramp, SImode, 12),
+ gen_int_mode (TARGET_LITTLE_ENDIAN ?
+ 0xc616c626 : 0x26c61fc6, SImode));
+ emit_move_insn (adjust_address (m_tramp, SImode, 16),
+ chain_value);
+ emit_move_insn (adjust_address (m_tramp, SImode, 20),
+ XEXP (DECL_RTL (fndecl), 0));
+
+ if (m32r_cache_flush_trap >= 0)
+ emit_insn (gen_flush_icache
+ (validize_mem (adjust_address (m_tramp, SImode, 0)),
+ gen_int_mode (m32r_cache_flush_trap, SImode)));
+ else if (m32r_cache_flush_func && m32r_cache_flush_func[0])
+ emit_library_call (m32r_function_symbol (m32r_cache_flush_func),
+ LCT_NORMAL, VOIDmode, 3, XEXP (m_tramp, 0), Pmode,
+ gen_int_mode (TRAMPOLINE_SIZE, SImode), SImode,
+ GEN_INT (3), SImode);
+}
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index da6a105247b..7b6237a7c22 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -990,38 +990,6 @@ L2: .word STATIC
/* Length in bytes of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 24
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- do \
- { \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 0)), \
- gen_int_mode (TARGET_LITTLE_ENDIAN ? \
- 0x017e8e17 : 0x178e7e01, SImode)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), \
- gen_int_mode (TARGET_LITTLE_ENDIAN ? \
- 0x0c00ae86 : 0x86ae000c, SImode)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), \
- gen_int_mode (TARGET_LITTLE_ENDIAN ? \
- 0xe627871e : 0x1e8727e6, SImode)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), \
- gen_int_mode (TARGET_LITTLE_ENDIAN ? \
- 0xc616c626 : 0x26c61fc6, SImode)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 16)), \
- (CXT)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 20)), \
- (FNADDR)); \
- if (m32r_cache_flush_trap >= 0) \
- emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)),\
- gen_int_mode (m32r_cache_flush_trap, SImode))); \
- else if (m32r_cache_flush_func && m32r_cache_flush_func[0]) \
- emit_library_call (m32r_function_symbol (m32r_cache_flush_func), \
- LCT_NORMAL, VOIDmode, 3, TRAMP, Pmode, \
- gen_int_mode (TRAMPOLINE_SIZE, SImode), SImode, \
- GEN_INT (3), SImode); \
- } \
- while (0)
#define RETURN_ADDR_RTX(COUNT, FRAME) m32r_return_addr (COUNT)
diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h
index e4f8ba7ae80..59154faf00b 100644
--- a/gcc/config/m68hc11/m68hc11-protos.h
+++ b/gcc/config/m68hc11/m68hc11-protos.h
@@ -43,8 +43,6 @@ extern void m68hc11_function_arg_advance (CUMULATIVE_ARGS*,
#ifdef RTX_CODE
extern int m68hc11_auto_inc_p (rtx);
-extern void m68hc11_initialize_trampoline (rtx, rtx, rtx);
-
extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx);
extern enum reg_class preferred_reload_class (rtx, enum reg_class);
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index d30b84ccfd5..5f8011c664f 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -92,6 +92,7 @@ static void m68hc11_init_libfuncs (void);
static rtx m68hc11_struct_value_rtx (tree, int);
static bool m68hc11_return_in_memory (const_tree, const_tree);
static bool m68hc11_can_eliminate (const int, const int);
+static void m68hc11_trampoline_init (rtx, tree, rtx);
/* Must be set to 1 to produce debug messages. */
int debug_m6811 = 0;
@@ -282,6 +283,9 @@ static const struct attribute_spec m68hc11_attribute_table[] =
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE m68hc11_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT m68hc11_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
int
@@ -1072,39 +1076,49 @@ symbolic_memory_operand (rtx op, enum machine_mode mode)
jmp FNADDR
*/
-void
-m68hc11_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+m68hc11_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
{
const char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM];
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
/* Skip the '*'. */
if (*static_chain_reg == '*')
static_chain_reg++;
if (TARGET_M6811)
{
- emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x18ce));
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
- GEN_INT (0x18df));
- emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, GEN_INT (0x18ce));
+ mem = adjust_address (m_tramp, HImode, 2);
+ emit_move_insn (mem, cxt);
+ mem = adjust_address (m_tramp, HImode, 4);
+ emit_move_insn (mem, GEN_INT (0x18df));
+ mem = adjust_address (m_tramp, QImode, 6);
+ emit_move_insn (mem,
gen_rtx_CONST (QImode,
gen_rtx_SYMBOL_REF (Pmode,
static_chain_reg)));
- emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 7)),
- GEN_INT (0x7e));
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 8)), fnaddr);
+ mem = adjust_address (m_tramp, QImode, 7);
+ emit_move_insn (mem, GEN_INT (0x7e));
+ mem = adjust_address (m_tramp, HImode, 8);
+ emit_move_insn (mem, fnaddr);
}
else
{
- emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x1803));
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, GEN_INT (0x1803));
+ mem = adjust_address (m_tramp, HImode, 2);
+ emit_move_insn (mem, cxt);
+ mem = adjust_address (m_tramp, HImode, 4);
+ emit_move_insn (mem,
gen_rtx_CONST (HImode,
gen_rtx_SYMBOL_REF (Pmode,
static_chain_reg)));
- emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
- GEN_INT (0x06));
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 7)), fnaddr);
+ mem = adjust_address (m_tramp, QImode, 6);
+ emit_move_insn (mem, GEN_INT (0x06));
+ mem = adjust_address (m_tramp, HImode, 7);
+ emit_move_insn (mem, fnaddr);
}
}
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 9b19c33e0f8..ee0f9f67fca 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1005,17 +1005,10 @@ typedef struct m68hc11_args
for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO) \
fprintf (FILE, "\tldy\t.LP%d\n\tjsr mcount\n", (LABELNO))
+
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE (TARGET_M6811 ? 11 : 9)
-/* A C statement to initialize the variable parts of a trampoline.
- ADDR is an RTX for the address of the trampoline; FNADDR is an
- RTX for the address of the nested function; STATIC_CHAIN is an
- RTX for the static chain value that should be passed to the
- function when it is called. */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- m68hc11_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
-
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 033872c28a1..0862936b1b4 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -153,6 +153,7 @@ static bool m68k_rtx_costs (rtx, int, int, int *, bool);
static bool m68k_return_in_memory (const_tree, const_tree);
#endif
static void m68k_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
+static void m68k_trampoline_init (rtx, tree, rtx);
/* Specify the identification number of the library being built */
@@ -267,6 +268,9 @@ const char *m68k_library_id_string = "_current_shared_library_a5_offset_";
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE m68k_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT m68k_trampoline_init
+
static const struct attribute_spec m68k_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
@@ -4958,7 +4962,11 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this_slot, offset, addr, mem, insn;
+ rtx this_slot, offset, addr, mem, insn, tmp;
+
+ /* Avoid clobbering the struct value reg by using the
+ static chain reg as a temporary. */
+ tmp = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
/* Pretend to be a post-reload pass while generating rtl. */
reload_completed = 1;
@@ -4985,15 +4993,15 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
if (vcall_offset != 0)
{
/* Set the static chain register to *THIS. */
- emit_move_insn (static_chain_rtx, this_slot);
- emit_move_insn (static_chain_rtx, gen_rtx_MEM (Pmode, static_chain_rtx));
+ emit_move_insn (tmp, this_slot);
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
/* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */
- addr = plus_constant (static_chain_rtx, vcall_offset);
+ addr = plus_constant (tmp, vcall_offset);
if (!m68k_legitimate_address_p (Pmode, addr, true))
{
- emit_insn (gen_rtx_SET (VOIDmode, static_chain_rtx, addr));
- addr = static_chain_rtx;
+ emit_insn (gen_rtx_SET (VOIDmode, tmp, addr));
+ addr = tmp;
}
/* Load the offset into %d0 and add it to THIS. */
@@ -5019,8 +5027,8 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
SET_REGNO (pic_offset_table_rtx, STATIC_CHAIN_REGNUM);
emit_insn (gen_load_got (pic_offset_table_rtx));
}
- legitimize_pic_address (XEXP (mem, 0), Pmode, static_chain_rtx);
- mem = replace_equiv_address (mem, static_chain_rtx);
+ legitimize_pic_address (XEXP (mem, 0), Pmode, tmp);
+ mem = replace_equiv_address (mem, tmp);
}
insn = emit_call_insn (gen_sibcall (mem, const0_rtx));
SIBLING_CALL_P (insn) = 1;
@@ -6390,4 +6398,30 @@ m68k_sched_indexed_address_bypass_p (rtx pro, rtx con)
}
}
+/* We generate a two-instructions program at M_TRAMP :
+ movea.l &CHAIN_VALUE,%a0
+ jmp FNADDR
+ where %a0 can be modified by changing STATIC_CHAIN_REGNUM. */
+
+static void
+m68k_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ gcc_assert (ADDRESS_REGNO_P (STATIC_CHAIN_REGNUM));
+
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, GEN_INT(0x207C + ((STATIC_CHAIN_REGNUM-8) << 9)));
+ mem = adjust_address (m_tramp, SImode, 2);
+ emit_move_insn (mem, chain_value);
+
+ mem = adjust_address (m_tramp, HImode, 6);
+ emit_move_insn (mem, GEN_INT(0x4EF9));
+ mem = adjust_address (m_tramp, SImode, 8);
+ emit_move_insn (mem, fnaddr);
+
+ FINALIZE_TRAMPOLINE (XEXP (m_tramp, 0));
+}
+
#include "gt-m68k.h"
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index b2cfb1d8fd1..5787e8aa1fd 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -617,20 +617,6 @@ extern enum reg_class regno_reg_class[];
#define FINALIZE_TRAMPOLINE(TRAMP)
#endif
-/* We generate a two-instructions program at address TRAMP :
- movea.l &CXT,%a0
- jmp FNADDR */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \
- GEN_INT(0x207C + ((STATIC_CHAIN_REGNUM-8) << 9))); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), \
- GEN_INT(0x4EF9)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), FNADDR); \
- FINALIZE_TRAMPOLINE(TRAMP); \
-}
-
/* This is the library routine that is used to transfer control from the
trampoline to the actual nested function. It is defined for backward
compatibility, for linking with object code that used the old trampoline
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index 258b9e1cc73..fd654188e05 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -312,39 +312,5 @@ while (0)
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts. */
-
-/* On m68k svr4, the trampoline is different from the generic version
- in that we use a1 as the static call chain. */
-
-#undef TRAMPOLINE_TEMPLATE
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- assemble_aligned_integer (2, GEN_INT (0x227a)); \
- assemble_aligned_integer (2, GEN_INT (8)); \
- assemble_aligned_integer (2, GEN_INT (0x2f3a)); \
- assemble_aligned_integer (2, GEN_INT (8)); \
- assemble_aligned_integer (2, GEN_INT (0x4e75)); \
- assemble_aligned_integer (4, const0_rtx); \
- assemble_aligned_integer (4, const0_rtx); \
-}
-
-/* Redefine since we are using a different trampoline */
-#undef TRAMPOLINE_SIZE
-#define TRAMPOLINE_SIZE 18
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#undef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 10)), CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 14)), FNADDR); \
-}
-
-
/* XXX
This is the end of the chunk lifted from m68kv4.h */
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 170b4b00de6..de897fd5a55 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -144,7 +144,8 @@ static bool mcore_return_in_memory (const_tree, const_tree);
static int mcore_arg_partial_bytes (CUMULATIVE_ARGS *,
enum machine_mode,
tree, bool);
-
+static void mcore_asm_trampoline_template (FILE *);
+static void mcore_trampoline_init (rtx, tree, rtx);
/* MCore specific attributes. */
@@ -209,6 +210,11 @@ static const struct attribute_spec mcore_attribute_table[] =
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS mcore_setup_incoming_varargs
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE mcore_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT mcore_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Adjust the stack and return the number of bytes taken to do it. */
@@ -2736,7 +2742,7 @@ mcore_function_value (const_tree valtype, const_tree func)
mode = TYPE_MODE (valtype);
/* Since we promote return types, we must promote the mode here too. */
- mode = promote_function_mode (valtype, mode, &unsignedp, func, 1);
+ mode = promote_function_mode (valtype, mode, &unsigned_p, func, 1);
return handle_structs_in_regs (mode, valtype, FIRST_RET_REG);
}
@@ -3105,3 +3111,42 @@ mcore_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
const HOST_WIDE_INT size = int_size_in_bytes (type);
return (size == -1 || size > 2 * UNITS_PER_WORD);
}
+
+/* Worker function for TARGET_ASM_TRAMPOLINE_TEMPLATE.
+ Output assembler code for a block containing the constant parts
+ of a trampoline, leaving space for the variable parts.
+
+ On the MCore, the trampoline looks like:
+ lrw r1, function
+ lrw r13, area
+ jmp r13
+ or r0, r0
+ .literals */
+
+static void
+mcore_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\t.short 0x7102\n");
+ fprintf (f, "\t.short 0x7d02\n");
+ fprintf (f, "\t.short 0x00cd\n");
+ fprintf (f, "\t.short 0x1e00\n");
+ fprintf (f, "\t.long 0\n");
+ fprintf (f, "\t.long 0\n");
+}
+
+/* Worker function for TARGET_TRAMPOLINE_INIT. */
+
+static void
+mcore_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (2*UNITS_PER_WORD), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, SImode, 8);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 12);
+ emit_move_insn (mem, fnaddr);
+}
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index acc54495a1c..630a11fda1e 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -631,42 +631,12 @@ extern const enum reg_class reg_class_from_letter[];
No definition is equivalent to always zero. */
#define EXIT_IGNORE_STACK 0
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts.
-
- On the MCore, the trampoline looks like:
- lrw r1, function
- lrw r13, area
- jmp r13
- or r0, r0
- .literals */
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- fprintf ((FILE), " .short 0x7102\n"); \
- fprintf ((FILE), " .short 0x7d02\n"); \
- fprintf ((FILE), " .short 0x00cd\n"); \
- fprintf ((FILE), " .short 0x1e00\n"); \
- fprintf ((FILE), " .long 0\n"); \
- fprintf ((FILE), " .long 0\n"); \
-}
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 12
/* Alignment required for a trampoline in bits. */
#define TRAMPOLINE_ALIGNMENT 32
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 8)), \
- (CXT)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 12)), \
- (FNADDR)); \
-}
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
diff --git a/gcc/config/mep/mep-protos.h b/gcc/config/mep/mep-protos.h
index e53ca79639c..82be465ad04 100644
--- a/gcc/config/mep/mep-protos.h
+++ b/gcc/config/mep/mep-protos.h
@@ -89,7 +89,6 @@ extern void mep_file_cleanups (void);
extern const char *mep_strip_name_encoding (const char *);
extern void mep_output_aligned_common (FILE *, tree, const char *,
int, int, int);
-extern void mep_init_trampoline (rtx, rtx, rtx);
extern void mep_emit_doloop (rtx *, int);
extern bool mep_vliw_function_p (tree);
extern bool mep_store_data_bypass_p (rtx, rtx);
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 4c37d38f0b0..dcf536259fa 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -229,6 +229,7 @@ static tree mep_build_builtin_va_list (void);
static void mep_expand_va_start (tree, rtx);
static tree mep_gimplify_va_arg_expr (tree, tree, tree *, tree *);
static bool mep_can_eliminate (const int, const int);
+static void mep_trampoline_init (rtx, tree, rtx);
/* Initialize the GCC target structure. */
@@ -300,8 +301,10 @@ static bool mep_can_eliminate (const int, const int);
#define TARGET_EXPAND_BUILTIN_VA_START mep_expand_va_start
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR mep_gimplify_va_arg_expr
-#undef TARGET_CAN_ELIMINATE
+#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE mep_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT mep_trampoline_init
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -4922,9 +4925,12 @@ mep_output_aligned_common (FILE *stream, tree decl, const char *name,
/* Trampolines. */
-void
-mep_init_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
+static void
+mep_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
{
+ rtx addr = XEXP (m_tramp, 0);
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__mep_trampoline_helper"),
LCT_NORMAL, VOIDmode, 3,
addr, Pmode,
diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h
index fff79626807..8b00a444ce2 100644
--- a/gcc/config/mep/mep.h
+++ b/gcc/config/mep/mep.h
@@ -565,10 +565,6 @@ typedef struct
run-time also. */
#define TRAMPOLINE_SIZE 20
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
- mep_init_trampoline (ADDR, FNADDR, STATIC_CHAIN)
-
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ace48bafe79..4c83ea505a0 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -15874,6 +15874,66 @@ mips_final_postscan_insn (FILE *file ATTRIBUTE_UNUSED, rtx insn,
mips_pop_asm_switch (&mips_noat);
}
+/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+static void
+mips_asm_trampoline_template (FILE *f)
+{
+ if (ptr_mode == DImode)
+ fprintf (f, "\t.word\t0x03e0082d\t\t# dmove $1,$31\n");
+ else
+ fprintf (f, "\t.word\t0x03e00821\t\t# move $1,$31\n");
+ fprintf (f, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# nop\n");
+ if (ptr_mode == DImode)
+ {
+ fprintf (f, "\t.word\t0xdff90014\t\t# ld $25,20($31)\n");
+ fprintf (f, "\t.word\t0xdfef001c\t\t# ld $15,28($31)\n");
+ }
+ else
+ {
+ fprintf (f, "\t.word\t0x8ff90010\t\t# lw $25,16($31)\n");
+ fprintf (f, "\t.word\t0x8fef0014\t\t# lw $15,20($31)\n");
+ }
+ fprintf (f, "\t.word\t0x03200008\t\t# jr $25\n");
+ if (ptr_mode == DImode)
+ {
+ fprintf (f, "\t.word\t0x0020f82d\t\t# dmove $31,$1\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# <padding>\n");
+ fprintf (f, "\t.dword\t0x00000000\t\t# <function address>\n");
+ fprintf (f, "\t.dword\t0x00000000\t\t# <static chain value>\n");
+ }
+ else
+ {
+ fprintf (f, "\t.word\t0x0020f821\t\t# move $31,$1\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# <function address>\n");
+ fprintf (f, "\t.word\t0x00000000\t\t# <static chain value>\n");
+ }
+}
+
+/* Implement TARGET_TRAMPOLINE_INIT. */
+
+static void
+mips_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem, addr, end_addr;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, ptr_mode, ptr_mode == DImode ? 32 : 28);
+ mips_emit_move (mem, force_reg (ptr_mode, fnaddr));
+ mem = adjust_address (mem, ptr_mode, GET_MODE_SIZE (ptr_mode));
+ mips_emit_move (mem, force_reg (ptr_mode, chain_value));
+
+ addr = force_reg (ptr_mode, XEXP (m_tramp, 0));
+ end_addr = gen_reg_rtx (ptr_mode);
+ emit_insn (gen_add3_insn (end_addr, addr, GEN_INT (TRAMPOLINE_SIZE)));
+ emit_insn (gen_clear_cache (addr, end_addr));
+}
+
+
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
@@ -16054,6 +16114,11 @@ mips_final_postscan_insn (FILE *file ATTRIBUTE_UNUSED, rtx insn,
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE mips_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE mips_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT mips_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-mips.h"
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index defcd6ef7df..934e0fafa90 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2433,45 +2433,6 @@ typedef struct mips_args {
#define EXIT_IGNORE_STACK 1
-/* A C statement to output, on the stream FILE, assembler code for a
- block of data that contains the constant parts of a trampoline.
- This code should not include a label--the label is taken care of
- automatically. */
-
-#define TRAMPOLINE_TEMPLATE(STREAM) \
-{ \
- if (ptr_mode == DImode) \
- fprintf (STREAM, "\t.word\t0x03e0082d\t\t# dmove $1,$31\n"); \
- else \
- fprintf (STREAM, "\t.word\t0x03e00821\t\t# move $1,$31\n"); \
- fprintf (STREAM, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# nop\n"); \
- if (ptr_mode == DImode) \
- { \
- fprintf (STREAM, "\t.word\t0xdff90014\t\t# ld $25,20($31)\n"); \
- fprintf (STREAM, "\t.word\t0xdfef001c\t\t# ld $15,28($31)\n"); \
- } \
- else \
- { \
- fprintf (STREAM, "\t.word\t0x8ff90010\t\t# lw $25,16($31)\n"); \
- fprintf (STREAM, "\t.word\t0x8fef0014\t\t# lw $15,20($31)\n"); \
- } \
- fprintf (STREAM, "\t.word\t0x03200008\t\t# jr $25\n"); \
- if (ptr_mode == DImode) \
- { \
- fprintf (STREAM, "\t.word\t0x0020f82d\t\t# dmove $31,$1\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# <padding>\n"); \
- fprintf (STREAM, "\t.dword\t0x00000000\t\t# <function address>\n"); \
- fprintf (STREAM, "\t.dword\t0x00000000\t\t# <static chain value>\n"); \
- } \
- else \
- { \
- fprintf (STREAM, "\t.word\t0x0020f821\t\t# move $31,$1\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# <function address>\n"); \
- fprintf (STREAM, "\t.word\t0x00000000\t\t# <static chain value>\n"); \
- } \
-}
-
/* A C expression for the size in bytes of the trampoline, as an
integer. */
@@ -2481,7 +2442,7 @@ typedef struct mips_args {
#define TRAMPOLINE_ALIGNMENT GET_MODE_BITSIZE (ptr_mode)
-/* INITIALIZE_TRAMPOLINE calls this library function to flush
+/* mips_trampoline_init calls this library function to flush
program and data caches. */
#ifndef CACHE_FLUSH_FUNC
@@ -2495,25 +2456,6 @@ typedef struct mips_args {
LCT_NORMAL, VOIDmode, 3, ADDR, Pmode, SIZE, Pmode, \
GEN_INT (3), TYPE_MODE (integer_type_node))
-/* A C statement to initialize the variable parts of a trampoline.
- ADDR is an RTX for the address of the trampoline; FNADDR is an
- RTX for the address of the nested function; STATIC_CHAIN is an
- RTX for the static chain value that should be passed to the
- function when it is called. */
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
-{ \
- rtx func_addr, chain_addr, end_addr; \
- \
- func_addr = plus_constant (ADDR, ptr_mode == DImode ? 32 : 28); \
- chain_addr = plus_constant (func_addr, GET_MODE_SIZE (ptr_mode)); \
- mips_emit_move (gen_rtx_MEM (ptr_mode, func_addr), FUNC); \
- mips_emit_move (gen_rtx_MEM (ptr_mode, chain_addr), CHAIN); \
- end_addr = gen_reg_rtx (Pmode); \
- emit_insn (gen_add3_insn (end_addr, copy_rtx (ADDR), \
- GEN_INT (TRAMPOLINE_SIZE))); \
- emit_insn (gen_clear_cache (copy_rtx (ADDR), end_addr)); \
-}
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index e839d864697..957164b468b 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -25,8 +25,6 @@ extern int mmix_initial_elimination_offset (int, int);
extern int mmix_starting_frame_offset (void);
extern int mmix_function_arg_regno_p (int, int);
extern void mmix_function_profiler (FILE *, int);
-extern void mmix_trampoline_template (FILE *);
-extern int mmix_trampoline_size;
extern int mmix_reversible_cc_mode (enum machine_mode);
extern int mmix_register_move_cost
(enum machine_mode, enum reg_class, enum reg_class);
@@ -80,7 +78,6 @@ extern rtx mmix_dynamic_chain_address (rtx);
extern rtx mmix_return_addr_rtx (int, rtx);
extern rtx mmix_eh_return_stackadj_rtx (void);
extern rtx mmix_eh_return_handler_rtx (void);
-extern void mmix_initialize_trampoline (rtx, rtx, rtx);
extern int mmix_constant_address_p (rtx);
extern int mmix_legitimate_constant_p (rtx);
extern void mmix_print_operand (FILE *, rtx, int);
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 8521f374f81..b589db96ea6 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -141,6 +141,8 @@ static enum machine_mode mmix_promote_function_mode (const_tree,
static bool mmix_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, const_tree, bool);
static bool mmix_frame_pointer_required (void);
+static void mmix_asm_trampoline_template (FILE *);
+static void mmix_trampoline_init (rtx, tree, rtx);
/* Target structure macros. Listed by node. See `Using and Porting GCC'
for a general description. */
@@ -212,6 +214,11 @@ static bool mmix_frame_pointer_required (void);
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED mmix_frame_pointer_required
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE mmix_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT mmix_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Functions that are expansions for target macros.
@@ -886,46 +893,44 @@ mmix_setup_incoming_varargs (CUMULATIVE_ARGS *args_so_farp,
internal_error ("MMIX Internal: Last named vararg would not fit in a register");
}
-/* TRAMPOLINE_SIZE. */
-/* Four 4-byte insns plus two 8-byte values. */
-int mmix_trampoline_size = 32;
-
-
-/* TRAMPOLINE_TEMPLATE. */
+/* TARGET_ASM_TRAMPOLINE_TEMPLATE. */
-void
-mmix_trampoline_template (FILE *stream)
+static void
+mmix_asm_trampoline_template (FILE *stream)
{
/* Read a value into the static-chain register and jump somewhere. The
static chain is stored at offset 16, and the function address is
stored at offset 24. */
- /* FIXME: GCC copies this using *intsize* (tetra), when it should use
- register size (octa). */
+
fprintf (stream, "\tGETA $255,1F\n\t");
- fprintf (stream, "LDOU %s,$255,0\n\t",
- reg_names[MMIX_STATIC_CHAIN_REGNUM]);
+ fprintf (stream, "LDOU %s,$255,0\n\t", reg_names[MMIX_STATIC_CHAIN_REGNUM]);
fprintf (stream, "LDOU $255,$255,8\n\t");
fprintf (stream, "GO $255,$255,0\n");
fprintf (stream, "1H\tOCTA 0\n\t");
fprintf (stream, "OCTA 0\n");
}
-/* INITIALIZE_TRAMPOLINE. */
+/* TARGET_TRAMPOLINE_INIT. */
/* Set the static chain and function pointer field in the trampoline.
We also SYNCID here to be sure (doesn't matter in the simulator, but
some day it will). */
-void
-mmix_initialize_trampoline (rtx trampaddr, rtx fnaddr, rtx static_chain)
-{
- emit_move_insn (gen_rtx_MEM (DImode, plus_constant (trampaddr, 16)),
- static_chain);
- emit_move_insn (gen_rtx_MEM (DImode,
- plus_constant (trampaddr, 24)),
- fnaddr);
- emit_insn (gen_sync_icache (validize_mem (gen_rtx_MEM (DImode,
- trampaddr)),
- GEN_INT (mmix_trampoline_size - 1)));
+static void
+mmix_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (2*UNITS_PER_WORD), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, DImode, 2*UNITS_PER_WORD);
+ emit_move_insn (mem, static_chain);
+ mem = adjust_address (m_tramp, DImode, 3*UNITS_PER_WORD);
+ emit_move_insn (mem, fnaddr);
+
+ mem = adjust_address (m_tramp, DImode, 0);
+ emit_insn (gen_sync_icache (mem, GEN_INT (TRAMPOLINE_SIZE - 1)));
}
/* We must exclude constant addresses that have an increment that is not a
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 41466545e21..1e76e460939 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -651,13 +651,8 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
/* Node: Trampolines */
-#define TRAMPOLINE_TEMPLATE(FILE) \
- mmix_trampoline_template (FILE)
-
-#define TRAMPOLINE_SIZE mmix_trampoline_size
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
- mmix_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
-
+#define TRAMPOLINE_SIZE (4*UNITS_PER_WORD)
+#define TRAMPOLINE_ALIGNMENT BITS_PER_WORD
/* Node: Addressing Modes */
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 608f8a0fa35..1a0eb37bbde 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -83,6 +83,9 @@ static bool mn10300_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static unsigned int mn10300_case_values_threshold (void);
+static void mn10300_encode_section_info (tree, rtx, int);
+static void mn10300_asm_trampoline_template (FILE *);
+static void mn10300_trampoline_init (rtx, tree, rtx);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -131,7 +134,11 @@ static unsigned int mn10300_case_values_threshold (void);
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P mn10300_legitimate_address_p
-static void mn10300_encode_section_info (tree, rtx, int);
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE mn10300_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT mn10300_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -2165,3 +2172,36 @@ unsigned int mn10300_case_values_threshold (void)
{
return 6;
}
+
+/* Worker function for TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+static void
+mn10300_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\tadd -4,sp\n");
+ fprintf (f, "\t.long 0x0004fffa\n");
+ fprintf (f, "\tmov (0,sp),a0\n");
+ fprintf (f, "\tadd 4,sp\n");
+ fprintf (f, "\tmov (13,a0),a1\n");
+ fprintf (f, "\tmov (17,a0),a0\n");
+ fprintf (f, "\tjmp (a0)\n");
+ fprintf (f, "\t.long 0\n");
+ fprintf (f, "\t.long 0\n");
+}
+
+/* Worker function for TARGET_TRAMPOLINE_INIT. */
+
+static void
+mn10300_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, SImode, 0x14);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 0x18);
+ emit_move_insn (mem, fnaddr);
+}
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 7d15e05810b..fc2ece30790 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -598,36 +598,12 @@ struct cum_arg {int nbytes; };
#define FUNCTION_PROFILER(FILE, LABELNO) ;
-#define TRAMPOLINE_TEMPLATE(FILE) \
- do { \
- fprintf (FILE, "\tadd -4,sp\n"); \
- fprintf (FILE, "\t.long 0x0004fffa\n"); \
- fprintf (FILE, "\tmov (0,sp),a0\n"); \
- fprintf (FILE, "\tadd 4,sp\n"); \
- fprintf (FILE, "\tmov (13,a0),a1\n"); \
- fprintf (FILE, "\tmov (17,a0),a0\n"); \
- fprintf (FILE, "\tjmp (a0)\n"); \
- fprintf (FILE, "\t.long 0\n"); \
- fprintf (FILE, "\t.long 0\n"); \
- } while (0)
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 0x1b
#define TRAMPOLINE_ALIGNMENT 32
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x14)), \
- (CXT)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x18)), \
- (FNADDR)); \
-}
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index 8b2d8b23fe3..7515fa26a47 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -453,6 +453,55 @@ moxie_arg_partial_bytes (CUMULATIVE_ARGS *cum,
return 0;
}
+/* Worker function for TARGET_STATIC_CHAIN. */
+
+static rtx
+moxie_static_chain (const_tree fndecl, bool incoming_p)
+{
+ rtx addr, mem;
+
+ if (!DECL_STATIC_CHAIN (fndecl))
+ return NULL;
+
+ if (incoming_p)
+ addr = plus_constant (arg_pointer_rtx, 2 * UNITS_PER_WORD);
+ else
+ addr = plus_constant (stack_pointer_rtx, -UNITS_PER_WORD);
+
+ mem = gen_rtx_MEM (Pmode, addr);
+ MEM_NOTRAP_P (mem) = 1;
+
+ return mem;
+}
+
+/* Worker function for TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+static void
+moxie_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\tpush $sp, $r0\n");
+ fprintf (f, "\tldi.l $r0, 0x0\n");
+ fprintf (f, "\tsto.l 0x8($fp), $r0\n");
+ fprintf (f, "\tpop $sp, $r0\n");
+ fprintf (f, "\tjmpa 0x0\n");
+}
+
+/* Worker function for TARGET_TRAMPOLINE_INIT. */
+
+static void
+moxie_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx mem, fnaddr = XEXP (DECL_RTL (fndecl), 0);
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, SImode, 4);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 18);
+ emit_move_insn (mem, fnaddr);
+}
+
/* The Global `targetm' Variable. */
/* Initialize the GCC target structure. */
@@ -485,6 +534,13 @@ moxie_arg_partial_bytes (CUMULATIVE_ARGS *cum,
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED hook_bool_void_true
+#undef TARGET_STATIC_CHAIN
+#define TARGET_STATIC_CHAIN moxie_static_chain
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE moxie_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT moxie_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-moxie.h"
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index 21792da6527..f1b77eaf0c2 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -391,31 +391,6 @@ enum reg_class
/* Alignment required for trampolines, in bits. */
#define TRAMPOLINE_ALIGNMENT 16
-/* A C statement to initialize the variable parts of a trampoline. ADDR is an
- RTX for the address of the trampoline; FNADDR is an RTX for the address of
- the nested function; STATIC_CHAIN is an RTX for the static chain value that
- should be passed to the function when it is called. */
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
-do \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, \
- plus_constant (ADDR, 4)), STATIC_CHAIN); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (ADDR, 18)), FNADDR); \
-} while (0);
-
-/* A C statement to output, on the stream FILE, assembler code for a
- block of data that contains the constant parts of a trampoline.
- This code should not include a label--the label is taken care of
- automatically. */
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- fprintf (FILE, "\tpush $sp, $r0\n"); \
- fprintf (FILE, "\tldi.l $r0, 0x0\n"); \
- fprintf (FILE, "\tsto.l 0x8($fp), $r0\n"); \
- fprintf (FILE, "\tpop $sp, $r0\n"); \
- fprintf (FILE, "\tjmpa 0x0\n"); \
-}
-
/* An alias for the machine mode for pointers. */
#define Pmode SImode
@@ -435,17 +410,6 @@ do \
access the function's argument list. */
#define ARG_POINTER_REGNUM MOXIE_QAP
-/* If the static chain is passed in memory, these macros provide rtx
- giving 'mem' expressions that denote where they are stored.
- 'STATIC_CHAIN' and 'STATIC_CHAIN_INCOMING' give the locations as
- seen by the calling and called functions, respectively. */
-
-#define STATIC_CHAIN \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -UNITS_PER_WORD))
-
-#define STATIC_CHAIN_INCOMING \
- gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, 2 * UNITS_PER_WORD))
-
#define HARD_FRAME_POINTER_REGNUM MOXIE_FP
#define ELIMINABLE_REGS \
diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h
index 3f424528318..4f82809c8c1 100644
--- a/gcc/config/netbsd.h
+++ b/gcc/config/netbsd.h
@@ -180,7 +180,7 @@ along with GCC; see the file COPYING3. If not see
/* Attempt to turn on execute permission for the stack. This may be
- used by INITIALIZE_TRAMPOLINE of the target needs it (that is,
+ used by TARGET_TRAMPOLINE_INIT if the target needs it (that is,
if the target machine can change execute permissions on a page).
There is no way to query the execute permission of the stack, so
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index 526081acd52..e71d8a1e82c 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -154,7 +154,6 @@ extern int reloc_needed (tree);
#ifdef RTX_CODE
extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode,
tree, int);
-extern rtx function_value (const_tree, const_tree);
#endif
extern bool pa_return_in_memory (const_tree, const_tree);
#endif /* TREE_CODE */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 65a07d9eb93..96fe2fbdde7 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -103,6 +103,7 @@ static void store_reg (int, HOST_WIDE_INT, int);
static void store_reg_modify (int, int, HOST_WIDE_INT);
static void load_reg (int, HOST_WIDE_INT, int);
static void set_reg_plus_d (int, int, HOST_WIDE_INT, int);
+static rtx pa_function_value (const_tree, const_tree, bool);
static void pa_output_function_prologue (FILE *, HOST_WIDE_INT);
static void update_total_code_bytes (unsigned int);
static void pa_output_function_epilogue (FILE *, HOST_WIDE_INT);
@@ -163,6 +164,10 @@ static enum machine_mode pa_promote_function_mode (const_tree,
enum machine_mode, int *,
const_tree, int);
+static void pa_asm_trampoline_template (FILE *);
+static void pa_trampoline_init (rtx, tree, rtx);
+static rtx pa_trampoline_adjust_address (rtx);
+
/* The following extra sections are only used for SOM. */
static GTY(()) section *som_readonly_data_section;
static GTY(()) section *som_one_only_readonly_data_section;
@@ -227,6 +232,9 @@ static size_t n_deferred_plabels = 0;
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE pa_output_function_epilogue
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE pa_function_value
+
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS hppa_legitimize_address
@@ -325,6 +333,13 @@ static size_t n_deferred_plabels = 0;
#undef TARGET_EXTRA_LIVE_ON_ENTRY
#define TARGET_EXTRA_LIVE_ON_ENTRY pa_extra_live_on_entry
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE pa_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT pa_trampoline_init
+#undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
+#define TARGET_TRAMPOLINE_ADJUST_ADDRESS pa_trampoline_adjust_address
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Parse the -mfixed-range= option string. */
@@ -9215,7 +9230,9 @@ pa_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
to match the HP Compiler ABI. */
rtx
-function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
+pa_function_value (const_tree valtype,
+ const_tree func ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
{
enum machine_mode valmode;
@@ -9808,4 +9825,174 @@ pa_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2)
return true;
}
+
+/* Length in units of the trampoline instruction code. */
+
+#define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 32 : 40))
+
+
+/* Output assembler code for a block containing the constant parts
+ of a trampoline, leaving space for the variable parts.\
+
+ The trampoline sets the static chain pointer to STATIC_CHAIN_REGNUM
+ and then branches to the specified routine.
+
+ This code template is copied from text segment to stack location
+ and then patched with pa_trampoline_init to contain valid values,
+ and then entered as a subroutine.
+
+ It is best to keep this as small as possible to avoid having to
+ flush multiple lines in the cache. */
+
+static void
+pa_asm_trampoline_template (FILE *f)
+{
+ if (!TARGET_64BIT)
+ {
+ fputs ("\tldw 36(%r22),%r21\n", f);
+ fputs ("\tbb,>=,n %r21,30,.+16\n", f);
+ if (ASSEMBLER_DIALECT == 0)
+ fputs ("\tdepi 0,31,2,%r21\n", f);
+ else
+ fputs ("\tdepwi 0,31,2,%r21\n", f);
+ fputs ("\tldw 4(%r21),%r19\n", f);
+ fputs ("\tldw 0(%r21),%r21\n", f);
+ if (TARGET_PA_20)
+ {
+ fputs ("\tbve (%r21)\n", f);
+ fputs ("\tldw 40(%r22),%r29\n", f);
+ fputs ("\t.word 0\n", f);
+ fputs ("\t.word 0\n", f);
+ }
+ else
+ {
+ fputs ("\tldsid (%r21),%r1\n", f);
+ fputs ("\tmtsp %r1,%sr0\n", f);
+ fputs ("\tbe 0(%sr0,%r21)\n", f);
+ fputs ("\tldw 40(%r22),%r29\n", f);
+ }
+ fputs ("\t.word 0\n", f);
+ fputs ("\t.word 0\n", f);
+ fputs ("\t.word 0\n", f);
+ fputs ("\t.word 0\n", f);
+ }
+ else
+ {
+ fputs ("\t.dword 0\n", f);
+ fputs ("\t.dword 0\n", f);
+ fputs ("\t.dword 0\n", f);
+ fputs ("\t.dword 0\n", f);
+ fputs ("\tmfia %r31\n", f);
+ fputs ("\tldd 24(%r31),%r1\n", f);
+ fputs ("\tldd 24(%r1),%r27\n", f);
+ fputs ("\tldd 16(%r1),%r1\n", f);
+ fputs ("\tbve (%r1)\n", f);
+ fputs ("\tldd 32(%r31),%r31\n", f);
+ fputs ("\t.dword 0 ; fptr\n", f);
+ fputs ("\t.dword 0 ; static link\n", f);
+ }
+}
+
+/* Emit RTL insns to initialize the variable parts of a trampoline.
+ FNADDR is an RTX for the address of the function's pure code.
+ CXT is an RTX for the static chain value for the function.
+
+ Move the function address to the trampoline template at offset 36.
+ Move the static chain value to trampoline template at offset 40.
+ Move the trampoline address to trampoline template at offset 44.
+ Move r19 to trampoline template at offset 48. The latter two
+ words create a plabel for the indirect call to the trampoline.
+
+ A similar sequence is used for the 64-bit port but the plabel is
+ at the beginning of the trampoline.
+
+ Finally, the cache entries for the trampoline code are flushed.
+ This is necessary to ensure that the trampoline instruction sequence
+ is written to memory prior to any attempts at prefetching the code
+ sequence. */
+
+static void
+pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx start_addr = gen_reg_rtx (Pmode);
+ rtx end_addr = gen_reg_rtx (Pmode);
+ rtx line_length = gen_reg_rtx (Pmode);
+ rtx r_tramp, tmp;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+ r_tramp = force_reg (Pmode, XEXP (m_tramp, 0));
+
+ if (!TARGET_64BIT)
+ {
+ tmp = adjust_address (m_tramp, Pmode, 36);
+ emit_move_insn (tmp, fnaddr);
+ tmp = adjust_address (m_tramp, Pmode, 40);
+ emit_move_insn (tmp, chain_value);
+
+ /* Create a fat pointer for the trampoline. */
+ tmp = adjust_address (m_tramp, Pmode, 44);
+ emit_move_insn (tmp, r_tramp);
+ tmp = adjust_address (m_tramp, Pmode, 48);
+ emit_move_insn (tmp, gen_rtx_REG (Pmode, 19));
+
+ /* fdc and fic only use registers for the address to flush,
+ they do not accept integer displacements. We align the
+ start and end addresses to the beginning of their respective
+ cache lines to minimize the number of lines flushed. */
+ emit_insn (gen_andsi3 (start_addr, r_tramp,
+ GEN_INT (-MIN_CACHELINE_SIZE)));
+ tmp = force_reg (Pmode, plus_constant (r_tramp, TRAMPOLINE_CODE_SIZE-1));
+ emit_insn (gen_andsi3 (end_addr, tmp,
+ GEN_INT (-MIN_CACHELINE_SIZE)));
+ emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
+ emit_insn (gen_dcacheflushsi (start_addr, end_addr, line_length));
+ emit_insn (gen_icacheflushsi (start_addr, end_addr, line_length,
+ gen_reg_rtx (Pmode),
+ gen_reg_rtx (Pmode)));
+ }
+ else
+ {
+ tmp = adjust_address (m_tramp, Pmode, 56);
+ emit_move_insn (tmp, fnaddr);
+ tmp = adjust_address (m_tramp, Pmode, 64);
+ emit_move_insn (tmp, chain_value);
+
+ /* Create a fat pointer for the trampoline. */
+ tmp = adjust_address (m_tramp, Pmode, 16);
+ emit_move_insn (tmp, force_reg (Pmode, plus_constant (r_tramp, 32)));
+ tmp = adjust_address (m_tramp, Pmode, 24);
+ emit_move_insn (tmp, gen_rtx_REG (Pmode, 27));
+
+ /* fdc and fic only use registers for the address to flush,
+ they do not accept integer displacements. We align the
+ start and end addresses to the beginning of their respective
+ cache lines to minimize the number of lines flushed. */
+ tmp = force_reg (Pmode, plus_constant (r_tramp, 32));
+ emit_insn (gen_anddi3 (start_addr, tmp,
+ GEN_INT (-MIN_CACHELINE_SIZE)));
+ tmp = force_reg (Pmode, plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1));
+ emit_insn (gen_anddi3 (end_addr, tmp,
+ GEN_INT (-MIN_CACHELINE_SIZE)));
+ emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
+ emit_insn (gen_dcacheflushdi (start_addr, end_addr, line_length));
+ emit_insn (gen_icacheflushdi (start_addr, end_addr, line_length,
+ gen_reg_rtx (Pmode),
+ gen_reg_rtx (Pmode)));
+ }
+}
+
+/* Perform any machine-specific adjustment in the address of the trampoline.
+ ADDR contains the address that was passed to pa_trampoline_init.
+ Adjust the trampoline address to point to the plabel at offset 44. */
+
+static rtx
+pa_trampoline_adjust_address (rtx addr)
+{
+ if (!TARGET_64BIT)
+ addr = memory_address (Pmode, plus_constant (addr, 46));
+ return addr;
+}
+
#include "gt-pa.h"
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 3b0ddeda64a..4b10a0a3b9b 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -570,13 +570,6 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-/* Define how to find the value returned by a function.
- VALTYPE is the data type of the value (as a tree).
- If the precise function being called is known, FUNC is its FUNCTION_DECL;
- otherwise, FUNC is 0. */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) function_value (VALTYPE, FUNC)
-
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
@@ -778,74 +771,13 @@ extern int may_call_alloca;
(get_frame_size () != 0 \
|| cfun->calls_alloca || crtl->outgoing_args_size)
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts.\
-
- The trampoline sets the static chain pointer to STATIC_CHAIN_REGNUM
- and then branches to the specified routine.
-
- This code template is copied from text segment to stack location
- and then patched with INITIALIZE_TRAMPOLINE to contain
- valid values, and then entered as a subroutine.
-
- It is best to keep this as small as possible to avoid having to
- flush multiple lines in the cache. */
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
- { \
- if (!TARGET_64BIT) \
- { \
- fputs ("\tldw 36(%r22),%r21\n", FILE); \
- fputs ("\tbb,>=,n %r21,30,.+16\n", FILE); \
- if (ASSEMBLER_DIALECT == 0) \
- fputs ("\tdepi 0,31,2,%r21\n", FILE); \
- else \
- fputs ("\tdepwi 0,31,2,%r21\n", FILE); \
- fputs ("\tldw 4(%r21),%r19\n", FILE); \
- fputs ("\tldw 0(%r21),%r21\n", FILE); \
- if (TARGET_PA_20) \
- { \
- fputs ("\tbve (%r21)\n", FILE); \
- fputs ("\tldw 40(%r22),%r29\n", FILE); \
- fputs ("\t.word 0\n", FILE); \
- fputs ("\t.word 0\n", FILE); \
- } \
- else \
- { \
- fputs ("\tldsid (%r21),%r1\n", FILE); \
- fputs ("\tmtsp %r1,%sr0\n", FILE); \
- fputs ("\tbe 0(%sr0,%r21)\n", FILE); \
- fputs ("\tldw 40(%r22),%r29\n", FILE); \
- } \
- fputs ("\t.word 0\n", FILE); \
- fputs ("\t.word 0\n", FILE); \
- fputs ("\t.word 0\n", FILE); \
- fputs ("\t.word 0\n", FILE); \
- } \
- else \
- { \
- fputs ("\t.dword 0\n", FILE); \
- fputs ("\t.dword 0\n", FILE); \
- fputs ("\t.dword 0\n", FILE); \
- fputs ("\t.dword 0\n", FILE); \
- fputs ("\tmfia %r31\n", FILE); \
- fputs ("\tldd 24(%r31),%r1\n", FILE); \
- fputs ("\tldd 24(%r1),%r27\n", FILE); \
- fputs ("\tldd 16(%r1),%r1\n", FILE); \
- fputs ("\tbve (%r1)\n", FILE); \
- fputs ("\tldd 32(%r31),%r31\n", FILE); \
- fputs ("\t.dword 0 ; fptr\n", FILE); \
- fputs ("\t.dword 0 ; static link\n", FILE); \
- } \
- }
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52)
-/* Length in units of the trampoline instruction code. */
+/* Alignment required by the trampoline. */
-#define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 32 : 40))
+#define TRAMPOLINE_ALIGNMENT BITS_PER_WORD
/* Minimum length of a cache line. A length of 16 will work on all
PA-RISC processors. All PA 1.1 processors have a cache line of
@@ -855,102 +787,6 @@ extern int may_call_alloca;
#define MIN_CACHELINE_SIZE 32
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function.
-
- Move the function address to the trampoline template at offset 36.
- Move the static chain value to trampoline template at offset 40.
- Move the trampoline address to trampoline template at offset 44.
- Move r19 to trampoline template at offset 48. The latter two
- words create a plabel for the indirect call to the trampoline.
-
- A similar sequence is used for the 64-bit port but the plabel is
- at the beginning of the trampoline.
-
- Finally, the cache entries for the trampoline code are flushed.
- This is necessary to ensure that the trampoline instruction sequence
- is written to memory prior to any attempts at prefetching the code
- sequence. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- rtx start_addr = gen_reg_rtx (Pmode); \
- rtx end_addr = gen_reg_rtx (Pmode); \
- rtx line_length = gen_reg_rtx (Pmode); \
- rtx tmp; \
- \
- if (!TARGET_64BIT) \
- { \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 36)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 40)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \
- \
- /* Create a fat pointer for the trampoline. */ \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 44)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), (TRAMP)); \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 48)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), \
- gen_rtx_REG (Pmode, 19)); \
- \
- /* fdc and fic only use registers for the address to flush, \
- they do not accept integer displacements. We align the \
- start and end addresses to the beginning of their respective \
- cache lines to minimize the number of lines flushed. */ \
- tmp = force_reg (Pmode, (TRAMP)); \
- emit_insn (gen_andsi3 (start_addr, tmp, \
- GEN_INT (-MIN_CACHELINE_SIZE))); \
- tmp = force_reg (Pmode, \
- plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \
- emit_insn (gen_andsi3 (end_addr, tmp, \
- GEN_INT (-MIN_CACHELINE_SIZE))); \
- emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \
- emit_insn (gen_dcacheflushsi (start_addr, end_addr, line_length));\
- emit_insn (gen_icacheflushsi (start_addr, end_addr, line_length, \
- gen_reg_rtx (Pmode), \
- gen_reg_rtx (Pmode))); \
- } \
- else \
- { \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 56)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 64)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \
- \
- /* Create a fat pointer for the trampoline. */ \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), \
- force_reg (Pmode, plus_constant ((TRAMP), 32))); \
- tmp = memory_address (Pmode, plus_constant ((TRAMP), 24)); \
- emit_move_insn (gen_rtx_MEM (Pmode, tmp), \
- gen_rtx_REG (Pmode, 27)); \
- \
- /* fdc and fic only use registers for the address to flush, \
- they do not accept integer displacements. We align the \
- start and end addresses to the beginning of their respective \
- cache lines to minimize the number of lines flushed. */ \
- tmp = force_reg (Pmode, plus_constant ((TRAMP), 32)); \
- emit_insn (gen_anddi3 (start_addr, tmp, \
- GEN_INT (-MIN_CACHELINE_SIZE))); \
- tmp = force_reg (Pmode, \
- plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \
- emit_insn (gen_anddi3 (end_addr, tmp, \
- GEN_INT (-MIN_CACHELINE_SIZE))); \
- emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \
- emit_insn (gen_dcacheflushdi (start_addr, end_addr, line_length));\
- emit_insn (gen_icacheflushdi (start_addr, end_addr, line_length, \
- gen_reg_rtx (Pmode), \
- gen_reg_rtx (Pmode))); \
- } \
-}
-
-/* Perform any machine-specific adjustment in the address of the trampoline.
- ADDR contains the address that was passed to INITIALIZE_TRAMPOLINE.
- Adjust the trampoline address to point to the plabel at offset 44. */
-
-#define TRAMPOLINE_ADJUST_ADDRESS(ADDR) \
- if (!TARGET_64BIT) (ADDR) = memory_address (Pmode, plus_constant ((ADDR), 46))
/* Addressing modes, and classification of registers for them.
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index b46760897a5..f95d03cee48 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -152,6 +152,7 @@ static void pdp11_output_function_prologue (FILE *, HOST_WIDE_INT);
static void pdp11_output_function_epilogue (FILE *, HOST_WIDE_INT);
static bool pdp11_rtx_costs (rtx, int, int, int *, bool);
static bool pdp11_return_in_memory (const_tree, const_tree);
+static void pdp11_trampoline_init (rtx, tree, rtx);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_BYTE_OP
@@ -185,6 +186,9 @@ static bool pdp11_return_in_memory (const_tree, const_tree);
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY pdp11_return_in_memory
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT pdp11_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -1740,3 +1744,31 @@ pdp11_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
return (TYPE_MODE (type) == DImode
|| (TYPE_MODE (type) == DFmode && ! TARGET_AC0));
}
+
+/* Worker function for TARGET_TRAMPOLINE_INIT.
+
+ trampoline - how should i do it in separate i+d ?
+ have some allocate_trampoline magic???
+
+ the following should work for shared I/D:
+
+ MV #STATIC, $4 0x940Y 0x0000 <- STATIC; Y = STATIC_CHAIN_REGNUM
+ JMP FUNCTION 0x0058 0x0000 <- FUNCTION
+*/
+
+static void
+pdp11_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ gcc_assert (!TARGET_SPLIT);
+
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, GEN_INT (0x9400+STATIC_CHAIN_REGNUM));
+ mem = adjust_address (m_tramp, HImode, 2);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, HImode, 4);
+ emit_move_insn (mem, GEN_INT (0x0058));
+ emit_move_insn (mem, fnaddr);
+}
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index ac678f5cb5b..8997612ba5a 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -983,42 +983,9 @@ extern struct rtx_def *cc0_reg_rtx;
fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
)
-/* trampoline - how should i do it in separate i+d ?
- have some allocate_trampoline magic???
-
- the following should work for shared I/D: */
-
-/* lets see whether this works as trampoline:
-MV #STATIC, $4 0x940Y 0x0000 <- STATIC; Y = STATIC_CHAIN_REGNUM
-JMP FUNCTION 0x0058 0x0000 <- FUNCTION
-*/
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- gcc_assert (!TARGET_SPLIT); \
- \
- assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
- assemble_aligned_integer (2, const0_rtx); \
- assemble_aligned_integer (2, GEN_INT(0x0058)); \
- assemble_aligned_integer (2, const0_rtx); \
-}
-
#define TRAMPOLINE_SIZE 8
#define TRAMPOLINE_ALIGNMENT 16
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \
-{ \
- gcc_assert (!TARGET_SPLIT); \
- \
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \
- emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \
-}
-
-
/* Some machines may desire to change what optimizations are
performed for various optimization levels. This macro, if
defined, is executed once just after the optimization level is
diff --git a/gcc/config/picochip/picochip-protos.h b/gcc/config/picochip/picochip-protos.h
index 7a2a07b98fa..de68c81d458 100644
--- a/gcc/config/picochip/picochip-protos.h
+++ b/gcc/config/picochip/picochip-protos.h
@@ -60,7 +60,7 @@ extern CUMULATIVE_ARGS picochip_arg_advance (CUMULATIVE_ARGS cum, int mode,
tree type, int named);
extern int picochip_regno_nregs (int regno, int mode);
-extern int picochip_class_max_nregs (int class, int mode);
+extern int picochip_class_max_nregs (int klass, int mode);
extern void picochip_order_regs_for_local_alloc (void);
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index 5155e7695ad..bf6d263994c 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -111,6 +111,8 @@ picochip_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED,
tree decl ATTRIBUTE_UNUSED);
+static rtx picochip_static_chain (const_tree, bool);
+
/* Lookup table mapping a register number to the earliest containing
class. Used by REGNO_REG_CLASS. */
const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER] =
@@ -289,6 +291,9 @@ static char picochip_get_vliw_alu_id (void);
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY picochip_return_in_memory
+#undef TARGET_STATIC_CHAIN
+#define TARGET_STATIC_CHAIN picochip_static_chain
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -4402,3 +4407,14 @@ picochip_check_conditional_copy (rtx * operands)
}
+
+static rtx
+picochip_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p)
+{
+ rtx addr;
+ if (incoming_p)
+ addr = arg_pointer_rtx;
+ else
+ addr = plus_constant (stack_pointer_rtx, -2 * UNITS_PER_WORD);
+ return gen_frame_mem (Pmode, addr);
+}
diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h
index c08b89d67eb..44559f22333 100644
--- a/gcc/config/picochip/picochip.h
+++ b/gcc/config/picochip/picochip.h
@@ -391,20 +391,6 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define FRAME_POINTER_REGNUM 18
#define ARG_POINTER_REGNUM 19
-/* Static chain is used to pass the local variables of the enclosing function.
- The static chain is passed in memory. The first long-word location
- beneath the stack pointer is used. In the presence of pretend
- arguments, which are written into that location, this mechanism
- complicates matters. */
-
-/* Location seen by the caller. */
-#define STATIC_CHAIN \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -2 * UNITS_PER_WORD))
-
-/* Location seen by the callee. */
-#define STATIC_CHAIN_INCOMING \
- gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, 0))
-
/* Eliminating Frame Pointer and Arg Pointer. The frame and argument
pointers are eliminated wherever possible, by replacing them with
offsets from the stack pointer. */
@@ -482,7 +468,6 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
/* No trampolines. */
#define TRAMPOLINE_SIZE 0
-#define INITIALIZE_TRAMPOLINE(ADDR,FNADDR,CHAIN)
/* Addressing Modes */
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index cf25cb7bf0f..d03cce6f8a2 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -448,10 +448,6 @@
&& INTVAL (XEXP (op, 1)) == -16)
op = XEXP (op, 0);
- else if (VECTOR_MEM_VSX_P (mode)
- && GET_CODE (op) == PRE_MODIFY)
- op = XEXP (op, 1);
-
return indexed_or_indirect_address (op, mode);
})
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 6e6bb9e3891..ca5e5848f7f 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -109,7 +109,6 @@ extern void rs6000_emit_swdivsf (rtx, rtx, rtx);
extern void rs6000_emit_swdivdf (rtx, rtx, rtx);
extern void rs6000_emit_swrsqrtsf (rtx, rtx);
extern void output_toc (FILE *, rtx, int, enum machine_mode);
-extern void rs6000_initialize_trampoline (rtx, rtx, rtx);
extern rtx rs6000_longcall_ref (rtx);
extern void rs6000_fatal_bad_address (rtx);
extern rtx create_TOC_reference (rtx);
@@ -142,7 +141,6 @@ extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
extern int function_arg_boundary (enum machine_mode, tree);
extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *);
-extern rtx rs6000_function_value (const_tree, const_tree);
extern rtx rs6000_libcall_value (enum machine_mode);
extern rtx rs6000_va_arg (tree, tree);
extern int function_ok_for_sibcall (tree);
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 564b5407322..2de4ffad046 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -846,6 +846,7 @@ static void rs6000_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
tree);
static rtx rs6000_emit_set_long_const (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
static bool rs6000_return_in_memory (const_tree, const_tree);
+static rtx rs6000_function_value (const_tree, const_tree, bool);
static void rs6000_file_start (void);
#if TARGET_ELF
static int rs6000_elf_reloc_rw_mask (void);
@@ -1094,6 +1095,7 @@ static const enum reg_class *rs6000_ira_cover_classes (void);
const int INSN_NOT_AVAILABLE = -1;
static enum machine_mode rs6000_eh_return_filter_mode (void);
static bool rs6000_can_eliminate (const int, const int);
+static void rs6000_trampoline_init (rtx, tree, rtx);
/* Hash table stuff for keeping track of TOC entries. */
@@ -1467,6 +1469,12 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE rs6000_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT rs6000_trampoline_init
+
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE rs6000_function_value
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Return number of consecutive hard regs needed starting at reg REGNO
@@ -5694,12 +5702,6 @@ rs6000_legitimate_address_p (enum machine_mode mode, rtx x, bool reg_ok_strict)
&& legitimate_indexed_address_p (x, reg_ok_strict))
return 1;
if (GET_CODE (x) == PRE_MODIFY
- && VECTOR_MEM_VSX_P (mode)
- && TARGET_UPDATE
- && legitimate_indexed_address_p (XEXP (x, 1), reg_ok_strict)
- && rtx_equal_p (XEXP (XEXP (x, 1), 0), XEXP (x, 0)))
- return 1;
- if (GET_CODE (x) == PRE_MODIFY
&& mode != TImode
&& mode != TFmode
&& mode != TDmode
@@ -5707,7 +5709,7 @@ rs6000_legitimate_address_p (enum machine_mode mode, rtx x, bool reg_ok_strict)
|| TARGET_POWERPC64
|| ((mode != DFmode && mode != DDmode) || TARGET_E500_DOUBLE))
&& (TARGET_POWERPC64 || mode != DImode)
- && !VECTOR_MEM_ALTIVEC_P (mode)
+ && !VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)
&& !SPE_VECTOR_MODE (mode)
/* Restrict addressing for DI because of our SUBREG hackery. */
&& !(TARGET_E500_DOUBLE
@@ -8640,10 +8642,10 @@ static struct builtin_description bdesc_2arg[] =
{ MASK_ALTIVEC, CODE_FOR_vector_eqv4sf, "__builtin_altivec_vcmpeqfp", ALTIVEC_BUILTIN_VCMPEQFP },
{ MASK_ALTIVEC, CODE_FOR_vector_gev4sf, "__builtin_altivec_vcmpgefp", ALTIVEC_BUILTIN_VCMPGEFP },
{ MASK_ALTIVEC, CODE_FOR_vector_gtuv16qi, "__builtin_altivec_vcmpgtub", ALTIVEC_BUILTIN_VCMPGTUB },
- { MASK_ALTIVEC, CODE_FOR_vector_gtuv8hi, "__builtin_altivec_vcmpgtsb", ALTIVEC_BUILTIN_VCMPGTSB },
- { MASK_ALTIVEC, CODE_FOR_vector_gtuv4si, "__builtin_altivec_vcmpgtuh", ALTIVEC_BUILTIN_VCMPGTUH },
- { MASK_ALTIVEC, CODE_FOR_vector_gtv16qi, "__builtin_altivec_vcmpgtsh", ALTIVEC_BUILTIN_VCMPGTSH },
- { MASK_ALTIVEC, CODE_FOR_vector_gtv8hi, "__builtin_altivec_vcmpgtuw", ALTIVEC_BUILTIN_VCMPGTUW },
+ { MASK_ALTIVEC, CODE_FOR_vector_gtv16qi, "__builtin_altivec_vcmpgtsb", ALTIVEC_BUILTIN_VCMPGTSB },
+ { MASK_ALTIVEC, CODE_FOR_vector_gtuv8hi, "__builtin_altivec_vcmpgtuh", ALTIVEC_BUILTIN_VCMPGTUH },
+ { MASK_ALTIVEC, CODE_FOR_vector_gtv8hi, "__builtin_altivec_vcmpgtsh", ALTIVEC_BUILTIN_VCMPGTSH },
+ { MASK_ALTIVEC, CODE_FOR_vector_gtuv4si, "__builtin_altivec_vcmpgtuw", ALTIVEC_BUILTIN_VCMPGTUW },
{ MASK_ALTIVEC, CODE_FOR_vector_gtv4si, "__builtin_altivec_vcmpgtsw", ALTIVEC_BUILTIN_VCMPGTSW },
{ MASK_ALTIVEC, CODE_FOR_vector_gtv4sf, "__builtin_altivec_vcmpgtfp", ALTIVEC_BUILTIN_VCMPGTFP },
{ MASK_ALTIVEC, CODE_FOR_altivec_vctsxs, "__builtin_altivec_vctsxs", ALTIVEC_BUILTIN_VCTSXS },
@@ -10904,7 +10906,7 @@ static void
rs6000_init_builtins (void)
{
tree tdecl;
-
+
V2SI_type_node = build_vector_type (intSI_type_node, 2);
V2SF_type_node = build_vector_type (float_type_node, 2);
V2DI_type_node = build_vector_type (intDI_type_node, 2);
@@ -19107,6 +19109,8 @@ rs6000_output_function_prologue (FILE *file,
if (! HAVE_prologue)
{
+ rtx prologue;
+
start_sequence ();
/* A NOTE_INSN_DELETED is supposed to be at the start and end of
@@ -19126,10 +19130,14 @@ rs6000_output_function_prologue (FILE *file,
}
}
- if (TARGET_DEBUG_STACK)
- debug_rtx_list (get_insns (), 100);
- final (get_insns (), file, FALSE);
+ prologue = get_insns ();
end_sequence ();
+
+ if (TARGET_DEBUG_STACK)
+ debug_rtx_list (prologue, 100);
+
+ emit_insn_before_noloc (prologue, BB_HEAD (ENTRY_BLOCK_PTR->next_bb),
+ ENTRY_BLOCK_PTR);
}
rs6000_pic_labelno++;
@@ -22962,32 +22970,38 @@ rs6000_trampoline_size (void)
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
-void
-rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
+static void
+rs6000_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
{
int regsize = (TARGET_32BIT) ? 4 : 8;
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx ctx_reg = force_reg (Pmode, cxt);
+ rtx addr = force_reg (Pmode, XEXP (m_tramp, 0));
switch (DEFAULT_ABI)
{
default:
gcc_unreachable ();
-/* Macros to shorten the code expansions below. */
-#define MEM_DEREF(addr) gen_rtx_MEM (Pmode, memory_address (Pmode, addr))
-#define MEM_PLUS(addr,offset) \
- gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (addr, offset)))
-
/* Under AIX, just build the 3 word function descriptor */
case ABI_AIX:
{
+ rtx fnmem = gen_const_mem (Pmode, force_reg (Pmode, fnaddr));
rtx fn_reg = gen_reg_rtx (Pmode);
rtx toc_reg = gen_reg_rtx (Pmode);
- emit_move_insn (fn_reg, MEM_DEREF (fnaddr));
- emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize));
- emit_move_insn (MEM_DEREF (addr), fn_reg);
- emit_move_insn (MEM_PLUS (addr, regsize), toc_reg);
- emit_move_insn (MEM_PLUS (addr, 2*regsize), ctx_reg);
+
+ /* Macro to shorten the code expansions below. */
+# define MEM_PLUS(MEM, OFFSET) adjust_address (MEM, Pmode, OFFSET)
+
+ m_tramp = replace_equiv_address (m_tramp, addr);
+
+ emit_move_insn (fn_reg, MEM_PLUS (fnmem, 0));
+ emit_move_insn (toc_reg, MEM_PLUS (fnmem, regsize));
+ emit_move_insn (MEM_PLUS (m_tramp, 0), fn_reg);
+ emit_move_insn (MEM_PLUS (m_tramp, regsize), toc_reg);
+ emit_move_insn (MEM_PLUS (m_tramp, 2*regsize), ctx_reg);
+
+# undef MEM_PLUS
}
break;
@@ -23002,8 +23016,6 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
ctx_reg, Pmode);
break;
}
-
- return;
}
@@ -25085,10 +25097,7 @@ rs6000_complex_function_value (enum machine_mode mode)
return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r2));
}
-/* Define how to find the value returned by a function.
- VALTYPE is the data type of the value (as a tree).
- If the precise function being called is known, FUNC is its FUNCTION_DECL;
- otherwise, FUNC is 0.
+/* Target hook for TARGET_FUNCTION_VALUE.
On the SPE, both FPs and vectors are returned in r3.
@@ -25096,7 +25105,9 @@ rs6000_complex_function_value (enum machine_mode mode)
fp1, unless -msoft-float. */
rtx
-rs6000_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
+rs6000_function_value (const_tree valtype,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
unsigned int regno;
@@ -25395,7 +25406,7 @@ static bool
rs6000_scalar_mode_supported_p (enum machine_mode mode)
{
if (DECIMAL_FLOAT_MODE_P (mode))
- return true;
+ return default_decimal_float_supported_p ();
else
return default_scalar_mode_supported_p (mode);
}
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 6152e3655ec..52d9a594be2 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1518,13 +1518,6 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-/* Define how to find the value returned by a function.
- VALTYPE is the data type of the value (as a tree).
- If the precise function being called is known, FUNC is its FUNCTION_DECL;
- otherwise, FUNC is 0. */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) rs6000_function_value ((VALTYPE), (FUNC))
-
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
@@ -1727,18 +1720,9 @@ typedef struct rs6000_args
&& (REGNO) == 2))
-/* TRAMPOLINE_TEMPLATE deleted */
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE rs6000_trampoline_size ()
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
- rs6000_initialize_trampoline (ADDR, FNADDR, CXT)
/* Definitions for __builtin_return_address and __builtin_frame_address.
__builtin_return_address (0) should give link register (65), enable
@@ -3175,18 +3159,12 @@ enum rs6000_builtins
RS6000_BUILTIN_BSWAP_HI,
/* VSX builtins. */
- VSX_BUILTIN_LXSDUX,
VSX_BUILTIN_LXSDX,
- VSX_BUILTIN_LXVD2UX,
VSX_BUILTIN_LXVD2X,
VSX_BUILTIN_LXVDSX,
- VSX_BUILTIN_LXVW4UX,
VSX_BUILTIN_LXVW4X,
- VSX_BUILTIN_STXSDUX,
VSX_BUILTIN_STXSDX,
- VSX_BUILTIN_STXVD2UX,
VSX_BUILTIN_STXVD2X,
- VSX_BUILTIN_STXVW4UX,
VSX_BUILTIN_STXVW4X,
VSX_BUILTIN_XSABSDP,
VSX_BUILTIN_XSADDDP,
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 7f50f929488..ba51f1cebc7 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -11513,7 +11513,7 @@
(minus:SI (match_operand:SI 2 "symbol_ref_operand" "s")
(match_operand:SI 3 "symbol_ref_operand" "s"))))]
"TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic"
- "{cal|addi} %0,%1,%2-%3@l")
+ "{cal %0,%2-%3@l(%1)|addi %0,%1,%2-%3@l}")
;; If the TOC is shared over a translation unit, as happens with all
;; the kinds of PIC that we support, we need to restore the TOC
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index c6aafa6fac0..7d572a48412 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -38,9 +38,6 @@
;; it to use gprs as well as vsx registers.
(define_mode_iterator VSX_M [V16QI V8HI V4SI V2DI V4SF V2DF])
-;; Iterator for types for load/store with update
-(define_mode_iterator VSX_U [V16QI V8HI V4SI V2DI V4SF V2DF TI DF])
-
;; Map into the appropriate load/store name based on the type
(define_mode_attr VSm [(V16QI "vw4")
(V8HI "vw4")
@@ -108,10 +105,6 @@
(V2DF "d")
(DF "d")])
-;; Bitsize for DF load with update
-(define_mode_attr VSbit [(SI "32")
- (DI "64")])
-
;; Map into either s or v, depending on whether this is a scalar or vector
;; operation
(define_mode_attr VSv [(V16QI "v")
@@ -186,26 +179,6 @@
(V8HI "HI")
(V16QI "QI")])
-;; Appropriate type for load + update
-(define_mode_attr VStype_load_update [(V16QI "vecload")
- (V8HI "vecload")
- (V4SI "vecload")
- (V4SF "vecload")
- (V2DI "vecload")
- (V2DF "vecload")
- (TI "vecload")
- (DF "fpload")])
-
-;; Appropriate type for store + update
-(define_mode_attr VStype_store_update [(V16QI "vecstore")
- (V8HI "vecstore")
- (V4SI "vecstore")
- (V4SF "vecstore")
- (V2DI "vecstore")
- (V2DF "vecstore")
- (TI "vecstore")
- (DF "fpstore")])
-
;; Constants for creating unspecs
(define_constants
[(UNSPEC_VSX_CONCAT 500)
@@ -243,11 +216,19 @@
{
case 0:
case 3:
- return "stx<VSm>%U0x %x1,%y0";
+ gcc_assert (MEM_P (operands[0])
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_INC
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_DEC
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_MODIFY);
+ return "stx<VSm>x %x1,%y0";
case 1:
case 4:
- return "lx<VSm>%U0x %x0,%y1";
+ gcc_assert (MEM_P (operands[1])
+ && GET_CODE (XEXP (operands[1], 0)) != PRE_INC
+ && GET_CODE (XEXP (operands[1], 0)) != PRE_DEC
+ && GET_CODE (XEXP (operands[1], 0)) != PRE_MODIFY);
+ return "lx<VSm>x %x0,%y1";
case 2:
case 5:
@@ -266,9 +247,17 @@
return output_vec_const_move (operands);
case 12:
+ gcc_assert (MEM_P (operands[0])
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_INC
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_DEC
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_MODIFY);
return "stvx %1,%y0";
case 13:
+ gcc_assert (MEM_P (operands[0])
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_INC
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_DEC
+ && GET_CODE (XEXP (operands[0], 0)) != PRE_MODIFY);
return "lvx %0,%y1";
default:
@@ -289,10 +278,10 @@
switch (which_alternative)
{
case 0:
- return "stxvd2%U0x %x1,%y0";
+ return "stxvd2x %x1,%y0";
case 1:
- return "lxvd2%U0x %x0,%y1";
+ return "lxvd2x %x0,%y1";
case 2:
return "xxlor %x0,%x1,%x1";
@@ -320,41 +309,6 @@
}
[(set_attr "type" "vecstore,vecload,vecsimple,*,*,*,vecsimple,*,vecstore,vecload")])
-;; Load/store with update
-;; Define insns that do load or store with update. Because VSX only has
-;; reg+reg addressing, pre-decrement or pre-increment is unlikely to be
-;; generated.
-;;
-;; In all these cases, we use operands 0 and 1 for the register being
-;; incremented because those are the operands that local-alloc will
-;; tie and these are the pair most likely to be tieable (and the ones
-;; that will benefit the most).
-
-(define_insn "*vsx_load<VSX_U:mode>_update_<P:mptrsize>"
- [(set (match_operand:VSX_U 3 "vsx_register_operand" "=<VSr>,?wa")
- (mem:VSX_U (plus:P (match_operand:P 1 "gpc_reg_operand" "0,0")
- (match_operand:P 2 "gpc_reg_operand" "r,r"))))
- (set (match_operand:P 0 "gpc_reg_operand" "=b,b")
- (plus:P (match_dup 1)
- (match_dup 2)))]
- "<P:tptrsize> && TARGET_UPDATE && VECTOR_MEM_VSX_P (<MODE>mode)"
- "lx<VSm>ux %x3,%0,%2"
- [(set_attr "type" "<VSX_U:VStype_load_update>")])
-
-(define_insn "*vsx_store<mode>_update_<P:mptrsize>"
- [(set (mem:VSX_U (plus:P (match_operand:P 1 "gpc_reg_operand" "0,0")
- (match_operand:P 2 "gpc_reg_operand" "r,r")))
- (match_operand:VSX_U 3 "gpc_reg_operand" "<VSr>,?wa"))
- (set (match_operand:P 0 "gpc_reg_operand" "=b,b")
- (plus:P (match_dup 1)
- (match_dup 2)))]
- "<P:tptrsize> && TARGET_UPDATE && VECTOR_MEM_VSX_P (<MODE>mode)"
- "stx<VSm>ux %x3,%0,%2"
- [(set_attr "type" "<VSX_U:VStype_store_update>")])
-
-;; We may need to have a varient on the pattern for use in the prologue
-;; that doesn't depend on TARGET_UPDATE.
-
;; VSX scalar and vector floating point arithmetic instructions
(define_insn "*vsx_add<mode>3"
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index be68bd530c3..8a2f1b7186e 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -106,8 +106,6 @@ extern bool s390_output_addr_const_extra (FILE*, rtx);
extern void print_operand_address (FILE *, rtx);
extern void print_operand (FILE *, rtx, int);
extern void s390_output_pool_entry (rtx, enum machine_mode, unsigned int);
-extern void s390_trampoline_template (FILE *);
-extern void s390_initialize_trampoline (rtx, rtx, rtx);
extern int s390_agen_dep_p (rtx, rtx);
extern rtx s390_load_got (void);
extern rtx s390_get_thread_pointer (void);
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index a4ac3a38b6b..e439b01709f 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -366,7 +366,7 @@ static bool
s390_scalar_mode_supported_p (enum machine_mode mode)
{
if (DECIMAL_FLOAT_MODE_P (mode))
- return true;
+ return default_decimal_float_supported_p ();
else
return default_scalar_mode_supported_p (mode);
}
@@ -8863,8 +8863,8 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
On S/390, we use gpr 1 internally in the trampoline code;
gpr 0 is used to hold the static chain. */
-void
-s390_trampoline_template (FILE *file)
+static void
+s390_asm_trampoline_template (FILE *file)
{
rtx op[2];
op[0] = gen_rtx_REG (Pmode, 0);
@@ -8890,15 +8890,19 @@ s390_trampoline_template (FILE *file)
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
-void
-s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
+static void
+s390_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
{
- emit_move_insn (gen_rtx_MEM (Pmode,
- memory_address (Pmode,
- plus_constant (addr, (TARGET_64BIT ? 16 : 8)))), cxt);
- emit_move_insn (gen_rtx_MEM (Pmode,
- memory_address (Pmode,
- plus_constant (addr, (TARGET_64BIT ? 24 : 12)))), fnaddr);
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (2*UNITS_PER_WORD), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, Pmode, 2*UNITS_PER_WORD);
+ emit_move_insn (mem, cxt);
+ mem = adjust_address (m_tramp, Pmode, 3*UNITS_PER_WORD);
+ emit_move_insn (mem, fnaddr);
}
/* Output assembler code to FILE to increment profiler label # LABELNO
@@ -10152,6 +10156,11 @@ s390_reorg (void)
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE s390_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE s390_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT s390_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-s390.h"
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 3c93fb770f6..ffb96cd0f34 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -712,14 +712,8 @@ CUMULATIVE_ARGS;
/* Trampolines for nested functions. */
-#define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16)
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
- s390_initialize_trampoline ((ADDR), (FNADDR), (CXT))
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
- s390_trampoline_template (FILE)
-
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16)
+#define TRAMPOLINE_ALIGNMENT BITS_PER_WORD
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/score/score-protos.h b/gcc/config/score/score-protos.h
index 204dc1876a4..d42ec14eb69 100644
--- a/gcc/config/score/score-protos.h
+++ b/gcc/config/score/score-protos.h
@@ -50,7 +50,6 @@ extern int score_hard_regno_mode_ok (unsigned int, enum machine_mode);
extern int score_const_ok_for_letter_p (HOST_WIDE_INT value, char c);
extern int score_extra_constraint (rtx op, char c);
extern rtx score_return_addr (int count, rtx frame);
-extern void score_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN);
extern int score_regno_mode_ok_for_base_p (int regno, int strict);
extern void score_function_arg_advance (CUMULATIVE_ARGS *cum,
enum machine_mode mode,
diff --git a/gcc/config/score/score.c b/gcc/config/score/score.c
index 12eb76b1a41..4324d653e1e 100644
--- a/gcc/config/score/score.c
+++ b/gcc/config/score/score.c
@@ -119,6 +119,11 @@
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE score_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE score_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT score_trampoline_init
+
struct extern_list *extern_head = 0;
/* default 0 = NO_REGS */
@@ -519,14 +524,27 @@ score_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
gcc_unreachable ();
}
-/* Implement INITIALIZE_TRAMPOLINE macro. */
-void
-score_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN)
+/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+static void
+score_asm_trampoline_template (FILE *f)
+{
+ if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
+ return score7_asm_trampoline_template (f);
+ else if (TARGET_SCORE3)
+ return score3_asm_trampoline_template (f);
+
+ gcc_unreachable ();
+}
+
+/* Implement TARGET_TRAMPOLINE_INIT. */
+static void
+score_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
+ /* ??? These two routines are identical. */
if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
- return score7_initialize_trampoline (ADDR, FUNC, CHAIN);
+ return score7_trampoline_init (m_tramp, fndecl, chain_value);
else if (TARGET_SCORE3)
- return score3_initialize_trampoline (ADDR, FUNC, CHAIN);
+ return score3_trampoline_init (m_tramp, fndecl, chain_value);
gcc_unreachable ();
}
diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h
index ea3e0168995..0b7af7b2739 100644
--- a/gcc/config/score/score.h
+++ b/gcc/config/score/score.h
@@ -673,54 +673,12 @@ typedef struct score_args
} \
} while (0)
-#define TRAMPOLINE_TEMPLATE(STREAM) \
- do { \
- if (TARGET_SCORE7) \
- { \
- fprintf (STREAM, "\t.set r1\n"); \
- fprintf (STREAM, "\tmv r31, r3\n"); \
- fprintf (STREAM, "\tbl nextinsn\n"); \
- fprintf (STREAM, "nextinsn:\n"); \
- fprintf (STREAM, "\tlw r1, [r3, 6*4-8]\n"); \
- fprintf (STREAM, "\tlw r23, [r3, 6*4-4]\n"); \
- fprintf (STREAM, "\tmv r3, r31\n"); \
- fprintf (STREAM, "\tbr! r1\n"); \
- fprintf (STREAM, "\tnop!\n"); \
- fprintf (STREAM, "\t.set nor1\n"); \
- } \
- else if (TARGET_SCORE3) \
- { \
- fprintf (STREAM, "\t.set r1\n"); \
- fprintf (STREAM, "\tmv! r31, r3\n"); \
- fprintf (STREAM, "\tnop!\n"); \
- fprintf (STREAM, "\tbl nextinsn\n"); \
- fprintf (STREAM, "nextinsn:\n"); \
- fprintf (STREAM, "\tlw! r1, [r3, 6*4-8]\n"); \
- fprintf (STREAM, "\tnop!\n"); \
- fprintf (STREAM, "\tlw r23, [r3, 6*4-4]\n"); \
- fprintf (STREAM, "\tmv! r3, r31\n"); \
- fprintf (STREAM, "\tnop!\n"); \
- fprintf (STREAM, "\tbr! r1\n"); \
- fprintf (STREAM, "\tnop!\n"); \
- fprintf (STREAM, "\t.set nor1\n"); \
- } \
- } while (0)
-
/* Trampolines for Nested Functions. */
#define TRAMPOLINE_INSNS 6
/* A C expression for the size in bytes of the trampoline, as an integer. */
#define TRAMPOLINE_SIZE (24 + GET_MODE_SIZE (ptr_mode) * 2)
-/* A C statement to initialize the variable parts of a trampoline.
- ADDR is an RTX for the address of the trampoline; FNADDR is an
- RTX for the address of the nested function; STATIC_CHAIN is an
- RTX for the static chain value that should be passed to the
- function when it is called. */
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
- score_initialize_trampoline (ADDR, FUNC, CHAIN)
-
#define HAVE_PRE_INCREMENT 1
#define HAVE_PRE_DECREMENT 1
#define HAVE_POST_INCREMENT 1
@@ -1067,7 +1025,7 @@ typedef struct score_args
for 32-bit targets. */
#define FUNCTION_MODE Pmode
-struct extern_list GTY ((chain_next ("%h.next")))
+struct GTY ((chain_next ("%h.next"))) extern_list
{
struct extern_list *next; /* next external */
const char *name; /* name of the external */
diff --git a/gcc/config/score/score3.c b/gcc/config/score/score3.c
index d27d1f9f764..a5c8e608d15 100644
--- a/gcc/config/score/score3.c
+++ b/gcc/config/score/score3.c
@@ -870,23 +870,48 @@ score3_function_value (tree valtype, tree func, enum machine_mode mode)
return gen_rtx_REG (mode, RT_REGNUM);
}
-/* Implement INITIALIZE_TRAMPOLINE macro. */
+/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+void
+score3_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\t.set r1\n");
+ fprintf (f, "\tmv! r31, r3\n");
+ fprintf (f, "\tnop!\n");
+ fprintf (f, "\tbl nextinsn\n");
+ fprintf (f, "nextinsn:\n");
+ fprintf (f, "\tlw! r1, [r3, 6*4-8]\n");
+ fprintf (f, "\tnop!\n");
+ fprintf (f, "\tlw r23, [r3, 6*4-4]\n");
+ fprintf (f, "\tmv! r3, r31\n");
+ fprintf (f, "\tnop!\n");
+ fprintf (f, "\tbr! r1\n");
+ fprintf (f, "\tnop!\n");
+ fprintf (f, "\t.set nor1\n");
+}
+
+/* Implement TARGET_TRAMPOLINE_INIT. */
void
-score3_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN)
+score3_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
#define FFCACHE "_flush_cache"
#define CODE_SIZE (TRAMPOLINE_INSNS * UNITS_PER_WORD)
- rtx pfunc, pchain;
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx addr = XEXP (m_tramp, 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
- pfunc = plus_constant (ADDR, CODE_SIZE);
- pchain = plus_constant (ADDR, CODE_SIZE + GET_MODE_SIZE (SImode));
+ mem = adjust_address (m_tramp, SImode, CODE_SIZE);
+ emit_move_insn (mem, fnaddr);
+ mem = adjust_address (m_tramp, SImode, CODE_SIZE + GET_MODE_SIZE (SImode));
+ emit_move_insn (mem, chain_value);
- emit_move_insn (gen_rtx_MEM (SImode, pfunc), FUNC);
- emit_move_insn (gen_rtx_MEM (SImode, pchain), CHAIN);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, FFCACHE),
0, VOIDmode, 2,
- ADDR, Pmode,
+ addr, Pmode,
GEN_INT (TRAMPOLINE_SIZE), SImode);
#undef FFCACHE
#undef CODE_SIZE
diff --git a/gcc/config/score/score3.h b/gcc/config/score/score3.h
index 001b2f0c2ee..4e545fc9570 100644
--- a/gcc/config/score/score3.h
+++ b/gcc/config/score/score3.h
@@ -120,7 +120,8 @@ extern rtx score3_function_arg (const CUMULATIVE_ARGS *cum,
extern rtx score3_function_value (tree valtype,
tree func ATTRIBUTE_UNUSED,
enum machine_mode mode);
-extern void score3_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN);
+extern void score3_asm_trampoline_template (FILE *);
+extern void score3_trampoline_init (rtx, tree, rtx);
extern int score3_regno_mode_ok_for_base_p (int regno, int strict);
extern bool score3_legitimate_address_p (enum machine_mode mode, rtx x,
bool strict);
diff --git a/gcc/config/score/score7.c b/gcc/config/score/score7.c
index 4ba3dce43a1..2307201f166 100644
--- a/gcc/config/score/score7.c
+++ b/gcc/config/score/score7.c
@@ -861,23 +861,45 @@ score7_function_value (tree valtype, tree func, enum machine_mode mode)
return gen_rtx_REG (mode, RT_REGNUM);
}
-/* Implement INITIALIZE_TRAMPOLINE macro. */
+/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+void
+score7_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\t.set r1\n");
+ fprintf (f, "\tmv r31, r3\n");
+ fprintf (f, "\tbl nextinsn\n");
+ fprintf (f, "nextinsn:\n");
+ fprintf (f, "\tlw r1, [r3, 6*4-8]\n");
+ fprintf (f, "\tlw r23, [r3, 6*4-4]\n");
+ fprintf (f, "\tmv r3, r31\n");
+ fprintf (f, "\tbr! r1\n");
+ fprintf (f, "\tnop!\n");
+ fprintf (f, "\t.set nor1\n");
+}
+
+/* Implement TARGET_TRAMPOLINE_INIT. */
void
-score7_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN)
+score7_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
#define FFCACHE "_flush_cache"
#define CODE_SIZE (TRAMPOLINE_INSNS * UNITS_PER_WORD)
- rtx pfunc, pchain;
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx addr = XEXP (m_tramp, 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
- pfunc = plus_constant (ADDR, CODE_SIZE);
- pchain = plus_constant (ADDR, CODE_SIZE + GET_MODE_SIZE (SImode));
+ mem = adjust_address (m_tramp, SImode, CODE_SIZE);
+ emit_move_insn (mem, fnaddr);
+ mem = adjust_address (m_tramp, SImode, CODE_SIZE + GET_MODE_SIZE (SImode));
+ emit_move_insn (mem, chain_value);
- emit_move_insn (gen_rtx_MEM (SImode, pfunc), FUNC);
- emit_move_insn (gen_rtx_MEM (SImode, pchain), CHAIN);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, FFCACHE),
0, VOIDmode, 2,
- ADDR, Pmode,
+ addr, Pmode,
GEN_INT (TRAMPOLINE_SIZE), SImode);
#undef FFCACHE
#undef CODE_SIZE
diff --git a/gcc/config/score/score7.h b/gcc/config/score/score7.h
index ae3f4e837cb..0931a2b97e5 100644
--- a/gcc/config/score/score7.h
+++ b/gcc/config/score/score7.h
@@ -120,7 +120,8 @@ extern rtx score7_function_arg (const CUMULATIVE_ARGS *cum,
extern rtx score7_function_value (tree valtype,
tree func ATTRIBUTE_UNUSED,
enum machine_mode mode);
-extern void score7_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN);
+extern void score7_asm_trampoline_template (FILE *);
+extern void score7_trampoline_init (rtx, tree, rtx);
extern int score7_regno_mode_ok_for_base_p (int regno, int strict);
extern bool score7_legitimate_address_p (enum machine_mode mode, rtx x,
bool strict);
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 35cd73021b9..f61c5d5440a 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -142,7 +142,6 @@ extern int sh_cfun_interrupt_handler_p (void);
extern int sh_cfun_resbank_handler_p (void);
extern int sh_attr_renesas_p (const_tree);
extern int sh_cfun_attr_renesas_p (void);
-extern void sh_initialize_trampoline (rtx, rtx, rtx);
extern bool sh_cannot_change_mode_class
(enum machine_mode, enum machine_mode, enum reg_class);
extern void sh_mark_label (rtx, int);
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index d0f9932288a..df03c14a364 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -272,6 +272,8 @@ static bool sh_scalar_mode_supported_p (enum machine_mode);
static int sh_dwarf_calling_convention (const_tree);
static void sh_encode_section_info (tree, rtx, int);
static int sh2a_function_vector_p (tree);
+static void sh_trampoline_init (rtx, tree, rtx);
+static rtx sh_trampoline_adjust_address (rtx);
static const struct attribute_spec sh_attribute_table[] =
{
@@ -511,6 +513,11 @@ static const struct attribute_spec sh_attribute_table[] =
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P sh_legitimate_address_p
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT sh_trampoline_init
+#undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
+#define TARGET_TRAMPOLINE_ADJUST_ADDRESS sh_trampoline_adjust_address
+
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
@@ -10327,10 +10334,11 @@ sh_ms_bitfield_layout_p (const_tree record_type ATTRIBUTE_UNUSED)
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
-void
-sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+sh_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt)
{
- rtx tramp_mem = gen_frame_mem (BLKmode, tramp);
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx tramp = force_reg (Pmode, XEXP (tramp_mem, 0));
if (TARGET_SHMEDIA64)
{
@@ -10421,7 +10429,6 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
rtx ptabs = force_reg (DImode, GEN_INT (0x6bf10600));
rtx blink = force_reg (DImode, GEN_INT (0x4401fff0));
- tramp = force_reg (Pmode, tramp);
fnaddr = force_reg (SImode, fnaddr);
cxt = force_reg (SImode, cxt);
emit_insn (gen_mshflo_w_x (gen_rtx_SUBREG (V4HImode, quad0, 0),
@@ -10477,6 +10484,17 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
}
}
+/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
+
+static rtx
+sh_trampoline_adjust_address (rtx tramp)
+{
+ if (TARGET_SHMEDIA)
+ tramp = expand_simple_binop (Pmode, PLUS, tramp, const1_rtx,
+ gen_reg_rtx (Pmode), 0, OPTAB_LIB_WIDEN);
+ return tramp;
+}
+
/* FIXME: This is overly conservative. A SHcompact function that
receives arguments ``by reference'' will have them stored in its
own stack frame, so it must not pass pointers or references to
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 9b3d99fc788..c24555f9796 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1829,23 +1829,6 @@ struct sh_args {
((CACHE_LOG < 3 || (TARGET_SMALLCODE && ! TARGET_HARVARD)) ? 32 \
: TARGET_SHMEDIA ? 256 : 64)
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- sh_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
-
-/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
-
-#define TRAMPOLINE_ADJUST_ADDRESS(TRAMP) do \
-{ \
- if (TARGET_SHMEDIA) \
- (TRAMP) = expand_simple_binop (Pmode, PLUS, (TRAMP), const1_rtx, \
- gen_reg_rtx (Pmode), 0, \
- OPTAB_LIB_WIDEN); \
-} while (0)
-
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
FRAMEADDR is already the frame pointer of the COUNT frame, so we
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 4ece6c0b161..097b709624b 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -61,9 +61,6 @@ extern void sparc_emit_fixunsdi (rtx [2], enum machine_mode);
extern void emit_tfmode_binop (enum rtx_code, rtx *);
extern void emit_tfmode_unop (enum rtx_code, rtx *);
extern void emit_tfmode_cvt (enum rtx_code, rtx *);
-/* This function handles all v9 scc insns */
-extern void sparc_initialize_trampoline (rtx, rtx, rtx);
-extern void sparc64_initialize_trampoline (rtx, rtx, rtx);
extern bool legitimate_constant_p (rtx);
extern bool constant_address_p (rtx);
extern bool legitimate_pic_operand_p (rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index ea439142dea..0bfde6f6632 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -424,6 +424,7 @@ static bool sparc_can_eliminate (const int, const int);
#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
static const char *sparc_mangle_type (const_tree);
#endif
+static void sparc_trampoline_init (rtx, tree, rtx);
#ifdef SUBTARGET_ATTRIBUTE_TABLE
/* Table of valid machine attributes. */
@@ -600,6 +601,9 @@ static bool fpu_option_set = false;
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P sparc_legitimate_address_p
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT sparc_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -7404,8 +7408,8 @@ sparc_type_code (register tree type)
Emit enough FLUSH insns to synchronize the data and instruction caches. */
-void
-sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+sparc32_initialize_trampoline (rtx m_tramp, rtx fnaddr, rtx cxt)
{
/* SPARC 32-bit trampoline:
@@ -7419,7 +7423,7 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
*/
emit_move_insn
- (gen_rtx_MEM (SImode, plus_constant (tramp, 0)),
+ (adjust_address (m_tramp, SImode, 0),
expand_binop (SImode, ior_optab,
expand_shift (RSHIFT_EXPR, SImode, fnaddr,
size_int (10), 0, 1),
@@ -7427,7 +7431,7 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
NULL_RTX, 1, OPTAB_DIRECT));
emit_move_insn
- (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
+ (adjust_address (m_tramp, SImode, 4),
expand_binop (SImode, ior_optab,
expand_shift (RSHIFT_EXPR, SImode, cxt,
size_int (10), 0, 1),
@@ -7435,14 +7439,14 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
NULL_RTX, 1, OPTAB_DIRECT));
emit_move_insn
- (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
+ (adjust_address (m_tramp, SImode, 8),
expand_binop (SImode, ior_optab,
expand_and (SImode, fnaddr, GEN_INT (0x3ff), NULL_RTX),
GEN_INT (trunc_int_for_mode (0x81c06000, SImode)),
NULL_RTX, 1, OPTAB_DIRECT));
emit_move_insn
- (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
+ (adjust_address (m_tramp, SImode, 12),
expand_binop (SImode, ior_optab,
expand_and (SImode, cxt, GEN_INT (0x3ff), NULL_RTX),
GEN_INT (trunc_int_for_mode (0x8410a000, SImode)),
@@ -7450,19 +7454,18 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
/* On UltraSPARC a flush flushes an entire cache line. The trampoline is
aligned on a 16 byte boundary so one flush clears it all. */
- emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp))));
+ emit_insn (gen_flush (validize_mem (adjust_address (m_tramp, SImode, 0))));
if (sparc_cpu != PROCESSOR_ULTRASPARC
&& sparc_cpu != PROCESSOR_ULTRASPARC3
&& sparc_cpu != PROCESSOR_NIAGARA
&& sparc_cpu != PROCESSOR_NIAGARA2)
- emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode,
- plus_constant (tramp, 8)))));
+ emit_insn (gen_flush (validize_mem (adjust_address (m_tramp, SImode, 8))));
/* Call __enable_execute_stack after writing onto the stack to make sure
the stack address is accessible. */
#ifdef ENABLE_EXECUTE_STACK
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
+ LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
#endif
}
@@ -7471,8 +7474,8 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
values as "immediate" data out of the trampoline. It's also easier since
we can read the PC without clobbering a register. */
-void
-sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+sparc64_initialize_trampoline (rtx m_tramp, rtx fnaddr, rtx cxt)
{
/* SPARC 64-bit trampoline:
@@ -7483,31 +7486,44 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+16 bytes data
*/
- emit_move_insn (gen_rtx_MEM (SImode, tramp),
+ emit_move_insn (adjust_address (m_tramp, SImode, 0),
GEN_INT (trunc_int_for_mode (0x83414000, SImode)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
+ emit_move_insn (adjust_address (m_tramp, SImode, 4),
GEN_INT (trunc_int_for_mode (0xca586018, SImode)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
+ emit_move_insn (adjust_address (m_tramp, SImode, 8),
GEN_INT (trunc_int_for_mode (0x81c14000, SImode)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
+ emit_move_insn (adjust_address (m_tramp, SImode, 12),
GEN_INT (trunc_int_for_mode (0xca586010, SImode)));
- emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 16)), cxt);
- emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 24)), fnaddr);
- emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, tramp))));
+ emit_move_insn (adjust_address (m_tramp, DImode, 16), cxt);
+ emit_move_insn (adjust_address (m_tramp, DImode, 24), fnaddr);
+ emit_insn (gen_flushdi (validize_mem (adjust_address (m_tramp, DImode, 0))));
if (sparc_cpu != PROCESSOR_ULTRASPARC
&& sparc_cpu != PROCESSOR_ULTRASPARC3
&& sparc_cpu != PROCESSOR_NIAGARA
&& sparc_cpu != PROCESSOR_NIAGARA2)
- emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8)))));
+ emit_insn (gen_flushdi (validize_mem (adjust_address (m_tramp, DImode, 8))));
/* Call __enable_execute_stack after writing onto the stack to make sure
the stack address is accessible. */
#ifdef ENABLE_EXECUTE_STACK
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
+ LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
#endif
}
+
+/* Worker for TARGET_TRAMPOLINE_INIT. */
+
+static void
+sparc_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
+{
+ rtx fnaddr = force_reg (Pmode, XEXP (DECL_RTL (fndecl), 0));
+ cxt = force_reg (Pmode, cxt);
+ if (TARGET_ARCH64)
+ sparc64_initialize_trampoline (m_tramp, fnaddr, cxt);
+ else
+ sparc32_initialize_trampoline (m_tramp, fnaddr, cxt);
+}
/* Adjust the cost of a scheduling dependency. Return the new cost of
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index c5c762a44ec..13efc690ee3 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1612,16 +1612,6 @@ do { \
#define TRAMPOLINE_SIZE (TARGET_ARCH64 ? 32 : 16)
#define TRAMPOLINE_ALIGNMENT 128 /* 16 bytes */
-
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- if (TARGET_ARCH64) \
- sparc64_initialize_trampoline (TRAMP, FNADDR, CXT); \
- else \
- sparc_initialize_trampoline (TRAMP, FNADDR, CXT)
/* Generate RTL to flush the register windows so as to make arbitrary frames
available. */
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 9e35910f4db..516779200a9 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -6397,7 +6397,6 @@
emit_move_insn (hard_frame_pointer_rtx, stack);
emit_use (stack_pointer_rtx);
- emit_use (static_chain_rtx);
/* ??? The V9-specific version was disabled in rev 1.65. */
emit_jump_insn (gen_goto_handler_and_restore (labreg));
diff --git a/gcc/config/spu/spu-protos.h b/gcc/config/spu/spu-protos.h
index 65cdd07264e..a1f5d13f17c 100644
--- a/gcc/config/spu/spu-protos.h
+++ b/gcc/config/spu/spu-protos.h
@@ -70,7 +70,7 @@ extern int cpat_const_p (rtx x, enum machine_mode mode);
extern rtx gen_cpat_const (rtx * ops);
extern void constant_to_array (enum machine_mode mode, rtx x,
unsigned char *arr);
-extern rtx array_to_constant (enum machine_mode mode, unsigned char *arr);
+extern rtx array_to_constant (enum machine_mode mode, const unsigned char *arr);
extern rtx spu_gen_exp2 (enum machine_mode mode, rtx x);
extern void spu_allocate_stack (rtx op0, rtx op1);
extern void spu_restore_stack_nonlocal (rtx op0, rtx op1);
@@ -81,7 +81,6 @@ extern void spu_builtin_splats (rtx ops[]);
extern void spu_builtin_extract (rtx ops[]);
extern void spu_builtin_insert (rtx ops[]);
extern void spu_builtin_promote (rtx ops[]);
-extern void spu_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt);
extern void spu_expand_sign_extend (rtx ops[]);
extern void spu_expand_vector_init (rtx target, rtx vals);
extern void spu_init_expanders (void);
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 37488b2c14b..b0b2fd27500 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -212,6 +212,7 @@ static int spu_sms_res_mii (struct ddg *g);
static void asm_file_start (void);
static unsigned int spu_section_type_flags (tree, const char *, int);
static rtx spu_expand_load (rtx, rtx, rtx, int);
+static void spu_trampoline_init (rtx, tree, rtx);
extern const char *reg_names[];
@@ -411,6 +412,9 @@ static const struct attribute_spec spu_attribute_table[] =
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P spu_legitimate_address_p
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT spu_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
void
@@ -4876,7 +4880,7 @@ constant_to_array (enum machine_mode mode, rtx x, unsigned char arr[16])
smaller than 16 bytes, use the bytes that would represent that value
in a register, e.g., for QImode return the value of arr[3]. */
rtx
-array_to_constant (enum machine_mode mode, unsigned char arr[16])
+array_to_constant (enum machine_mode mode, const unsigned char arr[16])
{
enum machine_mode inner_mode;
rtvec v;
@@ -5580,9 +5584,10 @@ spu_builtin_promote (rtx ops[])
emit_insn (gen_rotqby_ti (rot, from, offset));
}
-void
-spu_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+spu_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx shuf = gen_reg_rtx (V4SImode);
rtx insn = gen_reg_rtx (V4SImode);
rtx shufc;
@@ -5597,11 +5602,11 @@ spu_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
rtx rotl = gen_reg_rtx (V4SImode);
rtx mask = gen_reg_rtx (V4SImode);
rtx bi = gen_reg_rtx (SImode);
- unsigned char shufa[16] = {
+ static unsigned char const shufa[16] = {
2, 3, 0, 1, 18, 19, 16, 17,
0, 1, 2, 3, 16, 17, 18, 19
};
- unsigned char insna[16] = {
+ static unsigned char const insna[16] = {
0x41, 0, 0, 79,
0x41, 0, 0, STATIC_CHAIN_REGNUM,
0x60, 0x80, 0, 79,
@@ -5616,18 +5621,18 @@ spu_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
emit_insn (gen_movv4si (mask, spu_const (V4SImode, 0xffff << 7)));
emit_insn (gen_selb (insn, insnc, rotl, mask));
- mem = memory_address (Pmode, tramp);
- emit_move_insn (gen_rtx_MEM (V4SImode, mem), insn);
+ mem = adjust_address (m_tramp, V4SImode, 0);
+ emit_move_insn (mem, insn);
emit_move_insn (bi, GEN_INT (0x35000000 + (79 << 7)));
- mem = memory_address (Pmode, plus_constant (tramp, 16));
- emit_move_insn (gen_rtx_MEM (Pmode, mem), bi);
+ mem = adjust_address (m_tramp, Pmode, 16);
+ emit_move_insn (mem, bi);
}
else
{
rtx scxt = gen_reg_rtx (SImode);
rtx sfnaddr = gen_reg_rtx (SImode);
- unsigned char insna[16] = {
+ static unsigned char const insna[16] = {
0x42, 0, 0, STATIC_CHAIN_REGNUM,
0x30, 0, 0, 0,
0, 0, 0, 0,
@@ -5649,9 +5654,8 @@ spu_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
emit_insn (gen_shufb (shuf, sfnaddr, scxt, shufc));
emit_insn (gen_iorv4si3 (insn, insnc, shuf));
- mem = memory_address (Pmode, tramp);
- emit_move_insn (gen_rtx_MEM (V4SImode, mem), insn);
-
+ mem = adjust_address (m_tramp, V4SImode, 0);
+ emit_move_insn (mem, insn);
}
emit_insn (gen_sync ());
}
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 6b56a4546fb..67011a62126 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -403,10 +403,6 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define TRAMPOLINE_SIZE (TARGET_LARGE_MEM ? 20 : 16)
#define TRAMPOLINE_ALIGNMENT 128
-
-#define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \
- spu_initialize_trampoline(TRAMP,FNADDR,CXT)
-
/* Addressing Modes */
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 1c076b2c649..03e716f096e 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1456,34 +1456,36 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
return build_va_arg_indirect_ref (addr);
}
-/* Initialize the variable parts of a trampoline. ADDR is an RTX for
- the address of the trampoline; FNADDR is an RTX for the address of
- the nested function; STATIC_CHAIN is an RTX for the static chain
- value that should be passed to the function when it is called. */
+/* Worker function for TARGET_TRAMPOLINE_INIT. */
-void
-xstormy16_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
+static void
+xstormy16_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
{
- rtx reg_addr = gen_reg_rtx (Pmode);
rtx temp = gen_reg_rtx (HImode);
rtx reg_fnaddr = gen_reg_rtx (HImode);
- rtx reg_addr_mem;
+ rtx reg_addr, reg_addr_mem;
- reg_addr_mem = gen_rtx_MEM (HImode, reg_addr);
+ reg_addr = copy_to_reg (XEXP (m_tramp, 0));
+ reg_addr_mem = adjust_automodify_address (m_tramp, HImode, reg_addr, 0);
- emit_move_insn (reg_addr, addr);
emit_move_insn (temp, GEN_INT (0x3130 | STATIC_CHAIN_REGNUM));
emit_move_insn (reg_addr_mem, temp);
emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
+ reg_addr_mem = adjust_automodify_address (reg_addr_mem, VOIDmode, NULL, 2);
+
emit_move_insn (temp, static_chain);
emit_move_insn (reg_addr_mem, temp);
emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
- emit_move_insn (reg_fnaddr, fnaddr);
+ reg_addr_mem = adjust_automodify_address (reg_addr_mem, VOIDmode, NULL, 2);
+
+ emit_move_insn (reg_fnaddr, XEXP (DECL_RTL (fndecl), 0));
emit_move_insn (temp, reg_fnaddr);
emit_insn (gen_andhi3 (temp, temp, GEN_INT (0xFF)));
emit_insn (gen_iorhi3 (temp, temp, GEN_INT (0x0200)));
emit_move_insn (reg_addr_mem, temp);
emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
+ reg_addr_mem = adjust_automodify_address (reg_addr_mem, VOIDmode, NULL, 2);
+
emit_insn (gen_lshrhi3 (reg_fnaddr, reg_fnaddr, GEN_INT (8)));
emit_move_insn (reg_addr_mem, reg_fnaddr);
}
@@ -2667,6 +2669,9 @@ xstormy16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE xstormy16_can_eliminate
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT xstormy16_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-stormy16.h"
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 49505b507b0..682f7e6f466 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -454,12 +454,7 @@ enum reg_class
/* Trampolines for Nested Functions. */
#define TRAMPOLINE_SIZE 8
-
#define TRAMPOLINE_ALIGNMENT 16
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
- xstormy16_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
-
/* Define this macro to override the type used by the library routines to pick
up arguments of type `float'. (By default, they use a union of `float' and
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
index 0680618a6ec..c1b086ea116 100644
--- a/gcc/config/t-freebsd
+++ b/gcc/config/t-freebsd
@@ -3,3 +3,8 @@ CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
# Compile libgcc.a with pic.
TARGET_LIBGCC2_CFLAGS += -fPIC
+
+# Use unwind-dw2-fde-glibc
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 19268e2bd3b..6242ba62013 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -66,6 +66,7 @@ static section *v850_select_section (tree, int, unsigned HOST_WIDE_INT);
static void v850_encode_data_area (tree, rtx);
static void v850_encode_section_info (tree, rtx, int);
static bool v850_return_in_memory (const_tree, const_tree);
+static rtx v850_function_value (const_tree, const_tree, bool);
static void v850_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
tree, int *, int);
static bool v850_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
@@ -73,6 +74,8 @@ static bool v850_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
static int v850_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static bool v850_can_eliminate (const int, const int);
+static void v850_asm_trampoline_template (FILE *);
+static void v850_trampoline_init (rtx, tree, rtx);
/* Information about the various small memory areas. */
struct small_memory_info small_memory[ (int)SMALL_MEMORY_max ] =
@@ -162,6 +165,9 @@ static const struct attribute_spec v850_attribute_table[] =
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY v850_return_in_memory
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE v850_function_value
+
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE v850_pass_by_reference
@@ -177,6 +183,11 @@ static const struct attribute_spec v850_attribute_table[] =
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE v850_can_eliminate
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE v850_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT v850_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Set the maximum size of small memory area TYPE to the value given
@@ -2948,6 +2959,17 @@ v850_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
/* Return values > 8 bytes in length in memory. */
return int_size_in_bytes (type) > 8 || TYPE_MODE (type) == BLKmode;
}
+
+/* Worker function for TARGET_FUNCTION_VALUE. */
+
+rtx
+v850_function_value (const_tree valtype,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (TYPE_MODE (valtype), 10);
+}
+
/* Worker function for TARGET_SETUP_INCOMING_VARARGS. */
@@ -2963,10 +2985,41 @@ v850_setup_incoming_varargs (CUMULATIVE_ARGS *ca,
/* Worker function for TARGET_CAN_ELIMINATE. */
-bool
+static bool
v850_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
{
return (to == STACK_POINTER_REGNUM ? ! frame_pointer_needed : true);
}
+
+/* Worker function for TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+
+static void
+v850_asm_trampoline_template (FILE *f)
+{
+ fprintf (f, "\tjarl .+4,r12\n");
+ fprintf (f, "\tld.w 12[r12],r20\n");
+ fprintf (f, "\tld.w 16[r12],r12\n");
+ fprintf (f, "\tjmp [r12]\n");
+ fprintf (f, "\tnop\n");
+ fprintf (f, "\t.long 0\n");
+ fprintf (f, "\t.long 0\n");
+}
+
+/* Worker function for TARGET_TRAMPOLINE_INIT. */
+
+static void
+v850_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
+{
+ rtx mem, fnaddr = XEXP (DECL_RTL (fndecl), 0);
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, SImode, 16);
+ emit_move_insn (mem, chain_value);
+ mem = adjust_address (m_tramp, SImode, 20);
+ emit_move_insn (mem, fnaddr);
+}
+
#include "gt-v850.h"
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 026a2292588..4a288178b7a 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -620,14 +620,6 @@ struct cum_arg { int nbytes; int anonymous_args; };
#define FUNCTION_ARG_REGNO_P(N) (N >= 6 && N <= 9)
-/* Define how to find the value returned by a function.
- VALTYPE is the data type of the value (as a tree).
- If the precise function being called is known, FUNC is its FUNCTION_DECL;
- otherwise, FUNC is 0. */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx_REG (TYPE_MODE (VALTYPE), 10)
-
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
@@ -658,33 +650,10 @@ struct cum_arg { int nbytes; int anonymous_args; };
#define FUNCTION_PROFILER(FILE, LABELNO) ;
-#define TRAMPOLINE_TEMPLATE(FILE) \
- do { \
- fprintf (FILE, "\tjarl .+4,r12\n"); \
- fprintf (FILE, "\tld.w 12[r12],r20\n"); \
- fprintf (FILE, "\tld.w 16[r12],r12\n"); \
- fprintf (FILE, "\tjmp [r12]\n"); \
- fprintf (FILE, "\tnop\n"); \
- fprintf (FILE, "\t.long 0\n"); \
- fprintf (FILE, "\t.long 0\n"); \
- } while (0)
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 24
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 16)), \
- (CXT)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 20)), \
- (FNADDR)); \
-}
-
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 4dfaa2e9dd1..d75d11f9a51 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -57,6 +57,8 @@ static int vax_address_cost (rtx, bool);
static bool vax_rtx_costs (rtx, int, int, int *, bool);
static rtx vax_struct_value_rtx (tree, int);
static rtx vax_builtin_setjmp_frame_value (void);
+static void vax_asm_trampoline_template (FILE *);
+static void vax_trampoline_init (rtx, tree, rtx);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -101,6 +103,11 @@ static rtx vax_builtin_setjmp_frame_value (void);
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED hook_bool_void_true
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE vax_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT vax_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Set global variables as needed for the options enabled. */
@@ -2020,3 +2027,45 @@ adjacent_operands_p (rtx lo, rtx hi, enum machine_mode mode)
return rtx_equal_p (lo, hi)
&& hi_offset - lo_offset == GET_MODE_SIZE (mode);
}
+
+/* Output assembler code for a block containing the constant parts
+ of a trampoline, leaving space for the variable parts. */
+
+/* On the VAX, the trampoline contains an entry mask and two instructions:
+ .word NN
+ movl $STATIC,r0 (store the functions static chain)
+ jmp *$FUNCTION (jump to function code at address FUNCTION) */
+
+static void
+vax_asm_trampoline_template (FILE *f ATTRIBUTE_UNUSED)
+{
+ assemble_aligned_integer (2, const0_rtx);
+ assemble_aligned_integer (2, GEN_INT (0x8fd0));
+ assemble_aligned_integer (4, const0_rtx);
+ assemble_aligned_integer (1, GEN_INT (0x50 + STATIC_CHAIN_REGNUM));
+ assemble_aligned_integer (2, GEN_INT (0x9f17));
+ assemble_aligned_integer (4, const0_rtx);
+}
+
+/* We copy the register-mask from the function's pure code
+ to the start of the trampoline. */
+
+static void
+vax_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx mem;
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ mem = adjust_address (m_tramp, HImode, 0);
+ emit_move_insn (mem, gen_const_mem (HImode, fnaddr));
+
+ mem = adjust_address (m_tramp, SImode, 4);
+ emit_move_insn (mem, cxt);
+ mem = adjust_address (m_tramp, SImode, 11);
+ emit_move_insn (mem, plus_constant (fnaddr, 2));
+ emit_insn (gen_sync_istream ());
+}
+
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 0ac7ba58b57..e85ce01f820 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -428,44 +428,10 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0;
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts. */
-
-/* On the VAX, the trampoline contains an entry mask and two instructions:
- .word NN
- movl $STATIC,r0 (store the functions static chain)
- jmp *$FUNCTION (jump to function code at address FUNCTION) */
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- assemble_aligned_integer (2, const0_rtx); \
- assemble_aligned_integer (2, GEN_INT (0x8fd0)); \
- assemble_aligned_integer (4, const0_rtx); \
- assemble_aligned_integer (1, GEN_INT (0x50 + STATIC_CHAIN_REGNUM)); \
- assemble_aligned_integer (2, GEN_INT (0x9f17)); \
- assemble_aligned_integer (4, const0_rtx); \
-}
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 15
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-/* We copy the register-mask from the function's pure code
- to the start of the trampoline. */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \
- gen_rtx_MEM (HImode, FNADDR)); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 11)), \
- plus_constant (FNADDR, 2)); \
- emit_insn (gen_sync_istream ()); \
-}
-
/* Byte offset of return address in a stack frame. The "saved PC" field
is in element [4] when treating the frame as an array of longwords. */
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
index 73176f6f8f6..6bd1e565fe7 100644
--- a/gcc/config/xtensa/xtensa-protos.h
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -70,7 +70,6 @@ struct secondary_reload_info;
extern enum reg_class xtensa_secondary_reload (bool, rtx, enum reg_class,
enum machine_mode,
struct secondary_reload_info *);
-extern void xtensa_initialize_trampoline (rtx, rtx, rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
@@ -86,6 +85,5 @@ extern void override_options (void);
extern long compute_frame_size (int);
extern void xtensa_expand_prologue (void);
extern void order_regs_for_local_alloc (void);
-extern void xtensa_trampoline_template (FILE *);
#endif /* !__XTENSA_PROTOS_H__ */
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 77ba2d9d017..f7b73748b76 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -146,6 +146,9 @@ static tree xtensa_fold_builtin (tree, tree, bool);
static rtx xtensa_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void xtensa_va_start (tree, rtx);
static bool xtensa_frame_pointer_required (void);
+static rtx xtensa_static_chain (const_tree, bool);
+static void xtensa_asm_trampoline_template (FILE *);
+static void xtensa_trampoline_init (rtx, tree, rtx);
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
REG_ALLOC_ORDER;
@@ -229,6 +232,13 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED xtensa_frame_pointer_required
+#undef TARGET_STATIC_CHAIN
+#define TARGET_STATIC_CHAIN xtensa_static_chain
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE xtensa_asm_trampoline_template
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT xtensa_trampoline_init
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -3427,6 +3437,17 @@ xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
outgoing ? GP_OUTGOING_RETURN : GP_RETURN);
}
+/* The static chain is passed in memory. Provide rtx giving 'mem'
+ expressions that denote where they are stored. */
+
+static rtx
+xtensa_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p)
+{
+ rtx base = incoming_p ? arg_pointer_rtx : stack_pointer_rtx;
+ return gen_frame_mem (Pmode, plus_constant (base, -5 * UNITS_PER_WORD));
+}
+
+
/* TRAMPOLINE_TEMPLATE: For Xtensa, the trampoline must perform an ENTRY
instruction with a minimal stack frame in order to get some free
registers. Once the actual call target is known, the proper stack frame
@@ -3435,8 +3456,8 @@ xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
control to the instruction following the ENTRY at the target. Note:
this assumes that the target begins with an ENTRY instruction. */
-void
-xtensa_trampoline_template (FILE *stream)
+static void
+xtensa_asm_trampoline_template (FILE *stream)
{
bool use_call0 = (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS);
@@ -3503,17 +3524,21 @@ xtensa_trampoline_template (FILE *stream)
fprintf (stream, "\t.end no-transform\n");
}
-
-void
-xtensa_initialize_trampoline (rtx addr, rtx func, rtx chain)
+static void
+xtensa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain)
{
+ rtx func = XEXP (DECL_RTL (fndecl), 0);
bool use_call0 = (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS);
int chain_off = use_call0 ? 12 : 8;
int func_off = use_call0 ? 16 : 12;
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, chain_off)), chain);
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, func_off)), func);
+
+ emit_block_move (m_tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ emit_move_insn (adjust_address (m_tramp, SImode, chain_off), chain);
+ emit_move_insn (adjust_address (m_tramp, SImode, func_off), func);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_sync_caches"),
- 0, VOIDmode, 1, addr, Pmode);
+ 0, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
}
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 84d320bc95b..b9d896a9510 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -383,17 +383,6 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM (GP_REG_FIRST + 17)
-/* If the static chain is passed in memory, these macros provide rtx
- giving 'mem' expressions that denote where they are stored.
- 'STATIC_CHAIN' and 'STATIC_CHAIN_INCOMING' give the locations as
- seen by the calling and called functions, respectively. */
-
-#define STATIC_CHAIN \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -5 * UNITS_PER_WORD))
-
-#define STATIC_CHAIN_INCOMING \
- gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -5 * UNITS_PER_WORD))
-
/* For now we don't try to use the full set of boolean registers. Without
software pipelining of FP operations, there's not much to gain and it's
a real pain to get them reloaded. */
@@ -677,8 +666,6 @@ typedef struct xtensa_args
/* Stack pointer value doesn't matter at exit. */
#define EXIT_IGNORE_STACK 1
-#define TRAMPOLINE_TEMPLATE(STREAM) xtensa_trampoline_template (STREAM)
-
/* Size in bytes of the trampoline, as an integer. Make sure this is
a multiple of TRAMPOLINE_ALIGNMENT to avoid -Wpadded warnings. */
#define TRAMPOLINE_SIZE (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS ? 60 : 52)
@@ -686,11 +673,6 @@ typedef struct xtensa_args
/* Alignment required for trampolines, in bits. */
#define TRAMPOLINE_ALIGNMENT 32
-/* A C statement to initialize the variable parts of a trampoline. */
-#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
- xtensa_initialize_trampoline (ADDR, FUNC, CHAIN)
-
-
/* If defined, a C expression that produces the machine-specific code
to setup the stack so that arbitrary frames can be accessed.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d2fa331b9bd..5949b24ec8a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,33 @@
+2009-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ * method.c (make_thunk, make_alias_for): Don't set
+ DECL_NO_STATIC_CHAIN.
+ * decl.c (builtin_function_1, grokfndecl): Likewise.
+ * lex.c (build_lang_decl): Likewise.
+
+2009-09-23 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/41065
+ * decl.c (cp_finish_decl): Record the types used by the global
+ variable declaration we've just parsed.
+
+2009-09-22 Dodji Seketeli <dodji@redhat.com>
+
+ * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
+ LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
+ LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
+ hooks for the c++ FE.
+ * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
+ function_parameter_expanded_from_pack_p): Declare ...
+ * pt.c (function_parameter_pack_p, get_function_template_decl,
+ function_parameter_expanded_from_pack_p): ... new hooks.
+ (get_template_info): Make this more robust.
+ (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
+ line between comment and function.
+ (get_template_argument_pack_elems): Fix comment.
+ (tsubst_decl): Arguments of function parameter packs are not
+ parameter packs themselves.
+
2009-09-21 Jason Merrill <jason@redhat.com>
PR c++/41421
@@ -29,8 +59,10 @@
2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
PR c++/39365
- * g++.dg/expr/bool3.C: New test.
- * g++.dg/expr/bool4.C: New test.
+ * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
+ using same_type_p.
+ (convert_for_assignment): Likewise.
+ * cvt.c (type_promotes_to): Likewise.
2009-09-14 Richard Henderson <rth@redhat.com>
Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 9521eab28cd..d84325d291b 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -59,13 +59,20 @@ static tree cp_eh_personality (void);
#undef LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS
#define LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS \
get_template_innermost_arguments
+#undef LANG_HOOKS_FUNCTION_PARAMETER_PACK_P
+#define LANG_HOOKS_FUNCTION_PARAMETER_PACK_P \
+ function_parameter_pack_p
#undef LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS
#define LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS \
get_template_argument_pack_elems
#undef LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P
#define LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P \
template_template_parameter_p
-
+#undef LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P
+#define LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P \
+ function_parameter_expanded_from_pack_p
+#undef LANG_HOOKS_GET_GENERIC_FUNCTION_DECL
+#define LANG_HOOKS_GET_GENERIC_FUNCTION_DECL get_function_template_decl
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
#define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name
#undef LANG_HOOKS_DWARF_NAME
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 816b4cabd0b..c089bb75f27 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4643,6 +4643,8 @@ extern tree instantiate_decl (tree, int, bool);
extern int comp_template_parms (const_tree, const_tree);
extern bool uses_parameter_packs (tree);
extern bool template_parameter_pack_p (const_tree);
+extern bool function_parameter_pack_p (const_tree);
+extern bool function_parameter_expanded_from_pack_p (tree, tree);
extern tree make_pack_expansion (tree);
extern bool check_for_bare_parameter_packs (tree);
extern tree get_template_info (const_tree);
@@ -4692,7 +4694,7 @@ bool template_template_parameter_p (const_tree);
extern tree get_primary_template_innermost_parameters (const_tree);
extern tree get_template_innermost_arguments (const_tree);
extern tree get_template_argument_pack_elems (const_tree);
-
+extern tree get_function_template_decl (const_tree);
/* in repo.c */
extern void init_repo (void);
extern int repo_emit_p (tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 614dbb05238..c720f6c33a3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3580,10 +3580,6 @@ builtin_function_1 (tree decl, tree context, bool is_global)
retrofit_lang_decl (decl);
- /* All nesting of C++ functions is lexical; there is never a "static
- chain" in the sense of GNU C nested functions. */
- DECL_NO_STATIC_CHAIN (decl) = 1;
-
DECL_ARTIFICIAL (decl) = 1;
SET_OVERLOADED_OPERATOR_CODE (decl, ERROR_MARK);
SET_DECL_LANGUAGE (decl, lang_c);
@@ -5801,6 +5797,15 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
type. */
else if (TREE_CODE (type) == ARRAY_TYPE)
layout_type (type);
+
+ if (!processing_template_decl
+ && TREE_STATIC (decl)
+ && !at_function_scope_p ()
+ && current_function_decl == NULL)
+ /* So decl is a global variable or a static member of a
+ non local class. Record the types it uses
+ so that we can decide later to emit debug info for them. */
+ record_types_used_by_current_var_decl (decl);
}
else if (TREE_CODE (decl) == FIELD_DECL
&& TYPE_FOR_JAVA (type) && MAYBE_CLASS_TYPE_P (type))
@@ -6770,9 +6775,6 @@ grokfndecl (tree ctype,
&& !grok_op_properties (decl, /*complain=*/true))
return NULL_TREE;
- if (ctype && decl_function_context (decl))
- DECL_NO_STATIC_CHAIN (decl) = 1;
-
if (funcdef_flag)
/* Make the init_value nonzero so pushdecl knows this is not
tentative. error_mark_node is replaced later with the BLOCK. */
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 5eb182d3caf..041e391f543 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -516,11 +516,6 @@ build_lang_decl (enum tree_code code, tree name, tree type)
code, name, type);
retrofit_lang_decl (t);
- /* All nesting of C++ functions is lexical; there is never a "static
- chain" in the sense of GNU C nested functions. */
- if (code == FUNCTION_DECL)
- DECL_NO_STATIC_CHAIN (t) = 1;
-
return t;
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 6acf1bb4b71..b0df48938a8 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -151,9 +151,6 @@ make_thunk (tree function, bool this_adjusting,
DECL_CONSTRUCTOR_P (thunk) = 0;
DECL_EXTERNAL (thunk) = 1;
DECL_ARTIFICIAL (thunk) = 1;
- /* Even if this thunk is a member of a local class, we don't
- need a static chain. */
- DECL_NO_STATIC_CHAIN (thunk) = 1;
/* The THUNK is not a pending inline, even if the FUNCTION is. */
DECL_PENDING_INLINE_P (thunk) = 0;
DECL_DECLARED_INLINE_P (thunk) = 0;
@@ -281,7 +278,6 @@ make_alias_for (tree function, tree newid)
DECL_CONSTRUCTOR_P (alias) = 0;
DECL_EXTERNAL (alias) = 0;
DECL_ARTIFICIAL (alias) = 1;
- DECL_NO_STATIC_CHAIN (alias) = 1;
DECL_PENDING_INLINE_P (alias) = 0;
DECL_DECLARED_INLINE_P (alias) = 0;
DECL_USE_TEMPLATE (alias) = 0;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7e3a54540ec..08964dab271 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -294,6 +294,9 @@ get_template_info (const_tree t)
{
tree tinfo = NULL_TREE;
+ if (!t || t == error_mark_node)
+ return NULL;
+
if (DECL_P (t) && DECL_LANG_SPECIFIC (t))
tinfo = DECL_TEMPLATE_INFO (t);
@@ -2617,6 +2620,7 @@ comp_template_parms (const_tree parms1, const_tree parms2)
}
/* Determine whether PARM is a parameter pack. */
+
bool
template_parameter_pack_p (const_tree parm)
{
@@ -2635,8 +2639,49 @@ template_parameter_pack_p (const_tree parm)
&& TEMPLATE_TYPE_PARAMETER_PACK (parm));
}
+/* Determine if T is a function parameter pack. */
+
+bool
+function_parameter_pack_p (const_tree t)
+{
+ if (t && TREE_CODE (t) == PARM_DECL)
+ return FUNCTION_PARAMETER_PACK_P (t);
+ return false;
+}
+
+/* Return the function template declaration of PRIMARY_FUNC_TMPL_INST.
+ PRIMARY_FUNC_TMPL_INST is a primary function template instantiation. */
+
+tree
+get_function_template_decl (const_tree primary_func_tmpl_inst)
+{
+ if (! primary_func_tmpl_inst
+ || TREE_CODE (primary_func_tmpl_inst) != FUNCTION_DECL
+ || ! primary_template_instantiation_p (primary_func_tmpl_inst))
+ return NULL;
+
+ return DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (primary_func_tmpl_inst));
+}
+
+/* Return true iff the function parameter PARAM_DECL was expanded
+ from the function parameter pack PACK. */
+
+bool
+function_parameter_expanded_from_pack_p (tree param_decl, tree pack)
+{
+ if (! function_parameter_pack_p (pack))
+ return false;
+
+ gcc_assert (DECL_NAME (param_decl) && DECL_NAME (pack));
+
+ /* The parameter pack and its pack arguments have the same
+ DECL_PARM_INDEX. */
+ return DECL_PARM_INDEX (pack) == DECL_PARM_INDEX (param_decl);
+}
+
/* Determine whether ARGS describes a variadic template args list,
i.e., one that is terminated by a template argument pack. */
+
static bool
template_args_variadic_p (tree args)
{
@@ -2659,6 +2704,7 @@ template_args_variadic_p (tree args)
/* Generate a new name for the parameter pack name NAME (an
IDENTIFIER_NODE) that incorporates its */
+
static tree
make_ith_pack_parameter_name (tree name, int i)
{
@@ -2735,7 +2781,8 @@ get_template_innermost_arguments (const_tree t)
return args;
}
-/* Return the arguments pack of T if T is a template, NULL otherwise. */
+/* Return the argument pack elements of T if T is a template argument pack,
+ NULL otherwise. */
tree
get_template_argument_pack_elems (const_tree t)
@@ -8825,6 +8872,10 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
if (DECL_TEMPLATE_PARM_P (t))
SET_DECL_TEMPLATE_PARM_P (r);
+ /* An argument of a function parameter pack is not a parameter
+ pack. */
+ FUNCTION_PARAMETER_PACK_P (r) = false;
+
if (expanded_types)
/* We're on the Ith parameter of the function parameter
pack. */
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index 6f8a8dd2d62..2b6b7799209 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -83,6 +83,15 @@ call_ ## FUNC (void) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
&& !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+ && defined(__FreeBSD__) && __FreeBSD__ >= 7
+#include <link.h>
+# define USE_PT_GNU_EH_FRAME
+#endif
+
+#if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
&& defined(__GLIBC__) && __GLIBC__ >= 2
#include <link.h>
/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 35be03c7629..45df29ecc2b 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -3601,18 +3601,6 @@ df_recompute_luids (basic_block bb)
}
-/* Returns true if the function entry needs to
- define the static chain register. */
-
-static bool
-df_need_static_chain_reg (struct function *fun)
-{
- tree fun_context = decl_function_context (fun->decl);
- return fun_context
- && DECL_NO_STATIC_CHAIN (fun_context) == false;
-}
-
-
/* Collect all artificial refs at the block level for BB and add them
to COLLECTION_REC. */
@@ -3891,24 +3879,17 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
if ((call_used_regs[i] == 0) && (df_regs_ever_live_p (i)))
bitmap_set_bit (entry_block_defs, i);
}
- else
- {
- /* If STATIC_CHAIN_INCOMING_REGNUM == STATIC_CHAIN_REGNUM
- only STATIC_CHAIN_REGNUM is defined. If they are different,
- we only care about the STATIC_CHAIN_INCOMING_REGNUM. */
-#ifdef STATIC_CHAIN_INCOMING_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_INCOMING_REGNUM);
-#else
-#ifdef STATIC_CHAIN_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
-#endif
-#endif
- }
r = targetm.calls.struct_value_rtx (current_function_decl, true);
if (r && REG_P (r))
bitmap_set_bit (entry_block_defs, REGNO (r));
+ /* If the function has an incoming STATIC_CHAIN, it has to show up
+ in the entry def set. */
+ r = targetm.calls.static_chain (current_function_decl, true);
+ if (r && REG_P (r))
+ bitmap_set_bit (entry_block_defs, REGNO (r));
+
if ((!reload_completed) || frame_pointer_needed)
{
/* Any reference to any pseudo before reload is a potential
@@ -3946,19 +3927,6 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
#endif
targetm.live_on_entry (entry_block_defs);
-
- /* If the function has an incoming STATIC_CHAIN,
- it has to show up in the entry def set. */
- if (df_need_static_chain_reg (cfun))
- {
-#ifdef STATIC_CHAIN_INCOMING_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_INCOMING_REGNUM);
-#else
-#ifdef STATIC_CHAIN_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
-#endif
-#endif
- }
}
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 12c574d3992..e1729520522 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -3181,6 +3181,13 @@ Support for FreeBSD 1 was discontinued in GCC 3.2. Support for
FreeBSD 2 (and any mutant a.out variants of FreeBSD 3) was
discontinued in GCC 4.0.
+In GCC 4.5, we enabled the use of @code{dl_iterate_phdr} inside boehm-gc on
+FreeBSD 7 or later. In order to better match the configuration of the
+FreeBSD system compiler: We also enabled the check to see if libc
+provides SSP support (which it does on FreeBSD 7), the use of
+@code{dl_iterate_phdr} inside @file{libgcc_s.so.1} (on FreeBSD 7 or later)
+and the use of @code{__cxa_atexit} by default (on FreeBSD 6 or later).
+
We support FreeBSD using the ELF file format with DWARF 2 debugging
for all CPU architectures. You may use @option{-gstabs} instead of
@option{-g}, if you really want the old debugging format. There are
@@ -3196,7 +3203,7 @@ and check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3, 4.4,
The version of binutils installed in @file{/usr/bin} probably works
with this release of GCC@. Bootstrapping against the latest GNU
-binutils and/or the version found in /usr/ports/devel/binutils has
+binutils and/or the version found in @file{/usr/ports/devel/binutils} has
been known to enable additional features and improve overall testsuite
results. However, it is currently known that boehm-gc (which itself
is required for java) may not configure properly on FreeBSD prior to
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5a547e2aaa5..92652ccf1f6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -313,7 +313,8 @@ Objective-C and Objective-C++ Dialects}.
-ftest-coverage -ftime-report -fvar-tracking @gol
-fvar-tracking-assigments -fvar-tracking-assignments-toggle @gol
-g -g@var{level} -gtoggle -gcoff -gdwarf-@var{version} @gol
--ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
+-ggdb -gstabs -gstabs+ -gstrict-dwarf -gno-strict-dwarf @gol
+-gvms -gxcoff -gxcoff+ @gol
-fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
-fdebug-prefix-map=@var{old}=@var{new} @gol
-femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
@@ -4428,6 +4429,17 @@ use, some non-conflicting DWARF 3 extensions in the unwind tables.
Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
for maximum benefit.
+@item -gstrict-dwarf
+@opindex gstrict-dwarf
+Disallow using extensions of later DWARF standard version than selected
+with @option{-gdwarf-@var{version}}. On most targets using non-conflicting
+DWARF extensions from later standard versions is allowed.
+
+@item -gno-strict-dwarf
+@opindex gno-strict-dwarf
+Allow using extensions of later DWARF standard version than selected with
+@option{-gdwarf-@var{version}}.
+
@item -gvms
@opindex gvms
Produce debugging information in VMS debug format (if that is
@@ -14372,7 +14384,7 @@ Supported values for @var{cpu_type} are @samp{401}, @samp{403},
@samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
@samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
@samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
-@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
+@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7},
@samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
@samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 0139a8bfe6f..27263d91c59 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -3661,28 +3661,30 @@ not be defined.
The static chain register need not be a fixed register.
If the static chain is passed in memory, these macros should not be
-defined; instead, the next two macros should be defined.
+defined; instead, the @code{TARGET_STATIC_CHAIN} hook should be used.
@end defmac
-@defmac STATIC_CHAIN
-@defmacx STATIC_CHAIN_INCOMING
-If the static chain is passed in memory, these macros provide rtx giving
-@code{mem} expressions that denote where they are stored.
-@code{STATIC_CHAIN} and @code{STATIC_CHAIN_INCOMING} give the locations
-as seen by the calling and called functions, respectively. Often the former
-will be at an offset from the stack pointer and the latter at an offset from
-the frame pointer.
+@deftypefn {Target Hook} rtx TARGET_STATIC_CHAIN (const_tree @var{fndecl}, bool @var{incoming_p})
+This hook replaces the use of @code{STATIC_CHAIN_REGNUM} et al for
+targets that may use different static chain locations for different
+nested functions. This may be required if the target has function
+attributes that affect the calling conventions of the function and
+those calling conventions use different static chain locations.
+The default version of this hook uses @code{STATIC_CHAIN_REGNUM} et al.
+
+If the static chain is passed in memory, this hook should be used to
+provide rtx giving @code{mem} expressions that denote where they are stored.
+Often the @code{mem} expression as seen by the caller will be at an offset
+from the stack pointer and the @code{mem} expression as seen by the callee
+will be at an offset from the frame pointer.
@findex stack_pointer_rtx
@findex frame_pointer_rtx
@findex arg_pointer_rtx
The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and
-@code{arg_pointer_rtx} will have been initialized prior to the use of these
-macros and should be used to refer to those items.
-
-If the static chain is passed in a register, the two previous macros should
-be defined instead.
-@end defmac
+@code{arg_pointer_rtx} will have been initialized and should be used
+to refer to those items.
+@end deftypefn
@defmac DWARF_FRAME_REGISTERS
This macro specifies the maximum number of hard registers that can be
@@ -5099,17 +5101,17 @@ proper offset from the start of the trampoline. On a RISC machine, it
may be necessary to take out pieces of the address and store them
separately.
-@defmac TRAMPOLINE_TEMPLATE (@var{file})
-A C statement to output, on the stream @var{file}, assembler code for a
-block of data that contains the constant parts of a trampoline. This
-code should not include a label---the label is taken care of
-automatically.
+@deftypefn {Target Hook} void TARGET_ASM_TRAMPOLINE_TEMPLATE (FILE *@var{f})
+This hook is called by @code{assemble_trampoline_template} to output,
+on the stream @var{f}, assembler code for a block of data that contains
+the constant parts of a trampoline. This code should not include a
+label---the label is taken care of automatically.
-If you do not define this macro, it means no template is needed
-for the target. Do not define this macro on systems where the block move
+If you do not define this hook, it means no template is needed
+for the target. Do not define this hook on systems where the block move
code to copy the trampoline into place would be larger than the code
to generate it on the spot.
-@end defmac
+@end deftypefn
@defmac TRAMPOLINE_SECTION
Return the section into which the trampoline template is to be placed
@@ -5123,43 +5125,38 @@ A C expression for the size in bytes of the trampoline, as an integer.
@defmac TRAMPOLINE_ALIGNMENT
Alignment required for trampolines, in bits.
-If you don't define this macro, the value of @code{BIGGEST_ALIGNMENT}
+If you don't define this macro, the value of @code{FUNCTION_ALIGNMENT}
is used for aligning trampolines.
@end defmac
-@defmac INITIALIZE_TRAMPOLINE (@var{addr}, @var{fnaddr}, @var{static_chain})
-A C statement to initialize the variable parts of a trampoline.
-@var{addr} is an RTX for the address of the trampoline; @var{fnaddr} is
-an RTX for the address of the nested function; @var{static_chain} is an
+@deftypefn {Target Hook} void TARGET_TRAMPOLINE_INIT (rtx @var{m_tramp}, tree @var{fndecl}, rtx @var{static_chain})
+This hook is called to initialize a trampoline.
+@var{m_tramp} is an RTX for the memory block for the trampoline; @var{fndecl}
+is the @code{FUNCTION_DECL} for the nested function; @var{static_chain} is an
RTX for the static chain value that should be passed to the function
when it is called.
-@end defmac
-@defmac TRAMPOLINE_ADJUST_ADDRESS (@var{addr})
-A C statement that should perform any machine-specific adjustment in
-the address of the trampoline. Its argument contains the address that
-was passed to @code{INITIALIZE_TRAMPOLINE}. In case the address to be
-used for a function call should be different from the address in which
-the template was stored, the different address should be assigned to
-@var{addr}. If this macro is not defined, @var{addr} will be used for
-function calls.
+If the target defines @code{TARGET_ASM_TRAMPOLINE_TEMPLATE}, then the
+first thing this hook should do is emit a block move into @var{m_tramp}
+from the memory block returned by @code{assemble_trampoline_template}.
+Note that the block move need only cover the constant parts of the
+trampoline. If the target isolates the variable parts of the trampoline
+to the end, not all @code{TRAMPOLINE_SIZE} bytes need be copied.
-@cindex @code{TARGET_ASM_FUNCTION_EPILOGUE} and trampolines
-@cindex @code{TARGET_ASM_FUNCTION_PROLOGUE} and trampolines
-If this macro is not defined, by default the trampoline is allocated as
-a stack slot. This default is right for most machines. The exceptions
-are machines where it is impossible to execute instructions in the stack
-area. On such machines, you may have to implement a separate stack,
-using this macro in conjunction with @code{TARGET_ASM_FUNCTION_PROLOGUE}
-and @code{TARGET_ASM_FUNCTION_EPILOGUE}.
-
-@var{fp} points to a data structure, a @code{struct function}, which
-describes the compilation status of the immediate containing function of
-the function which the trampoline is for. The stack slot for the
-trampoline is in the stack frame of this containing function. Other
-allocation strategies probably must do something analogous with this
-information.
-@end defmac
+If the target requires any other actions, such as flushing caches or
+enabling stack execution, these actions should be performed after
+initializing the trampoline proper.
+@end deftypefn
+
+@deftypefn {Target Hook} rtx TARGET_TRAMPOLINE_ADJUST_ADDRESS (rtx @var{addr})
+This hook should perform any machine-specific adjustment in
+the address of the trampoline. Its argument contains the address of the
+memory block that was passed to @code{TARGET_TRAMPOLINE_INIT}. In case
+the address to be used for a function call should be different from the
+address at which the template was stored, the different address should
+be returned; otherwise @var{addr} should be returned unchanged.
+If this hook is not defined, @var{addr} will be used for function calls.
+@end deftypefn
Implementing trampolines is difficult on many machines because they have
separate instruction and data caches. Writing into a stack location
@@ -5192,7 +5189,7 @@ code located on the stack. The macro should expand to a series of C
file-scope constructs (e.g.@: functions) and provide a unique entry point
named @code{__enable_execute_stack}. The target is responsible for
emitting calls to the entry point in the code, for example from the
-@code{INITIALIZE_TRAMPOLINE} macro.
+@code{TARGET_TRAMPOLINE_INIT} hook.
@end defmac
To use a standard subroutine, define the following macro. In addition,
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f5a0944c43b..aa6b91bb188 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -4668,6 +4668,7 @@ loc_descr_plus_const (dw_loc_descr_ref *list_head, HOST_WIDE_INT offset)
}
}
+#ifdef DWARF2_DEBUGGING_INFO
/* Add a constant OFFSET to a location list. */
static void
@@ -4677,6 +4678,7 @@ loc_list_plus_const (dw_loc_list_ref list_head, HOST_WIDE_INT offset)
for (d = list_head; d != NULL; d = d->dw_loc_next)
loc_descr_plus_const (&d->expr, offset);
}
+#endif
/* Return the size of a location descriptor. */
@@ -6002,7 +6004,8 @@ static dw_die_ref base_type_die (tree);
static int is_base_type (tree);
static dw_die_ref subrange_type_die (tree, tree, tree, dw_die_ref);
static dw_die_ref modified_type_die (tree, int, int, dw_die_ref);
-static dw_die_ref generic_parameter_die (tree, tree, dw_die_ref, int);
+static dw_die_ref generic_parameter_die (tree, tree, bool, dw_die_ref);
+static dw_die_ref template_parameter_pack_die (tree, tree, dw_die_ref);
static int type_is_enum (const_tree);
static unsigned int dbx_reg_number (const_rtx);
static void add_loc_descr_op_piece (dw_loc_descr_ref *, int);
@@ -6070,7 +6073,8 @@ static void gen_descr_array_type_die (tree, struct array_descr_info *, dw_die_re
static void gen_entry_point_die (tree, dw_die_ref);
#endif
static dw_die_ref gen_enumeration_type_die (tree, dw_die_ref);
-static dw_die_ref gen_formal_parameter_die (tree, tree, dw_die_ref);
+static dw_die_ref gen_formal_parameter_die (tree, tree, bool, dw_die_ref);
+static dw_die_ref gen_formal_parameter_pack_die (tree, tree, dw_die_ref, tree*);
static void gen_unspecified_parameters_die (tree, dw_die_ref);
static void gen_formal_types_die (tree, dw_die_ref);
static void gen_subprogram_die (tree, dw_die_ref);
@@ -6102,7 +6106,6 @@ static dw_die_ref declare_in_namespace (tree, dw_die_ref);
static struct dwarf_file_data * lookup_filename (const char *);
static void retry_incomplete_types (void);
static void gen_type_die_for_member (tree, tree, dw_die_ref);
-static tree make_ith_pack_parameter_name (tree, int);
static void gen_generic_params_dies (tree);
static void splice_child_die (dw_die_ref, dw_die_ref);
static int file_info_cmp (const void *, const void *);
@@ -6409,6 +6412,10 @@ dwarf_tag_name (unsigned int tag)
return "DW_TAG_shared_type";
case DW_TAG_type_unit:
return "DW_TAG_type_unit";
+ case DW_TAG_template_parameter_pack:
+ return "DW_TAG_template_parameter_pack";
+ case DW_TAG_formal_parameter_pack:
+ return "DW_TAG_formal_parameter_pack";
case DW_TAG_MIPS_loop:
return "DW_TAG_MIPS_loop";
case DW_TAG_format_label:
@@ -11678,13 +11685,20 @@ base_type_die (tree type)
case REAL_TYPE:
if (DECIMAL_FLOAT_MODE_P (TYPE_MODE (type)))
- encoding = DW_ATE_decimal_float;
+ {
+ if (dwarf_version >= 3 || !dwarf_strict)
+ encoding = DW_ATE_decimal_float;
+ else
+ encoding = DW_ATE_lo_user;
+ }
else
encoding = DW_ATE_float;
break;
case FIXED_POINT_TYPE:
- if (TYPE_UNSIGNED (type))
+ if (!(dwarf_version >= 3 || !dwarf_strict))
+ encoding = DW_ATE_lo_user;
+ else if (TYPE_UNSIGNED (type))
encoding = DW_ATE_unsigned_fixed;
else
encoding = DW_ATE_signed_fixed;
@@ -11951,27 +11965,6 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
return mod_type_die;
}
-/* Generate a new name for the parameter pack name NAME (an
- IDENTIFIER_NODE) that incorporates its */
-
-static tree
-make_ith_pack_parameter_name (tree name, int i)
-{
- /* Munge the name to include the parameter index. */
-#define NUMBUF_LEN 128
- char numbuf[NUMBUF_LEN];
- char* newname;
- int newname_len;
-
- snprintf (numbuf, NUMBUF_LEN, "%i", i);
- newname_len = IDENTIFIER_LENGTH (name)
- + strlen (numbuf) + 2;
- newname = (char*) alloca (newname_len);
- snprintf (newname, newname_len,
- "%s#%i", IDENTIFIER_POINTER (name), i);
- return get_identifier (newname);
-}
-
/* Generate DIEs for the generic parameters of T.
T must be either a generic type or a generic function.
See http://gcc.gnu.org/wiki/TemplateParmsDwarf for more. */
@@ -12003,30 +11996,27 @@ gen_generic_params_dies (tree t)
args = lang_hooks.get_innermost_generic_args (t);
for (i = 0; i < parms_num; i++)
{
- tree parm, arg;
+ tree parm, arg, arg_pack_elems;
parm = TREE_VEC_ELT (parms, i);
arg = TREE_VEC_ELT (args, i);
+ arg_pack_elems = lang_hooks.types.get_argument_pack_elems (arg);
+ gcc_assert (parm && TREE_VALUE (parm) && arg);
+
if (parm && TREE_VALUE (parm) && arg)
{
- tree pack_elems =
- lang_hooks.types.get_argument_pack_elems (arg);
- if (pack_elems)
- {
- /* So ARG is an argument pack and the elements of that pack
- are stored in PACK_ELEMS. */
- int i, len;
-
- len = TREE_VEC_LENGTH (pack_elems);
- for (i = 0; i < len; i++)
- generic_parameter_die (TREE_VALUE (parm),
- TREE_VEC_ELT (pack_elems, i),
- die, i);
- }
- else /* Arg is not an argument pack. */
- generic_parameter_die (TREE_VALUE (parm),
- arg, die,
- -1/* Not a param pack. */);
+ /* If PARM represents a template parameter pack,
+ emit a DW_TAG_template_parameter_pack DIE, followed
+ by DW_TAG_template_*_parameter DIEs for the argument
+ pack elements of ARG. Note that ARG would then be
+ an argument pack. */
+ if (arg_pack_elems)
+ template_parameter_pack_die (TREE_VALUE (parm),
+ arg_pack_elems,
+ die);
+ else
+ generic_parameter_die (TREE_VALUE (parm), arg,
+ true /* Emit DW_AT_name */, die);
}
}
}
@@ -12035,15 +12025,15 @@ gen_generic_params_dies (tree t)
the representation of a generic type parameter.
For instance, in the C++ front end, PARM would be a template parameter.
ARG is the argument to PARM.
+ EMIT_NAME_P if tree, the DIE will have DW_AT_name attribute set to the
+ name of the PARM.
PARENT_DIE is the parent DIE which the new created DIE should be added to,
- as a child node.
- PACK_ELEM_INDEX is >= 0 if PARM is a generic parameter pack, and if ARG
- is one of the unpacked elements of the parameter PACK. In that case,
- PACK_ELEM_INDEX is the index of ARG in the parameter pack. */
+ as a child node. */
static dw_die_ref
-generic_parameter_die (tree parm, tree arg, dw_die_ref parent_die,
- int pack_elem_index)
+generic_parameter_die (tree parm, tree arg,
+ bool emit_name_p,
+ dw_die_ref parent_die)
{
dw_die_ref tmpl_die = NULL;
const char *name = NULL;
@@ -12076,20 +12066,17 @@ generic_parameter_die (tree parm, tree arg, dw_die_ref parent_die,
{
tree tmpl_type;
- if (pack_elem_index >= 0)
+ /* If PARM is a generic parameter pack, it means we are
+ emitting debug info for a template argument pack element.
+ In other terms, ARG is a template argument pack element.
+ In that case, we don't emit any DW_AT_name attribute for
+ the die. */
+ if (emit_name_p)
{
- /* PARM is an element of a parameter pack.
- Generate a name for it. */
- tree identifier = make_ith_pack_parameter_name (DECL_NAME (parm),
- pack_elem_index);
- if (identifier)
- name = IDENTIFIER_POINTER (identifier);
+ name = IDENTIFIER_POINTER (DECL_NAME (parm));
+ gcc_assert (name);
+ add_AT_string (tmpl_die, DW_AT_name, name);
}
- else
- name = IDENTIFIER_POINTER (DECL_NAME (parm));
-
- gcc_assert (name);
- add_AT_string (tmpl_die, DW_AT_name, name);
if (!lang_hooks.decls.generic_generic_parameter_decl_p (parm))
{
@@ -12134,6 +12121,33 @@ generic_parameter_die (tree parm, tree arg, dw_die_ref parent_die,
return tmpl_die;
}
+/* Generate and return a DW_TAG_template_parameter_pack DIE representing.
+ PARM_PACK must be a template parameter pack. The returned DIE
+ will be child DIE of PARENT_DIE. */
+
+static dw_die_ref
+template_parameter_pack_die (tree parm_pack,
+ tree parm_pack_args,
+ dw_die_ref parent_die)
+{
+ dw_die_ref die;
+ int j;
+
+ gcc_assert (parent_die
+ && parm_pack
+ && DECL_NAME (parm_pack));
+
+ die = new_die (DW_TAG_template_parameter_pack, parent_die, parm_pack);
+ add_AT_string (die, DW_AT_name, IDENTIFIER_POINTER (DECL_NAME (parm_pack)));
+
+ for (j = 0; j < TREE_VEC_LENGTH (parm_pack_args); j++)
+ generic_parameter_die (parm_pack,
+ TREE_VEC_ELT (parm_pack_args, j),
+ false /* Don't emit DW_AT_name */,
+ die);
+ return die;
+}
+
/* Given a pointer to an arbitrary ..._TYPE tree node, return true if it is
an enumerated type. */
@@ -12330,7 +12344,9 @@ int_loc_descriptor (HOST_WIDE_INT i)
return new_loc_descr (op, i, 0);
}
+#endif
+#ifdef DWARF2_DEBUGGING_INFO
/* Return loc description representing "address" of integer value.
This can appear only as toplevel expression. */
@@ -12340,6 +12356,9 @@ address_of_int_loc_descriptor (int size, HOST_WIDE_INT i)
int litsize;
dw_loc_descr_ref loc_result = NULL;
+ if (!(dwarf_version >= 4 || !dwarf_strict))
+ return NULL;
+
if (i >= 0)
{
if (i <= 31)
@@ -12368,17 +12387,14 @@ address_of_int_loc_descriptor (int size, HOST_WIDE_INT i)
}
/* Determine if DW_OP_stack_value or DW_OP_implicit_value
is more compact. For DW_OP_stack_value we need:
- litsize + 1 (DW_OP_stack_value) + 1 (DW_OP_bit_size)
- + 1 (mode size)
+ litsize + 1 (DW_OP_stack_value)
and for DW_OP_implicit_value:
- 1 (DW_OP_implicit_value) + 1 (length) + mode_size. */
- if (DWARF2_ADDR_SIZE >= size
- && litsize + 1 + 1 + 1 < 1 + 1 + size)
+ 1 (DW_OP_implicit_value) + 1 (length) + size. */
+ if ((int) DWARF2_ADDR_SIZE >= size && litsize + 1 <= 1 + 1 + size)
{
loc_result = int_loc_descriptor (i);
add_loc_descr (&loc_result,
new_loc_descr (DW_OP_stack_value, 0, 0));
- add_loc_descr_op_piece (&loc_result, size);
return loc_result;
}
@@ -12388,9 +12404,6 @@ address_of_int_loc_descriptor (int size, HOST_WIDE_INT i)
loc_result->dw_loc_oprnd2.v.val_int = i;
return loc_result;
}
-#endif
-
-#ifdef DWARF2_DEBUGGING_INFO
/* Return a location descriptor that designates a base+offset location. */
@@ -12494,7 +12507,7 @@ tls_mem_loc_descriptor (rtx mem)
|| !DECL_THREAD_LOCAL_P (base))
return NULL;
- loc_result = loc_descriptor_from_tree (MEM_EXPR (mem), 2);
+ loc_result = loc_descriptor_from_tree (MEM_EXPR (mem), 1);
if (loc_result == NULL)
return NULL;
@@ -12698,7 +12711,6 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
break;
}
- symref:
mem_loc_result = new_loc_descr (DW_OP_addr, 0, 0);
mem_loc_result->dw_loc_oprnd1.val_class = dw_val_class_addr;
mem_loc_result->dw_loc_oprnd1.v.val_addr = rtl;
@@ -13107,14 +13119,15 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
case PARITY:
case ASM_OPERANDS:
case UNSPEC:
+ case HIGH:
/* If delegitimize_address couldn't do anything with the UNSPEC, we
can't express it in the debug info. This can happen e.g. with some
TLS UNSPECs. */
break;
case CONST_STRING:
- rtl = get_debug_string_label (XSTR (rtl, 0));
- goto symref;
+ /* These can't easily be tracked, see PR41404. */
+ break;
default:
#ifdef ENABLE_CHECKING
@@ -13289,7 +13302,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
break;
case CONST_DOUBLE:
- if (mode != VOIDmode)
+ if (mode != VOIDmode && (dwarf_version >= 4 || !dwarf_strict))
{
/* Note that a CONST_DOUBLE rtx could represent either an integer
or a floating-point constant. A CONST_DOUBLE is used whenever
@@ -13320,7 +13333,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
break;
case CONST_VECTOR:
- if (mode != VOIDmode)
+ if (mode != VOIDmode && (dwarf_version >= 4 || !dwarf_strict))
{
unsigned int elt_size = GET_MODE_UNIT_SIZE (GET_MODE (rtl));
unsigned int length = CONST_VECTOR_NUNITS (rtl);
@@ -13408,7 +13421,8 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
&& SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
break;
case LABEL_REF:
- if (mode != VOIDmode && GET_MODE_SIZE (mode) == DWARF2_ADDR_SIZE)
+ if (mode != VOIDmode && GET_MODE_SIZE (mode) == DWARF2_ADDR_SIZE
+ && (dwarf_version >= 4 || !dwarf_strict))
{
loc_result = new_loc_descr (DW_OP_implicit_value,
DWARF2_ADDR_SIZE, 0);
@@ -13420,16 +13434,14 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
default:
if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE (rtl) == mode
- && GET_MODE_SIZE (GET_MODE (rtl)) <= DWARF2_ADDR_SIZE)
+ && GET_MODE_SIZE (GET_MODE (rtl)) <= DWARF2_ADDR_SIZE
+ && (dwarf_version >= 4 || !dwarf_strict))
{
/* Value expression. */
loc_result = mem_loc_descriptor (rtl, VOIDmode, initialized);
if (loc_result)
- {
- add_loc_descr (&loc_result,
- new_loc_descr (DW_OP_stack_value, 0, 0));
- add_loc_descr_op_piece (&loc_result, GET_MODE_SIZE (mode));
- }
+ add_loc_descr (&loc_result,
+ new_loc_descr (DW_OP_stack_value, 0, 0));
}
break;
}
@@ -13792,7 +13804,8 @@ loc_list_for_address_of_addr_expr_of_indirect_ref (tree loc, bool toplev)
if (!offset && !bitpos)
list_ret = loc_list_from_tree (TREE_OPERAND (obj, 0), toplev ? 2 : 1);
else if (toplev
- && int_size_in_bytes (TREE_TYPE (loc)) <= DWARF2_ADDR_SIZE)
+ && int_size_in_bytes (TREE_TYPE (loc)) <= DWARF2_ADDR_SIZE
+ && (dwarf_version >= 4 || !dwarf_strict))
{
list_ret = loc_list_from_tree (TREE_OPERAND (obj, 0), 0);
if (!list_ret)
@@ -13818,11 +13831,6 @@ loc_list_for_address_of_addr_expr_of_indirect_ref (tree loc, bool toplev)
loc_list_plus_const (list_ret, bytepos);
add_loc_descr_to_each (list_ret,
new_loc_descr (DW_OP_stack_value, 0, 0));
- add_loc_descr_to_each (list_ret,
- new_loc_descr (DW_OP_piece,
- int_size_in_bytes (TREE_TYPE
- (loc)),
- 0));
}
return list_ret;
}
@@ -13928,7 +13936,8 @@ loc_list_from_tree (tree loc, int want_address)
}
else
{
- if (!targetm.emutls.debug_form_tls_address)
+ if (!targetm.emutls.debug_form_tls_address
+ || !(dwarf_version >= 3 || !dwarf_strict))
return 0;
loc = emutls_decl (loc);
first_op = DW_OP_addr;
@@ -14331,7 +14340,8 @@ loc_list_from_tree (tree loc, int want_address)
if (!ret && !list_ret)
return 0;
- if (want_address == 2 && !have_address)
+ if (want_address == 2 && !have_address
+ && (dwarf_version >= 4 || !dwarf_strict))
{
if (int_size_in_bytes (TREE_TYPE (loc)) > DWARF2_ADDR_SIZE)
{
@@ -14341,11 +14351,6 @@ loc_list_from_tree (tree loc, int want_address)
}
add_loc_descr_to_each (list_ret,
new_loc_descr (DW_OP_stack_value, 0, 0));
- add_loc_descr_to_each (list_ret,
- new_loc_descr (DW_OP_piece,
- int_size_in_bytes (TREE_TYPE
- (loc)),
- 0));
have_address = 1;
}
/* Show if we can't fill the request for an address. */
@@ -14886,10 +14891,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
case CONST:
if (CONSTANT_P (XEXP (rtl, 0)))
- {
- add_const_value_attribute (die, XEXP (rtl, 0));
- return true;
- }
+ return add_const_value_attribute (die, XEXP (rtl, 0));
/* FALLTHROUGH */
case SYMBOL_REF:
if (GET_CODE (rtl) == SYMBOL_REF
@@ -14914,6 +14916,10 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
values in Dwarf, so for now we just punt and generate nothing. */
return false;
+ case HIGH:
+ case CONST_FIXED:
+ return false;
+
default:
/* No other kinds of rtx should be possible here. */
gcc_unreachable ();
@@ -15352,7 +15358,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
&& add_const_value_attribute (die, rtl))
return true;
}
- list = loc_list_from_tree (decl, 2);
+ list = loc_list_from_tree (decl, decl_by_reference_p (decl) ? 0 : 2);
if (list)
{
add_AT_location_description (die, attr, list);
@@ -15539,10 +15545,7 @@ tree_add_const_value_attribute (dw_die_ref die, tree t)
rtl = rtl_for_decl_init (init, type);
if (rtl)
- {
- add_const_value_attribute (die, rtl);
- return true;
- }
+ return add_const_value_attribute (die, rtl);
/* If the host and target are sane, try harder. */
else if (CHAR_BIT == 8 && BITS_PER_UNIT == 8
&& initializer_constant_valid_p (init, type))
@@ -16721,7 +16724,9 @@ record_type_tag (tree type)
return DW_TAG_class_type;
case RECORD_IS_INTERFACE:
- return DW_TAG_interface_type;
+ if (dwarf_version >= 3 || !dwarf_strict)
+ return DW_TAG_interface_type;
+ return DW_TAG_structure_type;
default:
gcc_unreachable ();
@@ -16810,10 +16815,13 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
DIE to represent a formal parameter object (or some inlining thereof). If
it's the latter, then this function is only being called to output a
DW_TAG_formal_parameter DIE to stand as a placeholder for some formal
- argument type of some subprogram type. */
+ argument type of some subprogram type.
+ If EMIT_NAME_P is true, name and source coordinate attributes
+ are emitted. */
static dw_die_ref
-gen_formal_parameter_die (tree node, tree origin, dw_die_ref context_die)
+gen_formal_parameter_die (tree node, tree origin, bool emit_name_p,
+ dw_die_ref context_die)
{
tree node_or_origin = node ? node : origin;
dw_die_ref parm_die
@@ -16829,7 +16837,8 @@ gen_formal_parameter_die (tree node, tree origin, dw_die_ref context_die)
else
{
tree type = TREE_TYPE (node);
- add_name_and_src_coords_attributes (parm_die, node);
+ if (emit_name_p)
+ add_name_and_src_coords_attributes (parm_die, node);
if (decl_by_reference_p (node))
add_type_attribute (parm_die, TREE_TYPE (type), 0, 0,
context_die);
@@ -16862,6 +16871,49 @@ gen_formal_parameter_die (tree node, tree origin, dw_die_ref context_die)
return parm_die;
}
+/* Generate and return a DW_TAG_formal_parameter_pack. Also generate
+ children DW_TAG_formal_parameter DIEs representing the arguments of the
+ parameter pack.
+
+ PARM_PACK must be a function parameter pack.
+ PACK_ARG is the first argument of the parameter pack. Its TREE_CHAIN
+ must point to the subsequent arguments of the function PACK_ARG belongs to.
+ SUBR_DIE is the DIE of the function PACK_ARG belongs to.
+ If NEXT_ARG is non NULL, *NEXT_ARG is set to the function argument
+ following the last one for which a DIE was generated. */
+
+static dw_die_ref
+gen_formal_parameter_pack_die (tree parm_pack,
+ tree pack_arg,
+ dw_die_ref subr_die,
+ tree *next_arg)
+{
+ tree arg;
+ dw_die_ref parm_pack_die;
+
+ gcc_assert (parm_pack
+ && lang_hooks.function_parameter_pack_p (parm_pack)
+ && DECL_NAME (parm_pack)
+ && subr_die);
+
+ parm_pack_die = new_die (DW_TAG_formal_parameter_pack, subr_die, parm_pack);
+ add_AT_string (parm_pack_die, DW_AT_name,
+ IDENTIFIER_POINTER (DECL_NAME (parm_pack)));
+
+ for (arg = pack_arg; arg; arg = TREE_CHAIN (arg))
+ {
+ if (! lang_hooks.decls.function_parm_expanded_from_pack_p (arg,
+ parm_pack))
+ break;
+ gen_formal_parameter_die (arg, NULL,
+ false /* Don't emit name attribute. */,
+ parm_pack_die);
+ }
+ if (next_arg)
+ *next_arg = arg;
+ return parm_pack_die;
+}
+
/* Generate a special type of DIE used as a stand-in for a trailing ellipsis
at the end of an (ANSI prototyped) formal parameters list. */
@@ -16905,7 +16957,9 @@ gen_formal_types_die (tree function_or_method_type, dw_die_ref context_die)
break;
/* Output a (nameless) DIE to represent the formal parameter itself. */
- parm_die = gen_formal_parameter_die (formal_type, NULL, context_die);
+ parm_die = gen_formal_parameter_die (formal_type, NULL,
+ true /* Emit name attribute. */,
+ context_die);
if ((TREE_CODE (function_or_method_type) == METHOD_TYPE
&& link == first_parm_type)
|| (arg && DECL_ARTIFICIAL (arg)))
@@ -17023,10 +17077,11 @@ dwarf2out_abstract_function (tree decl)
}
/* Helper function of premark_used_types() which gets called through
- htab_traverse_resize().
+ htab_traverse.
Marks the DIE of a given type in *SLOT as perennial, so it never gets
marked as unused by prune_unused_types. */
+
static int
premark_used_types_helper (void **slot, void *data ATTRIBUTE_UNUSED)
{
@@ -17040,7 +17095,42 @@ premark_used_types_helper (void **slot, void *data ATTRIBUTE_UNUSED)
return 1;
}
+/* Helper function of premark_types_used_by_global_vars which gets called
+ through htab_traverse.
+
+ Marks the DIE of a given type in *SLOT as perennial, so it never gets
+ marked as unused by prune_unused_types. The DIE of the type is marked
+ only if the global variable using the type will actually be emitted. */
+
+static int
+premark_types_used_by_global_vars_helper (void **slot,
+ void *data ATTRIBUTE_UNUSED)
+{
+ struct types_used_by_vars_entry *entry;
+ dw_die_ref die;
+
+ entry = (struct types_used_by_vars_entry *) *slot;
+ gcc_assert (entry->type != NULL
+ && entry->var_decl != NULL);
+ die = lookup_type_die (entry->type);
+ if (die)
+ {
+ /* Ask cgraph if the global variable really is to be emitted.
+ If yes, then we'll keep the DIE of ENTRY->TYPE. */
+ struct varpool_node *node = varpool_node (entry->var_decl);
+ if (node->needed)
+ {
+ die->die_perennial_p = 1;
+ /* Keep the parent DIEs as well. */
+ while ((die = die->die_parent) && die->die_perennial_p == 0)
+ die->die_perennial_p = 1;
+ }
+ }
+ return 1;
+}
+
/* Mark all members of used_types_hash as perennial. */
+
static void
premark_used_types (void)
{
@@ -17048,6 +17138,16 @@ premark_used_types (void)
htab_traverse (cfun->used_types_hash, premark_used_types_helper, NULL);
}
+/* Mark all members of types_used_by_vars_entry as perennial. */
+
+static void
+premark_types_used_by_global_vars (void)
+{
+ if (types_used_by_vars_hash)
+ htab_traverse (types_used_by_vars_hash,
+ premark_types_used_by_global_vars_helper, NULL);
+}
+
/* Generate a DIE to represent a declared function (either file-scope or
block-local). */
@@ -17180,7 +17280,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
/* If this is an explicit function declaration then generate
a DW_AT_explicit attribute. */
- if (lang_hooks.decls.function_decl_explicit_p (decl))
+ if (lang_hooks.decls.function_decl_explicit_p (decl)
+ && (dwarf_version >= 3 || !dwarf_strict))
add_AT_flag (subr_die, DW_AT_explicit, 1);
/* The first time we see a member function, it is in the context of
@@ -17316,21 +17417,46 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
else
{
/* Generate DIEs to represent all known formal parameters. */
- tree arg_decls = DECL_ARGUMENTS (decl);
- tree parm;
-
- /* When generating DIEs, generate the unspecified_parameters DIE
- instead if we come across the arg "__builtin_va_alist" */
- for (parm = arg_decls; parm; parm = TREE_CHAIN (parm))
- if (TREE_CODE (parm) == PARM_DECL)
- {
- if (DECL_NAME (parm)
- && !strcmp (IDENTIFIER_POINTER (DECL_NAME (parm)),
- "__builtin_va_alist"))
- gen_unspecified_parameters_die (parm, subr_die);
- else
+ tree parm = DECL_ARGUMENTS (decl);
+ tree generic_decl = lang_hooks.decls.get_generic_function_decl (decl);
+ tree generic_decl_parm = generic_decl
+ ? DECL_ARGUMENTS (generic_decl)
+ : NULL;
+
+ /* Now we want to walk the list of parameters of the function and
+ emit their relevant DIEs.
+
+ We consider the case of DECL being an instance of a generic function
+ as well as it being a normal function.
+
+ If DECL is an instance of a generic function we walk the
+ parameters of the generic function declaration _and_ the parameters of
+ DECL itself. This is useful because we want to emit specific DIEs for
+ function parameter packs and those are declared as part of the
+ generic function declaration. In that particular case,
+ the parameter pack yields a DW_TAG_formal_parameter_pack DIE.
+ That DIE has children DIEs representing the set of arguments
+ of the pack. Note that the set of pack arguments can be empty.
+ In that case, the DW_TAG_formal_parameter_pack DIE will not have any
+ children DIE.
+
+ Otherwise, we just consider the parameters of DECL. */
+ while (generic_decl_parm || parm)
+ {
+ if (generic_decl_parm
+ && lang_hooks.function_parameter_pack_p (generic_decl_parm))
+ gen_formal_parameter_pack_die (generic_decl_parm,
+ parm, subr_die,
+ &parm);
+ else if (parm)
+ {
gen_decl_die (parm, NULL, subr_die);
- }
+ parm = TREE_CHAIN (parm);
+ }
+
+ if (generic_decl_parm)
+ generic_decl_parm = TREE_CHAIN (generic_decl_parm);
+ }
/* Decide whether we need an unspecified_parameters DIE at the end.
There are 2 more cases to do this for: 1) the ansi ... declaration -
@@ -17728,8 +17854,11 @@ add_call_src_coords_attributes (tree stmt, dw_die_ref die)
{
expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt));
- add_AT_file (die, DW_AT_call_file, lookup_filename (s.file));
- add_AT_unsigned (die, DW_AT_call_line, s.line);
+ if (dwarf_version >= 3 || !dwarf_strict)
+ {
+ add_AT_file (die, DW_AT_call_file, lookup_filename (s.file));
+ add_AT_unsigned (die, DW_AT_call_line, s.line);
+ }
}
@@ -17741,7 +17870,8 @@ add_high_low_attributes (tree stmt, dw_die_ref die)
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- if (BLOCK_FRAGMENT_CHAIN (stmt))
+ if (BLOCK_FRAGMENT_CHAIN (stmt)
+ && (dwarf_version >= 3 || !dwarf_strict))
{
tree chain;
@@ -17943,24 +18073,26 @@ gen_compile_unit_die (const char *filename)
add_AT_string (die, DW_AT_producer, producer);
+ language = DW_LANG_C89;
if (strcmp (language_string, "GNU C++") == 0)
language = DW_LANG_C_plus_plus;
- else if (strcmp (language_string, "GNU Ada") == 0)
- language = DW_LANG_Ada95;
else if (strcmp (language_string, "GNU F77") == 0)
language = DW_LANG_Fortran77;
- else if (strcmp (language_string, "GNU Fortran") == 0)
- language = DW_LANG_Fortran95;
else if (strcmp (language_string, "GNU Pascal") == 0)
language = DW_LANG_Pascal83;
- else if (strcmp (language_string, "GNU Java") == 0)
- language = DW_LANG_Java;
- else if (strcmp (language_string, "GNU Objective-C") == 0)
- language = DW_LANG_ObjC;
- else if (strcmp (language_string, "GNU Objective-C++") == 0)
- language = DW_LANG_ObjC_plus_plus;
- else
- language = DW_LANG_C89;
+ else if (dwarf_version >= 3 || !dwarf_strict)
+ {
+ if (strcmp (language_string, "GNU Ada") == 0)
+ language = DW_LANG_Ada95;
+ else if (strcmp (language_string, "GNU Fortran") == 0)
+ language = DW_LANG_Fortran95;
+ else if (strcmp (language_string, "GNU Java") == 0)
+ language = DW_LANG_Java;
+ else if (strcmp (language_string, "GNU Objective-C") == 0)
+ language = DW_LANG_ObjC;
+ else if (strcmp (language_string, "GNU Objective-C++") == 0)
+ language = DW_LANG_ObjC_plus_plus;
+ }
add_AT_unsigned (die, DW_AT_language, language);
return die;
@@ -18240,7 +18372,8 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
/* If this is an array type with hidden descriptor, handle it first. */
if (!TREE_ASM_WRITTEN (type)
&& lang_hooks.types.get_array_descr_info
- && lang_hooks.types.get_array_descr_info (type, &info))
+ && lang_hooks.types.get_array_descr_info (type, &info)
+ && (dwarf_version >= 3 || !dwarf_strict))
{
gen_descr_array_type_die (type, &info, context_die);
TREE_ASM_WRITTEN (type) = 1;
@@ -18624,7 +18757,11 @@ force_decl_die (tree decl)
break;
case NAMESPACE_DECL:
- dwarf2out_decl (decl);
+ if (dwarf_version >= 3 || !dwarf_strict)
+ dwarf2out_decl (decl);
+ else
+ /* DWARF2 has neither DW_TAG_module, nor DW_TAG_namespace. */
+ decl_die = comp_unit_die;
break;
default:
@@ -18907,7 +19044,9 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die)
if (!origin)
origin = decl_ultimate_origin (decl);
if (origin != NULL_TREE && TREE_CODE (origin) == PARM_DECL)
- gen_formal_parameter_die (decl, origin, context_die);
+ gen_formal_parameter_die (decl, origin,
+ true /* Emit name attribute. */,
+ context_die);
else
gen_variable_die (decl, origin, context_die);
break;
@@ -18929,12 +19068,15 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die)
gen_type_die (TREE_TYPE (TREE_TYPE (decl_or_origin)), context_die);
else
gen_type_die (TREE_TYPE (decl_or_origin), context_die);
- gen_formal_parameter_die (decl, origin, context_die);
+ gen_formal_parameter_die (decl, origin,
+ true /* Emit name attribute. */,
+ context_die);
break;
case NAMESPACE_DECL:
case IMPORTED_DECL:
- gen_namespace_die (decl, context_die);
+ if (dwarf_version >= 3 || !dwarf_strict)
+ gen_namespace_die (decl, context_die);
break;
default:
@@ -19032,9 +19174,14 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
}
if (TREE_CODE (decl) == NAMESPACE_DECL)
- imported_die = new_die (DW_TAG_imported_module,
- lexical_block_die,
- lexical_block);
+ {
+ if (dwarf_version >= 3 || !dwarf_strict)
+ imported_die = new_die (DW_TAG_imported_module,
+ lexical_block_die,
+ lexical_block);
+ else
+ return;
+ }
else
imported_die = new_die (DW_TAG_imported_declaration,
lexical_block_die,
@@ -19075,6 +19222,10 @@ dwarf2out_imported_module_or_decl (tree decl, tree name, tree context,
&& TYPE_P (context)
&& !should_emit_struct_debug (context, DINFO_USAGE_DIR_USE))
return;
+
+ if (!(dwarf_version >= 3 || !dwarf_strict))
+ return;
+
scope_die = get_context_die (context);
if (child)
@@ -20110,6 +20261,9 @@ prune_unused_types (void)
verify_marks_clear (ctnode->root_die);
#endif /* ENABLE_ASSERT_CHECKING */
+ /* Mark types that are used in global variables. */
+ premark_types_used_by_global_vars ();
+
/* Set the mark on nodes that are actually used. */
prune_unused_types_walk (comp_unit_die);
for (node = limbo_die_list; node; node = node->next)
@@ -20372,7 +20526,8 @@ dwarf2out_finish (const char *filename)
/* We can only use the low/high_pc attributes if all of the code was
in .text. */
- if (!have_multiple_function_sections)
+ if (!have_multiple_function_sections
+ || !(dwarf_version >= 3 || !dwarf_strict))
{
add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, text_section_label);
add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 9ed36b33211..b3672e3e5ad 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -136,8 +136,6 @@ FIXED_VALUE_TYPE fconst1[MAX_FCONST1];
In an inline procedure, the stack and frame pointer rtxs may not be
used for anything else. */
-rtx static_chain_rtx; /* (REG:Pmode STATIC_CHAIN_REGNUM) */
-rtx static_chain_incoming_rtx; /* (REG:Pmode STATIC_CHAIN_INCOMING_REGNUM) */
rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */
/* This is used to implement __builtin_return_address for some machines.
@@ -5671,28 +5669,6 @@ init_emit_regs (void)
= gen_raw_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM);
#endif
-#ifdef STATIC_CHAIN_REGNUM
- static_chain_rtx = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
-
-#ifdef STATIC_CHAIN_INCOMING_REGNUM
- if (STATIC_CHAIN_INCOMING_REGNUM != STATIC_CHAIN_REGNUM)
- static_chain_incoming_rtx
- = gen_rtx_REG (Pmode, STATIC_CHAIN_INCOMING_REGNUM);
- else
-#endif
- static_chain_incoming_rtx = static_chain_rtx;
-#endif
-
-#ifdef STATIC_CHAIN
- static_chain_rtx = STATIC_CHAIN;
-
-#ifdef STATIC_CHAIN_INCOMING
- static_chain_incoming_rtx = STATIC_CHAIN_INCOMING;
-#else
- static_chain_incoming_rtx = static_chain_rtx;
-#endif
-#endif
-
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
else
diff --git a/gcc/expr.h b/gcc/expr.h
index 9bf0c38f5d2..4e02c24b75f 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -618,7 +618,7 @@ extern HOST_WIDE_INT int_expr_size (tree);
in its original home. This becomes invalid if any more code is emitted. */
extern rtx hard_function_value (const_tree, const_tree, const_tree, int);
-extern rtx prepare_call_address (rtx, rtx, rtx *, int, int);
+extern rtx prepare_call_address (tree, rtx, rtx, rtx *, int, int);
extern bool shift_return_value (enum machine_mode, bool, rtx);
diff --git a/gcc/final.c b/gcc/final.c
index cd36860455f..78a698b4484 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1594,12 +1594,14 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
#ifndef NO_PROFILE_COUNTERS
# define NO_PROFILE_COUNTERS 0
#endif
-#if defined(ASM_OUTPUT_REG_PUSH)
- int sval = cfun->returns_struct;
- rtx svrtx = targetm.calls.struct_value_rtx (TREE_TYPE (current_function_decl), 1);
-#if defined(STATIC_CHAIN_INCOMING_REGNUM) || defined(STATIC_CHAIN_REGNUM)
- int cxt = cfun->static_chain_decl != NULL;
-#endif
+#ifdef ASM_OUTPUT_REG_PUSH
+ rtx sval = NULL, chain = NULL;
+
+ if (cfun->returns_struct)
+ sval = targetm.calls.struct_value_rtx (TREE_TYPE (current_function_decl),
+ true);
+ if (cfun->static_chain_decl)
+ chain = targetm.calls.static_chain (current_function_decl, true);
#endif /* ASM_OUTPUT_REG_PUSH */
if (! NO_PROFILE_COUNTERS)
@@ -1613,44 +1615,20 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
switch_to_section (current_function_section ());
-#if defined(ASM_OUTPUT_REG_PUSH)
- if (sval && svrtx != NULL_RTX && REG_P (svrtx))
- {
- ASM_OUTPUT_REG_PUSH (file, REGNO (svrtx));
- }
-#endif
-
-#if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (cxt)
- ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_INCOMING_REGNUM);
-#else
-#if defined(STATIC_CHAIN_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (cxt)
- {
- ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_REGNUM);
- }
-#endif
+#ifdef ASM_OUTPUT_REG_PUSH
+ if (sval && REG_P (sval))
+ ASM_OUTPUT_REG_PUSH (file, REGNO (sval));
+ if (chain && REG_P (chain))
+ ASM_OUTPUT_REG_PUSH (file, REGNO (chain));
#endif
FUNCTION_PROFILER (file, current_function_funcdef_no);
-#if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (cxt)
- ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_INCOMING_REGNUM);
-#else
-#if defined(STATIC_CHAIN_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (cxt)
- {
- ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_REGNUM);
- }
-#endif
-#endif
-
-#if defined(ASM_OUTPUT_REG_PUSH)
- if (sval && svrtx != NULL_RTX && REG_P (svrtx))
- {
- ASM_OUTPUT_REG_POP (file, REGNO (svrtx));
- }
+#ifdef ASM_OUTPUT_REG_PUSH
+ if (chain && REG_P (chain))
+ ASM_OUTPUT_REG_POP (file, REGNO (chain));
+ if (sval && REG_P (sval))
+ ASM_OUTPUT_REG_POP (file, REGNO (sval));
#endif
}
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 34e47c19e79..d754bee2581 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1995,9 +1995,22 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
return do_mpc_arg2 (arg1, arg2, type,
/* do_nonfinite= */ folding_initializer,
mpc_div);
+ /* Fallthru ... */
#endif
+ case TRUNC_DIV_EXPR:
+ case CEIL_DIV_EXPR:
+ case FLOOR_DIV_EXPR:
+ case ROUND_DIV_EXPR:
+ if (flag_complex_method == 0)
{
+ /* Keep this algorithm in sync with
+ tree-complex.c:expand_complex_div_straight().
+
+ Expand complex division to scalars, straightforward algorithm.
+ a / b = ((ar*br + ai*bi)/t) + i((ai*br - ar*bi)/t)
+ t = br*br + bi*bi
+ */
tree magsquared
= const_binop (PLUS_EXPR,
const_binop (MULT_EXPR, r2, r2, notrunc),
@@ -2014,12 +2027,64 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
const_binop (MULT_EXPR, r1, i2, notrunc),
notrunc);
- if (INTEGRAL_TYPE_P (TREE_TYPE (r1)))
- code = TRUNC_DIV_EXPR;
-
real = const_binop (code, t1, magsquared, notrunc);
imag = const_binop (code, t2, magsquared, notrunc);
}
+ else
+ {
+ /* Keep this algorithm in sync with
+ tree-complex.c:expand_complex_div_wide().
+
+ Expand complex division to scalars, modified algorithm to minimize
+ overflow with wide input ranges. */
+ tree inner_type = TREE_TYPE (type);
+ tree absr2 = fold_build1 (ABS_EXPR, inner_type, r2);
+ tree absi2 = fold_build1 (ABS_EXPR, inner_type, i2);
+ tree compare = fold_build2 (LT_EXPR, boolean_type_node, absr2, absi2);
+ if (integer_nonzerop (compare))
+ {
+ /* In the TRUE branch, we compute
+ ratio = br/bi;
+ div = (br * ratio) + bi;
+ tr = (ar * ratio) + ai;
+ ti = (ai * ratio) - ar;
+ tr = tr / div;
+ ti = ti / div; */
+ tree ratio = fold_build2 (code, inner_type, r2, i2);
+ tree div = fold_build2 (PLUS_EXPR, inner_type, i2,
+ fold_build2 (MULT_EXPR, inner_type,
+ r2, ratio));
+ real = fold_build2 (MULT_EXPR, inner_type, r1, ratio);
+ real = fold_build2 (PLUS_EXPR, inner_type, real, i1);
+ real = fold_build2 (code, inner_type, real, div);
+
+ imag = fold_build2 (MULT_EXPR, inner_type, i1, ratio);
+ imag = fold_build2 (MINUS_EXPR, inner_type, imag, r1);
+ imag = fold_build2 (code, inner_type, imag, div);
+ }
+ else
+ {
+ /* In the FALSE branch, we compute
+ ratio = d/c;
+ divisor = (d * ratio) + c;
+ tr = (b * ratio) + a;
+ ti = b - (a * ratio);
+ tr = tr / div;
+ ti = ti / div; */
+ tree ratio = fold_build2 (code, inner_type, i2, r2);
+ tree div = fold_build2 (PLUS_EXPR, inner_type, r2,
+ fold_build2 (MULT_EXPR, inner_type,
+ i2, ratio));
+
+ real = fold_build2 (MULT_EXPR, inner_type, i1, ratio);
+ real = fold_build2 (PLUS_EXPR, inner_type, real, r1);
+ real = fold_build2 (code, inner_type, real, div);
+
+ imag = fold_build2 (MULT_EXPR, inner_type, r1, ratio);
+ imag = fold_build2 (MINUS_EXPR, inner_type, i1, imag);
+ imag = fold_build2 (code, inner_type, imag, div);
+ }
+ }
break;
default:
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9c9744b140e..e7826e00008 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,19 @@
+2009-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * simplify.c (gfc_simplify_acos, gfc_simplify_acosh,
+ gfc_simplify_asin, gfc_simplify_asinh, gfc_simplify_atan,
+ gfc_simplify_atanh): Fix error message.
+
+2009-09-24 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/41459
+ * error.c(gfc_warning_now): Move warnings_are_errors test to
+ after actual emitting of the warning.
+ * parse.c (next_free): Improve error locus printing.
+ (next_fixed): Change gfc_warn to gfc_warning_now, and improve
+ locus reporting.
+
+
2009-09-16 Michael Matz <matz@suse.de>
PR fortran/41212
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 9d5453e4ceb..88c2883946f 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -821,14 +821,16 @@ gfc_warning_now (const char *nocmsgid, ...)
i = buffer_flag;
buffer_flag = 0;
warnings++;
- if (warnings_are_errors)
- gfc_increment_error_count();
va_start (argp, nocmsgid);
error_print (_("Warning:"), _(nocmsgid), argp);
va_end (argp);
error_char ('\0');
+
+ if (warnings_are_errors)
+ gfc_increment_error_count();
+
buffer_flag = i;
}
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index e7439892f15..93a6cfdc7f6 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -655,7 +655,7 @@ next_free (void)
if (gfc_match_eos () == MATCH_YES)
{
gfc_warning_now ("Ignoring statement label in empty statement "
- "at %C");
+ "at %L", &label_locus);
gfc_free_st_label (gfc_statement_label);
gfc_statement_label = NULL;
return ST_NONE;
@@ -848,7 +848,8 @@ next_fixed (void)
blank_line:
if (digit_flag)
- gfc_warning ("Ignoring statement label in empty statement at %C");
+ gfc_warning_now ("Ignoring statement label in empty statement at %L",
+ &label_locus);
gfc_current_locus.lb->truncated = 0;
gfc_advance_line ();
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index fbb88a411af..a22dd00c2d8 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -749,7 +749,7 @@ gfc_simplify_acos (gfc_expr *x)
case BT_COMPLEX:
return NULL;
default:
- gfc_internal_error ("in gfc_simplify_cos(): Bad type");
+ gfc_internal_error ("in gfc_simplify_acos(): Bad type");
}
result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
@@ -783,7 +783,7 @@ gfc_simplify_acosh (gfc_expr *x)
case BT_COMPLEX:
return NULL;
default:
- gfc_internal_error ("in gfc_simplify_cos(): Bad type");
+ gfc_internal_error ("in gfc_simplify_acosh(): Bad type");
}
return range_check (result, "ACOSH");
@@ -1045,7 +1045,7 @@ gfc_simplify_asin (gfc_expr *x)
case BT_COMPLEX:
return NULL;
default:
- gfc_internal_error ("in gfc_simplify_cos(): Bad type");
+ gfc_internal_error ("in gfc_simplify_asin(): Bad type");
}
return range_check (result, "ASIN");
@@ -1069,7 +1069,7 @@ gfc_simplify_asinh (gfc_expr *x)
case BT_COMPLEX:
return NULL;
default:
- gfc_internal_error ("in gfc_simplify_cos(): Bad type");
+ gfc_internal_error ("in gfc_simplify_asinh(): Bad type");
}
return range_check (result, "ASINH");
@@ -1093,7 +1093,7 @@ gfc_simplify_atan (gfc_expr *x)
case BT_COMPLEX:
return NULL;
default:
- gfc_internal_error ("in gfc_simplify_cos(): Bad type");
+ gfc_internal_error ("in gfc_simplify_atan(): Bad type");
}
return range_check (result, "ATAN");
@@ -1125,7 +1125,7 @@ gfc_simplify_atanh (gfc_expr *x)
case BT_COMPLEX:
return NULL;
default:
- gfc_internal_error ("in gfc_simplify_cos(): Bad type");
+ gfc_internal_error ("in gfc_simplify_atanh(): Bad type");
}
return range_check (result, "ATANH");
diff --git a/gcc/function.c b/gcc/function.c
index 85e2f058932..aaed57a5de1 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -130,6 +130,10 @@ static GTY((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
static GTY((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
htab_t epilogue_insn_hash;
+
+htab_t types_used_by_vars_hash = NULL;
+tree types_used_by_cur_var_decl = NULL;
+
/* Forward declarations. */
static struct temp_slot *find_temp_slot_from_address (rtx);
@@ -4453,13 +4457,21 @@ expand_function_start (tree subr)
if (cfun->static_chain_decl)
{
tree parm = cfun->static_chain_decl;
- rtx local = gen_reg_rtx (Pmode);
+ rtx local, chain, insn;
+
+ local = gen_reg_rtx (Pmode);
+ chain = targetm.calls.static_chain (current_function_decl, true);
- set_decl_incoming_rtl (parm, static_chain_incoming_rtx, false);
+ set_decl_incoming_rtl (parm, chain, false);
SET_DECL_RTL (parm, local);
mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
- emit_move_insn (local, static_chain_incoming_rtx);
+ insn = emit_move_insn (local, chain);
+
+ /* Mark the register as eliminable, similar to parameters. */
+ if (MEM_P (chain)
+ && reg_mentioned_p (arg_pointer_rtx, XEXP (chain, 0)))
+ set_unique_reg_note (insn, REG_EQUIV, chain);
}
/* If the function receives a non-local goto, then store the
@@ -5418,6 +5430,7 @@ rest_of_handle_check_leaf_regs (void)
}
/* Insert a TYPE into the used types hash table of CFUN. */
+
static void
used_types_insert_helper (tree type, struct function *func)
{
@@ -5442,7 +5455,81 @@ used_types_insert (tree t)
t = TREE_TYPE (t);
t = TYPE_MAIN_VARIANT (t);
if (debug_info_level > DINFO_LEVEL_NONE)
- used_types_insert_helper (t, cfun);
+ {
+ if (cfun)
+ used_types_insert_helper (t, cfun);
+ else
+ /* So this might be a type referenced by a global variable.
+ Record that type so that we can later decide to emit its debug
+ information. */
+ types_used_by_cur_var_decl =
+ tree_cons (t, NULL, types_used_by_cur_var_decl);
+
+ }
+}
+
+/* Helper to Hash a struct types_used_by_vars_entry. */
+
+static hashval_t
+hash_types_used_by_vars_entry (const struct types_used_by_vars_entry *entry)
+{
+ gcc_assert (entry && entry->var_decl && entry->type);
+
+ return iterative_hash_object (entry->type,
+ iterative_hash_object (entry->var_decl, 0));
+}
+
+/* Hash function of the types_used_by_vars_entry hash table. */
+
+hashval_t
+types_used_by_vars_do_hash (const void *x)
+{
+ const struct types_used_by_vars_entry *entry =
+ (const struct types_used_by_vars_entry *) x;
+
+ return hash_types_used_by_vars_entry (entry);
+}
+
+/*Equality function of the types_used_by_vars_entry hash table. */
+
+int
+types_used_by_vars_eq (const void *x1, const void *x2)
+{
+ const struct types_used_by_vars_entry *e1 =
+ (const struct types_used_by_vars_entry *) x1;
+ const struct types_used_by_vars_entry *e2 =
+ (const struct types_used_by_vars_entry *)x2;
+
+ return (e1->var_decl == e2->var_decl && e1->type == e2->type);
+}
+
+/* Inserts an entry into the types_used_by_vars_hash hash table. */
+
+void
+types_used_by_var_decl_insert (tree type, tree var_decl)
+{
+ if (type != NULL && var_decl != NULL)
+ {
+ void **slot;
+ struct types_used_by_vars_entry e;
+ e.var_decl = var_decl;
+ e.type = type;
+ if (types_used_by_vars_hash == NULL)
+ types_used_by_vars_hash =
+ htab_create_ggc (37, types_used_by_vars_do_hash,
+ types_used_by_vars_eq, NULL);
+ slot = htab_find_slot_with_hash (types_used_by_vars_hash, &e,
+ hash_types_used_by_vars_entry (&e), INSERT);
+ if (*slot == NULL)
+ {
+ struct types_used_by_vars_entry *entry;
+ entry = (struct types_used_by_vars_entry*) ggc_alloc
+ (sizeof (struct types_used_by_vars_entry));
+ entry->type = type;
+ entry->var_decl = var_decl;
+ *slot = entry;
+ }
+ }
}
struct rtl_opt_pass pass_leaf_regs =
diff --git a/gcc/function.h b/gcc/function.h
index 72aad0006dc..4825d16cf7f 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -622,6 +622,28 @@ extern int virtuals_instantiated;
/* Nonzero if at least one trampoline has been created. */
extern int trampolines_created;
+struct GTY(()) types_used_by_vars_entry {
+ tree type;
+ tree var_decl;
+};
+
+/* Hash table making the relationship between a global variable
+ and the types it references in its initializer. The key of the
+ entry is a referenced type, and the value is the DECL of the global
+ variable. types_use_by_vars_do_hash and types_used_by_vars_eq below are
+ the hash and equality functions to use for this hash table. */
+extern GTY((param_is (struct types_used_by_vars_entry))) htab_t
+ types_used_by_vars_hash;
+
+hashval_t types_used_by_vars_do_hash (const void*);
+int types_used_by_vars_eq (const void *, const void *);
+void types_used_by_var_decl_insert (tree type, tree var_decl);
+
+/* During parsing of a global variable, this linked list points to
+ the list of types referenced by the global variable. */
+extern GTY(()) tree types_used_by_cur_var_decl;
+
+
/* cfun shouldn't be set directly; use one of these functions instead. */
extern void set_cfun (struct function *new_cfun);
extern void push_cfun (struct function *new_cfun);
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 69fa68ddb42..26c7958d93c 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -144,7 +144,7 @@ static outf_p output_files;
corresponding gt-<plugin>.h are generated in the current
directory. */
static char** plugin_files;
-static int nb_plugin_files;
+static size_t nb_plugin_files;
/* The output header file that is included into pretty much every
source file. */
@@ -464,7 +464,7 @@ read_input_list (const char *listname)
/* Add the plugin files if provided. */
if (plugin_files)
{
- int i;
+ size_t i;
for (i = 0; i < nb_plugin_files; i++)
gt_files[nfiles++] = plugin_files[i];
}
@@ -1716,7 +1716,8 @@ get_output_file_with_visibility (const char *input_file)
plugin_files. */
if (plugin_files && nb_plugin_files > 0)
{
- int ix= -1, i;
+ int ix= -1;
+ size_t i;
for (i = 0; i < nb_plugin_files && ix < 0; i++)
if (strcmp (input_file, plugin_files[i]) == 0)
ix = i;
@@ -1794,6 +1795,32 @@ get_output_file_name (const char *input_file)
return NULL;
}
+/* Check if existing file is equal to the in memory buffer. */
+
+static bool
+is_file_equal (outf_p of)
+{
+ FILE *newfile = fopen (of->name, "r");
+ size_t i;
+ bool equal;
+ if (newfile == NULL)
+ return false;
+
+ equal = true;
+ for (i = 0; i < of->bufused; i++)
+ {
+ int ch;
+ ch = fgetc (newfile);
+ if (ch == EOF || ch != (unsigned char) of->buf[i])
+ {
+ equal = false;
+ break;
+ }
+ }
+ fclose (newfile);
+ return equal;
+}
+
/* Copy the output to its final destination,
but don't unnecessarily change modification times. */
@@ -1804,35 +1831,20 @@ close_output_files (void)
for (of = output_files; of; of = of->next)
{
- FILE * newfile;
- newfile = fopen (of->name, "r");
- if (newfile != NULL )
- {
- int no_write_p;
- size_t i;
-
- for (i = 0; i < of->bufused; i++)
- {
- int ch;
- ch = fgetc (newfile);
- if (ch == EOF || ch != (unsigned char) of->buf[i])
- break;
- }
- no_write_p = i == of->bufused && fgetc (newfile) == EOF;
- fclose (newfile);
-
- if (no_write_p)
- continue;
- }
-
- newfile = fopen (of->name, "w");
- if (newfile == NULL)
- fatal ("opening output file %s: %s", of->name, strerror (errno));
- if (fwrite (of->buf, 1, of->bufused, newfile) != of->bufused)
- fatal ("writing output file %s: %s", of->name, strerror (errno));
- if (fclose (newfile) != 0)
- fatal ("closing output file %s: %s", of->name, strerror (errno));
+ if (!is_file_equal(of))
+ {
+ FILE *newfile = fopen (of->name, "w");
+ if (newfile == NULL)
+ fatal ("opening output file %s: %s", of->name, strerror (errno));
+ if (fwrite (of->buf, 1, of->bufused, newfile) != of->bufused)
+ fatal ("writing output file %s: %s", of->name, strerror (errno));
+ if (fclose (newfile) != 0)
+ fatal ("closing output file %s: %s", of->name, strerror (errno));
+ }
+ free(of->buf);
+ of->buf = NULL;
+ of->bufused = of->buflength = 0;
}
}
@@ -1876,14 +1888,16 @@ static void write_func_for_structure
const struct write_types_data *wtd);
static void write_types_process_field
(type_p f, const struct walk_type_data *d);
-static void write_types (type_p structures,
+static void write_types (outf_p output_header,
+ type_p structures,
type_p param_structs,
const struct write_types_data *wtd);
static void write_types_local_process_field
(type_p f, const struct walk_type_data *d);
static void write_local_func_for_structure
(type_p orig_s, type_p s, type_p * param);
-static void write_local (type_p structures,
+static void write_local (outf_p output_header,
+ type_p structures,
type_p param_structs);
static void write_enum_defn (type_p structures, type_p param_structs);
static int contains_scalar_p (type_p t);
@@ -2698,12 +2712,12 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
/* Write out marker routines for STRUCTURES and PARAM_STRUCTS. */
static void
-write_types (type_p structures, type_p param_structs,
+write_types (outf_p output_header, type_p structures, type_p param_structs,
const struct write_types_data *wtd)
{
type_p s;
- oprintf (header_file, "\n/* %s*/\n", wtd->comment);
+ oprintf (output_header, "\n/* %s*/\n", wtd->comment);
for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO)
@@ -2714,13 +2728,13 @@ write_types (type_p structures, type_p param_structs,
&& s->u.s.line.file == NULL)
continue;
- oprintf (header_file, "#define gt_%s_", wtd->prefix);
- output_mangled_typename (header_file, s);
- oprintf (header_file, "(X) do { \\\n");
- oprintf (header_file,
+ oprintf (output_header, "#define gt_%s_", wtd->prefix);
+ output_mangled_typename (output_header, s);
+ oprintf (output_header, "(X) do { \\\n");
+ oprintf (output_header,
" if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix,
s->u.s.tag);
- oprintf (header_file,
+ oprintf (output_header,
" } while (0)\n");
for (opt = s->u.s.opt; opt; opt = opt->next)
@@ -2730,7 +2744,7 @@ write_types (type_p structures, type_p param_structs,
if (t->kind == TYPE_STRUCT
|| t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT)
- oprintf (header_file,
+ oprintf (output_header,
"#define gt_%sx_%s gt_%sx_%s\n",
wtd->prefix, s->u.s.tag, wtd->prefix, t->u.s.tag);
else
@@ -2742,7 +2756,7 @@ write_types (type_p structures, type_p param_structs,
continue;
/* Declare the marker procedure only once. */
- oprintf (header_file,
+ oprintf (output_header,
"extern void gt_%sx_%s (void *);\n",
wtd->prefix, s->u.s.tag);
@@ -2770,9 +2784,9 @@ write_types (type_p structures, type_p param_structs,
type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */
- oprintf (header_file, "extern void gt_%s_", wtd->prefix);
- output_mangled_typename (header_file, s);
- oprintf (header_file, " (void *);\n");
+ oprintf (output_header, "extern void gt_%s_", wtd->prefix);
+ output_mangled_typename (output_header, s);
+ oprintf (output_header, " (void *);\n");
if (stru->u.s.line.file == NULL)
{
@@ -2887,13 +2901,13 @@ write_local_func_for_structure (type_p orig_s, type_p s, type_p *param)
/* Write out local marker routines for STRUCTURES and PARAM_STRUCTS. */
static void
-write_local (type_p structures, type_p param_structs)
+write_local (outf_p output_header, type_p structures, type_p param_structs)
{
type_p s;
- if (!header_file)
+ if (!output_header)
return;
- oprintf (header_file, "\n/* Local pointer-walking routines. */\n");
+ oprintf (output_header, "\n/* Local pointer-walking routines. */\n");
for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO)
@@ -2911,11 +2925,11 @@ write_local (type_p structures, type_p param_structs)
|| t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT)
{
- oprintf (header_file, "#define gt_pch_p_");
- output_mangled_typename (header_file, s);
- oprintf (header_file, " gt_pch_p_");
- output_mangled_typename (header_file, t);
- oprintf (header_file, "\n");
+ oprintf (output_header, "#define gt_pch_p_");
+ output_mangled_typename (output_header, s);
+ oprintf (output_header, " gt_pch_p_");
+ output_mangled_typename (output_header, t);
+ oprintf (output_header, "\n");
}
else
error_at_line (&s->u.s.line,
@@ -2926,9 +2940,9 @@ write_local (type_p structures, type_p param_structs)
continue;
/* Declare the marker procedure only once. */
- oprintf (header_file, "extern void gt_pch_p_");
- output_mangled_typename (header_file, s);
- oprintf (header_file,
+ oprintf (output_header, "extern void gt_pch_p_");
+ output_mangled_typename (output_header, s);
+ oprintf (output_header,
"\n (void *, void *, gt_pointer_operator, void *);\n");
if (s->kind == TYPE_LANG_STRUCT)
@@ -2948,9 +2962,9 @@ write_local (type_p structures, type_p param_structs)
type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */
- oprintf (header_file, "extern void gt_pch_p_");
- output_mangled_typename (header_file, s);
- oprintf (header_file,
+ oprintf (output_header, "extern void gt_pch_p_");
+ output_mangled_typename (output_header, s);
+ oprintf (output_header,
"\n (void *, void *, gt_pointer_operator, void *);\n");
if (stru->u.s.line.file == NULL)
@@ -3644,8 +3658,17 @@ main (int argc, char **argv)
{
srcdir = argv[2];
inputlist = argv[3];
- plugin_files = argv+4;
nb_plugin_files = argc-4;
+ plugin_files = XCNEWVEC (char *, nb_plugin_files);
+ for (i = 0; i < nb_plugin_files; i++)
+ {
+ /* Place an all zero lang_bitmap before the plugin file
+ name. */
+ char *name = argv[i + 4];
+ int len = strlen(name) + 1 + sizeof (lang_bitmap);
+ plugin_files[i] = XCNEWVEC (char, len) + sizeof (lang_bitmap);
+ strcpy (plugin_files[i], name);
+ }
}
else if (argc == 3)
{
@@ -3689,13 +3712,20 @@ main (int argc, char **argv)
open_base_files ();
write_enum_defn (structures, param_structs);
- write_types (structures, param_structs, &ggc_wtd);
- write_types (structures, param_structs, &pch_wtd);
- write_local (structures, param_structs);
+ write_types (header_file, structures, param_structs, &ggc_wtd);
+ write_types (header_file, structures, param_structs, &pch_wtd);
+ write_local (header_file, structures, param_structs);
write_roots (variables);
write_rtx_next ();
close_output_files ();
+ if (plugin_files)
+ {
+ for (i = 0; i < nb_plugin_files; i++)
+ free (plugin_files[i] - sizeof (lang_bitmap));
+ free (plugin_files);
+ }
+
if (hit_error)
return 1;
return 0;
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index dc4fdeef02f..fa078adaa9a 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -157,8 +157,12 @@ extern tree lhd_make_node (enum tree_code);
#define LANG_HOOKS_GENERIC_TYPE_P hook_bool_const_tree_false
#define LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS hook_tree_const_tree_null
#define LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS hook_tree_const_tree_null
+#define LANG_HOOKS_FUNCTION_PARAMETER_PACK_P hook_bool_const_tree_false
#define LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS hook_tree_const_tree_null
#define LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P hook_bool_const_tree_false
+#define LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P \
+ hook_bool_tree_tree_false
+#define LANG_HOOKS_GET_GENERIC_FUNCTION_DECL hook_tree_const_tree_null
#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type
#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_const_tree
@@ -214,6 +218,8 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_GETDECLS, \
LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P, \
LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P, \
+ LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P, \
+ LANG_HOOKS_GET_GENERIC_FUNCTION_DECL, \
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
LANG_HOOKS_WRITE_GLOBALS, \
LANG_HOOKS_DECL_OK_FOR_SIBCALL, \
@@ -268,6 +274,7 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_FOR_TYPES_INITIALIZER, \
LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS, \
LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS, \
+ LANG_HOOKS_FUNCTION_PARAMETER_PACK_P, \
LANG_HOOKS_GIMPLIFY_EXPR, \
LANG_HOOKS_FOLD_OBJ_TYPE_REF, \
LANG_HOOKS_BUILTIN_FUNCTION, \
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 349a5d8d5a4..ab640403df7 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -172,6 +172,13 @@ struct lang_hooks_for_decls
of a generic type, e.g a template template parameter for the C++ FE. */
bool (*generic_generic_parameter_decl_p) (const_tree);
+ /* Determine if a function parameter got expanded from a
+ function parameter pack. */
+ bool (*function_parm_expanded_from_pack_p) (tree, tree);
+
+ /* Returns the generic declaration of a generic function instantiations. */
+ tree (*get_generic_function_decl) (const_tree);
+
/* Returns true when we should warn for an unused global DECL.
We will already have checked that it has static binding. */
bool (*warn_unused_global) (const_tree);
@@ -379,7 +386,7 @@ struct lang_hooks
struct lang_hooks_for_types types;
- /* Retuns the generic parameters of an instantiation of
+ /* Returns the generic parameters of an instantiation of
a generic type or decl, e.g. C++ template instantiation. */
tree (*get_innermost_generic_parms) (const_tree);
@@ -387,6 +394,9 @@ struct lang_hooks
of a generic type of decl, e.g. C++ template instantiation. */
tree (*get_innermost_generic_args) (const_tree);
+ /* Determine if a tree is a function parameter pack. */
+ bool (*function_parameter_pack_p) (const_tree);
+
/* Perform language-specific gimplification on the argument. Returns an
enum gimplify_status, though we can't see that type here. */
int (*gimplify_expr) (tree *, gimple_seq *, gimple_seq *);
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 4097d3eefb0..d6816d0b6e8 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -2049,6 +2049,8 @@ __enable_execute_stack (void *addr __attribute__((__unused__)))
/* Jump to a trampoline, loading the static chain address. */
#if defined(WINNT) && ! defined(__CYGWIN__)
+int getpagesize (void);
+int mprotect (char *,int, int);
int
getpagesize (void)
diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog
index 9acf08b3e4d..97eba617e11 100644
--- a/gcc/objcp/ChangeLog
+++ b/gcc/objcp/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR objc++/41430
+ * Make-lang.in (objcp-lang.o): Add $(EXCEPT_H) dependency.
+ * objcp-lang.c (LANG_HOOKS_EH_PERSONALITY): Define.
+ (LANG_HOOKS_EH_RUNTIME_TYPE): Likewise.
+ (objcxx_eh_personality): New function.
+
2009-09-03 Diego Novillo <dnovillo@google.com>
* objcp-lang.c (lang_hooks): Remove const qualifier.
diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in
index 0f549d07a41..09af104f0a6 100644
--- a/gcc/objcp/Make-lang.in
+++ b/gcc/objcp/Make-lang.in
@@ -72,7 +72,7 @@ cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS)
objcp/objcp-lang.o : objcp/objcp-lang.c \
$(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h objc/objc-act.h \
$(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objcp.h \
- $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(GIMPLE_H)
+ $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(GIMPLE_H) $(EXCEPT_H)
objcp/objcp-decl.o : objcp/objcp-decl.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
diff --git a/gcc/objcp/objcp-lang.c b/gcc/objcp/objcp-lang.c
index 1b54ba81754..47bff9ab2ff 100644
--- a/gcc/objcp/objcp-lang.c
+++ b/gcc/objcp/objcp-lang.c
@@ -33,9 +33,11 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "debug.h"
#include "cp-objcp-common.h"
+#include "except.h"
enum c_language_kind c_language = clk_objcxx;
static void objcxx_init_ts (void);
+static tree objcxx_eh_personality (void);
/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h;
consequently, there should be very few hooks below. */
@@ -50,6 +52,10 @@ static void objcxx_init_ts (void);
#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS objcxx_init_ts
+#undef LANG_HOOKS_EH_PERSONALITY
+#define LANG_HOOKS_EH_PERSONALITY objcxx_eh_personality
+#undef LANG_HOOKS_EH_RUNTIME_TYPE
+#define LANG_HOOKS_EH_RUNTIME_TYPE build_eh_type_type
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -138,6 +144,20 @@ objcxx_init_ts (void)
init_shadowed_var_for_decl ();
}
+static GTY(()) tree objcp_eh_personality_decl;
+
+static tree
+objcxx_eh_personality (void)
+{
+ if (!objcp_eh_personality_decl)
+ objcp_eh_personality_decl
+ = build_personality_function (USING_SJLJ_EXCEPTIONS
+ ? "__gxx_personality_sj0"
+ : "__gxx_personality_v0");
+
+ return objcp_eh_personality_decl;
+}
+
void
finish_file (void)
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 1d66769a1f7..f4b74d95ffc 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -381,8 +381,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fputs (" autoinline", file);
if (code == FUNCTION_DECL && DECL_BUILT_IN (node))
fputs (" built-in", file);
- if (code == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
- fputs (" no-static-chain", file);
+ if (code == FUNCTION_DECL && DECL_STATIC_CHAIN (node))
+ fputs (" static-chain", file);
if (code == FIELD_DECL && DECL_PACKED (node))
fputs (" packed", file);
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 984913a5fc1..5581cd66083 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1241,39 +1241,54 @@ reload (rtx first, int global)
{
rtx reg = regno_reg_rtx[i];
rtx equiv = 0;
- df_ref use;
+ df_ref use, next;
if (reg_equiv_constant[i])
equiv = reg_equiv_constant[i];
else if (reg_equiv_invariant[i])
equiv = reg_equiv_invariant[i];
else if (reg && MEM_P (reg))
- {
- equiv = targetm.delegitimize_address (reg);
- if (equiv == reg)
- equiv = 0;
- }
+ equiv = targetm.delegitimize_address (reg);
else if (reg && REG_P (reg) && (int)REGNO (reg) != i)
equiv = reg;
- if (equiv)
- for (use = DF_REG_USE_CHAIN (i); use;
- use = DF_REF_NEXT_REG (use))
- if (DEBUG_INSN_P (DF_REF_INSN (use)))
+ if (equiv == reg)
+ continue;
+
+ for (use = DF_REG_USE_CHAIN (i); use; use = next)
+ {
+ rtx *loc = DF_REF_LOC (use);
+ rtx x = *loc;
+
+ insn = DF_REF_INSN (use);
+ next = DF_REF_NEXT_REG (use);
+
+ if (DEBUG_INSN_P (insn))
{
- rtx *loc = DF_REF_LOC (use);
- rtx x = *loc;
-
- if (x == reg)
- *loc = copy_rtx (equiv);
- else if (GET_CODE (x) == SUBREG
- && SUBREG_REG (x) == reg)
- *loc = simplify_gen_subreg (GET_MODE (x), equiv,
- GET_MODE (reg),
- SUBREG_BYTE (x));
+ gcc_assert (x == reg
+ || (GET_CODE (x) == SUBREG
+ && SUBREG_REG (x) == reg));
+
+ if (!equiv)
+ {
+ INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC ();
+ df_insn_rescan_debug_internal (insn);
+ }
else
- gcc_unreachable ();
+ {
+ if (x == reg)
+ *loc = copy_rtx (equiv);
+ else if (GET_CODE (x) == SUBREG
+ && SUBREG_REG (x) == reg)
+ *loc = simplify_gen_subreg (GET_MODE (x), equiv,
+ GET_MODE (reg),
+ SUBREG_BYTE (x));
+ else
+ gcc_unreachable ();
+ *loc = wrap_constant (GET_MODE (x), *loc);
+ }
}
+ }
}
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 925246f787b..d415ba483f3 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2024,8 +2024,6 @@ extern GTY(()) rtx global_rtl[GR_MAX];
#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
extern GTY(()) rtx pic_offset_table_rtx;
-extern GTY(()) rtx static_chain_rtx;
-extern GTY(()) rtx static_chain_incoming_rtx;
extern GTY(()) rtx return_address_pointer_rtx;
/* Include the RTL generation functions. */
diff --git a/gcc/stmt.c b/gcc/stmt.c
index ffd180ec112..d2583ca5458 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1799,13 +1799,17 @@ expand_return (tree retval)
static void
expand_nl_goto_receiver (void)
{
+ rtx chain;
+
/* Clobber the FP when we get here, so we have to make sure it's
marked as used by this function. */
emit_use (hard_frame_pointer_rtx);
/* Mark the static chain as clobbered here so life information
doesn't get messed up for it. */
- emit_clobber (static_chain_rtx);
+ chain = targetm.calls.static_chain (current_function_decl, true);
+ if (chain && REG_P (chain))
+ emit_clobber (chain);
#ifdef HAVE_nonlocal_goto
if (! HAVE_nonlocal_goto)
diff --git a/gcc/system.h b/gcc/system.h
index 1b36ddf389a..0c846cfbdd6 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -707,7 +707,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN \
FUNCTION_ARG_PARTIAL_NREGS ASM_OUTPUT_DWARF_DTPREL \
ALLOCATE_INITIAL_VALUE LEGITIMIZE_ADDRESS FRAME_POINTER_REQUIRED \
- CAN_ELIMINATE
+ CAN_ELIMINATE TRAMPOLINE_TEMPLATE INITIALIZE_TRAMPOLINE \
+ TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 728e018f71d..45b7ab7430e 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -247,6 +247,8 @@
#define TARGET_ASM_RECORD_GCC_SWITCHES_SECTION ".GCC.command.line"
#endif
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE NULL
+
#define TARGET_ASM_ALIGNED_INT_OP \
{TARGET_ASM_ALIGNED_HI_OP, \
TARGET_ASM_ALIGNED_SI_OP, \
@@ -296,7 +298,8 @@
TARGET_ASM_RECORD_GCC_SWITCHES_SECTION, \
TARGET_ASM_OUTPUT_ANCHOR, \
TARGET_ASM_OUTPUT_DWARF_DTPREL, \
- TARGET_ASM_FINAL_POSTSCAN_INSN}
+ TARGET_ASM_FINAL_POSTSCAN_INSN, \
+ TARGET_ASM_TRAMPOLINE_TEMPLATE }
/* Scheduler hooks. All of these default to null pointers, which
haifa-sched.c looks for and handles. */
@@ -607,6 +610,9 @@
#define TARGET_UPDATE_STACK_BOUNDARY NULL
#define TARGET_GET_DRAP_RTX NULL
#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS hook_bool_void_true
+#define TARGET_STATIC_CHAIN default_static_chain
+#define TARGET_TRAMPOLINE_INIT default_trampoline_init
+#define TARGET_TRAMPOLINE_ADJUST_ADDRESS NULL
#define TARGET_CALLS { \
TARGET_PROMOTE_FUNCTION_MODE, \
@@ -629,7 +635,10 @@
TARGET_INTERNAL_ARG_POINTER, \
TARGET_UPDATE_STACK_BOUNDARY, \
TARGET_GET_DRAP_RTX, \
- TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS \
+ TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS, \
+ TARGET_STATIC_CHAIN, \
+ TARGET_TRAMPOLINE_INIT, \
+ TARGET_TRAMPOLINE_ADJUST_ADDRESS \
}
#ifndef TARGET_UNWIND_TABLES_DEFAULT
diff --git a/gcc/target.h b/gcc/target.h
index c57b683a4fc..f964b6975f8 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -253,6 +253,9 @@ struct gcc_target
/* Some target machines need to postscan each insn after it is output. */
void (*final_postscan_insn) (FILE *, rtx, rtx *, int);
+
+ /* Emit the trampoline template. This hook may be NULL. */
+ void (*trampoline_template) (FILE *);
} asm_out;
/* Functions relating to instruction scheduling. */
@@ -915,7 +918,17 @@ struct gcc_target
/* Return true if all function parameters should be spilled to the
stack. */
bool (*allocate_stack_slots_for_args) (void);
-
+
+ /* Return an rtx for the static chain for FNDECL. If INCOMING_P is true,
+ then it should be for the callee; otherwise for the caller. */
+ rtx (*static_chain) (const_tree fndecl, bool incoming_p);
+
+ /* Fill in the trampoline at MEM with a call to FNDECL and a
+ static chain value of CHAIN. */
+ void (*trampoline_init) (rtx mem, tree fndecl, rtx chain);
+
+ /* Adjust the address of the trampoline in a target-specific way. */
+ rtx (*trampoline_adjust_address) (rtx addr);
} calls;
/* Return the diagnostic message string if conversion from FROMTYPE
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 8480c0b833f..dd52da98638 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -628,6 +628,44 @@ default_internal_arg_pointer (void)
return virtual_incoming_args_rtx;
}
+rtx
+default_static_chain (const_tree fndecl, bool incoming_p)
+{
+ if (!DECL_STATIC_CHAIN (fndecl))
+ return NULL;
+
+ if (incoming_p)
+ {
+#ifdef STATIC_CHAIN_INCOMING_REGNUM
+ return gen_rtx_REG (Pmode, STATIC_CHAIN_INCOMING_REGNUM);
+#endif
+ }
+
+#ifdef STATIC_CHAIN_REGNUM
+ return gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
+#endif
+
+ {
+ static bool issued_error;
+ if (!issued_error)
+ {
+ issued_error = true;
+ sorry ("nested functions not supported on this target");
+ }
+
+ /* It really doesn't matter what we return here, so long at it
+ doesn't cause the rest of the compiler to crash. */
+ return gen_rtx_MEM (Pmode, stack_pointer_rtx);
+ }
+}
+
+void
+default_trampoline_init (rtx ARG_UNUSED (m_tramp), tree ARG_UNUSED (t_func),
+ rtx ARG_UNUSED (r_chain))
+{
+ sorry ("nested function trampolines not supported on this target");
+}
+
enum reg_class
default_branch_target_register_class (void)
{
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 7a9355292ae..490d4ceeb91 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -100,6 +100,8 @@ extern bool hook_bool_const_rtx_commutative_p (const_rtx, int);
extern rtx default_function_value (const_tree, const_tree, bool);
extern rtx default_libcall_value (enum machine_mode, rtx);
extern rtx default_internal_arg_pointer (void);
+extern rtx default_static_chain (const_tree, bool);
+extern void default_trampoline_init (rtx, tree, rtx);
extern enum reg_class default_branch_target_register_class (void);
#ifdef IRA_COVER_CLASSES
extern const enum reg_class *default_ira_cover_classes (void);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8bf9349fd73..3ad55f87bdd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,152 @@
+2009-09-25 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41463
+ * gcc.c-torture/execute/pr41463.c: New testcase.
+
+2009-09-25 Olivier Hainque <hainque@adacore.com>
+
+ * gnat.dg/sse_nolib.adb: New testcase.
+
+2009-09-25 Revital Eres <ERES@il.ibm.com>
+
+ * gcc.target/powerpc/vsx-vectorize-8.c: New test.
+ * gcc.target/powerpc/vsx-vectorize-1.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-2.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-3.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-5.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-6.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
+ * gcc.dg/vect/vect.exp: Add Power7 flags.
+ * g++.dg/vect/vect.exp: Likewise.
+ * gfortran.dg/vect/vect.exp: Likewise.
+
+2009-09-24 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/41459
+ * gfortran.dg/empty_label.f: New test.
+ * gfortran.dg/empty_label.f90: Ditto.
+ * gfortran.dg/warnings_are_errors_1.f: Fix to emit a single warning.
+
+2009-09-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/torture/builtin-math-7.c: Test complex int division at
+ compile-time.
+
+2009-09-24 Adam Nemet <anemet@caviumnetworks.com>
+
+ * lib/scanasm.exp (make_pattern_printable): New function.
+ (dg-scan, scan-assembler-times, scan-assembler-dem,
+ scan-assembler-dem-not): Use it.
+
+2009-09-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/pr12329.c (dg-do): Changed to run.
+ (test_nested): Renamed to ...
+ (test_nested1): This.
+ (test_nested2): New.
+ (main): Likewise.
+
+2009-09-24 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36143
+ PR tree-optimization/38747
+ * gcc.dg/tree-ssa/fre-vce-1.c: XFAIL.
+ * gcc.dg/tree-ssa/forwprop-6.c: Likewise.
+ * g++.dg/torture/pr38747.C: New testcase.
+ * g++.dg/tree-ssa/pr19637.C: Un-XFAIL.
+
+2009-09-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/nested_proc.adb: New test.
+
+2009-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.target/i386/pr12329.c: Adjust.
+
+2009-09-23 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41248
+ * gcc.dg/pr41248.c: New.
+
+2009-09-23 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/41065
+ * gcc.dg/debug/dwarf2/global-used-types.c: New test.
+
+2009-09-23 Andreas Schwab <schwab@redhat.com>
+
+ * lib/profopt.exp (profopt-get-options): Set tool_flags for
+ current_compiler_flags. Fix typos.
+
+2009-09-23 Yuri Gribov <tetra2005@googlemail.com>
+
+ * gcc.c-torture/execute/980526-2.c: Skip if sizeof (int) > 4.
+
+2009-09-23 Uros Bizjak <ubizjak@gmail.com>
+
+ PR c/39779
+ * gcc.c-torture/compile/pr39779.c: New test.
+
+2009-09-22 Dodji Seketeli <dodji@redhat.com>
+
+ * g++.dg/debug/dwarf2/template-func-params-4.C: Adjust.
+ * g++.dg/debug/dwarf2/template-func-params-7.C: Likewise.
+ * g++.dg/debug/dwarf2/template-params-4.C: Likewise.
+
+2009-09-22 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41295
+ * gcc.dg/pr41295.c: New.
+
+2009-09-22 Neil Vachharajani <nvachhar@google.com>
+
+ * gcc.dg/pr40209.c: Add test case.
+
+2009-09-22 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/code-readable-1.c: Change \. to \\. when
+ matching assembly.
+ * gcc.target/mips/code-readable-2.c: Likewise.
+ * gcc.target/mips/code-readable-3.c: Likewise.
+
+2009-09-22 Janis Johnson <janis187@us.ibm.com>
+
+ * lib/target-supports.exp (check_effective_target_dfp_nocache):
+ Check support via mode instead of C type.
+ (check_effective_target_dfprt_nocache): Ditto.
+ (check_effective_target_hard_dfp): Ditto.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41395
+ * gcc.c-torture/execute/pr41395-1.c: New testcase.
+ * gcc.c-torture/execute/pr41395-2.c: Likewise.
+
+2009-09-22 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20090922-1.c: New test.
+
+ PR bootstrap/41405
+ * gfortran.dg/debug/pr37738.f: Add -gno-strict-dwarf to dg-options.
+ * gfortran.dg/debug/pr35154-dwarf2.f: Likewise.
+ * g++.dg/debug/dwarf2/explicit-constructor.C: Likewise.
+ * g++.dg/debug/dwarf2/imported-module-2.C: Likewise.
+ * g++.dg/debug/dwarf2/imported-module-3.C: Likewise.
+ * g++.dg/debug/dwarf2/imported-module-4.C: Likewise.
+ * g++.dg/debug/dwarf2/namespace-1.C: Likewise.
+ * objc.dg/dwarf-2.m: Likewise.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41428
+ * g++.dg/tree-ssa/pr41428.C: New testcase.
+
+2009-09-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/41429
+ * g++.dg/gomp/pr41429.C: New test.
+
2009-09-21 Giuseppe Scrivano <gscrivano@gnu.org>
* gcc.dg/tree-ssa/tailrecursion-6.c: New file.
@@ -83,9 +232,12 @@
2009-09-18 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/nolinkage1{.C,.h,a.cc}: New.
-
* g++.dg/cpp0x/initlist-deduce.C: New.
+2009-09-18 Neil Vachharajani <nvachhar@google.com>
+
+ * gcc.dg/tree-prof/val-prof-7.c: Added test case.
+
2009-09-18 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/dfp/dfp.exp: Also run tests in c-c++-common/dfp.
@@ -265,28 +417,26 @@
2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
PR c++/39365
- * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
- using same_type_p.
- (convert_for_assignment): Likewise.
- * cvt.c (type_promotes_to): Likewise.
+ * g++.dg/expr/bool3.C: New test.
+ * g++.dg/expr/bool4.C: New test.
2009-09-17 Janis Johnson <janis187@us.ibm.com>
- * gcc/testsuite/gcc.dg/dfp/dfp-dbg.h: Define EXTERN.
- * gcc/testsuite/gcc.dg/dfp/signbit-2.c: Use it.
- * gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h: Change two
+ * gcc.dg/dfp/dfp-dbg.h: Define EXTERN.
+ * gcc.dg/dfp/signbit-2.c: Use it.
+ * gcc.dg/dfp/func-vararg-alternate.h: Change two
arguments to unsigned int.
- * gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c: Don't include float.h.
- * gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c: Include dfp-dbg.h.
- * gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c: Ditto
- * gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c: Ditto.
- * gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c: Ditto.
- * gcc/testsuite/gcc.dg/dfp/pr39986.c: Ditto.
- * gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c: Ditto.
- * gcc/testsuite/gcc.dg/dfp/pr31385.c: Use mode in typedef, not C type.
- * gcc/testsuite/gcc.dg/dfp/pr35620.c: Define typedef for C++.
- * gcc/testsuite/gcc.dg/dfp/convert-int.c: Define BOOL for C++.
- * gcc/testsuite/gcc.dg/dfp/convert-int-fold.c: Ditto.
+ * gcc.dg/dfp/convert-bfp-10.c: Don't include float.h.
+ * gcc.dg/dfp/convert-bfp-fold.c: Include dfp-dbg.h.
+ * gcc.dg/dfp/convert-dfp-fold.c: Ditto
+ * gcc.dg/dfp/convert-int-max-fold.c: Ditto.
+ * gcc.dg/dfp/operator-arith-fold.c: Ditto.
+ * gcc.dg/dfp/pr39986.c: Ditto.
+ * gcc.dg/dfp/usual-arith-conv-const.c: Ditto.
+ * gcc.dg/dfp/pr31385.c: Use mode in typedef, not C type.
+ * gcc.dg/dfp/pr35620.c: Define typedef for C++.
+ * gcc.dg/dfp/convert-int.c: Define BOOL for C++.
+ * gcc.dg/dfp/convert-int-fold.c: Ditto.
2009-09-17 Jakub Jelinek <jakub@redhat.com>
@@ -760,20 +910,20 @@
2009-09-03 Alon Dayan <alond@il.ibm.com>
PR tree-optimization/38275
- * testsuite/gcc.dg/autopar/reduc-1char.c: Increase number
+ * gcc.dg/autopar/reduc-1char.c: Increase number
of iterations. Adjust the logic accordingly.
- * testsuite/gcc.dg/autopar/reduc-2char.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-1.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-2.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-3.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-6.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-7.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-8.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-9.c: Ditto.
- * testsuite/gcc.dg/autopar/pr39500-1.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-1short.c: Ditto.
- * testsuite/gcc.dg/autopar/reduc-2short.c: Ditto.
- * testsuite/gcc.dg/autopar/parallelization-1.c: Ditto.
+ * gcc.dg/autopar/reduc-2char.c: Ditto.
+ * gcc.dg/autopar/reduc-1.c: Ditto.
+ * gcc.dg/autopar/reduc-2.c: Ditto.
+ * gcc.dg/autopar/reduc-3.c: Ditto.
+ * gcc.dg/autopar/reduc-6.c: Ditto.
+ * gcc.dg/autopar/reduc-7.c: Ditto.
+ * gcc.dg/autopar/reduc-8.c: Ditto.
+ * gcc.dg/autopar/reduc-9.c: Ditto.
+ * gcc.dg/autopar/pr39500-1.c: Ditto.
+ * gcc.dg/autopar/reduc-1short.c: Ditto.
+ * gcc.dg/autopar/reduc-2short.c: Ditto.
+ * gcc.dg/autopar/parallelization-1.c: Ditto.
2009-09-03 Jakub Jelinek <jakub@redhat.com>
@@ -1400,6 +1550,15 @@
PR middle-end/40980
* gfortran.dg/graphite/id-17.f: New.
+2009-08-12 Konrad Trifunovic <konrad.trifunovic@gmail.com>
+ Sebastian Pop <sebastian.pop@amd.com>
+
+ * gcc.dg/graphite/interchange-1.c: XFAILed.
+ * gcc.dg/graphite/interchange-2.c: XFAILed.
+ * gcc.dg/graphite/interchange-3.c: XFAILed.
+ * gcc.dg/graphite/interchange-4.c: XFAILed.
+ * gcc.dg/graphite/interchange-7.c: XFAILed.
+
2009-08-12 Sebastian Pop <sebastian.pop@amd.com>
* gcc.dg/graphite/interchange-6.c: Un-XFAIL.
@@ -3893,6 +4052,11 @@
PR middle-end/40328
* gcc.dg/torture/pr40328.c: New testcase.
+2009-06-03 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * gcc.dg/falign-labels.c (dg-options): Don't restrict for
+ m68k and fido.
+
2009-06-03 Martin Jambor <mjambor@suse.cz>
* g++.dg/torture/pr40323.C: New file.
@@ -6352,6 +6516,12 @@
PR fortran/37614
* gfortran.dg/common_align_2.f90: New test.
+2009-04-04 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/39501
+ * gcc.c-torture/execute/pr39501.c: New file.
+ * gcc.c-torture/execute/pr39501.x: New file.
+
2009-04-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/8781
@@ -7937,6 +8107,10 @@
PR c/35435
* gcc.dg/tls/diag-6.c: New test.
+2009-02-04 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * gcc.dg/graphite/scop-19.c: New
+
2009-02-04 H.J. Lu <hongjiu.lu@intel.com>
AVX Programming Reference (January, 2009)
@@ -8659,6 +8833,11 @@
* gnat.dg/unchecked_convert3.adb: New test.
+2009-01-12 Tomas Bily <tbily@suse.cz>
+
+ PR middlend/38385
+ * gcc.dg/tree-ssa/pr38385.c: New file.
+
2009-01-12 Jakub Jelinek <jakub@redhat.com>
PR c++/38794
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C b/gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C
index 42fd26455f9..32d205d207f 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++
// { dg-do compile }
-// { dg-options "-O -g -dA" }
+// { dg-options "-O -g -dA -gno-strict-dwarf" }
// { dg-final { scan-assembler-times "DW_AT_explicit" 2 } }
struct Foo
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C
new file mode 100644
index 00000000000..bad08ed5e51
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C
@@ -0,0 +1,13 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// { dg-options "-g -dA -fno-merge-debug-strings" }
+// { dg-do compile }
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumeration_type" 1 } }
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumerator" 2 } }
+// { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+.*?DW_AT_name" 1 } }
+// { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+.*?DW_AT_name" 1 } }
+
+struct foo
+{
+ enum { a, b };
+};
+char s[foo::b];
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
index 9a4821ab54a..65141d74edb 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR debug/38390
// { dg-do compile }
-// { dg-options "-g -dA" }
+// { dg-options "-g -dA -gno-strict-dwarf" }
// { dg-final { scan-assembler "DW_TAG_imported_module" } }
namespace A
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
index 9559bcb4ce2..6c563752a49 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
@@ -1,6 +1,6 @@
// PR debug/39379
// { dg-do compile }
-// { dg-options "-g -dA" }
+// { dg-options "-g -dA -gno-strict-dwarf" }
// { dg-final { scan-assembler "DW_TAG_imported_module" } }
namespace A
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
index 7ac6bab498d..a325ce20f63 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
@@ -1,6 +1,6 @@
// PR debug/39379
// { dg-do compile }
-// { dg-options "-g -dA" }
+// { dg-options "-g -dA -gno-strict-dwarf" }
// { dg-final { scan-assembler "DW_TAG_imported_module" } }
namespace A
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C
index d3f26f11222..9b00453985a 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/41170
-// { dg-options "-g -dA -fno-merge-debug-strings" }
+// { dg-options "-g -dA -fno-merge-debug-strings -gno-strict-dwarf" }
//
// We want to test that there is a DW_TAG_namespace DIE DW_AT_name is set
// to "not_emitted". That namespace die has a child DW_TAG_typedef DIE
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C
index 0eb0fe5f138..f75d0e66999 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C
@@ -1,10 +1,16 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
// { dg-options "-std=c++0x -g -dA" }
-// { dg-final { scan-assembler "DW_TAG_template_type_param" } }
-// { dg-final { scan-assembler "DW_AT_name.*P#0" } }
-// { dg-final { scan-assembler "DW_AT_name.*P#1" } }
-// { dg-final { scan-assembler "DW_AT_name.*P#2" } }
+//
+// In theory the compiler instantiates count<int, char, long>,
+// count<char, long> and count<long>. In practice, only
+// count<int, char, long> is emitted, thanks to constant folding.
+// So in theory, each of the 3 instances of count yields a
+// DW_TAG_tempalate_parameter_pack DIE, but in practise, there is only one
+// DW_TAG_template_parameter_pack as there is only count<int, char, long>
+// is emitted.
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_parameter_pack" 1} }
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_type_param" 3} }
template <typename... Args> struct count;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C b/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
index dc6ac990313..8a883f832ff 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
@@ -16,17 +16,15 @@
// { dg-final {scan-assembler-times "\"printf.0\".*?DW_AT_name" 1 } }
// printf<int, char, int> and printf<char, int> have a pack expansion as
-// function parameters. In the former, the elements of the parameter pack
-// expansion are PackTypes#0, PackTypes#1 and the arguments are args#0 and
-// args#1. In the later, the element of the parameter pack expansion
-// is PackTypes#0 and the argument is args#0.
-// { dg-final {scan-assembler-times "DW_AT_name: \"PackTypes#0\"" 2 } }
-// { dg-final {scan-assembler-times "\"args#0.0\".*?DW_AT_name" 2 } }
-// { dg-final {scan-assembler-times "\"PackTypes#1.0\".*?DW_AT_name" 1 } }
-// { dg-final {scan-assembler-times "\"args#1.0\".*?DW_AT_name" 1 } }
-
+// function parameters. There should then be 3
+// DW_TAG_template_parameter_pack and 3 DW_TAG_formal_parameter_pack DIEs
+// { dg-final {scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_parameter_pack" 3 } }
+// { dg-final {scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_formal_parameter_pack" 3 } }
+// These 3 function template instantiations has a total of 3 template
+// parameters named T.
// { dg_final {scan-assembler-times "\.ascii \"T.0\"\[\t \]+.*?DW_AT_name" 3 } }
+
void
printf(const char* s)
{
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C
index 09d1d95de6b..e83ef61e060 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C
@@ -1,10 +1,16 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
// { dg-options "-std=c++0x -g -dA" }
-// { dg-final { scan-assembler "DW_TAG_template_type_param" } }
-// { dg-final { scan-assembler "DW_AT_name.*Args#0" } }
-// { dg-final { scan-assembler "DW_AT_name.*Args#1" } }
-// { dg-final { scan-assembler "DW_AT_name.*Args#2" } }
+//
+// In theory the compiler instantiates count<int, char, long>,
+// count<char, long> and count<long>. In practice, only
+// count<int, char, long> is emitted, thanks to constant folding.
+// So in theory, each of the 3 instances of count yields a
+// DW_TAG_tempalate_parameter_pack DIE, but in practise, there is only one
+// DW_TAG_template_parameter_pack as there is only count<int, char, long>
+// is emitted.
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_parameter_pack" 1} }
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_type_param" 3} }
template <typename... Args> struct count;
diff --git a/gcc/testsuite/g++.dg/gomp/pr41429.C b/gcc/testsuite/g++.dg/gomp/pr41429.C
new file mode 100644
index 00000000000..7de41b846eb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr41429.C
@@ -0,0 +1,5 @@
+// PR middle-end/41429
+// { dg-do compile { target fpic } }
+// { dg-options "-fopenmp -O2 -fpic" }
+
+#include "pr37189.C"
diff --git a/gcc/testsuite/g++.dg/torture/pr38747.C b/gcc/testsuite/g++.dg/torture/pr38747.C
new file mode 100644
index 00000000000..0f18a2f225f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr38747.C
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+extern "C" void abort (void);
+inline void *operator new (__SIZE_TYPE__, void *__p) throw () { return __p; }
+
+int __attribute__((noinline))
+foo(void)
+{
+ float f = 0;
+ int *i = new (&f) int (1);
+ return *(int *)&f;
+}
+
+int main()
+{
+ if (foo() != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr19637.C b/gcc/testsuite/g++.dg/tree-ssa/pr19637.C
index cf70e404123..2d1dcceba42 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr19637.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr19637.C
@@ -29,6 +29,5 @@ int foo_void_offset(void)
return reinterpret_cast<Foo *>(&i[0])->i[0];
}
-/* Regarding the xfail, see PR36143. */
-/* { dg-final { scan-tree-dump-times "return 1;" 3 "dom1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "return 1;" 3 "dom1" } } */
/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr41428.C b/gcc/testsuite/g++.dg/tree-ssa/pr41428.C
new file mode 100644
index 00000000000..32716cad1c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr41428.C
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1-details" } */
+
+extern "C" void abort (void);
+inline void *operator new (__SIZE_TYPE__, void *__p) throw () { return __p; }
+
+int foo(void)
+{
+ float f = 0;
+ int *i = new (&f) int (1);
+ return *(int *)&f;
+}
+
+/* { dg-final { scan-tree-dump "Folded into: if \\\(1 != 0\\\)" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect/vect.exp
index 0688a70339c..b735c223334 100644
--- a/gcc/testsuite/g++.dg/vect/vect.exp
+++ b/gcc/testsuite/g++.dg/vect/vect.exp
@@ -59,6 +59,10 @@ if [istarget "powerpc-*paired*"] {
}
lappend DEFAULT_VECTCFLAGS "-maltivec"
+ if [check_vsx_hw_available] {
+ lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
+ }
+
if [check_vmx_hw_available] {
set dg-do-what-default run
} else {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39779.c b/gcc/testsuite/gcc.c-torture/compile/pr39779.c
new file mode 100644
index 00000000000..d1680df29b9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39779.c
@@ -0,0 +1,5 @@
+int test (char v1)
+{
+ v1 >>= 0xdebecced;
+ return v1;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/980526-2.c b/gcc/testsuite/gcc.c-torture/execute/980526-2.c
index 2547147176d..c17f4ea6df1 100644
--- a/gcc/testsuite/gcc.c-torture/execute/980526-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/980526-2.c
@@ -50,7 +50,7 @@ int sys_mknod(const char * filename, int mode, dev_t dev)
int main(void)
{
- if (sizeof (int) < 4)
+ if (sizeof (int) != 4)
exit (0);
return sys_mknod("test",1,0x12345678);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41395-1.c b/gcc/testsuite/gcc.c-torture/execute/pr41395-1.c
new file mode 100644
index 00000000000..e4df0e5d187
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41395-1.c
@@ -0,0 +1,28 @@
+struct VEC_char_base
+{
+ unsigned num;
+ unsigned alloc;
+ short vec[1];
+};
+
+short __attribute__((noinline))
+foo (struct VEC_char_base *p, int i)
+{
+ short *q;
+ p->vec[i] = 0;
+ q = &p->vec[8];
+ *q = 1;
+ return p->vec[i];
+}
+
+extern void abort (void);
+extern void *malloc (__SIZE_TYPE__);
+
+int
+main()
+{
+ struct VEC_char_base *p = malloc (sizeof (struct VEC_char_base) + 256);
+ if (foo (p, 8) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41395-2.c b/gcc/testsuite/gcc.c-torture/execute/pr41395-2.c
new file mode 100644
index 00000000000..c75e963613b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41395-2.c
@@ -0,0 +1,35 @@
+struct VEC_char_base
+{
+ unsigned num;
+ unsigned alloc;
+ union {
+ short vec[1];
+ struct {
+ int i;
+ int j;
+ int k;
+ } a;
+ } u;
+};
+
+short __attribute__((noinline))
+foo (struct VEC_char_base *p, int i)
+{
+ short *q;
+ p->u.vec[i] = 0;
+ q = &p->u.vec[16];
+ *q = 1;
+ return p->u.vec[i];
+}
+
+extern void abort (void);
+extern void *malloc (__SIZE_TYPE__);
+
+int
+main()
+{
+ struct VEC_char_base *p = malloc (sizeof (struct VEC_char_base) + 256);
+ if (foo (p, 16) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41463.c b/gcc/testsuite/gcc.c-torture/execute/pr41463.c
new file mode 100644
index 00000000000..c410fe0218b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41463.c
@@ -0,0 +1,56 @@
+#include <stdlib.h>
+
+union tree_node;
+
+struct tree_common
+{
+ int a;
+ long b;
+ long c;
+ void *p;
+ int d;
+};
+
+struct other_tree
+{
+ struct tree_common common;
+ int arr[14];
+};
+
+struct tree_vec
+{
+ struct tree_common common;
+ int length;
+ union tree_node *a[1];
+};
+
+union tree_node
+{
+ struct other_tree othr;
+ struct tree_vec vec;
+};
+
+union tree_node global;
+
+union tree_node * __attribute__((noinline))
+foo (union tree_node *p, int i)
+{
+ union tree_node **q;
+ p->vec.a[i] = (union tree_node *) 0;
+ q = &p->vec.a[1];
+ *q = &global;
+ return p->vec.a[i];
+}
+
+extern void abort (void);
+extern void *malloc (__SIZE_TYPE__);
+
+int
+main()
+{
+ union tree_node *p = malloc (sizeof (union tree_node));
+ if (foo (p, 1) != &global)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20090922-1.c b/gcc/testsuite/gcc.dg/20090922-1.c
new file mode 100644
index 00000000000..62045cbbd58
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20090922-1.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -funroll-loops -std=gnu99" } */
+
+struct S
+{
+ unsigned long s1;
+ int **s2;
+};
+struct T
+{
+ unsigned long t1, t2;
+};
+struct U
+{
+ int u1, u2;
+ unsigned long u3;
+};
+struct V
+{
+ int v1, v3;
+ struct T *v2;
+ struct U *v4;
+};
+struct W
+{
+ int w1;
+ struct V **w2;
+};
+struct S *foo1 (void);
+int *foo2 (void);
+
+void
+test (struct W *w)
+{
+ for (int i = 0; i < w->w1; i++)
+ {
+ struct V *v = w->w2[i];
+ struct S *t = foo1 ();
+ if (!t)
+ for (int j; j < v->v1;)
+ {
+ struct T *q = &v->v2[j];
+ t += (q->t2 - q->t1) * 45000L;
+ }
+ for (; v->v3;)
+ {
+ struct U *v4 = (struct U *) &v->v4;
+ if (v4->u1 && v4->u2 >= 0 && v4->u2)
+ {
+ int *s = foo2 ();
+ if (!s)
+ for (int k = 0; k <= v4->u2; k++)
+ {
+ struct T *q = &v->v2[k];
+ if (k == v4->u2)
+ v4->u3 += (q->t1) * 1000000;
+ }
+ t->s2[t->s1] = s;
+ }
+ }
+ int *s = foo2 ();
+ if (!t)
+ t->s2[t->s1] = s;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c b/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c
new file mode 100644
index 00000000000..1c2d40326d2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c
@@ -0,0 +1,14 @@
+/*
+ Contributed by Dodji Seketeli <dodji@redhat.com>
+ { dg-options "-g -dA -fno-merge-debug-strings" }
+ { dg-do compile }
+ { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumeration_type" 1 } }
+ { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumerator" 2 } }
+ { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+.*?DW_AT_name" 1 } }
+ { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+.*?DW_AT_name" 1 } }
+ */
+
+enum { a, b };
+
+int v = a;
+char s[b];
diff --git a/gcc/testsuite/gcc.dg/pr40209.c b/gcc/testsuite/gcc.dg/pr40209.c
new file mode 100644
index 00000000000..f367f7c2472
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr40209.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-use" } */
+
+void process(const char *s);
+
+struct BaseHolder {
+ unsigned int base_;
+};
+
+void UInt2Str(struct BaseHolder *b, unsigned int x) {
+ static const char digit[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+ char buf[100];
+ int i = 100;
+ do {
+ buf[--i] = digit[x % b->base_];
+ x /= b->base_;
+ } while (x > 0);
+ process(buf);
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*\.gcda not found, execution counts estimated.*" } */
diff --git a/gcc/testsuite/gcc.dg/pr41248.c b/gcc/testsuite/gcc.dg/pr41248.c
new file mode 100644
index 00000000000..0d5a74919ee
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41248.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+struct __gcov_var {
+ unsigned int offset;
+ unsigned int buffer[(1 << 10) + 1];
+} __gcov_var;
+unsigned int * gcov_write_words (unsigned int words) {
+ unsigned int *result;
+ result = &__gcov_var.buffer[__gcov_var.offset];
+ return result;
+}
+
+struct gcov_ctr_summary { };
+struct gcov_summary {
+ unsigned int checksum;
+ struct gcov_ctr_summary ctrs[1];
+};
+void __gcov_write_unsigned (unsigned int);
+void __gcov_write_summary (unsigned int tag,
+ const struct gcov_summary *summary)
+{
+ unsigned ix;
+ const struct gcov_ctr_summary *csum;
+ __gcov_write_unsigned (summary->checksum);
+ for (csum = summary->ctrs, ix = 1; ix--; csum++) { }
+}
diff --git a/gcc/testsuite/gcc.dg/pr41295.c b/gcc/testsuite/gcc.dg/pr41295.c
new file mode 100644
index 00000000000..fabff63c923
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41295.c
@@ -0,0 +1,91 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+
+enum reg_class
+{
+ BASE_REGS,
+ GENERAL_REGS,
+ LIM_REG_CLASSES
+};
+
+static __inline__ unsigned char
+hard_reg_set_subset_p (const unsigned long x[4], const unsigned long y[4])
+{
+ return ((x[0] & ~y[0]) == 0
+ && (x[1] & ~y[1]) == 0
+ && (x[2] & ~y[2]) == 0
+ && (x[3] & ~y[3]) == 0);
+}
+
+static __inline__ unsigned char
+hard_reg_set_equal_p (const unsigned long x[4], const unsigned long y[4])
+{
+ return x[0] == y[0]
+ && x[1] == y[1]
+ && x[2] == y[2]
+ && x[3] == y[3];
+}
+
+extern unsigned long reg_class_contents[(int) LIM_REG_CLASSES][4];
+extern int ira_important_classes_num;
+extern enum reg_class ira_important_classes[(int) LIM_REG_CLASSES];
+extern enum reg_class ira_reg_class_intersect[(int) LIM_REG_CLASSES][(int)
+ LIM_REG_CLASSES];
+extern unsigned char ira_reg_classes_intersect_p[(int) LIM_REG_CLASSES][(int)
+ LIM_REG_CLASSES];
+extern enum reg_class ira_reg_class_super_classes[(int) LIM_REG_CLASSES][(int)
+ LIM_REG_CLASSES];
+static unsigned long temp_hard_regset[4];
+
+static void
+setup_reg_class_relations (void)
+{
+ int i, cl1, cl2, cl3;
+ unsigned long temp_set2[4];
+ for (cl1 = 0; cl1 < (int) LIM_REG_CLASSES; cl1++)
+ {
+ ira_reg_class_super_classes[cl1][0] = LIM_REG_CLASSES;
+ for (cl2 = 0; cl2 < (int) LIM_REG_CLASSES; cl2++)
+ {
+ ira_reg_classes_intersect_p[cl1][cl2] = 0;
+ {
+ unsigned long *scan_tp_ = (temp_set2), *scan_fp_ =
+ (reg_class_contents[cl2]);
+ scan_tp_[1] = scan_fp_[1];
+ scan_tp_[2] = scan_fp_[2];
+ scan_tp_[3] = scan_fp_[3];
+ }
+ for (i = 0; i < ira_important_classes_num; i++)
+ {
+ cl3 = ira_important_classes[i];
+ {
+ unsigned long *scan_tp_ = (temp_hard_regset), *scan_fp_ =
+ (reg_class_contents[cl3]);
+ scan_tp_[0] = scan_fp_[0];
+ scan_tp_[1] = scan_fp_[1];
+ scan_tp_[3] = scan_fp_[3];
+ }
+ if (!hard_reg_set_subset_p (temp_hard_regset, temp_set2)
+ || (hard_reg_set_equal_p (temp_hard_regset, temp_set2)
+ && hard_reg_set_subset_p (reg_class_contents[cl3],
+ reg_class_contents[(int)
+ ira_reg_class_intersect
+ [cl1]
+ [cl2]])))
+ ira_reg_class_intersect[cl1][cl2] = (enum reg_class) cl3;
+ }
+ }
+ }
+}
+
+static void
+find_reg_class_closure (void)
+{
+ setup_reg_class_relations ();
+}
+
+void
+ira_init (void)
+{
+ find_reg_class_closure ();
+}
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-7.c b/gcc/testsuite/gcc.dg/torture/builtin-math-7.c
index 0d6307d653b..86fd2622ccf 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-math-7.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-math-7.c
@@ -62,12 +62,14 @@ int main()
TESTIT (double, 3.+4.i, *, 2, 6+8i);
TESTIT (double, 3.+4.i, /, 2, 1.5+2i);
TESTIT (int, 3+4i, *, 2, 6+8i);
- RUNTIME_TESTIT (int, 3+4i, /, 2, 1+2i);
+ TESTIT (int, 3+4i, /, 2, 1+2i);
TESTIT (double, 3.+4.i, *, 2+5i, -14+23i);
TESTIT (double, 3.+4.i, /, 5i, .8-.6i);
TESTIT (int, 3+4i, *, 2+5i, -14+23i);
- RUNTIME_TESTIT (int, 30+40i, /, 5i, 8-6i);
+ TESTIT (int, 30+40i, /, 5i, 8-6i);
+ TESTIT (int, 14+6i, /, 7+3i, 2);
+ TESTIT (int, 8+24i, /, 4+12i, 2);
/* Test that we don't overflow. */
TESTIT (double,
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
index 987f8a3909a..54e51097e4c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
@@ -17,6 +17,11 @@ void f(void)
}
/* We should be able to convert the cast to a VCE in forwprop1,
- even if there is an aliasing violation. */
-/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "forwprop1"} } */
+ even if there is an aliasing violation.
+ ??? While this would be useful and nice to our users in this
+ particular situation before doing this transformation we have to
+ assure that a is killed by a dominating store via type float for
+ it to be valid. Then we might as well handle the situation by
+ value-numbering, removing the load alltogether. */
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "forwprop1" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c b/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
index 2bc6da33235..340f56893ca 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
@@ -32,6 +32,7 @@ void a2 (struct s1 sv, int i)
}
/* { dg-final { scan-tree-dump-times "sv_\[0-9\]\\\(D\\\)->i" 2 "fre" } } */
-/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre" } } */
-
+/* We can't value-number *(float *)&sv.i as VIEW_CONVERT_EXPR of the
+ value of sv.i. */
+/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 54e7cb27968..6b544c28c6e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -51,6 +51,10 @@ if [istarget "powerpc-*paired*"] {
}
lappend DEFAULT_VECTCFLAGS "-maltivec"
+ if [check_vsx_hw_available] {
+ lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
+ }
+
if [check_vmx_hw_available] {
set dg-do-what-default run
} else {
diff --git a/gcc/testsuite/gcc.target/i386/pr12329.c b/gcc/testsuite/gcc.target/i386/pr12329.c
index 21d2c6580e2..601480c0283 100644
--- a/gcc/testsuite/gcc.target/i386/pr12329.c
+++ b/gcc/testsuite/gcc.target/i386/pr12329.c
@@ -1,15 +1,47 @@
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2" } */
extern void abort (void);
-int test_nested (int i)
+int test_nested1 (int i)
{
- int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l) /* { dg-error "nested functions are limited to 2 register parameters" } */
+ int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l)
{
return i + j + k + l;
}
return foo (i, i+1, i+2);
}
+
+int test_nested2 (int i)
+{
+ int x;
+
+ int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l)
+ {
+ return i + j + k + l;
+ }
+
+ x = foo (i+3, i+1, i+2);
+ if (x != (4*i + 6))
+ abort ();
+
+ return x;
+}
+
+int
+main ()
+{
+ int i = test_nested1 (3);
+
+ if (i != 15)
+ abort ();
+
+ i = test_nested2 (4);
+
+ if (i != 22)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/mips/code-readable-1.c b/gcc/testsuite/gcc.target/mips/code-readable-1.c
index ee239e1f85f..d9b6e65ea27 100644
--- a/gcc/testsuite/gcc.target/mips/code-readable-1.c
+++ b/gcc/testsuite/gcc.target/mips/code-readable-1.c
@@ -25,10 +25,10 @@ bar (void)
}
/* { dg-final { scan-assembler "\tla\t" } } */
-/* { dg-final { scan-assembler "\t\.half\t" } } */
+/* { dg-final { scan-assembler "\t\\.half\t" } } */
/* { dg-final { scan-assembler-not "%hi\\(\[^)\]*L" } } */
/* { dg-final { scan-assembler-not "%lo\\(\[^)\]*L" } } */
-/* { dg-final { scan-assembler "\t\.word\tk\n" } } */
+/* { dg-final { scan-assembler "\t\\.word\tk\n" } } */
/* { dg-final { scan-assembler-not "%hi\\(k\\)" } } */
/* { dg-final { scan-assembler-not "%lo\\(k\\)" } } */
diff --git a/gcc/testsuite/gcc.target/mips/code-readable-2.c b/gcc/testsuite/gcc.target/mips/code-readable-2.c
index 1aeecafe1c8..8b87ff6582c 100644
--- a/gcc/testsuite/gcc.target/mips/code-readable-2.c
+++ b/gcc/testsuite/gcc.target/mips/code-readable-2.c
@@ -25,10 +25,10 @@ bar (void)
}
/* { dg-final { scan-assembler-not "\tla\t" } } */
-/* { dg-final { scan-assembler-not "\t\.half\t" } } */
+/* { dg-final { scan-assembler-not "\t\\.half\t" } } */
/* { dg-final { scan-assembler "%hi\\(\[^)\]*L" } } */
/* { dg-final { scan-assembler "%lo\\(\[^)\]*L" } } */
-/* { dg-final { scan-assembler "\t\.word\tk\n" } } */
+/* { dg-final { scan-assembler "\t\\.word\tk\n" } } */
/* { dg-final { scan-assembler-not "%hi\\(k\\)" } } */
/* { dg-final { scan-assembler-not "%lo\\(k\\)" } } */
diff --git a/gcc/testsuite/gcc.target/mips/code-readable-3.c b/gcc/testsuite/gcc.target/mips/code-readable-3.c
index 21dc82be2b5..075ca8d1749 100644
--- a/gcc/testsuite/gcc.target/mips/code-readable-3.c
+++ b/gcc/testsuite/gcc.target/mips/code-readable-3.c
@@ -25,10 +25,10 @@ bar (void)
}
/* { dg-final { scan-assembler-not "\tla\t" } } */
-/* { dg-final { scan-assembler-not "\t\.half\t" } } */
+/* { dg-final { scan-assembler-not "\t\\.half\t" } } */
/* { dg-final { scan-assembler "%hi\\(\[^)\]*L" } } */
/* { dg-final { scan-assembler "%lo\\(\[^)\]*L" } } */
-/* { dg-final { scan-assembler-not "\t\.word\tk\n" } } */
+/* { dg-final { scan-assembler-not "\t\\.word\tk\n" } } */
/* { dg-final { scan-assembler "%hi\\(k\\)" } } */
/* { dg-final { scan-assembler "%lo\\(k\\)" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-1.c b/gcc/testsuite/gcc.target/vsx-vectorize-1.c
new file mode 100644
index 00000000000..2538ad987d2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-1.c
@@ -0,0 +1,54 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-align-1.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+/* Compile time known misalignment. Cannot use loop peeling to align
+ the store. */
+
+#define N 16
+
+struct foo {
+ char x;
+ int y[N];
+} __attribute__((packed));
+
+int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (struct foo * __restrict__ p)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ p->y[i] = x[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->y[i] != x[i])
+ abort ();
+ }
+ return 0;
+}
+
+
+int main (void)
+{
+ int i;
+ struct foo *p = malloc (2*sizeof (struct foo));
+
+ main1 (p);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-2.c b/gcc/testsuite/gcc.target/vsx-vectorize-2.c
new file mode 100644
index 00000000000..e558f413c92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-2.c
@@ -0,0 +1,64 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pd, float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ if (pd[i] != 5.0)
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, float * __restrict__ pd, float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ pd[i] = 5.0;
+ }
+
+ bar (pd,pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float d[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,&d[1],a,b,c);
+ main1 (N-2,&d[1],a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-3.c b/gcc/testsuite/gcc.target/vsx-vectorize-3.c
new file mode 100644
index 00000000000..b99bcca49f4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-3.c
@@ -0,0 +1,60 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (short *pa, short *pb, short *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, short * __restrict__ pa, short * __restrict__ pb, short * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ short a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ short b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ short c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,a,b,c);
+ main1 (N-2,a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-4.c b/gcc/testsuite/gcc.target/vsx-vectorize-4.c
new file mode 100644
index 00000000000..a3bd7e69674
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-4.c
@@ -0,0 +1,60 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (double *pa, double *pb, double *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, double * __restrict__ pa, double * __restrict__ pb, double * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ double a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,a,b,c);
+ main1 (N-2,a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-5.c b/gcc/testsuite/gcc.target/vsx-vectorize-5.c
new file mode 100644
index 00000000000..32d05b29829
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-5.c
@@ -0,0 +1,60 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (char *pa, char *pb, char *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] + pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, char * __restrict__ pa, char * __restrict__ pb, char * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] + pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ char a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ char b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ char c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,a,b,c);
+ main1 (N-2,a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-6.c b/gcc/testsuite/gcc.target/vsx-vectorize-6.c
new file mode 100644
index 00000000000..c46c8a74711
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-6.c
@@ -0,0 +1,64 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (double *pd, double *pa, double *pb, double *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ if (pd[i] != 5.0)
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, double * __restrict__ pd, double * __restrict__ pa, double * __restrict__ pb, double * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ pd[i] = 5.0;
+ }
+
+ bar (pd,pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ double a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ double d[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,&d[1],a,b,c);
+ main1 (N-2,&d[1],a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-7.c b/gcc/testsuite/gcc.target/vsx-vectorize-7.c
new file mode 100644
index 00000000000..3c57f937fc0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-7.c
@@ -0,0 +1,64 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (int *pd, int *pa, int *pb, int *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ if (pd[i] != 5.0)
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, int * __restrict__ pd, int * __restrict__ pa, int * __restrict__ pb, int * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ pd[i] = 5.0;
+ }
+
+ bar (pd,pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ int a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int d[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ int c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,&d[1],a,b,c);
+ main1 (N-2,&d[1],a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-8.c b/gcc/testsuite/gcc.target/vsx-vectorize-8.c
new file mode 100644
index 00000000000..af671ee79cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vsx-vectorize-8.c
@@ -0,0 +1,64 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Taken from vect/vect-95.c. */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (short *pd, short *pa, short *pb, short *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ if (pd[i] != 5.0)
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, short * __restrict__ pd, short * __restrict__ pa, short * __restrict__ pb, short * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ pd[i] = 5.0;
+ }
+
+ bar (pd,pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ short a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ short d[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ short b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ short c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ main1 (N,&d[1],a,b,c);
+ main1 (N-2,&d[1],a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
index bfd215d9736..40c13a4a1e2 100644
--- a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
@@ -2,7 +2,7 @@ C Test program for common block debugging. G. Helffrich 11 July 2004.
C { dg-do compile }
C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "-g1" } { "" } }
-C { dg-options "-dA" }
+C { dg-options "-dA -gno-strict-dwarf" }
common i,j
common /label/l,m
i = 1
diff --git a/gcc/testsuite/gfortran.dg/debug/pr37738.f b/gcc/testsuite/gfortran.dg/debug/pr37738.f
index 48e18841ac2..fddc44c7ad4 100644
--- a/gcc/testsuite/gfortran.dg/debug/pr37738.f
+++ b/gcc/testsuite/gfortran.dg/debug/pr37738.f
@@ -2,7 +2,7 @@ C PR debug/37738
C { dg-do compile }
C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "-g1" } { "" } }
-C { dg-options "-dA" }
+C { dg-options "-dA -gno-strict-dwarf" }
subroutine a
integer*4 a_i, c_i
diff --git a/gcc/testsuite/gfortran.dg/empty_label.f b/gcc/testsuite/gfortran.dg/empty_label.f
new file mode 100644
index 00000000000..446fe8b131f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/empty_label.f
@@ -0,0 +1,5 @@
+C { dg-do compile }
+C { dg-options "-Werror -fmax-errors=1" }
+100 ! { dg-warning "empty statement" }
+ end
+C { dg-error "count reached limit" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/gfortran.dg/empty_label.f90 b/gcc/testsuite/gfortran.dg/empty_label.f90
new file mode 100644
index 00000000000..6300d3079d3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/empty_label.f90
@@ -0,0 +1,5 @@
+! { dg-do compile }
+! { dg-options "-Werror -fmax-errors=1" }
+100 ! { dg-warning "empty statement" }
+end
+! { dg-error "count reached limit" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index 826b64d0045..d818e7dcf4c 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -52,6 +52,10 @@ if [istarget "powerpc-*paired*"] {
}
lappend DEFAULT_VECTCFLAGS "-maltivec"
+ if [check_vsx_hw_available] {
+ lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
+ }
+
if [check_vmx_hw_available] {
set dg-do-what-default run
} else {
diff --git a/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f b/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f
index 2452b497151..3d163bbbdfc 100644
--- a/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f
+++ b/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f
@@ -8,7 +8,7 @@
integer(kind=1) :: i
real :: r1, r2(3)
! gfc_warning_now:
-0 ! { dg-warning "Zero is not a valid statement label" }
+0 r1 = 0 ! { dg-warning "Zero is not a valid statement label" }
!
34 5 i=0
! gfc_notify_std(GFC_STD_F95_DEL):
diff --git a/gcc/testsuite/gnat.dg/array7.adb b/gcc/testsuite/gnat.dg/array7.adb
index ff4e9e48857..d9df597cb3a 100644
--- a/gcc/testsuite/gnat.dg/array7.adb
+++ b/gcc/testsuite/gnat.dg/array7.adb
@@ -3,9 +3,18 @@
package body Array7 is
- function Get_Arr (Nbr : My_Range) return Arr_Acc is
- begin
- return new Arr (1 .. Nbr);
+ package body Range_Subtype is
+ function Get_Arr (Nbr : My_Range) return Arr_Acc is
+ begin
+ return new Arr (1 .. Nbr);
+ end;
+ end;
+
+ package body Range_Type is
+ function Get_Arr (Nbr : My_Range) return Arr_Acc is
+ begin
+ return new Arr (1 .. Nbr);
+ end;
end;
end Array7;
diff --git a/gcc/testsuite/gnat.dg/array7.ads b/gcc/testsuite/gnat.dg/array7.ads
index b47a1b6318e..bd8ec933152 100644
--- a/gcc/testsuite/gnat.dg/array7.ads
+++ b/gcc/testsuite/gnat.dg/array7.ads
@@ -1,10 +1,20 @@
package Array7 is
- type Arr is array (Positive range <>) of Integer;
- type Arr_Acc is access Arr;
+ package Range_Subtype is
+ type Arr is array (Positive range <>) of Integer;
+ type Arr_Acc is access Arr;
- subtype My_Range is Integer range 1 .. 25;
+ subtype My_Range is Integer range 1 .. 25;
+ function Get_Arr (Nbr : My_Range) return Arr_Acc;
+ end;
- function Get_Arr (Nbr : My_Range) return Arr_Acc;
+ package Range_Type is
+
+ type My_Range is range 1 .. 25;
+ type Arr is array (My_Range range <>) of Integer;
+ type Arr_Acc is access Arr;
+
+ function Get_Arr (Nbr : My_Range) return Arr_Acc;
+ end;
end Array7;
diff --git a/gcc/testsuite/gnat.dg/nested_proc.adb b/gcc/testsuite/gnat.dg/nested_proc.adb
new file mode 100644
index 00000000000..144533c2832
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/nested_proc.adb
@@ -0,0 +1,33 @@
+-- { dg-do run }
+-- Test that a static link is correctly passed to a subprogram which is
+-- indirectly called through an aggregate.
+
+procedure Nested_Proc is
+
+ I : Integer := 0;
+
+ procedure P1 (X : Integer) is
+ begin
+ I := X;
+ end;
+
+ type Func_Ptr is access procedure (X : Integer);
+
+ type Arr is array (1..64) of Integer;
+
+ type Rec is record
+ F : Func_Ptr;
+ A : Arr;
+ end record;
+
+ procedure P2 (R : Rec) is
+ begin
+ R.F (1);
+ end;
+
+begin
+ P2 ((F => P1'Access, A => (others => 0)));
+ if I /= 1 then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/sse_nolib.adb b/gcc/testsuite/gnat.dg/sse_nolib.adb
new file mode 100644
index 00000000000..b024a216e94
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/sse_nolib.adb
@@ -0,0 +1,49 @@
+-- { dg-do run { target i?86-*-* x86_64-*-* } }
+-- { dg-options "-O1 -msse" }
+
+with Ada.Unchecked_Conversion;
+
+procedure SSE_Nolib is
+
+ -- Base vector type definitions
+
+ package SSE_Types is
+ VECTOR_ALIGN : constant := 16;
+ VECTOR_BYTES : constant := 16;
+
+ type m128 is private;
+ private
+ type m128 is array (1 .. 4) of Float;
+ for m128'Alignment use VECTOR_ALIGN;
+ pragma Machine_Attribute (m128, "vector_type");
+ pragma Machine_Attribute (m128, "may_alias");
+ end SSE_Types;
+
+ use SSE_Types;
+
+ -- Core operations
+
+ function mm_add_ss (A, B : m128) return m128;
+ pragma Import (Intrinsic, mm_add_ss, "__builtin_ia32_addss");
+
+ -- User views / conversions or overlays
+
+ type Vf32_View is array (1 .. 4) of Float;
+ for Vf32_View'Alignment use VECTOR_ALIGN;
+
+ function To_m128 is new Ada.Unchecked_Conversion (Vf32_View, m128);
+ function To_m128 is new Ada.Unchecked_Conversion (m128, Vf32_View);
+
+ X, Y, Z : M128;
+
+ Vz : Vf32_View;
+ for Vz'Address use Z'Address;
+begin
+ X := To_m128 ((1.0, 1.0, 2.0, 2.0));
+ Y := To_m128 ((2.0, 2.0, 1.0, 1.0));
+ Z := mm_add_ss (X, Y);
+
+ if Vz /= (3.0, 1.0, 2.0, 2.0) then
+ raise Program_Error;
+ end if;
+end SSE_Nolib;
diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp
index 2e417645733..a9989b43ea4 100644
--- a/gcc/testsuite/lib/profopt.exp
+++ b/gcc/testsuite/lib/profopt.exp
@@ -177,6 +177,10 @@ proc profopt-get-options { src } {
# dg-require-* sets dg-do-what.
upvar dg-do-what dg-do-what
+ # current_compiler_flags reads tool_flags from the same stack frame
+ # as dg-extra-tool-flags
+ set tool_flags ""
+
set tmp [dg-get-options $src]
foreach op $tmp {
set cmd [lindex $op 0]
@@ -188,13 +192,13 @@ proc profopt-get-options { src } {
|| [string match "dg-require-*" $cmd] } {
set status [catch "$op" errmsg]
if { $status != 0 } {
- perror "src: $errmsg for \"$op\"\n"
+ perror "$src: $errmsg for \"$op\"\n"
unresolved "$src: $errmsg for \"$op\""
return
}
} else {
# Ignore unrecognized dg- commands, but warn about them.
- warning "compat.exp does not support $cmd"
+ warning "profopt.exp does not support $cmd"
}
}
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 24de1871b6a..abc01b7cc55 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -19,6 +19,11 @@
# Utility for scanning compiler result, invoked via dg-final.
+# Transform newline and similar characters into their escaped form.
+proc make_pattern_printable { pattern } {
+ return [string map {\t \\t \n \\n \r \\r \\ \\\\} $pattern]
+}
+
# Scan the OUTPUT_FILE for a pattern. If it is present and POSITIVE
# is non-zero, or it is not present and POSITIVE is zero, the test
# passes. The ORIG_ARGS is the list of arguments provided by dg-final
@@ -52,7 +57,7 @@ proc dg-scan { name positive testcase output_file orig_args } {
close $fd
set pattern [lindex $orig_args 0]
- set printable_pattern [string map {\t \\t \n \\n \r \\r \\ \\\\} $pattern]
+ set printable_pattern [make_pattern_printable $pattern]
set match [regexp -- $pattern $text]
if { $match == $positive } {
@@ -181,10 +186,12 @@ proc scan-assembler-times { args } {
set text [read $fd]
close $fd
- if { [llength [regexp -inline -all -- [lindex $args 0] $text]] == [lindex $args 1]} {
- pass "$testcase scan-assembler-times [lindex $args 0] [lindex $args 1]"
+ set pattern [lindex $args 0]
+ set pp_pattern [make_pattern_printable $pattern]
+ if { [llength [regexp -inline -all -- $pattern $text]] == [lindex $args 1]} {
+ pass "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
} else {
- fail "$testcase scan-assembler-times [lindex $args 0] [lindex $args 1]"
+ fail "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
}
}
@@ -228,10 +235,12 @@ proc scan-assembler-dem { args } {
set output [remote_exec host "$cxxfilt" "" "$output_file"]
set text [lindex $output 1]
- if [regexp -- [lindex $args 0] $text] {
- pass "$testcase scan-assembler-dem [lindex $args 0]"
+ set pattern [lindex $args 0]
+ set pp_pattern [make_pattern_printable $pattern]
+ if [regexp -- $pattern $text] {
+ pass "$testcase scan-assembler-dem $pp_pattern"
} else {
- fail "$testcase scan-assembler-dem [lindex $args 0]"
+ fail "$testcase scan-assembler-dem $pp_pattern"
}
}
@@ -274,9 +283,11 @@ proc scan-assembler-dem-not { args } {
set output [remote_exec host "$cxxfilt" "" "$output_file"]
set text [lindex $output 1]
- if ![regexp -- [lindex $args 0] $text] {
- pass "$testcase scan-assembler-dem-not [lindex $args 0]"
+ set pattern [lindex $args 0]
+ set pp_pattern [make_pattern_printable $pattern]
+ if ![regexp -- $pattern $text] {
+ pass "$testcase scan-assembler-dem-not $pp_pattern"
} else {
- fail "$testcase scan-assembler-dem-not [lindex $args 0]"
+ fail "$testcase scan-assembler-dem-not $pp_pattern"
}
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 918993830e8..0e29668c94e 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1295,7 +1295,7 @@ proc check_effective_target_fixed_point { } {
proc check_effective_target_dfp_nocache { } {
verbose "check_effective_target_dfp_nocache: compiling source" 2
set ret [check_no_compiler_messages_nocache dfp object {
- _Decimal32 x; _Decimal64 y; _Decimal128 z;
+ float x __attribute__((mode(DD)));
}]
verbose "check_effective_target_dfp_nocache: returning $ret" 2
return $ret
@@ -1303,7 +1303,8 @@ proc check_effective_target_dfp_nocache { } {
proc check_effective_target_dfprt_nocache { } {
return [check_runtime_nocache dfprt {
- _Decimal32 x = 1.2df; _Decimal64 y = 2.3dd; _Decimal128 z;
+ typedef float d64 __attribute__((mode(DD)));
+ d64 x = 1.2df; y = 2.3dd; z;
int main () { z = x + y; return 0; }
}]
}
@@ -3069,7 +3070,8 @@ proc check_effective_target_pow10 { } {
proc check_effective_target_hard_dfp {} {
return [check_no_messages_and_pattern hard_dfp "!adddd3" assembly {
- _Decimal64 x, y, z;
+ typedef float d64 __attribute__((mode(DD)));
+ d64 x, y, z;
void foo (void) { z = x + y; }
}]
}
diff --git a/gcc/testsuite/objc.dg/dwarf-2.m b/gcc/testsuite/objc.dg/dwarf-2.m
index f85a750ee25..967f5159013 100644
--- a/gcc/testsuite/objc.dg/dwarf-2.m
+++ b/gcc/testsuite/objc.dg/dwarf-2.m
@@ -1,4 +1,4 @@
-/* { dg-options "-gdwarf-2 -dA" } */
+/* { dg-options "-gdwarf-2 -dA -gno-strict-dwarf" } */
/* { dg-final { scan-assembler "0x10\[^0-9a-f\].*DW_AT_language" } } */
/* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
int x;
diff --git a/gcc/toplev.c b/gcc/toplev.c
index cf035d8b3fc..4dd17e4b0c8 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1910,6 +1910,11 @@ process_options (void)
}
}
+ /* Unless over-ridden for the target, assume that all DWARF levels
+ may be emitted, if DWARF2_DEBUG is selected. */
+ if (dwarf_strict < 0)
+ dwarf_strict = 0;
+
/* A lot of code assumes write_symbols == NO_DEBUG if the debugging
level is 0. */
if (debug_info_level == DINFO_LEVEL_NONE)
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index ef5f32284d4..df1f6caa857 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2001,6 +2001,7 @@ remove_useless_stmts_tc (gimple_stmt_iterator *gsi, struct rus_data *data)
case GIMPLE_EH_MUST_NOT_THROW:
this_may_throw = false;
+ gsi_next (gsi);
break;
default:
@@ -3574,7 +3575,7 @@ verify_gimple_call (gimple stmt)
}
/* If there is a static chain argument, this should not be an indirect
- call, and the decl should not have DECL_NO_STATIC_CHAIN set. */
+ call, and the decl should have DECL_STATIC_CHAIN set. */
if (gimple_call_chain (stmt))
{
if (TREE_CODE (fn) != ADDR_EXPR
@@ -3585,7 +3586,7 @@ verify_gimple_call (gimple stmt)
}
fn = TREE_OPERAND (fn, 0);
- if (DECL_NO_STATIC_CHAIN (fn))
+ if (!DECL_STATIC_CHAIN (fn))
{
error ("static chain with function that doesn't use one");
return true;
@@ -4354,6 +4355,7 @@ verify_types_in_gimple_stmt (gimple stmt)
case GIMPLE_PREDICT:
case GIMPLE_RESX:
case GIMPLE_EH_DISPATCH:
+ case GIMPLE_EH_MUST_NOT_THROW:
return false;
CASE_GIMPLE_OMP:
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index f6918056a68..199f1dcf54c 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1065,7 +1065,9 @@ expand_complex_multiplication (gimple_stmt_iterator *gsi, tree inner_type,
update_complex_assignment (gsi, rr, ri);
}
-/* Expand complex division to scalars, straightforward algorithm.
+/* Keep this algorithm in sync with fold-const.c:const_binop().
+
+ Expand complex division to scalars, straightforward algorithm.
a / b = ((ar*br + ai*bi)/t) + i((ai*br - ar*bi)/t)
t = br*br + bi*bi
*/
@@ -1094,7 +1096,9 @@ expand_complex_div_straight (gimple_stmt_iterator *gsi, tree inner_type,
update_complex_assignment (gsi, rr, ri);
}
-/* Expand complex division to scalars, modified algorithm to minimize
+/* Keep this algorithm in sync with fold-const.c:const_binop().
+
+ Expand complex division to scalars, modified algorithm to minimize
overflow with wide input ranges. */
static void
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index e9a645ef7f2..847a6818b1b 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -752,7 +752,6 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
tree size_tree = NULL_TREE;
HOST_WIDE_INT bit_offset = 0;
bool seen_variable_array_ref = false;
- bool seen_union = false;
/* First get the final access size from just the outermost expression. */
if (TREE_CODE (exp) == COMPONENT_REF)
@@ -794,17 +793,41 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
tree field = TREE_OPERAND (exp, 1);
tree this_offset = component_ref_field_offset (exp);
- if (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == UNION_TYPE)
- seen_union = true;
-
if (this_offset
&& TREE_CODE (this_offset) == INTEGER_CST
&& host_integerp (this_offset, 0))
{
HOST_WIDE_INT hthis_offset = TREE_INT_CST_LOW (this_offset);
hthis_offset *= BITS_PER_UNIT;
+ hthis_offset
+ += TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field));
bit_offset += hthis_offset;
- bit_offset += TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field));
+
+ /* If we had seen a variable array ref already and we just
+ referenced the last field of a struct or a union member
+ then we have to adjust maxsize by the padding at the end
+ of our field. */
+ if (seen_variable_array_ref
+ && maxsize != -1)
+ {
+ tree stype = TREE_TYPE (TREE_OPERAND (exp, 0));
+ tree next = TREE_CHAIN (field);
+ while (next && TREE_CODE (next) != FIELD_DECL)
+ next = TREE_CHAIN (next);
+ if (!next
+ || TREE_CODE (stype) != RECORD_TYPE)
+ {
+ tree fsize = DECL_SIZE_UNIT (field);
+ tree ssize = TYPE_SIZE_UNIT (stype);
+ if (host_integerp (fsize, 0)
+ && host_integerp (ssize, 0))
+ maxsize += ((TREE_INT_CST_LOW (ssize)
+ - TREE_INT_CST_LOW (fsize))
+ * BITS_PER_UNIT - hthis_offset);
+ else
+ maxsize = -1;
+ }
+ }
}
else
{
@@ -872,7 +895,6 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
break;
case VIEW_CONVERT_EXPR:
- /* ??? We probably should give up here and bail out. */
break;
default:
@@ -887,24 +909,17 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
struct { int length; int a[1]; } x; x.a[d]
struct { struct { int a; int b; } a[1]; } x; x.a[d].a
struct { struct { int a[1]; } a[1]; } x; x.a[0][d], x.a[d][0]
+ struct { int len; union { int a[1]; struct X x; } u; } x; x.u.a[d]
where we do not know maxsize for variable index accesses to
the array. The simplest way to conservatively deal with this
is to punt in the case that offset + maxsize reaches the
- base type boundary.
-
- Unfortunately this is difficult to determine reliably when unions are
- involved and so we are conservative in such cases.
-
- FIXME: This approach may be too conservative, we probably want to at least
- check that the union is the last field/element at its level or even
- propagate the calculated offsets back up the access chain and check
- there. */
+ base type boundary. This needs to include possible trailing padding
+ that is there for alignment purposes. */
if (seen_variable_array_ref
- && (seen_union
- || (maxsize != -1
- && host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
- && bit_offset + maxsize
+ && maxsize != -1
+ && (!host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
+ || (bit_offset + maxsize
== (signed) TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))))))
maxsize = -1;
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index b93e2f4a373..77cd80bdfe9 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -680,10 +680,6 @@ tree fold_const_aggregate_ref (tree);
bool may_propagate_address_into_dereference (tree, tree);
-/* In tree-vrp.c */
-tree vrp_evaluate_conditional (enum tree_code, tree, tree, gimple);
-bool simplify_stmt_using_ranges (gimple_stmt_iterator *);
-
/* In tree-ssa-dom.c */
extern void dump_dominator_optimization_stats (FILE *);
extern void debug_dominator_optimization_stats (void);
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 9f06e8c5d04..031e50e59df 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2337,6 +2337,8 @@ rewrite_into_ssa (void)
BITMAP_FREE (dfs[bb->index]);
free (dfs);
+ sbitmap_free (interesting_blocks);
+
fini_ssa_renamer ();
timevar_pop (TV_TREE_SSA_OTHER);
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index fe938d913e1..706571c59ec 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -353,11 +353,11 @@ get_chain_decl (struct nesting_info *info)
if (dump_file
&& (dump_flags & TDF_DETAILS)
- && DECL_NO_STATIC_CHAIN (info->context))
- fprintf (dump_file, "Resetting no-static-chain for %s\n",
+ && !DECL_STATIC_CHAIN (info->context))
+ fprintf (dump_file, "Setting static-chain for %s\n",
lang_hooks.decl_printable_name (info->context, 2));
- DECL_NO_STATIC_CHAIN (info->context) = 0;
+ DECL_STATIC_CHAIN (info->context) = 1;
}
return decl;
}
@@ -387,11 +387,11 @@ get_chain_field (struct nesting_info *info)
if (dump_file
&& (dump_flags & TDF_DETAILS)
- && DECL_NO_STATIC_CHAIN (info->context))
- fprintf (dump_file, "Resetting no-static-chain for %s\n",
+ && !DECL_STATIC_CHAIN (info->context))
+ fprintf (dump_file, "Setting static-chain for %s\n",
lang_hooks.decl_printable_name (info->context, 2));
- DECL_NO_STATIC_CHAIN (info->context) = 0;
+ DECL_STATIC_CHAIN (info->context) = 1;
}
return field;
}
@@ -1872,7 +1872,7 @@ convert_tramp_reference_op (tree *tp, int *walk_subtrees, void *data)
/* If the nested function doesn't use a static chain, then
it doesn't need a trampoline. */
- if (DECL_NO_STATIC_CHAIN (decl))
+ if (!DECL_STATIC_CHAIN (decl))
break;
/* If we don't want a trampoline, then don't build one. */
@@ -1972,7 +1972,7 @@ convert_gimple_call (gimple_stmt_iterator *gsi, bool *handled_ops_p,
if (!decl)
break;
target_context = decl_function_context (decl);
- if (target_context && !DECL_NO_STATIC_CHAIN (decl))
+ if (target_context && DECL_STATIC_CHAIN (decl))
{
gimple_call_set_chain (stmt, get_static_chain (info, target_context,
&wi->gsi));
@@ -2046,20 +2046,20 @@ convert_all_function_calls (struct nesting_info *root)
int iter_count;
bool any_changed;
- /* First, optimistically set no_static_chain for all decls that haven't
+ /* First, optimistically clear static_chain for all decls that haven't
used the static chain already for variable access. */
FOR_EACH_NEST_INFO (n, root)
{
tree decl = n->context;
- if (n->outer && !n->chain_decl && !n->chain_field)
+ if (!n->outer || (!n->chain_decl && !n->chain_field))
{
- DECL_NO_STATIC_CHAIN (decl) = 1;
+ DECL_STATIC_CHAIN (decl) = 0;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Guessing no-static-chain for %s\n",
+ fprintf (dump_file, "Guessing no static-chain for %s\n",
lang_hooks.decl_printable_name (decl, 2));
}
else
- gcc_assert (!DECL_NO_STATIC_CHAIN (decl));
+ DECL_STATIC_CHAIN (decl) = 1;
}
/* Walk the functions and perform transformations. Note that these
@@ -2081,7 +2081,7 @@ convert_all_function_calls (struct nesting_info *root)
FOR_EACH_NEST_INFO (n, root)
{
tree decl = n->context;
- bool old_no_static_chain = DECL_NO_STATIC_CHAIN (decl);
+ bool old_static_chain = DECL_STATIC_CHAIN (decl);
walk_function (convert_tramp_reference_stmt,
convert_tramp_reference_op, n);
@@ -2089,7 +2089,7 @@ convert_all_function_calls (struct nesting_info *root)
/* If a call to another function created the use of a chain
within this function, we'll have to continue iteration. */
- if (old_no_static_chain && !DECL_NO_STATIC_CHAIN (decl))
+ if (!old_static_chain && DECL_STATIC_CHAIN (decl))
any_changed = true;
}
}
@@ -2337,7 +2337,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
if (!field)
continue;
- gcc_assert (!DECL_NO_STATIC_CHAIN (i->context));
+ gcc_assert (DECL_STATIC_CHAIN (i->context));
arg3 = build_addr (root->frame_decl, context);
arg2 = build_addr (i->context, context);
@@ -2528,10 +2528,6 @@ lower_nested_functions (tree fndecl)
{
struct cgraph_node *cgn;
struct nesting_info *root;
-#ifdef ENABLE_CHECKING
- struct nesting_info *n;
- bitmap orig_decl_no_static_chain;
-#endif
/* If there are no nested functions, there's nothing to do. */
cgn = cgraph_node (fndecl);
@@ -2548,15 +2544,6 @@ lower_nested_functions (tree fndecl)
bitmap_obstack_initialize (&nesting_info_bitmap_obstack);
root = create_nesting_tree (cgn);
-#ifdef ENABLE_CHECKING
- /* The C++ and Ada front ends set DECL_NO_STATIC_CHAIN in various
- instances where they expect no static chain needed. */
- orig_decl_no_static_chain = BITMAP_ALLOC (&nesting_info_bitmap_obstack);
- FOR_EACH_NEST_INFO (n, root)
- if (DECL_NO_STATIC_CHAIN (n->context))
- bitmap_set_bit (orig_decl_no_static_chain, DECL_UID (n->context));
-#endif
-
walk_all_functions (convert_nonlocal_reference_stmt,
convert_nonlocal_reference_op,
root);
@@ -2570,13 +2557,6 @@ lower_nested_functions (tree fndecl)
finalize_nesting_tree (root);
unnest_nesting_tree (root);
-#ifdef ENABLE_CHECKING
- /* Validate the original settings of DECL_NO_STATIC_CHAIN. */
- FOR_EACH_NEST_INFO (n, root)
- if (bitmap_bit_p (orig_decl_no_static_chain, DECL_UID (n->context)))
- gcc_assert (DECL_NO_STATIC_CHAIN (n->context));
-#endif
-
free_nesting_tree (root);
bitmap_obstack_release (&nesting_info_bitmap_obstack);
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 61827a74ab4..454240392cf 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -229,6 +229,7 @@ typedef enum
static prop_value_t *const_val;
static void canonicalize_float_value (prop_value_t *);
+static bool ccp_fold_stmt (gimple_stmt_iterator *);
/* Dump constant propagation value VAL to file OUTF prefixed by PREFIX. */
@@ -724,7 +725,7 @@ ccp_finalize (void)
do_dbg_cnt ();
/* Perform substitutions based on the known constant values. */
- something_changed = substitute_and_fold (const_val, false);
+ something_changed = substitute_and_fold (const_val, ccp_fold_stmt);
free (const_val);
const_val = NULL;
@@ -1472,6 +1473,34 @@ evaluate_stmt (gimple stmt)
return val;
}
+/* Fold the stmt at *GSI with CCP specific information that propagating
+ and regular folding does not catch. */
+
+static bool
+ccp_fold_stmt (gimple_stmt_iterator *gsi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+ prop_value_t val;
+
+ if (gimple_code (stmt) != GIMPLE_COND)
+ return false;
+
+ /* Statement evaluation will handle type mismatches in constants
+ more gracefully than the final propagation. This allows us to
+ fold more conditionals here. */
+ val = evaluate_stmt (stmt);
+ if (val.lattice_val != CONSTANT
+ || TREE_CODE (val.value) != INTEGER_CST)
+ return false;
+
+ if (integer_zerop (val.value))
+ gimple_cond_make_false (stmt);
+ else
+ gimple_cond_make_true (stmt);
+
+ return true;
+}
+
/* Visit the assignment statement STMT. Set the value of its LHS to the
value computed by the RHS and store LHS in *OUTPUT_P. If STMT
creates virtual definitions, set the value of each new name to that
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 6bc3c13d4bb..986ad454e74 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -847,7 +847,7 @@ fini_copy_prop (void)
duplicate_ssa_name_ptr_info (tmp[i].value, SSA_NAME_PTR_INFO (var));
}
- substitute_and_fold (tmp, false);
+ substitute_and_fold (tmp, NULL);
free (cached_last_copy_of);
free (copy_of);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 5aec33415d4..87795a28223 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -831,7 +831,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
&& !TYPE_VOLATILE (TREE_TYPE (rhs))
&& !TYPE_VOLATILE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
&& operand_equal_p (TYPE_SIZE (TREE_TYPE (rhs)),
- TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0))
+ TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0)
+ /* Make sure we only do TBAA compatible replacements. */
+ && get_alias_set (TREE_OPERAND (def_rhs, 0)) == get_alias_set (rhs))
{
tree def_rhs_base, new_rhs = unshare_expr (TREE_OPERAND (def_rhs, 0));
new_rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (rhs), new_rhs);
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 42d89e91920..ec0ecf3d3bb 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -856,7 +856,7 @@ struct prop_stats_d
{
long num_const_prop;
long num_copy_prop;
- long num_pred_folded;
+ long num_stmts_folded;
long num_dce;
};
@@ -958,92 +958,24 @@ replace_phi_args_in (gimple phi, prop_value_t *prop_value)
}
-/* If the statement pointed by SI has a predicate whose value can be
- computed using the value range information computed by VRP, compute
- its value and return true. Otherwise, return false. */
-
-static bool
-fold_predicate_in (gimple_stmt_iterator *si)
-{
- bool assignment_p = false;
- tree val;
- gimple stmt = gsi_stmt (*si);
-
- if (is_gimple_assign (stmt)
- && TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison)
- {
- assignment_p = true;
- val = vrp_evaluate_conditional (gimple_assign_rhs_code (stmt),
- gimple_assign_rhs1 (stmt),
- gimple_assign_rhs2 (stmt),
- stmt);
- }
- else if (gimple_code (stmt) == GIMPLE_COND)
- val = vrp_evaluate_conditional (gimple_cond_code (stmt),
- gimple_cond_lhs (stmt),
- gimple_cond_rhs (stmt),
- stmt);
- else
- return false;
-
-
- if (val)
- {
- if (assignment_p)
- val = fold_convert (gimple_expr_type (stmt), val);
-
- if (dump_file)
- {
- fprintf (dump_file, "Folding predicate ");
- print_gimple_expr (dump_file, stmt, 0, 0);
- fprintf (dump_file, " to ");
- print_generic_expr (dump_file, val, 0);
- fprintf (dump_file, "\n");
- }
-
- prop_stats.num_pred_folded++;
-
- if (is_gimple_assign (stmt))
- gimple_assign_set_rhs_from_tree (si, val);
- else
- {
- gcc_assert (gimple_code (stmt) == GIMPLE_COND);
- if (integer_zerop (val))
- gimple_cond_make_false (stmt);
- else if (integer_onep (val))
- gimple_cond_make_true (stmt);
- else
- gcc_unreachable ();
- }
-
- return true;
- }
-
- return false;
-}
-
-
/* Perform final substitution and folding of propagated values.
PROP_VALUE[I] contains the single value that should be substituted
at every use of SSA name N_I. If PROP_VALUE is NULL, no values are
substituted.
- If USE_RANGES_P is true, statements that contain predicate
- expressions are evaluated with a call to vrp_evaluate_conditional.
- This will only give meaningful results when called from tree-vrp.c
- (the information used by vrp_evaluate_conditional is built by the
- VRP pass).
+ If FOLD_FN is non-NULL the function will be invoked on all statements
+ before propagating values for pass specific simplification.
Return TRUE when something changed. */
bool
-substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
+substitute_and_fold (prop_value_t *prop_value, ssa_prop_fold_stmt_fn fold_fn)
{
basic_block bb;
bool something_changed = false;
- if (prop_value == NULL && !use_ranges_p)
+ if (prop_value == NULL && !fold_fn)
return false;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1114,13 +1046,16 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
- /* If we have range information, see if we can fold
- predicate expressions. */
- if (use_ranges_p)
+ old_stmt = stmt;
+
+ /* Some statements may be simplified using propagator
+ specific information. Do this before propagating
+ into the stmt to not disturb pass specific information. */
+ if (fold_fn
+ && (*fold_fn)(&i))
{
- did_replace = fold_predicate_in (&i);
- /* fold_predicate_in should not have reallocated STMT. */
- gcc_assert (gsi_stmt (i) == stmt);
+ did_replace = true;
+ prop_stats.num_stmts_folded++;
}
/* Only replace real uses if we couldn't fold the
@@ -1130,20 +1065,9 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
did_replace |= replace_uses_in (stmt, prop_value);
/* If we made a replacement, fold the statement. */
-
- old_stmt = stmt;
if (did_replace)
fold_stmt (&i);
- /* Some statements may be simplified using ranges. For
- example, division may be replaced by shifts, modulo
- replaced with bitwise and, etc. Do this after
- substituting constants, folding, etc so that we're
- presented with a fully propagated, canonicalized
- statement. */
- if (use_ranges_p)
- did_replace |= simplify_stmt_using_ranges (&i);
-
/* Now cleanup. */
if (did_replace)
{
@@ -1190,8 +1114,8 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
prop_stats.num_const_prop);
statistics_counter_event (cfun, "Copies propagated",
prop_stats.num_copy_prop);
- statistics_counter_event (cfun, "Predicates folded",
- prop_stats.num_pred_folded);
+ statistics_counter_event (cfun, "Statements folded",
+ prop_stats.num_stmts_folded);
statistics_counter_event (cfun, "Statements deleted",
prop_stats.num_dce);
return something_changed;
diff --git a/gcc/tree-ssa-propagate.h b/gcc/tree-ssa-propagate.h
index 3c267247717..e8f4f03dfb3 100644
--- a/gcc/tree-ssa-propagate.h
+++ b/gcc/tree-ssa-propagate.h
@@ -110,6 +110,7 @@ typedef struct value_range_d value_range_t;
/* Call-back functions used by the value propagation engine. */
typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (gimple, edge *, tree *);
typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (gimple);
+typedef bool (*ssa_prop_fold_stmt_fn) (gimple_stmt_iterator *gsi);
/* In tree-ssa-propagate.c */
@@ -119,6 +120,6 @@ bool valid_gimple_call_p (tree);
void move_ssa_defining_stmt_for_defs (gimple, gimple);
bool update_call_from_tree (gimple_stmt_iterator *, tree);
bool stmt_makes_single_store (gimple);
-bool substitute_and_fold (prop_value_t *, bool);
+bool substitute_and_fold (prop_value_t *, ssa_prop_fold_stmt_fn);
#endif /* _TREE_SSA_PROPAGATE_H */
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 7e45123faff..ddaee818310 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1384,6 +1384,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
gimple_call_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ mark_symbols_for_renaming (new_stmt);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
@@ -1432,6 +1433,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
gimple_call_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ mark_symbols_for_renaming (new_stmt);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 514a3ec661e..57800075e94 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5678,7 +5678,7 @@ vrp_evaluate_conditional_warnv_with_ops (enum tree_code code, tree op0,
based on undefined signed overflow, issue a warning if
appropriate. */
-tree
+static tree
vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, gimple stmt)
{
bool sop;
@@ -6945,7 +6945,7 @@ simplify_switch_using_ranges (gimple stmt)
/* Simplify STMT using ranges if possible. */
-bool
+static bool
simplify_stmt_using_ranges (gimple_stmt_iterator *gsi)
{
gimple stmt = gsi_stmt (*gsi);
@@ -6998,6 +6998,78 @@ simplify_stmt_using_ranges (gimple_stmt_iterator *gsi)
return false;
}
+/* If the statement pointed by SI has a predicate whose value can be
+ computed using the value range information computed by VRP, compute
+ its value and return true. Otherwise, return false. */
+
+static bool
+fold_predicate_in (gimple_stmt_iterator *si)
+{
+ bool assignment_p = false;
+ tree val;
+ gimple stmt = gsi_stmt (*si);
+
+ if (is_gimple_assign (stmt)
+ && TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison)
+ {
+ assignment_p = true;
+ val = vrp_evaluate_conditional (gimple_assign_rhs_code (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ stmt);
+ }
+ else if (gimple_code (stmt) == GIMPLE_COND)
+ val = vrp_evaluate_conditional (gimple_cond_code (stmt),
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt),
+ stmt);
+ else
+ return false;
+
+ if (val)
+ {
+ if (assignment_p)
+ val = fold_convert (gimple_expr_type (stmt), val);
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "Folding predicate ");
+ print_gimple_expr (dump_file, stmt, 0, 0);
+ fprintf (dump_file, " to ");
+ print_generic_expr (dump_file, val, 0);
+ fprintf (dump_file, "\n");
+ }
+
+ if (is_gimple_assign (stmt))
+ gimple_assign_set_rhs_from_tree (si, val);
+ else
+ {
+ gcc_assert (gimple_code (stmt) == GIMPLE_COND);
+ if (integer_zerop (val))
+ gimple_cond_make_false (stmt);
+ else if (integer_onep (val))
+ gimple_cond_make_true (stmt);
+ else
+ gcc_unreachable ();
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+/* Callback for substitute_and_fold folding the stmt at *SI. */
+
+static bool
+vrp_fold_stmt (gimple_stmt_iterator *si)
+{
+ if (fold_predicate_in (si))
+ return true;
+
+ return simplify_stmt_using_ranges (si);
+}
+
/* Stack of dest,src equivalency pairs that need to be restored after
each attempt to thread a block's incoming edge to an outgoing edge.
@@ -7187,7 +7259,7 @@ vrp_finalize (void)
single_val_range = NULL;
}
- substitute_and_fold (single_val_range, true);
+ substitute_and_fold (single_val_range, vrp_fold_stmt);
if (warn_array_bounds)
check_all_array_refs ();
diff --git a/gcc/tree.h b/gcc/tree.h
index afb1d4260a0..4f4fd309b6e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3141,9 +3141,8 @@ struct GTY(())
#define DECL_NO_LIMIT_STACK(NODE) \
(FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack)
-/* In a FUNCTION_DECL with a nonzero DECL_CONTEXT, indicates that a
- static chain is not needed. */
-#define DECL_NO_STATIC_CHAIN(NODE) \
+/* In a FUNCTION_DECL indicates that a static chain is needed. */
+#define DECL_STATIC_CHAIN(NODE) \
(FUNCTION_DECL_CHECK (NODE)->function_decl.regdecl_flag)
/* Nonzero for a decl that cgraph has decided should be inlined into
diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c
index 418f0300108..ad6ecd50d59 100644
--- a/gcc/unwind-dw2-fde-glibc.c
+++ b/gcc/unwind-dw2-fde-glibc.c
@@ -48,6 +48,16 @@
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+# define USE_PT_GNU_EH_FRAME
+#endif
+
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+ && defined(__FreeBSD__) && __FreeBSD__ >= 7
+# define ElfW __ElfN
+# define USE_PT_GNU_EH_FRAME
+#endif
+
+#if defined(USE_PT_GNU_EH_FRAME)
#ifndef __RELOC_POINTER
# define __RELOC_POINTER(ptr, base) ((ptr) + (base))
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 12f1ecc5962..1da60e1a02a 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1154,8 +1154,6 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
lp_nr = lookup_stmt_eh_lp (icall_stmt);
if (lp_nr != 0)
{
- gimple_purge_dead_eh_edges (join_bb);
-
if (stmt_could_throw_p (dcall_stmt))
{
add_stmt_to_eh_lp (dcall_stmt, lp_nr);
@@ -1164,6 +1162,9 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
gcc_assert (stmt_could_throw_p (icall_stmt));
make_eh_edges (icall_stmt);
+
+ /* The old EH edges are sill on the join BB, purge them. */
+ gimple_purge_dead_eh_edges (join_bb);
}
return dcall_stmt;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 0e665b91bed..bdd3bdee34e 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -4977,8 +4977,8 @@ add_with_sets (rtx insn, struct cselib_set *sets, int n_sets)
note_uses (&PATTERN (insn), add_uses_1, &cui);
n2 = VTI (bb)->n_mos - 1;
- /* Order the MO_USEs to be before MO_USE_NO_VARs,
- MO_VAL_LOC and MO_VAL_USE. */
+ /* Order the MO_USEs to be before MO_USE_NO_VARs and MO_VAL_USE, and
+ MO_VAL_LOC last. */
while (n1 < n2)
{
while (n1 < n2 && VTI (bb)->mos[n1].type == MO_USE)
@@ -4995,6 +4995,24 @@ add_with_sets (rtx insn, struct cselib_set *sets, int n_sets)
}
}
+ n2 = VTI (bb)->n_mos - 1;
+
+ while (n1 < n2)
+ {
+ while (n1 < n2 && VTI (bb)->mos[n1].type != MO_VAL_LOC)
+ n1++;
+ while (n1 < n2 && VTI (bb)->mos[n2].type == MO_VAL_LOC)
+ n2--;
+ if (n1 < n2)
+ {
+ micro_operation sw;
+
+ sw = VTI (bb)->mos[n1];
+ VTI (bb)->mos[n1] = VTI (bb)->mos[n2];
+ VTI (bb)->mos[n2] = sw;
+ }
+ }
+
if (CALL_P (insn))
{
micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 566fb503a38..46ec00da180 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2507,7 +2507,6 @@ assemble_static_space (unsigned HOST_WIDE_INT size)
static GTY(()) rtx initial_trampoline;
-#ifdef TRAMPOLINE_TEMPLATE
rtx
assemble_trampoline_template (void)
{
@@ -2516,6 +2515,8 @@ assemble_trampoline_template (void)
int align;
rtx symbol;
+ gcc_assert (targetm.asm_out.trampoline_template != NULL);
+
if (initial_trampoline)
return initial_trampoline;
@@ -2530,12 +2531,10 @@ assemble_trampoline_template (void)
/* Write the assembler code to define one. */
align = floor_log2 (TRAMPOLINE_ALIGNMENT / BITS_PER_UNIT);
if (align > 0)
- {
- ASM_OUTPUT_ALIGN (asm_out_file, align);
- }
+ ASM_OUTPUT_ALIGN (asm_out_file, align);
targetm.asm_out.internal_label (asm_out_file, "LTRAMP", 0);
- TRAMPOLINE_TEMPLATE (asm_out_file);
+ targetm.asm_out.trampoline_template (asm_out_file);
/* Record the rtl to refer to it. */
ASM_GENERATE_INTERNAL_LABEL (label, "LTRAMP", 0);
@@ -2543,12 +2542,12 @@ assemble_trampoline_template (void)
symbol = gen_rtx_SYMBOL_REF (Pmode, name);
SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
- initial_trampoline = gen_rtx_MEM (BLKmode, symbol);
+ initial_trampoline = gen_const_mem (BLKmode, symbol);
set_mem_align (initial_trampoline, TRAMPOLINE_ALIGNMENT);
+ set_mem_size (initial_trampoline, GEN_INT (TRAMPOLINE_SIZE));
return initial_trampoline;
}
-#endif
/* A and B are either alignments or offsets. Return the minimum alignment
that may be assumed after adding the two together. */
@@ -4213,8 +4212,7 @@ initializer_constant_valid_p (tree value, tree endtype)
/* Taking the address of a nested function involves a trampoline,
unless we don't need or want one. */
if (TREE_CODE (op0) == FUNCTION_DECL
- && decl_function_context (op0)
- && !DECL_NO_STATIC_CHAIN (op0)
+ && DECL_STATIC_CHAIN (op0)
&& !TREE_NO_TRAMPOLINE (value))
return NULL_TREE;
/* "&{...}" requires a temporary to hold the constructed
@@ -6422,8 +6420,8 @@ default_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
flags |= SYMBOL_FLAG_FUNCTION;
if (targetm.binds_local_p (decl))
flags |= SYMBOL_FLAG_LOCAL;
- if (targetm.have_tls && TREE_CODE (decl) == VAR_DECL
- && DECL_THREAD_LOCAL_P (decl))
+ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)
+ && DECL_TLS_MODEL (decl) != TLS_MODEL_EMULATED)
flags |= DECL_TLS_MODEL (decl) << SYMBOL_FLAG_TLS_SHIFT;
else if (targetm.in_small_data_p (decl))
flags |= SYMBOL_FLAG_SMALL;
diff --git a/include/ChangeLog b/include/ChangeLog
index 4bd5e81f66e..b1158a2dd90 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,22 @@
+2009-09-25 Cary Coutant <ccoutant@google.com>
+
+ Add rest of new values from DWARF Version 4.
+ * dwarf2.h (DW_TAG_rvalue_reference_type, DW_TAG_template_alias):
+ New tags.
+ (DW_FORM_ref_sig8): New name for DW_FORM_sig8.
+ (DW_AT_main_subprogram, DW_AT_data_bit_offset, DW_AT_const_expr,
+ DW_AT_enum_class, DW_AT_linkage_name, DW_AT_GNU_guarded_by,
+ DW_AT_GNU_pt_guarded_by, DW_AT_GNU_guarded, DW_AT_GNU_pt_guarded,
+ DW_AT_GNU_locks_excluded, DW_AT_GNU_exclusive_locks_required,
+ DW_AT_GNU_shared_locks_required, DW_AT_GNU_odr_signature): New
+ attributes.
+ (DW_LANG_Python): New language.
+
+2009-09-22 Dodji Seketeli <dodji@redhat.com>
+
+ * dwarf2.h (enum dwarf_tag): Add
+ DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack.
+
2009-07-24 Ian Lance Taylor <iant@google.com>
PR bootstrap/40854
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 68b347e34dd..4aa10d5a873 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -196,10 +196,20 @@ enum dwarf_tag
DW_TAG_shared_type = 0x40,
/* DWARF 4. */
DW_TAG_type_unit = 0x41,
+ DW_TAG_rvalue_reference_type = 0x42,
+ DW_TAG_template_alias = 0x43,
DW_TAG_lo_user = 0x4080,
DW_TAG_hi_user = 0xffff,
+ /* DWARF 5? */
+
+ /* Template parameter pack extension, specified at
+ http://wiki.dwarfstd.org/index.php?title=C%2B%2B0x:_Variadic_templates
+ . */
+ DW_TAG_template_parameter_pack = 0x43,
+ DW_TAG_formal_parameter_pack = 0x44,
+
/* SGI/MIPS Extensions. */
DW_TAG_MIPS_loop = 0x4081,
/* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */
@@ -254,7 +264,8 @@ enum dwarf_form
DW_FORM_sec_offset = 0x17,
DW_FORM_exprloc = 0x18,
DW_FORM_flag_present = 0x19,
- DW_FORM_sig8 = 0x20
+ DW_FORM_ref_sig8 = 0x20
+#define DW_FORM_sig8 DW_FORM_ref_sig8 /* Note: The use of DW_FORM_sig8 is deprecated. */
};
/* Attribute names and codes. */
@@ -353,7 +364,12 @@ enum dwarf_attribute
DW_AT_pure = 0x67,
DW_AT_recursive = 0x68,
/* DWARF 4. */
- DW_AT_signature = 0x69,
+ DW_AT_signature = 0x69,
+ DW_AT_main_subprogram = 0x6a,
+ DW_AT_data_bit_offset = 0x6b,
+ DW_AT_const_expr = 0x6c,
+ DW_AT_enum_class = 0x6d,
+ DW_AT_linkage_name = 0x6e,
DW_AT_lo_user = 0x2000, /* Implementation-defined range start. */
DW_AT_hi_user = 0x3ff0, /* Implementation-defined range end. */
@@ -393,6 +409,15 @@ enum dwarf_attribute
DW_AT_body_begin = 0x2105,
DW_AT_body_end = 0x2106,
DW_AT_GNU_vector = 0x2107,
+ /* Thread-safety annotations.
+ See http://gcc.gnu.org/wiki/ThreadSafetyAnnotation . */
+ DW_AT_GNU_guarded_by = 0x2108,
+ DW_AT_GNU_pt_guarded_by = 0x2109,
+ DW_AT_GNU_guarded = 0x210a,
+ DW_AT_GNU_pt_guarded = 0x210b,
+ DW_AT_GNU_locks_excluded = 0x210c,
+ DW_AT_GNU_exclusive_locks_required = 0x210d,
+ DW_AT_GNU_shared_locks_required = 0x210e,
/* One-definition rule violation detection.
See http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo . */
DW_AT_GNU_odr_signature = 0x210f,
@@ -834,6 +859,7 @@ enum dwarf_source_language
DW_LANG_ObjC_plus_plus = 0x0011,
DW_LANG_UPC = 0x0012,
DW_LANG_D = 0x0013,
+ DW_LANG_Python = 0x0014,
DW_LANG_lo_user = 0x8000, /* Implementation-defined range start. */
DW_LANG_hi_user = 0xffff, /* Implementation-defined range start. */
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 6b257d211cb..7a30a8426f9 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,13 @@
+2009-09-23 Loren J. Rittle <ljrittle@acm.org>
+
+ * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
+ * configure: Rebuilt.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR pch/38987
+ * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
+
2009-09-18 Chris Demetriou <cgd@google.com>
PR preprocessor/28435:
diff --git a/libcpp/configure b/libcpp/configure
index eaf99dd28d6..00cbd7a583d 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -5127,7 +5127,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
for ac_header in locale.h fcntl.h limits.h stddef.h \
- stdlib.h strings.h string.h sys/file.h unistd.h
+ stdlib.h strings.h string.h sys/stat.h sys/file.h unistd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 52465462165..d520e933c90 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -62,7 +62,7 @@ if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
else
AC_LANG(C++)
AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
- stdlib.h strings.h string.h sys/file.h unistd.h)
+ stdlib.h strings.h string.h sys/stat.h sys/file.h unistd.h)
fi
# Checks for typedefs, structures, and compiler characteristics.
diff --git a/libcpp/files.c b/libcpp/files.c
index 96ba7e80afc..ecf9d6c4651 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -288,6 +288,12 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
if (file->name[0] == '\0' || !pfile->cb.valid_pch)
return false;
+ /* If the file is not included as first include from either the toplevel
+ file or the command-line it is not a valid use of PCH. */
+ if (pfile->all_files
+ && pfile->all_files->next_file)
+ return false;
+
flen = strlen (path);
len = flen + sizeof (extension);
pchname = XNEWVEC (char, len);
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 3600fd9e954..f92eb3e675b 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-23 Matthias Klose <doko@ubuntu.com>
+
+ PR libffi/40242, PR libffi/41443
+ * src/arm/sysv.S (__ARM_ARCH__): Define for processors
+ __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
+ __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
+ Change the conditionals to __SOFTFP__ || __ARM_EABI__
+ for -mfloat-abi=softfp to work.
+
2009-09-17 Loren J. Rittle <ljrittle@acm.org>
PR testsuite/32843 (strikes again)
diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S
index 34481c8c46c..4c289c697c7 100644
--- a/libffi/src/arm/sysv.S
+++ b/libffi/src/arm/sysv.S
@@ -67,11 +67,18 @@
#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
- || defined(__ARM_ARCH_6ZK__)
+ || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
+ || defined(__ARM_ARCH_6M__)
# undef __ARM_ARCH__
# define __ARM_ARCH__ 6
#endif
+#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__)
+# undef __ARM_ARCH__
+# define __ARM_ARCH__ 7
+#endif
+
#if __ARM_ARCH__ >= 5
# define call_reg(x) blx x
#elif defined (__ARM_ARCH_4T__)
@@ -189,7 +196,7 @@ ARM_FUNC_START ffi_call_SYSV
@ return INT
cmp r3, #FFI_TYPE_INT
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
cmpne r3, #FFI_TYPE_FLOAT
#endif
streq r0, [r2]
@@ -197,12 +204,12 @@ ARM_FUNC_START ffi_call_SYSV
@ return INT64
cmp r3, #FFI_TYPE_SINT64
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
cmpne r3, #FFI_TYPE_DOUBLE
#endif
stmeqia r2, {r0, r1}
-#ifndef __SOFTFP__
+#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
beq LSYM(Lepilogue)
@ return FLOAT
@@ -245,21 +252,21 @@ ARM_FUNC_START ffi_closure_SYSV
beq .Lretint
cmp r0, #FFI_TYPE_FLOAT
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretint
#else
beq .Lretfloat
#endif
cmp r0, #FFI_TYPE_DOUBLE
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretlonglong
#else
beq .Lretdouble
#endif
cmp r0, #FFI_TYPE_LONGDOUBLE
-#ifdef __SOFTFP__
+#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretlonglong
#else
beq .Lretlongdouble
@@ -278,7 +285,7 @@ ARM_FUNC_START ffi_closure_SYSV
ldr r1, [sp, #4]
b .Lclosure_epilogue
-#ifndef __SOFTFP__
+#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
.Lretfloat:
ldfs f0, [sp]
b .Lclosure_epilogue
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index af4cbfddcdb..ab6348b82fc 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-19 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ * configure.ac: Check for GFORTRAN_C99_1.1 funcs in OS libm.
+ * configure: Regenerate.
+ * config.h.in: Ditto.
+
2009-09-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/41328
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index 4873fd5d934..bdf3b4ac49f 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -108,6 +108,24 @@
/* libm includes cabsl */
#undef HAVE_CABSL
+/* libm includes cacos */
+#undef HAVE_CACOS
+
+/* libm includes cacosf */
+#undef HAVE_CACOSF
+
+/* libm includes cacosh */
+#undef HAVE_CACOSH
+
+/* libm includes cacoshf */
+#undef HAVE_CACOSHF
+
+/* libm includes cacoshl */
+#undef HAVE_CACOSHL
+
+/* libm includes cacosl */
+#undef HAVE_CACOSL
+
/* libm includes carg */
#undef HAVE_CARG
@@ -117,6 +135,42 @@
/* libm includes cargl */
#undef HAVE_CARGL
+/* libm includes casin */
+#undef HAVE_CASIN
+
+/* libm includes casinf */
+#undef HAVE_CASINF
+
+/* libm includes casinh */
+#undef HAVE_CASINH
+
+/* libm includes casinhf */
+#undef HAVE_CASINHF
+
+/* libm includes casinhl */
+#undef HAVE_CASINHL
+
+/* libm includes casinl */
+#undef HAVE_CASINL
+
+/* libm includes catan */
+#undef HAVE_CATAN
+
+/* libm includes catanf */
+#undef HAVE_CATANF
+
+/* libm includes catanh */
+#undef HAVE_CATANH
+
+/* libm includes catanhf */
+#undef HAVE_CATANHF
+
+/* libm includes catanhl */
+#undef HAVE_CATANHL
+
+/* libm includes catanl */
+#undef HAVE_CATANL
+
/* libm includes ccos */
#undef HAVE_CCOS
diff --git a/libgfortran/configure b/libgfortran/configure
index 2738f51337d..5fcd8d23e07 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -23275,6 +23275,818 @@ $as_echo "#define HAVE_LGAMMAL 1" >>confdefs.h
fi
+# Check for GFORTRAN_C99_1.1 funcs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacos in -lm" >&5
+$as_echo_n "checking for cacos in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacos+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacos ();
+int
+main ()
+{
+return cacos ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cacos=yes
+else
+ ac_cv_lib_m_cacos=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacos" >&5
+$as_echo "$ac_cv_lib_m_cacos" >&6; }
+if test "x$ac_cv_lib_m_cacos" = x""yes; then :
+
+$as_echo "#define HAVE_CACOS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosf in -lm" >&5
+$as_echo_n "checking for cacosf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacosf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosf ();
+int
+main ()
+{
+return cacosf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cacosf=yes
+else
+ ac_cv_lib_m_cacosf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacosf" >&5
+$as_echo "$ac_cv_lib_m_cacosf" >&6; }
+if test "x$ac_cv_lib_m_cacosf" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosh in -lm" >&5
+$as_echo_n "checking for cacosh in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacosh+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosh ();
+int
+main ()
+{
+return cacosh ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cacosh=yes
+else
+ ac_cv_lib_m_cacosh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacosh" >&5
+$as_echo "$ac_cv_lib_m_cacosh" >&6; }
+if test "x$ac_cv_lib_m_cacosh" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacoshf in -lm" >&5
+$as_echo_n "checking for cacoshf in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacoshf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacoshf ();
+int
+main ()
+{
+return cacoshf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cacoshf=yes
+else
+ ac_cv_lib_m_cacoshf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacoshf" >&5
+$as_echo "$ac_cv_lib_m_cacoshf" >&6; }
+if test "x$ac_cv_lib_m_cacoshf" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacoshl in -lm" >&5
+$as_echo_n "checking for cacoshl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacoshl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacoshl ();
+int
+main ()
+{
+return cacoshl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cacoshl=yes
+else
+ ac_cv_lib_m_cacoshl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacoshl" >&5
+$as_echo "$ac_cv_lib_m_cacoshl" >&6; }
+if test "x$ac_cv_lib_m_cacoshl" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosl in -lm" >&5
+$as_echo_n "checking for cacosl in -lm... " >&6; }
+if test "${ac_cv_lib_m_cacosl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosl ();
+int
+main ()
+{
+return cacosl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cacosl=yes
+else
+ ac_cv_lib_m_cacosl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cacosl" >&5
+$as_echo "$ac_cv_lib_m_cacosl" >&6; }
+if test "x$ac_cv_lib_m_cacosl" = x""yes; then :
+
+$as_echo "#define HAVE_CACOSL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casin in -lm" >&5
+$as_echo_n "checking for casin in -lm... " >&6; }
+if test "${ac_cv_lib_m_casin+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casin ();
+int
+main ()
+{
+return casin ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_casin=yes
+else
+ ac_cv_lib_m_casin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casin" >&5
+$as_echo "$ac_cv_lib_m_casin" >&6; }
+if test "x$ac_cv_lib_m_casin" = x""yes; then :
+
+$as_echo "#define HAVE_CASIN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinf in -lm" >&5
+$as_echo_n "checking for casinf in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinf ();
+int
+main ()
+{
+return casinf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_casinf=yes
+else
+ ac_cv_lib_m_casinf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinf" >&5
+$as_echo "$ac_cv_lib_m_casinf" >&6; }
+if test "x$ac_cv_lib_m_casinf" = x""yes; then :
+
+$as_echo "#define HAVE_CASINF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinh in -lm" >&5
+$as_echo_n "checking for casinh in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinh+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinh ();
+int
+main ()
+{
+return casinh ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_casinh=yes
+else
+ ac_cv_lib_m_casinh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinh" >&5
+$as_echo "$ac_cv_lib_m_casinh" >&6; }
+if test "x$ac_cv_lib_m_casinh" = x""yes; then :
+
+$as_echo "#define HAVE_CASINH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinhf in -lm" >&5
+$as_echo_n "checking for casinhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinhf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinhf ();
+int
+main ()
+{
+return casinhf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_casinhf=yes
+else
+ ac_cv_lib_m_casinhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinhf" >&5
+$as_echo "$ac_cv_lib_m_casinhf" >&6; }
+if test "x$ac_cv_lib_m_casinhf" = x""yes; then :
+
+$as_echo "#define HAVE_CASINHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinhl in -lm" >&5
+$as_echo_n "checking for casinhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinhl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinhl ();
+int
+main ()
+{
+return casinhl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_casinhl=yes
+else
+ ac_cv_lib_m_casinhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinhl" >&5
+$as_echo "$ac_cv_lib_m_casinhl" >&6; }
+if test "x$ac_cv_lib_m_casinhl" = x""yes; then :
+
+$as_echo "#define HAVE_CASINHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinl in -lm" >&5
+$as_echo_n "checking for casinl in -lm... " >&6; }
+if test "${ac_cv_lib_m_casinl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char casinl ();
+int
+main ()
+{
+return casinl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_casinl=yes
+else
+ ac_cv_lib_m_casinl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_casinl" >&5
+$as_echo "$ac_cv_lib_m_casinl" >&6; }
+if test "x$ac_cv_lib_m_casinl" = x""yes; then :
+
+$as_echo "#define HAVE_CASINL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catan in -lm" >&5
+$as_echo_n "checking for catan in -lm... " >&6; }
+if test "${ac_cv_lib_m_catan+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catan ();
+int
+main ()
+{
+return catan ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_catan=yes
+else
+ ac_cv_lib_m_catan=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catan" >&5
+$as_echo "$ac_cv_lib_m_catan" >&6; }
+if test "x$ac_cv_lib_m_catan" = x""yes; then :
+
+$as_echo "#define HAVE_CATAN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanf in -lm" >&5
+$as_echo_n "checking for catanf in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanf ();
+int
+main ()
+{
+return catanf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_catanf=yes
+else
+ ac_cv_lib_m_catanf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanf" >&5
+$as_echo "$ac_cv_lib_m_catanf" >&6; }
+if test "x$ac_cv_lib_m_catanf" = x""yes; then :
+
+$as_echo "#define HAVE_CATANF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanh in -lm" >&5
+$as_echo_n "checking for catanh in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanh+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanh ();
+int
+main ()
+{
+return catanh ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_catanh=yes
+else
+ ac_cv_lib_m_catanh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanh" >&5
+$as_echo "$ac_cv_lib_m_catanh" >&6; }
+if test "x$ac_cv_lib_m_catanh" = x""yes; then :
+
+$as_echo "#define HAVE_CATANH 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanhf in -lm" >&5
+$as_echo_n "checking for catanhf in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanhf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanhf ();
+int
+main ()
+{
+return catanhf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_catanhf=yes
+else
+ ac_cv_lib_m_catanhf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanhf" >&5
+$as_echo "$ac_cv_lib_m_catanhf" >&6; }
+if test "x$ac_cv_lib_m_catanhf" = x""yes; then :
+
+$as_echo "#define HAVE_CATANHF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanhl in -lm" >&5
+$as_echo_n "checking for catanhl in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanhl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanhl ();
+int
+main ()
+{
+return catanhl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_catanhl=yes
+else
+ ac_cv_lib_m_catanhl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanhl" >&5
+$as_echo "$ac_cv_lib_m_catanhl" >&6; }
+if test "x$ac_cv_lib_m_catanhl" = x""yes; then :
+
+$as_echo "#define HAVE_CATANHL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanl in -lm" >&5
+$as_echo_n "checking for catanl in -lm... " >&6; }
+if test "${ac_cv_lib_m_catanl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catanl ();
+int
+main ()
+{
+return catanl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_catanl=yes
+else
+ ac_cv_lib_m_catanl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_catanl" >&5
+$as_echo "$ac_cv_lib_m_catanl" >&6; }
+if test "x$ac_cv_lib_m_catanl" = x""yes; then :
+
+$as_echo "#define HAVE_CATANL 1" >>confdefs.h
+
+fi
+
+
# On AIX, clog is present in libm as __clog
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __clog in -lm" >&5
$as_echo_n "checking for __clog in -lm... " >&6; }
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 28d5d0f5264..104f2c18d5a 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -409,6 +409,26 @@ AC_CHECK_LIB([m],[lgamma],[AC_DEFINE([HAVE_LGAMMA],[1],[libm includes lgamma])])
AC_CHECK_LIB([m],[lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1],[libm includes lgammaf])])
AC_CHECK_LIB([m],[lgammal],[AC_DEFINE([HAVE_LGAMMAL],[1],[libm includes lgammal])])
+# Check for GFORTRAN_C99_1.1 funcs
+AC_CHECK_LIB([m],[cacos],[AC_DEFINE([HAVE_CACOS],[1],[libm includes cacos])])
+AC_CHECK_LIB([m],[cacosf],[AC_DEFINE([HAVE_CACOSF],[1],[libm includes cacosf])])
+AC_CHECK_LIB([m],[cacosh],[AC_DEFINE([HAVE_CACOSH],[1],[libm includes cacosh])])
+AC_CHECK_LIB([m],[cacoshf],[AC_DEFINE([HAVE_CACOSHF],[1],[libm includes cacoshf])])
+AC_CHECK_LIB([m],[cacoshl],[AC_DEFINE([HAVE_CACOSHL],[1],[libm includes cacoshl])])
+AC_CHECK_LIB([m],[cacosl],[AC_DEFINE([HAVE_CACOSL],[1],[libm includes cacosl])])
+AC_CHECK_LIB([m],[casin],[AC_DEFINE([HAVE_CASIN],[1],[libm includes casin])])
+AC_CHECK_LIB([m],[casinf],[AC_DEFINE([HAVE_CASINF],[1],[libm includes casinf])])
+AC_CHECK_LIB([m],[casinh],[AC_DEFINE([HAVE_CASINH],[1],[libm includes casinh])])
+AC_CHECK_LIB([m],[casinhf],[AC_DEFINE([HAVE_CASINHF],[1],[libm includes casinhf])])
+AC_CHECK_LIB([m],[casinhl],[AC_DEFINE([HAVE_CASINHL],[1],[libm includes casinhl])])
+AC_CHECK_LIB([m],[casinl],[AC_DEFINE([HAVE_CASINL],[1],[libm includes casinl])])
+AC_CHECK_LIB([m],[catan],[AC_DEFINE([HAVE_CATAN],[1],[libm includes catan])])
+AC_CHECK_LIB([m],[catanf],[AC_DEFINE([HAVE_CATANF],[1],[libm includes catanf])])
+AC_CHECK_LIB([m],[catanh],[AC_DEFINE([HAVE_CATANH],[1],[libm includes catanh])])
+AC_CHECK_LIB([m],[catanhf],[AC_DEFINE([HAVE_CATANHF],[1],[libm includes catanhf])])
+AC_CHECK_LIB([m],[catanhl],[AC_DEFINE([HAVE_CATANHL],[1],[libm includes catanhl])])
+AC_CHECK_LIB([m],[catanl],[AC_DEFINE([HAVE_CATANL],[1],[libm includes catanl])])
+
# On AIX, clog is present in libm as __clog
AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index c86cbc6075a..dd1c1a301fc 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-23 Matthew Gingell <gingell@adacore.com>
+
+ * cplus-dem.c (ada_demangle): Ensure demangled is freed.
+
+2009-09-22 Ozkan Sezer <sezeroz@gmail.com>
+
+ * choose-temp.c: Include unistd.h for mingw targets.
+
2009-09-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* hashtab.c [HAVE_INTTYPES_H]: Include <inttypes.h>.
diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c
index b1c2e5b66ba..0a454cfa7ca 100644
--- a/libiberty/choose-temp.c
+++ b/libiberty/choose-temp.c
@@ -22,6 +22,10 @@ Boston, MA 02110-1301, USA. */
#endif
#include <stdio.h> /* May get P_tmpdir. */
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 41674675366..66285141ffa 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -984,7 +984,10 @@ ada_demangle (const char *mangled, int option ATTRIBUTE_UNUSED)
goto Suppress;
if (! changed)
- return NULL;
+ {
+ free (demangled);
+ return NULL;
+ }
else
return demangled;
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index b58bc9966bb..e8ad3b347ce 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,46 @@
+2009-09-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * configure.host (enable_libgcj_sublibs_default): New variable,
+ set for Cygwin and MinGW.
+ * configure.ac (--enable-libgcj-sublibs): New command-line switch.
+ (BUILD_SUBLIBS): New AM_CONDITIONAL relating to it.
+ (libgcj_spec_lgcj_override): New variable, define if building sublibs.
+ (libgcj_spec_lgcj_bc_override): Likewise for when USE_LIBGCJ_BC.
+ (LIBGCJ_SPEC_LGCJ): New variable to abstract "-lgcj" from specs.
+ (LIBGCJ_SPEC_LGCJ_BC): Likewise for when USE_LIBGCJ_BC.
+ (LIBGCJ_SPEC): Use them.
+ * configure: Regenerate.
+ * Makefile.am (LOWER_PACKAGE_FILES_LO): New variable.
+ (ALL_PACKAGE_SOURCE_FILES_LO): Likewise.
+ (NONCORE_PACKAGE_SOURCE_FILES_LO): Likewise.
+ (CORE_PACKAGE_SOURCE_FILES_LO): Likewise.
+ (toolexeclib_LTLIBRARIES): Add libgcj-noncore.la if building sublibs.
+ (libgcj_noncore_la_LIBADD_SUBOBJECTS): New variable.
+ (libgcj_la_LIBADD_SUBOBJECTS): Likewise.
+ (libgcj_la_LDFLAGS_NOUNDEF): Likewise.
+ (libgij_la_LDFLAGS): Add DLL-related options.
+ (libgcj_la_LDFLAGS): Use libgcj_la_LDFLAGS_NOUNDEF and
+ libgcj_la_LIBADD_SUBOBJECTS.
+ (libgcj_la_DEPENDENCIES): Adjust to match.
+ (libgcj_noncore_la_SOURCES, libgcj_noncore_la_LDFLAGS,
+ libgcj_noncore_la_LIBADD, libgcj_noncore_la_DEPENDENCIES,
+ libgcj_noncore_la_LINK): New automake variables for sublibrary.
+ (libgcj_tools_la_LDFLAGS): Add DLL-related flags.
+ (libgcj_tools_la_LIBADD): New variable.
+ (libjvm_la_LDFLAGS): Add DLL-related flags.
+ (lib_gnu_awt_xlib_la_LDFLAGS): Likewise.
+ (libgcj_bc_la_LDFLAGS): Likewise.
+ (libgij_la_DEPENDENCIES): Add dependency on libgcj-noncore.la when
+ building sublibs.
+ (libgcj_tools_la_DEPENDENCIES, libjvm_la_DEPENDENCIES,
+ lib_gnu_awt_xlib_la_DEPENDENCIES, jv_convert_DEPENDENCIES,
+ gcj_dbtool_DEPENDENCIES, gc_analyze_DEPENDENCIES, ecjx_DEPENDENCIES):
+ Likewise.
+ * Makefile.in: Regenerate.
+ * sysdep/i386/backtrace.h (MAIN_FUNC): New #define for main function,
+ set appropriately for Cygwin on that platform or to "main" elsewhere.
+ (fallback_backtrace): Use it to limit stack unwind.
+
2009-09-16 Jonathan Yong <jon_y@users.sourceforge.net>
* gnu/java/security/jce/prng/natVMSecureRandomWin32.cc: Correct
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 7b6750c493c..e923fa30c5e 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -45,6 +45,170 @@ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
toolexecmainlib_DATA = libgcj.spec
+##
+## These files form a closed dependency group at the lower
+## edge of libjava's dependency graph, so can be separated out.
+## For details of how the list was generated, see the GCC wiki:
+##
+## http://gcc.gnu.org/wiki/Internal_dependencies_of_libgcj
+##
+LOWER_PACKAGE_FILES_LO = \
+ $(propertyo_files) \
+ gnu-CORBA.lo \
+ gnu-java-awt-dnd-peer-gtk.lo \
+ gnu-java-awt-peer-gtk.lo \
+ gnu-java-awt-peer-swing.lo \
+ gnu-java-lang-management.lo \
+ gnu-javax-management.lo \
+ gnu-javax-rmi.lo \
+ gnu-javax-sound-midi.lo \
+ gnu-xml-aelfred2.lo \
+ gnu-xml-dom.lo \
+ gnu-xml-libxmlj.lo \
+ gnu-xml-pipeline.lo \
+ gnu-xml-stream.lo \
+ gnu-xml-transform.lo \
+ gnu-xml-util.lo \
+ gnu-xml-validation.lo \
+ gnu-xml-xpath.lo \
+ java-lang-management.lo \
+ javax-imageio.lo \
+ javax-rmi.lo \
+ jni-libjvm.lo \
+ org-omg-CORBA.lo \
+ org-omg-CORBA_2_3.lo \
+ org-omg-CosNaming.lo \
+ org-omg-Dynamic.lo \
+ org-omg-DynamicAny.lo \
+ org-omg-IOP.lo \
+ org-omg-Messaging.lo \
+ org-omg-PortableInterceptor.lo \
+ org-omg-PortableServer.lo \
+ org-omg-SendingContext.lo \
+ org-omg-stub.lo \
+ org-relaxng.lo \
+ org-xml.lo \
+ META-INF/services/java.util.prefs.PreferencesFactory.in.lo \
+ META-INF/services/java.util.prefs.PreferencesFactory.lo \
+ META-INF/services/javax.sound.midi.spi.MidiDeviceProvider.lo \
+ META-INF/services/javax.sound.midi.spi.MidiFileReader.lo \
+ META-INF/services/javax.sound.midi.spi.MidiFileWriter.lo \
+ META-INF/services/javax.sound.sampled.spi.AudioFileReader.lo \
+ classpath/native/jni/classpath/jcl.lo \
+ classpath/native/jni/classpath/jnilink.lo \
+ classpath/native/jni/java-math/gnu_java_math_GMP.lo \
+ classpath/tools/libgcj_tools_la-tools.lo \
+ gnu/awt.lo \
+ gnu/awt/j2d.lo \
+ gnu/gcj/io.lo \
+ gnu/gcj/io/natSimpleSHSStream.lo \
+ gnu/gcj/io/shs.lo \
+ gnu/gcj/tools/gcj_dbtool.lo \
+ gnu/gcj/util/natDebug.lo \
+ gnu/gcj/util/natGCInfo.lo \
+ gnu/java/awt/dnd.lo \
+ gnu/java/awt/font.lo \
+ gnu/java/awt/image.lo \
+ gnu/java/awt/print.lo \
+ gnu/java/awt/font/autofit.lo \
+ gnu/java/awt/font/opentype.lo \
+ gnu/java/awt/font/opentype/truetype.lo \
+ gnu/java/lang/management/natVMClassLoadingMXBeanImpl.lo \
+ gnu/java/lang/management/natVMCompilationMXBeanImpl.lo \
+ gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.lo \
+ gnu/java/lang/management/natVMMemoryMXBeanImpl.lo \
+ gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.lo \
+ gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.lo \
+ gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.lo \
+ gnu/java/lang/management/natVMRuntimeMXBeanImpl.lo \
+ gnu/java/lang/management/natVMThreadMXBeanImpl.lo \
+ gnu/java/net/local.lo \
+ gnu/java/net/protocol/ftp.lo \
+ gnu/java/net/protocol/gcjlib.lo \
+ gnu/java/net/protocol/https.lo \
+ gnu/javax/imageio.lo \
+ gnu/javax/print.lo \
+ gnu/javax/sound.lo \
+ gnu/javax/activation/viewers.lo \
+ gnu/javax/imageio/bmp.lo \
+ gnu/javax/imageio/gif.lo \
+ gnu/javax/imageio/jpeg.lo \
+ gnu/javax/imageio/png.lo \
+ gnu/javax/naming/giop.lo \
+ gnu/javax/naming/ictxImpl/trans.lo \
+ gnu/javax/naming/jndi/url/corbaname.lo \
+ gnu/javax/naming/jndi/url/rmi.lo \
+ gnu/javax/print/ipp.lo \
+ gnu/javax/print/ipp/attribute.lo \
+ gnu/javax/print/ipp/attribute/defaults.lo \
+ gnu/javax/print/ipp/attribute/job.lo \
+ gnu/javax/print/ipp/attribute/printer.lo \
+ gnu/javax/print/ipp/attribute/supported.lo \
+ gnu/javax/security/auth/login.lo \
+ gnu/javax/sound/sampled/AU.lo \
+ gnu/javax/sound/sampled/WAV.lo \
+ gnu/javax/swing/plaf/gnu.lo \
+ gnu/javax/swing/plaf/metal.lo \
+ java/sql.lo \
+ java/awt/im.lo \
+ java/awt/print.lo \
+ java/awt/im/spi.lo \
+ java/security/acl.lo \
+ javax/activation.lo \
+ javax/activity.lo \
+ javax/management.lo \
+ javax/naming.lo \
+ javax/print.lo \
+ javax/sql.lo \
+ javax/tools.lo \
+ javax/transaction.lo \
+ javax/management/loading.lo \
+ javax/management/openmbean.lo \
+ javax/management/remote.lo \
+ javax/management/remote/rmi.lo \
+ javax/naming/directory.lo \
+ javax/naming/event.lo \
+ javax/naming/ldap.lo \
+ javax/naming/spi.lo \
+ javax/print/attribute.lo \
+ javax/print/event.lo \
+ javax/print/attribute/standard.lo \
+ javax/security/cert.lo \
+ javax/security/auth/kerberos.lo \
+ javax/security/auth/login.lo \
+ javax/security/auth/spi.lo \
+ javax/sound/midi.lo \
+ javax/sound/midi/spi.lo \
+ javax/swing/plaf/multi.lo \
+ javax/swing/plaf/synth.lo \
+ javax/swing/text/rtf.lo \
+ javax/swing/text/html/default.css.lo \
+ javax/transaction/xa.lo \
+ org/ietf/jgss.lo \
+ sun/awt.lo
+
+##
+## Lists of all .lo files, and filtered core and non-core lists.
+##
+ALL_PACKAGE_SOURCE_FILES_LO = $(all_packages_source_files:.list=.lo) $(propertyo_files) $(bc_objects)
+NONCORE_PACKAGE_SOURCE_FILES_LO = $(filter $(LOWER_PACKAGE_FILES_LO),$(ALL_PACKAGE_SOURCE_FILES_LO))
+CORE_PACKAGE_SOURCE_FILES_LO = $(filter-out $(LOWER_PACKAGE_FILES_LO),$(ALL_PACKAGE_SOURCE_FILES_LO))
+
+##
+## Assign objects to output libraries.
+##
+if BUILD_SUBLIBS
+toolexeclib_LTLIBRARIES += libgcj-noncore.la
+libgcj_noncore_la_LIBADD_SUBOBJECTS = $(NONCORE_PACKAGE_SOURCE_FILES_LO)
+libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO)
+libgcj_la_LDFLAGS_NOUNDEF = -no-undefined -bindir $(bindir)
+else
+# If not building sublibraries, everything goes in libgcj,
+# and it cannot be usefully built shared on PE platforms.
+libgcj_la_LIBADD_SUBOBJECTS = $(ALL_PACKAGE_SOURCE_FILES_LO)
+libgcj_la_LDFLAGS_NOUNDEF =
+endif
+
if USE_LIBGCJ_BC
toolexeclib_LTLIBRARIES += libgcj_bc.la
endif
@@ -218,10 +382,13 @@ BOOTCLASSPATH = $(srcdir)/classpath/lib
libgij_la_SOURCES = gij.cc
libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+libgij_la_DEPENDENCIES += libgcj-noncore.la
+endif
## See jv_convert_LDADD.
libgij_la_LIBADD = -L$(here)/.libs libgcj.la
## The mysterious backslash in the grep pattern is consumed by make.
-libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
+libgij_la_LDFLAGS = -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
libgij_la_LINK = $(CXXLINK) $(libgij_la_LDFLAGS)
@@ -278,7 +445,7 @@ xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
# certain linuxthread functions get linked:
## The mysterious backslash in the grep pattern is consumed by make.
libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
- $(LIBLTDL) $(SYS_ZLIBS) \
+ $(LIBLTDL) $(SYS_ZLIBS) $(libgcj_la_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
libgcj_la_LIBADD = \
@@ -286,15 +453,13 @@ libgcj_la_LIBADD = \
java/lang/Object.lo \
java/lang/Class.lo \
java/process-$(PLATFORM).lo \
- $(all_packages_source_files:.list=.lo) \
- $(bc_objects) \
- $(propertyo_files) \
+ $(libgcj_la_LIBADD_SUBOBJECTS) \
$(LIBFFI) $(ZLIBS) $(GCLIBS)
libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
java/lang/Object.lo \
java/lang/Class.lo \
java/process-$(PLATFORM).lo \
- $(all_packages_source_files:.list=.lo) \
+ $(ALL_PACKAGE_SOURCE_FILES_LO) \
$(LIBLTDL) $(libgcj_la_LIBADD)
if ANONVERSCRIPT
libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver
@@ -306,6 +471,19 @@ libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
## compiled.
EXTRA_libgcj_la_SOURCES = java/lang/Object.java
+if BUILD_SUBLIBS
+libgcj_noncore_la_SOURCES =
+libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
+libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) \
+ $(LIBFFI) $(ZLIBS) $(GCLIBS) libgcj.la
+libgcj_noncore_la_DEPENDENCIES = libgcj-$(gcc_version).jar $(LIBLTDL) \
+ $(libgcj_noncore_la_LIBADD) libgcj.la
+if ANONVERSCRIPT
+libgcj_noncore_la_DEPENDENCIES += $(srcdir)/libgcj.ver
+endif
+libgcj_noncore_la_LINK = $(libgcj_la_LINK)
+endif
+
# We compile libgcj_tools with -findirect-dispatch so that they can
# depend on external classes: in particular, gjdoc uses antlr. In
# addition, -fno-bootstrap-classes ensures that the tools are loaded
@@ -317,16 +495,24 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \
-fsource-filename=$(here)/classpath/tools/all-classes.lst
libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
+libgcj_tools_la_LIBADD = libgcj.la
libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+libgcj_tools_la_DEPENDENCIES += libgcj-noncore.la
+endif
libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS)
## libjvm.so
libjvm_la_SOURCES = jni-libjvm.cc
libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+libjvm_la_DEPENDENCIES += libgcj-noncore.la
+endif
## See jv_convert_LDADD.
libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
-libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
+libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC) \
+ -no-undefined -bindir $(bindir)
libjvm_la_LINK = $(CXXLINK) $(libjvm_la_LDFLAGS)
## The .db file. This rule is only used for native builds, so it is
@@ -344,6 +530,9 @@ lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
libgcj.la libgcj.spec \
$(lib_gnu_awt_xlib_la_LIBADD)
+if BUILD_SUBLIBS
+lib_gnu_awt_xlib_la_DEPENDENCIES += libgcj-noncore.la
+endif
## We require libstdc++-v3 to be in the same build tree.
lib_gnu_awt_xlib_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
@@ -353,7 +542,7 @@ lib_gnu_awt_xlib_la_CPPFLAGS = \
## The mysterious backslash in the grep pattern is consumed by make.
lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
- -rpath $(toolexeclibdir) \
+ -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
@@ -363,7 +552,7 @@ lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
## This library is not linked against libgcj.
libgcj_bc_la_SOURCES = libgcj_bc.c
libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
libgcj_bc_la_DEPENDENCIES = libgcj.la
libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
@@ -826,6 +1015,9 @@ jv_convert_LDADD = -L$(here)/.libs libgcj.la
## Depend on the spec file to make sure it is up to date before
## linking this program.
jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+jv_convert_DEPENDENCIES += libgcj-noncore.la
+endif
gcj_dbtool_SOURCES = \
gnu/gcj/tools/gcj_dbtool/natMain.cc
@@ -847,6 +1039,9 @@ gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
## Depend on the spec file to make sure it is up to date before
## linking this program.
gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+gcj_dbtool_DEPENDENCIES += libgcj-noncore.la
+endif
gc_analyze_SOURCES =
@@ -861,6 +1056,9 @@ gc_analyze_LDADD = -L$(here)/.libs libgcj-tools.la libgcj.la
## Depend on the spec file to make sure it is up to date before
## linking this program.
gc_analyze_DEPENDENCIES = libgcj-tools.la libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+gc_analyze_DEPENDENCIES += libgcj-noncore.la
+endif
gij_SOURCES =
## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
@@ -899,6 +1097,9 @@ endif !ENABLE_SHARED
ecjx_LDADD = -L$(here)/.libs $(extra_ldflags)
ecjx_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+ecjx_DEPENDENCIES += libgcj-noncore.la
+endif
if USE_LIBGCJ_BC
ecjx_DEPENDENCIES += libgcj_bc.la
else
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 349b9074d34..83c4c606975 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -39,26 +39,32 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
@TESTSUBDIR_TRUE@am__append_1 = testsuite
-@USE_LIBGCJ_BC_TRUE@am__append_2 = libgcj_bc.la
-@XLIB_AWT_TRUE@am__append_3 = lib-gnu-awt-xlib.la
-@INSTALL_ECJ_JAR_TRUE@am__append_4 = $(ECJ_BUILD_JAR)
-@CREATE_GJDOC_TRUE@@NATIVE_TRUE@am__append_5 = gjdoc
+@BUILD_SUBLIBS_TRUE@am__append_2 = libgcj-noncore.la
+@USE_LIBGCJ_BC_TRUE@am__append_3 = libgcj_bc.la
+@XLIB_AWT_TRUE@am__append_4 = lib-gnu-awt-xlib.la
+@INSTALL_ECJ_JAR_TRUE@am__append_5 = $(ECJ_BUILD_JAR)
+@CREATE_GJDOC_TRUE@@NATIVE_TRUE@am__append_6 = gjdoc
@NATIVE_TRUE@noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_4)
@INSTALL_BINARIES_TRUE@@NATIVE_TRUE@bin_PROGRAMS = $(am__EXEEXT_2)
-@INSTALL_BINARIES_FALSE@@NATIVE_TRUE@am__append_6 = $(bin_programs)
-@INSTALL_AOT_RPM_TRUE@am__append_7 = contrib/aot-compile-rpm
+@INSTALL_BINARIES_FALSE@@NATIVE_TRUE@am__append_7 = $(bin_programs)
+@INSTALL_AOT_RPM_TRUE@am__append_8 = contrib/aot-compile-rpm
@BUILD_ECJ1_TRUE@libexecsub_PROGRAMS = ecjx$(EXEEXT)
-@ANONVERSCRIPT_TRUE@am__append_8 = -Wl,--version-script=$(srcdir)/libgcj.ver
-@USING_GCC_TRUE@am__append_9 = $(WARNINGS)
-@USING_BOEHMGC_TRUE@am__append_10 = boehm.cc
-@USING_NOGC_TRUE@am__append_11 = nogc.cc
-@USING_POSIX_PLATFORM_TRUE@am__append_12 = posix.cc
-@USING_WIN32_PLATFORM_TRUE@am__append_13 = win32.cc
-@USING_DARWIN_CRT_TRUE@am__append_14 = darwin.cc
-@USING_POSIX_THREADS_TRUE@am__append_15 = posix-threads.cc
-@USING_WIN32_THREADS_TRUE@am__append_16 = win32-threads.cc
-@USING_NO_THREADS_TRUE@am__append_17 = no-threads.cc
-@ANONVERSCRIPT_TRUE@am__append_18 = $(srcdir)/libgcj.ver
+@ANONVERSCRIPT_TRUE@am__append_9 = -Wl,--version-script=$(srcdir)/libgcj.ver
+@USING_GCC_TRUE@am__append_10 = $(WARNINGS)
+@BUILD_SUBLIBS_TRUE@am__append_11 = libgcj-noncore.la
+@USING_BOEHMGC_TRUE@am__append_12 = boehm.cc
+@USING_NOGC_TRUE@am__append_13 = nogc.cc
+@USING_POSIX_PLATFORM_TRUE@am__append_14 = posix.cc
+@USING_WIN32_PLATFORM_TRUE@am__append_15 = win32.cc
+@USING_DARWIN_CRT_TRUE@am__append_16 = darwin.cc
+@USING_POSIX_THREADS_TRUE@am__append_17 = posix-threads.cc
+@USING_WIN32_THREADS_TRUE@am__append_18 = win32-threads.cc
+@USING_NO_THREADS_TRUE@am__append_19 = no-threads.cc
+@ANONVERSCRIPT_TRUE@am__append_20 = $(srcdir)/libgcj.ver
+@ANONVERSCRIPT_TRUE@@BUILD_SUBLIBS_TRUE@am__append_21 = $(srcdir)/libgcj.ver
+@BUILD_SUBLIBS_TRUE@am__append_22 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_23 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_24 = libgcj-noncore.la
DIST_COMMON = README $(am__configure_deps) $(srcdir)/../compile \
$(srcdir)/../config.guess $(srcdir)/../config.sub \
$(srcdir)/../depcomp $(srcdir)/../install-sh \
@@ -76,10 +82,14 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/../compile \
$(top_srcdir)/gnu/java/nio/natVMSelector${PLATFORM}.cc \
$(top_srcdir)/java/lang/nat${PLATFORM}Process.cc \
$(top_srcdir)/scripts/jar.in COPYING ChangeLog NEWS THANKS
-@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@am__append_19 = gen-from-JIS
-@NATIVE_TRUE@@USE_LIBGCJ_BC_TRUE@am__append_20 = libgcj_bc.la
-@NATIVE_TRUE@@USE_LIBGCJ_BC_FALSE@am__append_21 = libgcj.la
-@XLIB_AWT_TRUE@am__append_22 = $(xlib_nat_headers)
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@am__append_25 = gen-from-JIS
+@BUILD_SUBLIBS_TRUE@am__append_26 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_27 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_28 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@@NATIVE_TRUE@am__append_29 = libgcj-noncore.la
+@NATIVE_TRUE@@USE_LIBGCJ_BC_TRUE@am__append_30 = libgcj_bc.la
+@NATIVE_TRUE@@USE_LIBGCJ_BC_FALSE@am__append_31 = libgcj.la
+@XLIB_AWT_TRUE@am__append_32 = $(xlib_nat_headers)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libltdl/acinclude.m4 \
@@ -174,10 +184,14 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt_xlib_la-natClip.lo \
am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1)
lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS)
@XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir)
-libgcj_tools_la_LIBADD =
+am__DEPENDENCIES_1 =
+am_libgcj_noncore_la_OBJECTS =
+libgcj_noncore_la_OBJECTS = $(am_libgcj_noncore_la_OBJECTS)
+@BUILD_SUBLIBS_TRUE@am_libgcj_noncore_la_rpath = -rpath \
+@BUILD_SUBLIBS_TRUE@ $(toolexeclibdir)
am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo
libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
-@INTERPRETER_TRUE@am__DEPENDENCIES_1 = gnu/classpath/jdwp.lo \
+@INTERPRETER_TRUE@am__DEPENDENCIES_2 = gnu/classpath/jdwp.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/event.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/event/filters.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/exception.lo \
@@ -186,7 +200,7 @@ libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
@INTERPRETER_TRUE@ gnu/classpath/jdwp/transport.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/util.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/value.lo gnu/gcj/jvmti.lo
-am__DEPENDENCIES_2 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
+am__DEPENDENCIES_3 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
gnu/classpath/debug.lo gnu/classpath/toolkit.lo gnu/gcj.lo \
gnu/gcj/convert.lo gnu/gcj/io.lo gnu/gcj/runtime.lo \
gnu/gcj/util.lo gnu/java/awt.lo gnu/java/awt/color.lo \
@@ -303,8 +317,12 @@ am__DEPENDENCIES_2 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
javax/swing/undo.lo javax/tools.lo javax/transaction.lo \
javax/transaction/xa.lo org/ietf/jgss.lo sun/awt.lo \
sun/misc.lo sun/reflect.lo sun/reflect/annotation.lo \
- sun/reflect/misc.lo $(am__DEPENDENCIES_1)
-am__DEPENDENCIES_3 =
+ sun/reflect/misc.lo $(am__DEPENDENCIES_2)
+am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(propertyo_files) \
+ $(bc_objects)
+@BUILD_SUBLIBS_FALSE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_4)
+@BUILD_SUBLIBS_TRUE@am__DEPENDENCIES_5 = \
+@BUILD_SUBLIBS_TRUE@ $(CORE_PACKAGE_SOURCE_FILES_LO)
am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc \
stacktrace.cc link.cc defineclass.cc verify.cc jvmti.cc \
interpret.cc gnu/classpath/jdwp/natVMFrame.cc \
@@ -538,23 +556,23 @@ GCJCOMPILE = $(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)
LTGCJCOMPILE = $(LIBTOOL) --tag=GCJ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)
GCJLD = $(GCJ)
-SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) $(libgcj_tools_la_SOURCES) \
- $(libgcj_la_SOURCES) $(EXTRA_libgcj_la_SOURCES) \
- $(libgcj_bc_la_SOURCES) $(libgij_la_SOURCES) \
- $(libjvm_la_SOURCES) $(ecjx_SOURCES) $(gappletviewer_SOURCES) \
- $(gc_analyze_SOURCES) $(gcj_dbtool_SOURCES) $(gcjh_SOURCES) \
- $(gen_from_JIS_SOURCES) $(gij_SOURCES) $(gjar_SOURCES) \
- $(gjarsigner_SOURCES) $(gjavah_SOURCES) $(gjdoc_SOURCES) \
- $(gkeytool_SOURCES) $(gnative2ascii_SOURCES) $(gorbd_SOURCES) \
- $(grmic_SOURCES) $(grmid_SOURCES) $(grmiregistry_SOURCES) \
- $(gserialver_SOURCES) $(gtnameserv_SOURCES) \
- $(jv_convert_SOURCES)
-DIST_SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) \
- $(libgcj_tools_la_SOURCES) $(am__libgcj_la_SOURCES_DIST) \
+SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) $(libgcj_noncore_la_SOURCES) \
+ $(libgcj_tools_la_SOURCES) $(libgcj_la_SOURCES) \
$(EXTRA_libgcj_la_SOURCES) $(libgcj_bc_la_SOURCES) \
$(libgij_la_SOURCES) $(libjvm_la_SOURCES) $(ecjx_SOURCES) \
$(gappletviewer_SOURCES) $(gc_analyze_SOURCES) \
- $(gcj_dbtool_SOURCES) $(gcjh_SOURCES) \
+ $(gcj_dbtool_SOURCES) $(gcjh_SOURCES) $(gen_from_JIS_SOURCES) \
+ $(gij_SOURCES) $(gjar_SOURCES) $(gjarsigner_SOURCES) \
+ $(gjavah_SOURCES) $(gjdoc_SOURCES) $(gkeytool_SOURCES) \
+ $(gnative2ascii_SOURCES) $(gorbd_SOURCES) $(grmic_SOURCES) \
+ $(grmid_SOURCES) $(grmiregistry_SOURCES) $(gserialver_SOURCES) \
+ $(gtnameserv_SOURCES) $(jv_convert_SOURCES)
+DIST_SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) \
+ $(libgcj_noncore_la_SOURCES) $(libgcj_tools_la_SOURCES) \
+ $(am__libgcj_la_SOURCES_DIST) $(EXTRA_libgcj_la_SOURCES) \
+ $(libgcj_bc_la_SOURCES) $(libgij_la_SOURCES) \
+ $(libjvm_la_SOURCES) $(ecjx_SOURCES) $(gappletviewer_SOURCES) \
+ $(gc_analyze_SOURCES) $(gcj_dbtool_SOURCES) $(gcjh_SOURCES) \
$(am__gen_from_JIS_SOURCES_DIST) $(gij_SOURCES) \
$(gjar_SOURCES) $(gjarsigner_SOURCES) $(gjavah_SOURCES) \
$(gjdoc_SOURCES) $(gkeytool_SOURCES) $(gnative2ascii_SOURCES) \
@@ -802,7 +820,7 @@ dvidir = @dvidir@
exec_prefix = @exec_prefix@
extra_gij_ldflags = @extra_gij_ldflags@
extra_ldflags = @extra_ldflags@
-extra_ldflags_libjava = @extra_ldflags_libjava@ $(am__append_8)
+extra_ldflags_libjava = @extra_ldflags_libjava@ $(am__append_9)
gcc_suffix = @gcc_suffix@
gcjsubdir = @gcjsubdir@
gxx_include_dir = @gxx_include_dir@
@@ -883,13 +901,158 @@ write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la \
- $(am__append_2) $(am__append_3)
+ $(am__append_2) $(am__append_3) $(am__append_4)
toolexecmainlib_DATA = libgcj.spec
+LOWER_PACKAGE_FILES_LO = \
+ $(propertyo_files) \
+ gnu-CORBA.lo \
+ gnu-java-awt-dnd-peer-gtk.lo \
+ gnu-java-awt-peer-gtk.lo \
+ gnu-java-awt-peer-swing.lo \
+ gnu-java-lang-management.lo \
+ gnu-javax-management.lo \
+ gnu-javax-rmi.lo \
+ gnu-javax-sound-midi.lo \
+ gnu-xml-aelfred2.lo \
+ gnu-xml-dom.lo \
+ gnu-xml-libxmlj.lo \
+ gnu-xml-pipeline.lo \
+ gnu-xml-stream.lo \
+ gnu-xml-transform.lo \
+ gnu-xml-util.lo \
+ gnu-xml-validation.lo \
+ gnu-xml-xpath.lo \
+ java-lang-management.lo \
+ javax-imageio.lo \
+ javax-rmi.lo \
+ jni-libjvm.lo \
+ org-omg-CORBA.lo \
+ org-omg-CORBA_2_3.lo \
+ org-omg-CosNaming.lo \
+ org-omg-Dynamic.lo \
+ org-omg-DynamicAny.lo \
+ org-omg-IOP.lo \
+ org-omg-Messaging.lo \
+ org-omg-PortableInterceptor.lo \
+ org-omg-PortableServer.lo \
+ org-omg-SendingContext.lo \
+ org-omg-stub.lo \
+ org-relaxng.lo \
+ org-xml.lo \
+ META-INF/services/java.util.prefs.PreferencesFactory.in.lo \
+ META-INF/services/java.util.prefs.PreferencesFactory.lo \
+ META-INF/services/javax.sound.midi.spi.MidiDeviceProvider.lo \
+ META-INF/services/javax.sound.midi.spi.MidiFileReader.lo \
+ META-INF/services/javax.sound.midi.spi.MidiFileWriter.lo \
+ META-INF/services/javax.sound.sampled.spi.AudioFileReader.lo \
+ classpath/native/jni/classpath/jcl.lo \
+ classpath/native/jni/classpath/jnilink.lo \
+ classpath/native/jni/java-math/gnu_java_math_GMP.lo \
+ classpath/tools/libgcj_tools_la-tools.lo \
+ gnu/awt.lo \
+ gnu/awt/j2d.lo \
+ gnu/gcj/io.lo \
+ gnu/gcj/io/natSimpleSHSStream.lo \
+ gnu/gcj/io/shs.lo \
+ gnu/gcj/tools/gcj_dbtool.lo \
+ gnu/gcj/util/natDebug.lo \
+ gnu/gcj/util/natGCInfo.lo \
+ gnu/java/awt/dnd.lo \
+ gnu/java/awt/font.lo \
+ gnu/java/awt/image.lo \
+ gnu/java/awt/print.lo \
+ gnu/java/awt/font/autofit.lo \
+ gnu/java/awt/font/opentype.lo \
+ gnu/java/awt/font/opentype/truetype.lo \
+ gnu/java/lang/management/natVMClassLoadingMXBeanImpl.lo \
+ gnu/java/lang/management/natVMCompilationMXBeanImpl.lo \
+ gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.lo \
+ gnu/java/lang/management/natVMMemoryMXBeanImpl.lo \
+ gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.lo \
+ gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.lo \
+ gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.lo \
+ gnu/java/lang/management/natVMRuntimeMXBeanImpl.lo \
+ gnu/java/lang/management/natVMThreadMXBeanImpl.lo \
+ gnu/java/net/local.lo \
+ gnu/java/net/protocol/ftp.lo \
+ gnu/java/net/protocol/gcjlib.lo \
+ gnu/java/net/protocol/https.lo \
+ gnu/javax/imageio.lo \
+ gnu/javax/print.lo \
+ gnu/javax/sound.lo \
+ gnu/javax/activation/viewers.lo \
+ gnu/javax/imageio/bmp.lo \
+ gnu/javax/imageio/gif.lo \
+ gnu/javax/imageio/jpeg.lo \
+ gnu/javax/imageio/png.lo \
+ gnu/javax/naming/giop.lo \
+ gnu/javax/naming/ictxImpl/trans.lo \
+ gnu/javax/naming/jndi/url/corbaname.lo \
+ gnu/javax/naming/jndi/url/rmi.lo \
+ gnu/javax/print/ipp.lo \
+ gnu/javax/print/ipp/attribute.lo \
+ gnu/javax/print/ipp/attribute/defaults.lo \
+ gnu/javax/print/ipp/attribute/job.lo \
+ gnu/javax/print/ipp/attribute/printer.lo \
+ gnu/javax/print/ipp/attribute/supported.lo \
+ gnu/javax/security/auth/login.lo \
+ gnu/javax/sound/sampled/AU.lo \
+ gnu/javax/sound/sampled/WAV.lo \
+ gnu/javax/swing/plaf/gnu.lo \
+ gnu/javax/swing/plaf/metal.lo \
+ java/sql.lo \
+ java/awt/im.lo \
+ java/awt/print.lo \
+ java/awt/im/spi.lo \
+ java/security/acl.lo \
+ javax/activation.lo \
+ javax/activity.lo \
+ javax/management.lo \
+ javax/naming.lo \
+ javax/print.lo \
+ javax/sql.lo \
+ javax/tools.lo \
+ javax/transaction.lo \
+ javax/management/loading.lo \
+ javax/management/openmbean.lo \
+ javax/management/remote.lo \
+ javax/management/remote/rmi.lo \
+ javax/naming/directory.lo \
+ javax/naming/event.lo \
+ javax/naming/ldap.lo \
+ javax/naming/spi.lo \
+ javax/print/attribute.lo \
+ javax/print/event.lo \
+ javax/print/attribute/standard.lo \
+ javax/security/cert.lo \
+ javax/security/auth/kerberos.lo \
+ javax/security/auth/login.lo \
+ javax/security/auth/spi.lo \
+ javax/sound/midi.lo \
+ javax/sound/midi/spi.lo \
+ javax/swing/plaf/multi.lo \
+ javax/swing/plaf/synth.lo \
+ javax/swing/text/rtf.lo \
+ javax/swing/text/html/default.css.lo \
+ javax/transaction/xa.lo \
+ org/ietf/jgss.lo \
+ sun/awt.lo
+
+ALL_PACKAGE_SOURCE_FILES_LO = $(all_packages_source_files:.list=.lo) $(propertyo_files) $(bc_objects)
+NONCORE_PACKAGE_SOURCE_FILES_LO = $(filter $(LOWER_PACKAGE_FILES_LO),$(ALL_PACKAGE_SOURCE_FILES_LO))
+CORE_PACKAGE_SOURCE_FILES_LO = $(filter-out $(LOWER_PACKAGE_FILES_LO),$(ALL_PACKAGE_SOURCE_FILES_LO))
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LIBADD_SUBOBJECTS = $(NONCORE_PACKAGE_SOURCE_FILES_LO)
+# If not building sublibraries, everything goes in libgcj,
+# and it cannot be usefully built shared on PE platforms.
+@BUILD_SUBLIBS_FALSE@libgcj_la_LIBADD_SUBOBJECTS = $(ALL_PACKAGE_SOURCE_FILES_LO)
+@BUILD_SUBLIBS_TRUE@libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO)
+@BUILD_SUBLIBS_FALSE@libgcj_la_LDFLAGS_NOUNDEF =
+@BUILD_SUBLIBS_TRUE@libgcj_la_LDFLAGS_NOUNDEF = -no-undefined -bindir $(bindir)
dbexec_LTLIBRARIES = libjvm.la
pkgconfigdir = $(libdir)/pkgconfig
jardir = $(datadir)/java
jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar \
- $(am__append_4)
+ $(am__append_5)
@JAVA_HOME_SET_FALSE@JAVA_HOME_DIR = $(prefix)
@JAVA_HOME_SET_TRUE@JAVA_HOME_DIR = $(JAVA_HOME)
@JAVA_HOME_SET_FALSE@BOOT_CLASS_PATH_DIR = $(jardir)/libgcj-$(gcc_version).jar
@@ -899,10 +1062,10 @@ db_pathtail = $(gcjsubdir)/$(db_name)
@NATIVE_TRUE@bin_programs = jv-convert gij grmic grmiregistry \
@NATIVE_TRUE@ gcj-dbtool gappletviewer gjarsigner gkeytool gjar \
@NATIVE_TRUE@ gcjh gjavah gnative2ascii gorbd grmid gserialver \
-@NATIVE_TRUE@ gtnameserv gc-analyze $(am__append_5)
+@NATIVE_TRUE@ gtnameserv gc-analyze $(am__append_6)
@NATIVE_TRUE@dbexec_DATA = $(db_name)
bin_SCRIPTS = contrib/rebuild-gcj-db contrib/aot-compile \
- $(am__append_7)
+ $(am__append_8)
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
GCJLINK = $(LIBTOOL) --tag=GCJ $(LIBTOOLFLAGS) --mode=link $(GCJ) -L$(here) \
@@ -944,7 +1107,7 @@ AM_GCJFLAGS = \
--encoding=UTF-8 \
-Wno-deprecated -fbootstrap-classes
-AM_CFLAGS = @LIBGCJ_CFLAGS@ $(am__append_9)
+AM_CFLAGS = @LIBGCJ_CFLAGS@ $(am__append_10)
@SUPPRESS_LIBGCJ_BC_FALSE@LIBGCJ_BC_FLAGS = -findirect-dispatch -fno-indirect-classes
@SUPPRESS_LIBGCJ_BC_TRUE@LIBGCJ_BC_FLAGS =
@BUILD_LIBGCJ_REDUCED_REFLECTION_FALSE@LIBGCJ_REDUCED_REFLECTION_FLAGS =
@@ -962,9 +1125,9 @@ AM_CPPFLAGS = -I$(top_srcdir) \
BOOTCLASSPATH = $(srcdir)/classpath/lib
libgij_la_SOURCES = gij.cc
-libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
+libgij_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_11)
libgij_la_LIBADD = -L$(here)/.libs libgcj.la
-libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
+libgij_la_LDFLAGS = -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
libgij_la_LINK = $(CXXLINK) $(libgij_la_LDFLAGS)
@@ -972,16 +1135,16 @@ libgij_la_LINK = $(CXXLINK) $(libgij_la_LDFLAGS)
@INTERPRETER_TRUE@libgcj_interpret_source_files = jvmti.cc interpret.cc
libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc link.cc \
defineclass.cc verify.cc $(libgcj_interpret_source_files) \
- $(nat_source_files) $(am__append_10) $(am__append_11) \
- $(am__append_12) $(am__append_13) $(am__append_14) \
- $(am__append_15) $(am__append_16) $(am__append_17)
+ $(nat_source_files) $(am__append_12) $(am__append_13) \
+ $(am__append_14) $(am__append_15) $(am__append_16) \
+ $(am__append_17) $(am__append_18) $(am__append_19)
nat_files = $(nat_source_files:.cc=.lo)
xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
# Include THREADLIBS here to ensure that the correct version of
# certain linuxthread functions get linked:
libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
- $(LIBLTDL) $(SYS_ZLIBS) \
+ $(LIBLTDL) $(SYS_ZLIBS) $(libgcj_la_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
@@ -990,17 +1153,25 @@ libgcj_la_LIBADD = \
java/lang/Object.lo \
java/lang/Class.lo \
java/process-$(PLATFORM).lo \
- $(all_packages_source_files:.list=.lo) \
- $(bc_objects) \
- $(propertyo_files) \
+ $(libgcj_la_LIBADD_SUBOBJECTS) \
$(LIBFFI) $(ZLIBS) $(GCLIBS)
libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar java/lang/Object.lo \
java/lang/Class.lo java/process-$(PLATFORM).lo \
- $(all_packages_source_files:.list=.lo) $(LIBLTDL) \
- $(libgcj_la_LIBADD) $(am__append_18)
+ $(ALL_PACKAGE_SOURCE_FILES_LO) $(LIBLTDL) $(libgcj_la_LIBADD) \
+ $(am__append_20)
libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
EXTRA_libgcj_la_SOURCES = java/lang/Object.java
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_SOURCES =
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) \
+@BUILD_SUBLIBS_TRUE@ $(LIBFFI) $(ZLIBS) $(GCLIBS) libgcj.la
+
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_DEPENDENCIES = \
+@BUILD_SUBLIBS_TRUE@ libgcj-$(gcc_version).jar $(LIBLTDL) \
+@BUILD_SUBLIBS_TRUE@ $(libgcj_noncore_la_LIBADD) libgcj.la \
+@BUILD_SUBLIBS_TRUE@ $(am__append_21)
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LINK = $(libgcj_la_LINK)
# We compile libgcj_tools with -findirect-dispatch so that they can
# depend on external classes: in particular, gjdoc uses antlr. In
@@ -1014,21 +1185,22 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \
libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
-libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
+libgcj_tools_la_LIBADD = libgcj.la
+libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_22)
libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS)
libjvm_la_SOURCES = jni-libjvm.cc
-libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
+libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_23)
libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
-libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
+libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC) \
+ -no-undefined -bindir $(bindir)
+
libjvm_la_LINK = $(CXXLINK) $(libjvm_la_LDFLAGS)
lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
-lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
- libgcj.la libgcj.spec \
- $(lib_gnu_awt_xlib_la_LIBADD)
-
+lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar libgcj.la \
+ libgcj.spec $(lib_gnu_awt_xlib_la_LIBADD) $(am__append_24)
lib_gnu_awt_xlib_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I../libstdc++-v3/include \
@@ -1037,13 +1209,13 @@ lib_gnu_awt_xlib_la_CPPFLAGS = \
lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
- -rpath $(toolexeclibdir) \
+ -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
libgcj_bc_la_SOURCES = libgcj_bc.c
libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
libgcj_bc_la_DEPENDENCIES = libgcj.la
libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
@@ -8306,7 +8478,7 @@ jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
jv_convert_LINK = $(GCJLINK) $(jv_convert_LDFLAGS)
jv_convert_LDADD = -L$(here)/.libs libgcj.la
-jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
+jv_convert_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_26)
gcj_dbtool_SOURCES = \
gnu/gcj/tools/gcj_dbtool/natMain.cc
@@ -8315,14 +8487,16 @@ gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
gcj_dbtool_LINK = $(GCJLINK) $(gcj_dbtool_LDFLAGS)
gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
-gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
+gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la \
+ libgcj.spec $(am__append_27)
gc_analyze_SOURCES =
gc_analyze_LDFLAGS = --main=gnu.gcj.tools.gc_analyze.MemoryAnalyze \
-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
gc_analyze_LINK = $(GCJLINK) $(gc_analyze_LDFLAGS)
gc_analyze_LDADD = -L$(here)/.libs libgcj-tools.la libgcj.la
-gc_analyze_DEPENDENCIES = libgcj-tools.la libgcj.la libgcj.spec
+gc_analyze_DEPENDENCIES = libgcj-tools.la libgcj.la libgcj.spec \
+ $(am__append_28)
gij_SOURCES =
gij_LDFLAGS = -rpath $(dbexecdir) -rpath $(toolexeclibdir) \
-shared-libgcc $(THREADLDFLAGS) $(extra_ldflags) \
@@ -8342,10 +8516,10 @@ ECJX_BASE_FLAGS = -findirect-dispatch \
@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
@NATIVE_FALSE@ecjx_LDADD =
@NATIVE_TRUE@ecjx_LDADD = -L$(here)/.libs $(extra_ldflags) \
-@NATIVE_TRUE@ $(am__append_21)
+@NATIVE_TRUE@ $(am__append_31)
@NATIVE_FALSE@ecjx_DEPENDENCIES =
@NATIVE_TRUE@ecjx_DEPENDENCIES = libgcj.la libgcj.spec \
-@NATIVE_TRUE@ $(am__append_20)
+@NATIVE_TRUE@ $(am__append_29) $(am__append_30)
gappletviewer_SOURCES =
gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
@@ -8562,7 +8736,7 @@ gnu/gcj/xlib/natXImage.cc \
gnu/gcj/xlib/natXUnmapEvent.cc
sourcesdir = $(jardir)
-headers_to_make = $(nat_headers) $(am__append_22)
+headers_to_make = $(nat_headers) $(am__append_32)
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
@@ -8803,6 +8977,8 @@ gnu/gcj/xlib/lib_gnu_awt_xlib_la-natXImage.lo: \
gnu/gcj/xlib/lib_gnu_awt_xlib_la-natXUnmapEvent.lo: \
gnu/gcj/xlib/$(am__dirstamp) \
gnu/gcj/xlib/$(DEPDIR)/$(am__dirstamp)
+libgcj-noncore.la: $(libgcj_noncore_la_OBJECTS) $(libgcj_noncore_la_DEPENDENCIES)
+ $(libgcj_noncore_la_LINK) $(am_libgcj_noncore_la_rpath) $(libgcj_noncore_la_OBJECTS) $(libgcj_noncore_la_LIBADD) $(LIBS)
classpath/tools/$(am__dirstamp):
@$(MKDIR_P) classpath/tools
@: > classpath/tools/$(am__dirstamp)
diff --git a/libjava/configure b/libjava/configure
index a7c464a0bdb..5e92946deb9 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -915,6 +915,8 @@ XLIB_AWT_FALSE
XLIB_AWT_TRUE
TOOLKIT
LIBGCJDEBUG
+BUILD_SUBLIBS_FALSE
+BUILD_SUBLIBS_TRUE
LIBGCJ_LD_SYMBOLIC_FUNCTIONS
LIBGCJ_LD_SYMBOLIC
LIBGCJ_JAVAFLAGS
@@ -1054,6 +1056,7 @@ enable_gjdoc
enable_java_maintainer_mode
enable_dependency_tracking
enable_maintainer_mode
+enable_libgcj_sublibs
enable_libgcj_debug
with_escher
enable_java_awt
@@ -1745,6 +1748,7 @@ Optional Features:
--enable-dependency-tracking do not reject slow dependency extractors
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
+ --enable-libgcj-sublibs build libgcj as many sub-libraries
--enable-libgcj-debug enable runtime debugging code
--enable-java-awt list of AWT peer implementations to be built
--enable-shared[=PKGS] build shared libraries [default=yes]
@@ -5935,6 +5939,7 @@ fi
# libgcj_cflags - host specific C compiler flags
# libgcj_cxxflags - host specific C++ compiler flags
# libgcj_javaflags - host specific Java compiler flags
+# and a number of others; see the list at the start of the file.
libgcj_cflags=
libgcj_cxxflags=
@@ -6536,6 +6541,35 @@ fi
ac_config_headers="$ac_config_headers include/config.h gcj/libgcj-config.h"
+# Possibly build libgcj as many sub-libraries.
+# Check whether --enable-libgcj-sublibs was given.
+if test "${enable_libgcj_sublibs+set}" = set; then :
+ enableval=$enable_libgcj_sublibs;
+fi
+
+
+if test -z "$enable_libgcj_sublibs"; then
+ enable_libgcj_sublibs=$enable_libgcj_sublibs_default
+fi
+ if test "$enable_libgcj_sublibs" = yes; then
+ BUILD_SUBLIBS_TRUE=
+ BUILD_SUBLIBS_FALSE='#'
+else
+ BUILD_SUBLIBS_TRUE='#'
+ BUILD_SUBLIBS_FALSE=
+fi
+
+if test "$enable_libgcj_sublibs" = yes ; then
+ # In theory we could make do with only one override and simply
+ # tag "_bc" onto the end of it when we use it to generate the
+ # spec, but that's an ugly thing to do when there are multiple
+ # words in the string and you're relying on the ordering to
+ # append the correct one.
+ libgcj_spec_lgcj_override="-lgcj-noncore -lgcj"
+ libgcj_spec_lgcj_bc_override="-lgcj-noncore -lgcj_bc"
+fi
+
+
# See if the user has requested runtime debugging.
LIBGCJDEBUG="disable"
@@ -7464,13 +7498,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:7467: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:7501: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:7470: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:7504: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:7473: output\"" >&5)
+ (eval echo "\"\$as_me:7507: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -8665,7 +8699,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 8668 "configure"' > conftest.$ac_ext
+ echo '#line 8702 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -10599,11 +10633,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10602: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10636: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:10606: \$? = $ac_status" >&5
+ echo "$as_me:10640: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -10938,11 +10972,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10941: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10975: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:10945: \$? = $ac_status" >&5
+ echo "$as_me:10979: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -11043,11 +11077,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11046: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11080: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11050: \$? = $ac_status" >&5
+ echo "$as_me:11084: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11098,11 +11132,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11101: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11135: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11105: \$? = $ac_status" >&5
+ echo "$as_me:11139: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -13507,7 +13541,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13510 "configure"
+#line 13544 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13603,7 +13637,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13606 "configure"
+#line 13640 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15565,11 +15599,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15568: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15602: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15572: \$? = $ac_status" >&5
+ echo "$as_me:15606: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -15664,11 +15698,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15667: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15701: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15671: \$? = $ac_status" >&5
+ echo "$as_me:15705: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15716,11 +15750,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15719: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15753: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15723: \$? = $ac_status" >&5
+ echo "$as_me:15757: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17132,11 +17166,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17135: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17169: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17139: \$? = $ac_status" >&5
+ echo "$as_me:17173: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17465,11 +17499,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17468: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17502: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17472: \$? = $ac_status" >&5
+ echo "$as_me:17506: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17564,11 +17598,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17567: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17601: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17571: \$? = $ac_status" >&5
+ echo "$as_me:17605: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17616,11 +17650,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17619: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17653: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17623: \$? = $ac_status" >&5
+ echo "$as_me:17657: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19218,7 +19252,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then :
enableval=$enable_sjlj_exceptions; :
else
cat > conftest.$ac_ext << EOF
-#line 19221 "configure"
+#line 19255 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -20310,6 +20344,9 @@ arm*linux*eabi)
LIBSTDCXXSPEC=-lstdc++
LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -L`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -rpath `${PWDCMD-pwd}`/.libs:`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -lstdc++"
;;
+*-*-cygwin)
+ extra_ldflags_libjava=-liconv
+ ;;
esac
@@ -20552,9 +20589,17 @@ ac_config_links="$ac_config_links sysdep/backtrace.h:$fallback_backtrace_h"
ac_config_links="$ac_config_links sysdep/descriptor.h:$descriptor_h"
-LIBGCJ_SPEC="%{s-bc-abi:} -lgcj"
+LIBGCJ_SPEC_LGCJ=-lgcj
+LIBGCJ_SPEC_LGCJ_BC=-lgcj_bc
+if test x"$libgcj_spec_lgcj_override" != x ; then
+ LIBGCJ_SPEC_LGCJ=$libgcj_spec_lgcj_override
+fi
+if test x"$libgcj_spec_lgcj_bc_override" != x ; then
+ LIBGCJ_SPEC_LGCJ_BC=$libgcj_spec_lgcj_bc_override
+fi
+LIBGCJ_SPEC="%{s-bc-abi:} $LIBGCJ_SPEC_LGCJ"
if test "$use_libgcj_bc" = yes; then
- LIBGCJ_SPEC="%{static|static-libgcj|!s-bc-abi:-lgcj;:-lgcj_bc}"
+ LIBGCJ_SPEC="%{static|static-libgcj|!s-bc-abi:$LIBGCJ_SPEC_LGCJ;:$LIBGCJ_SPEC_LGCJ_BC}"
LIBGCJ_BC_SPEC="%{findirect-dispatch:-fPIC}"
fi
@@ -24607,6 +24652,10 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BUILD_SUBLIBS_TRUE}" && test -z "${BUILD_SUBLIBS_FALSE}"; then
+ as_fn_error "conditional \"BUILD_SUBLIBS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${XLIB_AWT_TRUE}" && test -z "${XLIB_AWT_FALSE}"; then
as_fn_error "conditional \"XLIB_AWT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libjava/configure.ac b/libjava/configure.ac
index c6bcbf4d7e6..c2418dc2bba 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -206,6 +206,7 @@ AC_EXEEXT
# libgcj_cflags - host specific C compiler flags
# libgcj_cxxflags - host specific C++ compiler flags
# libgcj_javaflags - host specific Java compiler flags
+# and a number of others; see the list at the start of the file.
libgcj_cflags=
libgcj_cxxflags=
@@ -237,6 +238,26 @@ fi
AC_CONFIG_HEADERS([include/config.h gcj/libgcj-config.h])
+# Possibly build libgcj as many sub-libraries.
+AC_ARG_ENABLE(libgcj-sublibs,
+ AS_HELP_STRING([--enable-libgcj-sublibs],
+ [build libgcj as many sub-libraries]))
+
+if test -z "$enable_libgcj_sublibs"; then
+ enable_libgcj_sublibs=$enable_libgcj_sublibs_default
+fi
+AM_CONDITIONAL(BUILD_SUBLIBS, test "$enable_libgcj_sublibs" = yes)
+if test "$enable_libgcj_sublibs" = yes ; then
+ # In theory we could make do with only one override and simply
+ # tag "_bc" onto the end of it when we use it to generate the
+ # spec, but that's an ugly thing to do when there are multiple
+ # words in the string and you're relying on the ordering to
+ # append the correct one.
+ libgcj_spec_lgcj_override="-lgcj-noncore -lgcj"
+ libgcj_spec_lgcj_bc_override="-lgcj-noncore -lgcj_bc"
+fi
+
+
# See if the user has requested runtime debugging.
LIBGCJDEBUG="disable"
AC_SUBST(LIBGCJDEBUG)
@@ -897,6 +918,9 @@ arm*linux*eabi)
LIBSTDCXXSPEC=-lstdc++
LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -L`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -rpath `${PWDCMD-pwd}`/.libs:`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -lstdc++"
;;
+*-*-cygwin)
+ extra_ldflags_libjava=-liconv
+ ;;
esac
AC_SUBST(extra_ldflags_libjava)
AC_SUBST(extra_gij_ldflags)
@@ -1075,9 +1099,17 @@ AC_CONFIG_LINKS(sysdep/locks.h:sysdep/$sysdeps_dir/locks.h)
AC_CONFIG_LINKS(sysdep/backtrace.h:$fallback_backtrace_h)
AC_CONFIG_LINKS(sysdep/descriptor.h:$descriptor_h)
-LIBGCJ_SPEC="%{s-bc-abi:} -lgcj"
+LIBGCJ_SPEC_LGCJ=-lgcj
+LIBGCJ_SPEC_LGCJ_BC=-lgcj_bc
+if test x"$libgcj_spec_lgcj_override" != x ; then
+ LIBGCJ_SPEC_LGCJ=$libgcj_spec_lgcj_override
+fi
+if test x"$libgcj_spec_lgcj_bc_override" != x ; then
+ LIBGCJ_SPEC_LGCJ_BC=$libgcj_spec_lgcj_bc_override
+fi
+LIBGCJ_SPEC="%{s-bc-abi:} $LIBGCJ_SPEC_LGCJ"
if test "$use_libgcj_bc" = yes; then
- LIBGCJ_SPEC="%{static|static-libgcj|!s-bc-abi:-lgcj;:-lgcj_bc}"
+ LIBGCJ_SPEC="%{static|static-libgcj|!s-bc-abi:$LIBGCJ_SPEC_LGCJ;:$LIBGCJ_SPEC_LGCJ_BC}"
LIBGCJ_BC_SPEC="%{findirect-dispatch:-fPIC}"
fi
AC_SUBST(LIBGCJ_SPEC)
diff --git a/libjava/configure.host b/libjava/configure.host
index 1d1b7085e11..2955571b276 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -23,6 +23,9 @@
# default.
# enable_hash_synchronization_default If hash synchronization should be
# enabled by default.
+# enable_libgcj_sublibs_default Whether to build libgcj as a bunch of
+# separate shared libraries or in one
+# monolithic one.
# sysdeps_dir Directory containing system-dependent headers
# slow_pthread_self The synchronization code should try to avoid
# pthread_self calls by caching thread IDs in a hashtable
@@ -41,6 +44,7 @@ libgcj_javaflags=
libgcj_interpreter=
enable_java_net_default=yes
enable_hash_synchronization_default=no
+enable_libgcj_sublibs_default=no
sysdeps_dir=generic
slow_pthread_self=
can_unwind_signal=no
@@ -341,6 +345,8 @@ case "${host}" in
fallback_backtrace_h=sysdep/i386/backtrace.h
# We need a frame pointer on Windows, so override BACKTRACESPEC
BACKTRACESPEC=
+ # Win32 DLLs are limited to 64k exported symbols each.
+ enable_libgcj_sublibs_default=yes
;;
esac
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index d52d7327bd8..a2b5499d37d 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-22 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * ltdl.h (LT_SCOPE): Change conditional to avoid breaking
+ auto-export during libgcj DLL linking.
+ * Makefile.am (libltdl_la_LDFLAGS): Remove -bindir switch.
+ * Makefile.in: Regenerate.
+
2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac (AC_PREREQ): Bump to 2.64. Remove FIXME.
diff --git a/libjava/libltdl/Makefile.am b/libjava/libltdl/Makefile.am
index 8a2af102e4b..737290e6c7c 100644
--- a/libjava/libltdl/Makefile.am
+++ b/libjava/libltdl/Makefile.am
@@ -22,7 +22,7 @@ endif
CLEANFILES = libltdl.la libltdlc.la
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -no-undefined -bindir "$(bindir)" -version-info 4:1:1
+libltdl_la_LDFLAGS = -no-undefined -version-info 4:1:1
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
diff --git a/libjava/libltdl/Makefile.in b/libjava/libltdl/Makefile.in
index e3212433a37..46e139ef7f1 100644
--- a/libjava/libltdl/Makefile.in
+++ b/libjava/libltdl/Makefile.in
@@ -249,7 +249,7 @@ INCLUDES = $(GCINCS)
@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = libltdlc.la
CLEANFILES = libltdl.la libltdlc.la
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -no-undefined -bindir "$(bindir)" -version-info 4:1:1
+libltdl_la_LDFLAGS = -no-undefined -version-info 4:1:1
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
libltdlc_la_LIBADD = $(LIBADD_DL)
diff --git a/libjava/libltdl/ltdl.h b/libjava/libltdl/ltdl.h
index 8aaf3429ad4..c31c579d49d 100644
--- a/libjava/libltdl/ltdl.h
+++ b/libjava/libltdl/ltdl.h
@@ -128,7 +128,7 @@ LT_BEGIN_C_DECLS
ridiculous implementation of data symbol exporting. */
#ifndef LT_SCOPE
# ifdef __WINDOWS__
-# ifdef DLL_EXPORT /* defined by libtool (if required) */
+# ifdef LIBLTDL_DLL_EXPORT /* don't define or ld disables auto-export. */
# define LT_SCOPE __declspec(dllexport)
# endif
# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */
diff --git a/libjava/sysdep/i386/backtrace.h b/libjava/sysdep/i386/backtrace.h
index 63b32746137..ee793b22a0f 100644
--- a/libjava/sysdep/i386/backtrace.h
+++ b/libjava/sysdep/i386/backtrace.h
@@ -13,7 +13,14 @@ details. */
#include <java-stack.h>
-extern int main (int, char **);
+#ifdef __CYGWIN__
+/* To allow this to link as a DLL. */
+#define MAIN_FUNC dll_crt0__FP11per_process
+extern "C" int MAIN_FUNC () __declspec(dllimport);
+#else /* !__CYGWIN__ */
+#define MAIN_FUNC main
+extern int MAIN_FUNC (int, char **);
+#endif /* ?__CYGWIN__ */
/* The context used to keep track of our position while unwinding through
the call stack. */
@@ -104,7 +111,7 @@ fallback_backtrace (_Unwind_Trace_Fn trace_fn, _Jv_UnwindState *state)
const char **, bool))_Jv_RunMain;
if (ctx.meth_addr == (_Jv_uintptr_t)jv_runmain
|| ctx.meth_addr == (_Jv_uintptr_t)_Jv_ThreadStart
- || (ctx.meth_addr - (_Jv_uintptr_t)main) < 16)
+ || (ctx.meth_addr - (_Jv_uintptr_t)MAIN_FUNC) < 16)
break;
}
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index e51c109bbac..f65cf2ab3d3 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-22 Frank Ch. Eigler <fche@redhat.com>
+
+ PR libmudflap/41433
+ * mf-runtime.c (__mf_init): Ignore $MUDFLAP_OPTIONS if
+ running setuid or setgid.
+
2009-09-01 Loren J. Rittle <ljrittle@acm.org>
* mf-runtime.c (__mf_init): Support FreeBSD.
diff --git a/libmudflap/mf-runtime.c b/libmudflap/mf-runtime.c
index 3bfaf02b6a0..08a50c21807 100644
--- a/libmudflap/mf-runtime.c
+++ b/libmudflap/mf-runtime.c
@@ -303,6 +303,14 @@ __mf_set_default_options ()
#ifdef LIBMUDFLAPTH
__mf_opts.thread_stack = 0;
#endif
+
+ /* PR41443: Beware that the above flags will be applied to
+ setuid/setgid binaries, and cannot be overriden with
+ $MUDFLAP_OPTIONS. So the defaults must be non-exploitable.
+
+ Should we consider making the default violation_mode something
+ harsher than viol_nop? OTOH, glibc's MALLOC_CHECK_ is disabled
+ by default for these same programs. */
}
static struct mudoption
@@ -442,7 +450,7 @@ __mf_usage ()
"This is a %s%sGCC \"mudflap\" memory-checked binary.\n"
"Mudflap is Copyright (C) 2002-2009 Free Software Foundation, Inc.\n"
"\n"
- "The mudflap code can be controlled by an environment variable:\n"
+ "Unless setuid, a program's mudflap options be set by an environment variable:\n"
"\n"
"$ export MUDFLAP_OPTIONS='<options>'\n"
"$ <mudflapped_program>\n"
@@ -711,7 +719,8 @@ __mf_init ()
__mf_set_default_options ();
- ov = getenv ("MUDFLAP_OPTIONS");
+ if (getuid () == geteuid () && getgid () == getegid ()) /* PR41433, not setuid */
+ ov = getenv ("MUDFLAP_OPTIONS");
if (ov)
{
int rc = __mfu_set_options (ov);
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e49f3e226ac..83edeb75915 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,64 @@
+2009-09-25 Johannes Singler <singler@ira.uka.de>
+
+ * include/parallel/include/parallel/checkers.h
+ (is_sorted_failure, is_sorted_print_failures): Remove (unused).
+ (__is_sorted): Remove default parameter for _Compare; remove
+ inappropriate printf.
+
+2009-09-25 Johannes Singler <singler@ira.uka.de>
+
+ * include/parallel/base.h: Comment on presence of min/max duplicates.
+
+2009-09-25 Johannes Singler <singler@ira.uka.de>
+
+ * include/parallel/partition.h (__parallel_nth_element):
+ Correct comment.
+
+2009-09-24 Johannes Singler <singler@ira.uka.de>
+
+ * include/parallel/algo.h: Uglify internal identifiers;
+ correct line breaks.
+ * include/parallel/for_each.h: Likewise.
+ * include/parallel/numeric: Likewise.
+ * include/parallel/omp_loop.h: Likewise.
+ * include/parallel/omp_loop_static.h: Likewise.
+ * include/parallel/par_loop.h: Likewise.
+ * include/parallel/workstealing.h: Likewise.
+
+2009-09-24 Johannes Singler <singler@ira.uka.de>
+
+ * include/parallel/base.h (_EqualFromLess): Move _Compare template
+ parameter to the end as of others.
+ * include/parallel/algobase.h
+ (__lexicographical_compare_switch): Likewise.
+
+2009-09-23 Johannes Singler <singler@ira.uka.de>
+
+ * include/parallel/algobase.h: Uglify internal identifiers;
+ correct line breaks.
+ * include/parallel/algo.h: Likewise.
+ * include/parallel/base.h: Likewise.
+ * include/parallel/equally_split.h: Likewise.
+ * include/parallel/find.h: Likewise.
+ * include/parallel/find_selectors.h: Likewise.
+ * include/parallel/for_each_selectors.h: Likewise.
+ * include/parallel/list_partition.h: Likewise.
+ * include/parallel/losertree.h: Likewise.
+ * include/parallel/merge.h: Likewise.
+ * include/parallel/multiseq_selection.h: Likewise.
+ * include/parallel/multiway_merge.h: Likewise.
+ * include/parallel/multiway_mergesort.h: Likewise.
+ * include/parallel/numeric: Likewise.
+ * include/parallel/numericfwd.h: Likewise.
+ * include/parallel/omp_loop.h: Likewise.
+ * include/parallel/omp_loop_static.h: Likewise.
+ * include/parallel/par_loop.h: Likewise.
+ * include/parallel/partition.h: Likewise.
+ * include/parallel/random_shuffle.h: Likewise.
+ * include/parallel/search.h: Likewise.
+ * include/parallel/sort.h: Likewise.
+ * include/parallel/workstealing.h: Likewise.
+
2009-09-21 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/appendix_contributing.xml: Adjust link to
diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h
index 1a75d24b917..8d685b5c946 100644
--- a/libstdc++-v3/include/parallel/algo.h
+++ b/libstdc++-v3/include/parallel/algo.h
@@ -150,8 +150,8 @@ namespace __parallel
if (_GLIBCXX_PARALLEL_CONDITION(true))
{
- binder2nd<__gnu_parallel::equal_to<_ValueType, const _Tp&> >
- __comp(__gnu_parallel::equal_to<_ValueType, const _Tp&>(), __val);
+ binder2nd<__gnu_parallel::_EqualTo<_ValueType, const _Tp&> >
+ __comp(__gnu_parallel::_EqualTo<_ValueType, const _Tp&>(), __val);
return __gnu_parallel::__find_template(
__begin, __end, __begin, __comp,
__gnu_parallel::__find_if_selector()).first;
@@ -293,7 +293,7 @@ namespace __parallel
typedef typename iteratorf_traits::value_type _FValueType;
return find_first_of(__begin1, __end1, __begin2, __end2, __gnu_parallel::
- equal_to<_IValueType, _FValueType>());
+ _EqualTo<_IValueType, _FValueType>());
}
// Sequential fallback
@@ -815,15 +815,15 @@ namespace __parallel
if (_GLIBCXX_PARALLEL_CONDITION(true))
{
- _RAIter spot = __gnu_parallel::
+ _RAIter __spot = __gnu_parallel::
__find_template(
__begin, __end - 1, __begin, equal_to<_ValueType>(),
__gnu_parallel::__adjacent_find_selector())
.first;
- if (spot == (__end - 1))
+ if (__spot == (__end - 1))
return __end;
else
- return spot;
+ return __spot;
}
else
return adjacent_find(__begin, __end, __gnu_parallel::sequential_tag());
@@ -1038,16 +1038,16 @@ namespace __parallel
_RAIter2 __begin2, _RAIter2 __end2,
random_access_iterator_tag, random_access_iterator_tag)
{
- typedef std::iterator_traits<_RAIter1> iterator1_traits;
- typedef typename iterator1_traits::value_type _ValueType1;
- typedef std::iterator_traits<_RAIter2> iterator2_traits;
- typedef typename iterator2_traits::value_type _ValueType2;
+ typedef std::iterator_traits<_RAIter1> _Iterator1Traits;
+ typedef typename _Iterator1Traits::value_type _ValueType1;
+ typedef std::iterator_traits<_RAIter2> _Iterator2Traits;
+ typedef typename _Iterator2Traits::value_type _ValueType2;
if (_GLIBCXX_PARALLEL_CONDITION(true))
return __gnu_parallel::
__search_template(
__begin1, __end1, __begin2, __end2,
- __gnu_parallel::equal_to<_ValueType1, _ValueType2>());
+ __gnu_parallel::_EqualTo<_ValueType1, _ValueType2>());
else
return search(__begin1, __end1, __begin2, __end2,
__gnu_parallel::sequential_tag());
@@ -1069,10 +1069,10 @@ namespace __parallel
search(_FIterator1 __begin1, _FIterator1 __end1,
_FIterator2 __begin2, _FIterator2 __end2)
{
- typedef std::iterator_traits<_FIterator1> iterator1_traits;
- typedef typename iterator1_traits::iterator_category _IteratorCategory1;
- typedef std::iterator_traits<_FIterator2> iterator2_traits;
- typedef typename iterator2_traits::iterator_category _IteratorCategory2;
+ typedef std::iterator_traits<_FIterator1> _Iterator1Traits;
+ typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
+ typedef std::iterator_traits<_FIterator2> _Iterator2Traits;
+ typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
return __search_switch(__begin1, __end1, __begin2, __end2,
_IteratorCategory1(), _IteratorCategory2());
@@ -1124,10 +1124,10 @@ namespace __parallel
_FIterator2 __begin2, _FIterator2 __end2,
_BinaryPredicate __pred)
{
- typedef std::iterator_traits<_FIterator1> iterator1_traits;
- typedef typename iterator1_traits::iterator_category _IteratorCategory1;
- typedef std::iterator_traits<_FIterator2> iterator2_traits;
- typedef typename iterator2_traits::iterator_category _IteratorCategory2;
+ typedef std::iterator_traits<_FIterator1> _Iterator1Traits;
+ typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
+ typedef std::iterator_traits<_FIterator2> _Iterator2Traits;
+ typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
return __search_switch(__begin1, __end1, __begin2, __end2, __pred,
_IteratorCategory1(), _IteratorCategory2());
}
@@ -1135,47 +1135,47 @@ namespace __parallel
// Sequential fallback
template<typename _FIterator, typename _Integer, typename _Tp>
inline _FIterator
- search_n(_FIterator __begin, _FIterator __end, _Integer count,
+ search_n(_FIterator __begin, _FIterator __end, _Integer __count,
const _Tp& __val, __gnu_parallel::sequential_tag)
- { return _GLIBCXX_STD_P::search_n(__begin, __end, count, __val); }
+ { return _GLIBCXX_STD_P::search_n(__begin, __end, __count, __val); }
// Sequential fallback
template<typename _FIterator, typename _Integer, typename _Tp,
typename _BinaryPredicate>
inline _FIterator
- search_n(_FIterator __begin, _FIterator __end, _Integer count,
+ search_n(_FIterator __begin, _FIterator __end, _Integer __count,
const _Tp& __val, _BinaryPredicate __binary_pred,
__gnu_parallel::sequential_tag)
{ return _GLIBCXX_STD_P::search_n(
- __begin, __end, count, __val, __binary_pred); }
+ __begin, __end, __count, __val, __binary_pred); }
// Public interface.
template<typename _FIterator, typename _Integer, typename _Tp>
inline _FIterator
- search_n(_FIterator __begin, _FIterator __end, _Integer count,
+ search_n(_FIterator __begin, _FIterator __end, _Integer __count,
const _Tp& __val)
{
typedef typename iterator_traits<_FIterator>::value_type _ValueType;
- return search_n(__begin, __end, count, __val,
- __gnu_parallel::equal_to<_ValueType, _Tp>());
+ return search_n(__begin, __end, __count, __val,
+ __gnu_parallel::_EqualTo<_ValueType, _Tp>());
}
// Parallel algorithm for random access iterators.
template<typename _RAIter, typename _Integer,
typename _Tp, typename _BinaryPredicate>
_RAIter
- __search_n_switch(_RAIter __begin, _RAIter __end, _Integer count,
+ __search_n_switch(_RAIter __begin, _RAIter __end, _Integer __count,
const _Tp& __val, _BinaryPredicate __binary_pred,
random_access_iterator_tag)
{
if (_GLIBCXX_PARALLEL_CONDITION(true))
{
- __gnu_parallel::_PseudoSequence<_Tp, _Integer> __ps(__val, count);
+ __gnu_parallel::_PseudoSequence<_Tp, _Integer> __ps(__val, __count);
return __gnu_parallel::__search_template(
__begin, __end, __ps.begin(), __ps.end(), __binary_pred);
}
else
- return std::__search_n(__begin, __end, count, __val,
+ return std::__search_n(__begin, __end, __count, __val,
__binary_pred, random_access_iterator_tag());
}
@@ -1183,20 +1183,20 @@ namespace __parallel
template<typename _FIterator, typename _Integer, typename _Tp,
typename _BinaryPredicate, typename _IteratorTag>
inline _FIterator
- __search_n_switch(_FIterator __begin, _FIterator __end, _Integer count,
+ __search_n_switch(_FIterator __begin, _FIterator __end, _Integer __count,
const _Tp& __val, _BinaryPredicate __binary_pred,
_IteratorTag)
- { return __search_n(__begin, __end, count, __val, __binary_pred,
+ { return __search_n(__begin, __end, __count, __val, __binary_pred,
_IteratorTag()); }
// Public interface.
template<typename _FIterator, typename _Integer, typename _Tp,
typename _BinaryPredicate>
inline _FIterator
- search_n(_FIterator __begin, _FIterator __end, _Integer count,
+ search_n(_FIterator __begin, _FIterator __end, _Integer __count,
const _Tp& __val, _BinaryPredicate __binary_pred)
{
- return __search_n_switch(__begin, __end, count, __val, __binary_pred,
+ return __search_n_switch(__begin, __end, __count, __val, __binary_pred,
typename std::iterator_traits<_FIterator>::
iterator_category());
}
@@ -1207,15 +1207,15 @@ namespace __parallel
typename _UnaryOperation>
inline _OutputIterator
transform(_IIter __begin, _IIter __end, _OutputIterator __result,
- _UnaryOperation unary_op, __gnu_parallel::sequential_tag)
- { return _GLIBCXX_STD_P::transform(__begin, __end, __result, unary_op); }
+ _UnaryOperation __unary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::transform(__begin, __end, __result, __unary_op); }
// Parallel unary transform for random access iterators.
template<typename _RAIter1, typename _RAIter2,
typename _UnaryOperation>
_RAIter2
__transform1_switch(_RAIter1 __begin, _RAIter1 __end,
- _RAIter2 __result, _UnaryOperation unary_op,
+ _RAIter2 __result, _UnaryOperation __unary_op,
random_access_iterator_tag, random_access_iterator_tag,
__gnu_parallel::_Parallelism __parallelism_tag
= __gnu_parallel::parallel_balanced)
@@ -1228,18 +1228,18 @@ namespace __parallel
bool __dummy = true;
typedef __gnu_parallel::_IteratorPair<_RAIter1,
_RAIter2, random_access_iterator_tag> _ItTrip;
- _ItTrip begin_pair(__begin, __result),
- end_pair(__end, __result + (__end - __begin));
+ _ItTrip __begin_pair(__begin, __result),
+ __end_pair(__end, __result + (__end - __begin));
__gnu_parallel::__transform1_selector<_ItTrip> __functionality;
__gnu_parallel::
__for_each_template_random_access(
- begin_pair, end_pair, unary_op, __functionality,
+ __begin_pair, __end_pair, __unary_op, __functionality,
__gnu_parallel::_DummyReduct(),
__dummy, __dummy, -1, __parallelism_tag);
return __functionality._M_finish_iterator;
}
else
- return transform(__begin, __end, __result, unary_op,
+ return transform(__begin, __end, __result, __unary_op,
__gnu_parallel::sequential_tag());
}
@@ -1249,9 +1249,9 @@ namespace __parallel
typename _IteratorTag2>
inline _RAIter2
__transform1_switch(_RAIter1 __begin, _RAIter1 __end,
- _RAIter2 __result, _UnaryOperation unary_op,
+ _RAIter2 __result, _UnaryOperation __unary_op,
_IteratorTag1, _IteratorTag2)
- { return transform(__begin, __end, __result, unary_op,
+ { return transform(__begin, __end, __result, __unary_op,
__gnu_parallel::sequential_tag()); }
// Public interface.
@@ -1259,7 +1259,7 @@ namespace __parallel
typename _UnaryOperation>
inline _OutputIterator
transform(_IIter __begin, _IIter __end, _OutputIterator __result,
- _UnaryOperation unary_op,
+ _UnaryOperation __unary_op,
__gnu_parallel::_Parallelism __parallelism_tag)
{
typedef std::iterator_traits<_IIter> _IIterTraits;
@@ -1267,7 +1267,7 @@ namespace __parallel
typedef typename _IIterTraits::iterator_category _IIteratorCategory;
typedef typename _OIterTraits::iterator_category _OIterCategory;
- return __transform1_switch(__begin, __end, __result, unary_op,
+ return __transform1_switch(__begin, __end, __result, __unary_op,
_IIteratorCategory(), _OIterCategory(),
__parallelism_tag);
}
@@ -1276,14 +1276,14 @@ namespace __parallel
typename _UnaryOperation>
inline _OutputIterator
transform(_IIter __begin, _IIter __end, _OutputIterator __result,
- _UnaryOperation unary_op)
+ _UnaryOperation __unary_op)
{
typedef std::iterator_traits<_IIter> _IIterTraits;
typedef std::iterator_traits<_OutputIterator> _OIterTraits;
typedef typename _IIterTraits::iterator_category _IIteratorCategory;
typedef typename _OIterTraits::iterator_category _OIterCategory;
- return __transform1_switch(__begin, __end, __result, unary_op,
+ return __transform1_switch(__begin, __end, __result, __unary_op,
_IIteratorCategory(), _OIterCategory());
}
@@ -1518,24 +1518,24 @@ namespace __parallel
}
// Sequential fallback
- template<typename _FIterator, typename Generator>
+ template<typename _FIterator, typename _Generator>
inline void
- generate(_FIterator __begin, _FIterator __end, Generator __gen,
+ generate(_FIterator __begin, _FIterator __end, _Generator __gen,
__gnu_parallel::sequential_tag)
{ _GLIBCXX_STD_P::generate(__begin, __end, __gen); }
// Sequential fallback for input iterator case.
- template<typename _FIterator, typename Generator, typename _IteratorTag>
+ template<typename _FIterator, typename _Generator, typename _IteratorTag>
inline void
- __generate_switch(_FIterator __begin, _FIterator __end, Generator __gen,
+ __generate_switch(_FIterator __begin, _FIterator __end, _Generator __gen,
_IteratorTag)
{ generate(__begin, __end, __gen, __gnu_parallel::sequential_tag()); }
// Parallel algorithm for random access iterators.
- template<typename _RAIter, typename Generator>
+ template<typename _RAIter, typename _Generator>
void
__generate_switch(_RAIter __begin, _RAIter __end,
- Generator __gen, random_access_iterator_tag,
+ _Generator __gen, random_access_iterator_tag,
__gnu_parallel::_Parallelism __parallelism_tag
= __gnu_parallel::parallel_balanced)
{
@@ -1558,10 +1558,10 @@ namespace __parallel
}
// Public interface.
- template<typename _FIterator, typename Generator>
+ template<typename _FIterator, typename _Generator>
inline void
generate(_FIterator __begin, _FIterator __end,
- Generator __gen, __gnu_parallel::_Parallelism __parallelism_tag)
+ _Generator __gen, __gnu_parallel::_Parallelism __parallelism_tag)
{
typedef std::iterator_traits<_FIterator> _IteratorTraits;
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
@@ -1569,9 +1569,9 @@ namespace __parallel
__parallelism_tag);
}
- template<typename _FIterator, typename Generator>
+ template<typename _FIterator, typename _Generator>
inline void
- generate(_FIterator __begin, _FIterator __end, Generator __gen)
+ generate(_FIterator __begin, _FIterator __end, _Generator __gen)
{
typedef std::iterator_traits<_FIterator> _IteratorTraits;
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
@@ -1580,25 +1580,25 @@ namespace __parallel
// Sequential fallback.
- template<typename _OutputIterator, typename _Size, typename Generator>
+ template<typename _OutputIterator, typename _Size, typename _Generator>
inline _OutputIterator
- generate_n(_OutputIterator __begin, _Size __n, Generator __gen,
+ generate_n(_OutputIterator __begin, _Size __n, _Generator __gen,
__gnu_parallel::sequential_tag)
{ return _GLIBCXX_STD_P::generate_n(__begin, __n, __gen); }
// Sequential fallback for input iterator case.
- template<typename _OutputIterator, typename _Size, typename Generator,
+ template<typename _OutputIterator, typename _Size, typename _Generator,
typename _IteratorTag>
inline _OutputIterator
- __generate_n_switch(_OutputIterator __begin, _Size __n, Generator __gen,
+ __generate_n_switch(_OutputIterator __begin, _Size __n, _Generator __gen,
_IteratorTag)
{ return generate_n(__begin, __n, __gen,
__gnu_parallel::sequential_tag()); }
// Parallel algorithm for random access iterators.
- template<typename _RAIter, typename _Size, typename Generator>
+ template<typename _RAIter, typename _Size, typename _Generator>
inline _RAIter
- __generate_n_switch(_RAIter __begin, _Size __n, Generator __gen,
+ __generate_n_switch(_RAIter __begin, _Size __n, _Generator __gen,
random_access_iterator_tag,
__gnu_parallel::_Parallelism __parallelism_tag
= __gnu_parallel::parallel_balanced)
@@ -1608,9 +1608,9 @@ namespace __parallel
}
// Public interface.
- template<typename _OutputIterator, typename _Size, typename Generator>
+ template<typename _OutputIterator, typename _Size, typename _Generator>
inline _OutputIterator
- generate_n(_OutputIterator __begin, _Size __n, Generator __gen,
+ generate_n(_OutputIterator __begin, _Size __n, _Generator __gen,
__gnu_parallel::_Parallelism __parallelism_tag)
{
typedef std::iterator_traits<_OutputIterator> _IteratorTraits;
@@ -1619,9 +1619,9 @@ namespace __parallel
__parallelism_tag);
}
- template<typename _OutputIterator, typename _Size, typename Generator>
+ template<typename _OutputIterator, typename _Size, typename _Generator>
inline _OutputIterator
- generate_n(_OutputIterator __begin, _Size __n, Generator __gen)
+ generate_n(_OutputIterator __begin, _Size __n, _Generator __gen)
{
typedef std::iterator_traits<_OutputIterator> _IteratorTraits;
typedef typename _IteratorTraits::iterator_category _IteratorCategory;
@@ -1637,10 +1637,10 @@ namespace __parallel
{ _GLIBCXX_STD_P::random_shuffle(__begin, __end); }
// Sequential fallback.
- template<typename _RAIter, typename RandomNumberGenerator>
+ template<typename _RAIter, typename _RandomNumberGenerator>
inline void
random_shuffle(_RAIter __begin, _RAIter __end,
- RandomNumberGenerator& __rand,
+ _RandomNumberGenerator& __rand,
__gnu_parallel::sequential_tag)
{ _GLIBCXX_STD_P::random_shuffle(__begin, __end, __rand); }
@@ -1665,10 +1665,10 @@ namespace __parallel
}
// Parallel algorithm for random access iterators.
- template<typename _RAIter, typename RandomNumberGenerator>
+ template<typename _RAIter, typename _RandomNumberGenerator>
void
random_shuffle(_RAIter __begin, _RAIter __end,
- RandomNumberGenerator& __rand)
+ _RandomNumberGenerator& __rand)
{
if (__begin == __end)
return;
@@ -1759,7 +1759,7 @@ namespace __parallel
if (_GLIBCXX_PARALLEL_CONDITION(
static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) >=
__gnu_parallel::_Settings::get().sort_minimal_n))
- __gnu_parallel::parallel_sort<false>(
+ __gnu_parallel::__parallel_sort<false>(
__begin, __end, __comp, __parallelism);
else
sort(__begin, __end, __comp, __gnu_parallel::sequential_tag());
@@ -1898,7 +1898,7 @@ namespace __parallel
if (_GLIBCXX_PARALLEL_CONDITION(
static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) >=
__gnu_parallel::_Settings::get().sort_minimal_n))
- __gnu_parallel::parallel_sort<true>(
+ __gnu_parallel::__parallel_sort<true>(
__begin, __end, __comp, __parallelism);
else
stable_sort(__begin, __end, __comp,
@@ -2071,10 +2071,10 @@ namespace __parallel
merge(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
_IIter2 __end2, _OutputIterator __result)
{
- typedef std::iterator_traits<_IIter1> iterator1_traits;
- typedef std::iterator_traits<_IIter2> iterator2_traits;
- typedef typename iterator1_traits::value_type _ValueType1;
- typedef typename iterator2_traits::value_type _ValueType2;
+ typedef std::iterator_traits<_IIter1> _Iterator1Traits;
+ typedef std::iterator_traits<_IIter2> _Iterator2Traits;
+ typedef typename _Iterator1Traits::value_type _ValueType1;
+ typedef typename _Iterator2Traits::value_type _ValueType2;
return merge(__begin1, __end1, __begin2, __end2, __result,
__gnu_parallel::_Less<_ValueType1, _ValueType2>());
@@ -2104,7 +2104,7 @@ namespace __parallel
if (_GLIBCXX_PARALLEL_CONDITION(
static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
>= __gnu_parallel::_Settings::get().nth_element_minimal_n))
- __gnu_parallel::parallel_nth_element(__begin, __nth, __end, __comp);
+ __gnu_parallel::__parallel_nth_element(__begin, __nth, __end, __comp);
else
nth_element(__begin, __nth, __end, __comp,
__gnu_parallel::sequential_tag());
@@ -2146,7 +2146,7 @@ namespace __parallel
static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin)
>= __gnu_parallel::_Settings::get().partial_sort_minimal_n))
__gnu_parallel::
- parallel_partial_sort(__begin, __middle, __end, __comp);
+ __parallel_partial_sort(__begin, __middle, __end, __comp);
else
partial_sort(__begin, __middle, __end, __comp,
__gnu_parallel::sequential_tag());
diff --git a/libstdc++-v3/include/parallel/algobase.h b/libstdc++-v3/include/parallel/algobase.h
index b0571a47933..df1c58bedb6 100644
--- a/libstdc++-v3/include/parallel/algobase.h
+++ b/libstdc++-v3/include/parallel/algobase.h
@@ -95,16 +95,16 @@ namespace __parallel
inline pair<_IIter1, _IIter2>
mismatch(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2)
{
- typedef std::iterator_traits<_IIter1> iterator1_traits;
- typedef std::iterator_traits<_IIter2> iterator2_traits;
- typedef typename iterator1_traits::value_type _ValueType1;
- typedef typename iterator2_traits::value_type _ValueType2;
- typedef typename iterator1_traits::iterator_category _IteratorCategory1;
- typedef typename iterator2_traits::iterator_category _IteratorCategory2;
+ typedef std::iterator_traits<_IIter1> _Iterator1Traits;
+ typedef std::iterator_traits<_IIter2> _Iterator2Traits;
+ typedef typename _Iterator1Traits::value_type _ValueType1;
+ typedef typename _Iterator2Traits::value_type _ValueType2;
+ typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
+ typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
- typedef __gnu_parallel::equal_to<_ValueType1, _ValueType2> equal_to_type;
+ typedef __gnu_parallel::_EqualTo<_ValueType1, _ValueType2> _EqualTo;
- return __mismatch_switch(__begin1, __end1, __begin2, equal_to_type(),
+ return __mismatch_switch(__begin1, __end1, __begin2, _EqualTo(),
_IteratorCategory1(), _IteratorCategory2());
}
@@ -114,10 +114,10 @@ namespace __parallel
mismatch(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
_Predicate __pred)
{
- typedef std::iterator_traits<_IIter1> iterator1_traits;
- typedef std::iterator_traits<_IIter2> iterator2_traits;
- typedef typename iterator1_traits::iterator_category _IteratorCategory1;
- typedef typename iterator2_traits::iterator_category _IteratorCategory2;
+ typedef std::iterator_traits<_IIter1> _Iterator1Traits;
+ typedef std::iterator_traits<_IIter2> _Iterator2Traits;
+ typedef typename _Iterator1Traits::iterator_category _IteratorCategory1;
+ typedef typename _Iterator2Traits::iterator_category _IteratorCategory2;
return __mismatch_switch(__begin1, __end1, __begin2, __pred,
_IteratorCategory1(), _IteratorCategory2());
@@ -198,7 +198,7 @@ namespace __parallel
typedef typename _TraitsType2::value_type _ValueType2;
typedef __gnu_parallel::
- _EqualFromLess<_Predicate, _ValueType1, _ValueType2>
+ _EqualFromLess<_ValueType1, _ValueType2, _Predicate>
_EqualFromLessCompare;
// Longer sequence in first place.
diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h
index 6925696a72e..21c354829d1 100644
--- a/libstdc++-v3/include/parallel/base.h
+++ b/libstdc++-v3/include/parallel/base.h
@@ -88,21 +88,18 @@ namespace __gnu_parallel
return __i > 1 ? __i : 1;
}
-
+
inline bool
__is_parallel(const _Parallelism __p) { return __p != sequential; }
- // XXX remove std::duplicates from here if possible,
- // XXX but keep minimal dependencies.
-
/** @brief Calculates the rounded-down logarithm of @__c __n for base 2.
* @param __n Argument.
* @return Returns 0 for any argument <1.
*/
template<typename _Size>
inline _Size
- __log2(_Size __n)
+ __rd_log2(_Size __n)
{
_Size __k;
for (__k = 0; __n > 1; __n >>= 1)
@@ -115,7 +112,7 @@ template<typename _Size>
* _CASable_bits/2 bits.
* @param __b Second integer, to be encoded in the least-significant
* @__c _CASable_bits/2 bits.
- * @return __gnu_parallel::_CASable _M_value encoding @__c __a and @__c __b.
+ * @return value encoding @__c __a and @__c __b.
* @see decode2
*/
inline _CASable
@@ -139,6 +136,8 @@ decode2(_CASable __x, int& __a, int& __b)
__b = (int)((__x >> 0 ) & _CASable_mask);
}
+//needed for parallel "numeric", even if "algorithm" not included
+
/** @brief Equivalent to std::min. */
template<typename _Tp>
const _Tp&
@@ -154,8 +153,7 @@ template<typename _Tp>
/** @brief Constructs predicate for equality from strict weak
* ordering predicate
*/
-// XXX comparator at the end, as per others
-template<typename _Compare, typename _T1, typename _T2>
+template<typename _T1, typename _T2, typename _Compare>
class _EqualFromLess : public std::binary_function<_T1, _T2, bool>
{
private:
@@ -171,7 +169,7 @@ template<typename _Compare, typename _T1, typename _T2>
};
-/** @brief Similar to std::__binder1st,
+/** @brief Similar to std::binder1st,
* but giving the argument types explicitly. */
template<typename _Predicate, typename argument_type>
class __unary_negate
@@ -189,7 +187,7 @@ template<typename _Predicate, typename argument_type>
{ return !_M_pred(__x); }
};
-/** @brief Similar to std::__binder1st,
+/** @brief Similar to std::binder1st,
* but giving the argument types explicitly. */
template<typename _Operation, typename _FirstArgumentType,
typename _SecondArgumentType, typename _ResultType>
@@ -247,7 +245,7 @@ template<typename _Operation, typename _FirstArgumentType,
/** @brief Similar to std::equal_to, but allows two different types. */
template<typename _T1, typename _T2>
- struct equal_to : std::binary_function<_T1, _T2, bool>
+ struct _EqualTo : std::binary_function<_T1, _T2, bool>
{
bool operator()(const _T1& __t1, const _T2& __t2) const
{ return __t1 == __t2; }
diff --git a/libstdc++-v3/include/parallel/checkers.h b/libstdc++-v3/include/parallel/checkers.h
index 5d3acfa4b8d..70cc949e3fe 100644
--- a/libstdc++-v3/include/parallel/checkers.h
+++ b/libstdc++-v3/include/parallel/checkers.h
@@ -46,13 +46,9 @@ namespace __gnu_parallel
* @param __comp Comparator.
* @return @__c true if sorted, @__c false otherwise.
*/
- // XXX Compare default template argument
template<typename _IIter, typename _Compare>
bool
- __is_sorted(_IIter __begin, _IIter __end,
- _Compare __comp
- = std::less<typename std::iterator_traits<_IIter>::
- _ValueType>())
+ __is_sorted(_IIter __begin, _IIter __end, _Compare __comp)
{
if (__begin == __end)
return true;
@@ -64,8 +60,6 @@ namespace __gnu_parallel
{
if (__comp(*__current, *__recent))
{
- printf("__is_sorted: check failed before position %__i.\n",
- __position);
return false;
}
__recent = __current;
@@ -75,83 +69,4 @@ namespace __gnu_parallel
return true;
}
- /**
- * @brief Check whether @__c [__begin, @__c __end) is sorted according to
- * @__c __comp.
- * Prints the position in case an unordered pair is found.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __first_failure The first failure is returned in this variable.
- * @param __comp Comparator.
- * @return @__c true if sorted, @__c false otherwise.
- */
- // XXX Compare default template argument
- template<typename _IIter, typename _Compare>
- bool
- is_sorted_failure(_IIter __begin, _IIter __end,
- _IIter& __first_failure,
- _Compare __comp
- = std::less<typename std::iterator_traits<_IIter>::
- _ValueType>())
- {
- if (__begin == __end)
- return true;
-
- _IIter __current(__begin), __recent(__begin);
-
- unsigned long long __position = 1;
- for (__current++; __current != __end; __current++)
- {
- if (__comp(*__current, *__recent))
- {
- __first_failure = __current;
- printf("__is_sorted: check failed before position %lld.\n",
- __position);
- return false;
- }
- __recent = __current;
- __position++;
- }
-
- __first_failure = __end;
- return true;
- }
-
- /**
- * @brief Check whether @__c [__begin, @__c __end) is sorted according to
- * @__c __comp.
- * Prints all unordered pair, including the surrounding two elements.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __comp Comparator.
- * @return @__c true if sorted, @__c false otherwise.
- */
- template<typename _IIter, typename _Compare>
- bool
- // XXX Compare default template argument
- is_sorted_print_failures(_IIter __begin, _IIter __end,
- _Compare __comp
- = std::less<typename std::iterator_traits
- <_IIter>::value_type>())
- {
- if (__begin == __end)
- return true;
-
- _IIter __recent(__begin);
- bool __ok = true;
-
- for (_IIter __pos(__begin + 1); __pos != __end; __pos++)
- {
- if (__comp(*__pos, *__recent))
- {
- printf("%ld: %d %d %d %d\n", __pos - __begin, *(__pos - 2),
- *(__pos- 1), *__pos, *(__pos + 1));
- __ok = false;
- }
- __recent = __pos;
- }
- return __ok;
- }
-}
-
#endif /* _GLIBCXX_PARALLEL_CHECKERS_H */
diff --git a/libstdc++-v3/include/parallel/equally_split.h b/libstdc++-v3/include/parallel/equally_split.h
index a41ed6ec41e..31ed87d16f3 100644
--- a/libstdc++-v3/include/parallel/equally_split.h
+++ b/libstdc++-v3/include/parallel/equally_split.h
@@ -42,7 +42,7 @@ namespace __gnu_parallel
* @param __n Number of elements
* @param __num_threads Number of parts
* @param __s Splitters
- * @returns End of splitter sequence, i.e. @__c __s+__num_threads+1 */
+ * @returns End of __splitter sequence, i.e. @__c __s+__num_threads+1 */
template<typename _DifferenceType, typename _OutputIterator>
_OutputIterator
equally_split(_DifferenceType __n, _ThreadIndex __num_threads,
diff --git a/libstdc++-v3/include/parallel/find.h b/libstdc++-v3/include/parallel/find.h
index e7f0d839086..050a80d8af0 100644
--- a/libstdc++-v3/include/parallel/find.h
+++ b/libstdc++-v3/include/parallel/find.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/** @file parallel/find.h
- * @brief Parallel implementation __base for std::find(), std::equal()
+ * @brief Parallel implementation base for std::find(), std::equal()
* and related functions.
* This file is a GNU parallel extension to the Standard C++ Library.
*/
diff --git a/libstdc++-v3/include/parallel/find_selectors.h b/libstdc++-v3/include/parallel/find_selectors.h
index 2b1e118a64f..0d385bc6c94 100644
--- a/libstdc++-v3/include/parallel/find_selectors.h
+++ b/libstdc++-v3/include/parallel/find_selectors.h
@@ -107,11 +107,11 @@ namespace __gnu_parallel
_RAIter2 __begin2, _Pred __pred)
{
// Passed end iterator is one short.
- _RAIter1 spot = adjacent_find(__begin1, __end1 + 1,
+ _RAIter1 __spot = adjacent_find(__begin1, __end1 + 1,
__pred, sequential_tag());
- if (spot == (__end1 + 1))
- spot = __end1;
- return std::make_pair(spot, __begin2);
+ if (__spot == (__end1 + 1))
+ __spot = __end1;
+ return std::make_pair(__spot, __begin2);
}
};
diff --git a/libstdc++-v3/include/parallel/for_each.h b/libstdc++-v3/include/parallel/for_each.h
index f1c9c23b8a5..b585999f514 100644
--- a/libstdc++-v3/include/parallel/for_each.h
+++ b/libstdc++-v3/include/parallel/for_each.h
@@ -69,26 +69,26 @@ namespace __gnu_parallel
_Parallelism __parallelism_tag)
{
if (__parallelism_tag == parallel_unbalanced)
- return for_each_template_random_access_ed(__begin, __end, __user_op,
+ return __for_each_template_random_access_ed(__begin, __end, __user_op,
__functionality, __reduction,
__reduction_start,
__output, __bound);
else if (__parallelism_tag == parallel_omp_loop)
- return for_each_template_random_access_omp_loop(
+ return __for_each_template_random_access_omp_loop(
__begin, __end, __user_op,
__functionality,
__reduction,
__reduction_start,
__output, __bound);
else if (__parallelism_tag == parallel_omp_loop_static)
- return for_each_template_random_access_omp_loop(
+ return __for_each_template_random_access_omp_loop(
__begin, __end, __user_op,
__functionality,
__reduction,
__reduction_start,
__output, __bound);
else //e. g. parallel_balanced
- return for_each_template_random_access_workstealing(__begin, __end,
+ return __for_each_template_random_access_workstealing(__begin, __end,
__user_op,
__functionality,
__reduction,
diff --git a/libstdc++-v3/include/parallel/for_each_selectors.h b/libstdc++-v3/include/parallel/for_each_selectors.h
index 9b3bb6b5703..c6c8a14920a 100644
--- a/libstdc++-v3/include/parallel/for_each_selectors.h
+++ b/libstdc++-v3/include/parallel/for_each_selectors.h
@@ -88,9 +88,9 @@ namespace __gnu_parallel
/** @brief Functor execution.
* @param __v Current value.
* @param __i iterator referencing object. */
- template<typename Val>
+ template<typename _ValueType>
bool
- operator()(Val& __v, _It __i)
+ operator()(_ValueType& __v, _It __i)
{
*__i = __v;
return true;
@@ -185,9 +185,9 @@ namespace __gnu_parallel
* @param __v Current value.
* @param __i iterator referencing object.
* @return 1 if count, 0 if does not count. */
- template<typename Val>
+ template<typename _ValueType>
_Diff
- operator()(Val& __v, _It __i)
+ operator()(_ValueType& __v, _It __i)
{ return (__v == *__i) ? 1 : 0; }
};
diff --git a/libstdc++-v3/include/parallel/list_partition.h b/libstdc++-v3/include/parallel/list_partition.h
index 7eed96b4a0d..9c4f48187f0 100644
--- a/libstdc++-v3/include/parallel/list_partition.h
+++ b/libstdc++-v3/include/parallel/list_partition.h
@@ -143,7 +143,7 @@ namespace __gnu_parallel
}
// Calculation of the parts (one must be extracted from __current
- // because the partition beginning at __end, consists only of
+ // because the partition beginning at end, consists only of
// itself).
size_t __size_part = (__cur - 1) / __num_parts;
int __size_greater = static_cast<int>((__cur - 1) % __num_parts);
diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h
index 239aac8c057..0da84abe4ab 100644
--- a/libstdc++-v3/include/parallel/losertree.h
+++ b/libstdc++-v3/include/parallel/losertree.h
@@ -62,7 +62,7 @@ protected:
{
/** @brief flag, true iff this is a "maximum" __sentinel. */
bool _M_sup;
- /** @brief __index of the _M_source __sequence. */
+ /** @brief __index of the __source __sequence. */
int _M_source;
/** @brief _M_key of the element in the _LoserTree. */
_Tp _M_key;
@@ -99,7 +99,7 @@ public:
_M_ik = __k;
// Compute log_2{_M_k} for the _Loser Tree
- _M_log_k = __log2(_M_ik - 1) + 1;
+ _M_log_k = __rd_log2(_M_ik - 1) + 1;
// Next greater power of 2.
_M_k = 1 << _M_log_k;
@@ -124,7 +124,7 @@ public:
* @brief Initializes the sequence "_M_source" with the element "_M_key".
*
* @param _M_key the element to insert
- * @param _M_source __index of the _M_source __sequence
+ * @param _M_source __index of the __source __sequence
* @param _M_sup flag that determines whether the value to insert is an
* explicit __supremum.
*/
@@ -265,7 +265,7 @@ public:
{}
/**
- * Computes the winner of the competition at __position "__root".
+ * Computes the winner of the competition at position "__root".
*
* Called recursively (starting at 0) to build the initial tree.
*
@@ -365,7 +365,7 @@ public:
_M_ik = __k;
// Next greater power of 2.
- _M_k = 1 << (__log2(_M_ik - 1) + 1);
+ _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
_M_offset = _M_k;
_M_losers = new _Loser[_M_k * 2];
for (unsigned int __i = _M_ik - 1; __i < _M_k; __i++)
@@ -580,7 +580,7 @@ public:
_M_ik = __k;
// Next greater power of 2.
- _M_k = 1 << (__log2(_M_ik - 1) + 1);
+ _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
_M_offset = _M_k;
// Avoid default-constructing _M_losers[]._M_key
_M_losers
@@ -789,7 +789,7 @@ public:
};
/** @brief Unguarded loser tree, keeping only pointers to the
-* __elements in the tree structure.
+* elements in the tree structure.
*
* No guarding is done, therefore not a single input sequence must
* run empty. This is a very fast variant.
@@ -818,7 +818,7 @@ public:
_M_ik = __k;
// Next greater power of 2.
- _M_k = 1 << (__log2(_M_ik - 1) + 1);
+ _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
_M_offset = _M_k;
// Avoid default-constructing _M_losers[]._M_key
_M_losers = new _Loser[2 * _M_k];
@@ -859,7 +859,7 @@ public:
* Unstable variant is implemented below using partial specialization.
*/
template<bool __stable/* default == true */, typename _Tp, typename _Compare>
-class LoserTreePointerUnguarded :
+class _LoserTreePointerUnguarded :
public LoserTreePointerUnguardedBase<_Tp, _Compare>
{
typedef LoserTreePointerUnguardedBase<_Tp, _Compare> Base;
@@ -867,7 +867,7 @@ class LoserTreePointerUnguarded :
using Base::_M_losers;
public:
- LoserTreePointerUnguarded(unsigned int __k, const _Tp& _sentinel,
+ _LoserTreePointerUnguarded(unsigned int __k, const _Tp& _sentinel,
_Compare __comp = std::less<_Tp>())
: Base::LoserTreePointerUnguardedBase(__k, _sentinel, __comp)
{}
@@ -943,7 +943,7 @@ public:
* Stable variant is above.
*/
template<typename _Tp, typename _Compare>
-class LoserTreePointerUnguarded</* __stable == */false, _Tp, _Compare> :
+class _LoserTreePointerUnguarded</* __stable == */false, _Tp, _Compare> :
public LoserTreePointerUnguardedBase<_Tp, _Compare>
{
typedef LoserTreePointerUnguardedBase<_Tp, _Compare> Base;
@@ -951,7 +951,7 @@ class LoserTreePointerUnguarded</* __stable == */false, _Tp, _Compare> :
using Base::_M_losers;
public:
- LoserTreePointerUnguarded(unsigned int __k, const _Tp& _sentinel,
+ _LoserTreePointerUnguarded(unsigned int __k, const _Tp& _sentinel,
_Compare __comp = std::less<_Tp>())
: Base::LoserTreePointerUnguardedBase(__k, _sentinel, __comp)
{}
diff --git a/libstdc++-v3/include/parallel/merge.h b/libstdc++-v3/include/parallel/merge.h
index b2d8996ae5a..c323c629893 100644
--- a/libstdc++-v3/include/parallel/merge.h
+++ b/libstdc++-v3/include/parallel/merge.h
@@ -112,9 +112,9 @@ namespace __gnu_parallel
{
typedef _DifferenceTp _DifferenceType;
typedef typename std::iterator_traits<_RAIter1>::value_type
- value_type1;
+ _ValueType1;
typedef typename std::iterator_traits<_RAIter2>::value_type
- value_type2;
+ _ValueType2;
#if _GLIBCXX_ASSERTIONS
_GLIBCXX_PARALLEL_ASSERT(__max_length >= 0);
@@ -124,8 +124,8 @@ namespace __gnu_parallel
{
_RAIter1 __next1 = __begin1 + 1;
_RAIter2 __next2 = __begin2 + 1;
- value_type1 __element1 = *__begin1;
- value_type2 __element2 = *__begin2;
+ _ValueType1 __element1 = *__begin1;
+ _ValueType2 __element2 = *__begin2;
if (__comp(__element2, __element1))
{
diff --git a/libstdc++-v3/include/parallel/multiseq_selection.h b/libstdc++-v3/include/parallel/multiseq_selection.h
index 539695fc766..221470cc16c 100644
--- a/libstdc++-v3/include/parallel/multiseq_selection.h
+++ b/libstdc++-v3/include/parallel/multiseq_selection.h
@@ -103,15 +103,15 @@ namespace __gnu_parallel
};
/**
- * @brief Splits several sorted sequences at __a certain global __rank,
+ * @brief Splits several sorted sequences at a certain global __rank,
* resulting in a splitting point for each sequence.
- * The sequences are passed via __a __sequence of random-access
+ * The sequences are passed via a sequence of random-access
* iterator pairs, none of the sequences may be empty. If there
* are several equal elements across the split, the ones on the
* __left side will be chosen from sequences with smaller number.
* @param __begin_seqs Begin of the sequence of iterator pairs.
* @param __end_seqs End of the sequence of iterator pairs.
- * @param __rank The global __rank to partition at.
+ * @param __rank The global rank to partition at.
* @param __begin_offsets A random-access __sequence __begin where the
* __result will be stored in. Each element of the sequence is an
* iterator that points to the first element on the greater part of
@@ -181,7 +181,7 @@ namespace __gnu_parallel
__nmax = std::max(__nmax, __ns[__i]);
}
- __r = __log2(__nmax) + 1;
+ __r = __rd_log2(__nmax) + 1;
// Pad all lists to this length, at least as long as any ns[__i],
// equality iff __nmax = 2^__k - 1.
@@ -215,11 +215,12 @@ namespace __gnu_parallel
__sample.push_back(
std::make_pair(__S(__i)[0] /*__dummy element*/, __i));
- _DifferenceType localrank = __rank * __m / __N ;
+ _DifferenceType __localrank = __rank * __m / __N ;
int __j;
for (__j = 0;
- __j < localrank && ((__n + 1) <= __ns[__sample[__j].second]); ++__j)
+ __j < __localrank && ((__n + 1) <= __ns[__sample[__j].second]);
+ ++__j)
__a[__sample[__j].second] += __n + 1;
for (; __j < __m; __j++)
__b[__sample[__j].second] -= __n + 1;
@@ -288,15 +289,16 @@ namespace __gnu_parallel
for (; __skew != 0 && !__pq.empty(); --__skew)
{
- int source = __pq.top().second;
+ int __source = __pq.top().second;
__pq.pop();
- __a[source] = std::min(__a[source] + __n + 1, __ns[source]);
- __b[source] += __n + 1;
+ __a[__source]
+ = std::min(__a[__source] + __n + 1, __ns[__source]);
+ __b[__source] += __n + 1;
- if (__b[source] < __ns[source])
+ if (__b[__source] < __ns[__source])
__pq.push(
- std::make_pair(__S(source)[__b[source]], source));
+ std::make_pair(__S(__source)[__b[__source]], __source));
}
}
else if (__skew < 0)
@@ -312,15 +314,15 @@ namespace __gnu_parallel
for (; __skew != 0; ++__skew)
{
- int source = __pq.top().second;
+ int __source = __pq.top().second;
__pq.pop();
- __a[source] -= __n + 1;
- __b[source] -= __n + 1;
+ __a[__source] -= __n + 1;
+ __b[__source] -= __n + 1;
- if (__a[source] > 0)
- __pq.push(
- std::make_pair(__S(source)[__a[source] - 1], source));
+ if (__a[__source] > 0)
+ __pq.push(std::make_pair(
+ __S(__source)[__a[__source] - 1], __source));
}
}
}
@@ -373,14 +375,14 @@ namespace __gnu_parallel
/**
- * @brief Selects the element at __a certain global __rank from several
+ * @brief Selects the element at a certain global __rank from several
* sorted sequences.
*
- * The sequences are passed via __a __sequence of random-access
+ * The sequences are passed via a sequence of random-access
* iterator pairs, none of the sequences may be empty.
* @param __begin_seqs Begin of the sequence of iterator pairs.
* @param __end_seqs End of the sequence of iterator pairs.
- * @param __rank The global __rank to partition at.
+ * @param __rank The global rank to partition at.
* @param __offset The rank of the selected element in the global
* subsequence of elements equal to the selected element. If the
* selected element is unique, this number is 0.
@@ -434,7 +436,7 @@ namespace __gnu_parallel
__nmax = std::max(__nmax, __ns[__i]);
}
- __r = __log2(__nmax) + 1;
+ __r = __rd_log2(__nmax) + 1;
// Pad all lists to this length, at least as long as any ns[__i],
// equality iff __nmax = 2^__k - 1
@@ -470,11 +472,12 @@ namespace __gnu_parallel
__sample.push_back(
std::make_pair(__S(__i)[0] /*__dummy element*/, __i));
- _DifferenceType localrank = __rank * __m / __N ;
+ _DifferenceType __localrank = __rank * __m / __N ;
int __j;
for (__j = 0;
- __j < localrank && ((__n + 1) <= __ns[__sample[__j].second]); ++__j)
+ __j < __localrank && ((__n + 1) <= __ns[__sample[__j].second]);
+ ++__j)
__a[__sample[__j].second] += __n + 1;
for (; __j < __m; ++__j)
__b[__sample[__j].second] -= __n + 1;
@@ -533,15 +536,16 @@ namespace __gnu_parallel
for (; __skew != 0 && !__pq.empty(); --__skew)
{
- int source = __pq.top().second;
+ int __source = __pq.top().second;
__pq.pop();
- __a[source] = std::min(__a[source] + __n + 1, __ns[source]);
- __b[source] += __n + 1;
+ __a[__source]
+ = std::min(__a[__source] + __n + 1, __ns[__source]);
+ __b[__source] += __n + 1;
- if (__b[source] < __ns[source])
+ if (__b[__source] < __ns[__source])
__pq.push(
- std::make_pair(__S(source)[__b[source]], source));
+ std::make_pair(__S(__source)[__b[__source]], __source));
}
}
else if (__skew < 0)
@@ -557,15 +561,15 @@ namespace __gnu_parallel
for (; __skew != 0; ++__skew)
{
- int source = __pq.top().second;
+ int __source = __pq.top().second;
__pq.pop();
- __a[source] -= __n + 1;
- __b[source] -= __n + 1;
+ __a[__source] -= __n + 1;
+ __b[__source] -= __n + 1;
- if (__a[source] > 0)
- __pq.push(
- std::make_pair(__S(source)[__a[source] - 1], source));
+ if (__a[__source] > 0)
+ __pq.push(std::make_pair(
+ __S(__source)[__a[__source] - 1], __source));
}
}
}
@@ -615,7 +619,7 @@ namespace __gnu_parallel
}
}
- // Minright is the splitter, in any case.
+ // Minright is the __splitter, in any case.
if (!__maxleftset || __comp(__minright, __maxleft))
{
diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h
index b5540e71426..310a07a766c 100644
--- a/libstdc++-v3/include/parallel/multiway_merge.h
+++ b/libstdc++-v3/include/parallel/multiway_merge.h
@@ -75,7 +75,7 @@ template<typename _RAIter, typename _Compare>
/** @brief _Iterator wrapper supporting an implicit supremum at the end
* of the sequence, dominating all comparisons.
*
- * The implicit supremum comes with __a performance cost.
+ * The implicit supremum comes with a performance cost.
*
* Deriving from _RAIter is not possible since
* _RAIter need not be a class.
@@ -168,20 +168,20 @@ template<typename _RAIter, typename _Compare>
}
template<typename _RAIter, typename _Compare>
- class unguarded_iterator;
+ class _UnguardedIterator;
template<typename _RAIter, typename _Compare>
inline bool
- operator<(unguarded_iterator<_RAIter, _Compare>& __bi1,
- unguarded_iterator<_RAIter, _Compare>& __bi2);
+ operator<(_UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2);
template<typename _RAIter, typename _Compare>
inline bool
- operator<=(unguarded_iterator<_RAIter, _Compare>& __bi1,
- unguarded_iterator<_RAIter, _Compare>& __bi2);
+ operator<=(_UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2);
template<typename _RAIter, typename _Compare>
- class unguarded_iterator
+ class _UnguardedIterator
{
private:
/** @brief Current iterator __position. */
@@ -194,14 +194,14 @@ template<typename _RAIter, typename _Compare>
* @param __begin Begin iterator of sequence.
* @param _M_end Unused, only for compatibility.
* @param __comp Unused, only for compatibility. */
- unguarded_iterator(_RAIter __begin,
+ _UnguardedIterator(_RAIter __begin,
_RAIter _M_end, _Compare& __comp)
: _M_current(__begin), __comp(__comp)
{ }
/** @brief Pre-increment operator.
* @return This. */
- unguarded_iterator<_RAIter, _Compare>&
+ _UnguardedIterator<_RAIter, _Compare>&
operator++()
{
++_M_current;
@@ -221,13 +221,13 @@ template<typename _RAIter, typename _Compare>
friend bool
operator< <_RAIter, _Compare>(
- unguarded_iterator<_RAIter, _Compare>& __bi1,
- unguarded_iterator<_RAIter, _Compare>& __bi2);
+ _UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2);
friend bool
operator<= <_RAIter, _Compare>(
- unguarded_iterator<_RAIter, _Compare>& __bi1,
- unguarded_iterator<_RAIter, _Compare>& __bi2);
+ _UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2);
};
/** @brief Compare two elements referenced by unguarded iterators.
@@ -236,8 +236,8 @@ template<typename _RAIter, typename _Compare>
* @return @__c true if less. */
template<typename _RAIter, typename _Compare>
inline bool
- operator<(unguarded_iterator<_RAIter, _Compare>& __bi1,
- unguarded_iterator<_RAIter, _Compare>& __bi2)
+ operator<(_UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2)
{
// Normal compare.
return (__bi1.__comp)(*__bi1, *__bi2);
@@ -249,8 +249,8 @@ template<typename _RAIter, typename _Compare>
* @return @__c True if less equal. */
template<typename _RAIter, typename _Compare>
inline bool
- operator<=(unguarded_iterator<_RAIter, _Compare>& __bi1,
- unguarded_iterator<_RAIter, _Compare>& __bi2)
+ operator<=(_UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2)
{
// Normal compare.
return !(__bi1.__comp)(*__bi2, *__bi1);
@@ -266,7 +266,7 @@ template<typename _RAIter, typename _Compare>
*
* This works well for merging up to 4 sequences.
*
- * Note that making the merging stable does <em>not</em> come at __a
+ * Note that making the merging stable does <em>not</em> come at a
* performance hit.
*
* Whether the merging is done guarded or unguarded is selected by the
@@ -274,7 +274,7 @@ template<typename _RAIter, typename _Compare>
*
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, less equal than the
* total number of elements available.
@@ -386,7 +386,7 @@ template<template<typename RAI, typename C> class iterator,
*
* This works well for merging up to 4 sequences.
*
- * Note that making the merging stable does <em>not</em> come at __a
+ * Note that making the merging stable does <em>not</em> come at a
* performance hit.
*
* Whether the merging is done guarded or unguarded is selected by the
@@ -394,7 +394,7 @@ template<template<typename RAI, typename C> class iterator,
*
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, less equal than the
* total number of elements available.
@@ -510,15 +510,15 @@ template<template<typename RAI, typename C> class iterator,
/** @brief Multi-way merging procedure for a high branching factor,
* guarded case.
*
- * This merging variant uses __a LoserTree class as selected by <tt>LT</tt>.
+ * This merging variant uses a LoserTree class as selected by <tt>LT</tt>.
*
* Stability is selected through the used LoserTree class <tt>LT</tt>.
*
- * At least one non-empty __sequence is required.
+ * At least one non-empty sequence is required.
*
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, less equal than the
* total number of elements available.
@@ -569,21 +569,21 @@ template<typename LT,
__lt.__init();
- int source;
+ int __source;
for (_DifferenceType __i = 0; __i < __length; ++__i)
{
//take out
- source = __lt.__get_min_source();
+ __source = __lt.__get_min_source();
- *(__target++) = *(__seqs_begin[source].first++);
+ *(__target++) = *(__seqs_begin[__source].first++);
// Feed.
- if (__seqs_begin[source].first == __seqs_begin[source].second)
+ if (__seqs_begin[__source].first == __seqs_begin[__source].second)
__lt.__delete_min_insert(*__arbitrary_element, true);
else
- // Replace from same source.
- __lt.__delete_min_insert(*__seqs_begin[source].first, false);
+ // Replace from same __source.
+ __lt.__delete_min_insert(*__seqs_begin[__source].first, false);
}
return __target;
@@ -600,7 +600,7 @@ template<typename LT,
*
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, less equal than the
* total number of elements available.
@@ -646,7 +646,7 @@ template<typename LT,
__lt.__init();
- int source;
+ int __source;
#if _GLIBCXX_ASSERTIONS
_DifferenceType __i = 0;
@@ -656,22 +656,22 @@ template<typename LT,
while (__target < __target_end)
{
// Take out.
- source = __lt.__get_min_source();
+ __source = __lt.__get_min_source();
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(0 <= source && source < __k);
+ _GLIBCXX_PARALLEL_ASSERT(0 <= __source && __source < __k);
_GLIBCXX_PARALLEL_ASSERT(__i == 0
- || !__comp(*(__seqs_begin[source].first), *(__target - 1)));
+ || !__comp(*(__seqs_begin[__source].first), *(__target - 1)));
#endif
// Feed.
- *(__target++) = *(__seqs_begin[source].first++);
+ *(__target++) = *(__seqs_begin[__source].first++);
#if _GLIBCXX_ASSERTIONS
++__i;
#endif
- // Replace from same source.
- __lt.__delete_min_insert(*__seqs_begin[source].first, false);
+ // Replace from same __source.
+ __lt.__delete_min_insert(*__seqs_begin[__source].first, false);
}
return __target;
@@ -689,7 +689,7 @@ template<typename LT,
*
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, less equal than the
* total number of elements available.
@@ -726,7 +726,7 @@ template<
_RAIter3 __target_end;
for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
- // Move the sequends _M_end behind the sentinel spots. This has the
+ // Move the sequence ends to the sentinel. This has the
// effect that the sentinel appears to be within the sequence. Then,
// we can use the unguarded variant if we merge out as many
// non-sentinel elements as we have.
@@ -829,7 +829,7 @@ struct __multiway_merge_3_variant_sentinel_switch
_RAIter3 __target,
_DifferenceTp __length, _Compare __comp)
{
- return multiway_merge_3_variant<unguarded_iterator>(
+ return multiway_merge_3_variant<_UnguardedIterator>(
__seqs_begin, __seqs_end, __target, __length, __comp);
}
};
@@ -878,7 +878,7 @@ struct __multiway_merge_4_variant_sentinel_switch
_RAIter3 __target,
_DifferenceTp __length, _Compare __comp)
{
- return multiway_merge_4_variant<unguarded_iterator>(
+ return multiway_merge_4_variant<_UnguardedIterator>(
__seqs_begin, __seqs_end, __target, __length, __comp);
}
};
@@ -913,7 +913,7 @@ struct __multiway_merge_k_variant_sentinel_switch
return multiway_merge_loser_tree_sentinel<
typename __gnu_cxx::__conditional_type<
_LoserTreeTraits<_ValueType>::_M_use_pointer
- , LoserTreePointerUnguarded<__stable, _ValueType, _Compare>
+ , _LoserTreePointerUnguarded<__stable, _ValueType, _Compare>
, _LoserTreeUnguarded<__stable, _ValueType, _Compare>
>::__type>(
__seqs_begin, __seqs_end, __target, __sentinel, __length, __comp);
@@ -963,11 +963,11 @@ struct __multiway_merge_k_variant_sentinel_switch
* runtime settings.
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, possibly larger than the
* number of elements available.
- * @param __stable Stable merging incurs __a performance penalty.
+ * @param __stable Stable merging incurs a performance penalty.
* @param __sentinel The sequences have __a __sentinel element.
* @return End iterator of output sequence. */
template<
@@ -1267,15 +1267,15 @@ void multiway_merge_exact_splitting(
*
* Must not be called if the number of sequences is 1.
*
- * @param Splitter functor to split input (either __exact or sampling based)
+ * @param _Splitter functor to split input (either __exact or sampling based)
*
* @param __seqs_begin Begin iterator of iterator pair input sequence.
* @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of __output sequence.
+ * @param __target Begin iterator of output sequence.
* @param __comp Comparator.
* @param __length Maximum length to merge, possibly larger than the
* number of elements available.
- * @param __stable Stable merging incurs __a performance penalty.
+ * @param __stable Stable merging incurs a performance penalty.
* @param __sentinel Ignored.
* @return End iterator of output sequence.
*/
@@ -1285,14 +1285,14 @@ template<
typename _RAIterIterator,
typename _RAIter3,
typename _DifferenceTp,
- typename Splitter,
+ typename _Splitter,
typename _Compare
>
_RAIter3
parallel_multiway_merge(_RAIterIterator __seqs_begin,
_RAIterIterator __seqs_end,
_RAIter3 __target,
- Splitter splitter,
+ _Splitter __splitter,
_DifferenceTp __length,
_Compare __comp,
_ThreadIndex __num_threads)
@@ -1356,7 +1356,7 @@ template<
__gnu_parallel::_Settings::get().merge_oversampling *
__num_threads;
- splitter(__ne_seqs, __ne_seqs + __k, __length, __total_length,
+ __splitter(__ne_seqs, __ne_seqs + __k, __length, __total_length,
__comp, __pieces);
} //single
diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h
index 9f61ce305a2..c7f10ae7511 100644
--- a/libstdc++-v3/include/parallel/multiway_mergesort.h
+++ b/libstdc++-v3/include/parallel/multiway_mergesort.h
@@ -373,8 +373,8 @@ template<bool __stable, bool __exact, typename _RAIter,
typedef std::vector<
std::pair<_SortingPlacesIterator, _SortingPlacesIterator> >
- seq_vector_type;
- seq_vector_type seqs(__sd->_M_num_threads);
+ _SeqVector;
+ _SeqVector seqs(__sd->_M_num_threads);
for (int __s = 0; __s < __sd->_M_num_threads; ++__s)
{
@@ -386,7 +386,7 @@ template<bool __stable, bool __exact, typename _RAIter,
__possibly_stable_multiway_merge<
__stable,
- typename seq_vector_type::iterator,
+ typename _SeqVector::iterator,
_RAIter,
_Compare, _DifferenceType>()
(seqs.begin(), seqs.end(),
@@ -444,11 +444,11 @@ template<bool __stable, bool __exact, typename _RAIter,
if (!__exact)
{
- _DifferenceType size =
+ _DifferenceType __size =
(_Settings::get().sort_mwms_oversampling * __num_threads - 1)
* __num_threads;
__sd._M_samples = static_cast<_ValueType*>(
- ::operator new(size * sizeof(_ValueType)));
+ ::operator new(__size * sizeof(_ValueType)));
}
else
__sd._M_samples = NULL;
diff --git a/libstdc++-v3/include/parallel/numeric b/libstdc++-v3/include/parallel/numeric
index 5d03e679c27..06985ba99c9 100644
--- a/libstdc++-v3/include/parallel/numeric
+++ b/libstdc++-v3/include/parallel/numeric
@@ -98,7 +98,7 @@ __gnu_parallel::sequential_tag()); }
__gnu_parallel::__accumulate_selector<__RAIter>
__my_selector;
__gnu_parallel::
- for_each_template_random_access_ed(__begin, __end,
+ __for_each_template_random_access_ed(__begin, __end,
__gnu_parallel::_Nothing(),
__my_selector,
__gnu_parallel::
@@ -174,23 +174,24 @@ __gnu_parallel::sequential_tag()); }
__first1, __last1, __first2, __init); }
template<typename _IIter1, typename _IIter2, typename _Tp,
- typename BinaryFunction1, typename BinaryFunction2>
+ typename _BinaryFunction1, typename _BinaryFunction2>
inline _Tp
- inner_product(_IIter1 __first1, _IIter1 __last1,
- _IIter2 __first2, _Tp __init, BinaryFunction1 __binary_op1,
- BinaryFunction2 __binary_op2, __gnu_parallel::sequential_tag)
+ inner_product(_IIter1 __first1, _IIter1 __last1,
+ _IIter2 __first2, _Tp __init, _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2,
+ __gnu_parallel::sequential_tag)
{ return _GLIBCXX_STD_P::inner_product(__first1, __last1, __first2, __init,
__binary_op1, __binary_op2); }
// Parallel algorithm for random access iterators.
template<typename _RAIter1, typename _RAIter2,
- typename _Tp, typename BinaryFunction1, typename BinaryFunction2>
+ typename _Tp, typename _BinaryFunction1, typename _BinaryFunction2>
_Tp
__inner_product_switch(_RAIter1 __first1,
_RAIter1 __last1,
_RAIter2 __first2, _Tp __init,
- BinaryFunction1 __binary_op1,
- BinaryFunction2 __binary_op2,
+ _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2,
random_access_iterator_tag,
random_access_iterator_tag,
__gnu_parallel::_Parallelism __parallelism_tag
@@ -207,9 +208,9 @@ __gnu_parallel::sequential_tag()); }
__inner_product_selector<_RAIter1,
_RAIter2, _Tp> __my_selector(__first1, __first2);
__gnu_parallel::
- for_each_template_random_access_ed(__first1, __last1, __binary_op2,
- __my_selector, __binary_op1,
- __res, __res, -1);
+ __for_each_template_random_access_ed(
+ __first1, __last1, __binary_op2, __my_selector, __binary_op1,
+ __res, __res, -1);
return __res;
}
else
@@ -219,24 +220,24 @@ __gnu_parallel::sequential_tag()); }
// No parallelism for input iterators.
template<typename _IIter1, typename _IIter2, typename _Tp,
- typename BinaryFunction1, typename BinaryFunction2,
+ typename _BinaryFunction1, typename _BinaryFunction2,
typename _IteratorTag1, typename _IteratorTag2>
inline _Tp
__inner_product_switch(_IIter1 __first1, _IIter1 __last1,
_IIter2 __first2, _Tp __init,
- BinaryFunction1 __binary_op1,
- BinaryFunction2 __binary_op2,
+ _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2,
_IteratorTag1, _IteratorTag2)
{ return inner_product(__first1, __last1, __first2, __init,
__binary_op1, __binary_op2,
__gnu_parallel::sequential_tag()); }
template<typename _IIter1, typename _IIter2, typename _Tp,
- typename BinaryFunction1, typename BinaryFunction2>
+ typename _BinaryFunction1, typename _BinaryFunction2>
inline _Tp
inner_product(_IIter1 __first1, _IIter1 __last1,
- _IIter2 __first2, _Tp __init, BinaryFunction1 __binary_op1,
- BinaryFunction2 __binary_op2,
+ _IIter2 __first2, _Tp __init, _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2,
__gnu_parallel::_Parallelism __parallelism_tag)
{
typedef iterator_traits<_IIter1> _TraitsType1;
@@ -252,11 +253,11 @@ __gnu_parallel::sequential_tag()); }
}
template<typename _IIter1, typename _IIter2, typename _Tp,
- typename BinaryFunction1, typename BinaryFunction2>
+ typename _BinaryFunction1, typename _BinaryFunction2>
inline _Tp
inner_product(_IIter1 __first1, _IIter1 __last1,
- _IIter2 __first2, _Tp __init, BinaryFunction1 __binary_op1,
- BinaryFunction2 __binary_op2)
+ _IIter2 __first2, _Tp __init, _BinaryFunction1 __binary_op1,
+ _BinaryFunction2 __binary_op2)
{
typedef iterator_traits<_IIter1> _TraitsType1;
typedef typename _TraitsType1::iterator_category _IteratorCategory1;
@@ -275,18 +276,18 @@ __gnu_parallel::sequential_tag()); }
_IIter2 __first2, _Tp __init,
__gnu_parallel::_Parallelism __parallelism_tag)
{
- typedef iterator_traits<_IIter1> traits_type1;
- typedef typename traits_type1::value_type value_type1;
- typedef iterator_traits<_IIter2> traits_type2;
- typedef typename traits_type2::value_type value_type2;
+ typedef iterator_traits<_IIter1> _TraitsType1;
+ typedef typename _TraitsType1::value_type _ValueType1;
+ typedef iterator_traits<_IIter2> _TraitsType2;
+ typedef typename _TraitsType2::value_type _ValueType2;
typedef typename
- __gnu_parallel::_Multiplies<value_type1, value_type2>::__result
+ __gnu_parallel::_Multiplies<_ValueType1, _ValueType2>::__result
_MultipliesResultType;
return inner_product(__first1, __last1, __first2, __init,
__gnu_parallel::_Plus<_Tp, _MultipliesResultType>(),
__gnu_parallel::
- _Multiplies<value_type1, value_type2>(),
+ _Multiplies<_ValueType1, _ValueType2>(),
__parallelism_tag);
}
@@ -295,18 +296,18 @@ __gnu_parallel::sequential_tag()); }
inner_product(_IIter1 __first1, _IIter1 __last1,
_IIter2 __first2, _Tp __init)
{
- typedef iterator_traits<_IIter1> traits_type1;
- typedef typename traits_type1::value_type value_type1;
- typedef iterator_traits<_IIter2> traits_type2;
- typedef typename traits_type2::value_type value_type2;
+ typedef iterator_traits<_IIter1> _TraitsType1;
+ typedef typename _TraitsType1::value_type _ValueType1;
+ typedef iterator_traits<_IIter2> _TraitsType2;
+ typedef typename _TraitsType2::value_type _ValueType2;
typedef typename
- __gnu_parallel::_Multiplies<value_type1, value_type2>::__result
+ __gnu_parallel::_Multiplies<_ValueType1, _ValueType2>::__result
_MultipliesResultType;
return inner_product(__first1, __last1, __first2, __init,
__gnu_parallel::_Plus<_Tp, _MultipliesResultType>(),
__gnu_parallel::
- _Multiplies<value_type1, value_type2>());
+ _Multiplies<_ValueType1, _ValueType2>());
}
// Sequential fallback.
@@ -368,8 +369,8 @@ __gnu_parallel::sequential_tag()); }
partial_sum(_IIter __begin, _IIter __end, _OutputIterator __result,
_BinaryOperation __binary_op)
{
- typedef iterator_traits<_IIter> traitsi_type;
- typedef typename traitsi_type::iterator_category _IIteratorCategory;
+ typedef iterator_traits<_IIter> _ITraitsType;
+ typedef typename _ITraitsType::iterator_category _IIteratorCategory;
typedef iterator_traits<_OutputIterator> _OTraitsType;
typedef typename _OTraitsType::iterator_category _OIterCategory;
@@ -426,15 +427,14 @@ __gnu_parallel::sequential_tag()); }
typedef __gnu_parallel::_IteratorPair<_IIter, _OutputIterator,
random_access_iterator_tag> _ItTrip;
*__result = *__begin;
- _ItTrip begin_pair(__begin + 1, __result + 1),
- end_pair(__end, __result + (__end - __begin));
+ _ItTrip __begin_pair(__begin + 1, __result + 1),
+ __end_pair(__end, __result + (__end - __begin));
__gnu_parallel::__adjacent_difference_selector<_ItTrip>
__functionality;
__gnu_parallel::
- for_each_template_random_access_ed(begin_pair, end_pair, __bin_op,
- __functionality,
- __gnu_parallel::_DummyReduct(),
- __dummy, __dummy, -1);
+ __for_each_template_random_access_ed(
+ __begin_pair, __end_pair, __bin_op, __functionality,
+ __gnu_parallel::_DummyReduct(), __dummy, __dummy, -1);
return __functionality.finish_iterator;
}
else
@@ -474,8 +474,8 @@ __gnu_parallel::sequential_tag()); }
_OutputIterator __result, _BinaryOperation __binary_op,
__gnu_parallel::_Parallelism __parallelism_tag)
{
- typedef iterator_traits<_IIter> traitsi_type;
- typedef typename traitsi_type::iterator_category _IIteratorCategory;
+ typedef iterator_traits<_IIter> _ITraitsType;
+ typedef typename _ITraitsType::iterator_category _IIteratorCategory;
typedef iterator_traits<_OutputIterator> _OTraitsType;
typedef typename _OTraitsType::iterator_category _OIterCategory;
@@ -491,8 +491,8 @@ __gnu_parallel::sequential_tag()); }
adjacent_difference(_IIter __begin, _IIter __end,
_OutputIterator __result, _BinaryOperation __binary_op)
{
- typedef iterator_traits<_IIter> traitsi_type;
- typedef typename traitsi_type::iterator_category _IIteratorCategory;
+ typedef iterator_traits<_IIter> _ITraitsType;
+ typedef typename _ITraitsType::iterator_category _IIteratorCategory;
typedef iterator_traits<_OutputIterator> _OTraitsType;
typedef typename _OTraitsType::iterator_category _OIterCategory;
diff --git a/libstdc++-v3/include/parallel/numericfwd.h b/libstdc++-v3/include/parallel/numericfwd.h
index e8d887be05c..bb6a9bd0612 100644
--- a/libstdc++-v3/include/parallel/numericfwd.h
+++ b/libstdc++-v3/include/parallel/numericfwd.h
@@ -157,7 +157,7 @@ namespace __parallel
template<typename _RAIter1, typename _RAIter2, typename _Tp,
typename BinaryFunction1, typename BinaryFunction2>
_Tp
- __inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, BinaryFunction1,
+ __inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, BinaryFunction1,
BinaryFunction2, random_access_iterator_tag,
random_access_iterator_tag,
__gnu_parallel::_Parallelism
diff --git a/libstdc++-v3/include/parallel/omp_loop.h b/libstdc++-v3/include/parallel/omp_loop.h
index 7147961df98..2424bfbdde8 100644
--- a/libstdc++-v3/include/parallel/omp_loop.h
+++ b/libstdc++-v3/include/parallel/omp_loop.h
@@ -44,14 +44,14 @@ namespace __gnu_parallel
/** @brief Embarrassingly parallel algorithm for random access
* iterators, using an OpenMP for loop.
*
- * @param __begin Begin iterator of element __sequence.
- * @param __end End iterator of element __sequence.
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
* @param __o User-supplied functor (comparator, predicate, adding
* functor, etc.).
* @param __f Functor to "process" an element with __op (depends on
* desired functionality, e. g. for std::for_each(), ...).
* @param __r Functor to "add" a single __result to the already
- * processed __elements (depends on functionality).
+ * processed elements (depends on functionality).
* @param __base Base value for reduction.
* @param __output Pointer to position where final result is written to
* @param __bound Maximum number of elements processed (e. g. for
@@ -64,7 +64,7 @@ template<typename _RAIter,
typename _Red,
typename _Result>
_Op
- for_each_template_random_access_omp_loop(
+ __for_each_template_random_access_omp_loop(
_RAIter __begin, _RAIter __end, _Op __o, _Fu& __f, _Red __r,
_Result __base, _Result& __output,
typename std::iterator_traits<_RAIter>::difference_type __bound)
diff --git a/libstdc++-v3/include/parallel/omp_loop_static.h b/libstdc++-v3/include/parallel/omp_loop_static.h
index cc3443ba1a9..3d9ed841ac6 100644
--- a/libstdc++-v3/include/parallel/omp_loop_static.h
+++ b/libstdc++-v3/include/parallel/omp_loop_static.h
@@ -44,8 +44,8 @@ namespace __gnu_parallel
/** @brief Embarrassingly parallel algorithm for random access
* iterators, using an OpenMP for loop with static scheduling.
*
- * @param __begin Begin iterator of element __sequence.
- * @param __end End iterator of element __sequence.
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
* @param __o User-supplied functor (comparator, predicate, adding
* functor, ...).
* @param __f Functor to "process" an element with __op (depends on
@@ -64,7 +64,7 @@ template<typename _RAIter,
typename _Red,
typename _Result>
_Op
- for_each_template_random_access_omp_loop_static(
+ __for_each_template_random_access_omp_loop_static(
_RAIter __begin, _RAIter __end, _Op __o, _Fu& __f, _Red __r,
_Result __base, _Result& __output,
typename std::iterator_traits<_RAIter>::difference_type __bound)
diff --git a/libstdc++-v3/include/parallel/par_loop.h b/libstdc++-v3/include/parallel/par_loop.h
index 0a71831342e..c842364a6fd 100644
--- a/libstdc++-v3/include/parallel/par_loop.h
+++ b/libstdc++-v3/include/parallel/par_loop.h
@@ -45,14 +45,14 @@ namespace __gnu_parallel
* iterators, using hand-crafted parallelization by equal splitting
* the work.
*
- * @param __begin Begin iterator of element __sequence.
- * @param __end End iterator of element __sequence.
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
* @param __o User-supplied functor (comparator, predicate, adding
* functor, ...)
* @param __f Functor to "process" an element with __op (depends on
* desired functionality, e. g. for std::for_each(), ...).
* @param __r Functor to "add" a single __result to the already
- * processed __elements (depends on functionality).
+ * processed elements (depends on functionality).
* @param __base Base value for reduction.
* @param __output Pointer to position where final result is written to
* @param __bound Maximum number of elements processed (e. g. for
@@ -65,7 +65,7 @@ template<typename _RAIter,
typename _Red,
typename _Result>
_Op
- for_each_template_random_access_ed(
+ __for_each_template_random_access_ed(
_RAIter __begin, _RAIter __end, _Op __o, _Fu& __f, _Red __r,
_Result __base, _Result& __output,
typename std::iterator_traits<_RAIter>::difference_type __bound)
diff --git a/libstdc++-v3/include/parallel/partition.h b/libstdc++-v3/include/parallel/partition.h
index f50e83bbfd3..11362939fc8 100644
--- a/libstdc++-v3/include/parallel/partition.h
+++ b/libstdc++-v3/include/parallel/partition.h
@@ -114,13 +114,13 @@ template<typename _RAIter, typename _Predicate>
// Private.
_DifferenceType __thread_left, __thread_left_border,
- thread_right, __thread_right_border;
+ __thread_right, __thread_right_border;
__thread_left = __left + 1;
// Just to satisfy the condition below.
__thread_left_border = __thread_left - 1;
- thread_right = __n - 1;
- __thread_right_border = thread_right + 1;
+ __thread_right = __n - 1;
+ __thread_right_border = __thread_right + 1;
bool __iam_finished = false;
while (!__iam_finished)
@@ -139,14 +139,14 @@ template<typename _RAIter, typename _Predicate>
omp_unset_lock(&__result_lock);
}
- if (thread_right < __thread_right_border)
+ if (__thread_right < __thread_right_border)
{
omp_set_lock(&__result_lock);
if (__left > __right - (__chunk_size - 1))
__iam_finished = true;
else
{
- thread_right = __right;
+ __thread_right = __right;
__thread_right_border = __right - (__chunk_size - 1);
__right -= __chunk_size;
}
@@ -157,23 +157,23 @@ template<typename _RAIter, typename _Predicate>
break;
// Swap as usual.
- while (__thread_left < thread_right)
+ while (__thread_left < __thread_right)
{
while (__pred(__begin[__thread_left])
&& __thread_left <= __thread_left_border)
++__thread_left;
- while (!__pred(__begin[thread_right])
- && thread_right >= __thread_right_border)
- --thread_right;
+ while (!__pred(__begin[__thread_right])
+ && __thread_right >= __thread_right_border)
+ --__thread_right;
if (__thread_left > __thread_left_border
- || thread_right < __thread_right_border)
+ || __thread_right < __thread_right_border)
// Fetch new chunk(__s).
break;
- std::swap(__begin[__thread_left], __begin[thread_right]);
+ std::swap(__begin[__thread_left], __begin[__thread_right]);
++__thread_left;
- --thread_right;
+ --__thread_right;
}
}
@@ -181,7 +181,7 @@ template<typename _RAIter, typename _Predicate>
if (__thread_left <= __thread_left_border)
# pragma omp atomic
++__leftover_left;
- if (thread_right >= __thread_right_border)
+ if (__thread_right >= __thread_right_border)
# pragma omp atomic
++__leftover_right;
@@ -206,7 +206,7 @@ template<typename _RAIter, typename _Predicate>
}
// <=> __thread_right_border - (__chunk_size - 1) <= __rightnew
- if (thread_right >= __thread_right_border
+ if (__thread_right >= __thread_right_border
&& __thread_right_border <= __rightnew)
{
// Chunk already in place, reserve spot.
@@ -241,7 +241,7 @@ template<typename _RAIter, typename _Predicate>
__begin + __swapstart);
}
- if (thread_right >= __thread_right_border
+ if (__thread_right >= __thread_right_border
&& __thread_right_border > __rightnew)
{
// Find spot and swap
@@ -331,7 +331,7 @@ template<typename _RAIter, typename _Predicate>
*/
template<typename _RAIter, typename _Compare>
void
- parallel_nth_element(_RAIter __begin, _RAIter __nth,
+ __parallel_nth_element(_RAIter __begin, _RAIter __nth,
_RAIter __end, _Compare __comp)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
@@ -343,11 +343,11 @@ template<typename _RAIter, typename _Compare>
_RAIter __split;
_RandomNumber __rng;
- _DifferenceType minimum_length =
+ _DifferenceType __minimum_length =
std::max<_DifferenceType>(2, _Settings::get().partition_minimal_n);
// Break if input range to small.
- while (static_cast<_SequenceIndex>(__end - __begin) >= minimum_length)
+ while (static_cast<_SequenceIndex>(__end - __begin) >= __minimum_length)
{
_DifferenceType __n = __end - __begin;
@@ -358,12 +358,11 @@ template<typename _RAIter, typename _Compare>
std::swap(*__pivot_pos, *(__end - 1));
__pivot_pos = __end - 1;
- // XXX _Compare must have first__ValueType, second__ValueType,
- // _ResultType
- // _Compare == __gnu_parallel::_Lexicographic<S, int,
- // __gnu_parallel::_Less<S, S> >
+ // _Compare must have first_value_type, second_value_type,
+ // result_type
+ // _Compare ==
+ // __gnu_parallel::_Lexicographic<S, int, __gnu_parallel::_Less<S, S> >
// __pivot_pos == std::pair<S, int>*
- // XXX binder2nd only for _RAIters??
__gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool>
__pred(__comp, *__pivot_pos);
@@ -419,11 +418,11 @@ template<typename _RAIter, typename _Compare>
* @param __comp Comparator. */
template<typename _RAIter, typename _Compare>
void
- parallel_partial_sort(_RAIter __begin,
+ __parallel_partial_sort(_RAIter __begin,
_RAIter __middle,
_RAIter __end, _Compare __comp)
{
- parallel_nth_element(__begin, __middle, __end, __comp);
+ __parallel_nth_element(__begin, __middle, __end, __comp);
std::sort(__begin, __middle, __comp);
}
diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h
index 49d0d8557b7..cb6d4278b85 100644
--- a/libstdc++-v3/include/parallel/random_shuffle.h
+++ b/libstdc++-v3/include/parallel/random_shuffle.h
@@ -55,7 +55,7 @@ template<typename _RAIter>
typedef typename _TraitsType::value_type _ValueType;
typedef typename _TraitsType::difference_type _DifferenceType;
- /** @brief Begin iterator of the _M_source. */
+ /** @brief Begin iterator of the __source. */
_RAIter& _M_source;
/** @brief Temporary arrays for each thread. */
@@ -80,14 +80,14 @@ template<typename _RAIter>
int _M_num_bits;
/** @brief Constructor. */
- _DRandomShufflingGlobalData(_RAIter& _source)
- : _M_source(_source) { }
+ _DRandomShufflingGlobalData(_RAIter& __source)
+ : _M_source(__source) { }
};
/** @brief Local data for a thread participating in
__gnu_parallel::__parallel_random_shuffle().
*/
-template<typename _RAIter, typename RandomNumberGenerator>
+template<typename _RAIter, typename _RandomNumberGenerator>
struct _DRSSorterPU
{
/** @brief Number of threads participating in total. */
@@ -110,24 +110,24 @@ template<typename _RAIter, typename RandomNumberGenerator>
* @param logp Logarithm (basis 2) of the upper range __bound.
* @param __rng Random number generator to use.
*/
-template<typename RandomNumberGenerator>
+template<typename _RandomNumberGenerator>
inline int
- __random_number_pow2(int logp, RandomNumberGenerator& __rng)
+ __random_number_pow2(int logp, _RandomNumberGenerator& __rng)
{ return __rng.__genrand_bits(logp); }
/** @brief Random shuffle code executed by each thread.
* @param __pus Array of thread-local data records. */
-template<typename _RAIter, typename RandomNumberGenerator>
+template<typename _RAIter, typename _RandomNumberGenerator>
void
__parallel_random_shuffle_drs_pu(_DRSSorterPU<_RAIter,
- RandomNumberGenerator>* __pus)
+ _RandomNumberGenerator>* __pus)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
typedef typename _TraitsType::difference_type _DifferenceType;
_ThreadIndex __iam = omp_get_thread_num();
- _DRSSorterPU<_RAIter, RandomNumberGenerator>* d = &__pus[__iam];
+ _DRSSorterPU<_RAIter, _RandomNumberGenerator>* d = &__pus[__iam];
_DRandomShufflingGlobalData<_RAIter>* _M_sd = d->_M_sd;
// Indexing: _M_dist[bin][processor]
@@ -248,7 +248,7 @@ template<typename _Tp>
if (__x <= 1)
return 1;
else
- return (_Tp)1 << (__log2(__x - 1) + 1);
+ return (_Tp)1 << (__rd_log2(__x - 1) + 1);
}
/** @brief Main parallel random shuffle step.
@@ -258,14 +258,14 @@ template<typename _Tp>
* @param __num_threads Number of threads to use.
* @param __rng Random number generator to use.
*/
-template<typename _RAIter, typename RandomNumberGenerator>
+template<typename _RAIter, typename _RandomNumberGenerator>
void
__parallel_random_shuffle_drs(_RAIter __begin,
_RAIter __end,
typename std::iterator_traits
<_RAIter>::difference_type __n,
_ThreadIndex __num_threads,
- RandomNumberGenerator& __rng)
+ _RandomNumberGenerator& __rng)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
@@ -352,7 +352,7 @@ template<typename _RAIter, typename RandomNumberGenerator>
= new _DifferenceType[__num_threads + 1];
int bin_cursor = 0;
_M_sd._M_num_bins = _M_num_bins;
- _M_sd._M_num_bits = __log2(_M_num_bins);
+ _M_sd._M_num_bits = __rd_log2(_M_num_bins);
_DifferenceType __chunk_length = __n / __num_threads,
__split = __n % __num_threads, __start = 0;
@@ -396,11 +396,11 @@ template<typename _RAIter, typename RandomNumberGenerator>
* @param __end End iterator of sequence.
* @param __rng Random number generator to use.
*/
-template<typename _RAIter, typename RandomNumberGenerator>
+template<typename _RAIter, typename _RandomNumberGenerator>
void
__sequential_random_shuffle(_RAIter __begin,
_RAIter __end,
- RandomNumberGenerator& __rng)
+ _RandomNumberGenerator& __rng)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
@@ -451,7 +451,7 @@ template<typename _RAIter, typename RandomNumberGenerator>
}
#endif
- int _M_num_bits = __log2(_M_num_bins);
+ int _M_num_bits = __rd_log2(_M_num_bins);
if (_M_num_bins > 1)
{
@@ -511,11 +511,11 @@ template<typename _RAIter, typename RandomNumberGenerator>
* @param __end End iterator of sequence.
* @param __rng Random number generator to use.
*/
-template<typename _RAIter, typename RandomNumberGenerator>
+template<typename _RAIter, typename _RandomNumberGenerator>
inline void
__parallel_random_shuffle(_RAIter __begin,
_RAIter __end,
- RandomNumberGenerator __rng = _RandomNumber())
+ _RandomNumberGenerator __rng = _RandomNumber())
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::difference_type _DifferenceType;
diff --git a/libstdc++-v3/include/parallel/search.h b/libstdc++-v3/include/parallel/search.h
index a253126d90a..1fc8ceaa5c8 100644
--- a/libstdc++-v3/include/parallel/search.h
+++ b/libstdc++-v3/include/parallel/search.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/** @file parallel/search.h
- * @brief Parallel implementation __base for std::search() and
+ * @brief Parallel implementation base for std::search() and
* std::search_n().
* This file is a GNU parallel extension to the Standard C++ Library.
*/
diff --git a/libstdc++-v3/include/parallel/sort.h b/libstdc++-v3/include/parallel/sort.h
index 03b19210a82..2d38cad4d96 100644
--- a/libstdc++-v3/include/parallel/sort.h
+++ b/libstdc++-v3/include/parallel/sort.h
@@ -58,7 +58,7 @@ namespace __gnu_parallel
template<bool __stable, typename _RAIter,
typename _Compare, typename _Parallelism>
void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, _Parallelism __parallelism);
/**
@@ -71,7 +71,7 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, multiway_mergesort_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
@@ -94,7 +94,7 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, multiway_mergesort_exact_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
@@ -113,7 +113,7 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, multiway_mergesort_sampling_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
@@ -131,7 +131,7 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, quicksort_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
@@ -152,7 +152,7 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, balanced_quicksort_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
@@ -174,12 +174,12 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, default_parallel_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
- parallel_sort<__stable>
+ __parallel_sort<__stable>
(__begin, __end, __comp,
multiway_mergesort_exact_tag(__parallelism.__get_num_threads()));
}
@@ -195,7 +195,7 @@ namespace __gnu_parallel
*/
template<bool __stable, typename _RAIter, typename _Compare>
inline void
- parallel_sort(_RAIter __begin, _RAIter __end,
+ __parallel_sort(_RAIter __begin, _RAIter __end,
_Compare __comp, parallel_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
diff --git a/libstdc++-v3/include/parallel/workstealing.h b/libstdc++-v3/include/parallel/workstealing.h
index ca6eb0cc4d3..638057ca740 100644
--- a/libstdc++-v3/include/parallel/workstealing.h
+++ b/libstdc++-v3/include/parallel/workstealing.h
@@ -74,16 +74,16 @@ template<typename _DifferenceTp>
/** @brief Work stealing algorithm for random access iterators.
*
- * Uses O(1) additional memory. Synchronization at __job lists is
+ * Uses O(1) additional memory. Synchronization at job lists is
* done with atomic operations.
- * @param __begin Begin iterator of element __sequence.
- * @param __end End iterator of element __sequence.
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
* @param __op User-supplied functor (comparator, predicate, adding
* functor, ...).
* @param __f Functor to "process" an element with __op (depends on
* desired functionality, e. g. for std::for_each(), ...).
* @param __r Functor to "add" a single __result to the already
- * processed __elements (depends on functionality).
+ * processed elements (depends on functionality).
* @param __base Base value for reduction.
* @param __output Pointer to position where final result is written to
* @param __bound Maximum number of elements processed (e. g. for
@@ -96,7 +96,7 @@ template<typename _RAIter,
typename _Red,
typename _Result>
_Op
- for_each_template_random_access_workstealing(
+ __for_each_template_random_access_workstealing(
_RAIter __begin, _RAIter __end, _Op __op, _Fu& __f, _Red __r,
_Result __base, _Result& __output,
typename std::iterator_traits<_RAIter>::difference_type __bound)
@@ -209,21 +209,21 @@ template<typename _RAIter,
{
// fetch-and-add call
// Reserve current job block (size __chunk_size) in my queue.
- _DifferenceType current_job =
+ _DifferenceType __current_job =
__fetch_and_add<_DifferenceType>(
&(__my_job._M_first), __chunk_size);
// Update _M_load, to make the three values consistent,
// _M_first might have been changed in the meantime
__my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
- for (_DifferenceType job_counter = 0;
- job_counter < __chunk_size
- && current_job <= __my_job._M_last;
- ++job_counter)
+ for (_DifferenceType __job_counter = 0;
+ __job_counter < __chunk_size
+ && __current_job <= __my_job._M_last;
+ ++__job_counter)
{
// Yes: process it!
- __current = __begin + current_job;
- ++current_job;
+ __current = __begin + __current_job;
+ ++__current_job;
// Do actual work.
__result = __r(__result, __f(__op, __current));
@@ -271,12 +271,12 @@ template<typename _RAIter,
_DifferenceType __stolen_first =
__fetch_and_add<_DifferenceType>(
&(__job[__victim * __stride]._M_first), __steal);
- _DifferenceType stolen_try =
+ _DifferenceType __stolen_try =
__stolen_first + __steal - _DifferenceType(1);
__my_job._M_first = __stolen_first;
__my_job._M_last =
- __gnu_parallel::min(stolen_try, __supposed_last);
+ __gnu_parallel::min(__stolen_try, __supposed_last);
__my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
// Has potential work again.